PageSourceSearch

https://semsa.ch/assets/index-CTxZmTc0.js

js semsa.ch collected 2026-10-04 07:42:20 UTC 1,266,878 bytes, 563 lines download raw bytes

vendor: 6,687 bytes, lines 1-9
1var lb=e=>{throw TypeError(e)};var np=(e,t,n)=>t.has(e)||lb("Cannot "+n);var ce=(e,t,n)=>(np(e,t,"read from private field"),n?n.call(e):t.get(e)),_t=(e,t,n)=>t.has(e)?lb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),tt=(e,t,n,s)=>(np(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),Bn=(e,t,n)=>(np(e,t,"access private method"),n);var Ou=(e,t,n,s)=>({set _(a){tt(e,t,a,n)},get _(){return ce(e,t,s)}});function sP(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(s,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),n}var M_={exports:{}},Hh={},D_={exports:{}},ft={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Qd=Symbol.for("react.element"),iP=Symbol.for("react.portal"),oP=Symbol.for("react.fragment"),lP=Symbol.for("react.strict_mode"),cP=Symbol.for("react.profiler"),dP=Symbol.for("react.provider"),uP=Symbol.for("react.context"),mP=Symbol.for("react.forward_ref"),hP=Symbol.for("react.suspense"),fP=Symbol.for("react.memo"),pP=Symbol.for("react.lazy"),cb=Symbol.iterator;function gP(e){return e===null||typeof e!="object"?null:(e=cb&&e[cb]||e["@@iterator"],typeof e=="function"?e:null)}var O_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I_=Object.assign,L_={};function ql(e,t,n){this.props=e,this.context=t,this.refs=L_,this.updater=n||O_}ql.prototype.isReactComponent={};ql.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F_(){}F_.prototype=ql.prototype;function Cv(e,t,n){this.props=e,this.context=t,this.refs=L_,this.updater=n||O_}var Av=Cv.prototype=new F_;Av.constructor=Cv;I_(Av,ql.prototype);Av.isPureReactComponent=!0;var db=Array.isArray,$_=Object.prototype.hasOwnProperty,Ev={current:null},z_={key:!0,ref:!0,__self:!0,__source:!0};function U_(e,t,n){var s,a={},i=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)$_.call(t,s)&&!z_.hasOwnProperty(s)&&(a[s]=t[s]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)a[s]===void 0&&(a[s]=l[s]);return{$$typeof:Qd,type:e,key:i,ref:o,props:a,_owner:Ev.current}}function xP(e,t){return{$$typeof:Qd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Tv(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qd}function vP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ub=/\/+/g;function rp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vP(""+e.key):t.toString(36)}function bm(e,t,n,s,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Qd:case iP:o=!0}}if(o)return o=e,a=a(o),e=s===""?"."+rp(o,0):s,db(a)?(n="",e!=null&&(n=e.replace(ub,"$&/")+"/"),bm(a,t,n,"",function(d){return d})):a!=null&&(Tv(a)&&(a=xP(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(ub,"$&/")+"/")+e)),t.push(a)),1;if(o=0,s=s===""?".":s+":",db(e))for(var l=0;l<e.length;l++){i=e[l];var c=s+rp(i,l);o+=bm(i,t,n,c,a)}else if(c=gP(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=s+rp(i,l++),o+=bm(i,t,n,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Iu(e,t,n){if(e==null)return e;var s=[],a=0;return bm(e,s,"","",function(i){return t.call(n,i,a++)}),s}function yP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var or={current:null},jm={transition:null},wP={ReactCurrentDispatcher:or,ReactCurrentBatchConfig:jm,ReactCurrentOwner:Ev};function B_(){throw Error("act(...) is not supported in production builds of React.")}ft.Children={map:Iu,forEach:function(e,t,n){Iu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Iu(e,function(){t++}),t},toArray:function(e){return Iu(e,function(t){return t})||[]},only:function(e){if(!Tv(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ft.Component=ql;ft.Fragment=oP;ft.Profiler=cP;ft.PureComponent=Cv;ft.StrictMode=lP;ft.Suspense=hP;
vendor: 3,909 bytes, lines 9-25
9ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wP;ft.act=B_;ft.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=I_({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Ev.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)$_.call(t,c)&&!z_.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];s.children=l}return{$$typeof:Qd,type:e.type,key:a,ref:i,props:s,_owner:o}};ft.createContext=function(e){return e={$$typeof:uP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:dP,_context:e},e.Consumer=e};ft.createElement=U_;ft.createFactory=function(e){var t=U_.bind(null,e);return t.type=e,t};ft.createRef=function(){return{current:null}};ft.forwardRef=function(e){return{$$typeof:mP,render:e}};ft.isValidElement=Tv;ft.lazy=function(e){return{$$typeof:pP,_payload:{_status:-1,_result:e},_init:yP}};ft.memo=function(e,t){return{$$typeof:fP,type:e,compare:t===void 0?null:t}};ft.startTransition=function(e){var t=jm.transition;jm.transition={};try{e()}finally{jm.transition=t}};ft.unstable_act=B_;ft.useCallback=function(e,t){return or.current.useCallback(e,t)};ft.useContext=function(e){return or.current.useContext(e)};ft.useDebugValue=function(){};ft.useDeferredValue=function(e){return or.current.useDeferredValue(e)};ft.useEffect=function(e,t){return or.current.useEffect(e,t)};ft.useId=function(){return or.current.useId()};ft.useImperativeHandle=function(e,t,n){return or.current.useImperativeHandle(e,t,n)};ft.useInsertionEffect=function(e,t){return or.current.useInsertionEffect(e,t)};ft.useLayoutEffect=function(e,t){return or.current.useLayoutEffect(e,t)};ft.useMemo=function(e,t){return or.current.useMemo(e,t)};ft.useReducer=function(e,t,n){return or.current.useReducer(e,t,n)};ft.useRef=function(e){return or.current.useRef(e)};ft.useState=function(e){return or.current.useState(e)};ft.useSyncExternalStore=function(e,t,n){return or.current.useSyncExternalStore(e,t,n)};ft.useTransition=function(){return or.current.useTransition()};ft.version="18.3.1";D_.exports=ft;var m=D_.exports;const Z=R_(m),bP=sP({__proto__:null,default:Z},[m]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var jP=m,_P=Symbol.for("react.element"),NP=Symbol.for("react.fragment"),SP=Object.prototype.hasOwnProperty,kP=jP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,CP={key:!0,ref:!0,__self:!0,__source:!0};function H_(e,t,n){var s,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)SP.call(t,s)&&!CP.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)a[s]===void 0&&(a[s]=t[s]);return{$$typeof:_P,type:e,key:i,ref:o,props:a,_owner:kP.current}}Hh.Fragment=NP;Hh.jsx=H_;Hh.jsxs=H_;M_.exports=Hh;var r=M_.exports,W_={exports:{}},Fr={},q_={exports:{}},V_={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(C,D){var F=C.length;C.push(D);e:for(;0<F;){var T=F-1>>>1,q=C[T];if(0<a(q,D))C[T]=D,C[F]=q,F=T;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var D=C[0],F=C.pop();if(F!==D){C[0]=F;e:for(var T=0,q=C.length,I=q>>>1;T<I;){var Y=2*(T+1)-1,ie=C[Y],se=Y+1,pe=C[se];
vendor: 1,066 bytes, line 25
25if(0>a(ie,F))se<q&&0>a(pe,ie)?(C[T]=pe,C[se]=F,T=se):(C[T]=ie,C[Y]=F,T=Y);else if(se<q&&0>a(pe,F))C[T]=pe,C[se]=F,T=se;else break e}}return D}function a(C,D){var F=C.sortIndex-D.sortIndex;return F!==0?F:C.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,h=null,f=3,p=!1,w=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(C){for(var D=n(d);D!==null;){if(D.callback===null)s(d);else if(D.startTime<=C)s(d),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(d)}}function j(C){if(v=!1,y(C),!w)if(n(c)!==null)w=!0,S(N);else{var D=n(d);D!==null&&L(j,D.startTime-C)}}function N(C,D){w=!1,v&&(v=!1,x(P),P=-1),p=!0;var F=f;
vendor: 9,235 bytes, lines 25-34
25try{for(y(D),h=n(c);h!==null&&(!(h.expirationTime>D)||C&&!O());){var T=h.callback;if(typeof T=="function"){h.callback=null,f=h.priorityLevel;var q=T(h.expirationTime<=D);D=e.unstable_now(),typeof q=="function"?h.callback=q:h===n(c)&&s(c),y(D)}else s(c);h=n(c)}if(h!==null)var I=!0;else{var Y=n(d);Y!==null&&L(j,Y.startTime-D),I=!1}return I}finally{h=null,f=F,p=!1}}var k=!1,_=null,P=-1,$=5,M=-1;function O(){return!(e.unstable_now()-M<$)}function A(){if(_!==null){var C=e.unstable_now();M=C;var D=!0;try{D=_(!0,C)}finally{D?U():(k=!1,_=null)}}else k=!1}var U;if(typeof g=="function")U=function(){g(A)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,E=W.port2;W.port1.onmessage=A,U=function(){E.postMessage(null)}}else U=function(){b(A,0)};function S(C){_=C,k||(k=!0,U())}function L(C,D){P=b(function(){C(e.unstable_now())},D)}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(C){C.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,S(N))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var D=3;break;default:D=f}var F=f;f=D;try{return C()}finally{f=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,D){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var F=f;f=C;try{return D()}finally{f=F}},e.unstable_scheduleCallback=function(C,D,F){var T=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?T+F:T):F=T,C){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=F+q,C={id:u++,callback:D,priorityLevel:C,startTime:F,expirationTime:q,sortIndex:-1},F>T?(C.sortIndex=F,t(d,C),n(c)===null&&C===n(d)&&(v?(x(P),P=-1):v=!0,L(j,F-T))):(C.sortIndex=q,t(c,C),w||p||(w=!0,S(N))),C},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(C){var D=f;return function(){var F=f;f=D;try{return C.apply(this,arguments)}finally{f=F}}}})(V_);q_.exports=V_;var AP=q_.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var EP=m,Ir=AP;function ve(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Y_=new Set,ad={};function xo(e,t){Al(e,t),Al(e+"Capture",t)}function Al(e,t){for(ad[e]=t,e=0;e<t.length;e++)Y_.add(t[e])}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mg=Object.prototype.hasOwnProperty,TP=/^[: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]*$/,mb={},hb={};function PP(e){return Mg.call(hb,e)?!0:Mg.call(mb,e)?!1:TP.test(e)?hb[e]=!0:(mb[e]=!0,!1)}function RP(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function MP(e,t,n,s){if(t===null||typeof t>"u"||RP(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function lr(e,t,n,s,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var zn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){zn[e]=new lr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];zn[t]=new lr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){zn[e]=new lr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){zn[e]=new lr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){zn[e]=new lr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){zn[e]=new lr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){zn[e]=new lr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){zn[e]=new lr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){zn[e]=new lr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pv=/[\-:]([a-z])/g;function Rv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pv,Rv);zn[t]=new lr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pv,Rv);zn[t]=new lr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pv,Rv);zn[t]=new lr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){zn[e]=new lr(e,1,!1,e.toLowerCase(),null,!1,!1)});zn.xlinkHref=new lr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){zn[e]=new lr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mv(e,t,n,s){var a=zn.hasOwnProperty(t)?zn[t]:null;(a!==null?a.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(MP(t,n,a,s)&&(n=null),s||a===null?PP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,s=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Aa=EP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Lu=Symbol.for("react.element"),Wo=Symbol.for("react.portal"),qo=Symbol.for("react.fragment"),Dv=Symbol.for("react.strict_mode"),Dg=Symbol.for("react.profiler"),G_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),Ov=Symbol.for("react.forward_ref"),Og=Symbol.for("react.suspense"),Ig=Symbol.for("react.suspense_list"),Iv=Symbol.for("react.memo"),Ua=Symbol.for("react.lazy"),Z_=Symbol.for("react.offscreen"),fb=Symbol.iterator;function hc(e){return e===null||typeof e!="object"?null:(e=fb&&e[fb]||e["@@iterator"],typeof e=="function"?e:null)}var Qt=Object.assign,sp;function Fc(e){if(sp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sp=t&&t[1]||""}return`
34`+sp+e}var ap=!1;function ip(e,t){if(!e||ap)return"";ap=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var s=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){s=d}e.call(t.prototype)}else{try{throw Error()}catch(d){s=d}e()}}
vendor: 14,694 bytes, lines 34-37
34catch(d){if(d&&s&&typeof d.stack=="string"){for(var a=d.stack.split(`
35`),i=s.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{ap=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fc(e):""}function DP(e){switch(e.tag){case 5:return Fc(e.type);case 16:return Fc("Lazy");case 13:return Fc("Suspense");case 19:return Fc("SuspenseList");case 0:case 2:case 15:return e=ip(e.type,!1),e;case 11:return e=ip(e.type.render,!1),e;case 1:return e=ip(e.type,!0),e;default:return""}}function Lg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qo:return"Fragment";case Wo:return"Portal";case Dg:return"Profiler";case Dv:return"StrictMode";case Og:return"Suspense";case Ig:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K_:return(e.displayName||"Context")+".Consumer";case G_:return(e._context.displayName||"Context")+".Provider";case Ov:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Iv:return t=e.displayName||null,t!==null?t:Lg(e.type)||"Memo";case Ua:t=e._payload,e=e._init;try{return Lg(e(t))}catch{}}return null}function OP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lg(t);case 8:return t===Dv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ui(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function X_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function IP(e){var t=X_(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fu(e){e._valueTracker||(e._valueTracker=IP(e))}function Q_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=X_(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Hm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Fg(e,t){var n=t.checked;return Qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pb(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=ui(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function J_(e,t){t=t.checked,t!=null&&Mv(e,"checked",t,!1)}function $g(e,t){J_(e,t);var n=ui(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zg(e,t.type,n):t.hasOwnProperty("defaultValue")&&zg(e,t.type,ui(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zg(e,t,n){(t!=="number"||Hm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $c=Array.isArray;function il(e,t,n,s){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ui(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,s&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Ug(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ve(91));return Qt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xb(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ve(92));if($c(n)){if(1<n.length)throw Error(ve(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ui(n)}}function eN(e,t){var n=ui(t.value),s=ui(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function vb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tN(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tN(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $u,nN=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for($u=$u||document.createElement("div"),$u.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=$u.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function id(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yc={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},LP=["Webkit","ms","Moz","O"];Object.keys(Yc).forEach(function(e){LP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yc[t]=Yc[e]})});function rN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yc.hasOwnProperty(e)&&Yc[e]?(""+t).trim():t+"px"}function sN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,a=rN(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,a):e[n]=a}}var FP=Qt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hg(e,t){if(t){if(FP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ve(62))}}function Wg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qg=null;function Lv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vg=null,ol=null,ll=null;function yb(e){if(e=tu(e)){if(typeof Vg!="function")throw Error(ve(280));var t=e.stateNode;t&&(t=Gh(t),Vg(e.stateNode,e.type,t))}}function aN(e){ol?ll?ll.push(e):ll=[e]:ol=e}function iN(){if(ol){var e=ol,t=ll;if(ll=ol=null,yb(e),t)for(e=0;e<t.length;e++)yb(t[e])}}function oN(e,t){return e(t)}function lN(){}var op=!1;function cN(e,t,n){if(op)return e(t,n);op=!0;try{return oN(e,t,n)}finally{op=!1,(ol!==null||ll!==null)&&(lN(),iN())}}function od(e,t){var n=e.stateNode;if(n===null)return null;var s=Gh(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ve(231,t,typeof n));return n}var Yg=!1;if(ya)try{var fc={};Object.defineProperty(fc,"passive",{get:function(){Yg=!0}}),window.addEventListener("test",fc,fc),window.removeEventListener("test",fc,fc)}catch{Yg=!1}function $P(e,t,n,s,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var Gc=!1,Wm=null,qm=!1,Gg=null,zP={onError:function(e){Gc=!0,Wm=e}};function UP(e,t,n,s,a,i,o,l,c){Gc=!1,Wm=null,$P.apply(zP,arguments)}function BP(e,t,n,s,a,i,o,l,c){if(UP.apply(this,arguments),Gc){if(Gc){var d=Wm;Gc=!1,Wm=null}else throw Error(ve(198));qm||(qm=!0,Gg=d)}}function vo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dN(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function wb(e){if(vo(e)!==e)throw Error(ve(188))}function HP(e){var t=e.alternate;if(!t){if(t=vo(e),t===null)throw Error(ve(188));return t!==e?null:e}for(var n=e,s=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(s=a.return,s!==null){n=s;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return wb(a),e;if(i===s)return wb(a),t;i=i.sibling}throw Error(ve(188))}if(n.return!==s.return)n=a,s=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o)throw Error(ve(189))}}if(n.alternate!==s)throw Error(ve(190))}if(n.tag!==3)throw Error(ve(188));return n.stateNode.current===n?e:t}function uN(e){return e=HP(e),e!==null?mN(e):null}function mN(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=mN(e);if(t!==null)return t;e=e.sibling}return null}var hN=Ir.unstable_scheduleCallback,bb=Ir.unstable_cancelCallback,WP=Ir.unstable_shouldYield,qP=Ir.unstable_requestPaint,sn=Ir.unstable_now,VP=Ir.unstable_getCurrentPriorityLevel,Fv=Ir.unstable_ImmediatePriority,fN=Ir.unstable_UserBlockingPriority,Vm=Ir.unstable_NormalPriority,YP=Ir.unstable_LowPriority,pN=Ir.unstable_IdlePriority,Wh=null,Ws=null;function GP(e){if(Ws&&typeof Ws.onCommitFiberRoot=="function")try{Ws.onCommitFiberRoot(Wh,e,void 0,(e.current.flags&128)===128)}catch{}}var ys=Math.clz32?Math.clz32:XP,KP=Math.log,ZP=Math.LN2;function XP(e){return e>>>=0,e===0?32:31-(KP(e)/ZP|0)|0}var zu=64,Uu=4194304;function zc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ym(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?s=zc(l):(i&=o,i!==0&&(s=zc(i)))}else o=n&~a,o!==0?s=zc(o):i!==0&&(s=zc(i));if(s===0)return 0;if(t!==0&&t!==s&&!(t&a)&&(a=s&-s,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-ys(t),a=1<<n,s|=e[n],t&=~a;return s}function QP(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function JP(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-ys(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&s)&&(a[o]=QP(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Kg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gN(){var e=zu;return zu<<=1,!(zu&4194240)&&(zu=64),e}function lp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ys(t),e[t]=n}function eR(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-ys(n),i=1<<a;t[a]=0,s[a]=-1,e[a]=-1,n&=~i}}function $v(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ys(n),a=1<<s;a&t|e[s]&t&&(e[s]|=t),n&=~a}}var Ct=0;function xN(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}
vendor: 13,900 bytes, line 37
37var vN,zv,yN,wN,bN,Zg=!1,Bu=[],ni=null,ri=null,si=null,ld=new Map,cd=new Map,Ha=[],tR="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 jb(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":ld.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cd.delete(t.pointerId)}}function pc(e,t,n,s,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[a]},t!==null&&(t=tu(t),t!==null&&zv(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function nR(e,t,n,s,a){switch(t){case"focusin":return ni=pc(ni,e,t,n,s,a),!0;case"dragenter":return ri=pc(ri,e,t,n,s,a),!0;case"mouseover":return si=pc(si,e,t,n,s,a),!0;case"pointerover":var i=a.pointerId;return ld.set(i,pc(ld.get(i)||null,e,t,n,s,a)),!0;case"gotpointercapture":return i=a.pointerId,cd.set(i,pc(cd.get(i)||null,e,t,n,s,a)),!0}return!1}function jN(e){var t=Vi(e.target);if(t!==null){var n=vo(t);if(n!==null){if(t=n.tag,t===13){if(t=dN(n),t!==null){e.blockedOn=t,bN(e.priority,function(){yN(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _m(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);qg=s,n.target.dispatchEvent(s),qg=null}else return t=tu(n),t!==null&&zv(t),e.blockedOn=n,!1;t.shift()}return!0}function _b(e,t,n){_m(e)&&n.delete(t)}function rR(){Zg=!1,ni!==null&&_m(ni)&&(ni=null),ri!==null&&_m(ri)&&(ri=null),si!==null&&_m(si)&&(si=null),ld.forEach(_b),cd.forEach(_b)}function gc(e,t){e.blockedOn===t&&(e.blockedOn=null,Zg||(Zg=!0,Ir.unstable_scheduleCallback(Ir.unstable_NormalPriority,rR)))}function dd(e){function t(a){return gc(a,e)}if(0<Bu.length){gc(Bu[0],e);for(var n=1;n<Bu.length;n++){var s=Bu[n];s.blockedOn===e&&(s.blockedOn=null)}}for(ni!==null&&gc(ni,e),ri!==null&&gc(ri,e),si!==null&&gc(si,e),ld.forEach(t),cd.forEach(t),n=0;n<Ha.length;n++)s=Ha[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ha.length&&(n=Ha[0],n.blockedOn===null);)jN(n),n.blockedOn===null&&Ha.shift()}var cl=Aa.ReactCurrentBatchConfig,Gm=!0;function sR(e,t,n,s){var a=Ct,i=cl.transition;cl.transition=null;try{Ct=1,Uv(e,t,n,s)}finally{Ct=a,cl.transition=i}}function aR(e,t,n,s){var a=Ct,i=cl.transition;cl.transition=null;try{Ct=4,Uv(e,t,n,s)}finally{Ct=a,cl.transition=i}}function Uv(e,t,n,s){if(Gm){var a=Xg(e,t,n,s);if(a===null)vp(e,t,s,Km,n),jb(e,s);else if(nR(a,e,t,n,s))s.stopPropagation();else if(jb(e,s),t&4&&-1<tR.indexOf(e)){for(;a!==null;){var i=tu(a);if(i!==null&&vN(i),i=Xg(e,t,n,s),i===null&&vp(e,t,s,Km,n),i===a)break;a=i}a!==null&&s.stopPropagation()}else vp(e,t,s,null,n)}}var Km=null;function Xg(e,t,n,s){if(Km=null,e=Lv(s),e=Vi(e),e!==null)if(t=vo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dN(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Km=e,null}function _N(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(VP()){case Fv:return 1;case fN:return 4;case Vm:case YP:return 16;case pN:return 536870912;default:return 16}default:return 16}}var Qa=null,Bv=null,Nm=null;function NN(){if(Nm)return Nm;var e,t=Bv,n=t.length,s,a="value"in Qa?Qa.value:Qa.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===a[i-s];s++);return Nm=a.slice(e,1<s?1-s:void 0)}function Sm(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Hu(){return!0}function Nb(){return!1}function $r(e){function t(n,s,a,i,o){this._reactName=n,this._targetInst=a,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Hu:Nb,this.isPropagationStopped=Nb,this}return Qt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hu)},persist:function(){},isPersistent:Hu}),t}var Vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hv=$r(Vl),eu=Qt({},Vl,{view:0,detail:0}),iR=$r(eu),cp,dp,xc,qh=Qt({},eu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xc&&(xc&&e.type==="mousemove"?(cp=e.screenX-xc.screenX,dp=e.screenY-xc.screenY):dp=cp=0,xc=e),cp)},movementY:function(e){return"movementY"in e?e.movementY:dp}}),Sb=$r(qh),oR=Qt({},qh,{dataTransfer:0}),lR=$r(oR),cR=Qt({},eu,{relatedTarget:0}),up=$r(cR),dR=Qt({},Vl,{animationName:0,elapsedTime:0,pseudoElement:0}),uR=$r(dR),mR=Qt({},Vl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hR=$r(mR),fR=Qt({},Vl,{data:0}),kb=$r(fR),pR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gR={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"},xR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vR(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xR[e])?!!t[e]:!1}function Wv(){return vR}var yR=Qt({},eu,{key:function(e){if(e.key){var t=pR[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Sm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gR[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wv,charCode:function(e){return e.type==="keypress"?Sm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Sm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wR=$r(yR),bR=Qt({},qh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cb=$r(bR),jR=Qt({},eu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wv}),_R=$r(jR),NR=Qt({},Vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),SR=$r(NR),kR=Qt({},qh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),CR=$r(kR),AR=[9,13,27,32],qv=ya&&"CompositionEvent"in window,Kc=null;ya&&"documentMode"in document&&(Kc=document.documentMode);var ER=ya&&"TextEvent"in window&&!Kc,SN=ya&&(!qv||Kc&&8<Kc&&11>=Kc),Ab=" ",Eb=!1;function kN(e,t){switch(e){case"keyup":return AR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vo=!1;function TR(e,t){switch(e){case"compositionend":return CN(t);case"keypress":return t.which!==32?null:(Eb=!0,Ab);case"textInput":return e=t.data,e===Ab&&Eb?null:e;default:return null}}function PR(e,t){if(Vo)return e==="compositionend"||!qv&&kN(e,t)?(e=NN(),Nm=Bv=Qa=null,Vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return SN&&t.locale!=="ko"?null:t.data;default:return null}}var RR={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 Tb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!RR[e.type]:t==="textarea"}function AN(e,t,n,s){aN(s),t=Zm(t,"onChange"),0<t.length&&(n=new Hv("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Zc=null,ud=null;function MR(e){$N(e,0)}function Vh(e){var t=Ko(e);if(Q_(t))return e}function DR(e,t){if(e==="change")return t}var EN=!1;if(ya){var mp;if(ya){var hp="oninput"in document;if(!hp){var Pb=document.createElement("div");Pb.setAttribute("oninput","return;"),hp=typeof Pb.oninput=="function"}mp=hp}else mp=!1;EN=mp&&(!document.documentMode||9<document.documentMode)}function Rb(){Zc&&(Zc.detachEvent("onpropertychange",TN),ud=Zc=null)}function TN(e){if(e.propertyName==="value"&&Vh(ud)){var t=[];AN(t,ud,e,Lv(e)),cN(MR,t)}}function OR(e,t,n){e==="focusin"?(Rb(),Zc=t,ud=n,Zc.attachEvent("onpropertychange",TN)):e==="focusout"&&Rb()}function IR(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vh(ud)}function LR(e,t){if(e==="click")return Vh(t)}function FR(e,t){if(e==="input"||e==="change")return Vh(t)}function $R(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var js=typeof Object.is=="function"?Object.is:$R;function md(e,t){if(js(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var a=n[s];if(!Mg.call(t,a)||!js(e[a],t[a]))return!1}return!0}function Mb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Db(e,t){var n=Mb(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mb(n)}}function PN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?PN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function RN(){for(var e=window,t=Hm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hm(e.document)}return t}function Vv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function zR(e){var t=RN(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&PN(n.ownerDocument.documentElement,n)){if(s!==null&&Vv(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(s.start,a);s=s.end===void 0?i:Math.min(s.end,a),!e.extend&&i>s&&(a=s,s=i,i=a),a=Db(n,i);var o=Db(n,s);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var UR=ya&&"documentMode"in document&&11>=document.documentMode,Yo=null,Qg=null,Xc=null,Jg=!1;function Ob(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jg||Yo==null||Yo!==Hm(s)||(s=Yo,"selectionStart"in s&&Vv(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focu
vendor: 3,045 bytes, line 37
37sNode:s.focusNode,focusOffset:s.focusOffset}),Xc&&md(Xc,s)||(Xc=s,s=Zm(Qg,"onSelect"),0<s.length&&(t=new Hv("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Yo)))}function Wu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Go={animationend:Wu("Animation","AnimationEnd"),animationiteration:Wu("Animation","AnimationIteration"),animationstart:Wu("Animation","AnimationStart"),transitionend:Wu("Transition","TransitionEnd")},fp={},MN={};ya&&(MN=document.createElement("div").style,"AnimationEvent"in window||(delete Go.animationend.animation,delete Go.animationiteration.animation,delete Go.animationstart.animation),"TransitionEvent"in window||delete Go.transitionend.transition);function Yh(e){if(fp[e])return fp[e];if(!Go[e])return e;var t=Go[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in MN)return fp[e]=t[n];return e}var DN=Yh("animationend"),ON=Yh("animationiteration"),IN=Yh("animationstart"),LN=Yh("transitionend"),FN=new Map,Ib="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 Ai(e,t){FN.set(e,t),xo(t,[e])}for(var pp=0;pp<Ib.length;pp++){var gp=Ib[pp],BR=gp.toLowerCase(),HR=gp[0].toUpperCase()+gp.slice(1);Ai(BR,"on"+HR)}Ai(DN,"onAnimationEnd");Ai(ON,"onAnimationIteration");Ai(IN,"onAnimationStart");Ai("dblclick","onDoubleClick");Ai("focusin","onFocus");Ai("focusout","onBlur");Ai(LN,"onTransitionEnd");Al("onMouseEnter",["mouseout","mouseover"]);Al("onMouseLeave",["mouseout","mouseover"]);Al("onPointerEnter",["pointerout","pointerover"]);Al("onPointerLeave",["pointerout","pointerover"]);xo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xo("onBeforeInput",["compositionend","keypress","textInput","paste"]);xo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uc="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(" "),WR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uc));
vendor: 4,690 bytes, line 37
37function Lb(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,BP(s,t,void 0,e),e.currentTarget=null}function $N(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],a=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;Lb(a,l,d),i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Lb(a,l,d),i=c}}}if(qm)throw e=Gg,qm=!1,Gg=null,e}function Lt(e,t){var n=t[sx];n===void 0&&(n=t[sx]=new Set);var s=e+"__bubble";n.has(s)||(zN(t,e,2,!1),n.add(s))}function xp(e,t,n){var s=0;t&&(s|=4),zN(n,e,s,t)}var qu="_reactListening"+Math.random().toString(36).slice(2);function hd(e){if(!e[qu]){e[qu]=!0,Y_.forEach(function(n){n!=="selectionchange"&&(WR.has(n)||xp(n,!1,e),xp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qu]||(t[qu]=!0,xp("selectionchange",!1,t))}}function zN(e,t,n,s){switch(_N(t)){case 1:var a=sR;break;case 4:a=aR;break;default:a=Uv}n=a.bind(null,t,n,e),a=void 0,!Yg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),s?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function vp(e,t,n,s,a){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Vi(l),o===null)return;if(c=o.tag,c===5||c===6){s=i=o;continue e}l=l.parentNode}}s=s.return}cN(function(){var d=i,u=Lv(n),h=[];e:{var f=FN.get(e);if(f!==void 0){var p=Hv,w=e;switch(e){case"keypress":if(Sm(n)===0)break e;case"keydown":case"keyup":p=wR;break;case"focusin":w="focus",p=up;break;case"focusout":w="blur",p=up;break;case"beforeblur":case"afterblur":p=up;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Sb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=lR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_R;break;case DN:case ON:case IN:p=uR;break;case LN:p=SR;break;case"scroll":p=iR;break;case"wheel":p=CR;break;case"copy":case"cut":case"paste":p=hR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Cb}var v=(t&4)!==0,b=!v&&e==="scroll",x=v?f!==null?f+"Capture":null:f;v=[];for(var g=d,y;g!==null;){y=g;var j=y.stateNode;if(y.tag===5&&j!==null&&(y=j,x!==null&&(j=od(g,x),j!=null&&v.push(fd(g,j,y)))),b)break;g=g.return}0<v.length&&(f=new p(f,w,null,n,u),h.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==qg&&(w=n.relatedTarget||n.fromElement)&&(Vi(w)||w[wa]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(w=n.relatedTarget||n.toElement,p=d,w=w?Vi(w):null,w!==null&&(b=vo(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=d),p!==w)){if(v=Sb,j="onMouseLeave",x="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Cb,j="onPointerLeave",x="onPointerEnter",g="pointer"),b=p==null?f:Ko(p),y=w==null?f:Ko(w),f=new v(j,g+"leave",p,n,u),f.target=b,f.relatedTarget=y,j=null,Vi(u)===d&&(v=new v(x,g+"enter",w,n,u),v.target=y,v.relatedTarget=b,j=v),b=j,p&&w)t:{for(v=p,x=w,g=0,y=v;y;y=To(y))g++;for(y=0,j=x;j;j=To(j))y++;for(;0<g-y;)v=To(v),g--;for(;0<y-g;)x=To(x),y--;for(;g--;){if(v===x||x!==null&&v===x.alternate)break t;v=To(v),x=To(x)}v=null}else v=null;p!==null&&Fb(h,f,p,v,!1),w!==null&&b!==null&&Fb(h,b,w,v,!0)}}e:{if(f=d?Ko(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var N=DR;else if(Tb(f))if(EN)N=FR;else{N=IR;var k=OR}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=LR);if(N&&(N=N(e,d))){AN(h,N,n,u);break e}k&&k(e,f,d),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&zg(f,"number",f.value)}switch(k=d?Ko(d):window,e){case"focusin":(Tb(k)||k.contentEditable==="true")&&(Yo=k,Qg=d,Xc=null);break;case"focusout":Xc=Qg=Yo=null;break;case"mousedown":Jg=!0;break;case"contextmenu":case"mouseup":case"dragend":Jg=!1,Ob(h,n,u);break;case"selectionchange":if(UR)break;case"keydown":case"keyup":Ob(h,n,u)}var _;
vendor: 4,838 bytes, lines 37-38
37if(qv)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Vo?kN(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(SN&&n.locale!=="ko"&&(Vo||P!=="onCompositionStart"?P==="onCompositionEnd"&&Vo&&(_=NN()):(Qa=u,Bv="value"in Qa?Qa.value:Qa.textContent,Vo=!0)),k=Zm(d,P),0<k.length&&(P=new kb(P,e,null,n,u),h.push({event:P,listeners:k}),_?P.data=_:(_=CN(n),_!==null&&(P.data=_)))),(_=ER?TR(e,n):PR(e,n))&&(d=Zm(d,"onBeforeInput"),0<d.length&&(u=new kb("onBeforeInput","beforeinput",null,n,u),h.push({event:u,listeners:d}),u.data=_))}$N(h,t)})}function fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zm(e,t){for(var n=t+"Capture",s=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=od(e,n),i!=null&&s.unshift(fd(e,i,a)),i=od(e,t),i!=null&&s.push(fd(e,i,a))),e=e.return}return s}function To(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fb(e,t,n,s,a){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&d!==null&&(l=d,a?(c=od(n,i),c!=null&&o.unshift(fd(n,c,l))):a||(c=od(n,i),c!=null&&o.push(fd(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var qR=/\r\n?/g,VR=/\u0000|\uFFFD/g;function $b(e){return(typeof e=="string"?e:""+e).replace(qR,`
38`).replace(VR,"")}function Vu(e,t,n){if(t=$b(t),$b(e)!==t&&n)throw Error(ve(425))}function Xm(){}var ex=null,tx=null;function nx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rx=typeof setTimeout=="function"?setTimeout:void 0,YR=typeof clearTimeout=="function"?clearTimeout:void 0,zb=typeof Promise=="function"?Promise:void 0,GR=typeof queueMicrotask=="function"?queueMicrotask:typeof zb<"u"?function(e){return zb.resolve(null).then(e).catch(KR)}:rx;function KR(e){setTimeout(function(){throw e})}function yp(e,t){var n=t,s=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(s===0){e.removeChild(a),dd(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=a}while(n);dd(t)}function ai(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ub(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Yl=Math.random().toString(36).slice(2),zs="__reactFiber$"+Yl,pd="__reactProps$"+Yl,wa="__reactContainer$"+Yl,sx="__reactEvents$"+Yl,ZR="__reactListeners$"+Yl,XR="__reactHandles$"+Yl;function Vi(e){var t=e[zs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wa]||n[zs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ub(e);e!==null;){if(n=e[zs])return n;e=Ub(e)}return t}e=n,n=e.parentNode}return null}function tu(e){return e=e[zs]||e[wa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ko(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ve(33))}function Gh(e){return e[pd]||null}var ax=[],Zo=-1;function Ei(e){return{current:e}}function Ft(e){0>Zo||(e.current=ax[Zo],ax[Zo]=null,Zo--)}function Mt(e,t){Zo++,ax[Zo]=e.current,e.current=t}var mi={},Gn=Ei(mi),xr=Ei(!1),no=mi;function El(e,t){var n=e.type.contextTypes;if(!n)return mi;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function vr(e){return e=e.childContextTypes,e!=null}function Qm(){Ft(xr),Ft(Gn)}function Bb(e,t,n){if(Gn.current!==mi)throw Error(ve(168));Mt(Gn,t),Mt(xr,n)}function UN(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var a in s)if(!(a in t))throw Error(ve(108,OP(e)||"Unknown",a));return Qt({},n,s)}function Jm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mi,no=Gn.current,Mt(Gn,e),Mt(xr,xr.current),!0}function Hb(e,t,n){var s=e.stateNode;if(!s)throw Error(ve(169));n?(e=UN(e,t,no),s.__reactInternalMemoizedMergedChildContext=e,Ft(xr),Ft(Gn),Mt(Gn,e)):Ft(xr),Mt(xr,n)}var ma=null,Kh=!1,wp=!1;function BN(e){ma===null?ma=[e]:ma.push(e)}function QR(e){Kh=!0,BN(e)}function Ti(){if(!wp&&ma!==null){wp=!0;var e=0,t=Ct;try{var n=ma;for(Ct=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}ma=null,Kh=!1}catch(a){throw ma!==null&&(ma=ma.slice(e+1)),hN(Fv,Ti),a}
vendor: 16,029 bytes, line 38
38finally{Ct=t,wp=!1}}return null}var Xo=[],Qo=0,eh=null,th=0,Wr=[],qr=0,ro=null,ha=1,fa="";function Ui(e,t){Xo[Qo++]=th,Xo[Qo++]=eh,eh=e,th=t}function HN(e,t,n){Wr[qr++]=ha,Wr[qr++]=fa,Wr[qr++]=ro,ro=e;var s=ha;e=fa;var a=32-ys(s)-1;s&=~(1<<a),n+=1;var i=32-ys(t)+a;if(30<i){var o=a-a%5;i=(s&(1<<o)-1).toString(32),s>>=o,a-=o,ha=1<<32-ys(t)+a|n<<a|s,fa=i+e}else ha=1<<i|n<<a|s,fa=e}function Yv(e){e.return!==null&&(Ui(e,1),HN(e,1,0))}function Gv(e){for(;e===eh;)eh=Xo[--Qo],Xo[Qo]=null,th=Xo[--Qo],Xo[Qo]=null;for(;e===ro;)ro=Wr[--qr],Wr[qr]=null,fa=Wr[--qr],Wr[qr]=null,ha=Wr[--qr],Wr[qr]=null}var Mr=null,Rr=null,Bt=!1,gs=null;function WN(e,t){var n=Yr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wb(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mr=e,Rr=ai(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mr=e,Rr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ro!==null?{id:ha,overflow:fa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Yr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mr=e,Rr=null,!0):!1;default:return!1}}function ix(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ox(e){if(Bt){var t=Rr;if(t){var n=t;if(!Wb(e,t)){if(ix(e))throw Error(ve(418));t=ai(n.nextSibling);var s=Mr;t&&Wb(e,t)?WN(s,n):(e.flags=e.flags&-4097|2,Bt=!1,Mr=e)}}else{if(ix(e))throw Error(ve(418));e.flags=e.flags&-4097|2,Bt=!1,Mr=e}}}function qb(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mr=e}function Yu(e){if(e!==Mr)return!1;if(!Bt)return qb(e),Bt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!nx(e.type,e.memoizedProps)),t&&(t=Rr)){if(ix(e))throw qN(),Error(ve(418));for(;t;)WN(e,t),t=ai(t.nextSibling)}if(qb(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ve(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Rr=ai(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Rr=null}}else Rr=Mr?ai(e.stateNode.nextSibling):null;return!0}function qN(){for(var e=Rr;e;)e=ai(e.nextSibling)}function Tl(){Rr=Mr=null,Bt=!1}function Kv(e){gs===null?gs=[e]:gs.push(e)}var JR=Aa.ReactCurrentBatchConfig;function vc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ve(309));var s=n.stateNode}if(!s)throw Error(ve(147,e));var a=s,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(ve(284));if(!n._owner)throw Error(ve(290,e))}return e}function Gu(e,t){throw e=Object.prototype.toString.call(t),Error(ve(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vb(e){var t=e._init;return t(e._payload)}function VN(e){function t(x,g){if(e){var y=x.deletions;y===null?(x.deletions=[g],x.flags|=16):y.push(g)}}function n(x,g){if(!e)return null;for(;g!==null;)t(x,g),g=g.sibling;return null}function s(x,g){for(x=new Map;g!==null;)g.key!==null?x.set(g.key,g):x.set(g.index,g),g=g.sibling;return x}function a(x,g){return x=ci(x,g),x.index=0,x.sibling=null,x}function i(x,g,y){return x.index=y,e?(y=x.alternate,y!==null?(y=y.index,y<g?(x.flags|=2,g):y):(x.flags|=2,g)):(x.flags|=1048576,g)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,g,y,j){return g===null||g.tag!==6?(g=Cp(y,x.mode,j),g.return=x,g):(g=a(g,y),g.return=x,g)}function c(x,g,y,j){var N=y.type;return N===qo?u(x,g,y.props.children,j,y.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ua&&Vb(N)===g.type)?(j=a(g,y.props),j.ref=vc(x,g,y),j.return=x,j):(j=Rm(y.type,y.key,y.props,null,x.mode,j),j.ref=vc(x,g,y),j.return=x,j)}function d(x,g,y,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Ap(y,x.mode,j),g.return=x,g):(g=a(g,y.children||[]),g.return=x,g)}function u(x,g,y,j,N){return g===null||g.tag!==7?(g=eo(y,x.mode,j,N),g.return=x,g):(g=a(g,y),g.return=x,g)}function h(x,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Cp(""+g,x.mode,y),g.return=x,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Lu:return y=Rm(g.type,g.key,g.props,null,x.mode,y),y.ref=vc(x,null,g),y.return=x,y;case Wo:return g=Ap(g,x.mode,y),g.return=x,g;case Ua:var j=g._init;return h(x,j(g._payload),y)}if($c(g)||hc(g))return g=eo(g,x.mode,y,null),g.return=x,g;Gu(x,g)}return null}function f(x,g,y,j){var N=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:l(x,g,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Lu:return y.key===N?c(x,g,y,j):null;case Wo:return y.key===N?d(x,g,y,j):null;case Ua:return N=y._init,f(x,g,N(y._payload),j)}if($c(y)||hc(y))return N!==null?null:u(x,g,y,j,null);Gu(x,y)}return null}function p(x,g,y,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return x=x.get(y)||null,l(g,x,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Lu:return x=x.get(j.key===null?y:j.key)||null,c(g,x,j,N);case Wo:return x=x.get(j.key===null?y:j.key)||null,d(g,x,j,N);case Ua:var k=j._init;return p(x,g,y,k(j._payload),N)}if($c(j)||hc(j))return x=x.get(y)||null,u(g,x,j,N,null);Gu(g,j)}return null}function w(x,g,y,j){for(var N=null,k=null,_=g,P=g=0,$=null;_!==null&&P<y.length;P++){_.index>P?($=_,_=null):$=_.sibling;var M=f(x,_,y[P],j);if(M===null){_===null&&(_=$);break}e&&_&&M.alternate===null&&t(x,_),g=i(M,g,P),k===null?N=M:k.sibling=M,k=M,_=$}if(P===y.length)return n(x,_),Bt&&Ui(x,P),N;if(_===null){for(;P<y.length;P++)_=h(x,y[P],j),_!==null&&(g=i(_,g,P),k===null?N=_:k.sibling=_,k=_);return Bt&&Ui(x,P),N}for(_=s(x,_);P<y.length;P++)$=p(_,x,P,y[P],j),$!==null&&(e&&$.alternate!==null&&_.delete($.key===null?P:$.key),g=i($,g,P),k===null?N=$:k.sibling=$,k=$);return e&&_.forEach(function(O){return t(x,O)}),Bt&&Ui(x,P),N}function v(x,g,y,j){var N=hc(y);if(typeof N!="function")throw Error(ve(150));if(y=N.call(y),y==null)throw Error(ve(151));for(var k=N=null,_=g,P=g=0,$=null,M=y.next();_!==null&&!M.done;P++,M=y.next()){_.index>P?($=_,_=null):$=_.sibling;var O=f(x,_,M.value,j);if(O===null){_===null&&(_=$);break}e&&_&&O.alternate===null&&t(x,_),g=i(O,g,P),k===null?N=O:k.sibling=O,k=O,_=$}if(M.done)return n(x,_),Bt&&Ui(x,P),N;if(_===null){for(;!M.done;P++,M=y.next())M=h(x,M.value,j),M!==null&&(g=i(M,g,P),k===null?N=M:k.sibling=M,k=M);return Bt&&Ui(x,P),N}for(_=s(x,_);!M.done;P++,M=y.next())M=p(_,x,P,M.value,j),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?P:M.key),g=i(M,g,P),k===null?N=M:k.sibling=M,k=M);return e&&_.forEach(function(A){return t(x,A)}),Bt&&Ui(x,P),N}function b(x,g,y,j){if(typeof y=="object"&&y!==null&&y.type===qo&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Lu:e:{for(var N=y.key,k=g;k!==null;){if(k.key===N){if(N=y.type,N===qo){if(k.tag===7){n(x,k.sibling),g=a(k,y.props.children),g.return=x,x=g;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ua&&Vb(N)===k.type){n(x,k.sibling),g=a(k,y.props),g.ref=vc(x,k,y),g.return=x,x=g;break e}n(x,k);break}else t(x,k);k=k.sibling}y.type===qo?(g=eo(y.props.children,x.mode,j,y.key),g.return=x,x=g):(j=Rm(y.type,y.key,y.props,null,x.mode,j),j.ref=vc(x,g,y),j.return=x,x=j)}return o(x);case Wo:e:{for(k=y.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(x,g.sibling),g=a(g,y.children||[]),g.return=x,x=g;break e}else{n(x,g);break}else t(x,g);g=g.sibling}g=Ap(y,x.mode,j),g.return=x,x=g}return o(x);case Ua:return k=y._init,b(x,g,k(y._payload),j)}if($c(y))return w(x,g,y,j);if(hc(y))return v(x,g,y,j);Gu(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(x,g.sibling),g=a(g,y),g.return=x,x=g):(n(x,g),g=Cp(y,x.mode,j),g.return=x,x=g),o(x)):n(x,g)}return b}var Pl=VN(!0),YN=VN(!1),nh=Ei(null),rh=null,Jo=null,Zv=null;function Xv(){Zv=Jo=rh=null}function Qv(e){var t=nh.current;Ft(nh),e._currentValue=t}function lx(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function dl(e,t){rh=e,Zv=Jo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(fr=!0),e.firstContext=null)}function Qr(e){var t=e._currentValue;if(Zv!==e)if(e={context:e,memoizedValue:t,next:null},Jo===null){if(rh===null)throw Error(ve(308));Jo=e,rh.dependencies={lanes:0,firstContext:e}}else Jo=Jo.next=e;return t}var Yi=null;function Jv(e){Yi===null?Yi=[e]:Yi.push(e)}function GN(e,t,n,s){var a=t.interleaved;return a===null?(n.next=n,Jv(t)):(n.next=a.next,a.next=n),t.interleaved=n,ba(e,s)}function ba(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ba=!1;function ey(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function KN(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ga(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ii(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,wt&2){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,ba(e,n)}return a=s.interleaved,a===null?(t.next=t,Jv(s)):(t.next=a.next,a.next=t),s.interleaved=t,ba(e,n)}function km(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$v(e,n)}}function Yb(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sh(e,t,n,s){var a=e.updateQueue;Ba=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var h=a.baseState;o=0,u=d=c=null,l=i;do{var f=l.lane,p=l.eventTime;if((s&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,v=l;switch(f=t,p=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){h=w.call(p,h,f);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,f=typeof w=="function"?w.call(p,h,f):w,f==null)break e;h=Qt({},h,f);break e;case 2:Ba=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=a.effects,f===null?a.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=p,c=h):u=u.next=p,o|=f;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;f=l,l=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(u===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ao|=o,e.lanes=o,e.memoizedState=h}}function Gb(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],a=s.callback;if(a!==null){if(s.callback=null,s=n,typeof a!="function")throw Error(ve(191,a));a.call(s)}}}var nu={},qs=Ei(nu),gd=Ei(nu),xd=Ei(nu);function Gi(e){if(e===nu)throw Error(ve(174));return e}function ty(e,t){switch(Mt(xd,t),Mt(gd,e),Mt(qs,nu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bg(t,e)}Ft(qs),Mt(qs,t)}function Rl(){Ft(qs),Ft(gd),Ft(xd)}function ZN(e){Gi(xd.current);var t=Gi(qs.current),n=Bg(t,e.type);t!==n&&(Mt(gd,e),Mt(qs,n))}function ny(e){gd.current===e&&(Ft(qs),Ft(gd))}var Kt=Ei(0);function ah(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bp=[];function ry(){for(var e=0;e<bp.length;e++)bp[e]._workInProgressVersionPrimary=null;bp.length=0}var Cm=Aa.ReactCurrentDispatcher,jp=Aa.ReactCurrentBatchConfig,so=0,Zt=null,wn=null,Pn=null,ih=!1,Qc=!1,vd=0,eM=0;function Hn(){throw Error(ve(321))}function sy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!js(e[n],t[n]))return!1;return!0}function ay(e,t,n,s,a,i){if(so=i,Zt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cm.current=e===null||e.memoizedState===null?sM:aM,e=n(s,a),Qc){i=0;do{if(Qc=!1,vd=0,25<=i)throw Error(ve(301));i+=1,Pn=wn=null,t.updateQueue=null,Cm.current=iM,e=n(s,a)}while(Qc)}if(Cm.current=oh,t=wn!==null&&wn.next!==null,so=0,Pn=wn=Zt=null,ih=!1,t)throw Error(ve(300));return e}function iy(){var e=vd!==0;return vd=0,e}function Os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pn===null?Zt.memoizedState=Pn=e:Pn=Pn.next=e,Pn}function Jr(){if(wn===null){var e=Zt.alternate;e=e!==null?e.memoizedState:null}else e=wn.next;var t=Pn===null?Zt.memoizedState:Pn.next;if(t!==null)Pn=t,wn=e;else{if(e===null)throw Error(ve(310));wn=e,e={memoizedState:wn.memoizedState,baseState:wn.baseState,baseQueue:wn.baseQueue,queue:wn.queue,next:null},Pn===null?Zt.memoizedState=Pn=e:Pn=Pn.next=e}return Pn}function yd(e,t){return typeof t=="function"?t(e):t}function _p(e){var t=Jr(),n=t.queue;if(n===null)throw Error(ve(311));n.lastRenderedReducer=e;var s=wn,a=s.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}s.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,s=s.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((so&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,o=s):c=c.next=h,Zt.lanes|=u,ao|=u}d=d.next}while(d!==null&&d!==i);c===null?o=s:c.next=l,js(s,t.memoizedState)||(fr=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){a=e;do i=a.lane,Zt.lanes|=i,ao|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Np(e){var t=Jr(),n=t.queue;if(n===null)throw Error(ve(311));n.lastRenderedReducer=e;var s=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);js(i,t.memoizedState)||(fr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function XN(){}function QN(e,t){var n=Zt,s=Jr(),a=t(),i=!js(s.memoizedState,a);if(i&&(s.memoizedState=a,fr=!0),s=s.queue,oy(t1.bind(null,n,s,e),[e]),s.getSnapshot!==t||i||Pn!==null&&Pn.memoizedState.tag&1){if(n.flags|=2048,wd(9,e1.bind(null,n,s,a,t),void 0,null),Mn===null)throw Error(ve(349));
vendor: 4,230 bytes, line 38
38so&30||JN(n,t,a)}return a}function JN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Zt.updateQueue,t===null?(t={lastEffect:null,stores:null},Zt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function e1(e,t,n,s){t.value=n,t.getSnapshot=s,n1(t)&&r1(e)}function t1(e,t,n){return n(function(){n1(t)&&r1(e)})}function n1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!js(e,n)}catch{return!0}}function r1(e){var t=ba(e,1);t!==null&&ws(t,e,1,-1)}function Kb(e){var t=Os();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yd,lastRenderedState:e},t.queue=e,e=e.dispatch=rM.bind(null,Zt,e),[t.memoizedState,e]}function wd(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Zt.updateQueue,t===null?(t={lastEffect:null,stores:null},Zt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function s1(){return Jr().memoizedState}function Am(e,t,n,s){var a=Os();Zt.flags|=e,a.memoizedState=wd(1|t,n,void 0,s===void 0?null:s)}function Zh(e,t,n,s){var a=Jr();s=s===void 0?null:s;var i=void 0;if(wn!==null){var o=wn.memoizedState;if(i=o.destroy,s!==null&&sy(s,o.deps)){a.memoizedState=wd(t,n,i,s);return}}Zt.flags|=e,a.memoizedState=wd(1|t,n,i,s)}function Zb(e,t){return Am(8390656,8,e,t)}function oy(e,t){return Zh(2048,8,e,t)}function a1(e,t){return Zh(4,2,e,t)}function i1(e,t){return Zh(4,4,e,t)}function o1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function l1(e,t,n){return n=n!=null?n.concat([e]):null,Zh(4,4,o1.bind(null,t,e),n)}function ly(){}function c1(e,t){var n=Jr();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&sy(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function d1(e,t){var n=Jr();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&sy(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function u1(e,t,n){return so&21?(js(n,t)||(n=gN(),Zt.lanes|=n,ao|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,fr=!0),e.memoizedState=n)}function tM(e,t){var n=Ct;Ct=n!==0&&4>n?n:4,e(!0);var s=jp.transition;jp.transition={};try{e(!1),t()}finally{Ct=n,jp.transition=s}}function m1(){return Jr().memoizedState}function nM(e,t,n){var s=li(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},h1(e))f1(t,n);else if(n=GN(e,t,n,s),n!==null){var a=rr();ws(n,e,s,a),p1(n,t,s)}}function rM(e,t,n){var s=li(e),a={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(h1(e))f1(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,js(l,o)){var c=t.interleaved;c===null?(a.next=a,Jv(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=GN(e,t,a,s),n!==null&&(a=rr(),ws(n,e,s,a),p1(n,t,s))}}function h1(e){var t=e.alternate;return e===Zt||t!==null&&t===Zt}function f1(e,t){Qc=ih=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function p1(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$v(e,n)}}var oh={readContext:Qr,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},sM={readContext:Qr,useCallback:function(e,t){return Os().memoizedState=[e,t===void 0?null:t],e},useContext:Qr,useEffect:Zb,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Am(4194308,4,o1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Am(4194308,4,e,t)},useInsertionEffect:function(e,t){return Am(4,2,e,t)},useMemo:function(e,t){var n=Os();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Os();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=nM.bind(null,Zt,e),[s.memoizedState,e]}
vendor: 4,426 bytes, lines 38-40
38,useRef:function(e){var t=Os();return e={current:e},t.memoizedState=e},useState:Kb,useDebugValue:ly,useDeferredValue:function(e){return Os().memoizedState=e},useTransition:function(){var e=Kb(!1),t=e[0];return e=tM.bind(null,e[1]),Os().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Zt,a=Os();if(Bt){if(n===void 0)throw Error(ve(407));n=n()}else{if(n=t(),Mn===null)throw Error(ve(349));so&30||JN(s,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Zb(t1.bind(null,s,i,e),[e]),s.flags|=2048,wd(9,e1.bind(null,s,i,n,t),void 0,null),n},useId:function(){var e=Os(),t=Mn.identifierPrefix;if(Bt){var n=fa,s=ha;n=(s&~(1<<32-ys(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=vd++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=eM++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},aM={readContext:Qr,useCallback:c1,useContext:Qr,useEffect:oy,useImperativeHandle:l1,useInsertionEffect:a1,useLayoutEffect:i1,useMemo:d1,useReducer:_p,useRef:s1,useState:function(){return _p(yd)},useDebugValue:ly,useDeferredValue:function(e){var t=Jr();return u1(t,wn.memoizedState,e)},useTransition:function(){var e=_p(yd)[0],t=Jr().memoizedState;return[e,t]},useMutableSource:XN,useSyncExternalStore:QN,useId:m1,unstable_isNewReconciler:!1},iM={readContext:Qr,useCallback:c1,useContext:Qr,useEffect:oy,useImperativeHandle:l1,useInsertionEffect:a1,useLayoutEffect:i1,useMemo:d1,useReducer:Np,useRef:s1,useState:function(){return Np(yd)},useDebugValue:ly,useDeferredValue:function(e){var t=Jr();return wn===null?t.memoizedState=e:u1(t,wn.memoizedState,e)},useTransition:function(){var e=Np(yd)[0],t=Jr().memoizedState;return[e,t]},useMutableSource:XN,useSyncExternalStore:QN,useId:m1,unstable_isNewReconciler:!1};function us(e,t){if(e&&e.defaultProps){t=Qt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function cx(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Qt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xh={isMounted:function(e){return(e=e._reactInternals)?vo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=rr(),a=li(e),i=ga(s,a);i.payload=t,n!=null&&(i.callback=n),t=ii(e,i,a),t!==null&&(ws(t,e,a,s),km(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=rr(),a=li(e),i=ga(s,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ii(e,i,a),t!==null&&(ws(t,e,a,s),km(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rr(),s=li(e),a=ga(n,s);a.tag=2,t!=null&&(a.callback=t),t=ii(e,a,s),t!==null&&(ws(t,e,s,n),km(t,e,s))}};function Xb(e,t,n,s,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!md(n,s)||!md(a,i):!0}function g1(e,t,n){var s=!1,a=mi,i=t.contextType;return typeof i=="object"&&i!==null?i=Qr(i):(a=vr(t)?no:Gn.current,s=t.contextTypes,i=(s=s!=null)?El(e,a):mi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xh,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Qb(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Xh.enqueueReplaceState(t,t.state,null)}function dx(e,t,n,s){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},ey(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Qr(i):(i=vr(t)?no:Gn.current,a.context=El(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(cx(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Xh.enqueueReplaceState(a,a.state,null),sh(e,n,a,s),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ml(e,t){try{var n="",s=t;do n+=DP(s),s=s.return;while(s);var a=n}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:a,digest:null}}
vendor: 11,370 bytes, line 40
40function Sp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ux(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oM=typeof WeakMap=="function"?WeakMap:Map;function x1(e,t,n){n=ga(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){ch||(ch=!0,bx=s),ux(e,t)},n}function v1(e,t,n){n=ga(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var a=t.value;n.payload=function(){return s(a)},n.callback=function(){ux(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ux(e,t),typeof s!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Jb(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new oM;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(n)||(a.add(n),e=bM.bind(null,e,t,n),t.then(e,e))}function ej(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function tj(e,t,n,s,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ga(-1,1),t.tag=2,ii(n,t,1))),n.lanes|=1),e)}var lM=Aa.ReactCurrentOwner,fr=!1;function Jn(e,t,n,s){t.child=e===null?YN(t,null,n,s):Pl(t,e.child,n,s)}function nj(e,t,n,s,a){n=n.render;var i=t.ref;return dl(t,a),s=ay(e,t,n,s,i,a),n=iy(),e!==null&&!fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ja(e,t,a)):(Bt&&n&&Yv(t),t.flags|=1,Jn(e,t,s,a),t.child)}function rj(e,t,n,s,a){if(e===null){var i=n.type;return typeof i=="function"&&!gy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,y1(e,t,i,s,a)):(e=Rm(n.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:md,n(o,s)&&e.ref===t.ref)return ja(e,t,a)}return t.flags|=1,e=ci(i,s),e.ref=t.ref,e.return=t,t.child=e}function y1(e,t,n,s,a){if(e!==null){var i=e.memoizedProps;if(md(i,s)&&e.ref===t.ref)if(fr=!1,t.pendingProps=s=i,(e.lanes&a)!==0)e.flags&131072&&(fr=!0);else return t.lanes=e.lanes,ja(e,t,a)}return mx(e,t,n,s,a)}function w1(e,t,n){var s=t.pendingProps,a=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(tl,Er),Er|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Mt(tl,Er),Er|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,Mt(tl,Er),Er|=s}else i!==null?(s=i.baseLanes|n,t.memoizedState=null):s=n,Mt(tl,Er),Er|=s;return Jn(e,t,a,n),t.child}function b1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function mx(e,t,n,s,a){var i=vr(n)?no:Gn.current;return i=El(t,i),dl(t,a),n=ay(e,t,n,s,i,a),s=iy(),e!==null&&!fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ja(e,t,a)):(Bt&&s&&Yv(t),t.flags|=1,Jn(e,t,n,a),t.child)}function sj(e,t,n,s,a){if(vr(n)){var i=!0;Jm(t)}else i=!1;if(dl(t,a),t.stateNode===null)Em(e,t),g1(t,n,s),dx(t,n,s,a),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Qr(d):(d=vr(n)?no:Gn.current,d=El(t,d));var u=n.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==d)&&Qb(t,o,s,d),Ba=!1;var f=t.memoizedState;o.state=f,sh(t,s,o,a),c=t.memoizedState,l!==s||f!==c||xr.current||Ba?(typeof u=="function"&&(cx(t,n,u,s),c=t.memoizedState),(l=Ba||Xb(t,n,l,s,f,c,d))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=d,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,KN(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:us(t.type,l),o.props=d,h=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qr(c):(c=vr(n)?no:Gn.current,c=El(t,c));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==c)&&Qb(t,o,s,c),Ba=!1,f=t.memoizedState,o.state=f,sh(t,s,o,a);var w=t.memoizedState;l!==h||f!==w||xr.current||Ba?(typeof p=="function"&&(cx(t,n,p,s),w=t.memoizedState),(d=Ba||Xb(t,n,d,s,f,w,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=w),o.props=s,o.state=w,o.context=c,s=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return hx(e,t,n,s,i,a)}function hx(e,t,n,s,a,i){b1(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return a&&Hb(t,n,!1),ja(e,t,i);s=t.stateNode,lM.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=Pl(t,e.child,null,i),t.child=Pl(t,null,l,i)):Jn(e,t,l,i),t.memoizedState=s.state,a&&Hb(t,n,!0),t.child}function j1(e){var t=e.stateNode;t.pendingContext?Bb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bb(e,t.context,!1),ty(e,t.containerInfo)}function aj(e,t,n,s,a){return Tl(),Kv(a),t.flags|=256,Jn(e,t,n,s),t.child}var fx={dehydrated:null,treeContext:null,retryLane:0};function px(e){return{baseLanes:e,cachePool:null,transitions:null}}function _1(e,t,n){var s=t.pendingProps,a=Kt.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Mt(Kt,a&1),e===null)return ox(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,i?(s=t.mode,i=t.child,o={mode:"hidden",children:o},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=ef(o,s,0,null),e=eo(e,s,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=px(n),t.memoizedState=fx,e):cy(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return cM(e,t,o,s,l,a,n);if(i){i=s.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==a?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=ci(a,c),s.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=ci(l,i):(i=eo(i,o,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,s=i,i=t.child,o=e.child.memoizedState,o=o===null?px(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=fx,s}return i=e.child,e=i.sibling,s=ci(i,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function cy(e,t){return t=ef({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ku(e,t,n,s){return s!==null&&Kv(s),Pl(t,e.child,null,n),e=cy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cM(e,t,n,s,a,i,o){if(n)return t.flags&256?(t.flags&=-257,s=Sp(Error(ve(422))),Ku(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=s.fallback,a=t.mode,s=ef({mode:"visible",children:s.children},a,0,null),i=eo(i,a,o,null),i.flags|=2,s.return=t,i.return=t,s.sibling=i,t.child=s,t.mode&1&&Pl(t,e.child,null,o),t.child.memoizedState=px(o),t.memoizedState=fx,i);if(!(t.mode&1))return Ku(e,t,o,null);if(a.data==="$!"){if(s=a.nextSibling&&a.nextSibling.dataset,s)var l=s.dgst;return s=l,i=Error(ve(419)),s=Sp(i,s,void 0),Ku(e,t,o,s)}if(l=(o&e.childLanes)!==0,fr||l){if(s=Mn,s!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(s.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,ba(e,a),ws(s,e,a,-1))}return py(),s=Sp(Error(ve(421))),Ku(e,t,o,s)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=jM.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Rr=ai(a.nextSibling),Mr=t,Bt=!0,gs=null,e!==null&&(Wr[qr++]=ha,Wr[qr++]=fa,Wr[qr++]=ro,ha=e.id,fa=e.overflow,ro=t),t=cy(t,s.children),t.flags|=4096,t)}function ij(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),lx(e.return,t,n)}function kp(e,t,n,s,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=a)}function N1(e,t,n){var s=t.pendingProps,a=s.revealOrder,i=s.tail;if(Jn(e,t,s.children,n),s=Kt.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ij(e,n,t);else if(e.tag===19)ij(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Mt(Kt,s),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ah(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),kp(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ah(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}kp(t,!0,n,null,i);break;case"together":kp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Em(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ja(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ao|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ve(153));if(t.child!==null){for(e=t.child,n=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}
vendor: 5,271 bytes, line 40
40function dM(e,t,n){switch(t.tag){case 3:j1(t),Tl();break;case 5:ZN(t);break;case 1:vr(t.type)&&Jm(t);break;case 4:ty(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,a=t.memoizedProps.value;Mt(nh,s._currentValue),s._currentValue=a;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Mt(Kt,Kt.current&1),t.flags|=128,null):n&t.child.childLanes?_1(e,t,n):(Mt(Kt,Kt.current&1),e=ja(e,t,n),e!==null?e.sibling:null);Mt(Kt,Kt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return N1(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Mt(Kt,Kt.current),s)break;return null;case 22:case 23:return t.lanes=0,w1(e,t,n)}return ja(e,t,n)}var S1,gx,k1,C1;S1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gx=function(){};k1=function(e,t,n,s){var a=e.memoizedProps;if(a!==s){e=t.stateNode,Gi(qs.current);var i=null;switch(n){case"input":a=Fg(e,a),s=Fg(e,s),i=[];break;case"select":a=Qt({},a,{value:void 0}),s=Qt({},s,{value:void 0}),i=[];break;case"textarea":a=Ug(e,a),s=Ug(e,s),i=[];break;default:typeof a.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Xm)}Hg(n,s);var o;n=null;for(d in a)if(!s.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ad.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in s){var c=s[d];if(l=a!=null?a[d]:void 0,s.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ad.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Lt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};C1=function(e,t,n,s){n!==s&&(t.flags|=4)};function yc(e,t){if(!Bt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Wn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags&14680064,s|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function uM(e,t,n){var s=t.pendingProps;switch(Gv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(t),null;case 1:return vr(t.type)&&Qm(),Wn(t),null;case 3:return s=t.stateNode,Rl(),Ft(xr),Ft(Gn),ry(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Yu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gs!==null&&(Nx(gs),gs=null))),gx(e,t),Wn(t),null;case 5:ny(t);var a=Gi(xd.current);if(n=t.type,e!==null&&t.stateNode!=null)k1(e,t,n,s,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(ve(166));return Wn(t),null}if(e=Gi(qs.current),Yu(t)){s=t.stateNode,n=t.type;var i=t.memoizedProps;switch(s[zs]=t,s[pd]=i,e=(t.mode&1)!==0,n){case"dialog":Lt("cancel",s),Lt("close",s);break;case"iframe":case"object":case"embed":Lt("load",s);break;case"video":case"audio":for(a=0;a<Uc.length;a++)Lt(Uc[a],s);break;case"source":Lt("error",s);break;case"img":case"image":case"link":Lt("error",s),Lt("load",s);break;case"details":Lt("toggle",s);break;case"input":pb(s,i),Lt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},Lt("invalid",s);break;case"textarea":xb(s,i),Lt("invalid",s)}Hg(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?s.textContent!==l&&(i.suppressHydrationWarning!==!0&&Vu(s.textContent,l,e),a=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Vu(s.textContent,l,e),a=["children",""+l]):ad.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Lt("scroll",s)}switch(n){case"input":Fu(s),gb(s,i,!0);break;case"textarea":Fu(s),vb(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=Xm)}s=a,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tN(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[zs]=t,e[pd]=s,S1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wg(n,s),n){case"dialog":Lt("cancel",e),Lt("close",e),a=s;break;case"iframe":case"object":case"embed":Lt("load",e),a=s;break;case"video":case"audio":for(a=0;a<Uc.length;a++)Lt(Uc[a],e);a=s;break;case"source":Lt("error",e),a=s;break;case"img":case"image":case"link":Lt("error",e),Lt("load",e),a=s;break;case"details":Lt("toggle",e),a=s;break;case"input":pb(e,s),a=Fg(e,s),Lt("invalid",e);break;case"option":a=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},a=Qt({},s,{value:void 0}),Lt("invalid",e);break;case"textarea":xb(e,s),a=Ug(e,s),Lt("invalid",e);break;default:a=s}Hg(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?sN(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&nN(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&id(e,c):typeof c=="number"&&id(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ad.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Lt("scroll",e):c!=null&&Mv(e,i,c,o))}switch(n){case"input":Fu(e),gb(e,s,!1);break;case"textarea":Fu(e),vb(e);break;case"option":s.value!=null&&e.setAttribute("value",""+ui(s.value));break;case"select":e.multiple=!!s.multiple,i=s.value,i!=null?il(e,!!s.multiple,i,!1):s.defaultValue!=null&&il(e,!!s.multiple,s.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Xm)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wn(t),null;case 6:if(e&&t.stateNode!=null)C1(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(ve(166));if(n=Gi(xd.current),Gi(qs.current),Yu(t)){if(s=t.stateNode,n=t.memoizedProps,s[zs]=t,(i=s.nodeValue!==n)&&(e=Mr,e!==null))switch(e.tag){case 3:Vu(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vu(s.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[zs]=t,t.stateNode=s}return Wn(t),null;case 13:if(Ft(Kt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Bt&&Rr!==null&&t.mode&1&&!(t.flags&128))qN(),Tl(),t.flags|=98560,i=!1;else if(i=Yu(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(ve(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ve(317));i[zs]=t}else Tl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wn(t),i=!1}else gs!==null&&(Nx(gs),gs=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||Kt.current&1?jn===0&&(jn=3):py())),t.updateQueue!==null&&(t.flags|=4),Wn(t),null);case 4:return Rl(),gx(e,t),e===null&&hd(t.stateNode.containerInfo),Wn(t),null;case 10:return Qv(t.type._context),Wn(t),null;case 17:return vr(t.type)&&Qm(),Wn(t),null;case 19:if(Ft(Kt),i=t.memoizedState,i===null)return Wn(t),null;if(s=(t.flags&128)!==0,o=i.rendering,o===null)if(s)yc(i,!1);else{if(jn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ah(e),o!==null){for(t.flags|=128,yc(i,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)i=n,e=s,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Mt(Kt,Kt.current&1|2),t.child}e=e.sibling}i.tail!==null&&sn()>Dl&&(t.flags|=128,s=!0,yc(i,!1),t.lanes=4194304)}else{if(!s)if(e=ah(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),yc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Bt)return Wn(t),null}else 2*sn()-i.renderingStartTime>Dl&&n!==1073741824&&(t.flags|=128,s=!0,yc(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=sn(),t.sibling=null,n=Kt.current,Mt(Kt,s?n&1|2:n&1),t):(Wn(t),null);case 22:case 23:return fy(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Er&1073741824&&(Wn(t),t.subtreeFlags&6&&(t.flags|=8192)):Wn(t),null;case 24:return null;case 25:return null}throw Error(ve(156,t.tag))}function mM(e,t){switch(Gv(t),t.tag){case 1:return vr(t.type)&&Qm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 23,785 bytes, line 40
40case 3:return Rl(),Ft(xr),Ft(Gn),ry(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ny(t),null;case 13:if(Ft(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ve(340));Tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ft(Kt),null;case 4:return Rl(),null;case 10:return Qv(t.type._context),null;case 22:case 23:return fy(),null;case 24:return null;default:return null}}var Zu=!1,Yn=!1,hM=typeof WeakSet=="function"?WeakSet:Set,Te=null;function el(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){nn(e,t,s)}else n.current=null}function xx(e,t,n){try{n()}catch(s){nn(e,t,s)}}var oj=!1;function fM(e,t){if(ex=Gm,e=RN(),Vv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var a=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,u=0,h=e,f=null;t:for(;;){for(var p;h!==n||a!==0&&h.nodeType!==3||(l=o+a),h!==i||s!==0&&h.nodeType!==3||(c=o+s),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++d===a&&(l=o),f===i&&++u===s&&(c=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tx={focusedElem:e,selectionRange:n},Gm=!1,Te=t;Te!==null;)if(t=Te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Te=e;else for(;Te!==null;){t=Te;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,b=w.memoizedState,x=t.stateNode,g=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:us(t.type,v),b);x.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(j){nn(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Te=e;break}Te=t.return}return w=oj,oj=!1,w}function Jc(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&xx(t,n,i)}a=a.next}while(a!==s)}}function Qh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function vx(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function A1(e){var t=e.alternate;t!==null&&(e.alternate=null,A1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zs],delete t[pd],delete t[sx],delete t[ZR],delete t[XR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function E1(e){return e.tag===5||e.tag===3||e.tag===4}function lj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yx(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xm));else if(s!==4&&(e=e.child,e!==null))for(yx(e,t,n),e=e.sibling;e!==null;)yx(e,t,n),e=e.sibling}function wx(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(wx(e,t,n),e=e.sibling;e!==null;)wx(e,t,n),e=e.sibling}var Ln=null,fs=!1;function Ra(e,t,n){for(n=n.child;n!==null;)T1(e,t,n),n=n.sibling}function T1(e,t,n){if(Ws&&typeof Ws.onCommitFiberUnmount=="function")try{Ws.onCommitFiberUnmount(Wh,n)}catch{}switch(n.tag){case 5:Yn||el(n,t);case 6:var s=Ln,a=fs;Ln=null,Ra(e,t,n),Ln=s,fs=a,Ln!==null&&(fs?(e=Ln,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ln.removeChild(n.stateNode));break;case 18:Ln!==null&&(fs?(e=Ln,n=n.stateNode,e.nodeType===8?yp(e.parentNode,n):e.nodeType===1&&yp(e,n),dd(e)):yp(Ln,n.stateNode));break;case 4:s=Ln,a=fs,Ln=n.stateNode.containerInfo,fs=!0,Ra(e,t,n),Ln=s,fs=a;break;case 0:case 11:case 14:case 15:if(!Yn&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){a=s=s.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&xx(n,t,o),a=a.next}while(a!==s)}Ra(e,t,n);break;case 1:if(!Yn&&(el(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){nn(n,t,l)}Ra(e,t,n);break;case 21:Ra(e,t,n);break;case 22:n.mode&1?(Yn=(s=Yn)||n.memoizedState!==null,Ra(e,t,n),Yn=s):Ra(e,t,n);break;default:Ra(e,t,n)}}function cj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hM),t.forEach(function(s){var a=_M.bind(null,e,s);n.has(s)||(n.add(s),s.then(a,a))})}}function os(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var a=n[s];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Ln=l.stateNode,fs=!1;break e;case 3:Ln=l.stateNode.containerInfo,fs=!0;break e;case 4:Ln=l.stateNode.containerInfo,fs=!0;break e}l=l.return}if(Ln===null)throw Error(ve(160));T1(i,o,a),Ln=null,fs=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){nn(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)P1(t,e),t=t.sibling}function P1(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(os(t,e),Rs(e),s&4){try{Jc(3,e,e.return),Qh(3,e)}catch(v){nn(e,e.return,v)}try{Jc(5,e,e.return)}catch(v){nn(e,e.return,v)}}break;case 1:os(t,e),Rs(e),s&512&&n!==null&&el(n,n.return);break;case 5:if(os(t,e),Rs(e),s&512&&n!==null&&el(n,n.return),e.flags&32){var a=e.stateNode;try{id(a,"")}catch(v){nn(e,e.return,v)}}if(s&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&J_(a,i),Wg(l,o);var d=Wg(l,i);for(o=0;o<c.length;o+=2){var u=c[o],h=c[o+1];u==="style"?sN(a,h):u==="dangerouslySetInnerHTML"?nN(a,h):u==="children"?id(a,h):Mv(a,u,h,d)}switch(l){case"input":$g(a,i);break;case"textarea":eN(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?il(a,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?il(a,!!i.multiple,i.defaultValue,!0):il(a,!!i.multiple,i.multiple?[]:"",!1))}a[pd]=i}catch(v){nn(e,e.return,v)}}break;case 6:if(os(t,e),Rs(e),s&4){if(e.stateNode===null)throw Error(ve(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){nn(e,e.return,v)}}break;case 3:if(os(t,e),Rs(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{dd(t.containerInfo)}catch(v){nn(e,e.return,v)}break;case 4:os(t,e),Rs(e);break;case 13:os(t,e),Rs(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(my=sn())),s&4&&cj(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Yn=(d=Yn)||u,os(t,e),Yn=d):os(t,e),Rs(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(Te=e,u=e.child;u!==null;){for(h=Te=u;Te!==null;){switch(f=Te,p=f.child,f.tag){case 0:case 11:case 14:case 15:Jc(4,f,f.return);break;case 1:el(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){nn(s,n,v)}}break;case 5:el(f,f.return);break;case 22:if(f.memoizedState!==null){uj(h);continue}}p!==null?(p.return=f,Te=p):uj(h)}u=u.sibling}e:for(u=null,h=e;;){if(h.tag===5){if(u===null){u=h;try{a=h.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=rN("display",o))}catch(v){nn(e,e.return,v)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){nn(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:os(t,e),Rs(e),s&4&&cj(e);break;case 21:break;default:os(t,e),Rs(e)}}function Rs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(E1(n)){var s=n;break e}n=n.return}throw Error(ve(160))}switch(s.tag){case 5:var a=s.stateNode;s.flags&32&&(id(a,""),s.flags&=-33);var i=lj(e);wx(e,i,a);break;case 3:case 4:var o=s.stateNode.containerInfo,l=lj(e);yx(e,l,o);break;default:throw Error(ve(161))}}catch(c){nn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pM(e,t,n){Te=e,R1(e)}function R1(e,t,n){for(var s=(e.mode&1)!==0;Te!==null;){var a=Te,i=a.child;if(a.tag===22&&s){var o=a.memoizedState!==null||Zu;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Yn;l=Zu;var d=Yn;if(Zu=o,(Yn=c)&&!d)for(Te=a;Te!==null;)o=Te,c=o.child,o.tag===22&&o.memoizedState!==null?mj(a):c!==null?(c.return=o,Te=c):mj(a);for(;i!==null;)Te=i,R1(i),i=i.sibling;Te=a,Zu=l,Yn=d}dj(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Te=i):dj(e)}}function dj(e){for(;Te!==null;){var t=Te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Yn||Qh(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Yn)if(n===null)s.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:us(t.type,n.memoizedProps);s.componentDidUpdate(a,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Gb(t,i,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Gb(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&dd(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ve(163))}Yn||t.flags&512&&vx(t)}catch(f){nn(t,t.return,f)}}if(t===e){Te=null;break}if(n=t.sibling,n!==null){n.return=t.return,Te=n;break}Te=t.return}}function uj(e){for(;Te!==null;){var t=Te;if(t===e){Te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Te=n;break}Te=t.return}}function mj(e){for(;Te!==null;){var t=Te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qh(4,t)}catch(c){nn(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var a=t.return;try{s.componentDidMount()}catch(c){nn(t,a,c)}}var i=t.return;try{vx(t)}catch(c){nn(t,i,c)}break;case 5:var o=t.return;try{vx(t)}catch(c){nn(t,o,c)}}}catch(c){nn(t,t.return,c)}if(t===e){Te=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Te=l;break}Te=t.return}}var gM=Math.ceil,lh=Aa.ReactCurrentDispatcher,dy=Aa.ReactCurrentOwner,Gr=Aa.ReactCurrentBatchConfig,wt=0,Mn=null,on=null,$n=0,Er=0,tl=Ei(0),jn=0,bd=null,ao=0,Jh=0,uy=0,ed=null,mr=null,my=0,Dl=1/0,ca=null,ch=!1,bx=null,oi=null,Xu=!1,Ja=null,dh=0,td=0,jx=null,Tm=-1,Pm=0;function rr(){return wt&6?sn():Tm!==-1?Tm:Tm=sn()}function li(e){return e.mode&1?wt&2&&$n!==0?$n&-$n:JR.transition!==null?(Pm===0&&(Pm=gN()),Pm):(e=Ct,e!==0||(e=window.event,e=e===void 0?16:_N(e.type)),e):1}function ws(e,t,n,s){if(50<td)throw td=0,jx=null,Error(ve(185));Jd(e,n,s),(!(wt&2)||e!==Mn)&&(e===Mn&&(!(wt&2)&&(Jh|=n),jn===4&&Wa(e,$n)),yr(e,s),n===1&&wt===0&&!(t.mode&1)&&(Dl=sn()+500,Kh&&Ti()))}function yr(e,t){var n=e.callbackNode;JP(e,t);var s=Ym(e,e===Mn?$n:0);if(s===0)n!==null&&bb(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&bb(n),t===1)e.tag===0?QR(hj.bind(null,e)):BN(hj.bind(null,e)),GR(function(){!(wt&6)&&Ti()}),n=null;else{switch(xN(s)){case 1:n=Fv;break;case 4:n=fN;break;case 16:n=Vm;break;case 536870912:n=pN;break;default:n=Vm}n=z1(n,M1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function M1(e,t){if(Tm=-1,Pm=0,wt&6)throw Error(ve(327));var n=e.callbackNode;if(ul()&&e.callbackNode!==n)return null;var s=Ym(e,e===Mn?$n:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=uh(e,s);else{t=s;var a=wt;wt|=2;var i=O1();(Mn!==e||$n!==t)&&(ca=null,Dl=sn()+500,Ji(e,t));do try{yM();break}catch(l){D1(e,l)}while(!0);Xv(),lh.current=i,wt=a,on!==null?t=0:(Mn=null,$n=0,t=jn)}if(t!==0){if(t===2&&(a=Kg(e),a!==0&&(s=a,t=_x(e,a))),t===1)throw n=bd,Ji(e,0),Wa(e,s),yr(e,sn()),n;if(t===6)Wa(e,s);else{if(a=e.current.alternate,!(s&30)&&!xM(a)&&(t=uh(e,s),t===2&&(i=Kg(e),i!==0&&(s=i,t=_x(e,i))),t===1))throw n=bd,Ji(e,0),Wa(e,s),yr(e,sn()),n;switch(e.finishedWork=a,e.finishedLanes=s,t){case 0:case 1:throw Error(ve(345));case 2:Bi(e,mr,ca);break;case 3:if(Wa(e,s),(s&130023424)===s&&(t=my+500-sn(),10<t)){if(Ym(e,0)!==0)break;if(a=e.suspendedLanes,(a&s)!==s){rr(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=rx(Bi.bind(null,e,mr,ca),t);break}Bi(e,mr,ca);break;case 4:if(Wa(e,s),(s&4194240)===s)break;for(t=e.eventTimes,a=-1;0<s;){var o=31-ys(s);i=1<<o,o=t[o],o>a&&(a=o),s&=~i}if(s=a,s=sn()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*gM(s/1960))-s,10<s){e.timeoutHandle=rx(Bi.bind(null,e,mr,ca),s);break}Bi(e,mr,ca);break;case 5:Bi(e,mr,ca);break;default:throw Error(ve(329))}}}return yr(e,sn()),e.callbackNode===n?M1.bind(null,e):null}function _x(e,t){var n=ed;return e.current.memoizedState.isDehydrated&&(Ji(e,t).flags|=256),e=uh(e,t),e!==2&&(t=mr,mr=n,t!==null&&Nx(t)),e}function Nx(e){mr===null?mr=e:mr.push.apply(mr,e)}function xM(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var a=n[s],i=a.getSnapshot;a=a.value;try{if(!js(i(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wa(e,t){for(t&=~uy,t&=~Jh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ys(t),s=1<<n;e[n]=-1,t&=~s}}function hj(e){if(wt&6)throw Error(ve(327));ul();var t=Ym(e,0);if(!(t&1))return yr(e,sn()),null;var n=uh(e,t);if(e.tag!==0&&n===2){var s=Kg(e);s!==0&&(t=s,n=_x(e,s))}if(n===1)throw n=bd,Ji(e,0),Wa(e,t),yr(e,sn()),n;if(n===6)throw Error(ve(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Bi(e,mr,ca),yr(e,sn()),null}function hy(e,t){var n=wt;wt|=1;try{return e(t)}finally{wt=n,wt===0&&(Dl=sn()+500,Kh&&Ti())}}function io(e){Ja!==null&&Ja.tag===0&&!(wt&6)&&ul();var t=wt;wt|=1;var n=Gr.transition,s=Ct;try{if(Gr.transition=null,Ct=1,e)return e()}finally{Ct=s,Gr.transition=n,wt=t,!(wt&6)&&Ti()}}function fy(){Er=tl.current,Ft(tl)}function Ji(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YR(n)),on!==null)for(n=on.return;n!==null;){var s=n;switch(Gv(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Qm();break;case 3:Rl(),Ft(xr),Ft(Gn),ry();break;case 5:ny(s);break;case 4:Rl();break;case 13:Ft(Kt);break;case 19:Ft(Kt);break;case 10:Qv(s.type._context);break;case 22:case 23:fy()}n=n.return}if(Mn=e,on=e=ci(e.current,null),$n=Er=t,jn=0,bd=null,uy=Jh=ao=0,mr=ed=null,Yi!==null){for(t=0;t<Yi.length;t++)if(n=Yi[t],s=n.interleaved,s!==null){n.interleaved=null;var a=s.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,s.next=o}n.pending=s}Yi=null}return e}function D1(e,t){do{var n=on;try{if(Xv(),Cm.current=oh,ih){for(var s=Zt.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}ih=!1}if(so=0,Pn=wn=Zt=null,Qc=!1,vd=0,dy.current=null,n===null||n.return===null){jn=1,bd=t,on=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=$n,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=ej(o);if(p!==null){p.flags&=-257,tj(p,o,l,i,t),p.mode&1&&Jb(i,d,t),t=p,c=d;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){Jb(i,d,t),py();break e}c=Error(ve(426))}}else if(Bt&&l.mode&1){var b=ej(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),tj(b,o,l,i,t),Kv(Ml(c,l));break e}}i=c=Ml(c,l),jn!==4&&(jn=2),ed===null?ed=[i]:ed.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=x1(i,c,t);Yb(i,x);break e;case 1:l=c;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(oi===null||!oi.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=v1(i,l,t);Yb(i,j);break e}}i=i.return}while(i!==null)}L1(n)}catch(N){t=N,on===n&&n!==null&&(on=n=n.return);continue}break}while(!0)}function O1(){var e=lh.current;return lh.current=oh,e===null?oh:e}function py(){(jn===0||jn===3||jn===2)&&(jn=4),Mn===null||!(ao&268435455)&&!(Jh&268435455)||Wa(Mn,$n)}function uh(e,t){var n=wt;wt|=2;var s=O1();(Mn!==e||$n!==t)&&(ca=null,Ji(e,t));do try{vM();break}catch(a){D1(e,a)}while(!0);if(Xv(),wt=n,lh.current=s,on!==null)throw Error(ve(261));return Mn=null,$n=0,jn}function vM(){for(;on!==null;)I1(on)}function yM(){for(;on!==null&&!WP();)I1(on)}function I1(e){var t=$1(e.alternate,e,Er);e.memoizedProps=e.pendingProps,t===null?L1(e):on=t,dy.current=null}function L1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mM(n,t),n!==null){n.flags&=32767,on=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{jn=6,on=null;return}}else if(n=uM(n,t,Er),n!==null){on=n;return}if(t=t.sibling,t!==null){on=t;return}on=t=e}while(t!==null);jn===0&&(jn=5)}function Bi(e,t,n){var s=Ct,a=Gr.transition;try{Gr.transition=null,Ct=1,wM(e,t,n,s)}finally{Gr.transition=a,Ct=s}return null}function wM(e,t,n,s){do ul();while(Ja!==null);if(wt&6)throw Error(ve(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ve(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eR(e,i),e===Mn&&(on=Mn=null,$n=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xu||(Xu=!0,z1(Vm,function(){return ul(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Gr.transition,Gr.transition=null;var o=Ct;Ct=1;var l=wt;wt|=4,dy.current=null,fM(e,n),P1(n,e),zR(tx),Gm=!!ex,tx=ex=null,e.current=n,pM(n),qP(),wt=l,Ct=o,Gr.transition=i}else e.current=n;if(Xu&&(Xu=!1,Ja=e,dh=a),i=e.pendingLanes,i===0&&(oi=null),GP(n.stateNode),yr(e,sn()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],s(a.value,{componentStack:a.stack,digest:a.digest});if(ch)throw ch=!1,e=bx,bx=null,e;return dh&1&&e.tag!==0&&ul(),i=e.pendingLanes,i&1?e===jx?td++:(td=0,jx=e):td=0,Ti(),null}function ul(){if(Ja!==null){var e=xN(dh),t=Gr.transition,n=Ct;try{if(Gr.transition=null,Ct=16>e?16:e,Ja===null)var s=!1;else{if(e=Ja,Ja=null,dh=0,wt&6)throw Error(ve(331));var a=wt;for(wt|=4,Te=e.current;Te!==null;){var i=Te,o=i.child;if(Te.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Te=d;Te!==null;){var u=Te;switch(u.tag){case 0:case 11:case 15:Jc(8,u,i)}var h=u.child;if(h!==null)h.return=u,Te=h;else for(;Te!==null;){u=Te;var f=u.sibling,p=u.return;if(A1(u),u===d){Te=null;break}if(f!==null){f.return=p,Te=f;break}Te=p}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}Te=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Te=o;else e:for(;Te!==null;){if(i=Te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Jc(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,Te=x;break e}Te=i.return}}var g=e.current;for(Te=g;Te!==null;){o=Te;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,Te=y;else e:for(o=g;Te!==null;){if(l=Te,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Qh(9,l)}}catch(N){nn(l,l.return,N)}if(l===o){Te=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,Te=j;break e}Te=l.return}}if(wt=a,Ti(),Ws&&typeof Ws.onPostCommitFiberRoot=="function")try{Ws.onPostCommitFiberRoot(Wh,e)}catch{}s=!0}return s}finally{Ct=n,Gr.transition=t}}return!1}function fj(e,t,n){t=Ml(n,t),t=x1(e,t,1),e=ii(e,t,1),t=rr(),e!==null&&(Jd(e,1,t),yr(e,t))}function nn(e,t,n){if(e.tag===3)fj(e,e,n);else for(;t!==null;){if(t.tag===3){fj(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(oi===null||!oi.has(s))){e=Ml(n,e),e=v1(t,e,1),t=ii(t,e,1),e=rr(),t!==null&&(Jd(t,1,e),yr(t,e));break}}t=t.return}}function bM(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=rr(),e.pingedLanes|=e.suspendedLanes&n,Mn===e&&($n&n)===n&&(jn===4||jn===3&&($n&130023424)===$n&&500>sn()-my?Ji(e,0):uy|=n),yr(e,t)}function F1(e,t){t===0&&(e.mode&1?(t=Uu,Uu<<=1,!(Uu&130023424)&&(Uu=4194304)):t=1);var n=rr();e=ba(e,t),e!==null&&(Jd(e,t,n),yr(e,n))}function jM(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),F1(e,n)}function _M(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(ve(314))}s!==null&&s.delete(t),F1(e,n)}var $1;$1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xr.current)fr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return fr=!1,dM(e,t,n);fr=!!(e.flags&131072)}else fr=!1,Bt&&t.flags&1048576&&HN(t,th,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Em(e,t),e=t.pendingProps;var a=El(t,Gn.current);dl(t,n),a=ay(null,t,s,e,a,n);var i=iy();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vr(s)?(i=!0,Jm(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ey(t),a.updater=Xh,t.stateNode=a,a._reactInternals=t,dx(t,s,e,n),t=hx(null,t,s,!0,i,n)):(t.tag=0,Bt&&i&&Yv(t),Jn(null,t,a,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Em(e,t),e=t.pendingProps,a=s._init,s=a(s._payload),t.type=s,a=t.tag=SM(s),e=us(s,e),a){case 0:t=mx(null,t,s,e,n);break e;case 1:t=sj(null,t,s,e,n);break e;case 11:t=nj(null,t,s,e,n);break e;case 14:t=rj(null,t,s,us(s.type,e),n);break e}throw Error(ve(306,s,""))}return t;case 0:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:us(s,a),mx(e,t,s,a,n);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:us(s,a),sj(e,t,s,a,n);case 3:e:{if(j1(t),e===null)throw Error(ve(387));s=t.pendingProps,i=t.memoizedState,a=i.element,KN(e,t),sh(t,s,null,n);var o=t.memoizedState;if(s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Ml(Error(ve(423)),t),t=aj(e,t,s,n,a);break e}else if(s!==a){a=Ml(Error(ve(424)),t),t=aj(e,t,s,n,a);break e}else for(Rr=ai(t.stateNode.containerInfo.firstChild),Mr=t,Bt=!0,gs=null,n=YN(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;
vendor: 4,126 bytes, line 40
40else{if(Tl(),s===a){t=ja(e,t,n);break e}Jn(e,t,s,n)}t=t.child}return t;case 5:return ZN(t),e===null&&ox(t),s=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,nx(s,a)?o=null:i!==null&&nx(s,i)&&(t.flags|=32),b1(e,t),Jn(e,t,o,n),t.child;case 6:return e===null&&ox(t),null;case 13:return _1(e,t,n);case 4:return ty(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Pl(t,null,s,n):Jn(e,t,s,n),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:us(s,a),nj(e,t,s,a,n);case 7:return Jn(e,t,t.pendingProps,n),t.child;case 8:return Jn(e,t,t.pendingProps.children,n),t.child;case 12:return Jn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,Mt(nh,s._currentValue),s._currentValue=o,i!==null)if(js(i.value,o)){if(i.children===a.children&&!xr.current){t=ja(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(i.tag===1){c=ga(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),lx(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ve(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),lx(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Jn(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,dl(t,n),a=Qr(a),s=s(a),t.flags|=1,Jn(e,t,s,n),t.child;case 14:return s=t.type,a=us(s,t.pendingProps),a=us(s.type,a),rj(e,t,s,a,n);case 15:return y1(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:us(s,a),Em(e,t),t.tag=1,vr(s)?(e=!0,Jm(t)):e=!1,dl(t,n),g1(t,s,a),dx(t,s,a,n),hx(null,t,s,!0,e,n);case 19:return N1(e,t,n);case 22:return w1(e,t,n)}throw Error(ve(156,t.tag))};function z1(e,t){return hN(e,t)}function NM(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,n,s){return new NM(e,t,n,s)}function gy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SM(e){if(typeof e=="function")return gy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ov)return 11;if(e===Iv)return 14}return 2}function ci(e,t){var n=e.alternate;return n===null?(n=Yr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Rm(e,t,n,s,a,i){var o=2;if(s=e,typeof e=="function")gy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case qo:return eo(n.children,a,i,t);case Dv:o=8,a|=8;break;case Dg:return e=Yr(12,n,t,a|2),e.elementType=Dg,e.lanes=i,e;case Og:return e=Yr(13,n,t,a),e.elementType=Og,e.lanes=i,e;case Ig:return e=Yr(19,n,t,a),e.elementType=Ig,e.lanes=i,e;case Z_:return ef(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G_:o=10;break e;case K_:o=9;break e;case Ov:o=11;break e;case Iv:o=14;break e;case Ua:o=16,s=null;break e}throw Error(ve(130,e==null?e:typeof e,""))}return t=Yr(o,n,t,a),t.elementType=e,t.type=s,t.lanes=i,t}function eo(e,t,n,s){return e=Yr(7,e,s,t),e.lanes=n,e}function ef(e,t,n,s){return e=Yr(22,e,s,t),e.elementType=Z_,e.lanes=n,e.stateNode={isHidden:!1},e}
vendor: 5,695 bytes, line 40
40function Cp(e,t,n){return e=Yr(6,e,null,t),e.lanes=n,e}function Ap(e,t,n){return t=Yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kM(e,t,n,s,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lp(0),this.expirationTimes=lp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lp(0),this.identifierPrefix=s,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function xy(e,t,n,s,a,i,o,l,c){return e=new kM(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Yr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ey(i),e}function CM(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Wo,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function U1(e){if(!e)return mi;e=e._reactInternals;e:{if(vo(e)!==e||e.tag!==1)throw Error(ve(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ve(171))}if(e.tag===1){var n=e.type;if(vr(n))return UN(e,n,t)}return t}function B1(e,t,n,s,a,i,o,l,c){return e=xy(n,s,!0,e,a,i,o,l,c),e.context=U1(null),n=e.current,s=rr(),a=li(n),i=ga(s,a),i.callback=t??null,ii(n,i,a),e.current.lanes=a,Jd(e,a,s),yr(e,s),e}function tf(e,t,n,s){var a=t.current,i=rr(),o=li(a);return n=U1(n),t.context===null?t.context=n:t.pendingContext=n,t=ga(i,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=ii(a,t,o),e!==null&&(ws(e,a,o,i),km(e,a,o)),o}function mh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function pj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vy(e,t){pj(e,t),(e=e.alternate)&&pj(e,t)}function AM(){return null}var H1=typeof reportError=="function"?reportError:function(e){console.error(e)};function yy(e){this._internalRoot=e}nf.prototype.render=yy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ve(409));tf(e,t,null,null)};nf.prototype.unmount=yy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;io(function(){tf(null,e,null,null)}),t[wa]=null}};function nf(e){this._internalRoot=e}nf.prototype.unstable_scheduleHydration=function(e){if(e){var t=wN();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ha.length&&t!==0&&t<Ha[n].priority;n++);Ha.splice(n,0,e),n===0&&jN(e)}};function wy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function gj(){}function EM(e,t,n,s,a){if(a){if(typeof s=="function"){var i=s;s=function(){var d=mh(o);i.call(d)}}var o=B1(t,s,e,0,null,!1,!1,"",gj);return e._reactRootContainer=o,e[wa]=o.current,hd(e.nodeType===8?e.parentNode:e),io(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof s=="function"){var l=s;s=function(){var d=mh(c);l.call(d)}}var c=xy(e,0,!1,null,null,!1,!1,"",gj);return e._reactRootContainer=c,e[wa]=c.current,hd(e.nodeType===8?e.parentNode:e),io(function(){tf(t,c,n,s)}),c}function sf(e,t,n,s,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=mh(o);l.call(c)}}tf(t,o,e,a)}else o=EM(n,t,e,a,s);return mh(o)}vN=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=zc(t.pendingLanes);n!==0&&($v(t,n|1),yr(t,sn()),!(wt&6)&&(Dl=sn()+500,Ti()))}break;case 13:io(function(){var s=ba(e,1);if(s!==null){var a=rr();ws(s,e,1,a)}}),vy(e,1)}};zv=function(e){if(e.tag===13){var t=ba(e,134217728);if(t!==null){var n=rr();ws(t,e,134217728,n)}vy(e,134217728)}};yN=function(e){if(e.tag===13){var t=li(e),n=ba(e,t);if(n!==null){var s=rr();ws(n,e,t,s)}vy(e,t)}};wN=function(){return Ct};bN=function(e,t){var n=Ct;try{return Ct=e,t()}finally{Ct=n}};Vg=function(e,t,n){switch(t){case"input":if($g(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var a=Gh(s);if(!a)throw Error(ve(90));Q_(s),$g(s,a)}}}break;case"textarea":eN(e,n);break;case"select":t=n.value,t!=null&&il(e,!!n.multiple,t,!1)}};oN=hy;lN=io;var TM={usingClientEntryPoint:!1,Events:[tu,Ko,Gh,aN,iN,hy]},wc={findFiberByHostInstance:Vi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PM={bundleType:wc.bundleType,version:wc.version,rendererPackageName:wc.rendererPackageName,rendererConfig:wc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Aa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=uN(e),e===null?null:e.stateNode},findFiberByHostInstance:wc.findFiberByHostInstance||AM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qu.isDisabled&&Qu.supportsFiber)try{Wh=Qu.inject(PM),Ws=Qu}catch{}}Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TM;Fr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wy(t))throw Error(ve(200));return CM(e,t,null,n)};Fr.createRoot=function(e,t){if(!wy(e))throw Error(ve(299));var n=!1,s="",a=H1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=xy(e,1,!1,null,null,n,!1,s,a),e[wa]=t.current,hd(e.nodeType===8?e.parentNode:e),new yy(t)};Fr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ve(188)):(e=Object.keys(e).join(","),Error(ve(268,e)));return e=uN(t),e=e===null?null:e.stateNode,e};Fr.flushSync=function(e){return io(e)};Fr.hydrate=function(e,t,n){if(!rf(t))throw Error(ve(200));return sf(null,e,t,!0,n)};Fr.hydrateRoot=function(e,t,n){if(!wy(e))throw Error(ve(405));var s=n!=null&&n.hydratedSources||null,a=!1,i="",o=H1;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=B1(t,null,e,1,n??null,a,!1,i,o),e[wa]=t.current,hd(e),s)for(e=0;e<s.length;e++)n=s[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new nf(t)};Fr.render=function(e,t,n){if(!rf(t))throw Error(ve(200));return sf(null,e,t,!1,n)};Fr.unmountComponentAtNode=function(e){if(!rf(e))throw Error(ve(40));return e._reactRootContainer?(io(function(){sf(null,null,e,!1,function(){e._reactRootContainer=null,e[wa]=null})}),!0):!1};Fr.unstable_batchedUpdates=hy;Fr.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!rf(n))throw Error(ve(200));if(e==null||e._reactInternals===void 0)throw Error(ve(38));return sf(e,t,n,!1,s)};Fr.version="18.3.1-next-f1338f8080-20240426";function W1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(W1)}catch(e){console.error(e)}}W1(),W_.exports=Fr;var yo=W_.exports;const q1=R_(yo);var V1,xj=yo;V1=xj.createRoot,xj.hydrateRoot;const RM=1,MM=1e6;let Ep=0;function DM(){return Ep=(Ep+1)%Number.MAX_SAFE_INTEGER,Ep.toString()}const Tp=new Map,vj=e=>{if(Tp.has(e))return;const t=setTimeout(()=>{Tp.delete(e),nd({type:"REMOVE_TOAST",toastId:e})},MM);Tp.set(e,t)},OM=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,RM)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?vj(n):e.toasts.forEach(s=>{vj(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Mm=[];let Dm={toasts:[]};function nd(e){Dm=OM(Dm,e),Mm.forEach(t=>{t(Dm)})}function IM({...e}){const t=DM(),n=a=>nd({type:"UPDATE_TOAST",toast:{...a,id:t}}),s=()=>nd({type:"DISMISS_TOAST",toastId:t});return nd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||s()}}}),{id:t,dismiss:s,update:n}}function Sn(){const[e,t]=m.useState(Dm);return m.useEffect(()=>(Mm.push(t),()=>{const n=Mm.indexOf(t);n>-1&&Mm.splice(n,1)}),[e]),{...e,toast:IM,dismiss:n=>nd({type:"DISMISS_TOAST",toastId:n})}}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function LM(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function af(...e){return t=>e.forEach(n=>LM(n,t))}function ct(...e){return m.useCallback(af(...e),e)}function FM(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];function d(h){const{scope:f,children:p,...w}=h,v=(f==null?void 0:f[e][c])||l,b=m.useMemo(()=>w,Object.values(w));return r.jsx(v.Provider,{value:b,children:p})}function u(h,f){const p=(f==null?void 0:f[e][c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[s,$M(a,...t)]}function $M(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));
vendor: 9,397 bytes, line 40
40return function(i){const o=s.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var jr=m.forwardRef((e,t)=>{const{children:n,...s}=e,a=m.Children.toArray(n),i=a.find(zM);if(i){const o=i.props.children,l=a.map(c=>c===i?m.Children.count(o)>1?m.Children.only(null):m.isValidElement(o)?o.props.children:null:c);return r.jsx(Sx,{...s,ref:t,children:m.isValidElement(o)?m.cloneElement(o,void 0,l):null})}return r.jsx(Sx,{...s,ref:t,children:n})});jr.displayName="Slot";var Sx=m.forwardRef((e,t)=>{const{children:n,...s}=e;if(m.isValidElement(n)){const a=BM(n);return m.cloneElement(n,{...UM(s,n.props),ref:t?af(t,a):a})}return m.Children.count(n)>1?m.Children.only(null):null});Sx.displayName="SlotClone";var by=({children:e})=>r.jsx(r.Fragment,{children:e});function zM(e){return m.isValidElement(e)&&e.type===by}function UM(e,t){const n={...t};for(const s in t){const a=e[s],i=t[s];/^on[A-Z]/.test(s)?a&&i?n[s]=(...l)=>{i(...l),a(...l)}:a&&(n[s]=a):s==="style"?n[s]={...a,...i}:s==="className"&&(n[s]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function BM(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function of(e){const t=e+"CollectionProvider",[n,s]=FM(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:w,children:v}=p,b=Z.useRef(null),x=Z.useRef(new Map).current;return r.jsx(a,{scope:w,itemMap:x,collectionRef:b,children:v})};o.displayName=t;const l=e+"CollectionSlot",c=Z.forwardRef((p,w)=>{const{scope:v,children:b}=p,x=i(l,v),g=ct(w,x.collectionRef);return r.jsx(jr,{ref:g,children:b})});c.displayName=l;const d=e+"CollectionItemSlot",u="data-radix-collection-item",h=Z.forwardRef((p,w)=>{const{scope:v,children:b,...x}=p,g=Z.useRef(null),y=ct(w,g),j=i(d,v);return Z.useEffect(()=>(j.itemMap.set(g,{ref:g,...x}),()=>void j.itemMap.delete(g))),r.jsx(jr,{[u]:"",ref:y,children:b})});h.displayName=d;function f(p){const w=i(e+"CollectionConsumer",p);return Z.useCallback(()=>{const b=w.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(w.itemMap.values()).sort((j,N)=>x.indexOf(j.ref.current)-x.indexOf(N.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},f,s]}function HM(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return r.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function a(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,a]}function zr(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const d=h=>{var x;const{scope:f,children:p,...w}=h,v=((x=f==null?void 0:f[e])==null?void 0:x[c])||l,b=m.useMemo(()=>w,Object.values(w));return r.jsx(v.Provider,{value:b,children:p})};d.displayName=i+"Provider";function u(h,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[s,WM(a,...t)]}function WM(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var qM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Le=qM.reduce((e,t)=>{const n=m.forwardRef((s,a)=>{const{asChild:i,...o}=s,l=i?jr:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(l,{...o,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jy(e,t){e&&yo.flushSync(()=>e.dispatchEvent(t))}function Dn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function VM(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e);m.useEffect(()=>{const s=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var YM="DismissableLayer",kx="dismissableLayer.update",GM="dismissableLayer.pointerDownOutside",KM="dismissableLayer.focusOutside",yj,Y1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wo=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=m.useContext(Y1),[u,h]=m.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),w=ct(t,_=>h(_)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),g=u?v.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,j=g>=x,N=XM(_=>{const P=_.target,$=[...d.branches].some(M=>M.contains(P));!j||$||(a==null||a(_),o==null||o(_),_.defaultPrevented||l==null||l())},f),k=QM(_=>{const P=_.target;[...d.branches].some(M=>M.contains(P))||(i==null||i(_),o==null||o(_),_.defaultPrevented||l==null||l())},f);return VM(_=>{g===d.layers.size-1&&(s==null||s(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},f),m.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(yj=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),wj(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=yj)}},[u,f,n,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),wj())},[u,d]),m.useEffect(()=>{const _=()=>p({});return document.addEventListener(kx,_),()=>document.removeEventListener(kx,_)},[]),r.jsx(Le.div,{...c,ref:w,style:{pointerEvents:y?j?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,k.onFocusCapture),onBlurCapture:we(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,N.onPointerDownCapture)})});wo.displayName=YM;var ZM="DismissableLayerBranch",G1=m.forwardRef((e,t)=>{const n=m.useContext(Y1),s=m.useRef(null),a=ct(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),r.jsx(Le.div,{...e,ref:a})});G1.displayName=ZM;function XM(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e),s=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){K1(GM,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function QM(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e),s=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!s.current&&K1(KM,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function wj(){const e=new CustomEvent(kx);document.dispatchEvent(e)}function K1(e,t,n,{discrete:s}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?jy(a,i):a.dispatchEvent(i)}var JM=wo,e4=G1,On=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},t4="Portal",Gl=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[a,i]=m.useState(!1);On(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?q1.createPortal(r.jsx(Le.div,{...s,ref:t}),o):null});Gl.displayName=t4;function n4(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var Nr=e=>{const{present:t,children:n}=e,s=r4(t),a=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=ct(s.ref,s4(a));return typeof n=="function"||s.isPresent?m.cloneElement(a,{ref:i}):null};Nr.displayName="Presence";function r4(e){const[t,n]=m.useState(),s=m.useRef({}),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=n4(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Ju(s.current);i.current=l==="mounted"?d:"none"},[l]),On(()=>{const d=s.current,u=a.current;if(u!==e){const f=i.current,p=Ju(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),On(()=>
40{if(t){let d;const u=t.ownerDocument.defaultView??window,h=p=>{const v=Ju(s.current).includes(p.animationName);if(p.target===t&&v&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=p=>{p.target===t&&(i.current=Ju(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(d=>{d&&(s.current=getComputedStyle(d)),n(d)},[])}}function Ju(e){return(e==null?void 0:e.animationName)||"none"}function s4(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function es({prop:e,defaultProp:t,onChange:n=()=>{}}){const[s,a]=a4({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:s,l=Dn(n),c=m.useCallback(d=>{if(i){const h=typeof d=="function"?d(e):d;h!==e&&l(h)}else a(d)},[i,e,a,l]);return[o,c]}function a4({defaultProp:e,onChange:t}){const n=m.useState(e),[s]=n,a=m.useRef(s),i=Dn(t);return m.useEffect(()=>{a.current!==s&&(i(s),a.current=s)},[s,a,i]),n}var i4="VisuallyHidden",ru=m.forwardRef((e,t)=>r.jsx(Le.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ru.displayName=i4;var o4=ru,_y="ToastProvider",[Ny,l4,c4]=of("Toast"),[Z1,XG]=zr("Toast",[c4]),[d4,lf]=Z1(_y),X1=e=>{const{__scopeToast:t,label:n="Notification",duration:s=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),f=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${_y}\`. Expected non-empty \`string\`.`),r.jsx(Ny.Provider,{scope:t,children:r.jsx(d4,{scope:t,label:n,duration:s,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:m.useCallback(()=>u(p=>p+1),[]),onToastRemove:m.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};X1.displayName=_y;var Q1="ToastViewport",u4=["F8"],Cx="toast.viewportPause",Ax="toast.viewportResume",J1=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:s=u4,label:a="Notifications ({hotkey})",...i}=e,o=lf(Q1,n),l=l4(n),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),f=ct(t,h,o.onViewportChange),p=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=o.toastCount>0;m.useEffect(()=>{const b=x=>{var y;s.length!==0&&s.every(j=>x[j]||x.code===j)&&((y=h.current)==null||y.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[s]),m.useEffect(()=>{const b=c.current,x=h.current;if(w&&b&&x){const g=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(Cx);x.dispatchEvent(k),o.isClosePausedRef.current=!0}},y=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(Ax);x.dispatchEvent(k),o.isClosePausedRef.current=!1}},j=k=>{!b.contains(k.relatedTarget)&&y()},N=()=>{b.contains(document.activeElement)||y()};return b.addEventListener("focusin",g),b.addEventListener("focusout",j),b.addEventListener("pointermove",g),b.addEventListener("pointerleave",N),window.addEventListener("blur",g),window.addEventListener("focus",y),()=>{b.removeEventListener("focusin",g),b.removeEventListener("focusout",j),b.removeEventListener("pointermove",g),b.removeEventListener("pointerleave",N),window.removeEventListener("blur",g),window.removeEventListener("focus",y)}}},[w,o.isClosePausedRef]);const v=m.useCallback(({tabbingDirection:b})=>{const g=l().map(y=>{const j=y.ref.current,N=[j,...N4(j)];return b==="forwards"?N:N.reverse()});return(b==="forwards"?g.reverse():g).flat()},[l]);return m.useEffect(()=>{const b=h.current;if(b){const x=g=>{var N,k,_;const y=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!y){const P=document.activeElement,$=g.shiftKey;if(g.target===b&&$){(N=d.current)==null||N.focus();return}const A=v({tabbingDirection:$?"backwards":"forwards"}),U=A.findIndex(W=>W===P);Pp(A.slice(U+1))?g.preventDefault():$?(k=d.current)==null||k.focus():(_=u.current)==null||_.focus()}};return b.addEventListener("keydown",x),()=>b.removeEventListener("keydown",x)}},[l,v]),r.jsxs(e4,{ref:c,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&r.jsx(Ex,{ref:d,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});Pp(b)}}),r.jsx(Ny.Slot,{scope:n,children:r.jsx(Le.ol,{tabIndex:-1,...i,ref:f})}),w&&r.jsx(Ex,{ref:u,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});Pp(b)}})]})});J1.displayName=Q1;var eS="ToastFocusProxy",Ex=m.forwardRef((e,t)=>
40{const{__scopeToast:n,onFocusFromOutsideViewport:s,...a}=e,i=lf(eS,n);return r.jsx(ru,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&s()}})});Ex.displayName=eS;var cf="Toast",m4="toast.swipeStart",h4="toast.swipeMove",f4="toast.swipeCancel",p4="toast.swipeEnd",tS=m.forwardRef((e,t)=>{const{forceMount:n,open:s,defaultOpen:a,onOpenChange:i,...o}=e,[l=!0,c]=es({prop:s,defaultProp:a,onChange:i});return r.jsx(Nr,{present:n||l,children:r.jsx(v4,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Dn(e.onPause),onResume:Dn(e.onResume),onSwipeStart:we(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:we(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:we(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:we(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});tS.displayName=cf;var[g4,x4]=Z1(cf,{onClose(){}}),v4=m.forwardRef((e,t)=>{const{__scopeToast:n,type:s="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...w}=e,v=lf(cf,n),[b,x]=m.useState(null),g=ct(t,W=>x(W)),y=m.useRef(null),j=m.useRef(null),N=a||v.duration,k=m.useRef(0),_=m.useRef(N),P=m.useRef(0),{onToastAdd:$,onToastRemove:M}=v,O=Dn(()=>{var E;(b==null?void 0:b.contains(document.activeElement))&&((E=v.viewport)==null||E.focus()),o()}),A=m.useCallback(W=>{!W||W===1/0||(window.clearTimeout(P.current),k.current=new Date().getTime(),P.current=window.setTimeout(O,W))},[O]);m.useEffect(()=>{const W=v.viewport;if(W){const E=()=>{A(_.current),d==null||d()},S=()=>{const L=new Date().getTime()-k.current;_.current=_.current-L,window.clearTimeout(P.current),c==null||c()};return W.addEventListener(Cx,S),W.addEventListener(Ax,E),()=>{W.removeEventListener(Cx,S),W.removeEventListener(Ax,E)}}},[v.viewport,N,c,d,A]),m.useEffect(()=>{i&&!v.isClosePausedRef.current&&A(N)},[i,N,v.isClosePausedRef,A]),m.useEffect(()=>($(),()=>M()),[$,M]);const U=m.useMemo(()=>b?lS(b):null,[b]);return v.viewport?r.jsxs(r.Fragment,{children:[U&&r.jsx(y4,{__scopeToast:n,role:"status","aria-live":s==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),r.jsx(g4,{scope:n,onClose:O,children:yo.createPortal(r.jsx(Ny.ItemSlot,{scope:n,children:r.jsx(JM,{asChild:!0,onEscapeKeyDown:we(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||O(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(Le.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...w,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:we(e.onKeyDown,W=>{W.key==="Escape"&&(l==null||l(W.nativeEvent),W.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:we(e.onPointerDown,W=>{W.button===0&&(y.current={x:W.clientX,y:W.clientY})}),onPointerMove:we(e.onPointerMove,W=>{if(!y.current)return;const E=W.clientX-y.current.x,S=W.clientY-y.current.y,L=!!j.current,C=["left","right"].includes(v.swipeDirection),D=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,F=C?D(0,E):0,T=C?0:D(0,S),q=W.pointerType==="touch"?10:2,I={x:F,y:T},Y={originalEvent:W,delta:I};L?(j.current=I,em(h4,h,Y,{discrete:!1})):bj(I,v.swipeDirection,q)?(j.current=I,em(m4,u,Y,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(E)>q||Math.abs(S)>q)&&(y.current=null)}),onPointerUp:we(e.onPointerUp,W=>{const E=j.current,S=W.target;if(S.hasPointerCapture(W.pointerId)&&S.releasePointerCapture(W.pointerId),j.current=null,y.current=null,E){const L=W.currentTarget,C={originalEvent:W,delta:E};bj(E,v.swipeDirection,v.swipeThreshold)?em(p4,p,C,{discrete:!0}):em(f4,f,C,{discrete:!0}),L.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),y4=e=>{const{__scopeToast:t,children:n,...s}=e,a=lf(cf,t),[i,o]=m.useState(!1),[l,c]=m.useState(!1);return j4(()=>o(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:r.jsx(Gl,{asChild:!0,children:r.jsx(ru,{...s,children:i&&r.jsxs(r.Fragment,{children:[a.label," ",n]})})})},w4="ToastTitle",nS=m.forwardRef((e,t)=>
vendor: 4,864 bytes, lines 40-60
40{const{__scopeToast:n,...s}=e;return r.jsx(Le.div,{...s,ref:t})});nS.displayName=w4;var b4="ToastDescription",rS=m.forwardRef((e,t)=>{const{__scopeToast:n,...s}=e;return r.jsx(Le.div,{...s,ref:t})});rS.displayName=b4;var sS="ToastAction",aS=m.forwardRef((e,t)=>{const{altText:n,...s}=e;return n.trim()?r.jsx(oS,{altText:n,asChild:!0,children:r.jsx(Sy,{...s,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${sS}\`. Expected non-empty \`string\`.`),null)});aS.displayName=sS;var iS="ToastClose",Sy=m.forwardRef((e,t)=>{const{__scopeToast:n,...s}=e,a=x4(iS,n);return r.jsx(oS,{asChild:!0,children:r.jsx(Le.button,{type:"button",...s,ref:t,onClick:we(e.onClick,a.onClose)})})});Sy.displayName=iS;var oS=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:s,...a}=e;return r.jsx(Le.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...a,ref:t})});function lS(e){const t=[];return Array.from(e.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&t.push(s.textContent),_4(s)){const a=s.ariaHidden||s.hidden||s.style.display==="none",i=s.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=s.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...lS(s))}}),t}function em(e,t,n,{discrete:s}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?jy(a,i):a.dispatchEvent(i)}var bj=(e,t,n=0)=>{const s=Math.abs(e.x),a=Math.abs(e.y),i=s>a;return t==="left"||t==="right"?i&&s>n:!i&&a>n};function j4(e=()=>{}){const t=Dn(e);On(()=>{let n=0,s=0;return n=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(s)}},[t])}function _4(e){return e.nodeType===e.ELEMENT_NODE}function N4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Pp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var S4=X1,cS=J1,dS=tS,uS=nS,mS=rS,hS=aS,fS=Sy;function pS(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=pS(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function gS(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=pS(e))&&(s&&(s+=" "),s+=t);return s}const jj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_j=gS,Pi=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return _j(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const u=n==null?void 0:n[d],h=i==null?void 0:i[d];if(u===null)return null;const f=jj(u)||jj(h);return a[d][f]}),l=n&&Object.entries(n).reduce((d,u)=>{let[h,f]=u;return f===void 0||(d[h]=f),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,u)=>{let{class:h,className:f,...p}=u;return Object.entries(p).every(w=>{let[v,b]=w;return Array.isArray(b)?b.includes({...i,...l}[v]):{...i,...l}[v]===b})?[...d,h,f]:d},[]);return _j(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const k4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xS=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var C4={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const A4=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:i,iconNode:o,...l},c)=>m.createElement("svg",{ref:c,...C4,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:xS("lucide",a),...l},[...o.map(([d,u])=>m.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const je=(e,t)=>{const n=m.forwardRef(({className:s,...a},i)=>m.createElement(A4,{ref:i,iconNode:t,className:xS(`lucide-${k4(e)}`,s),...a}
60));return n.displayName=`${e}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const E4=je("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const hh=je("Ambulance",[["path",{d:"M10 10H6",key:"1bsnug"}],["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.28a1 1 0 0 0-.684-.948l-1.923-.641a1 1 0 0 1-.578-.502l-1.539-3.076A1 1 0 0 0 16.382 8H14",key:"lrkjwd"}],["path",{d:"M8 8v4",key:"1fwk8c"}],["path",{d:"M9 18h6",key:"x1upvd"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const bo=je("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const et=je("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const pr=je("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const Kl=je("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const jo=je("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const oo=je("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const T4=je("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Kr=je("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const hi=je("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const P4=je("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
120],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const su=je("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const Tr=je("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const Ys=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const ky=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const R4=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const Cy=je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const vS=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const tm=je("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const pa=je("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const jd=je("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const yS=je("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const _s=je("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const M4=je("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const D4=je("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const O4=je("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const Tx=je("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const Ay=je("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const At=je("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const fh=je("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const I4=je("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const L4=je("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const F4=je("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const Nj=je("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const lo=je("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const Ey=je("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const wS=je("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Gs=je("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const $4=je("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const Px=je("Hospital",[["path",{d:"M12 6v4",key:"16clxf"}],["path",{d:"M14 14h-4",key:"esezmu"}
265],["path",{d:"M14 18h-4",key:"16mqa2"}],["path",{d:"M14 8h-4",key:"z8ypaz"}],["path",{d:"M18 12h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h2",key:"b1k337"}],["path",{d:"M18 22V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v18",key:"16g51d"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const bS=je("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const z4=je("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const nl=je("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const Ty=je("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const ph=je("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const jS=je("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const Py=je("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const U4=je("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const B4=je("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const xa=je("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const gh=je("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const xh=je("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const H4=je("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const _d=je("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const Rn=je("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const W4=je("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"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const q4=je("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const V4=je("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const Nd=je("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const Rp=je("Plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const vh=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const Y4=je("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const df=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const _S=je("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const uf=je("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
390y:"oel41y"}]]);/**
391 * @license lucide-react v0.462.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const Ry=je("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
396 * @license lucide-react v0.462.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const Sd=je("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
401 * @license lucide-react v0.462.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const G4=je("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
406 * @license lucide-react v0.462.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const Rx=je("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
411 * @license lucide-react v0.462.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const fi=je("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
416 * @license lucide-react v0.462.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const yh=je("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
421 * @license lucide-react v0.462.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const Ns=je("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
426 * @license lucide-react v0.462.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const NS=je("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
431 * @license lucide-react v0.462.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const My=je("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/**
436 * @license lucide-react v0.462.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const SS=je("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
441 * @license lucide-react v0.462.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const K4=je("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
vendor: 7,623 bytes, lines 445-480
445],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
446 * @license lucide-react v0.462.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const Z4=je("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
451 * @license lucide-react v0.462.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const Sj=je("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
456 * @license lucide-react v0.462.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const mf=je("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
461 * @license lucide-react v0.462.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const Ht=je("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
466 * @license lucide-react v0.462.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const X4=je("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
471 * @license lucide-react v0.462.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const Nn=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
476 * @license lucide-react v0.462.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const Q4=je("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Dy="-",J4=e=>{const t=tD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(Dy);return l[0]===""&&l.length!==1&&l.shift(),kS(l,t)||eD(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},kS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?kS(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Dy);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},kj=/^\[(.+)\]$/,eD=e=>{if(kj.test(e)){const t=kj.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tD=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return rD(Object.entries(e.classGroups),n).forEach(([i,o])=>{Mx(o,s,i,t)}),s},Mx=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:Cj(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(nD(a)){Mx(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{Mx(o,Cj(t,i),n,s)})})},Cj=(e,t)=>{let n=e;return t.split(Dy).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},nD=e=>e.isThemeGetter,rD=(e,t)=>t?e.map(([n,s])=>{const a=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,sD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},CS="!",aD=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,h;for(let b=0;b<l.length;b++){let x=l[b];if(d===0){if(x===a&&(s||l.slice(b,b+i)===t)){c.push(l.slice(u,b)),u=b+i;continue}if(x==="/"){h=b;continue}}x==="["?d++:x==="]"&&d--}const f=c.length===0?l:l.substring(u),p=f.startsWith(CS),w=p?f.substring(1):f,v=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},iD=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},oD=e=>({cache:sD(e.cacheSize),parseClassName:aD(e),...J4(e)}),lD=/\s+/,cD=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(lD);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(d);let w=!!p,v=s(w?f.substring(0,p):f);if(!v){if(!w){l=d+(l.length>0?" "+l:l);continue}if(v=s(f),!v){l=d+(l.length>0?" "+l:l);continue}w=!1}const b=iD(u).join(":"),x=h?b+CS:b,g=x+v;if(i.includes(g))continue;i.push(g);const y=a(v,w);for(let j=0;j<y.length;++j){const N=y[j];i.push(x+N)}l=d+(l.length>0?" "+l:l)}return l};function dD(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=AS(t))&&(s&&(s+=" "),s+=n);return s}const AS=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=AS(e[s]))&&(n&&(n+=" "),n+=t);return n};function uD(e,...t){let n,s,a,i=o;function o(c){const d=t.reduce((u,h)=>h(u),e());return n=oD(d),s=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=s(c);if(d)return d;const u=cD(c,n);return a(c,u),u}return function(){return i(dD.apply(null,arguments))}}const It=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ES=/^\[(?:([a-z-]+):)?(.+)\]$/i,mD=/^\d+\/\d+$/,hD=new Set(["px","full","screen"]),fD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pD=/\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$/,gD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sa=e=>ml(e)||hD.has(e)||mD.test(e),Ma=e=>Zl(e,"length",kD),ml=e=>!!e&&!Number.isNaN(Number(e)),Mp=e=>Zl(e,"number",ml),bc=e=>!!e&&Number.isInteger(Number(e)),yD=e=>e.endsWith("%")&&ml(e.slice(0,-1)),Je=e=>ES.test(e),Da=e=>fD.test(e),wD=new Set(["length","size","percentage"]),bD=e=>Zl(e,wD,TS),jD=e=>Zl(e,"position",TS),_D=new Set(["image","url"]),ND=e=>Zl(e,_D,AD),SD=e=>Zl(e,"",CD),jc=()=>!0,Zl=(e,t,n)=>{const s=ES.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},kD=e=>pD.test(e)&&!gD.test(e),TS=()=>!1,CD=e=>xD.test(e),AD=e=>vD.test(e),ED=()=>{const e=It("colors"),t=It("spacing"),n=It("blur"),s=It("brightness"),a=It("borderColor"),i=It("borderRadius"),o=It("borderSpacing"),l=It("borderWidth"),c=It("contrast"),d=It("grayscale"),u=It("hueRotate"),h=It("invert"),f=It("gap"),p=It("gradientColorStops"),w=It("gradientColorStopPositions"),v=It("inset"),b=It("margin"),x=It("opacity"),g=It("padding"),y=It("saturate"),j=It("scale"),N=It
vendor: 12,377 bytes, line 480
480("sepia"),k=It("skew"),_=It("space"),P=It("translate"),$=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Je,t],A=()=>[Je,t],U=()=>["",sa,Ma],W=()=>["auto",ml,Je],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Je],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[ml,Je];return{cacheSize:500,separator:":",theme:{colors:[jc],spacing:[sa,Ma],blur:["none","",Da,Je],brightness:T(),borderColor:[e],borderRadius:["none","","full",Da,Je],borderSpacing:A(),borderWidth:U(),contrast:T(),grayscale:D(),hueRotate:T(),invert:D(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[yD,Ma],inset:O(),margin:O(),opacity:T(),padding:A(),saturate:T(),scale:T(),sepia:D(),skew:T(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",Je]}],container:["container"],columns:[{columns:[Da]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...E(),Je]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bc,Je]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Je]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",bc,Je]}],"grid-cols":[{"grid-cols":[jc]}],"col-start-end":[{col:["auto",{span:["full",bc,Je]},Je]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[jc]}],"row-start-end":[{row:["auto",{span:[bc,Je]},Je]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Je]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Je,t]}],"min-w":[{"min-w":[Je,t,"min","max","fit"]}],"max-w":[{"max-w":[Je,t,"none","full","min","max","fit","prose",{screen:[Da]},Da]}],h:[{h:[Je,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Je,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Je,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Je,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Da,Ma]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mp]}],"font-family":[{font:[jc]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Je]}],"line-clamp":[{"line-clamp":["none",ml,Mp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sa,Je]}],"list-image":[{"list-image":["none",Je]}],"list-style-type":[{list:["none","disc","decimal",Je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...S(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sa,Ma]}],"underline-offset":[{"underline-offset":["auto",sa,Je]}],"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:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Je]}],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",Je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),jD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ND]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...S(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:S()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...S()]}],"outline-offset":[{"outline-offset":[sa,Je]}],"outline-w":[{outline:[sa,Ma]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[sa,Ma]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Da,SD]}],"shadow-color":[{shadow:[jc]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Da,Je]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[y]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Je]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",Je]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",Je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[bc,Je]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Je]}],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",Je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 480
480],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",Je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[sa,Ma,Mp]}],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"]}}},TD=uD(ED);function le(...e){return TD(gS(e))}const PD=S4,PS=m.forwardRef(({className:e,...t},n)=>r.jsx(cS,{ref:n,className:le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));PS.displayName=cS.displayName;const RD=Pi("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),RS=m.forwardRef(({className:e,variant:t,...n},s)=>r.jsx(dS,{ref:s,className:le(RD({variant:t}),e),...n}));RS.displayName=dS.displayName;const MD=m.forwardRef(({className:e,...t},n)=>r.jsx(hS,{ref:n,className:le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));MD.displayName=hS.displayName;const MS=m.forwardRef(({className:e,...t},n)=>r.jsx(fS,{ref:n,className:le("absolute right-2 top-2 rounded-md p-1 text-foreground
480/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsx(Nn,{className:"h-4 w-4"})}));MS.displayName=fS.displayName;const DS=m.forwardRef(({className:e,...t},n)=>r.jsx(uS,{ref:n,className:le("text-sm font-semibold",e),...t}));DS.displayName=uS.displayName;const OS=m.forwardRef(({className:e,...t},n)=>r.jsx(mS,{ref:n,className:le("text-sm opacity-90",e),...t}));OS.displayName=mS.displayName;function DD(){const{toasts:e}=Sn();return r.jsxs(PD,{children:[e.map(function({id:t,title:n,description:s,action:a,...i}){return r.jsxs(RS,{...i,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(DS,{children:n}),s&&r.jsx(OS,{children:s})]}),a,r.jsx(MS,{})]},t)}),r.jsx(PS,{})]})}var Aj=["light","dark"],OD="(prefers-color-scheme: dark)",ID=m.createContext(void 0),LD={setTheme:e=>{},themes:[]},FD=()=>{var e;return(e=m.useContext(ID))!=null?e:LD};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let d=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(w=>`'${w}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=a?Aj.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(w,v=!1,b=!0)=>{let x=o?o[w]:w,g=v?w+"|| ''":`'${x}'`,y="";return a&&b&&!v&&Aj.includes(w)&&(y+=`d.style.colorScheme = '${w}';`),n==="class"?v||x?y+=`c.add(${g})`:y+="null":x&&(y+=`d[s](n,${g})`),y},p=e?`!function(){${u}${f(e)}}()`:s?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${OD}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${d?"":"else{"+f(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var $D=e=>{switch(e){case"success":return BD;case"info":return WD;case"warning":return HD;case"error":return qD;default:return null}},zD=Array(12).fill(0),UD=({visible:e})=>Z.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},Z.createElement("div",{className:"sonner-spinner"},zD.map((t,n)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),BD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),HD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qD=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),VD=()=>{let[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{let n=()=>{t(document.hidden)};
480return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Dx=1,YD=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...s}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Dx++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
480this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),a=n!==void 0;return s.then(async i=>{if(KD(i)&&!i.ok){a=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:o,description:l})}else if(t.success!==void 0){a=!1;let o=typeof t.success=="function"?await t.success(i):t.success,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:o,description:l})}}).catch(async i=>{if(t.error!==void 0){a=!1;let o=typeof t.error=="function"?await t.error(i):t.error,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:o,description:l})}}).finally(()=>{var i;a&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Dx++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Ar=new YD,GD=(e,t)=>{let n=(t==null?void 0:t.id)||Dx++;return Ar.addToast({title:e,...t,id:n}),n},KD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ZD=GD,XD=()=>Ar.toasts,Ms=Object.assign(ZD,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:XD});function QD(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}QD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
480left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
480:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
481`);function nm(e){return e.label!==void 0}var JD=3,eO="32px",tO=4e3,nO=356,rO=14,sO=20,aO=200;function iO(...e){return e.filter(Boolean).join(" ")}var oO=e=>{var t,n,s,a,i,o,l,c,d,u;let{invert:h,toast:f,unstyled:p,interacting:w,setHeights:v,visibleToasts:b,heights:x,index:g,toasts:y,exp
481anded:j,removeToast:N,defaultRichColors:k,closeButton:_,style:P,cancelButtonStyle:$,actionButtonStyle:M,className:O="",descriptionClassName:A="",duration:U,position:W,gap:E,loadingIcon:S,expandByDefault:L,classNames:C,icons:D,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:T,cn:q}=e,[I,Y]=Z.useState(!1),[ie,se]=Z.useState(!1),[pe,_e]=Z.useState(!1),[Pe,ke]=Z.useState(!1),[Re,De]=Z.useState(0),[de,R]=Z.useState(0),X=Z.useRef(null),ue=Z.useRef(null),te=g===0,Ce=g+1<=b,he=f.type,Be=f.dismissible!==!1,Nt=f.className||"",dt=f.descriptionClassName||"",Ze=Z.useMemo(()=>x.findIndex(V=>V.toastId===f.id)||0,[x,f.id]),st=Z.useMemo(()=>{var V;return(V=f.closeButton)!=null?V:_},[f.closeButton,_]),Ke=Z.useMemo(()=>f.duration||U||tO,[f.duration,U]),bt=Z.useRef(0),pt=Z.useRef(0),kn=Z.useRef(0),Ot=Z.useRef(null),[$t,pn]=W.split("-"),Sr=Z.useMemo(()=>x.reduce((V,oe,Ae)=>Ae>=Ze?V:V+oe.height,0),[x,Ze]),Cn=VD(),kr=f.invert||h,Wt=he==="loading";pt.current=Z.useMemo(()=>Ze*E+Sr,[Ze,Sr]),Z.useEffect(()=>{Y(!0)},[]),Z.useLayoutEffect(()=>{if(!I)return;let V=ue.current,oe=V.style.height;V.style.height="auto";let Ae=V.getBoundingClientRect().height;V.style.height=oe,R(Ae),v($e=>$e.find(Ve=>Ve.toastId===f.id)?$e.map(Ve=>Ve.toastId===f.id?{...Ve,height:Ae}:Ve):[{toastId:f.id,height:Ae,position:f.position},...$e])},[I,f.title,f.description,v,f.id]);let J=Z.useCallback(()=>{se(!0),De(pt.current),v(V=>V.filter(oe=>oe.toastId!==f.id)),setTimeout(()=>{N(f)},aO)},[f,N,v,pt]);Z.useEffect(()=>{if(f.promise&&he==="loading"||f.duration===1/0||f.type==="loading")return;let V,oe=Ke;return j||w||T&&Cn?(()=>{if(kn.current<bt.current){let Ae=new Date().getTime()-bt.current;oe=oe-Ae}kn.current=new Date().getTime()})():oe!==1/0&&(bt.current=new Date().getTime(),V=setTimeout(()=>{var Ae;(Ae=f.onAutoClose)==null||Ae.call(f,f),J()},oe)),()=>clearTimeout(V)},[j,w,L,f,Ke,J,f.promise,he,T,Cn]),Z.useEffect(()=>{let V=ue.current;if(V){let oe=V.getBoundingClientRect().height;return R(oe),v(Ae=>[{toastId:f.id,height:oe,position:f.position},...Ae]),()=>v(Ae=>Ae.filter($e=>$e.toastId!==f.id))}},[v,f.id]),Z.useEffect(()=>{f.delete&&J()},[J,f.delete]);function ae(){return D!=null&&D.loading?Z.createElement("div",{className:"sonner-loader","data-visible":he==="loading"},D.loading):S?Z.createElement("div",{className:"sonner-loader","data-visible":he==="loading"},S):Z.createElement(UD,{visible:he==="loading"})}return Z.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:ue,className:q(O,Nt,C==null?void 0:C.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,C==null?void 0:C.default,C==null?void 0:C[he],(n=f==null?void 0:f.classNames)==null?void 0:n[he]),"data-sonner-toast":"","data-rich-colors":(s=f.richColors)!=null?s:k,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":I,"data-promise":!!f.promise,"data-removed":ie,"data-visible":Ce,"data-y-position":$t,"data-x-position":pn,"data-index":g,"data-front":te,"data-swiping":pe,"data-dismissible":Be,"data-type":he,"data-invert":kr,"data-swipe-out":Pe,"data-expanded":!!(j||L&&I),style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${ie?Re:pt.current}px`,"--initial-height":L?"auto":`${de}px`,...P,...f.style},onPointerDown:V=>{Wt||!Be||(X.current=new Date,De(pt.current),V.target.setPointerCapture(V.pointerId),V.target.tagName!=="BUTTON"&&(_e(!0),Ot.current={x:V.clientX,y:V.clientY}))},onPointerUp:()=>{var V,oe,Ae,$e;if(Pe||!Be)return;Ot.current=null;let Ve=Number(((V=ue.current)==null?void 0:V.style.getPropertyValue("--swipe-amount").replace("px",""))||0),gt=new Date().getTime()-((oe=X.current)==null?void 0:oe.getTime()),qt=Math.abs(Ve)/gt;if(Math.abs(Ve)>=sO||qt>.11){De(pt.current),(Ae=f.onDismiss)==null||Ae.call(f,f),J(),ke(!0);return}($e=ue.current)==null||$e.style.setProperty("--swipe-amount","0px"),_e(!1)},onPointerMove:V=>{var oe;if(!Ot.current||!Be)return;let Ae=V.clientY-Ot.current.y,$e=V.clientX-Ot.current.x,Ve=($t==="top"?Math.min:Math.max)(0,Ae),gt=V.pointerType==="touch"?10:2;Math.abs(Ve)>gt?(oe=ue.current)==null||oe.style.setProperty("--swipe-amount",`${Ae}px`):Math.abs($e)>gt&&(Ot.current=null)}},st&&!f.jsx?Z.createElement("button",{"aria-label":F,"data-disabled":Wt,"data-close-button":!0,onClick:Wt||!Be?()=>{}:()=>{var V;J(),(V=f.onDismiss)==null||V.call(f,f)},className:q(C==null?void 0:C.closeButton,(a=f==null?void 0:f.classNames)==null?void 0:a.closeButton)},Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||Z.isValidElement(f.title)?f.jsx||f.title:Z.createElement(Z.Fragment,null,he||f.icon||f.promise?Z.createElement("div",{"data-icon":"",className:q(C==null?void 0:C.icon,(i=f==null?void 0:f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ae():null,f.type!=="loading"?f.icon||(D==null?void 0:D[he])||$D(he):null):null,Z.createElement("div",{"data-content":"",className:q(C==null?void 0:C.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},Z.createElement("div",{"data-title":"",className:q(C==null?void 0:C.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},f.title),f.description?Z.createElement("div",{"data-description":"",className:q(A,dt,C==null?void 0:C.description,(c=f==null?void 0:f.classNames)==null?void 0:c.description)},f.description):null),Z.isValidElement(f.cancel)?f.cancel:f.cancel&&nm(f.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||$,onClick:V=>{var oe,Ae;nm(f.cancel)&&Be&&((Ae=(oe=f.cancel).onClick)==null||Ae.call(oe,V),J())},className:q(C==null?void 0:C.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,Z.isValidElement(f.action)?f.action:f.action&&nm(f.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||M,onClick:V=>{var oe,Ae;nm(f.action)&&(V.defaultPrevented||((Ae=(oe=f.action).onClick)==null||Ae.call(oe,V),J()))},className:q(C==null?void 0:C.actionButton,(u=f==null?void 0:f.classNames)==null?void 0:u.actionButton)},f.action.label):null))};function Ej(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var lO=e=>{let{invert:t,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:i,className:o,offset:l,theme:c="light",richColors:d,duration:u,style:h,visibleToasts:f=JD,toastOptions:p,dir:w=Ej(),gap:v=rO,loadingIcon:b,icons:x,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:y,cn:j=iO}=e,[N,k]=Z.useState([]),_=Z.useMemo(()=>Array.from(new Set([n].concat(N.filter(T=>T.position).map(T=>T.position)))),[N,n]),[P,$]=Z.useState([]),[M,O]=Z.useState(!1),[A,U]=Z.useState(!1),[W,E]=Z.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
481k":"light"),S=Z.useRef(null),L=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=Z.useRef(null),D=Z.useRef(!1),F=Z.useCallback(T=>{var q;(q=N.find(I=>I.id===T.id))!=null&&q.delete||Ar.dismiss(T.id),k(I=>I.filter(({id:Y})=>Y!==T.id))},[N]);return Z.useEffect(()=>Ar.subscribe(T=>{if(T.dismiss){k(q=>q.map(I=>I.id===T.id?{...I,delete:!0}:I));return}setTimeout(()=>{q1.flushSync(()=>{k(q=>{let I=q.findIndex(Y=>Y.id===T.id);return I!==-1?[...q.slice(0,I),{...q[I],...T},...q.slice(I+1)]:[T,...q]})})})}),[]),Z.useEffect(()=>{if(c!=="system"){E(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:T})=>{E(T?"dark":"light")})},[c]),Z.useEffect(()=>{N.length<=1&&O(!1)},[N]),Z.useEffect(()=>{let T=q=>{var I,Y;s.every(ie=>q[ie]||q.code===ie)&&(O(!0),(I=S.current)==null||I.focus()),q.code==="Escape"&&(document.activeElement===S.current||(Y=S.current)!=null&&Y.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[s]),Z.useEffect(()=>{if(S.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,D.current=!1)}},[S.current]),N.length?Z.createElement("section",{"aria-label":`${g} ${L}`,tabIndex:-1},_.map((T,q)=>{var I;let[Y,ie]=T.split("-");return Z.createElement("ol",{key:T,dir:w==="auto"?Ej():w,tabIndex:-1,ref:S,className:o,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":Y,"data-x-position":ie,style:{"--front-toast-height":`${((I=P[0])==null?void 0:I.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||eO,"--width":`${nO}px`,"--gap":`${v}px`,...h},onBlur:se=>{D.current&&!se.currentTarget.contains(se.relatedTarget)&&(D.current=!1,C.current&&(C.current.focus({preventScroll:!0}),C.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||D.current||(D.current=!0,C.current=se.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{A||O(!1)},onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},N.filter(se=>!se.position&&q===0||se.position===T).map((se,pe)=>{var _e,Pe;return Z.createElement(oO,{key:se.id,icons:x,index:pe,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:u,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:f,closeButton:(Pe=p==null?void 0:p.closeButton)!=null?Pe:i,interacting:A,position:T,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:F,toasts:N.filter(ke=>ke.position==se.position),heights:P.filter(ke=>ke.position==se.position),setHeights:$,expandByDefault:a,gap:v,loadingIcon:b,expanded:M,pauseWhenPageIsHidden:y,cn:j})}))})):null};const cO=({...e})=>{const{theme:t="system"}=FD();return r.jsx(lO,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var dO=bP.useId||(()=>{}),uO=0;function wr(e){const[t,n]=m.useState(dO());return On(()=>{n(s=>s??String(uO++))},[e]),t?`radix-${t}`:""}const mO=["top","right","bottom","left"],pi=Math.min,Pr=Math.max,wh=Math.round,rm=Math.floor,gi=e=>({x:e,y:e}),hO={left:"right",right:"left",bottom:"top",top:"bottom"},fO={start:"end",end:"start"};function Ox(e,t,n){return Pr(e,pi(t,n))}function _a(e,t){return typeof e=="function"?e(t):e}function Na(e){return e.split("-")[0]}function Xl(e){return e.split("-")[1]}function Oy(e){return e==="x"?"y":"x"}function Iy(e){return e==="y"?"height":"width"}function xi(e){return["top","bottom"].includes(Na(e))?"y":"x"}function Ly(e){return Oy(xi(e))}function pO(e,t,n){n===void 0&&(n=!1);const s=Xl(e),a=Ly(e),i=Iy(a);let o=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=bh(o)),[o,bh(o)]}function gO(e){const t=bh(e);return[Ix(e),t,Ix(t)]}function Ix(e){return e.replace(/start|end/g,t=>fO[t])}function xO(e,t,n){const s=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:s:t?s:a;case"left":case"right":return t?i:o;default:return[]}}function vO(e,t,n,s){const a=Xl(e);let i=xO(Na(e),n==="start",s);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Ix)))),i}function bh(e){return e.replace(/left|right|bottom|top/g,t=>hO[t])}function yO(e){return{top:0,right:0,bottom:0,left:0,...e}}function IS(e){return typeof e!="number"?yO(e):{top:e,right:e,bottom:e,left:e}}function jh(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}
vendor: 7,521 bytes, line 481
481function Tj(e,t,n){let{reference:s,floating:a}=e;const i=xi(t),o=Ly(t),l=Iy(o),c=Na(t),d=i==="y",u=s.x+s.width/2-a.width/2,h=s.y+s.height/2-a.height/2,f=s[l]/2-a[l]/2;let p;switch(c){case"top":p={x:u,y:s.y-a.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-a.width,y:h};break;default:p={x:s.x,y:s.y}}switch(Xl(t)){case"start":p[o]-=f*(n&&d?-1:1);break;case"end":p[o]+=f*(n&&d?-1:1);break}return p}const wO=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:h}=Tj(d,s,c),f=s,p={},w=0;for(let v=0;v<l.length;v++){const{name:b,fn:x}=l[v],{x:g,y,data:j,reset:N}=await x({x:u,y:h,initialPlacement:s,placement:f,strategy:a,middlewareData:p,rects:d,platform:o,elements:{reference:e,floating:t}});u=g??u,h=y??h,p={...p,[b]:{...p[b],...j}},N&&w<=50&&(w++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:u,y:h}=Tj(d,f,c)),v=-1)}return{x:u,y:h,placement:f,strategy:a,middlewareData:p}};async function kd(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=_a(t,e),w=IS(p),b=l[f?h==="floating"?"reference":"floating":h],x=jh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),g=h==="floating"?{x:s,y:a,width:o.floating.width,height:o.floating.height}:o.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},N=jh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(x.top-N.top+w.top)/j.y,bottom:(N.bottom-x.bottom+w.bottom)/j.y,left:(x.left-N.left+w.left)/j.x,right:(N.right-x.right+w.right)/j.x}}const bO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=_a(e,t)||{};if(d==null)return{};const h=IS(u),f={x:n,y:s},p=Ly(a),w=Iy(p),v=await o.getDimensions(d),b=p==="y",x=b?"top":"left",g=b?"bottom":"right",y=b?"clientHeight":"clientWidth",j=i.reference[w]+i.reference[p]-f[p]-i.floating[w],N=f[p]-i.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let _=k?k[y]:0;(!_||!await(o.isElement==null?void 0:o.isElement(k)))&&(_=l.floating[y]||i.floating[w]);const P=j/2-N/2,$=_/2-v[w]/2-1,M=pi(h[x],$),O=pi(h[g],$),A=M,U=_-v[w]-O,W=_/2-v[w]/2+P,E=Ox(A,W,U),S=!c.arrow&&Xl(a)!=null&&W!==E&&i.reference[w]/2-(W<A?M:O)-v[w]/2<0,L=S?W<A?W-A:W-U:0;return{[p]:f[p]+L,data:{[p]:E,centerOffset:W-E-L,...S&&{alignmentOffset:L}},reset:S}}}),jO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...b}=_a(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Na(a),g=xi(l),y=Na(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=f||(y||!v?[bh(l)]:gO(l)),k=w!=="none";!f&&k&&N.push(...vO(l,v,w,j));const _=[l,...N],P=await kd(t,b),$=[];let M=((s=i.flip)==null?void 0:s.overflows)||[];if(u&&$.push(P[x]),h){const W=pO(a,o,j);$.push(P[W[0]],P[W[1]])}if(M=[...M,{placement:a,overflows:$}],!$.every(W=>W<=0)){var O,A;const W=(((O=i.flip)==null?void 0:O.index)||0)+1,E=_[W];if(E)return{data:{index:W,overflows:M},reset:{placement:E}};let S=(A=M.filter(L=>L.overflows[0]<=0).sort((L,C)=>L.overflows[1]-C.overflows[1])[0])==null?void 0:A.placement;if(!S)switch(p){case"bestFit":{var U;const L=(U=M.filter(C=>{if(k){const D=xi(C.placement);return D===g||D==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((C,D)=>C[1]-D[1])[0])==null?void 0:U[0];L&&(S=L);break}case"initialPlacement":S=l;break}if(a!==S)return{reset:{placement:S}}}return{}}}};function Pj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rj(e){return mO.some(t=>e[t]>=0)}const _O=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...a}=_a(e,t);switch(s){case"referenceHidden":{const i=await kd(t,{...a,elementContext:"reference"}),o=Pj(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Rj(o)}}}case"escaped":{const i=await kd(t,{...a,altBoundary:!0}),o=Pj(i,n.floating);return{data:{escapedOffsets:o,escaped:Rj(o)}}}default:return{}}}}};async function NO(e,t){const{placement:n,platform:s,elements:a}=e,i=await(s.isRTL==null?void 0:s.isRTL(a.floating)),o=Na(n),l=Xl(n),c=xi(n)==="y",d=["left","top"].includes(o)?-1:1,u=i&&c?-1:1,h=_a(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*u,y:f*d}:{x:f*d,y:p*u}}const SO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await NO(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},kO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x,y:g}=b;return{x,y:g}}},...c}=_a(e,t),d={x:n,y:s},u=await kd(t,c),h=xi(Na(a)),f=Oy(h);let p=d[f],w=d[h];if(i){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",g=p+u[b],y=p-u[x];p=Ox(g,p,y)}if(o){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",g=w+u[b],y=w-u[x];w=Ox(g,w,y)}const v=l.fn({...t,[f]:p,[h]:w});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[f]:i,[h]:o}}}}}},CO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=_a(e,t),u={x:n,y:s},h=xi(a),f=Oy(h);let p=u[f],w=u[h];const v=_a(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=f==="y"?"height":"width",j=i.reference[f]-i.floating[y]+b.mainAxis,N=i.reference[f]+i.reference[y]-b.mainAxis;p<j?p=j:p>N&&(p=N)}if(d){var x,g;const y=f==="y"?"width":"height",j=["top","left"].includes(Na(a)),N=i.reference[h]-i.floating[y]+(j&&((x=o.offset)==null?void 0:x[h])||0)+(j?0:b.crossAxis),k=i.reference[h]+i.reference[y]+(j?0:((g=o.offset)==null?void 0:g[h])||0)-(j?b.crossAxis:0);w<N?w=N:w>k&&(w=k)}return{[f]:p,[h]:w}}}},AO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=_a(e,t),u=await kd(t,d),h=Na(a),f=Xl(a),p=xi(a)==="y",{width:w,height:v}=i.floating;let b,x;h==="top"||h==="bottom"?(b=h,x=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(x=h,b=f==="end"?"top":"bottom");
vendor: 4,396 bytes, line 481
481const g=v-u.top-u.bottom,y=w-u.left-u.right,j=pi(v-u[b],g),N=pi(w-u[x],y),k=!t.middlewareData.shift;let _=j,P=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=y),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(_=g),k&&!f){const M=Pr(u.left,0),O=Pr(u.right,0),A=Pr(u.top,0),U=Pr(u.bottom,0);p?P=w-2*(M!==0||O!==0?M+O:Pr(u.left,u.right)):_=v-2*(A!==0||U!==0?A+U:Pr(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:_});const $=await o.getDimensions(l.floating);return w!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function Ql(e){return LS(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Js(e){var t;return(t=(LS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LS(e){return hf()?e instanceof Node||e instanceof Dr(e).Node:!1}function Ss(e){return hf()?e instanceof Element||e instanceof Dr(e).Element:!1}function Ks(e){return hf()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function Mj(e){return!hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function au(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(a)}function EO(e){return["table","td","th"].includes(Ql(e))}function ff(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fy(e){const t=$y(),n=Ss(e)?ks(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function TO(e){let t=vi(e);for(;Ks(t)&&!Ol(t);){if(Fy(t))return t;if(ff(t))return null;t=vi(t)}return null}function $y(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ol(e){return["html","body","#document"].includes(Ql(e))}function ks(e){return Dr(e).getComputedStyle(e)}function pf(e){return Ss(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vi(e){if(Ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mj(e)&&e.host||Js(e);return Mj(t)?t.host:t}function FS(e){const t=vi(e);return Ol(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ks(t)&&au(t)?t:FS(t)}function Cd(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=FS(e),i=a===((s=e.ownerDocument)==null?void 0:s.body),o=Dr(a);if(i){const l=Lx(o);return t.concat(o,o.visualViewport||[],au(a)?a:[],l&&n?Cd(l):[])}return t.concat(a,Cd(a,[],n))}function Lx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $S(e){const t=ks(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=Ks(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:s,l=wh(n)!==i||wh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function zy(e){return Ss(e)?e:e.contextElement}function hl(e){const t=zy(e);if(!Ks(t))return gi(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:i}=$S(t);let o=(i?wh(n.width):n.width)/s,l=(i?wh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const PO=gi(0);function zS(e){const t=Dr(e);return!$y()||!t.visualViewport?PO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function co(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=zy(e);let o=gi(1);t&&(s?Ss(s)&&(o=hl(s)):o=hl(e));const l=RO(i,n,s)?zS(i):gi(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,h=a.height/o.y;if(i){const f=Dr(i),p=s&&Ss(s)?Dr(s):s;let w=f,v=Lx(w);for(;v&&s&&p!==w;){const b=hl(v),x=v.getBoundingClientRect(),g=ks(v),y=x.left+(v.clientLeft+parseFloat(g.paddingLeft))*b.x,j=x.top+(v.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,d*=b.y,u*=b.x,h*=b.y,c+=y,d+=j,w=Dr(v),v=Lx(w)}}return jh({width:u,height:h,x:c,y:d})}function MO(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const i=a==="fixed",o=Js(s),l=t?ff(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=gi(1);const u=gi(0),h=Ks(s);
vendor: 5,459 bytes, line 481
481if((h||!h&&!i)&&((Ql(s)!=="body"||au(o))&&(c=pf(s)),Ks(s))){const f=co(s);d=hl(s),u.x=f.x+s.clientLeft,u.y=f.y+s.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function DO(e){return Array.from(e.getClientRects())}function Fx(e,t){const n=pf(e).scrollLeft;return t?t.left+n:co(Js(e)).left+n}function OO(e){const t=Js(e),n=pf(e),s=e.ownerDocument.body,a=Pr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Pr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+Fx(e);const l=-n.scrollTop;return ks(s).direction==="rtl"&&(o+=Pr(t.clientWidth,s.clientWidth)-a),{width:a,height:i,x:o,y:l}}function IO(e,t){const n=Dr(e),s=Js(e),a=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=$y();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}function LO(e,t){const n=co(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ks(e)?hl(e):gi(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=s*i.y;return{width:o,height:l,x:c,y:d}}function Dj(e,t,n){let s;if(t==="viewport")s=IO(e,n);else if(t==="document")s=OO(Js(e));else if(Ss(t))s=LO(t,n);else{const a=zS(e);s={...t,x:t.x-a.x,y:t.y-a.y}}return jh(s)}function US(e,t){const n=vi(e);return n===t||!Ss(n)||Ol(n)?!1:ks(n).position==="fixed"||US(n,t)}function FO(e,t){const n=t.get(e);if(n)return n;let s=Cd(e,[],!1).filter(l=>Ss(l)&&Ql(l)!=="body"),a=null;const i=ks(e).position==="fixed";let o=i?vi(e):e;for(;Ss(o)&&!Ol(o);){const l=ks(o),c=Fy(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||au(o)&&!c&&US(e,o))?s=s.filter(u=>u!==o):a=l,o=vi(o)}return t.set(e,s),s}function $O(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const o=[...n==="clippingAncestors"?ff(t)?[]:FO(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((d,u)=>{const h=Dj(t,u,a);return d.top=Pr(h.top,d.top),d.right=pi(h.right,d.right),d.bottom=pi(h.bottom,d.bottom),d.left=Pr(h.left,d.left),d},Dj(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function zO(e){const{width:t,height:n}=$S(e);return{width:t,height:n}}function UO(e,t,n){const s=Ks(t),a=Js(t),i=n==="fixed",o=co(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=gi(0);if(s||!s&&!i)if((Ql(t)!=="body"||au(a))&&(l=pf(t)),s){const p=co(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&(c.x=Fx(a));let d=0,u=0;if(a&&!s&&!i){const p=a.getBoundingClientRect();u=p.top+l.scrollTop,d=p.left+l.scrollLeft-Fx(a,p)}const h=o.left+l.scrollLeft-c.x-d,f=o.top+l.scrollTop-c.y-u;return{x:h,y:f,width:o.width,height:o.height}}function Dp(e){return ks(e).position==="static"}function Oj(e,t){if(!Ks(e)||ks(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Js(e)===n&&(n=n.ownerDocument.body),n}function BS(e,t){const n=Dr(e);if(ff(e))return n;if(!Ks(e)){let a=vi(e);for(;a&&!Ol(a);){if(Ss(a)&&!Dp(a))return a;a=vi(a)}return n}let s=Oj(e,t);for(;s&&EO(s)&&Dp(s);)s=Oj(s,t);return s&&Ol(s)&&Dp(s)&&!Fy(s)?n:s||TO(e)||n}const BO=async function(e){const t=this.getOffsetParent||BS,n=this.getDimensions,s=await n(e.floating);return{reference:UO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function HO(e){return ks(e).direction==="rtl"}const WO={convertOffsetParentRelativeRectToViewportRelativeRect:MO,getDocumentElement:Js,getClippingRect:$O,getOffsetParent:BS,getElementRects:BO,getClientRects:DO,getDimensions:zO,getScale:hl,isElement:Ss,isRTL:HO};function qO(e,t){let n=null,s;const a=Js(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:d,top:u,width:h,height:f}=e.getBoundingClientRect();if(l||t(),!h||!f)return;const p=rm(u),w=rm(a.clientWidth-(d+h)),v=rm(a.clientHeight-(u+f)),b=rm(d),g={rootMargin:-p+"px "+-w+"px "+-v+"px "+-b+"px",threshold:Pr(0,pi(1,c))||1};let y=!0;function j(N){const k=N[0].intersectionRatio;if(k!==c){if(!y)return o();k?o(!1,k):s=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(j,{...g,root:a.ownerDocument})}catch{n=new IntersectionObserver(j,g)}n.observe(e)}return o(!0),i}function VO(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=zy(e),u=a||i?[...d?Cd(d):[],...Cd(t)]:[];u.forEach(x=>{a&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=d&&l?qO(d,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(x=>{let[g]=x;g&&g.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let w,v=c?co(e):null;c&&b();function b(){const x=co(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,w=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(g=>{a&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const YO=SO,GO=kO,KO=jO,ZO=AO,XO=_O,Ij=bO,QO=CO,JO=(e,t,n)=>{const s=new Map,a={platform:WO,...n},i={...a.platform,_c:s};return wO(e,t,{...a,platform:i})};var Om=typeof document<"u"?m.useLayoutEffect:m.useEffect;function _h(e,t){if(e===t)return!0;
vendor: 5,694 bytes, line 481
481if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!_h(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const i=a[s];if(!(i==="_owner"&&e.$$typeof)&&!_h(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function HS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lj(e,t){const n=HS(e);return Math.round(t*n)/n}function Op(e){const t=m.useRef(e);return Om(()=>{t.current=e}),t}function eI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(s);_h(f,s)||p(s);const[w,v]=m.useState(null),[b,x]=m.useState(null),g=m.useCallback(C=>{C!==k.current&&(k.current=C,v(C))},[]),y=m.useCallback(C=>{C!==_.current&&(_.current=C,x(C))},[]),j=i||w,N=o||b,k=m.useRef(null),_=m.useRef(null),P=m.useRef(u),$=c!=null,M=Op(c),O=Op(a),A=Op(d),U=m.useCallback(()=>{if(!k.current||!_.current)return;const C={placement:t,strategy:n,middleware:f};O.current&&(C.platform=O.current),JO(k.current,_.current,C).then(D=>{const F={...D,isPositioned:A.current!==!1};W.current&&!_h(P.current,F)&&(P.current=F,yo.flushSync(()=>{h(F)}))})},[f,t,n,O,A]);Om(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[d]);const W=m.useRef(!1);Om(()=>(W.current=!0,()=>{W.current=!1}),[]),Om(()=>{if(j&&(k.current=j),N&&(_.current=N),j&&N){if(M.current)return M.current(j,N,U);U()}},[j,N,U,M,$]);const E=m.useMemo(()=>({reference:k,floating:_,setReference:g,setFloating:y}),[g,y]),S=m.useMemo(()=>({reference:j,floating:N}),[j,N]),L=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!S.floating)return C;const D=Lj(S.floating,u.x),F=Lj(S.floating,u.y);return l?{...C,transform:"translate("+D+"px, "+F+"px)",...HS(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:F}},[n,l,S.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:U,refs:E,elements:S,floatingStyles:L}),[u,U,E,S,L])}const tI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:a}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Ij({element:s.current,padding:a}).fn(n):{}:s?Ij({element:s,padding:a}).fn(n):{}}}},nI=(e,t)=>({...YO(e),options:[e,t]}),rI=(e,t)=>({...GO(e),options:[e,t]}),sI=(e,t)=>({...QO(e),options:[e,t]}),aI=(e,t)=>({...KO(e),options:[e,t]}),iI=(e,t)=>({...ZO(e),options:[e,t]}),oI=(e,t)=>({...XO(e),options:[e,t]}),lI=(e,t)=>({...tI(e),options:[e,t]});var cI="Arrow",WS=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...i}=e;return r.jsx(Le.svg,{...i,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});WS.displayName=cI;var dI=WS;function uI(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];function d(h){const{scope:f,children:p,...w}=h,v=(f==null?void 0:f[e][c])||l,b=m.useMemo(()=>w,Object.values(w));return r.jsx(v.Provider,{value:b,children:p})}function u(h,f){const p=(f==null?void 0:f[e][c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[s,mI(a,...t)]}function mI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Uy(e){const[t,n]=m.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var By="Popper",[qS,Ri]=uI(By),[hI,VS]=qS(By),YS=e=>{const{__scopePopper:t,children:n}=e,[s,a]=m.useState(null);return r.jsx(hI,{scope:t,anchor:s,onAnchorChange:a,children:n})};YS.displayName=By;var GS="PopperAnchor",KS=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,i=VS(GS,n),o=m.useRef(null),l=ct(t,o);return m.useEffect(()=>{i.onAnchorChange((s==null?void 0:s.current)||o.current)}),s?null:r.jsx(Le.div,{...a,ref:l})});KS.displayName=GS;var Hy="PopperContent",[fI,pI]=qS(Hy),ZS=m.forwardRef((e,t)=>{var pe,_e,Pe,ke,Re,De;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:w,...v}=e,b=VS(Hy,n),[x,g]=m.useState(null),y=ct(t,de=>g(de)),[j,N]=m.useState(null),k=Uy(j),_=(k==null?void 0:k.width)??0,P=(k==null?void 0:k.height)??0,$=s+(i!=="center"?"-"+i:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],A=O.length>
vendor: 5,105 bytes, line 481
4810,U={padding:M,boundary:O.filter(xI),altBoundary:A},{refs:W,floatingStyles:E,placement:S,isPositioned:L,middlewareData:C}=eI({strategy:"fixed",placement:$,whileElementsMounted:(...de)=>VO(...de,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[nI({mainAxis:a+P,alignmentAxis:o}),c&&rI({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?sI():void 0,...U}),c&&aI({...U}),iI({...U,apply:({elements:de,rects:R,availableWidth:X,availableHeight:ue})=>{const{width:te,height:Ce}=R.reference,he=de.floating.style;he.setProperty("--radix-popper-available-width",`${X}px`),he.setProperty("--radix-popper-available-height",`${ue}px`),he.setProperty("--radix-popper-anchor-width",`${te}px`),he.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),j&&lI({element:j,padding:l}),vI({arrowWidth:_,arrowHeight:P}),f&&oI({strategy:"referenceHidden",...U})]}),[D,F]=JS(S),T=Dn(w);On(()=>{L&&(T==null||T())},[L,T]);const q=(pe=C.arrow)==null?void 0:pe.x,I=(_e=C.arrow)==null?void 0:_e.y,Y=((Pe=C.arrow)==null?void 0:Pe.centerOffset)!==0,[ie,se]=m.useState();return On(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),r.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...E,transform:L?E.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(ke=C.transformOrigin)==null?void 0:ke.x,(Re=C.transformOrigin)==null?void 0:Re.y].join(" "),...((De=C.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(fI,{scope:n,placedSide:D,onArrowChange:N,arrowX:q,arrowY:I,shouldHideArrow:Y,children:r.jsx(Le.div,{"data-side":D,"data-align":F,...v,ref:y,style:{...v.style,animation:L?void 0:"none"}})})})});ZS.displayName=Hy;var XS="PopperArrow",gI={top:"bottom",right:"left",bottom:"top",left:"right"},QS=m.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,i=pI(XS,s),o=gI[i.placedSide];return r.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:r.jsx(dI,{...a,ref:n,style:{...a.style,display:"block"}})})});QS.displayName=XS;function xI(e){return e!==null}var vI=e=>({name:"transformOrigin",options:e,fn(t){var b,x,g;const{placement:n,rects:s,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=JS(n),h={start:"0%",center:"50%",end:"100%"}[u],f=(((x=a.arrow)==null?void 0:x.x)??0)+l/2,p=(((g=a.arrow)==null?void 0:g.y)??0)+c/2;let w="",v="";return d==="bottom"?(w=o?h:`${f}px`,v=`${-c}px`):d==="top"?(w=o?h:`${f}px`,v=`${s.floating.height+c}px`):d==="right"?(w=`${-c}px`,v=o?h:`${p}px`):d==="left"&&(w=`${s.floating.width+c}px`,v=o?h:`${p}px`),{data:{x:w,y:v}}}});function JS(e){const[t,n="center"]=e.split("-");return[t,n]}var iu=YS,ou=KS,gf=ZS,xf=QS,[vf,QG]=zr("Tooltip",[Ri]),yf=Ri(),ek="TooltipProvider",yI=700,$x="tooltip.open",[wI,Wy]=vf(ek),tk=e=>{const{__scopeTooltip:t,delayDuration:n=yI,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:i}=e,[o,l]=m.useState(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),r.jsx(wI,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),s)},[s]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(u=>{c.current=u},[]),disableHoverableContent:a,children:i})};tk.displayName=ek;var wf="Tooltip",[bI,bf]=vf(wf),nk=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=Wy(wf,e.__scopeTooltip),d=yf(t),[u,h]=m.useState(null),f=wr(),p=m.useRef(0),w=o??c.disableHoverableContent,v=l??c.delayDuration,b=m.useRef(!1),[x=!1,g]=es({prop:s,defaultProp:a,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent($x))):c.onClose(),i==null||i(_)}}),y=m.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),j=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,g(!0)},[g]),N=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,g(!0),p.current=0},v)},[v,g]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),r.jsx(iu,{...d,children:r.jsx(bI,{scope:t,contentId:f,open:x,stateAttribute:y,trigger:u,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayed?k():j()},[c.isOpenDelayed,k,j]),onTriggerLeave:m.useCallback(()=>{w?N():(window.clearTimeout(p.current),p.current=0)},[N,w]),onOpen:j,onClose:N,disableHoverableContent:w,children:n})})};nk.displayName=wf;var zx="TooltipTrigger",rk=m.forwardRef((e,t)=>
vendor: 3,936 bytes, line 481
481{const{__scopeTooltip:n,...s}=e,a=bf(zx,n),i=Wy(zx,n),o=yf(n),l=m.useRef(null),c=ct(t,l,a.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),r.jsx(ou,{asChild:!0,...o,children:r.jsx(Le.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:c,onPointerMove:we(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:we(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:we(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:we(e.onBlur,a.onClose),onClick:we(e.onClick,a.onClose)})})});rk.displayName=zx;var jI="TooltipPortal",[JG,_I]=vf(jI,{forceMount:void 0}),Il="TooltipContent",sk=m.forwardRef((e,t)=>{const n=_I(Il,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...i}=e,o=bf(Il,e.__scopeTooltip);return r.jsx(Nr,{present:s||o.open,children:o.disableHoverableContent?r.jsx(ak,{side:a,...i,ref:t}):r.jsx(NI,{side:a,...i,ref:t})})}),NI=m.forwardRef((e,t)=>{const n=bf(Il,e.__scopeTooltip),s=Wy(Il,e.__scopeTooltip),a=m.useRef(null),i=ct(t,a),[o,l]=m.useState(null),{trigger:c,onClose:d}=n,u=a.current,{onPointerInTransitChange:h}=s,f=m.useCallback(()=>{l(null),h(!1)},[h]),p=m.useCallback((w,v)=>{const b=w.currentTarget,x={x:w.clientX,y:w.clientY},g=AI(x,b.getBoundingClientRect()),y=EI(x,g),j=TI(v.getBoundingClientRect()),N=RI([...y,...j]);l(N),h(!0)},[h]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){const w=b=>p(b,u),v=b=>p(b,c);return c.addEventListener("pointerleave",w),u.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",v)}}},[c,u,p,f]),m.useEffect(()=>{if(o){const w=v=>{const b=v.target,x={x:v.clientX,y:v.clientY},g=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),y=!PI(x,o);g?f():y&&(f(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,u,o,d,f]),r.jsx(ak,{...e,ref:i})}),[SI,kI]=vf(wf,{isInside:!1}),ak=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=bf(Il,n),d=yf(n),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener($x,u),()=>document.removeEventListener($x,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),r.jsx(wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:r.jsxs(gf,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(by,{children:s}),r.jsx(SI,{scope:n,isInside:!0,children:r.jsx(o4,{id:c.contentId,role:"tooltip",children:a||s})})]})})});sk.displayName=Il;var ik="TooltipArrow",CI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=yf(n);return kI(ik,n).isInside?null:r.jsx(xf,{...a,...s,ref:t})});CI.displayName=ik;function AI(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,a,i)){case i:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function EI(e,t,n=5){const s=[];
481switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function TI(e){const{top:t,right:n,bottom:s,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:s},{x:a,y:s}]}function PI(e,t){const{x:n,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i].x,c=t[i].y,d=t[o].x,u=t[o].y;c>s!=u>s&&n<(d-l)*(s-c)/(u-c)+l&&(a=!a)}return a}function RI(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),MI(t)}function MI(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var DI=tk,OI=nk,II=rk,ok=sk;const lk=DI,LI=OI,FI=II,ck=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(ok,{ref:s,sideOffset:t,className:le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));ck.displayName=ok.displayName;var jf=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(){}},_f=typeof window>"u"||"Deno"in globalThis;function ms(){}function $I(e,t){return typeof e=="function"?e(t):e}function zI(e){return typeof e=="number"&&e>=0&&e!==1/0}function UI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fj(e,t){return typeof e=="function"?e(t):e}function BI(e,t){return typeof e=="function"?e(t):e}function $j(e,t){const{type:n="all",exact:s,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(s){if(t.queryHash!==qy(o,t.options))return!1}else if(!Ed(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function zj(e,t){const{exact:n,status:s,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Ad(t.options.mutationKey)!==Ad(i))return!1}else if(!Ed(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||a&&!a(t))}function qy(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ad)(e)}function Ad(e){return JSON.stringify(e,(t,n)=>Ux(n)?Object.keys(n).sort().reduce((s,a)=>(s[a]=n[a],s),{}):n)}function Ed(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ed(e[n],t[n])):!1}function dk(e,t){if(e===t)return e;const n=Uj(e)&&Uj(t);if(n||Ux(e)&&Ux(t)){const s=n?e:Object.keys(e),a=s.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{};let c=0;for(let d=0;d<o;d++){const u=n?d:i[d];(!n&&s.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(l[u]=void 0,c++):(l[u]=dk(e[u],t[u]),l[u]===e[u]&&e[u]!==void 0&&c++)}return a===o&&c===a?e:l}return t}function Uj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ux(e){if(!Bj(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Bj(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bj(e){return Object.prototype.toString.call(e)==="[object Object]"}function HI(e){return new Promise(t=>{setTimeout(t,e)})}function WI(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dk(e,t):t}function qI(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function VI(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Vy=Symbol();function uk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ki,Ya,yl,N_,YI=(N_=class extends jf{constructor(){super();_t(this,Ki);_t(this,Ya);_t(this,yl);tt(this,yl,t=>{if(!_f&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ce(this,Ya)||this.setEventListener(ce(this,yl))}onUnsubscribe(){var t;this.hasListeners()||((t=ce(this,Ya))==null||t.call(this),tt(this,Ya,void 0))}setEventListener(t){var n;tt(this,yl,t),(n=ce(this,Ya))==null||n.call(this),tt(this,Ya,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){ce(this,Ki)!==t&&(tt(this,Ki,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 19,718 bytes, line 481
481this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ce(this,Ki)=="boolean"?ce(this,Ki):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ki=new WeakMap,Ya=new WeakMap,yl=new WeakMap,N_),mk=new YI,wl,Ga,bl,S_,GI=(S_=class extends jf{constructor(){super();_t(this,wl,!0);_t(this,Ga);_t(this,bl);tt(this,bl,t=>{if(!_f&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){ce(this,Ga)||this.setEventListener(ce(this,bl))}onUnsubscribe(){var t;this.hasListeners()||((t=ce(this,Ga))==null||t.call(this),tt(this,Ga,void 0))}setEventListener(t){var n;tt(this,bl,t),(n=ce(this,Ga))==null||n.call(this),tt(this,Ga,t(this.setOnline.bind(this)))}setOnline(t){ce(this,wl)!==t&&(tt(this,wl,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return ce(this,wl)}},wl=new WeakMap,Ga=new WeakMap,bl=new WeakMap,S_),Nh=new GI;function KI(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function s(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},n.reject=a=>{s({status:"rejected",reason:a}),t(a)},n}function ZI(e){return Math.min(1e3*2**e,3e4)}function hk(e){return(e??"online")==="online"?Nh.isOnline():!0}var fk=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ip(e){return e instanceof fk}function pk(e){let t=!1,n=0,s=!1,a;const i=KI(),o=v=>{var b;s||(f(new fk(v)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>mk.isFocused()&&(e.networkMode==="always"||Nh.isOnline())&&e.canRun(),u=()=>hk(e.networkMode)&&e.canRun(),h=v=>{var b;s||(s=!0,(b=e.onSuccess)==null||b.call(e,v),a==null||a(),i.resolve(v))},f=v=>{var b;s||(s=!0,(b=e.onError)==null||b.call(e,v),a==null||a(),i.reject(v))},p=()=>new Promise(v=>{var b;a=x=>{(s||d())&&v(x)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;a=void 0,s||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(s)return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(x){v=Promise.reject(x)}Promise.resolve(v).then(h).catch(x=>{var k;if(s)return;const g=e.retry??(_f?0:3),y=e.retryDelay??ZI,j=typeof y=="function"?y(n,x):y,N=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,x);if(t||!N){f(x);return}n++,(k=e.onFail)==null||k.call(e,n,x),HI(j).then(()=>d()?void 0:p()).then(()=>{t?f(x):w()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?w():p().then(w),i)}}function XI(){let e=[],t=0,n=l=>{l()},s=l=>{l()},a=l=>setTimeout(l,0);const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{s(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{a=l}}}var tr=XI(),Zi,k_,gk=(k_=class{constructor(){_t(this,Zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zI(this.gcTime)&&tt(this,Zi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_f?1/0:5*60*1e3))}clearGcTimeout(){ce(this,Zi)&&(clearTimeout(ce(this,Zi)),tt(this,Zi,void 0))}},Zi=new WeakMap,k_),jl,_l,Hr,Vn,Zd,Xi,hs,ia,C_,QI=(C_=class extends gk{constructor(t){super();_t(this,hs);_t(this,jl);_t(this,_l);_t(this,Hr);_t(this,Vn);_t(this,Zd);_t(this,Xi);tt(this,Xi,!1),tt(this,Zd,t.defaultOptions),this.setOptions(t.options),this.observers=[],tt(this,Hr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,tt(this,jl,eL(this.options)),this.state=t.state??ce(this,jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ce(this,Vn))==null?void 0:t.promise}setOptions(t){this.options={...ce(this,Zd),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ce(this,Hr).remove(this)}setData(t,n){const s=WI(this.state.data,t,this.options);return Bn(this,hs,ia).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t,n){Bn(this,hs,ia).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var s,a;const n=(s=ce(this,Vn))==null?void 0:s.promise;return(a=ce(this,Vn))==null||a.cancel(t),n?n.then(ms).catch(ms):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ce(this,jl))}isActive(){return this.observers.some(t=>BI(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vy||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!UI(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ce(this,Vn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ce(this,Vn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ce(this,Hr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ce(this,Vn)&&(ce(this,Xi)?ce(this,Vn).cancel({revert:!0}):ce(this,Vn).cancelRetry()),this.scheduleGc()),ce(this,Hr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bn(this,hs,ia).call(this,{type:"invalidate"})}fetch(t,n){var c,d,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ce(this,Vn))return ce(this,Vn).continueRetry(),ce(this,Vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(tt(this,Xi,!0),s.signal)})},i=()=>{const h=uk(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return a(f),tt(this,Xi,!1),this.options.persister?this.options.persister(h,f,this):h(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};a(o),(c=this.options.behavior)==null||c.onFetch(o,this),tt(this,_l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Bn(this,hs,ia).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const l=h=>{var f,p,w,v;Ip(h)&&h.silent||Bn(this,hs,ia).call(this,{type:"error",error:h}),Ip(h)||((p=(f=ce(this,Hr).config).onError)==null||p.call(f,h,this),(v=(w=ce(this,Hr).config).onSettled)==null||v.call(w,this.state.data,h,this)),this.scheduleGc()};return tt(this,Vn,pk({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:s.abort.bind(s),onSuccess:h=>{var f,p,w,v;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){l(b);return}(p=(f=ce(this,Hr).config).onSuccess)==null||p.call(f,h,this),(v=(w=ce(this,Hr).config).onSettled)==null||v.call(w,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,f)=>{Bn(this,hs,ia).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Bn(this,hs,ia).call(this,{type:"pause"})},onContinue:()=>{Bn(this,hs,ia).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ce(this,Vn).start()}},jl=new WeakMap,_l=new WeakMap,Hr=new WeakMap,Vn=new WeakMap,Zd=new WeakMap,Xi=new WeakMap,hs=new WeakSet,ia=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...JI(s.data,this.options),fetchMeta:t.meta??null};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Ip(a)&&a.revert&&ce(this,_l)?{...ce(this,_l),fetchStatus:"idle"}:{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),tr.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),ce(this,Hr).notify({query:this,type:"updated",action:t})})},C_);function JI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eL(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ls,A_,tL=(A_=class extends jf{constructor(t={}){super();_t(this,Ls);this.config=t,tt(this,Ls,new Map)}build(t,n,s){const a=n.queryKey,i=n.queryHash??qy(a,n);let o=this.get(i);return o||(o=new QI({cache:this,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){ce(this,Ls).has(t.queryHash)||(ce(this,Ls).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ce(this,Ls).get(t.queryHash);n&&(t.destroy(),n===t&&ce(this,Ls).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ce(this,Ls).get(t)}getAll(){return[...ce(this,Ls).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>$j(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>$j(t,s)):n}notify(t){tr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ls=new WeakMap,A_),Fs,Qn,Qi,$s,Fa,E_,nL=(E_=class extends gk{constructor(t){super();_t(this,$s);_t(this,Fs);_t(this,Qn);_t(this,Qi);this.mutationId=t.mutationId,tt(this,Qn,t.mutationCache),tt(this,Fs,[]),this.state=t.state||rL(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ce(this,Fs).includes(t)||(ce(this,Fs).push(t),this.clearGcTimeout(),ce(this,Qn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){tt(this,Fs,ce(this,Fs).filter(n=>n!==t)),this.scheduleGc(),ce(this,Qn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ce(this,Fs).length||(this.state.status==="pending"?this.scheduleGc():ce(this,Qn).remove(this))}continue(){var t;return((t=ce(this,Qi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,o,l,c,d,u,h,f,p,w,v,b,x,g,y,j,N,k,_;tt(this,Qi,pk({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,$)=>{Bn(this,$s,Fa).call(this,{type:"failed",failureCount:P,error:$})},onPause:()=>{Bn(this,$s,Fa).call(this,{type:"pause"})},onContinue:()=>{Bn(this,$s,Fa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ce(this,Qn).canRun(this)}));const n=this.state.status==="pending",s=!ce(this,Qi).canStart();try{if(!n){Bn(this,$s,Fa).call(this,{type:"pending",variables:t,isPaused:s}),await((i=(a=ce(this,Qn).config).onMutate)==null?void 0:i.call(a,t,this));const $=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));$!==this.state.context&&Bn(this,$s,Fa).call(this,{type:"pending",context:$,variables:t,isPaused:s})}const P=await ce(this,Qi).start();return await((d=(c=ce(this,Qn).config).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,this)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,P,t,this.state.context)),await((p=(f=ce(this,Qn).config).onSettled)==null?void 0:p.call(f,P,null,this.state.variables,this.state.context,this)),await((v=(w=this.options).onSettled)==null?void 0:v.call(w,P,null,t,this.state.context)),Bn(this,$s,Fa).call(this,{type:"success",data:P}),P}catch(P){try{throw await((x=(b=ce(this,Qn).config).onError)==null?void 0:x.call(b,P,t,this.state.context,this)),await((y=(g=this.options).onError)==null?void 0:y.call(g,P,t,this.state.context)),await((N=(j=ce(this,Qn).config).onSettled)==null?void 0:N.call(j,void 0,P,this.state.variables,this.state.context,this)),await((_=(k=this.options).onSettled)==null?void 0:_.call(k,void 0,P,t,this.state.context)),P}finally{Bn(this,$s,Fa).call(this,{type:"error",error:P})}}finally{ce(this,Qn).runNext(this)}}},Fs=new WeakMap,Qn=new WeakMap,Qi=new WeakMap,$s=new WeakSet,Fa=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tr.batch(()=>{ce(this,Fs).forEach(s=>{s.onMutationUpdate(t)}),ce(this,Qn).notify({mutation:this,type:"updated",action:t})})},E_);function rL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cr,Xd,T_,sL=(T_=class extends jf{constructor(t={}){super();_t(this,Cr);_t(this,Xd);this.config=t,tt(this,Cr,new Map),tt(this,Xd,Date.now())}build(t,n,s){const a=new nL({mutationCache:this,mutationId:++Ou(this,Xd)._,options:t.defaultMutationOptions(n),state:s});return this.add(a),a}add(t){const n=sm(t),s=ce(this,Cr).get(n)??[];s.push(t),ce(this,Cr).set(n,s),this.notify({type:"added",mutation:t})}remove(t){var s;const n=sm(t);if(ce(this,Cr).has(n)){const a=(s=ce(this,Cr).get(n))==null?void 0:s.filter(i=>i!==t);a&&(a.length===0?ce(this,Cr).delete(n):ce(this,Cr).set(n,a))}this.notify({type:"removed",mutation:t})}canRun(t){var s;const n=(s=ce(this,Cr).get(sm(t)))==null?void 0:s.find(a=>a.state.status==="pending");return!n||n===t}runNext(t){var s;const n=(s=ce(this,Cr).get(sm(t)))==null?void 0:s.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){tr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...ce(this,Cr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(s=>zj(n,s))}findAll(t={}){return this.getAll().filter(n=>zj(t,n))}notify(t){tr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tr.batch(()=>Promise.all(t.map(n=>n.continue().catch(ms))))}},Cr=new WeakMap,Xd=new WeakMap,T_);function sm(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Hj(e){return{onFetch:(t,n)=>{var u,h,f,p,w;const s=t.options,a=(f=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let v=!1;const b=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},x=uk(t.options,t.fetchOptions),g=async(y,j,N)=>{if(v)return Promise.reject();if(j==null&&y.pages.length)return Promise.resolve(y);const k={queryKey:t.queryKey,pageParam:j,direction:N?"backward":"forward",meta:t.options.meta};b(k);const _=await x(k),{maxPages:P}=t.options,$=N?VI:qI;return{pages:$(y.pages,_,P),pageParams:$(y.pageParams,j,P)}};if(a&&i.length){const y=a==="backward",j=y?aL:Wj,N={pages:i,pageParams:o},k=j(s,N);l=await g(N,k,y)}else{const y=e??i.length;do{const j=c===0?o[0]??s.initialPageParam:Wj(s,l);if(c>0&&j==null)break;l=await g(l,j),c++}while(c<y)}return l};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Wj(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function aL(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var tn,Ka,Za,Nl,Sl,Xa,kl,Cl,P_,iL=(P_=class{constructor(e={}){_t(this,tn);_t(this,Ka);_t(this,Za);_t(this,Nl);_t(this,Sl);_t(this,Xa);_t(this,kl);_t(this,Cl);tt(this,tn,e.queryCache||new tL),tt(this,Ka,e.mutationCache||new sL),tt(this,Za,e.defaultOptions||{}),tt(this,Nl,new Map),tt(this,Sl,new Map),tt(this,Xa,0)}mount(){Ou(this,Xa)._++,ce(this,Xa)===1&&(tt(this,kl,mk.subscribe(async e=>{e&&(await this.resumePausedMutations(),ce(this,tn).onFocus())})),tt(this,Cl,Nh.subscribe(async e=>{e&&(await this.resumePausedMutations(),ce(this,tn).onOnline())})))}unmount(){var e,t;Ou(this,Xa)._--,ce(this,Xa)===0&&((e=ce(this,kl))==null||e.call(this),tt(this,kl,void 0),(t=ce(this,Cl))==null||t.call(this),tt(this,Cl,void 0))}isFetching(e){return ce(this,tn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ce(this,Ka).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ce(this,tn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),s=ce(this,tn).build(this,n);return e.revalidateIfStale&&s.isStaleByTime(Fj(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return ce(this,tn).findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),a=ce(this,tn).get(s.queryHash),i=a==null?void 0:a.state.data,o=$I(t,i);if(o!==void 0)return ce(this,tn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return tr.batch(()=>ce(this,tn).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ce(this,tn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ce(this,tn);tr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ce(this,tn),s={type:"active",...e};return tr.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(s,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},s=tr.batch(()=>ce(this,tn).findAll(e).map(a=>a.cancel(n)));
481return Promise.all(s).then(ms).catch(ms)}invalidateQueries(e={},t={}){return tr.batch(()=>{if(ce(this,tn).findAll(e).forEach(s=>{s.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},s=tr.batch(()=>ce(this,tn).findAll(e).filter(a=>!a.isDisabled()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(ms)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(ms)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ce(this,tn).build(this,t);return n.isStaleByTime(Fj(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ms).catch(ms)}fetchInfiniteQuery(e){return e.behavior=Hj(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ms).catch(ms)}ensureInfiniteQueryData(e){return e.behavior=Hj(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nh.isOnline()?ce(this,Ka).resumePausedMutations():Promise.resolve()}getQueryCache(){return ce(this,tn)}getMutationCache(){return ce(this,Ka)}getDefaultOptions(){return ce(this,Za)}setDefaultOptions(e){tt(this,Za,e)}setQueryDefaults(e,t){ce(this,Nl).set(Ad(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ce(this,Nl).values()];let n={};return t.forEach(s=>{Ed(e,s.queryKey)&&(n={...n,...s.defaultOptions})}),n}setMutationDefaults(e,t){ce(this,Sl).set(Ad(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ce(this,Sl).values()];let n={};return t.forEach(s=>{Ed(e,s.mutationKey)&&(n={...n,...s.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ce(this,Za).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qy(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.enabled!==!0&&t.queryFn===Vy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ce(this,Za).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ce(this,tn).clear(),ce(this,Ka).clear()}},tn=new WeakMap,Ka=new WeakMap,Za=new WeakMap,Nl=new WeakMap,Sl=new WeakMap,Xa=new WeakMap,kl=new WeakMap,Cl=new WeakMap,P_),oL=m.createContext(void 0),lL=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),r.jsx(oL.Provider,{value:e,children:t}));/**
482 * react-router v7.13.0
483 *
484 * Copyright (c) Remix Software Inc.
485 *
486 * This source code is licensed under the MIT license found in the
487 * LICENSE.md file in the root directory of this source tree.
488 *
489 * @license MIT
490 */var qj="popstate";function cL(e={}){function t(s,a){let{pathname:i,search:o,hash:l}=s.location;return Bx("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(s,a){return typeof a=="string"?a:Td(a)}return uL(t,n,null,e)}function Xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dL(){return Math.random().toString(36).substring(2,10)}function Vj(e,t){return{usr:e.state,key:e.key,idx:t}}function Bx(e,t,n=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Jl(t):t,state:n,key:t&&t.key||s||dL()}}function Td({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function uL(e,t,n,s={}){let{window:a=document.defaultView,v5Compat:i=!1}=s,o=a.history,l="POP",c=null,d=u();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function u(){return(o.state||{idx:null}).idx}function h(){l="POP";let b=u(),x=b==null?null:b-d;d=b,c&&c({action:l,location:v.location,delta:x})}function f(b,x){l="PUSH";let g=Bx(v.location,b,x);d=u()+1;let y=Vj(g,d),j=v.createHref(g);try{o.pushState(y,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}i&&c&&c({action:l,location:v.location,delta:1})}function p(b,x){l="REPLACE";let g=Bx(v.location,b,x);d=u();let y=Vj(g,d),j=v.createHref(g);o.replaceState(y,"",j),i&&c&&c({action:l,location:v.location,delta:0})}function w(b){return mL(b)}let v={get action(){return l},get location(){return e(a,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(qj,h),c=b,()=>{a.removeEventListener(qj,h),c=null}},createHref(b){return t(a,b)},createURL:w,encodeLocation(b){let x=w(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(b){return o.go(b)}};return v}function mL(e,t=!1){let n="http://localhost";
490typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Td(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function xk(e,t,n="/"){return hL(e,t,n,!1)}function hL(e,t,n,s){let a=typeof t=="string"?Jl(t):t,i=Sa(a.pathname||"/",n);if(i==null)return null;let o=vk(e);fL(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=SL(i);l=_L(o[c],d,s)}return l}function vk(e,t=[],n=[],s="",a=!1){let i=(o,l,c=a,d)=>{let u={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(s)&&c)return;Xt(u.relativePath.startsWith(s),`Absolute route path "${u.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(s.length)}let h=va([s,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Xt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),vk(o.children,t,f,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:bL(h,o.index),routesMeta:f})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))i(o,l);else for(let d of yk(o.path))i(o,l,!0,d)}),t}function yk(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return a?[i,""]:[i];let o=yk(s.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function fL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jL(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var pL=/^:[\w-]+$/,gL=3,xL=2,vL=1,yL=10,wL=-2,Yj=e=>e==="*";function bL(e,t){let n=e.split("/"),s=n.length;return n.some(Yj)&&(s+=wL),t&&(s+=xL),n.filter(a=>!Yj(a)).reduce((a,i)=>a+(pL.test(i)?gL:i===""?vL:yL),s)}function jL(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function _L(e,t,n=!1){let{routesMeta:s}=e,a={},i="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],d=l===s.length-1,u=i==="/"?t:t.slice(i.length)||"/",h=Sh({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),f=c.route;if(!h&&d&&n&&!s[s.length-1].route.index&&(h=Sh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!h)return null;
490Object.assign(a,h.params),o.push({params:a,pathname:va([i,h.pathname]),pathnameBase:EL(va([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=va([i,h.pathnameBase]))}return o}function Sh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=NL(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:s.reduce((d,{paramName:u,isOptional:h},f)=>{if(u==="*"){let w=l[f]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const p=l[f];return h&&!p?d[u]=void 0:d[u]=(p||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function NL(e,t=!1,n=!0){Cs(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function SL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cs(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Sa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var kL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function CL(e,t="/"){let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?Jl(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=Gj(n.substring(1),"/"):i=Gj(n,t)):i=t,{pathname:i,search:TL(s),hash:PL(a)}}function Gj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Lp(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function AL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wk(e){let t=AL(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function bk(e,t,n,s=!1){let a;typeof e=="string"?a=Jl(e):(a={...e},Xt(!a.pathname||!a.pathname.includes("?"),Lp("?","pathname","search",a)),Xt(!a.pathname||!a.pathname.includes("#"),Lp("#","pathname","hash",a)),Xt(!a.search||!a.search.includes("#"),Lp("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;a.pathname=f.join("/")}l=h>=0?t[h]:"/"}let c=CL(a,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}var va=e=>e.join("/").replace(/\/\/+/g,"/"),EL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RL=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ML(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function DL(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var jk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _k(e,t){let n=e;if(typeof n!="string"||!kL.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,a=!1;if(jk)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),l=Sa(o.pathname,t);o.origin===i.origin&&l!=null?n=l+o.search+o.hash:a=!0}catch{Cs(!1,`<Link to="${n}">
490 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Nk=["POST","PUT","PATCH","DELETE"];new Set(Nk);var OL=["GET",...Nk];new Set(OL);var ec=m.createContext(null);ec.displayName="DataRouter";var Nf=m.createContext(null);Nf.displayName="DataRouterState";var IL=m.createContext(!1),Sk=m.createContext({isTransitioning:!1});Sk.displayName="ViewTransition";var LL=m.createContext(new Map);LL.displayName="Fetchers";var FL=m.createContext(null);FL.displayName="Await";var ns=m.createContext(null);ns.displayName="Navigation";var lu=m.createContext(null);lu.displayName="Location";var ea=m.createContext({outlet:null,matches:[],isDataRoute:!1});ea.displayName="Route";var Yy=m.createContext(null);Yy.displayName="RouteError";var kk="REACT_ROUTER_ERROR",$L="REDIRECT",zL="ROUTE_ERROR_RESPONSE";function UL(e){if(e.startsWith(`${kk}:${$L}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function BL(e){if(e.startsWith(`${kk}:${zL}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new RL(t.status,t.statusText,t.data)}catch{}}function HL(e,{relative:t}={}){Xt(cu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=m.useContext(ns),{hash:a,pathname:i,search:o}=du(e,{relative:t}),l=i;return n!=="/"&&(l=i==="/"?n:va([n,i])),s.createHref({pathname:l,search:o,hash:a})}function cu(){return m.useContext(lu)!=null}function rs(){return Xt(cu(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(lu).location}var Ck="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ak(e){m.useContext(ns).static||m.useLayoutEffect(e)}function ta(){let{isDataRoute:e}=m.useContext(ea);return e?n3():WL()}function WL(){Xt(cu(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(ec),{basename:t,navigator:n}=m.useContext(ns),{matches:s}=m.useContext(ea),{pathname:a}=rs(),i=JSON.stringify(wk(s)),o=m.useRef(!1);return Ak(()=>{o.current=!0}),m.useCallback((c,d={})=>{if(Cs(o.current,Ck),!o.current)return;if(typeof c=="number"){n.go(c);return}let u=bk(c,JSON.parse(i),a,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:va([t,u.pathname])),(d.replace?n.replace:n.push)(u,d.state,d)},[t,n,i,a,e])}m.createContext(null);function Gy(){let{matches:e}=m.useContext(ea),t=e[e.length-1];return t?t.params:{}}function du(e,{relative:t}={}){let{matches:n}=m.useContext(ea),{pathname:s}=rs(),a=JSON.stringify(wk(n));return m.useMemo(()=>bk(e,JSON.parse(a),s,t==="path"),[e,a,s,t])}function qL(e,t){return Ek(e,t)}function Ek(e,t,n,s,a){var g;Xt(cu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(ns),{matches:o}=m.useContext(ea),l=o[o.length-1],c=l?l.params:{},d=l?l.pathname:"/",u=l?l.pathnameBase:"/",h=l&&l.route;{let y=h&&h.path||"";Pk(d,!h||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
491
492Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let f=rs(),p;if(t){let y=typeof t=="string"?Jl(t):t;Xt(u==="/"||((g=y.pathname)==null?void 0:g.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${y.pathname}" was given in the \`location\` prop.`),p=y}else p=f;let w=p.pathname||"/",v=w;if(u!=="/"){let y=u.replace(/^\//,"").split("/");v="/"+w.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=xk(e,{pathname:v});Cs(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Cs(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=ZL(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:va([u,i.encodeLocation?i.encodeLocation(y.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:va([u,i.encodeLocation?i.encodeLocation(y.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),o,n,s,a);return t&&x?m.createElement(lu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},x):x}function VL(){let e=t3(),t=ML(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:i},"ErrorBoundary")," or"," ",m.createElement("code",{style:i},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application 
492Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:a},n):null,o)}var YL=m.createElement(VL,null),Tk=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=BL(e.digest);n&&(e=n)}let t=e!==void 0?m.createElement(ea.Provider,{value:this.props.routeContext},m.createElement(Yy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?m.createElement(GL,{error:e},t):t}};Tk.contextType=IL;var Fp=new WeakMap;function GL({children:e,error:t}){let{basename:n}=m.useContext(ns);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=UL(t.digest);if(s){let a=Fp.get(t);if(a)throw a;let i=_k(s.location,n);if(jk&&!Fp.get(t))if(i.isExternal||s.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:s.replace}));throw Fp.set(t,o),o}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function KL({routeContext:e,match:t,children:n}){let s=m.useContext(ec);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(ea.Provider,{value:e},n)}function ZL(e,t=[],n=null,s=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let u=i.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);Xt(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let l=!1,c=-1;if(n)for(let u=0;u<i.length;u++){let h=i[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=u),h.route.id){let{loaderData:f,errors:p}=n,w=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||w){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}let d=n&&s?(u,h)=>{var f,p;s(u,{location:n.location,params:((p=(f=n.matches)==null?void 0:f[0])==null?void 0:p.params)??{},unstable_pattern:DL(n.matches),errorInfo:h})}:void 0;return i.reduceRight((u,h,f)=>{let p,w=!1,v=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,v=h.route.errorElement||YL,l&&(c<0&&f===0?(Pk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,b=null):c===f&&(w=!0,b=h.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,f+1)),g=()=>{let y;return p?y=v:w?y=b:h.route.Component?y=m.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=u,m.createElement(KL,{match:h,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?m.createElement(Tk,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:g(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:d}):g()},null)}function Ky(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function XL(e){let t=m.useContext(ec);return Xt(t,Ky(e)),t}function QL(e){let t=m.useContext(Nf);return Xt(t,Ky(e)),t}function JL(e){let t=m.useContext(ea);return Xt(t,Ky(e)),t}function Zy(e){let t=JL(e),n=t.matches[t.matches.length-1];return Xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function e3(){return Zy("useRouteId")}function t3(){var s;let e=m.useContext(Yy),t=QL("useRouteError"),n=Zy("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function n3(){let{router:e}=XL("useNavigate"),t=Zy("useNavigate"),n=m.useRef(!1);return Ak(()=>{n.current=!0}),m.useCallback(async(a,i={})=>{Cs(n.current,Ck),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Kj={};
492function Pk(e,t,n){!t&&!Kj[e]&&(Kj[e]=!0,Cs(!1,n))}m.memo(r3);function r3({routes:e,future:t,state:n,onError:s}){return Ek(e,void 0,n,s,t)}function ze(e){Xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function s3({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:a,static:i=!1,unstable_useTransitions:o}){Xt(!cu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=m.useMemo(()=>({basename:l,navigator:a,static:i,unstable_useTransitions:o,future:{}}),[l,a,i,o]);typeof n=="string"&&(n=Jl(n));let{pathname:d="/",search:u="",hash:h="",state:f=null,key:p="default"}=n,w=m.useMemo(()=>{let v=Sa(d,l);return v==null?null:{location:{pathname:v,search:u,hash:h,state:f,key:p},navigationType:s}},[l,d,u,h,f,p,s]);return Cs(w!=null,`<Router basename="${l}"> is not able to match the URL "${d}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:m.createElement(ns.Provider,{value:c},m.createElement(lu.Provider,{children:t,value:w}))}function a3({children:e,location:t}){return qL(Hx(e),t)}function Hx(e,t=[]){let n=[];return m.Children.forEach(e,(s,a)=>{if(!m.isValidElement(s))return;let i=[...t,a];if(s.type===m.Fragment){n.push.apply(n,Hx(s.props.children,i));return}Xt(s.type===ze,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Xt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Hx(s.props.children,i)),n.push(o)}),n}var Im="get",Lm="application/x-www-form-urlencoded";function Sf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function i3(e){return Sf(e)&&e.tagName.toLowerCase()==="button"}function o3(e){return Sf(e)&&e.tagName.toLowerCase()==="form"}function l3(e){return Sf(e)&&e.tagName.toLowerCase()==="input"}function c3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d3(e,t){return e.button===0&&(!t||t==="_self")&&!c3(e)}function Wx(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function u3(e,t){let n=Wx(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var am=null;function m3(){if(am===null)try{new FormData(document.createElement("form"),0),am=!1}catch{am=!0}return am}var h3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $p(e){return e!=null&&!h3.has(e)?(Cs(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lm}"`),null):e}function f3(e,t){let n,s,a,i,o;if(o3(e)){let l=e.getAttribute("action");s=l?Sa(l,t):null,n=e.getAttribute("method")||Im,a=$p(e.getAttribute("enctype"))||Lm,i=new FormData(e)}else if(i3(e)||l3(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(s=c?Sa(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Im,a=$p(e.getAttribute("formenctype"))||$p(l.getAttribute("enctype"))||Lm,i=new FormData(l,e),!m3()){let{name:d,type:u,value:h}=e;if(u==="image"){let f=d?`${d}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}
492else d&&i.append(d,h)}}else{if(Sf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Im,s=null,a=Lm,o=e}return i&&a==="text/plain"&&(o=i,i=void 0),{action:s,method:n.toLowerCase(),encType:a,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xy(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function p3(e,t,n,s){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${s}`:a.pathname=`${a.pathname}.${s}`:a.pathname==="/"?a.pathname=`_root.${s}`:t&&Sa(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${s}`,a}async function g3(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function x3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function v3(e,t,n){let s=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let o=await g3(i,n);return o.links?o.links():[]}return[]}));return j3(s.flat(1).filter(x3).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Zj(e,t,n,s,a,i){let o=(c,d)=>n[d]?c.route.id!==n[d].route.id:!0,l=(c,d)=>{var u;return n[d].pathname!==c.pathname||((u=n[d].route.path)==null?void 0:u.endsWith("*"))&&n[d].params["*"]!==c.params["*"]};return i==="assets"?t.filter((c,d)=>o(c,d)||l(c,d)):i==="data"?t.filter((c,d)=>{var h;let u=s.routes[c.route.id];if(!u||!u.hasLoader)return!1;if(o(c,d)||l(c,d))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function y3(e,t,{includeHydrateFallback:n}={}){return w3(e.map(s=>{let a=t.routes[s.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function w3(e){return[...new Set(e)]}function b3(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function j3(e,t){let n=new Set;return new Set(t),e.reduce((s,a)=>{let i=JSON.stringify(b3(a));return n.has(i)||(n.add(i),s.push({key:i,link:a})),s},[])}function Rk(){let e=m.useContext(ec);return Xy(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function _3(){let e=m.useContext(Nf);return Xy(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qy=m.createContext(void 0);Qy.displayName="FrameworkContext";function Mk(){let e=m.useContext(Qy);return Xy(e,"You must render this element inside a <HydratedRouter> element"),e}function N3(e,t){let n=m.useContext(Qy),[s,a]=m.useState(!1),[i,o]=m.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:u,onTouchStart:h}=t,f=m.useRef(null);m.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let v=x=>{x.forEach(g=>{o(g.isIntersecting)})},b=new IntersectionObserver(v,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[e]),m.useEffect(()=>{if(s){let v=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(v)}}},[s]);let p=()=>{a(!0)},w=()=>{a(!1),o(!1)};return n?e!=="intent"?[i,f,{}]:[i,f,{onFocus:_c(l,p),onBlur:_c(c,w),onMouseEnter:_c(d,p),onMouseLeave:_c(u,w),onTouchStart:_c(h,p)}]:[!1,f,{}]}function _c(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function S3({page:e,...t}){let{router:n}=Rk(),s=m.useMemo(()=>xk(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?m.createElement(C3,{page:e,matches:s,...t}):null}function k3(e){let{manifest:t,routeModules:n}=Mk(),[s,a]=m.useState([]);return m.useEffect(()=>{let i=!1;return v3(e,t,n).then(o=>{i||a(o)}),()=>{i=!0}},[e,t,n]),s}function C3({page:e,matches:t,...n}){let s=rs(),{future:a,manifest:i,routeModules:o}=Mk(),{basename:l}=Rk(),{loaderData:c,matches:d}=_3(),u=m.useMemo(()=>Zj(e,t,d,i,s,"data"),[e,t,d,i,s]),h=m.useMemo(()=>Zj(e,t,d,i,s,"assets"),[e,t,d,i,s]),f=m.useMemo(()=>
492{if(e===s.pathname+s.search+s.hash)return[];let v=new Set,b=!1;if(t.forEach(g=>{var j;let y=i.routes[g.route.id];!y||!y.hasLoader||(!u.some(N=>N.route.id===g.route.id)&&g.route.id in c&&((j=o[g.route.id])!=null&&j.shouldRevalidate)||y.hasClientLoader?b=!0:v.add(g.route.id))}),v.size===0)return[];let x=p3(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return b&&v.size>0&&x.searchParams.set("_routes",t.filter(g=>v.has(g.route.id)).map(g=>g.route.id).join(",")),[x.pathname+x.search]},[l,a.unstable_trailingSlashAwareDataRequests,c,s,i,u,t,e,o]),p=m.useMemo(()=>y3(h,i),[h,i]),w=k3(h);return m.createElement(m.Fragment,null,f.map(v=>m.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),p.map(v=>m.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),w.map(({key:v,link:b})=>m.createElement("link",{key:v,nonce:n.nonce,...b,crossOrigin:b.crossOrigin??n.crossOrigin})))}function A3(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var E3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{E3&&(window.__reactRouterVersion="7.13.0")}catch{}function T3({basename:e,children:t,unstable_useTransitions:n,window:s}){let a=m.useRef();a.current==null&&(a.current=cL({window:s,v5Compat:!0}));let i=a.current,[o,l]=m.useState({action:i.action,location:i.location}),c=m.useCallback(d=>{n===!1?l(d):m.startTransition(()=>l(d))},[n]);return m.useLayoutEffect(()=>i.listen(c),[i,c]),m.createElement(s3,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i,unstable_useTransitions:n})}var Dk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,be=m.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},w){let{basename:v,unstable_useTransitions:b}=m.useContext(ns),x=typeof d=="string"&&Dk.test(d),g=_k(d,v);d=g.to;let y=HL(d,{relative:a}),[j,N,k]=N3(s,p),_=M3(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b});function P(M){t&&t(M),M.defaultPrevented||_(M)}let $=m.createElement("a",{...p,...k,href:g.absoluteURL||y,onClick:g.isExternal||i?t:P,ref:A3(w,N),target:c,"data-discover":!x&&n==="render"?"true":void 0});return j&&!x?m.createElement(m.Fragment,null,$,m.createElement(S3,{page:y})):$});be.displayName="Link";var Ok=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:a=!1,style:i,to:o,viewTransition:l,children:c,...d},u){let h=du(o,{relative:d.relative}),f=rs(),p=m.useContext(Nf),{navigator:w,basename:v}=m.useContext(ns),b=p!=null&&F3(h)&&l===!0,x=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,g=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(g=g.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&v&&(y=Sa(y,v)||y);const j=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let N=g===x||!a&&g.startsWith(x)&&g.charAt(j)==="/",k=y!=null&&(y===x||!a&&y.startsWith(x)&&y.charAt(x.length)==="/"),_={isActive:N,isPending:k,isTransitioning:b},P=N?t:void 0,$;typeof s=="function"?$=s(_):$=[s,N?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(_):i;return m.createElement(be,{...d,"aria-current":P,className:$,ref:u,style:M,to:o,viewTransition:l},typeof c=="function"?c(_):c)});Ok.displayName="NavLink";var P3=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:a,state:i,method:o=Im,action:l,onSubmit:c,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},w)=>{let{unstable_useTransitions:v}=m.useContext(ns),b=I3(),x=L3(l,{relative:d}),g=o.toLowerCase()==="get"?"get":"post",y=typeof l=="string"&&Dk.test(l),j=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let k=N.nativeEvent.submitter,_=(k==null?void 0:k.getAttribute("formmethod"))||o,P=()=>b(k||N.currentTarget,{fetcherKey:t,method:_,navigate:n,replace:a,state:i,relative:d,preventScrollReset:u,viewTransition:h,unstable_defaultShouldRevalidate:f});v&&n!==!1?m.startTransition(()=>P()):P()};return m.createElement("form",{ref:w,method:g,action:x,onSubmit:s?c:j,...p,"data-discover":!y&&e==="render"?"true":void 0})});P3.displayName="Form";function R3(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ik(e){let t=m.useContext(ec);return Xt(t,R3(e)),t}function M3(e,{target:t,replace:n,state:s,preventScrollReset:a,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let d=ta(),u=rs(),h=du(e,{relative:i});return m.useCallback(f=>{if(d3(f,t)){f.preventDefault();let p=n!==void 0?n:Td(u)===Td(h),w=()=>d(e,{replace:p,state:s,preventScrollReset:a,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:l});c?m.startTransition(()=>w()):w()}},[u,d,h,n,s,t,e,a,i,o,l,c])}function _o(e){Cs(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(Wx(e)),n=m.useRef(!1),s=rs(),a=m.useMemo(()=>u3(s.search,n.current?null:t.current),[s.search]),i=ta(),o=m.useCallback((l,c)=>{const d=Wx(typeof l=="function"?l(new URLSearchParams(a)):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}var D3=0,O3=()=>`__${String(++D3)}__`;function I3(){let{router:e}=Ik("useSubmit"),{basename:t}=m.useContext(ns),n=e3(),s=e.fetch,a=e.navigate;return m.useCallback(async(i,o={})=>{let{action:l,method:c,encType:d,formData:u,body:h}=f3(i,t);if(o.navigate===!1){let f=o.fetcherKey||O3();await s(f,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await a(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:h,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[s,a,t,n])}function L3(e,{relative:t}={}){let{basename:n}=m.useContext(ns),s=m.useContext(ea);Xt(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),i={...du(e||".",{relative:t})},o=rs();if(e==null){i.search=o.search;let l=new URLSearchParams(i.search),c=l.getAll("index");if(c.some(u=>u==="")){l.delete("index"),c.filter(h=>
492h).forEach(h=>l.append("index",h));let u=l.toString();i.search=u?`?${u}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:va([n,i.pathname])),Td(i)}function F3(e,{relative:t}={}){let n=m.useContext(Sk);Xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Ik("useViewTransitionState"),a=du(e,{relative:t});if(!n.isTransitioning)return!1;let i=Sa(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=Sa(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Sh(a.pathname,o)!=null||Sh(a.pathname,i)!=null}const $3="modulepreload",z3=function(e){return"/"+e},Xj={},tc=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=z3(c),c in Xj)return;Xj[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":$3,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},U3=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>tc(async()=>{const{default:s}=await Promise.resolve().then(()=>nc);return{default:s}},[]).then(({default:s})=>s(...n)):t=fetch,(...n)=>t(...n)};class Jy extends Error{constructor(t,n="FunctionsError",s){super(t),this.name=n,this.context=s}}class B3 extends Jy{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Qj extends Jy{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Jj extends Jy{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var qx;(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"})(qx||(qx={}));var H3=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};class W3{constructor(t,{headers:n={},customFetch:s,region:a=qx.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=U3(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var s;return H3(this,void 0,void 0,function*(){try{const{headers:a,method:i,body:o}=n;let l={},{region:c}=n;c||(c=this.region);const d=new URL(`${this.url}/${t}`);c&&c!=="any"&&(l["x-region"]=c,d.searchParams.set("forceFunctionRegion",c));let u;o&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",u=o):typeof o=="string"?(l["Content-Type"]="text/plain",u=o):typeof FormData<"u"&&o instanceof FormData?u=o:(l["Content-Type"]="application/json",u=JSON.stringify(o)));const h=yield this.fetch(d.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),a),body:u}).catch(v=>{throw new B3(v)}),f=h.headers.get("x-relay-error");if(f&&f==="true")throw new Qj(h);if(!h.ok)throw new Jj(h);let p=((s=h.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),w;return p==="application/json"?w=yield h.json():p==="application/octet-stream"?w=yield h.blob():p==="text/event-stream"?w=h:p==="multipart/form-data"?w=yield h.formData():w=yield h.text(),{data:w,error:null,response:h}}catch(a){return{data:null,error:a,response:a instanceof Jj||a instanceof Qj?a.context:void 0}}})}}var hr={},ew={},kf={},uu={},Cf={},Af={},q3=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Ll=q3();const V3=Ll.fetch,Lk=Ll.fetch.bind(Ll),Fk=Ll.Headers,Y3=Ll.Request,G3=Ll.Response,nc=Object.freeze(Object.defineProperty({__proto__:null,Headers:Fk,Request:Y3,Response:G3,default:Lk,fetch:V3},Symbol.toStringTag,{value:"Module"})),K3=aP(nc);var Ef={};
492Object.defineProperty(Ef,"__esModule",{value:!0});let Z3=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};Ef.default=Z3;var $k=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Af,"__esModule",{value:!0});const X3=$k(K3),Q3=$k(Ef);let J3=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=X3.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=Object.assign({},this.headers),this.headers[t]=n,this}then(t,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const s=this.fetch;let a=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,l,c;let d=null,u=null,h=null,f=i.status,p=i.statusText;if(i.ok){if(this.method!=="HEAD"){const x=await i.text();x===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u=x:u=JSON.parse(x))}const v=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),b=(l=i.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");v&&b&&b.length>1&&(h=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(u)&&(u.length>1?(d={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,h=null,f=406,p="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{const v=await i.text();try{d=JSON.parse(v),Array.isArray(d)&&i.status===404&&(u=[],d=null,f=200,p="OK")}catch{i.status===404&&v===""?(f=204,p="No Content"):d={message:v}}if(d&&this.isMaybeSingle&&(!((c=d==null?void 0:d.details)===null||c===void 0)&&c.includes("0 rows"))&&(d=null,f=200,p="OK"),d&&this.shouldThrowOnError)throw new Q3.default(d)}return{error:d,data:u,count:h,status:f,statusText:p}});return this.shouldThrowOnError||(a=a.catch(i=>{var o,l,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(l=i==null?void 0:i.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),a.then(t,n)}returns(){return this}overrideTypes(){return this}};Af.default=J3;var e5=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cf,"__esModule",{value:!0});const t5=e5(Af);let n5=class extends t5.default{select(t){let n=!1;const s=(t??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:n=!0,nullsFirst:s,foreignTable:a,referencedTable:i=a}={}){const o=i?`${i}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${n?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:s=n}={}){const a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,n,{foreignTable:s,referencedTable:a=s}={}){const i=typeof a>"u"?"offset":`${a}.offset`,o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(o,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
492explain({analyze:t=!1,verbose:n=!1,settings:s=!1,buffers:a=!1,wal:i=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,n?"verbose":null,s?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${d}"; options=${c};`,o==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Cf.default=n5;var r5=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uu,"__esModule",{value:!0});const s5=r5(Cf);let a5=class extends s5.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const s=Array.from(new Set(n)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${s})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:s,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const o=s===void 0?"":`(${s})`;return this.url.searchParams.append(t,`${i}fts${o}.${n}`),this}match(t){return Object.entries(t).forEach(([n,s])=>{this.url.searchParams.append(n,`eq.${s}`)}),this}not(t,n,s){return this.url.searchParams.append(t,`not.${n}.${s}`),this}or(t,{foreignTable:n,referencedTable:s=n}={}){const a=s?`${s}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,n,s){return this.url.searchParams.append(t,`${n}.${s}`),this}};uu.default=a5;var i5=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kf,"__esModule",{value:!0});const Nc=i5(uu);let o5=class{constructor(t,{headers:n={},schema:s,fetch:a}){this.url=t,this.headers=n,this.schema=s,this.fetch=a}select(t,{head:n=!1,count:s}={}){const a=n?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),s&&(this.headers.Prefer=`count=${s}`),new Nc.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:n,defaultToNull:s=!0}={}){const a="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),s||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Nc.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:n,ignoreDuplicates:s=!1,count:a,defaultToNull:i=!0}={}){const o="POST",l=[`resolution=${s?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&l.push(this.headers.Prefer),a&&l.push(`count=${a}`),i||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(t)){const c=t.reduce((d,u)=>d.concat(Object.keys(u)),[]);if(c.length>0){const d=[...new Set(c)].map(u=>`"${u}"`);this.url.searchParams.set("columns",d.join(","))}}return new Nc.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:n}={}){const s="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),n&&a.push(`count=${n}`),this.headers.Prefer=a.join(","),new Nc.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const n="DELETE",s=[];return t&&s.push(`count=${t}`),this.headers.Prefer&&s.unshift(this.headers.Prefer),this.headers.Prefer=s.join(","),new Nc.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};kf.default=o5;var Tf={},Pf={};
492Object.defineProperty(Pf,"__esModule",{value:!0});Pf.version=void 0;Pf.version="0.0.0-automated";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.DEFAULT_HEADERS=void 0;const l5=Pf;Tf.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${l5.version}`};var zk=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ew,"__esModule",{value:!0});const c5=zk(kf),d5=zk(uu),u5=Tf;let m5=class Uk{constructor(t,{headers:n={},schema:s,fetch:a}={}){this.url=t,this.headers=Object.assign(Object.assign({},u5.DEFAULT_HEADERS),n),this.schemaName=s,this.fetch=a}from(t){const n=new URL(`${this.url}/${t}`);return new c5.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Uk(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:s=!1,get:a=!1,count:i}={}){let o;const l=new URL(`${this.url}/rpc/${t}`);let c;s||a?(o=s?"HEAD":"GET",Object.entries(n).filter(([u,h])=>h!==void 0).map(([u,h])=>[u,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([u,h])=>{l.searchParams.append(u,h)})):(o="POST",c=n);const d=Object.assign({},this.headers);return i&&(d.Prefer=`count=${i}`),new d5.default({method:o,url:l,headers:d,schema:this.schemaName,body:c,fetch:this.fetch,allowEmpty:!1})}};ew.default=m5;var rc=Xr&&Xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hr,"__esModule",{value:!0});hr.PostgrestError=hr.PostgrestBuilder=hr.PostgrestTransformBuilder=hr.PostgrestFilterBuilder=hr.PostgrestQueryBuilder=hr.PostgrestClient=void 0;const Bk=rc(ew);hr.PostgrestClient=Bk.default;const Hk=rc(kf);hr.PostgrestQueryBuilder=Hk.default;const Wk=rc(uu);hr.PostgrestFilterBuilder=Wk.default;const qk=rc(Cf);hr.PostgrestTransformBuilder=qk.default;const Vk=rc(Af);hr.PostgrestBuilder=Vk.default;const Yk=rc(Ef);hr.PostgrestError=Yk.default;var h5=hr.default={PostgrestClient:Bk.default,PostgrestQueryBuilder:Hk.default,PostgrestFilterBuilder:Wk.default,PostgrestTransformBuilder:qk.default,PostgrestBuilder:Vk.default,PostgrestError:Yk.default};const{PostgrestClient:f5,PostgrestQueryBuilder:aK,PostgrestFilterBuilder:iK,PostgrestTransformBuilder:oK,PostgrestBuilder:lK,PostgrestError:cK}=h5;function p5(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const g5=p5(),x5="2.11.15",v5=`realtime-js/${x5}`,y5="1.0.0",Gk=1e4,w5=1e3;var rd;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(rd||(rd={}));var qn;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(qn||(qn={}));var ps;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(ps||(ps={}));var Vx;(function(e){e.websocket="websocket"})(Vx||(Vx={}));var qi;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(qi||(qi={}));class b5{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),s=new TextDecoder;return this._decodeBroadcast(t,n,s)}_decodeBroadcast(t,n,s){const a=n.getUint8(1),i=n.getUint8(2);let o=this.HEADER_LENGTH+2;const l=s.decode(t.slice(o,o+a));o=o+a;const c=s.decode(t.slice(o,o+i));o=o+i;const d=JSON.parse(s.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:d}}}class Kk{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}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))}}var Rt;(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"})(Rt||(Rt={}));const e0=(e,t,n={})=>{var s;const a=(s=n.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(t).reduce((i,o)=>(i[o]=j5(o,e,t,a),i),{})},j5=(e,t,n,s)=>{const a=t.find(l=>
vendor: 11,602 bytes, line 492
492l.name===e),i=a==null?void 0:a.type,o=n[e];return i&&!s.includes(i)?Zk(i,o):Yx(o)},Zk=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return k5(t,n)}switch(e){case Rt.bool:return _5(t);case Rt.float4:case Rt.float8:case Rt.int2:case Rt.int4:case Rt.int8:case Rt.numeric:case Rt.oid:return N5(t);case Rt.json:case Rt.jsonb:return S5(t);case Rt.timestamp:return C5(t);case Rt.abstime:case Rt.date:case Rt.daterange:case Rt.int4range:case Rt.int8range:case Rt.money:case Rt.reltime:case Rt.text:case Rt.time:case Rt.timestamptz:case Rt.timetz:case Rt.tsrange:case Rt.tstzrange:return Yx(t);default:return Yx(t)}},Yx=e=>e,_5=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},N5=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},S5=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},k5=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,s=e[n];if(e[0]==="{"&&s==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>Zk(t,l))}return e},C5=e=>typeof e=="string"?e.replace(" ","T"):e,Xk=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class zp{constructor(t,n,s={},a=Gk){this.channel=t,this.event=n,this.payload=s,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var s;return this._hasReceived(t)&&n((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var t0;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(t0||(t0={}));class sd{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=sd.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=sd.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(s.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=sd.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,s,a){const i=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(i,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const h=i[d];if(h){const f=u.map(b=>b.presence_ref),p=h.map(b=>b.presence_ref),w=u.filter(b=>p.indexOf(b.presence_ref)<0),v=h.filter(b=>f.indexOf(b.presence_ref)<0);w.length>0&&(l[d]=w),v.length>0&&(c[d]=v)}else l[d]=u}),this.syncDiff(i,{joins:l,leaves:c},s,a)}static syncDiff(t,n,s,a){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return s||(s=()=>{}),a||(a=()=>{}),this.map(i,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const h=t[l].map(p=>p.presence_ref),f=u.filter(p=>h.indexOf(p.presence_ref)<0);t[l].unshift(...f)}s(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(h=>h.presence_ref);d=d.filter(h=>u.indexOf(h.presence_ref)<0),t[l]=d,a(l,d,c),d.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(s=>n(s,t[s]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,s)=>{const a=t[s];return"metas"in a?n[s]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[s]=a,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var n0;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(n0||(n0={}));var r0;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(r0||(r0={}));var da;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(da||(da={}));class tw{constructor(t,n={config:{}},s){this.topic=t,this.params=n,this.socket=s,this.bindings={},this.state=qn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new zp(this,ps.join,this.params,this.timeout),this.rejoinTimer=new Kk(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=qn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=qn.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=qn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=qn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ps.reply,{},(a,i)=>{this._trigger(this._replyEventName(i),a)}),this.presence=new sd(this),this.broadcastEndpointURL=Xk(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var s,a;if(this.socket.isConnected()||this.socket.connect(),this.state==qn.closed){const{config:{broadcast:i,presence:o,private:l}}=this.params;this._onError(u=>t==null?void 0:t(da.CHANNEL_ERROR,u)),this._onClose(()=>t==null?void 0:t(da.CLOSED));const c={},d={broadcast:i,presence:o,postgres_changes:(a=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(u=>u.filter))!==null&&a!==void 0?a:[],private:l};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:d},c)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:u})=>{var h;if(this.socket.setAuth(),u===void 0){t==null||t(da.SUBSCRIBED);return}else{const f=this.bindings.postgres_changes,p=(h=f==null?void 0:f.length)!==null&&h!==void 0?h:0,w=[];for(let v=0;v<p;v++){const b=f[v],{filter:{event:x,schema:g,table:y,filter:j}}=b,N=u&&u[v];if(N&&N.event===x&&N.schema===g&&N.table===y&&N.filter===j)w.push(Object.assign(Object.assign({},b),{id:N.id}));else{this.unsubscribe(),this.state=qn.errored,t==null||t(da.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=w,t&&t(da.SUBSCRIBED);return}}).receive("error",u=>{this.state=qn.errored,t==null||t(da.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(da.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,s){return this._on(t,n,s)}async send(t,n={}){var s,a;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);return await((a=d.body)===null||a===void 0?void 0:a.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const d=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=qn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ps.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(a=>{s=new zp(this,ps.leave,{},t),s.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s==null||s.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,n,s){const a=new AbortController,i=setTimeout(()=>a.abort(),s),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),o}_push(t,n,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new zp(this,t,n,s);return this._canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}_onMessage(t,n,s){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,s){var a,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=ps;if(s&&[l,c,d,u].indexOf(o)>=0&&s!==this._joinRef())return;let f=this._onMessage(o,n,s);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(p=>{var w,v,b;return((w=p.filter)===null||w===void 0?void 0:w.event)==="*"||((b=(v=p.filter)===null||v===void 0?void 0:v.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===o}).map(p=>
492p.callback(f,s)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var w,v,b,x,g,y;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const j=p.id,N=(w=p.filter)===null||w===void 0?void 0:w.event;return j&&((v=n.ids)===null||v===void 0?void 0:v.includes(j))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((b=n.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const j=(g=(x=p==null?void 0:p.filter)===null||x===void 0?void 0:x.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return j==="*"||j===((y=n==null?void 0:n.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const w=f.data,{schema:v,table:b,commit_timestamp:x,type:g,errors:y}=w;f=Object.assign(Object.assign({},{schema:v,table:b,commit_timestamp:x,eventType:g,new:{},old:{},errors:y}),this._getPayloadRecords(w))}p.callback(f,s)})}_isClosed(){return this.state===qn.closed}_isJoined(){return this.state===qn.joined}_isJoining(){return this.state===qn.joining}_isLeaving(){return this.state===qn.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,s){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:s};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const s=t.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&tw.isEqual(a.filter,n))}),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const s in t)if(t[s]!==n[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(ps.close,{},t)}_onError(t){this._on(ps.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=qn.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=e0(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=e0(t.columns,t.old_record)),n}}const s0=()=>{},A5=`
493  addEventListener("message", (e) => {
494    if (e.data.event === "start") {
495      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
496    }
497  });`;class E5{constructor(t,n){var s;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Gk,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=s0,this.ref=0,this.logger=s0,this.conn=null,this.sendBuffer=[],this.serializer=new b5,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...l)=>tc(async()=>{const{default:c}=await Promise.resolve().then(()=>nc);return{default:c}},void 0).then(({default:c})=>c(...l)):o=fetch,(...l)=>o(...l)},this.endPoint=`${t}/${Vx.websocket}`,this.httpEndpoint=Xk(t),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),(n!=null&&n.logLevel||n!=null&&n.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const a=(s=n==null?void 0:n.params)===null||s===void 0?void 0:s.apikey;if(a&&(this.accessTokenValue=a,this.apiKey=a),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(i,o)=>o(JSON.stringify(i)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Kk(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport||(this.transport=g5),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:y5}))}
497disconnect(t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(s=>s.teardown()))}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,s){this.logger(t,n,s)}connectionState(){switch(this.conn&&this.conn.readyState){case rd.connecting:return qi.Connecting;case rd.open:return qi.Open;case rd.closing:return qi.Closing;default:return qi.Closed}}isConnected(){return this.connectionState()===qi.Open}channel(t,n={config:{}}){const s=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===s);if(a)return a;{const i=new tw(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:s,payload:a,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${s} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){let n=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const a={access_token:n,version:v5};n&&s.updateJoinPayload(a),s.joinedOnce&&s._isJoined()&&s._push(ps.access_token,{access_token:n})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close(w5,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(s=>s.topic===t&&(s._isJoined()||s._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,n=>{let{topic:s,event:a,payload:i,ref:o}=n;s==="phoenix"&&a==="phx_reply"&&this.heartbeatCallback(n.payload.status=="ok"?"ok":"error"),o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${s} ${a} ${o&&"("+o+")"||""}`,i),Array.from(this.channels).filter(l=>l._isMember(s)).forEach(l=>l._trigger(a,i,o)),this.stateChangeCallbacks.message.forEach(l=>l(n))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(t))}
497_triggerChanError(){this.channels.forEach(t=>t._trigger(ps.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const s=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${s}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const s=new Blob([A5],{type:"application/javascript"});n=URL.createObjectURL(s)}return n}}class nw extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function Tn(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class T5 extends nw{constructor(t,n,s){super(t),this.name="StorageApiError",this.status=n,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class Gx extends nw{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var P5=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};const Qk=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>tc(async()=>{const{default:s}=await Promise.resolve().then(()=>nc);return{default:s}},void 0).then(({default:s})=>s(...n)):t=fetch,(...n)=>t(...n)},R5=()=>P5(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield tc(()=>Promise.resolve().then(()=>nc),void 0)).Response:Response}),Kx=e=>{if(Array.isArray(e))return e.map(n=>Kx(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,s])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=Kx(s)}),t},M5=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)};var No=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};const Up=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),D5=(e,t,n)=>No(void 0,void 0,void 0,function*(){const s=yield R5();e instanceof s&&!(n!=null&&n.noResolveJson)?e.json().then(a=>{const i=e.status||500,o=(a==null?void 0:a.statusCode)||i+"";t(new T5(Up(a),i,o))}).catch(a=>{t(new Gx(Up(a),a))}):t(new Gx(Up(e),e))}),O5=(e,t,n,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!s?a:(M5(s)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(s)):a.body=s,Object.assign(Object.assign({},a),n))};function mu(e,t,n,s,a,i){return No(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(n,O5(t,s,a,i)).then(c=>{if(!c.ok)throw c;return s!=null&&s.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>D5(c,l,s))})})}function kh(e,t,n,s){return No(this,void 0,void 0,function*(){return mu(e,"GET",t,n,s)})}function ua(e,t,n,s,a){return No(this,void 0,void 0,function*(){return mu(e,"POST",t,s,a,n)})}function Zx(e,t,n,s,a){return No(this,void 0,void 0,function*(){return mu(e,"PUT",t,s,a,n)})}function I5(e,t,n,s){return No(this,void 0,void 0,function*(){return mu(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),s)})}function Jk(e,t,n,s,a){return No(this,void 0,void 0,function*(){return mu(e,"DELETE",t,s,a,n)})}var ur=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};const L5={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a0={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class F5{constructor(t,n={},s,a){this.url=t,this.headers=n,this.bucketId=s,this.fetch=Qk(a)}uploadOrUpdate(t,n,s,a){return ur(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},a0),a);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&s instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",s)):typeof FormData<"u"&&s instanceof FormData?(i=s,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=s,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),a!=null&&a.headers&&(l=Object.assign(Object.assign({},l),a.headers));const d=this._removeEmptyFolders(n),u=this._getFinalPath(d),h=yield(t=="PUT"?Zx:ua)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(Tn(i))return{data:null,error:i};throw i}})}upload(t,n,s){return ur(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,s)})}uploadToSignedUrl(t,n,s,a){return ur(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",n);try{let c;const d=Object.assign({upsert:a0.upsert},a),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.append("cacheControl",d.cacheControl)):(c=s,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType);const h=yield Zx(this.fetch,l.toString(),c,{headers:u});return{data:{path:i,fullPath:h.Key},error:null}}catch(c){if(Tn(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,n){return ur(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t);const a=Object.assign({},this.headers);n!=null&&n.upsert&&(a["x-upsert"]="true");const i=yield ua(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:a}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new nw("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(s){if(Tn(s))return{data:null,error:s};throw s}})}update(t,n,s){return ur(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,s)})}move(t,n,s){return ur(this,void 0,void 0,function*(){try{return{data:yield ua(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(Tn(a))return{data:null,error:a};throw a}})}copy(t,n,s){return ur(this,void 0,void 0,function*(){try{return{data:{path:(yield ua(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(Tn(a))return{data:null,error:a};throw a}})}createSignedUrl(t,n,s){return ur(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield ua(this.fetch,`${this.url}/object/sign/${a}
497`,Object.assign({expiresIn:n},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(Tn(a))return{data:null,error:a};throw a}})}createSignedUrls(t,n,s){return ur(this,void 0,void 0,function*(){try{const a=yield ua(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),i=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(Tn(a))return{data:null,error:a};throw a}})}download(t,n){return ur(this,void 0,void 0,function*(){const a=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=i?`?${i}`:"";try{const l=this._getFinalPath(t);return{data:yield(yield kh(this.fetch,`${this.url}/${a}/${l}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(Tn(l))return{data:null,error:l};throw l}})}info(t){return ur(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const s=yield kh(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:Kx(s),error:null}}catch(s){if(Tn(s))return{data:null,error:s};throw s}})}exists(t){return ur(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield I5(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(Tn(s)&&s instanceof Gx){const a=s.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:s}}throw s}})}getPublicUrl(t,n){const s=this._getFinalPath(t),a=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&a.push(i);const l=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&a.push(c);let d=a.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${s}${d}`)}}}remove(t){return ur(this,void 0,void 0,function*(){try{return{data:yield Jk(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(Tn(n))return{data:null,error:n};throw n}})}list(t,n,s){return ur(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},L5),n),{prefix:t||""});return{data:yield ua(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},s),error:null}}catch(a){if(Tn(a))return{data:null,error:a};throw a}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const $5="2.10.4",z5={"X-Client-Info":`storage-js/${$5}`};var Po=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};class U5{constructor(t,n={},s,a){const i=new URL(t);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href,this.headers=Object.assign(Object.assign({},z5),n),this.fetch=Qk(s)}listBuckets(){return Po(this,void 0,void 0,function*(){try{return{data:yield kh(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(Tn(t))return{data:null,error:t};throw t}})}getBucket(t){return Po(this,void 0,void 0,function*(){try{return{data:yield kh(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(Tn(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return Po(this,void 0,void 0,function*(){try{return{data:yield ua(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(Tn(s))return{data:null,error:s};throw s}})}updateBucket(t,n){return Po(this,void 0,void 0,function*(){try{return{data:yield Zx(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(Tn(s))return{data:null,error:s};throw s}})}emptyBucket(t){return Po(this,void 0,void 0,function*(){try{return{data:yield ua(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(Tn(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Po(this,void 0,void 0,function*(){try{return{data:yield Jk(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(Tn(n))return{data:null,error:n};throw n}})}}class B5 extends U5{constructor(t,n={},s,a){super(t,n,s,a)}from(t){return new F5(this.url,this.headers,t,this.fetch)}}const H5="2.53.0";let Bc="";typeof Deno<"u"?Bc="deno":typeof document<"u"?Bc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Bc="react-native":Bc="node";const W5={"X-Client-Info":`supabase-js-${Bc}/${H5}`},q5={headers:W5},V5={schema:"public"},Y5={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},G5={};var K5=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}
497return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};const Z5=e=>{let t;return e?t=e:typeof fetch>"u"?t=Lk:t=fetch,(...n)=>t(...n)},X5=()=>typeof Headers>"u"?Fk:Headers,Q5=(e,t,n)=>{const s=Z5(n),a=X5();return(i,o)=>K5(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let d=new a(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),s(i,Object.assign(Object.assign({},o),{headers:d}))})};var J5=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};function e6(e){return e.endsWith("/")?e:e+"/"}function t6(e,t){var n,s;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:h}=t,f={db:Object.assign(Object.assign({},c),a),auth:Object.assign(Object.assign({},d),i),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),l),{headers:Object.assign(Object.assign({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(s=l==null?void 0:l.headers)!==null&&s!==void 0?s:{})}),accessToken:()=>J5(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}const eC="2.71.1",zo=30*1e3,Xx=3,Bp=Xx*zo,n6="http://localhost:9999",r6="supabase.auth.token",s6={"X-Client-Info":`gotrue-js/${eC}`},Qx="X-Supabase-Api-Version",tC={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},a6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,i6=10*60*1e3;class rw extends Error{constructor(t,n,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=s}}function Xe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class o6 extends rw{constructor(t,n,s){super(t,n,s),this.name="AuthApiError",this.status=n,this.code=s}}function l6(e){return Xe(e)&&e.name==="AuthApiError"}class nC extends rw{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Mi extends rw{constructor(t,n,s,a){super(t,s,a),this.name=n,this.status=s}}class $a extends Mi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function c6(e){return Xe(e)&&e.name==="AuthSessionMissingError"}class im extends Mi{constructor(){super("Auth session or user missing","AuthInvalidToken
497ResponseError",500,void 0)}}class om extends Mi{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class lm extends Mi{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function d6(e){return Xe(e)&&e.name==="AuthImplicitGrantRedirectError"}class i0 extends Mi{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Jx extends Mi{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Hp(e){return Xe(e)&&e.name==="AuthRetryableFetchError"}class o0 extends Mi{constructor(t,n,s){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=s}}class ev extends Mi{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),l0=` 	
498\r=`.split(""),u6=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<l0.length;t+=1)e[l0[t].charCodeAt(0)]=-2;for(let t=0;t<Ch.length;t+=1)e[Ch[t].charCodeAt(0)]=t;return e})();function c0(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;n(Ch[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;n(Ch[s]),t.queuedBits-=6}}function rC(e,t,n){const s=u6[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)n(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 d0(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},s={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{f6(o,s,n)};for(let o=0;o<e.length;o+=1)rC(e.charCodeAt(o),a,i);return t.join("")}function m6(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 h6(e,t){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>55295&&s<=56319){const a=(s-55296)*1024&65535;s=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}m6(s,t)}}function f6(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let s=1;s<6;s+=1)if(!(e>>7-s&1)){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function p6(e){const t=[],n={queue:0,queuedBits:0},s=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)rC(e.charCodeAt(a),n,s);return new Uint8Array(t)}function g6(e){const t=[];return h6(e,n=>t.push(n)),new Uint8Array(t)}function x6(e){const t=[],n={queue:0,queuedBits:0},s=a=>{t.push(a)};return e.forEach(a=>c0(a,n,s)),c0(null,n,s),t.join("")}function v6(e){return Math.round(Date.now()/1e3)+e}function y6(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const ls=()=>typeof window<"u"&&typeof document<"u",Fi={tested:!1,writable:!1},sC=()=>{if(!ls())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Fi.tested)return Fi.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Fi.tested=!0,Fi.writable=!0}catch{Fi.tested=!0,Fi.writable=!1}return Fi.writable};function w6(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((s,a)=>{t[a]=s}),t}const aC=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>tc(async()=>{const{default:s}=await Promise.resolve().then(()=>nc);return{default:s}},void 0).then(({default:s})=>s(...n)):t=fetch,(...n)=>t(...n)},b6=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Uo=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},$i=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Oa=async(e,t)=>{await e.removeItem(t)};class Rf{constructor(){this.promise=new Rf.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Rf.promiseConstructor=Promise;function Wp(e){const t=e.split(".");if(t.length!==3)throw new ev("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!a6.test(t[s]))throw new ev("JWT not in base64url format");return{header:JSON.parse(d0(t[0])),payload:JSON.parse(d0(t[1])),signature:p6(t[2]),raw:{header:t[0],payload:t[1]}}}async function j6(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function _6(e,t){return new Promise((s,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){s(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function N6(e){return("0"+e.toString(16)).substr(-2)}function S6(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*s));return a}return crypto.getRandomValues(t),Array.from(t,N6).join("")}async function k6(e){const n=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",
498n),a=new Uint8Array(s);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function C6(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await k6(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ro(e,t,n=!1){const s=S6();let a=s;n&&(a+="/PASSWORD_RECOVERY"),await Uo(e,`${t}-code-verifier`,a);const i=await C6(s);return[i,s===i?"plain":"s256"]}const A6=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function E6(e){const t=e.headers.get(Qx);if(!t||!t.match(A6))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function T6(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 P6(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 R6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Mo(e){if(!R6.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function qp(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const s=n.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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function u0(e){return JSON.parse(JSON.stringify(e))}var M6=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n};const Hi=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),D6=[502,503,504];async function m0(e){var t;if(!b6(e))throw new Jx(Hi(e),0);if(D6.includes(e.status))throw new Jx(Hi(e),e.status);let n;try{n=await e.json()}catch(i){throw new nC(Hi(i),i)}let s;const a=E6(e);if(a&&a.getTime()>=tC["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?s=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(s=n.error_code),s){if(s==="weak_password")throw new o0(Hi(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new $a}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new o0(Hi(n),e.status,n.weak_password.reasons);throw new o6(Hi(n),e.status||500,s)}const O6=(e,t,n,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(s),Object.assign(Object.assign({},a),n))};async function ut(e,t,n,s){var a;const i=Object.assign({},s==null?void 0:s.headers);i[Qx]||(i[Qx]=tC["2024-01-01"].name),s!=null&&s.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(a=s==null?void 0:s.query)!==null&&a!==void 0?a:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await I6(e,t,n+l,{headers:i,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(c):{data:Object.assign({},c),error:null}}async function I6(e,t,n,s,a,i){const o=O6(t,s,a,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Jx(Hi(c),0)}if(l.ok||await m0(l),s!=null&&s.noResolveJson)return l;try{return await l.json()}catch(c){await m0(c)}}function oa(e){var t;let n=null;z6(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=v6(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:s},error:null}}function h0(e){const t=oa(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function qa(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function L6(e){return{data:e,error:null}}function F6(e){const{action_link:t,email_otp:n,hashed_token:s,redirect_to:a,verification_type:i}=e,o=M6(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:s,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function $6(e){return e}function z6(e){return e.access_token&&e.refresh_token&&e.expires_in}const Vp=["global","local","others"];var U6=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n};class B6{constructor({url:t="",headers:n={},fetch:s}){this.url=t,this.headers=n,this.fetch=aC(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}
498async signOut(t,n=Vp[0]){if(Vp.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Vp.join(", ")}`);try{return await ut(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Xe(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,n={}){try{return await ut(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:qa})}catch(s){if(Xe(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:n}=t,s=U6(t,["options"]),a=Object.assign(Object.assign({},s),n);return"newEmail"in s&&(a.new_email=s==null?void 0:s.newEmail,delete a.newEmail),await ut(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:F6,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Xe(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await ut(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:qa})}catch(n){if(Xe(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,s,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await ut(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:$6});if(u.error)throw u.error;const h=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(w=>{const v=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);d[`${b}Page`]=v}),d.total=parseInt(f)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(Xe(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Mo(t);try{return await ut(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:qa})}catch(n){if(Xe(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Mo(t);try{return await ut(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:qa})}catch(s){if(Xe(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,n=!1){Mo(t);try{return await ut(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:qa})}catch(s){if(Xe(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){Mo(t.userId);try{const{data:n,error:s}=await ut(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:s}}catch(n){if(Xe(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Mo(t.userId),Mo(t.id);try{return{data:await ut(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Xe(n))return{data:null,error:n};throw n}}}function f0(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function H6(){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)}}const Do={debug:!!(globalThis&&sC()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class iC extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class W6 extends iC{}async function q6(e,t,n){Do.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;return t>0&&setTimeout(()=>{s.abort(),Do.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async a=>{if(a){Do.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{Do.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw Do.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new W6(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Do.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}H6();const V6={url:n6,storageKey:r6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:s6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function p0(e,t,n){return await n()}const Oo={};class Pd{constructor(t){var n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Pd.nextInstanceID,Pd.nextInstanceID+=1,this.instanceID>0&&ls()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},V6),t);
498if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new B6({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=aC(a.fetch),this.lock=a.lock||p0,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:ls()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=q6:this.lock=p0,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)},this.persistSession?(a.storage?this.storage=a.storage:sC()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=f0(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=f0(this.memoryStorage)),ls()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var t,n;return(n=(t=Oo[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Oo[this.storageKey]=Object.assign(Object.assign({},Oo[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Oo[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Oo[this.storageKey]=Object.assign(Object.assign({},Oo[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${eC}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=w6(window.location.href);let s="none";if(this._isImplicitGrantCallback(n)?s="implicit":await this._isPKCECallback(n)&&(s="pkce"),ls()&&this.detectSessionInUrl&&s!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),d6(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Xe(n)?{error:n}:{error:new nC("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,s,a;try{const i=await ut(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:oa}),{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(Xe(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var n,s,a;try{let i;if("email"in t){const{email:u,password:h,options:f}=t;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await Ro(this.storage,this.storageKey)),i=await ut(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:w},xform:oa})}else if("phone"in t){const{phone:u,password:h,options:f}=t;i=await ut(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(s=f==null?void 0:f.data)!==null&&s!==void 0?s:{},channel:(a=f==null?void 0:f.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:oa})}else throw new om("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(Xe(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:l}=t;n=await ut(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:h0})}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await ut(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:h0})}else throw new om("You must provide either an email or phone number and a password");const{data:s,error:a}=n;return a?{data:{user:null,session:null},error:a}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new im}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:a})}catch(n){if(Xe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,s,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;if(n==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}async signInWithSolana(t){var n,s,a,i,o,l,c,d,u,h,f,p;let w,v;if("message"in t)w=t.message,v=t.signature;else{const{chain:b,wallet:x,statement:g,options:y}=t;let j;if(ls())if(typeof x=="object")j=x;
498else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))j=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=x}const N=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const k=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),g?{statement:g}:null));let _;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")_=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)_=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),v=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${N.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(a=(s=y==null?void 0:y.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=y==null?void 0:y.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((d=y==null?void 0:y.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((h=(u=y==null?void 0:y.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...y.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
499`);const k=await j.signMessage(new TextEncoder().encode(w),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=k}}try{const{data:b,error:x}=await ut(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:x6(v)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:oa});if(x)throw x;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new im}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:x})}catch(b){if(Xe(b))return{data:{user:null,session:null},error:b};throw b}}async _exchangeCodeForSession(t){const n=await $i(this.storage,`${this.storageKey}-code-verifier`),[s,a]=(n??"").split("/");try{const{data:i,error:o}=await ut(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:oa});if(await Oa(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new im}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(Xe(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:n,provider:s,token:a,access_token:i,nonce:o}=t,l=await ut(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:oa}),{data:c,error:d}=l;return d?{data:{user:null,session:null},error:d}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new im}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:d})}catch(n){if(Xe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,s,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await Ro(this.storage,this.storageKey));const{error:h}=await ut(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:h}}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await ut(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u}}throw new om("You must provide either an email or phone number.")}catch(l){if(Xe(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var n,s;try{let a,i;"options"in t&&(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:l}=await ut(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:oa});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(a){if(Xe(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(t){var n,s,a;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await Ro(this.storage,this.storageKey)),await ut(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=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&s!==void 0?s:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:L6})}catch(i){if(Xe(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)throw s;if(!n)throw new $a;const{error:a}=await ut(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:a}})}catch(t){if(Xe(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:s,type:a,options:i}=t,{error:o}=await ut(this.fetch,"POST",n,{headers:this.headers,body:{email:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:s,type:a,options:i}=t,{data:o,error:l}=await ut(this.fetch,"POST",n,{headers:this.headers,body:{phone:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new om("You must provide either an email or phone number and a type")}catch(n){if(Xe(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await s,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}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=n();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.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 n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await $i(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
499id"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<Bp:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const o=await $i(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=qp()}if(this.storage.isServer&&t.user){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,d,u)=>(!o&&d==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,d,u))})}return{data:{session:t},error:null}}const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await ut(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:qa}):await this._useSession(async n=>{var s,a,i;const{data:o,error:l}=n;if(l)throw l;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new $a}:await ut(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:qa})})}catch(n){if(Xe(n))return c6(n)&&(await this._removeSession(),await Oa(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async s=>{const{data:a,error:i}=s;if(i)throw i;if(!a.session)throw new $a;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Ro(this.storage,this.storageKey));const{data:d,error:u}=await ut(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:qa});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(Xe(s))return{data:{user:null},error:s};throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new $a;const n=Date.now()/1e3;let s=n,a=!0,i=null;const{payload:o}=Wp(t.access_token);if(o.exp&&(s=o.exp,a=s<=n),a){const{session:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:s-n,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(Xe(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var s;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new $a;const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(Xe(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!ls())throw new lm("No browser detected.");
499if(t.error||t.error_description||t.error_code)throw new lm(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new i0("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new lm("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new i0("No code detected.");const{data:g,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:g.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!i||!l||!o||!d)throw new lm("No session defined in URL");const u=Math.round(Date.now()/1e3),h=parseInt(l);let f=u+h;c&&(f=parseInt(c));const p=f-u;p*1e3<=zo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const w=f-h;u-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,f,u):u-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,f,u);const{data:v,error:b}=await this._getUser(i);if(b)throw b;const x={provider_token:s,provider_refresh_token:a,access_token:i,expires_in:h,expires_at:f,refresh_token:o,token_type:d,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:x,redirectType:t.type},error:null}}catch(s){if(Xe(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await $i(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var s;const{data:a,error:i}=n;if(i)return{error:i};const o=(s=a.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(l6(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await Oa(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=y6(),s={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async n=>{var s,a;try{const{data:{session:i},error:o}=n;if(o)throw o;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let s=null,a=null;this.flowType==="pkce"&&([s,a]=await Ro(this.storage,this.storageKey,!0));try{return await ut(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(Xe(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:n,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(Xe(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:s,error:a}=await this._useSession(async i=>{var o,l,c,d,u;const{data:h,error:f}=i;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await ut(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(a)throw a;return ls()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),{data:{provider:t.provider,url:s==null?void 0:s.url},error:null}}catch(s){if(Xe(s))return{data:{provider:t.provider,url:null},error:s};throw s}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var s,a;const{data:i,error:o}=n;
499if(o)throw o;return await ut(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(Xe(n))return{data:null,error:n};throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const s=Date.now();return await _6(async a=>(a>0&&await j6(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await ut(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:oa})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Hp(i)&&Date.now()+o-s<zo})}catch(s){if(this._debug(n,"error",s),Xe(s))return{data:{session:null,user:null},error:s};throw s}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",s),ls()&&!n.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,n;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const a=await $i(this.storage,this.storageKey);if(a&&this.userStorage){let o=await $i(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Uo(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:qp()}else if(a&&!a.user&&!a.user){const o=await $i(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await Oa(this.storage,this.storageKey+"-user"),await Uo(this.storage,this.storageKey,a)):a.user=qp()}if(this._debug(s,"session from storage",a),!this._isValidSession(a)){this._debug(s,"session is not valid"),a!==null&&await this._removeSession();return}const i=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Bp;if(this._debug(s,`session has${i?"":" not"} expired with margin of ${Bp}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),Hp(o)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(s,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(s,"error",a),console.error(a);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var n,s;if(!t)throw new $a;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new Rf;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new $a;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={session:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),Xe(i)){const o={session:null,error:i};return Hp(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,n,s=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",n,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const n=Object.assign({},t),s=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&n.user&&await Uo(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const i=u0(a);await Uo(this.storage,this.storageKey,i)}else{const a=u0(n);await Uo(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),await Oa(this.storage,this.storageKey),await Oa(this.storage,this.storageKey+"-code-verifier"),await Oa(this.storage,this.storageKey+"-user"),this.userStorage&&await Oa(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ls()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
499catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),zo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:s}}=n;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((s.expires_at*1e3-t)/zo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${zo}ms, refresh threshold is ${Xx} ticks`),a<=Xx&&await this._callRefreshToken(s.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof iC)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ls()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,s){const a=[`provider=${encodeURIComponent(n)}`];if(s!=null&&s.redirectTo&&a.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&a.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await Ro(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(s!=null&&s.queryParams){const i=new URLSearchParams(s.queryParams);a.push(i.toString())}return s!=null&&s.skipBrowserRedirect&&a.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;return i?{data:null,error:i}:await ut(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token})})}catch(n){if(Xe(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var s,a;const{data:i,error:o}=n;if(o)return{data:null,error:o};const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:c,error:d}=await ut(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return d?{data:null,error:d}:(t.factorType==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(n){if(Xe(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;if(i)return{data:null,error:i};const{data:o,error:l}=await ut(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:l})})}catch(n){if(Xe(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;return i?{data:null,error:i}:await ut(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token})})}catch(n){if(Xe(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:s}=await this._challenge({factorId:t.factorId});return s?{data:null,error:s}:await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const s=(t==null?void 0:t.factors)||[],a=s.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=s.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:s,totp:a,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,s;const{data:{session:a},error:i}=t;if(i)return{data:null,error:i};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Wp(a.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((s=(n=a.user.factors)===null||n===void 0?void 0:n.filter(h=>h.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(c="aal2");const u=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(t,n={keys:[]}){let s=n.keys.find(l=>l.kid===t);if(s)return s;const a=Date.now();if(s=this.jwks.keys.find(l=>l.kid===t),s&&this.jwks_cached_at+i6>a)return s;const{data:i,error:o}=await ut(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,s=i.keys.find(l=>l.kid===t),!s)?null:s}async getClaims(t,n={}){try{let s=t;if(!s){const{data:p,error:w}
499=await this.getSession();if(w||!p.session)return{data:null,error:w};s=p.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Wp(s);n!=null&&n.allowExpired||T6(i.exp);const d=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:p}=await this.getUser(s);if(p)throw p;return{data:{claims:i,header:a,signature:o},error:null}}const u=P6(a.alg),h=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,o,g6(`${l}.${c}`)))throw new ev("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(s){if(Xe(s))return{data:null,error:s};throw s}}}Pd.nextInstanceID=0;const Y6=Pd;class G6 extends Y6{constructor(t){super(t)}}var K6=function(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(h){o(h)}}function c(u){try{d(s.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})};class Z6{constructor(t,n,s){var a,i,o;if(this.supabaseUrl=t,this.supabaseKey=n,!t)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const l=e6(t),c=new URL(l);this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const d=`sb-${c.hostname.split(".")[0]}-auth-token`,u={db:V5,realtime:G5,auth:Object.assign(Object.assign({},Y5),{storageKey:d}),global:q5},h=t6(s??{},u);this.storageKey=(a=h.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=h.global.headers)!==null&&i!==void 0?i:{},h.accessToken?(this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=h.auth)!==null&&o!==void 0?o:{},this.headers,h.global.fetch),this.fetch=Q5(n,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.rest=new f5(new URL("rest/v1",c).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),this.storage=new B5(this.storageUrl.href,this.headers,this.fetch,s==null?void 0:s.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new W3(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},s={}){return this.rest.rpc(t,n,s)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,n;return K6(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(n=(t=s.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:s,storage:a,storageKey:i,flowType:o,lock:l,debug:c},d,u){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new G6({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),d),storageKey:i,autoRefreshToken:t,persistSession:n,detectSessionInUrl:s,storage:a,flowType:o,lock:l,debug:c,fetch:u,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new E5(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,s)=>{this._handleTokenChanged(n,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(t,n,s){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==s?this.changedAccessToken=s:t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const X6=(e,t,n)=>new Z6(e,t,n);function Q6(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;const e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}Q6()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
499ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function J6(){var b,x;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(g=>e===g||e.endsWith("."+g)),s="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=n?((b=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+s+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:b[1])??((x=e.match(new RegExp("^("+s+")(?=[.-])","i")))==null?void 0:x[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),d=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",h=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(g,y,j)=>new Promise(N=>{const k=f();let _=!1,P;const $=A=>{_||(_=!0,clearTimeout(P),window.removeEventListener("message",M),N(A))},M=A=>{if(d.indexOf(A.origin)<0)return;const U=A.data;U&&U.type===u&&U.requestId===k&&$(U)};window.addEventListener("message",M);const O={type:g,requestId:k,projectId:a,key:y};j!==void 0&&(O.value=j);for(const A of d)window.parent.postMessage(O,A);P=setTimeout(()=>$(null),h)});let w=!0;const v=250;return{getItem:async g=>{let y=await p("lovable-preview-auth:get",g);return!y&&w&&(await new Promise(j=>setTimeout(j,v)),y=await p("lovable-preview-auth:get",g)),w=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(g),null):y.value:localStorage.getItem(g)},setItem:(g,y)=>(localStorage.setItem(g,y),p("lovable-preview-auth:set",g,y).then(()=>{})),removeItem:g=>(localStorage.removeItem(g),p("lovable-preview-auth:remove",g).then(()=>{}))}}const eF="https://lfkuhrdqapvdytyqiwfw.supabase.co",tF="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imxma3VocmRxYXB2ZHl0eXFpd2Z3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTQ0MDY0ODYsImV4cCI6MjA2OTk4MjQ4Nn0.Gwy0iAZ-IQ3XLonJPKIgZN_npF-wmbKWi11XuI7GMxk",K=X6(eF,tF,{auth:{storage:J6(),persistSession:!0,autoRefreshToken:!0,flowType:"implicit"}}),oC=m.createContext(void 0);function nF({children:e}){const[t,n]=m.useState(null),[s,a]=m.useState(null),[i,o]=m.useState(!1),[l,c]=m.useState(!1),[d,u]=m.useState(!1),[h,f]=m.useState(!1),[p,w]=m.useState(!0),{toast:v}=Sn();m.useEffect(()=>{const{data:{subscription:j}}=K.auth.onAuthStateChange((N,k)=>{a(k),n((k==null?void 0:k.user)??null),k!=null&&k.user?setTimeout(()=>{b(k.user.id)},0):(o(!1),c(!1),u(!1),f(!1))});return K.auth.getSession().then(({data:{session:N}})=>{a(N),n((N==null?void 0:N.user)??null),N!=null&&N.user&&b(N.user.id),w(!1)}),()=>j.unsubscribe()},[]);const b=async j=>{const{data:N,error:k}=await K.from("user_roles").select("role").eq("user_id",j);if(k){console.error("Error fetching roles:",k);return}const _=(N==null?void 0:N.map(A=>A.role))||[],P=_.includes("admin"),$=_.includes("member"),M=_.includes("tutor"),O=$||M||P;if(!O&&_.includes("pending")){console.log("User not approved, signing out"),await K.auth.signOut(),n(null),a(null),o(!1),c(!1),u(!1),f(!0);return}o(P),u(M),c(O),f(_.includes("pending"))},x=async(j,N,k)=>{const{error:_}=await K.auth.signUp({email:j,password:N,options:{emailRedirectTo:"https://semsa.ch/auth",data:k}});return v(_?{title:"Sign up failed",description:_.message,variant:"destructive"}:{title:"Registration submitted",description:"Your account is pending admin approval. You'll be notified once approved."}),{error:_}},g=async(j,N)=>{var P;const{data:k,error:_}=await K.auth.signInWithPassword({email:j,password:N});if(_)return(P=_.message)!=null&&P.toLowerCase().includes("email not confirmed")||v({title:"Login failed",description:_.message,variant:"destructive"}),{error:_};if(k.user){const{data:$,error:M}=await K.from("user_roles").select("role").eq("user_id",k.user.id);if(M)return console.error("Error checking roles:",M),await K.auth.signOut(),{error:{message:"Error checking account status"}};const O=($==null?void 0:$.map(U=>U.role))||[];
499if(!(O.includes("member")||O.includes("tutor")||O.includes("admin")))return await K.auth.signOut(),{error:{message:"ACCOUNT_NOT_ACTIVE",isPendingApproval:!0}}}return{error:null}},y=async()=>{await K.auth.signOut(),n(null),a(null),o(!1),c(!1),u(!1),f(!1)};return r.jsx(oC.Provider,{value:{user:t,session:s,isAdmin:i,isMember:l,isTutor:d,isPending:h,loading:p,signUp:x,signIn:g,signOut:y},children:e})}const In=()=>{const e=m.useContext(oC);if(e===void 0)throw new Error("useAuth must be used within AuthProvider");return e},Rd=Pi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),G=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...a},i)=>{const o=s?jr:"button";return r.jsx(o,{className:le(Rd({variant:t,size:n,className:e})),ref:i,...a})});G.displayName="Button";const rF=()=>{const[e,t]=m.useState(!1),n=rs(),{user:s}=In(),a=[{path:"/about",label:"About Us"},{path:"/membership",label:"Become a Member"},{path:"/emergency-medicine",label:"Emergency Medicine"},{path:"/events",label:"Events"},{path:"/contact",label:"Contact"}],i=o=>n.pathname===o;return r.jsx("nav",{className:"bg-medical-white border-b border-muted",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs("div",{className:"flex justify-between items-center h-16",children:[r.jsx(be,{to:"/",className:"flex items-center space-x-3",children:r.jsx("img",{src:"/lovable-uploads/5ab1a91c-083f-4c5d-a198-45307276c210.png",alt:"SEMSA Logo",className:"h-32 w-auto p-[5%]"})}),r.jsxs("div",{className:"hidden md:flex items-center space-x-1",children:[a.map(o=>r.jsx(be,{to:o.path,children:r.jsx(G,{variant:i(o.path)?"default":"ghost",className:"text-sm font-medium",children:o.label})},o.path)),s?r.jsx(be,{to:"/member-dashboard",children:r.jsxs(G,{variant:"outline",size:"sm",className:"ml-4 gap-2",children:[r.jsx(ph,{className:"h-4 w-4"}),"Dashboard"]})}):r.jsx(be,{to:"/auth",children:r.jsxs(G,{variant:"outline",size:"sm",className:"ml-4 gap-2",children:[r.jsx(xh,{className:"h-4 w-4"}),"Member Login"]})})]}),r.jsx("div",{className:"md:hidden",children:r.jsx(G,{variant:"ghost",size:"sm",onClick:()=>t(!e),children:e?r.jsx(Nn,{className:"h-5 w-5"}):r.jsx(W4,{className:"h-5 w-5"})})})]}),e&&r.jsx("div",{className:"md:hidden pb-4",children:r.jsxs("div",{className:"flex flex-col space-y-2",children:[a.map(o=>r.jsx(be,{to:o.path,onClick:()=>t(!1),children:r.jsx(G,{variant:i(o.path)?"default":"ghost",className:"w-full justify-start text-sm font-medium",children:o.label})},o.path)),s?r.jsx(be,{to:"/member-dashboard",onClick:()=>t(!1),children:r.jsxs(G,{variant:"outline",className:"w-full justify-start gap-2",children:[r.jsx(ph,{className:"h-4 w-4"}),"Dashboard"]})}):r.jsx(be,{to:"/auth",onClick:()=>t(!1),children:r.jsxs(G,{variant:"outline",className:"w-full justify-start gap-2",children:[r.jsx(xh,{className:"h-4 w-4"}),"Member Login"]})})]})})]})})},sF=Pi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-lg font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5",{variants:{variant:{red:"bg-primary text-primary-foreground hover:bg-primary/90",black:"bg-foreground text-background hover:bg-foreground
499/90",white:"bg-background text-foreground border border-input"},size:{default:"px-8 py-3",lg:"px-12 py-6 text-xl",sm:"px-6 py-2 text-base"}},defaultVariants:{variant:"red",size:"default"}}),Ue=m.forwardRef(({className:e,variant:t,size:n,...s},a)=>r.jsx("button",{className:le(sF({variant:t,size:n,className:e})),ref:a,...s}));Ue.displayName="LinkButton";const B=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:le("rounded-lg border bg-card text-card-foreground shadow-elevation-low",e),...t}));B.displayName="Card";const ne=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",e),...t}));ne.displayName="CardHeader";const re=m.forwardRef(({className:e,...t},n)=>r.jsx("h3",{ref:n,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));re.displayName="CardTitle";const Pt=m.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Pt.displayName="CardDescription";const H=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:le("p-6 pt-0",e),...t}));H.displayName="CardContent";const lC=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",e),...t}));lC.displayName="CardFooter";const qe=()=>r.jsx("footer",{className:"bg-muted/30 py-8 mt-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-6",children:[r.jsxs("a",{href:"https://www.instagram.com/semsa_ch?igsh=OGloaGhnbzYxZ2xo&utm_source=qr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-2 text-muted-foreground hover:text-primary transition-colors",children:[r.jsx(Ty,{className:"h-5 w-5"}),r.jsx("span",{children:"Instagram"})]}),r.jsxs("a",{href:"https://www.linkedin.com/company/swiss-emergency-medicine-student-association-semsa/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-2 text-muted-foreground hover:text-primary transition-colors",children:[r.jsx(Py,{className:"h-5 w-5"}),r.jsx("span",{children:"LinkedIn"})]})]}),r.jsxs("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[r.jsx(be,{to:"/legal",className:"hover:text-primary transition-colors",children:"Imprint & Privacy Policy"}),r.jsx("span",{children:"|"}),r.jsx("span",{children:"© 2025 SEMSA - Swiss Emergency Medicine Student Association"})]})]})})}),aF="/assets/medi-know-logo-DtExOZ9h.avif",iF="/assets/emergsquad-logo-B0nY0gLj.svg",oF="/assets/procamed-logo-CoaXVY-0.jpg",lF=1,cF="e55236bb-e8e1-4204-8e04-29625ce056eb",dF="83570890-54b0-41ca-9de9-10d29c6666a6",uF="/__l5e/assets-v1/e55236bb-e8e1-4204-8e04-29625ce056eb/sgnor-logo.jpeg",mF="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/e55236bb-e8e1-4204-8e04-29625ce056eb/sgnor-logo.jpeg",hF="sgnor-logo.jpeg",fF=1038598,pF="image/jpeg",gF="2026-06-15T13:26:28Z",xF={version:lF,asset_id:cF,project_id:dF,url:uF,r2_key:mF,original_filename:hF,size:fF,content_type:pF,created_at:gF},vF=1,yF="424d4ad7-fcc0-4153-bbd4-dcc6c7d18858",wF="83570890-54b0-41ca-9de9-10d29c6666a6",bF="/__l5e/assets-v1/424d4ad7-fcc0-4153-bbd4-dcc6c7d18858/pincast-logo.jpg",jF="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/424d4ad7-fcc0-4153-bbd4-dcc6c7d18858/pincast-logo.jpg",_F="pincast-logo.jpg",NF=123374,SF="image/jpeg",kF="2026-06-29T09:32:55Z",cC={version:vF,asset_id:yF,project_id:wF,url:bF,r2_key:jF,original_filename:_F,size:NF,content_type:SF,created_at:kF},CF="/assets/lr-logo-DaFdqIWk.png",AF="/assets/ambu-logo-pJOvGhI6.png",EF="/assets/emerge-logo-BVC0x9-Z.png",TF="/assets/youngdgina-logo-BxRBobjv.svg",PF="/assets/die-kliniker-logo-DauA5FIS.png",RF="/assets/seespital-logo-DobXUBl8.jpg",MF="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABkCAMAAACYXt08AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAEt1klB5lVV9mFd+mWCFn2GGn2yOpm2Pp3SUqneXrXiXrXuar3+dsYGes4OgtIejto6ouo6pu5CqvJmxwZqxwp61xKS5yKW6ybDCz7LE0bvL1rzL1sbU3dLc5NXf5t3l6t7m6+ju8e/y9fP2+Pb4+fz9/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKs3JNsAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAHVUlEQVR4Xu1a7bajNgwMpYHWbLPLlhTSJJRS2vd/QzojyUC4kO32X2LPOQv+kqWxZNnh7mEMFpF6iIjUQ0SkHiIi9RARqYeISD1EROohIlIPEZF6iIjUQ0SkHiIi9RARqYeISD1EROoe/e1cFElSFOdbb01viyX14ZInC+SXwTreEzP1oUlJ+OjKui6dLELavDP5iXqbgau7TGHeSwhkr
499VXfEJ76mcRXPFuHxsYq7wej/hXRfdfiEnfsga9WfjsodTDPNzN6h6h/V+5CvQLznYQ2IOhrK78ZSP2+zxzc4ff3zHWgPqRJ+uQQ69Mk+69n3KV5oYsQqNdJggzXTlZ3TWeltrmDNILiMeSHW9NIzxqY6dkijn+07V9WBFrAj57LQ45822ept+H70bXtt4TvTXP550CnnyTRcQEAli5TiTvBPRJq0AykVl2Ah+GzzfFjkvxmRVjISVTRsoyFdlzDUmr/B7Ait+I2uIeTZDhQTTdeWXFsv7AktGAEUMElk4kEF0Rg9QVOaMWCt01ztZZHgPovVpRZJxuRZ31ooflEI6D3f4IOsOI2Smoj9QyUsZ8BUkcMEBzB650aly+WUSxOeNG1hgU6l3KNoFtW8QNA/Wcr+pXVXSZuMLKXqh+Hunq2cZ7jW9R7Kiurvw9/MtDxYw2gvYgBAiUJBC3CCVP6omfJb1gEwgpYvV3qP1nRa5LwEGN2ZL4f36LONWeEHX6H62mF2kun0+/ooSeOWoRpUwRj4qMVEQJMTv2lscSIBMOtDqHcp60BGeU+DtoB6nP4KHWkGdtknvqDhEwzLBXAB8iyUx6j8ukayvx7X1Dv5nTci2TXdkMryQyzH74kOf17hQCWgvbQEIzCs0SjGJTPWw9Nc9KjoGa9gm2mVBo04V1k/+Q65SN1hg9AOYl3y5sqUdAQ1PC88DadJGd2QkHZ6QBdWA3XTFfClHE2VjvtVEnM5zja6YYFxsMn8XIlSsTpJUdpLmAKEM5ujka25z6No6wZQTl9oK6eVaDjgTrXEM1wGeOdRbZKwjOgimfBLsCySG5V2qWpGpCjcCWqS0RQJyxJafqS+g98laK+FVN7uOM0Dmxlo2zpcqauotlNKlIua7EAA9fU5cw6VhX3zQfqWDMHVTjEEBNH2g1HyuyQELMxiK8k5bxJhqoUtMrRFKpbRgVm8aJeGX2S6ncHC2fCqOfOKXUTHDi85Py1LgITgjgYNb4EujH16ou3LDjbQGqmrivFZT5h3GA544E6R2GrIcxhXkV9UEUJnuheAk/We1ahiAowoXgb4QLOdD437AdR2k4baRp0CPXjhZcdUyXUme5kN3KOnuqujPyTDELfI/XxLusqJPBSkqpuTZ2+k6PBOtbUJazufHRmD56y+xdTSQqgf9HNVk6oSZruQr5qb9KKhyYhFeVKiNu4TJ1QsR8qC+qymzG3U6dL6Gs3JtFsXs8BTzAnStLHUzuYs4aFvdqKglK1jiV12l2LwxnvSkO2mYqupiJX6LNWE+bTo12L+qG2aiRkJ8FE/ZMKYORJnc4JB25EafSz6XsCgwRLhqd2cI17r863fiDykTrmyUC/XJB5kPB17fats/CEdi3qhxpTz3dqAPUvkj/o8FqcLhNyEbBGCGM1NdPQWAADoEifwIO6qRWFXa+rCoaYFJgRq32vb1KXJwKekJnWtkiAMyC3qfNKgzeqQIqNhJ5MnS7ivMtg2ulKc5bNO3tduNBwbA2zDFtcllMygOizjiV1M0DyBrczXlDJ7CCHtElo6w51sv3MqoCiC2Wcn0mMB7SluTV1XGRJC1XAJzyAnQzjJC+YKIQwgYZzI5cF3evJ57aXSwdWwizj6/OtqUQ+vQ293HrQsUGdO1ESM14gSYnsPvT8SkoJbd2hLutW3OHzM05WUzaYMomnpr3Bi5x/izrkC7xp/OxBIeKLxGSxrRHAJisSDBizjLEM+F9FBnQsqXMswk1UMP+ABpyzlsDzCXUmPwUqs7EAxsiiCpj4N6mjBKtlzSTUZH47B67ekvm3ijUkRw7G20aknMxbxjARm/UOimXHP7SvqfONEXJ8Wd00ys0LVTyfUJ/tW1ZMdOKe09JN6jjC6fbalUoXvxhdbcWxr0t3eviA1ZYk5vSPUizdYU9ayoaoHC5JRO3SXJp6XK7Ssuu14+Tcr9IPlDa2do52T7J9SYneJPDU+EMBG8wPsirto3Ytm6hXBlMrmHG6iqVXNKpnx7aua9o2faDaB+JXjNsAqVvx9aCfJZ99d0T3ca/71akzW9je3sDTj9EvT50Jgdt9C2S+F+7vQJ35ffsPT2TOU3cHSBiaYV4RSp3c5XhawX4KvyeMuhx2xYp8y0vbfrS/Ojz1sZVb4fxfC4Ybz+/jboZ7fUzUcZOR21BWfG2apuDVN0mnq807YqYO8qH+NyJBf8VdESeWq66bGf+dsKIeEiL1EBGph4hIPURE6iEiUg8RkXqIiNRDRKQeIiL1EBGph4hIPURE6iEiUg8RkXqICJb6OP4LXNZoyJiNQEAAAAAASUVORK5CYII=",DF="/assets/gzf-logo-B0oI5hUj.png",dC="/assets/medventura-logo-B0v9-0MW.png",OF="/assets/stewi-logo-CO9stt8n.jpeg",IF="/assets/rega-logo-BL8bcziK.png",LF="/assets/redog-logo-2s1Mqy7W.png",FF=1,$F="96cb21e4-fe0e-4326-b7c5-ab18a145d8a4",zF="83570890-54b0-41ca-9de9-10d29c6666a6",UF="/__l5e/assets-v1/96cb21e4-fe0e-4326-b7c5-ab18a145d8a4/sirmed-logo.jpeg",BF="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/96cb21e4-fe0e-4326-b7c5-ab18a145d8a4/sirmed-logo.jpeg",HF="sirmed-logo.jpeg",WF=15843,qF="image/jpeg",VF="2026-07-06T08:58:24Z",uC={version:FF,asset_id:$F,project_id:zF,url:UF,r2_key:BF,original_filename:HF,size:WF,content_type:qF,created_at:VF},YF=1,GF="994b5e50-f655-4285-801b-3384a49ce7ee",KF="83570890-54b0-41ca-9de9-10d29c6666a6",ZF="/__l5e/assets-v1/994b5e50-f655-4285-801b-3384a49ce7ee/eth-logo-pos.png",XF="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/994b5e50-f655-4285-801b-3384a49ce7ee/eth-logo-pos.png",QF="eth-logo-pos.png",JF=6433,e$="image/png",t$="2026-07-20T15:36:32Z",n$={version:YF,asset_id:GF,project_id:KF,url:ZF,r2_key:XF,original_filename:QF,size:JF,content_type:e$,created_at:t$},r$=()=>{const e=[{icon:Ht,title:"Network",description:"Connect with fellow students, residents, and emergency medicine professionals",link:"/about"},{icon:Kr,title:"Information Hub",description:"Access to information on learning opportunities during and after your education",link:"/emergency-medicine"},{icon:Tr,title:"Events",description:"Hands-on training sessions and networking opportunities",link:"/events"},{icon:hh,title:"Strengthen interdisciplinary collaboration",description:"Get to know all the specialities you work with in emergency medicine",link:"/emergency-medicine/career-paths"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("section",{className:"relative bg-white",style:{paddingBlock:"clamp(6rem, 12vw, 12rem)"},children:r.jsx("div",{className:"container mx-auto px-4 text-center",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsx("img",{src:"/lovable-uploads/5ab1a91c-083f-4c5d-a198-45307276c210.png",alt:"SEMSA Logo",className:"w-full max-w-md mx-auto",style:{imageRendering:"crisp-edges"}}),r.jsxs("h1",{className:"text-4xl lg:text-6xl font-bold text-foreground mb-6",children:["Swiss Emergency Medicine ",r.jsx("br",{}),"Student Association"]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center mt-4",children:[r.jsx(be,{to:"/membership",children:r.jsx(Ue,{size:"lg",children:"Become a Member"})}),r.jsx(be,{to:"/about",children:r.jsx(Ue,{size:"lg",children:"Learn More"})})]})]})})}),r.jsx("section",{className:"py-20 bg-background",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground mb-4",children:"Why Join SEMSA?"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"We provide a comprehensive information hub and networking platform for medical, nursing and paramedic students and residents passionate about emergency medicine"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:e.map((t,n)=>{const s=t.icon;return r.jsx(be,{to:t.link,children:r.jsx(B,{className:"text-center shadow-elevation-medium hover:shadow-elevation-high transition-shadow h-full cursor-pointer",children:r.jsxs(H,{
499className:"pt-8 pb-6",children:[r.jsx("div",{className:"mx-auto mb-4 w-16 h-16 bg-primary rounded-full flex items-center justify-center",children:r.jsx(s,{className:"w-8 h-8 text-primary-foreground"})}),r.jsx("h3",{className:"text-xl font-semibold mb-3 text-foreground",children:t.title}),r.jsx("p",{className:"text-muted-foreground",children:t.description})]})})},n)})})]})}),r.jsx("section",{className:"py-20 bg-muted/30",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground mb-6",children:"Our mission"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-6 leading-relaxed",children:"The Swiss Emergency Medicine Students Association (SEMSA) was founded in response to a growing interest among students in the dynamic and vital field of emergency medicine. Recognizing the lack of a dedicated platform for students passionate about this specialty, a group of motivated individuals came together in 2025 to establish SEMSA."}),r.jsx("p",{className:"text-lg text-muted-foreground mb-6 leading-relaxed",children:"Our motivation stems from a shared commitment to enhancing early exposure to emergency care and fostering collaboration. We aim to bridge the gap between students and professionals by organizing educational events, networking opportunities, and hands-on experiences."}),r.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"SEMSA's mission is to inspire, connect, empower future emergency medicine practitioners across Switzerland and create a strong interdisciplinary community."}),r.jsx(be,{to:"/about"})]})})}),r.jsx("section",{className:"py-16 bg-background",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground text-center mb-12",children:"Our Sponsors"}),r.jsxs("div",{className:"flex flex-col md:flex-row justify-center gap-6 mb-8",children:[r.jsx("a",{href:"https://sgnor.ch/de/",target:"_blank",rel:"noopener noreferrer",className:"block w-full max-w-md",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer border-2 border-primary/20",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-10 h-48",children:r.jsx("img",{src:xF.url,alt:"SGNOR",className:"h-28 w-auto object-contain"})})})}),r.jsx("a",{href:"https://www.emergencysquad.ch",target:"_blank",rel:"noopener noreferrer",className:"block w-full max-w-md",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer border-2 border-primary/20",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-10 h-48",children:r.jsx("img",{src:iF,alt:"EmergSquad",className:"h-28 w-auto object-contain"})})})}),r.jsx("a",{href:"https://procamed.ch",target:"_blank",rel:"noopener noreferrer",className:"block w-full max-w-md",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer border-2 border-primary/20",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-10 h-48",children:r.jsx("img",{src:oF,alt:"Procamed",className:"h-28 w-auto object-contain"})})})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 max-w-4xl mx-auto",children:[r.jsx("a",{href:"https://medi-know.org/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-6 h-32",children:r.jsx("img",{src:aF,alt:"Medi Know",className:"h-16 w-auto object-contain"})})})}),r.jsx("a",{href:"https://www.lohmann-rauscher.com",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-6 h-32",children:r.jsx("img",{src:CF,alt:"L&R - People.Health.Care.",className:"h-24 w-auto object-contain"})})})}),r.jsx("a",{href:"https://www.ambu.com",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow cursor-pointer",children:r.jsx(H,{className:"flex flex-col items-center justify-center p-6 h-32",children:r.jsx("img",{src:AF,alt:"Ambu",className:"h-24 w-auto object-contain"})})})})]})]})}),r.jsx("section",{className:"py-16 bg-muted/30",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground text-center mb-12",children:"Partner & Supporters"}),r.jsxs("div",{className:"flex flex-wrap justify-center gap-6 max-w-5xl mx-auto",children:[r.jsx("a",{href:"https://www.rega.ch",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{
499className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:IF,alt:"Rega",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Rega"})]})})}),r.jsx("a",{href:"https://www.emerge-edu.com/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:EF,alt:"EMERGE Notfallmedizin",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"EMERGE"})]})})}),r.jsx("a",{href:"https://www.dgina.de/young",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:TF,alt:"YoungDGINA",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"YoungDGINA"})]})})}),r.jsx("a",{href:"https://www.pincast.net/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:cC.url,alt:"PINCAST",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"PINCAST"})]})})}),r.jsx("a",{href:"https://www.kliniker.ch/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:PF,alt:"Die Kliniker",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Die Kliniker"})]})})}),r.jsx("a",{href:"https://thestewi.ch/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:OF,alt:"STEW! - Student Trauma & Emergency Weekend",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"STEW!"})]})})}),r.jsx("a",{href:"https://see-spital.ch/fachgebiete/anaesthesiologie-intensivmedizin-rettungsmedizin/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:RF,alt:"Rettungsdienst Seespital",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Rettungsdienst Seespital"})]})})}),r.jsx("a",{href:"https://www.spitalmaennedorf.ch/en/departments/rescue-service/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:MF,alt:"Rettungsdienst Spital Männedorf",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Rettungsdienst Spital Männedorf"})]})})}),r.jsx("a",{href:"https://www.gzf.ch/medizinisches-angebot/rettungsdienst.html",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{
vendor: 4,959 bytes, line 499
499className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:DF,alt:"Rettungsdienst GZF",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Rettungsdienst GZF"})]})})}),r.jsx("a",{href:"https://www.medventura.ch",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:dC,alt:"Medventura",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"Medventura"})]})})}),r.jsx("a",{href:"https://www.redog.ch/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:LF,alt:"Logo REDOG",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"REDOG"})]})})}),r.jsx("a",{href:"https://www.paraplegie.ch/sirmed/en/",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:uC.url,alt:"SIRMED - Schweizer Institut für Rettungsmedizin",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"SIRMED"})]})})}),r.jsx("a",{href:"https://hest.ethz.ch/studium/medizin.html",target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsx(B,{className:"shadow-elevation-medium hover:shadow-elevation-high w-[200px] min-h-[180px] flex flex-col transition-shadow",children:r.jsxs(H,{className:"flex flex-col items-center justify-center p-6 flex-1",children:[r.jsx("img",{src:n$.url,alt:"ETH Zürich",className:"h-16 w-auto object-contain mb-4"}),r.jsx("h3",{className:"font-semibold text-center text-sm",children:"ETH Zürich"})]})})})]})]})}),r.jsx("section",{className:"py-20 bg-background",children:r.jsx("div",{className:"container mx-auto px-4 text-center",children:r.jsxs("div",{className:"max-w-3xl mx-auto",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground mb-6",children:"Follow us on Social Media"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"Stay connected with SEMSA and join our growing community of emergency medicine enthusiasts across Switzerland."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 justify-center items-center",children:[r.jsx("a",{href:"https://www.instagram.com/semsa_ch?igsh=OGloaGhnbzYxZ2xo&utm_source=qr",target:"_blank",rel:"noopener noreferrer",className:"group",children:r.jsxs(Ue,{className:"flex items-center gap-3",children:[r.jsx(Ty,{className:"h-5 w-5"}),"Follow on Instagram"]})}),r.jsx("a",{href:"https://www.linkedin.com/company/swiss-emergency-medicine-student-association-semsa/",target:"_blank",rel:"noopener noreferrer",className:"group",children:r.jsxs(Ue,{className:"flex items-center gap-3",children:[r.jsx(Py,{className:"h-5 w-5"}),"Connect on LinkedIn"]})})]})]})})}),r.jsx("section",{className:"py-20 bg-primary text-primary-foreground",children:r.jsx("div",{className:"container mx-auto px-4 text-center",children:r.jsxs("div",{className:"max-w-3xl mx-auto",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold mb-6",children:"Ready to be a part of our community? We would love to get to know you!"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsx(be,{to:"/membership",children:r.jsx(Ue,{size:"lg",className:"bg-white text-black hover:bg-white",children:"Join SEMSA Today"})}),r.jsx(be,{to:"/events",children:r.jsx(Ue,{size:"lg",className:"bg-white text-black hover:bg-white",children:"See upcoming events"})})]})]})})}),r.jsx(qe,{})]})},s$=Pi("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Me({className:e,variant:t,...n}){return r.jsx("div",{className:le(s$({variant:t}),e),...n})}var sw="Avatar",[a$,dK]=zr(sw),[i$,mC]=a$(sw),hC=m.forwardRef((e,t)=>
499{const{__scopeAvatar:n,...s}=e,[a,i]=m.useState("idle");return r.jsx(i$,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:r.jsx(Le.span,{...s,ref:t})})});hC.displayName=sw;var fC="AvatarImage",pC=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:a=()=>{},...i}=e,o=mC(fC,n),l=o$(s,i.referrerPolicy),c=Dn(d=>{a(d),o.onImageLoadingStatusChange(d)});return On(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?r.jsx(Le.img,{...i,ref:t,src:s}):null});pC.displayName=fC;var gC="AvatarFallback",xC=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:s,...a}=e,i=mC(gC,n),[o,l]=m.useState(s===void 0);return m.useEffect(()=>{if(s!==void 0){const c=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(c)}},[s]),o&&i.imageLoadingStatus!=="loaded"?r.jsx(Le.span,{...a,ref:t}):null});xC.displayName=gC;function o$(e,t){const[n,s]=m.useState("idle");return On(()=>{if(!e){s("error");return}let a=!0;const i=new window.Image,o=l=>()=>{a&&s(l)};return s("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{a=!1}},[e,t]),n}var vC=hC,yC=pC,wC=xC;const Mf=m.forwardRef(({className:e,...t},n)=>r.jsx(vC,{ref:n,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Mf.displayName=vC.displayName;const Df=m.forwardRef(({className:e,...t},n)=>r.jsx(yC,{ref:n,className:le("aspect-square h-full w-full object-cover object-center",e),...t}));Df.displayName=yC.displayName;const Of=m.forwardRef(({className:e,...t},n)=>r.jsx(wC,{ref:n,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Of.displayName=wC.displayName;const l$="/assets/megan-burns-Dh-KkbGN.jpg",c$="/assets/danai-bucher-Bqm1s7mL.jpg",d$="/assets/olivia-seyffer-BNr1yOqR.jpg",u$="/assets/chiara-stupan-Dsp7josF.jpg",m$="/assets/mathilda-osterwalder-BISzjC6L.jpg",h$="/assets/amaliya-kataya-DCuVTl3w.jpg",f$="/assets/marie-bobrovska-BAEPBDCo.jpg",p$="/assets/patrick-kuster-YrtyD9vN.jpg",g$="/assets/isabelle-schellenberg-D5YkhycT.jpg",x$="/assets/melina-ilar-QH6ZcImi.jpg",v$="/assets/jd-jaeger-CxgR-QJg.jpg",y$=1,w$="bbeb4f70-3aaa-40cd-9506-315f5e50ff82",b$="83570890-54b0-41ca-9de9-10d29c6666a6",j$="/__l5e/assets-v1/bbeb4f70-3aaa-40cd-9506-315f5e50ff82/laura-pestrin.jpeg",_$="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/bbeb4f70-3aaa-40cd-9506-315f5e50ff82/laura-pestrin.jpeg",N$="laura-pestrin.jpeg",S$=431574,k$="image/jpeg",C$="2026-09-11T15:30:54Z",A$={version:y$,asset_id:w$,project_id:b$,url:j$,r2_key:_$,original_filename:N$,size:S$,content_type:k$,created_at:C$},E$=1,T$="f6be7ef5-db50-4bd5-b45f-e4009b2364e9",P$="83570890-54b0-41ca-9de9-10d29c6666a6",R$="/__l5e/assets-v1/f6be7ef5-db50-4bd5-b45f-e4009b2364e9/dominique-ressnig.jpg",M$="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/f6be7ef5-db50-4bd5-b45f-e4009b2364e9/dominique-ressnig.jpg",D$="dominique-ressnig.jpg",O$=137905,I$="image/jpeg",L$="2026-09-12T18:21:11Z",F$={version:E$,asset_id:T$,project_id:P$,url:R$,r2_key:M$,original_filename:D$,size:O$,content_type:I$,created_at:L$},$$=1,z$="4cea00d0-23b5-468b-a8ba-de2ff15a14da",U$="83570890-54b0-41ca-9de9-10d29c6666a6",B$="/__l5e/assets-v1/4cea00d0-23b5-468b-a8ba-de2ff15a14da/lisa-kammacher.jpeg",H$="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/4cea00d0-23b5-468b-a8ba-de2ff15a14da/lisa-kammacher.jpeg",W$="lisa-kammacher.jpeg",q$=94031,V$="image/jpeg",Y$="2026-09-14T05:49:49Z",G$={version:$$,asset_id:z$,project_id:U$,url:B$,r2_key:H$,original_filename:W$,size:q$,content_type:V$,created_at:Y$},K$=()=>{const e=[{position:"President ad interim",members:[{name:"Megan Burns",image:l$}]},{position:"Outgoing Co-Presidency (handover in progress)",members:[{name:"Olivia Kotoun",image:"/lovable-uploads/376cfb5e-c463-4268-9f18-5e08a9afce27.png"},{name:"Tim Steck",image:"/lovable-uploads/d0c61e19-8046-42ce-b437-06e261b8b2f7.png"}]}],t=[{position:"Board Member",members:[{name:"Danai Bucher",image:c$}]},{position:"Nursing Department Rep.",members:[{name:"Chiara Stupan",image:u$}]},{position:"Sponsoring and Finances",members:[{name:"Lisa Kammacher",image:G$.url},{name:"Sebastian Eichenberger",image:"/lovable-uploads/0cda3bd8-7ab7-4fb0-abee-b8326594d014.png"}]},{position:"Administration",members:[{name:"Isabelle Schellenberg",image:g$}]},{position:"Social Media",members:[{name:"Olivia Seyffer",image:d$},{name:"Lynn Benz",image:"/lovable-uploads/bd419abe-9b99-4f1b-9dff-a0976cc18a19.png"}]},{position:"Website",members:[{name:"JD Jäger",image:v$}]}],n=[{position:"Course Management Lead",members:[{name:"Sophie Schreiber"}
499,{name:"Sam Dietrich",image:"/lovable-uploads/1de4f701-45ec-406b-8f03-ec0642a93e88.png"}]},{position:"Course Management, Zurich",members:[{name:"Patrick Kuster",image:p$},{name:"Mathilda Osterwalder",image:m$}]},{position:"Course Management, Lucerne",members:[{name:"Melina Ilar",image:x$}]},{position:"Course Management, Bern",members:[{name:"Dominique Ressnig",image:F$.url},{name:"Laura Pestrin",image:A$.url},{name:"Marie Bobrovska",image:f$}]},{position:"Course Management, Basel",members:[{name:"Amaliya Kataya",image:h$}]}],s=c=>c.split(" ").map(d=>d[0]).join(""),a=(c,d)=>{const u=c.members.length,h=u>1,f=u>=3?"w-16 h-20":"w-20 h-28",p=u>=3?"gap-2":"gap-3",w=u>=3?"w-[260px]":"w-[200px]";return r.jsxs(B,{className:`text-center shadow-elevation-low ${w} min-h-[280px] flex flex-col overflow-hidden`,children:[r.jsxs(ne,{className:"pb-4 flex flex-col items-center flex-1",children:[r.jsx("div",{className:`flex justify-center mb-4 ${h?`flex-row ${p}`:"flex-col"}`,children:c.members.map(v=>r.jsxs(Mf,{className:f,children:[r.jsx(Df,{src:v.image,alt:v.name,className:"object-cover object-top"}),r.jsx(Of,{children:s(v.name)})]},v.name))}),r.jsx("div",{className:"flex flex-col gap-1",children:c.members.map(v=>r.jsx(re,{className:"text-base leading-tight",children:v.name},v.name))})]}),r.jsx(H,{className:"pt-0",children:r.jsx(Me,{variant:"secondary",className:"text-xs",children:c.position})})]},d)},i=[{name:"Navid Azad",affiliation:"YoungDGINA"},{name:"PD Dr. med. Christoph Globas",affiliation:"Stroke Center University Hospital Zurich"},{name:"Dr. med. Gregory Mansella",affiliation:"Universitätsspital Basel"},{name:"Prof. Dr. med. Dagmar Keller Lang",affiliation:"Chefärztin Medizin, Leiterin Notfallstation, Spital Oberengadin AG"},{name:"Dr. med. Stefan Matthias Müller",affiliation:"Schutz & Rettung Zürich"},{name:"Prof. Dr. med. Valentin Neuhaus",affiliation:"Universitätsspital Zürich"},{name:"Dr. med. Michel Ramser",affiliation:"Universitäts-Kinderspital beider Basel"},{name:"Prof. Dr. med. Christian Nickel",affiliation:"Universitätsspital Basel"},{name:"Prof. Dr. med. Thomas Sauter, MME",affiliation:"Universitätsspital Bern"},{name:"Ph.D. PD Dr. med. Ksenija Slankamenac",affiliation:"Universitätsspital Zürich"},{name:"Dr. med. Senad Tabakovic",affiliation:"Stadtspital Triemli"},{name:"Prof. Dr. Roland Bingisser",affiliation:"Universitätsspital Basel"},{name:"Dirk Becker",affiliation:"Co-Präsident Notfallpflege Schweiz und Berufsbildner Stadtspital Zürich Triemli"},{name:"Dr. med. Sonja Guglielmetti",affiliation:"Kantonsspital Aarau"},{name:"Dr. med. Andrea Kyburz",affiliation:"Rega"},{name:"Angelo Urso",affiliation:"Schutz & Rettung Zürich"}],l=[{name:"PD Dr. med. Tanja Birrenbach, MME",affiliation:"Universitätsspital Bern"},{name:"Dr. med. Fiorangelo De Iseo",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Nicolas Frei",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Johanna Frey Renggli",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Anne Kaiser",affiliation:"Universitätsspital Zürich"},{name:"Dr. med. Astrid Lieflaender",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Bruno Minotti",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Jonas Roelli",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Luca Schuler",affiliation:"Kantonsspital Luzern"},{name:"Dr. med. Stefanie Vauk (Karriereberatung Notfallmedizin, Coaching)",affiliation:"HOCH Health Ostschweiz, Spital Wil"},{name:"Dr. med. Raphael Zeller",affiliation:"HOCH Health Ostschweiz, Spital Wil"},{name:"Dr. med. Sanila John (Coaching speziell Frauenförderung)",affiliation:"HOCH Health Ostschweiz, Spital Wil"},{name:"Dr. med. Mark Becker",affiliation:"HOCH Health Ostschweiz, Spital Wil"},{name:"Dr. med. Victor Speidel (Coaching)",affiliation:"Spital Langenthal"},{name:"Dr. med. Tanja Hänni",affiliation:"Spital Langenthal"},{name:"Dr. med. Emanuel Plüss",affiliation:"Bürgerspital Solothurn"},{name:"Dr. med. Linda Morgenstern",affiliation:"Spitalzentrum Biel"},{name:"Dr. med. Maria de Montmollin",affiliation:"Spitalzentrum Biel"},{name:"Dr. med. Michael Frei",affiliation:"Spital Visp"},{name:"Dr. med. Benedick Satari",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Adriana Sirova",affiliation:"Klinik St.Anna, Luzern"},{name:"Dr. med. Michael Künzli",affiliation:"Kantonsspital Frauenfeld"},{name:"Dr. med. Agostino Di Criscio",affiliation:"Kantonsspital Frauenfeld"},{name:"Patrick Wiech",affiliation:"Kantonsspital Winterthur"},{name:"Matthias Schwager",affiliation:"Kantonsspital Winterthur"},{name:"Dr. med. Shwaki Bhamad",affiliation:"Kantonsspital Aarau"},{name:"Dipl. med. Sylvia Bormann",affiliation:"Rega"},{name:"Dr. med. Ann-Katrin Unglert",affiliation:"Rega"},{name:"Dr. med. Mirko Minder",affiliation:"Rega"},{name:"Dr. med. Martina Fischer",affiliation:"Luzerner Kantonsspital"},{name:"Yorick Jaisli",affiliation:"Schutz und Rettung Zürich"},{name:"Angelo Urso",affiliation:"Schutz & Rettung Zürich"},{name:"Dr. med. Meret Balderi",affiliation:"University of Fribourg / University of Berne"},{name:"Dr. med. Marco Becker",affiliation:"Universitätsspital Zürich"},{name:"Felix Brinkmann",affiliation:"Rettungsdienst Kanton Zug"},{name:"Dr. med. Felix Gruner",affiliation:"Universitätsspital Basel"},{name:"Dr. med. Florian Marti",affiliation:"Bürgerspital Solothurn"},{name:"Peter Ott Meroni",affiliation:"See-Spital"},{name:"Dr. med. Isabella Stephan",affiliation:"Universität Heidelberg"},{name:"Dr. med. Anja Tobler",affiliation:"Universitätsspital Zürich"},{name:"Dr. med. Valeria Widmer",affiliation:"Universität Basel"}].sort((c,d)=>{const u=p=>{const v=p.replace(/^(PD\s+)?Dr\.\s+med\.\s+/i,"").replace(/,\s*(MME|PhD).*$/i,"").replace(/\s*\([^)]*\).*$/,"").trim().split(/\s+/);return v[v.length-1].toLowerCase()},h=u(c.name),f=u(d.name);return h.localeCompare(f)});return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs("div",{className:"max-w-4xl mx-auto text-center mb-16",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-8",children:"About SEMSA"}),r.jsxs("div",{className:"prose prose-lg mx-auto text-muted-foreground leading-relaxed",children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground mb-4",children:"Hi and welcome to SEMSA!"}),r.jsx("p",{className:"mb-6",children:"We are the Swiss Emergency Medicine Student Association — a young, dynamic and motivated nationwide community of medical, paramedic, and nursing students, as well as young professionals at the beginning of their careers in emergency medicine, from across Switzerland."}),r.jsx("p",{className:"mb-6",children:"United by a shared passion for emergency medicine, both in and out of hospital, we thrive in environments that demand rapid decision-making, clear communication, and strong teamwork."}),r.jsx("h3",{className:"text-xl font-bold text-foreground mb-4",children:"Our goal?"}),r.jsx("p",{className:"mb-6",children:"We want to create a platform where interested individuals from all levels of training can network, educate themselves and exchange ideas. Here you will find everything you need to know about emergency medicine."}),r.jsx("p",{className:"mb-6",children:"SEMSA thrives on commitment, openness and the joy of emergency medicine."}),r.jsx("p",{children:"If you would like to get involved or just want to have a look - get in touch, join in, come along. 🚑💬"}),r.jsx("div",{className:"mt-8",children:r.jsxs("a",{href:"/documents/Statutes_SEMSA_2025_en.pdf",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-primary hover:text-primary/80 transition-colors font-medium",children:[r.jsx(fh,{className:"h-5 w-5"}),"Association Statutes (PDF)"]})})]})]}),r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Our Board"}),r.jsx("h3",{className:"text-xl font-semibold text-center mb-6",children:"Presidency"}),r.jsx("div",{className:"flex flex-wrap justify-center gap-6 max-w-5xl mx-auto mb-10",children:e.map(c=>a(c,`pres-${c.position}`))}),r.jsx("h3",{className:"text-xl font-semibold text-center mb-6",children:"Board Members"}),r.jsx("div",{className:"flex flex-wrap justify-center gap-6 max-w-5xl mx-auto mb-10",children:t.map(c=>a(c,`bm-${c.position}`))}),r.jsx("h3",{className:"text-xl font-semibold text-center mb-6",children:"Course Management"}),r.jsx("div",{className:"flex flex-wrap justify-center gap-6 max-w-5xl mx-auto",children:n.map(c=>a(c,`cm-${c.position}`))})]}),r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Adv
499isory Board"}),r.jsx(B,{className:"max-w-4xl mx-auto",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.map(c=>r.jsxs("div",{className:"flex flex-col space-y-2 p-4 rounded-lg border bg-muted/50",children:[r.jsx("div",{className:"font-semibold text-foreground",children:c.name}),r.jsx("div",{className:"text-sm text-muted-foreground",children:c.affiliation})]},c.name)),r.jsx("div",{className:"flex flex-col space-y-2 p-4 rounded-lg border bg-muted/20",children:r.jsx("div",{className:"text-sm text-muted-foreground italic",children:"more to come"})})]})})})]}),r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Our Tutors"}),r.jsx(B,{className:"max-w-4xl mx-auto",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.map(c=>r.jsxs("div",{className:"flex flex-col space-y-2 p-4 rounded-lg border bg-muted/50",children:[r.jsx("div",{className:"font-semibold text-foreground",children:c.name}),c.affiliation&&r.jsx("div",{className:"text-sm text-muted-foreground",children:c.affiliation})]},c.name)),r.jsx("div",{className:"flex flex-col space-y-2 p-4 rounded-lg border bg-muted/20",children:r.jsx("div",{className:"text-sm text-muted-foreground italic",children:"more to come"})})]})})})]})]}),r.jsx(qe,{})]})},xe=m.forwardRef(({className:e,type:t,...n},s)=>r.jsx("input",{type:t,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...n}));xe.displayName="Input";var Z$="Label",bC=m.forwardRef((e,t)=>r.jsx(Le.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bC.displayName=Z$;var jC=bC;const X$=Pi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=m.forwardRef(({className:e,...t},n)=>r.jsx(jC,{ref:n,className:le(X$(),e),...t}));Q.displayName=jC.displayName;function Q$(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];function d(h){const{scope:f,children:p,...w}=h,v=(f==null?void 0:f[e][c])||l,b=m.useMemo(()=>w,Object.values(w));return r.jsx(v.Provider,{value:b,children:p})}function u(h,f){const p=(f==null?void 0:f[e][c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[s,J$(a,...t)]}function J$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var e8=m.createContext(void 0);function hu(e){const t=m.useContext(e8);return e||t||"ltr"}var Yp="rovingFocusGroup.onEntryFocus",t8={bubbles:!1,cancelable:!0},If="RovingFocusGroup",[tv,_C,n8]=of(If),[r8,sc]=Q$(If,[n8]),[s8,a8]=r8(If),NC=m.forwardRef((e,t)=>r.jsx(tv.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(tv.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(i8,{...e,ref:t})})}));NC.displayName=If;var i8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,f=m.useRef(null),p=ct(t,f),w=hu(i),[v=null,b]=es({prop:o,defaultProp:l,onChange:c}),[x,g]=m.useState(!1),y=Dn(d),j=_C(n),N=m.useRef(!1),[k,_]=m.useState(0);return m.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Yp,y),()=>P.removeEventListener(Yp,y)},[y]),r.jsx(s8,{scope:n,orientation:s,dir:w,loop:a,currentTabStopId:v,onItemFocus:m.useCallback(P=>b(P),[b]),onItemShiftTab:m.useCallback(()=>g(!0),[]),onFocusableItemAdd:m.useCallback(()=>_(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>_(P=>P-1),[]),children:r.jsx(Le.div,{tabIndex:x||k===0?-1:0,"data-orientation":s,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{N.current=!0}),onFocus:we(e.onFocus,P=>{const $=!N.current;if(P.target===P.currentTarget&&$&&!x){const M=new CustomEvent(Yp,t8);if(P.currentTarget.dispatchEvent(M),!M.defaultPrevented){const O=j().filter(S=>S.focusable),A=O.find(S=>S.active),U=O.find(S=>
vendor: 10,005 bytes, line 499
499S.id===v),E=[A,U,...O].filter(Boolean).map(S=>S.ref.current);CC(E,u)}}N.current=!1}),onBlur:we(e.onBlur,()=>g(!1))})})}),SC="RovingFocusGroupItem",kC=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:i,...o}=e,l=wr(),c=i||l,d=a8(SC,n),u=d.currentTabStopId===c,h=_C(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=d;return m.useEffect(()=>{if(s)return f(),()=>p()},[s,f,p]),r.jsx(tv.ItemSlot,{scope:n,id:c,focusable:s,active:a,children:r.jsx(Le.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:we(e.onMouseDown,w=>{s?d.onItemFocus(c):w.preventDefault()}),onFocus:we(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:we(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const v=c8(w,d.orientation,d.dir);if(v!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let x=h().filter(g=>g.focusable).map(g=>g.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const g=x.indexOf(w.currentTarget);x=d.loop?d8(x,g+1):x.slice(g+1)}setTimeout(()=>CC(x))}})})})});kC.displayName=SC;var o8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c8(e,t,n){const s=l8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return o8[s]}function CC(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function d8(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var aw=NC,iw=kC;function ow(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lw="Radio",[u8,AC]=zr(lw),[m8,h8]=u8(lw),EC=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:s,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:d,...u}=e,[h,f]=m.useState(null),p=ct(t,b=>f(b)),w=m.useRef(!1),v=h?d||!!h.closest("form"):!0;return r.jsxs(m8,{scope:n,checked:a,disabled:o,children:[r.jsx(Le.button,{type:"button",role:"radio","aria-checked":a,"data-state":RC(a),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:p,onClick:we(e.onClick,b=>{a||c==null||c(),v&&(w.current=b.isPropagationStopped(),w.current||b.stopPropagation())})}),v&&r.jsx(f8,{control:h,bubbles:!w.current,name:s,value:l,checked:a,required:i,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});EC.displayName=lw;var TC="RadioIndicator",PC=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:s,...a}=e,i=h8(TC,n);return r.jsx(Nr,{present:s||i.checked,children:r.jsx(Le.span,{"data-state":RC(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});PC.displayName=TC;var f8=e=>{const{control:t,checked:n,bubbles:s=!0,...a}=e,i=m.useRef(null),o=ow(n),l=Uy(t);return m.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&h){const f=new Event("click",{bubbles:s});h.call(c,n),c.dispatchEvent(f)}},[o,n,s]),r.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function RC(e){return e?"checked":"unchecked"}var p8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cw="RadioGroup",[g8,uK]=zr(cw,[sc,AC]),MC=sc(),DC=AC(),[x8,v8]=g8(cw),OC=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:s,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:h,...f}=e,p=MC(n),w=hu(d),[v,b]=es({prop:i,defaultProp:a,onChange:h});return r.jsx(x8,{scope:n,name:s,required:o,disabled:l,value:v,onValueChange:b,children:r.jsx(aw,{asChild:!0,...p,orientation:c,dir:w,loop:u,children:r.jsx(Le.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:w,...f,ref:t})})})});OC.displayName=cw;var IC="RadioGroupItem",LC=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:s,...a}=e,i=v8(IC,n),o=i.disabled||s,l=MC(n),c=DC(n),d=m.useRef(null),u=ct(t,d),h=i.value===a.value,f=m.useRef(!1);return m.useEffect(()=>{const p=v=>{p8.includes(v.key)&&(f.current=!0)},w=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",w)}},[]),r.jsx(iw,{asChild:!0,...l,focusable:!o,active:h,children:r.jsx(EC,{disabled:o,required:i.required,checked:h,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:we(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:we(a.onFocus,()=>{var p;f.current&&((p=d.current)==null||p.click())})})})});LC.displayName=IC;var y8="RadioGroupIndicator",FC=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...s}=e,a=DC(n);return r.jsx(PC,{...a,...s,ref:t})});FC.displayName=y8;var $C=OC,zC=LC,w8=FC;const rl=m.forwardRef(({className:e,...t},n)=>r.jsx($C,{className:le("grid gap-2",e),...t,ref:n}));rl.displayName=$C.displayName;const Is=m.forwardRef(({className:e,...t},n)=>r.jsx(zC,{ref:n,className:le("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:r.jsx(w8,{className:"flex items-center justify-center",children:r.jsx(yS,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Is.displayName=zC.displayName;function g0(e,[t,n]){return Math.min(n,Math.max(t,e))}var Gp=0;function Lf(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??x0()),document.body.insertAdjacentElement("beforeend",e[1]??x0()),Gp++,()=>{Gp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gp--}},[])}function x0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Kp="focusScope.autoFocusOnMount",Zp="focusScope.autoFocusOnUnmount",v0={bubbles:!1,cancelable:!0},b8="FocusScope",fu=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),d=Dn(a),u=Dn(i),h=m.useRef(null),f=ct(t,v=>c(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let v=function(y){if(p.paused||!l)return;const j=y.target;l.contains(j)?h.current=j:za(h.current,{select:!0})},b=function(y){if(p.paused||!l)return;const j=y.relatedTarget;j!==null&&(l.contains(j)||za(h.current,{select:!0}))},x=function(y){if(document.activeElement===document.body)for(const N of y)N.removedNodes.length>0&&za(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const g=new MutationObserver(x);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),g.disconnect()}}},[s,l,p.paused]),m.useEffect(()=>{if(l){w0.add(p);const v=document.activeElement;if(!l.contains(v)){const x=new CustomEvent(Kp,v0);l.addEventListener(Kp,d),l.dispatchEvent(x),x.defaultPrevented||(j8(C8(UC(l)),{select:!0}),document.activeElement===v&&za(l))}return()=>{l.removeEventListener(Kp,d),setTimeout(()=>{const x=new CustomEvent(Zp,v0);l.addEventListener(Zp,u),l.dispatchEvent(x),x.defaultPrevented||za(v??document.body,{select:!0}),l.removeEventListener(Zp,u),w0.remove(p)},0)}}},[l,d,u,p]);const w=m.useCallback(v=>{if(!n&&!s||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(b&&x){const g=v.currentTarget,[y,j]=_8(g);y&&j?!v.shiftKey&&x===j?(v.preventDefault(),n&&za(y,{select:!0})):v.shiftKey&&x===y&&(v.preventDefault(),n&&za(j,{select:!0})):x===g&&v.preventDefault()}},[n,s,p.paused]);return r.jsx(Le.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});fu.displayName=b8;function j8(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(za(s,{select:t}),document.activeElement!==n)return}function _8(e){const t=UC(e),n=y0(t,e),s=y0(t.reverse(),e);return[n,s]}function UC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function y0(e,t){for(const n of e)if(!N8(n,{upTo:t}))return n}function N8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function S8(e){return e instanceof HTMLInputElement&&"select"in e}function za(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&S8(e)&&t&&e.select()}}var w0=k8();function k8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=b0(e,t),e.unshift(t)},remove(t){var n;e=b0(e,t),(n=e[0])==null||n.resume()}}}function b0(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function C8(e){return e.filter(t=>t.tagName!=="A")}var A8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Io=new WeakMap,cm=new WeakMap,dm={},Xp=0,BC=function(e){return e&&(e.host||BC(e.parentNode))},E8=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=BC(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},T8=function(e,t,n,s){var a=E8(t,Array.isArray(e)?e:[e]);dm[n]||(dm[n]=new WeakMap);
vendor: 6,517 bytes, lines 499-514
499var i=dm[n],o=[],l=new Set,c=new Set(a),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};a.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))u(f);else try{var p=f.getAttribute(s),w=p!==null&&p!=="false",v=(Io.get(f)||0)+1,b=(i.get(f)||0)+1;Io.set(f,v),i.set(f,b),o.push(f),v===1&&w&&cm.set(f,!0),b===1&&f.setAttribute(n,"true"),w||f.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return u(t),l.clear(),Xp++,function(){o.forEach(function(h){var f=Io.get(h)-1,p=i.get(h)-1;Io.set(h,f),i.set(h,p),f||(cm.has(h)||h.removeAttribute(s),cm.delete(h)),p||h.removeAttribute(n)}),Xp--,Xp||(Io=new WeakMap,Io=new WeakMap,cm=new WeakMap,dm={})}},Ff=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=A8(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live]"))),T8(s,a,n,"aria-hidden")):function(){return null}},Us=function(){return Us=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Us.apply(this,arguments)};function HC(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function P8(e,t,n){if(n||arguments.length===2)for(var s=0,a=t.length,i;s<a;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var Fm="right-scroll-bar-position",$m="width-before-scroll-bar",R8="with-scroll-bars-hidden",M8="--removed-body-scroll-bar-size";function Qp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function D8(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var a=n.value;a!==s&&(n.value=s,n.callback(s,a))}}}})[0];return n.callback=t,n.facade}var O8=typeof window<"u"?m.useLayoutEffect:m.useEffect,j0=new WeakMap;function I8(e,t){var n=D8(null,function(s){return e.forEach(function(a){return Qp(a,s)})});return O8(function(){var s=j0.get(n);if(s){var a=new Set(s),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||Qp(l,null)}),i.forEach(function(l){a.has(l)||Qp(l,o)})}j0.set(n,e)},[e]),n}function L8(e){return e}function F8(e,t){t===void 0&&(t=L8);var n=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),n}}}};return a}function $8(e){e===void 0&&(e={});var t=F8(null);return t.options=Us({async:!0,ssr:!1},e),t}var WC=function(e){var t=e.sideCar,n=HC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,Us({},n))};WC.isSideCarExport=!0;function z8(e,t){return e.useMedium(t),WC}var qC=$8(),Jp=function(){},$f=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Jp,onWheelCapture:Jp,onTouchMoveCapture:Jp}),a=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,w=e.inert,v=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,g=e.gapMode,y=HC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,N=I8([n,t]),k=Us(Us({},y),a);return m.createElement(m.Fragment,null,u&&m.createElement(j,{sideCar:qC,removeScrollBar:d,shards:h,noIsolation:p,inert:w,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:g}),o?m.cloneElement(m.Children.only(l),Us(Us({},k),{ref:N})):m.createElement(x,Us({},k,{className:c,ref:N}),l))});$f.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$f.classNames={fullWidth:$m,zeroRight:Fm};var U8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=U8();return t&&e.setAttribute("nonce",t),e}function H8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function W8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var q8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B8())&&(H8(t,n),W8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},V8=function(){var e=q8();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VC=function(){var e=V8(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},Y8={left:0,top:0,right:0,gap:0},eg=function(e){return parseInt(e||"",10)||0},G8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[eg(n),eg(s),eg(a)]},K8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Y8;var t=G8(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},Z8=VC(),fl="data-scroll-locked",X8=function(e,t,n,s){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
500  .`.concat(R8,` {
501   overflow: hidden `).concat(s,`;
502   padding-right: `).concat(l,"px ").concat(s,`;
503  }
504  body[`).concat(fl,`] {
505    overflow: hidden `).concat(s,`;
506    overscroll-behavior: contain;
507    `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
508    padding-left: `.concat(a,`px;
509    padding-top: `).concat(i,`px;
510    padding-right: `).concat(o,`px;
511    margin-left:0;
512    margin-top:0;
513    margin-right: `).concat(l,"px ").concat(s,`;
514    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";
514")].filter(Boolean).join(""),`
515  }
516  
517  .`).concat(Fm,` {
518    right: `).concat(l,"px ").concat(s,`;
519  }
520  
521  .`).concat($m,` {
522    margin-right: `).concat(l,"px ").concat(s,`;
523  }
524  
525  .`).concat(Fm," .").concat(Fm,` {
526    right: 0 `).concat(s,`;
527  }
528  
529  .`).concat($m," .").concat($m,` {
530    margin-right: 0 `).concat(s,`;
531  }
532  
533  body[`).concat(fl,`] {
534    `).concat(M8,": ").concat(l,`px;
535  }
536`)},_0=function(){var e=parseInt(document.body.getAttribute(fl)||"0",10);return isFinite(e)?e:0},Q8=function(){m.useEffect(function(){return document.body.setAttribute(fl,(_0()+1).toString()),function(){var e=_0()-1;e<=0?document.body.removeAttribute(fl):document.body.setAttribute(fl,e.toString())}},[])},J8=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;Q8();var i=m.useMemo(function(){return K8(a)},[a]);return m.createElement(Z8,{styles:X8(i,!t,a,n?"":"!important")})},nv=!1;if(typeof window<"u")try{var um=Object.defineProperty({},"passive",{get:function(){return nv=!0,!0}});window.addEventListener("test",um,um),window.removeEventListener("test",um,um)}catch{nv=!1}var Lo=nv?{passive:!1}:!1,ez=function(e){return e.tagName==="TEXTAREA"},YC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ez(e)&&n[t]==="visible")},tz=function(e){return YC(e,"overflowY")},nz=function(e){return YC(e,"overflowX")},N0=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=GC(e,s);if(a){var i=KC(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},rz=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},sz=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},GC=function(e,t){return e==="v"?tz(t):nz(t)},KC=function(e,t){return e==="v"?rz(t):sz(t)},az=function(e,t){return e==="h"&&t==="rtl"?-1:1},iz=function(e,t,n,s,a){var i=az(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),d=!1,u=o>0,h=0,f=0;do{var p=KC(e,l),w=p[0],v=p[1],b=p[2],x=v-b-i*w;(w||x)&&GC(e,l)&&(h+=x,f+=w),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(h)<1||!a)||!u&&(Math.abs(f)<1||!a))&&(d=!0),d},mm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S0=function(e){return[e.deltaX,e.deltaY]},k0=function(e){return e&&"current"in e?e.current:e},oz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lz=function(e){return`
537  .block-interactivity-`.concat(e,` {pointer-events: none;}
538  .allow-interactivity-`).concat(e,` {pointer-events: all;}
539`)},cz=0,Fo=[];function dz(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),a=m.useState(cz++)[0],i=m.useState(VC)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=P8([e.lockRef.current],(e.shards||[]).map(k0),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var x=mm(v),g=n.current,y="deltaX"in v?v.deltaX:g[0]-x[0],j="deltaY"in v?v.deltaY:g[1]-x[1],N,k=v.target,_=Math.abs(y)>Math.abs(j)?"h":"v";if("touches"in v&&_==="h"&&k.type==="range")return!1;var P=N0(_,k);if(!P)return!0;if(P?N=_:(N=_==="v"?"h":"v",P=N0(_,k)),!P)return!1;if(!s.current&&"changedTouches"in v&&(y||j)&&(s.current=N),!N)return!0;var $=s.current||N;return iz($,b,v,$==="h"?y:j,!0)},[]),c=m.useCallback(function(v){var b=v;if(!(!Fo.length||Fo[Fo.length-1]!==i)){var x="deltaY"in b?S0(b):mm(b),g=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&oz(N.delta,x)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}
vendor: 1,167 bytes, line 539
539if(!g){var y=(o.current.shards||[]).map(k0).filter(Boolean).filter(function(N){return N.contains(b.target)}),j=y.length>0?l(b,y[0]):!o.current.noIsolation;j&&b.cancelable&&b.preventDefault()}}},[]),d=m.useCallback(function(v,b,x,g){var y={name:v,delta:b,target:x,should:g,shadowParent:uz(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(j){return j!==y})},1)},[]),u=m.useCallback(function(v){n.current=mm(v),s.current=void 0},[]),h=m.useCallback(function(v){d(v.type,S0(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){d(v.type,mm(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Fo.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Lo),document.addEventListener("touchmove",c,Lo),document.addEventListener("touchstart",u,Lo),function(){Fo=Fo.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Lo),document.removeEventListener("touchmove",c,Lo),document.removeEventListener("touchstart",u,Lo)}},[]);var p=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:lz(a
vendor: 18,502 bytes, line 539
539)}):null,p?m.createElement(J8,{gapMode:e.gapMode}):null)}function uz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mz=z8(qC,dz);var pu=m.forwardRef(function(e,t){return m.createElement($f,Us({},e,{ref:t,sideCar:mz}))});pu.classNames=$f.classNames;var hz=[" ","Enter","ArrowUp","ArrowDown"],fz=[" ","Enter"],gu="Select",[zf,Uf,pz]=of(gu),[ac,mK]=zr(gu,[pz,Ri]),Bf=Ri(),[gz,Di]=ac(gu),[xz,vz]=ac(gu),ZC=e=>{const{__scopeSelect:t,children:n,open:s,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:f,required:p,form:w}=e,v=Bf(t),[b,x]=m.useState(null),[g,y]=m.useState(null),[j,N]=m.useState(!1),k=hu(d),[_=!1,P]=es({prop:s,defaultProp:a,onChange:i}),[$,M]=es({prop:o,defaultProp:l,onChange:c}),O=m.useRef(null),A=b?w||!!b.closest("form"):!0,[U,W]=m.useState(new Set),E=Array.from(U).map(S=>S.props.value).join(";");return r.jsx(iu,{...v,children:r.jsxs(gz,{required:p,scope:t,trigger:b,onTriggerChange:x,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:wr(),value:$,onValueChange:M,open:_,onOpenChange:P,dir:k,triggerPointerDownPosRef:O,disabled:f,children:[r.jsx(zf.Provider,{scope:t,children:r.jsx(xz,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(S=>{W(L=>new Set(L).add(S))},[]),onNativeOptionRemove:m.useCallback(S=>{W(L=>{const C=new Set(L);return C.delete(S),C})},[]),children:n})}),A?r.jsxs(bA,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:h,value:$,onChange:S=>M(S.target.value),disabled:f,form:w,children:[$===void 0?r.jsx("option",{value:""}):null,Array.from(U)]},E):null]})})};ZC.displayName=gu;var XC="SelectTrigger",QC=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:s=!1,...a}=e,i=Bf(n),o=Di(XC,n),l=o.disabled||s,c=ct(t,o.onTriggerChange),d=Uf(n),u=m.useRef("touch"),[h,f,p]=jA(v=>{const b=d().filter(y=>!y.disabled),x=b.find(y=>y.value===o.value),g=_A(b,v,x);g!==void 0&&o.onValueChange(g.value)}),w=v=>{l||(o.onOpenChange(!0),p()),v&&(o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return r.jsx(ou,{asChild:!0,...i,children:r.jsx(Le.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":wA(o.value)?"":void 0,...a,ref:c,onClick:we(a.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&w(v)}),onPointerDown:we(a.onPointerDown,v=>{u.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:we(a.onKeyDown,v=>{const b=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&hz.includes(v.key)&&(w(),v.preventDefault())})})})});QC.displayName=XC;var JC="SelectValue",eA=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:a,children:i,placeholder:o="",...l}=e,c=Di(JC,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,h=ct(t,c.onValueNodeChange);return On(()=>{d(u)},[d,u]),r.jsx(Le.span,{...l,ref:h,style:{pointerEvents:"none"},children:wA(c.value)?r.jsx(r.Fragment,{children:o}):i})});eA.displayName=JC;var yz="SelectIcon",tA=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:s,...a}=e;return r.jsx(Le.span,{"aria-hidden":!0,...a,ref:t,children:s||"▼"})});tA.displayName=yz;var wz="SelectPortal",nA=e=>r.jsx(Gl,{asChild:!0,...e});nA.displayName=wz;var uo="SelectContent",rA=m.forwardRef((e,t)=>{const n=Di(uo,e.__scopeSelect),[s,a]=m.useState();if(On(()=>{a(new DocumentFragment)},[]),!n.open){const i=s;return i?yo.createPortal(r.jsx(sA,{scope:e.__scopeSelect,children:r.jsx(zf.Slot,{scope:e.__scopeSelect,children:r.jsx("div",{children:e.children})})}),i):null}return r.jsx(aA,{...e,ref:t})});rA.displayName=uo;var cs=10,[sA,Oi]=ac(uo),bz="SelectContentImpl",aA=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:w,hideWhenDetached:v,avoidCollisions:b,...x}=e,g=Di(uo,n),[y,j]=m.useState(null),[N,k]=m.useState(null),_=ct(t,pe=>j(pe)),[P,$]=m.useState(null),[M,O]=m.useState(null),A=Uf(n),[U,W]=m.useState(!1),E=m.useRef(!1);m.useEffect(()=>{if(y)return Ff(y)},[y]),Lf();const S=m.useCallback(pe=>{const[_e,...Pe]=A().map(De=>De.ref.current),[ke]=Pe.slice(-1),Re=document.activeElement;for(const De of pe)if(De===Re||(De==null||De.scrollIntoView({block:"nearest"}),De===_e&&N&&(N.scrollTop=0),De===ke&&N&&(N.scrollTop=N.scrollHeight),De==null||De.focus(),document.activeElement!==Re))return},[A,N]),L=m.useCallback(()=>S([P,y]),[S,P,y]);m.useEffect(()=>{U&&L()},[U,L]);const{onOpenChange:C,triggerPointerDownPosRef:D}=g;m.useEffect(()=>{if(y){let pe={x:0,y:0};const _e=ke=>{var Re,De;pe={x:Math.abs(Math.round(ke.pageX)-(((Re=D.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(ke.pageY)-(((De=D.current)==null?void 0:De.y)??0))}},Pe=ke=>{pe.x<=10&&pe.y<=10?ke.preventDefault():y.contains(ke.target)||C(!1),document.removeEventListener("pointermove",_e),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[y,C,D]),m.useEffect(()=>{const pe=()=>C(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[C]);const[F,T]=jA(pe=>{const _e=A().filter(Re=>!Re.disabled),Pe=_e.find(Re=>Re.ref.current===document.activeElement),ke=_A(_e,pe,Pe);ke&&setTimeout(()=>ke.ref.current.focus())}),q=m.useCallback((pe,_e,Pe)=>{const ke=!E.current&&!Pe;(g.value!==void 0&&g.value===_e||ke)&&($(pe),ke&&(E.current=!0))},[g.value]),I=m.useCallback(()=>y==null?void 0:y.focus(),[y]),Y=m.useCallback((pe,_e,Pe)=>{const ke=!E.current&&!Pe;(g.value!==void 0&&g.value===_e||ke)&&O(pe)},[g.value]),ie=s==="popper"?rv:iA,se=ie===rv?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:w,hideWhenDetached:v,avoidCollisions:b}:{};return r.jsx(sA,{scope:n,content:y,viewport:N,onViewportChange:k,itemRefCallback:q,selectedItem:P,onItemLeave:I,itemTextRefCallback:Y,focusSelectedItem:L,selectedItemText:M,position:s,isPositioned:U,searchRef:F,children:r.jsx(pu,{as:jr,allowPinchZoom:!0,children:r.jsx(fu,{asChild:!0,trapped:g.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:we(a,pe=>{var _e;(_e=g.trigger)==null||_e.focus({preventScroll:!0}),pe.preventDefault()}),children:r.jsx(wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:r.jsx(ie,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:pe=>pe.preventDefault(),...x,...se,onPlaced:()=>W(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:we(x.onKeyDown,pe=>{const _e=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!_e&&pe.key.length===1&&T(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ke=A().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Re=pe.target,De=ke.indexOf(Re);ke=ke.slice(De+1)}setTimeout(()=>S(ke)),pe.preventDefault()}})})})})})})});aA.displayName=bz;var jz="SelectItemAlignedPosition",iA=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:s,...a}=e,i=Di(uo,n),o=Oi(uo,n),[l,c]=m.useState(null),[d,u]=m.useState(null),h=ct(t,_=>u(_)),f=Uf(n),p=m.useRef(!1),w=m.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:x,focusSelectedItem:g}=o,y=m.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&v&&b&&x){const _=i.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(i.dir!=="rtl"){const Re=M.left-P.left,De=$.left-Re,de=_.left-De,R=_.width+de,X=Math.max(R,P.width),ue=window.innerWidth-cs,te=g0(De,[cs,Math.max(cs,ue-X)]);l.style.minWidth=R+"px",l.style.left=te+"px"}else{const Re=P.right-M.right,De=window.innerWidth-$.right-Re,de=window.innerWidth-_.right-De,R=_.width+de,X=Math.max(R,P.width),ue=window.innerWidth-cs,te=g0(De,[cs,Math.max(cs,ue-X)]);l.style.minWidth=R+"px",l.style.right=te+"px"}const O=f(),A=window.innerHeight-cs*2,U=v.scrollHeight,W=window.getComputedStyle(d),E=parseInt(W.borderTopWidth,10),S=parseInt(W.paddingTop,10),L=parseInt(W.borderBottomWidth,10),C=parseInt(W.paddingBottom,10),D=E+S+U+C+L,F=Math.min(b.offsetHeight*5,D),T=window.getComputedStyle(v),q=parseInt(T.paddingTop,10),I=parseInt(T.paddingBottom,10),Y=_.top+_.height/2-cs,ie=A-Y,se=b.offsetHeight/2,pe=b.offsetTop+se,_e=E+S+pe,Pe=D-_e;if(_e<=Y){const Re=O.length>0&&b===O[O.length-1].ref.current;l.style.bottom="0px";const De=d.clientHeight-v.offsetTop-v.offsetHeight,de=Math.max(ie,se+(Re?I:0)+De+L),R=_e+de;l.style.height=R+"px"}else{const Re=O.length>0&&b===O[0].ref.current;l.style.top="0px";const de=Math.max(Y,E+v.offsetTop+(Re?q:0)+se)+Pe;l.style.height=de+"px",v.scrollTop=_e-Y+v.offsetTop}l.style.margin=`${cs}px 0`,l.style.minHeight=F+"px",l.style.maxHeight=A+"px",s==null||s(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,l,d,v,b,x,i.dir,s]);On(()=>y(),[y]);const[j,N]=m.useState();On(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const k=m.useCallback(_=>{_&&w.current===!0&&(y(),g==null||g(),w.current=!1)},[y,g]);return r.jsx(Nz,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:r.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:r.jsx(Le.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});iA.displayName=jz;var _z="SelectPopperPosition",rv=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:s="start",collisionPadding:a=cs,...i}=e,o=Bf(n);return r.jsx(gf,{...o,...i,ref:t,align:s,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});rv.displayName=_z;var[Nz,dw]=ac(uo,{}),sv="SelectViewport",oA=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:s,...a}=e,i=Oi(sv,n),o=dw(sv,n),l=ct(t,i.onViewportChange),c=m.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),r.jsx(zf.Slot,{scope:n,children:r.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:we(a.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const p=Math.abs(c.current-u.scrollTop);if(p>0){const w=window.innerHeight-cs*2,v=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),x=Math.max(v,b);if(x<w){const g=x+p,y=Math.min(w,g),j=g-y;h.style.height=y+"px",h.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});oA.displayName=sv;var lA="SelectGroup",[Sz,kz]=ac(lA),Cz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=wr();return r.jsx(Sz,{scope:n,id:a,children:r.jsx(Le.div,{role:"group","aria-labelledby":a,...s,ref:t})})});Cz.displayName=lA;var cA="SelectLabel",dA=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=kz(cA,n);return r.jsx(Le.div,{id:a.id,...s,ref:t})});dA.displayName=cA;var Ah="SelectItem",[Az,uA]=ac(Ah),mA=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:s,disabled:a=!1,textValue:i,...o}=e,l=Di(Ah,n),c=Oi(Ah,n),d=l.value===s,[u,h]=m.useState(i??""),[f,p]=m.useState(!1),w=ct(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,s,a)}),v=wr(),b=m.useRef("touch"),x=()=>{a||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(Az,{scope:n,value:s,disabled:a,textId:v,isSelected:d,onItemTextChange:m.useCallback(g=>{h(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:r.jsx(zf.ItemSlot,{scope:n,value:s,disabled:a,textValue:u,children:r.jsx(Le.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:w,onFocus:we(o.onFocus,()=>p(!0)),onBlur:we(o.onBlur,()=>p(!1)),onClick:we(o.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:we(o.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:we(o.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:we(o.onPointerMove,g=>{var y;b.current=g.pointerType,a?(y=c.onItemLeave)==null||y.call(c):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(o.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:we(o.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(fz.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});mA.displayName=Ah;var Hc="SelectItemText",hA=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:a,...i}=e,o=Di(Hc,n),l=Oi(Hc,n),c=uA(Hc,n),d=vz(Hc,n),[u,h]=m.useState(null),f=ct(t,x=>h(x),c.onItemTextChange,x=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,x,c.value,c.disabled)}),p=u==null?void 0:u.textContent,w=m.useMemo(()=>r.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=d;return On(()=>(v(w),()=>b(w)),[v,b,w]),r.jsxs(r.Fragment,{children:[r.jsx(Le.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?yo.createPortal(i.children,o.valueNode):null]})});hA.displayName=Hc;var fA="SelectItemIndicator",pA=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return uA(fA,n).isSelected?r.jsx(Le.span,{"aria-hidden":!0,...s,ref:t}):null});pA.displayName=fA;var av="SelectScrollUpButton",gA=m.forwardRef((e,t)=>{const n=Oi(av,e.__scopeSelect),s=dw(av,e.__scopeSelect),[a,i]=m.useState(!1),o=ct(t,s.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?r.jsx(vA,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});gA.displayName=av;var iv="SelectScrollDownButton",xA=m.forwardRef((e,t)=>{const n=Oi(iv,e.__scopeSelect),s=dw(iv,e.__scopeSelect),[a,i]=m.useState(!1),o=ct(t,s.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?r.jsx(vA,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});xA.displayName=iv;var vA=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:s,...a}=e,i=Oi("SelectScrollButton",n),o=m.useRef(null),l=Uf(n),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),On(()=>{var u;const d=l().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),r.jsx(Le.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:we(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:we(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:we(a.onPointerLeave,()=>{c()})})}),Ez="SelectSeparator",yA=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return r.jsx(Le.div,{"aria-hidden":!0,...s,ref:t})});yA.displayName=Ez;var ov="SelectArrow",Tz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=Bf(n),i=Di(ov,n),o=Oi(ov,n);return i.open&&o.position==="popper"?r.jsx(xf,{...a,...s,ref:t}):null});Tz.displayName=ov;function wA(e){return e===""||e===void 0}var bA=m.forwardRef((e,t)=>{const{value:n,...s}=e,a=m.useRef(null),i=ct(t,a),o=ow(n);return m.useEffect(()=>{const l=a.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&u){const h=new Event("change",{bubbles:!0});u.call(l,n),l.dispatchEvent(h)}},[o,n]),r.jsx(ru,{asChild:!0,children:r.jsx("select",{...s,ref:i,defaultValue:n})})});bA.displayName="BubbleSelect";function jA(e){const t=Dn(e),n=m.useRef(""),s=m.useRef(0),a=m.useCallback(o=>{const l=n.current+o;t(l),function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,a,i]}function _A(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Pz(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function Pz(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var Rz=ZC,NA=QC,Mz=eA,Dz=tA,Oz=nA,SA=rA,Iz=oA,kA=dA,CA=mA,Lz=hA,Fz=pA,AA=gA,EA=xA,TA=yA;const mt=Rz,ht=Mz,ot=m.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(NA,{ref:s,className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
539ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,r.jsx(Dz,{asChild:!0,children:r.jsx(ky,{className:"h-4 w-4 opacity-50"})})]}));ot.displayName=NA.displayName;const PA=m.forwardRef(({className:e,...t},n)=>r.jsx(AA,{ref:n,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(vS,{className:"h-4 w-4"})}));PA.displayName=AA.displayName;const RA=m.forwardRef(({className:e,...t},n)=>r.jsx(EA,{ref:n,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(ky,{className:"h-4 w-4"})}));RA.displayName=EA.displayName;const lt=m.forwardRef(({className:e,children:t,position:n="popper",...s},a)=>r.jsx(Oz,{children:r.jsxs(SA,{ref:a,className:le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx(PA,{}),r.jsx(Iz,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(RA,{})]})}));lt.displayName=SA.displayName;const $z=m.forwardRef(({className:e,...t},n)=>r.jsx(kA,{ref:n,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$z.displayName=kA.displayName;const fe=m.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(CA,{ref:s,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Fz,{children:r.jsx(Ys,{className:"h-4 w-4"})})}),r.jsx(Lz,{children:t})]}));fe.displayName=CA.displayName;const zz=m.forwardRef(({className:e,...t},n)=>r.jsx(TA,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));zz.displayName=TA.displayName;const Uz=Pi("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Bs=m.forwardRef(({className:e,variant:t,...n},s)=>r.jsx("div",{ref:s,role:"alert",className:le(Uz({variant:t}),e),...n}));Bs.displayName="Alert";const sl=m.forwardRef(({className:e,...t},n)=>r.jsx("h5",{ref:n,className:le("mb-1 font-medium leading-none tracking-tight",e),...t}));sl.displayName="AlertTitle";const Hs=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:le("text-sm [&_p]:leading-relaxed",e),...t}));Hs.displayName="AlertDescription";const Bz={medicine:[{value:"student",label:"Student",isStudent:!0},{value:"resident",label:"Resident",isStudent:!1},{value:"specialist",label:"Specialist",isStudent:!1}],nursing:[{value:"student",label:"Student",isStudent:!0},{value:"registered_nurse",label:"Registered Nurse",isStudent:!1},{value:"apn",label:"Advanced Practice Nurse",isStudent:!1}],paramedic:[{value:"student",label:"Student",isStudent:!0},{value:"certified_paramedic",label:"Certified Paramedic",isStudent:!1},{value:"team_leader",label:"Team Leader",isStudent:!1}]},Hz=["Bachelor Year 1","Bachelor Year 2","Bachelor Year 3","Master Year 1","Master Year 2","Master Year 3"],Wz=["Year 1","Year 2","Year 3"],tg=["German","French","Italian","English"],qz={medicine_student:"University",medicine_pro:"Institution",nursing_student:"School",nursing_pro:"Workplace",paramedic_student:"School",paramedic_pro:"Employer"},Vz=()=>{const{toast:e}=Sn(),{isAdmin:t}=In(),[n,s]=m.useState(!1),[a,i]=m.useState({invitedTutor:"",firstName:"",lastName:"",profession:"",careerStage:"",institution:"",trainingYear:"",graduationYear:"",languages:[],customLanguage:"",tutorInterest:"",email:"",ph
539one:"",password:"",confirmPassword:""}),o=a.profession?Bz[a.profession]:[],l=o.find(j=>j.value===a.careerStage),c=(l==null?void 0:l.isStudent)===!0,d=a.profession==="medicine"?Hz:Wz,u=a.profession&&l?`${a.profession}_${c?"student":"pro"}`:"",h=qz[u]||"Institution",f=(j,N)=>{i(k=>{const _={...k,[j]:N};return j==="profession"&&(_.careerStage="",_.trainingYear="",_.graduationYear=""),j==="careerStage"&&(_.trainingYear="",_.graduationYear=""),_})},p=j=>{i(N=>({...N,languages:N.languages.includes(j)?N.languages.filter(k=>k!==j):[...N.languages,j]}))},w=()=>{const j=a.customLanguage.trim();j&&(a.languages.includes(j)?i(N=>({...N,customLanguage:""})):i(N=>({...N,languages:[...N.languages,j],customLanguage:""})))},v=()=>l?c?"10 CHF":"20 CHF":"Select your career stage above",b=async j=>{if(j.preventDefault(),n)return;if(a.password!==a.confirmPassword){e({title:"Passwords don't match",description:"Please make sure both passwords are identical",variant:"destructive"});return}if(a.password.length<6){e({title:"Password too short",description:"Password must be at least 6 characters",variant:"destructive"});return}if(!/^[0-9+()\-.\s]{6,20}$/.test(a.phone.trim())){e({title:"Invalid phone number",description:"Phone number must be 6-20 characters and contain only digits, +, (), -, . and spaces",variant:"destructive"});return}if(!a.profession||!a.careerStage){e({title:"Missing information",description:"Please select your profession and career stage",variant:"destructive"});return}if(c&&!a.trainingYear){e({title:"Missing training year",description:"Please select your current training year",variant:"destructive"});return}if(!c&&!/^\d{4}$/.test(a.graduationYear.trim())){e({title:"Invalid graduation year",description:"Please enter a 4-digit graduation year",variant:"destructive"});return}if(!a.institution.trim()){e({title:`Missing ${h.toLowerCase()}`,description:`Please enter your ${h.toLowerCase()}`,variant:"destructive"});return}if(!c&&!a.invitedTutor){e({title:"Please answer the tutor invitation question",description:"Let us know if you've been invited to register as a SEMSA Tutor",variant:"destructive"});return}const k=!c&&a.invitedTutor==="no";if(k&&a.tutorInterest===""){e({title:"Please answer the tutoring question",description:"Let us know if you'd be interested in future tutoring opportunities",variant:"destructive"});return}const _=!c&&/^\d{4}$/.test(a.graduationYear.trim())?parseInt(a.graduationYear.trim(),10):null,$=!c&&a.invitedTutor==="yes"?{firstName:a.firstName.trim(),lastName:a.lastName.trim(),email:a.email.trim(),phone:a.phone.trim(),password:a.password,field:a.profession,studentType:c?"student":a.profession==="medicine"&&a.careerStage==="resident"?"resident":"graduate",yearOfCompletion:String(c?new Date().getFullYear():_??""),placeOfStudy:a.institution.trim(),message:"Application as tutor"}:{firstName:a.firstName.trim(),lastName:a.lastName.trim(),email:a.email.trim(),phone:a.phone.trim(),password:a.password,profession:a.profession,career_stage:a.careerStage,training_year:c?a.trainingYear:"",graduation_year:_,institution_text:a.institution.trim(),languages:a.languages,tutor_interest:k?a.tutorInterest==="yes":null,message:""};s(!0);try{const{data:M,error:O}=await K.functions.invoke("save-membership",{body:$});if(O)throw new Error((O==null?void 0:O.message)||(typeof M=="string"?M:JSON.stringify(M))||"Edge Function returned non-2xx");e({title:"Welcome to SEMSA!",description:"We are more than happy to have you as part of the team! You will get the Invoice for the annual fee in the next 7 days per Email. You will only become a member once we have received your membership fee. See you soon!",duration:8e3,className:"text-lg"}),i({invitedTutor:"",firstName:"",lastName:"",profession:"",careerStage:"",institution:"",trainingYear:"",graduationYear:"",languages:[],customLanguage:"",tutorInterest:"",email:"",phone:"",password:"",confirmPassword:""})}catch(M){console.error("❌ Edge Function error:",M),e({title:"Error",description:(M==null?void 0:M.message)||"Failed to submit your application. Please try again.",variant:"destructive"})}finally{s(!1)}},x=!!l&&!c,g=x&&a.invitedTutor==="no",y=!a.firstName||!a.lastName||!a.profession||!a.c
539areerStage||!a.institution||c&&!a.trainingYear||!c&&!a.graduationYear||x&&!a.invitedTutor||g&&a.tutorInterest===""||!a.email||!a.phone||!a.password||!a.confirmPassword;return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("div",{className:"container mx-auto px-4 py-12",children:r.jsxs("div",{className:"max-w-2xl mx-auto",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Become a Member"}),r.jsx("p",{className:"text-lg text-muted-foreground",children:"Join SEMSA and become part of Switzerland's emergency medicine community"})]}),r.jsx("div",{className:"flex justify-center mb-8",children:r.jsx(be,{to:"/auth",children:r.jsxs(Ue,{variant:"white",className:"gap-2",children:[r.jsx(xh,{className:"h-4 w-4"}),"Already a member? Login here"]})})}),t&&r.jsxs(Bs,{className:"mb-8 border-amber-400 bg-amber-50",children:[r.jsx(nl,{className:"h-4 w-4 text-amber-600"}),r.jsxs(Hs,{className:"text-amber-800",children:[r.jsx("strong",{children:"Admin test mode active."})," You are signed in as an admin, so the rate limit is skipped for this submission. To also receive test emails (instead of real ones), use"," ",r.jsx("em",{children:"Test"})," as the last name."]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl text-center",children:"Why should you become a member?"})}),r.jsx(H,{children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"Connect with fellow students, residents, and emergency medicine professionals across Switzerland"})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"Access comprehensive information on learning opportunities during and after your education"})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"Participate in hands-on training sessions"})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"Never miss out on great networking opportunities within the emergency medicine community"})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"Be part of Switzerland's growing emergency medicine student community"})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mt-2 flex-shrink-0"}),r.jsx("p",{className:"text-muted-foreground",children:"As a member, you have the unique opportunity to join another specialty (paramedicine, nursing, or medicine) as part of a ride-along or shadowing experience"})]})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl text-center",children:"Membership Application"})}),r.jsx(H,{children:r.jsxs("form",{onSubmit:b,className:"space-y-8",children:[r.jsxs("section",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Personal Information"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"lastName",children:"Last Name *"}),r.jsx(xe,{id:"lastName",type:"text",value:a.lastName,onChange:j=>f("lastName",j.target.value),required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"firstName",children:"First Name *"}),r.jsx(xe,{id:"firstName",type:"text",value:a.firstName,onChange:j=>
539f("firstName",j.target.value),required:!0})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"email",children:"Email Address *"}),r.jsx(xe,{id:"email",type:"email",value:a.email,onChange:j=>f("email",j.target.value),required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"phone",children:"Phone Number *"}),r.jsx(xe,{id:"phone",type:"tel",value:a.phone,onChange:j=>f("phone",j.target.value),required:!0})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"password",children:"Password *"}),r.jsx(xe,{id:"password",type:"password",value:a.password,onChange:j=>f("password",j.target.value),placeholder:"Choose a secure password",minLength:6,required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"confirmPassword",children:"Confirm Password *"}),r.jsx(xe,{id:"confirmPassword",type:"password",value:a.confirmPassword,onChange:j=>f("confirmPassword",j.target.value),placeholder:"Confirm your password",minLength:6,required:!0})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"This password will be used to access your member dashboard (minimum 6 characters)"})]}),r.jsxs("section",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Professional Background"}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"Profession *"}),r.jsxs(rl,{value:a.profession,onValueChange:j=>
539f("profession",j),className:"flex flex-col space-y-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"medicine",id:"profession-medicine"}),r.jsx(Q,{htmlFor:"profession-medicine",className:"font-normal cursor-pointer",children:"Medicine"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"nursing",id:"profession-nursing"}),r.jsx(Q,{htmlFor:"profession-nursing",className:"font-normal cursor-pointer",children:"Nursing"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"paramedic",id:"profession-paramedic"}),r.jsx(Q,{htmlFor:"profession-paramedic",className:"font-normal cursor-pointer",children:"Paramedic"})]})]})]}),a.profession&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"Career Stage *"}),r.jsx(rl,{value:a.careerStage,onValueChange:j=>f("careerStage",j),className:"flex flex-col space-y-2",children:o.map(j=>r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:j.value,id:`stage-${j.value}`}),r.jsx(Q,{htmlFor:`stage-${j.value}`,className:"font-normal cursor-pointer",children:j.label})]},j.value))})]}),l&&r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"institution",children:[h," *"]}),r.jsx(xe,{id:"institution",type:"text",value:a.institution,onChange:j=>f("institution",j.target.value),placeholder:h==="University"?"e.g., University of Zurich":h==="School"?"e.g., Careum, Bern":"e.g., Inselspital Bern",required:!0})]}),c?r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"trainingYear",children:"Training Year *"}),r.jsxs(mt,{value:a.trainingYear,onValueChange:j=>
539f("trainingYear",j),children:[r.jsx(ot,{id:"trainingYear",children:r.jsx(ht,{placeholder:"Select year"})}),r.jsx(lt,{children:d.map(j=>r.jsx(fe,{value:j,children:j},j))})]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"graduationYear",children:"Graduation Year *"}),r.jsx(xe,{id:"graduationYear",type:"number",inputMode:"numeric",min:1950,max:2100,value:a.graduationYear,onChange:j=>f("graduationYear",j.target.value),placeholder:"e.g., 2023",required:!0})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"Languages spoken"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:tg.map(j=>{const N=a.languages.includes(j);return r.jsx("button",{type:"button",onClick:()=>p(j),className:`px-3 py-1 rounded-full text-sm border transition-colors ${N?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-input hover:bg-muted"}`,children:j},j)})}),a.languages.filter(j=>!tg.includes(j)).length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:a.languages.filter(j=>!tg.includes(j)).map(j=>r.jsxs(Me,{variant:"secondary",className:"gap-1 px-2 py-1",children:[j,r.jsx("button",{type:"button",onClick:()=>p(j),className:"ml-1 hover:text-destructive","aria-label":`Remove ${j}`,children:r.jsx(Nn,{className:"h-3 w-3"})})]},j))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(xe,{type:"text",value:a.customLanguage,onChange:j=>f("customLanguage",j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),w())},placeholder:"Add another language",className:"flex-1"}),r.jsx(G,{type:"button",variant:"outline",onClick:w,children:"Add"})]})]})]}),x&&r.jsxs("section",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Teaching & Tutoring"}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"Have you been invited to register as a SEMSA Tutor? *"}),r.jsxs(rl,{value:a.invitedTutor,onValueChange:j=>
539f("invitedTutor",j),className:"flex flex-col space-y-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"yes",id:"invited-tutor-yes"}),r.jsx(Q,{htmlFor:"invited-tutor-yes",className:"font-normal cursor-pointer",children:"Yes"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"no",id:"invited-tutor-no"}),r.jsx(Q,{htmlFor:"invited-tutor-no",className:"font-normal cursor-pointer",children:"No"})]})]}),a.invitedTutor==="yes"&&r.jsxs(Bs,{children:[r.jsx(nl,{className:"h-4 w-4"}),r.jsx(Hs,{className:"text-sm",children:"You're being registered through the tutor onboarding process. Your application will be reviewed by the SEMSA board."})]})]}),g&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"Would you be interested in future tutoring opportunities with SEMSA? *"}),r.jsxs(rl,{value:a.tutorInterest,onValueChange:j=>f("tutorInterest",j),className:"flex flex-col space-y-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"yes",id:"tutor-yes"}),r.jsx(Q,{htmlFor:"tutor-yes",className:"font-normal cursor-pointer",children:"Yes"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:"no",id:"tutor-no"}),r.jsx(Q,{htmlFor:"tutor-no",className:"font-normal cursor-pointer",children:"No"})]})]}),a.tutorInterest==="yes"&&r.jsxs(Bs,{children:[r.jsx(nl,{className:"h-4 w-4"}),r.jsx(Hs,{className:"text-sm",children:"Thanks! We'll keep this on file. This is not a tutor application — you can apply through the separate tutor onboarding process at any time."})]})]})]}),x&&a.invitedTutor==="yes"?r.jsxs("div",{className:"bg-medical-red-light p-4 rounded-md",children:[r.jsx("h3",{className:"font-semibold text-medical-red mb-2",children:"Annual Membership Fee"}),r.jsx("p",{className:"text-medical-red",children:"SEMSA Tutors are exempt from the annual membership fee."})]}):r.jsxs("div",{className:"bg-medical-red-light p-4 rounded-md",children:[r.jsx("h3",{className:"font-semibold text-medical-red mb-2",children:"Annual Membership Fee"}),r.jsx("p",{className:"text-lg font-bold text-medical-red",children:v()}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Students: 10 CHF • All other career stages: 20 CHF"})]}),r.jsx(G,{type:"submit",className:"w-full",disabled:y||n,children:n?r.jsxs(r.Fragment,{children:[r.jsx(xa,{className:"h-4 w-4 mr-2 animate-spin"}),"Submitting your application…"]}):"Submit Application"}),r.jsxs(Bs,{className:"mt-6",children:[r.jsx(nl,{className:"h-4 w-4"}),r.jsxs(Hs,{children:[r.jsx("strong",{children:"What happens after you submit?"}),r.jsxs("ul",{className:"mt-2 space-y-1 text-sm list-disc list-inside",children:[r.jsx("li",{children:"You will receive an email to confirm your email address"}),r.jsx("li",{children:"We will send you an invoice for the membership fee within 7 days (tutors are exempt)"}),r.jsx("li",{children:"Once we have received your payment (or approved your tutor application), we will unlock your login"})]})]})]})]})})]})]})}),r.jsx(qe,{})]})},Yz=()=>{const e=[{title:"Career Paths & Specializations",description:"Explore different career paths and specializations in emergency medicine",icon:fi,path:"/emergency-medicine/career-paths"},{title:"Student Courses",description:"Essential courses and training programs for emergency medicine students",icon:Ey,path:"/emergency-medicine/student-courses"},{title:"Student Jobs",description:"Job opportunities and positions for emergency medicine students",icon:hi,path:"/emergency-medicine/student-jobs"},{title:"Useful Tools",description:"Apps, websites, and digital resources for emergency medicine practice",icon:Sd,path:"/emergency-medicine/useful-tools"},{title:"Clinical Rotation Opportunities and Reviews for Medical Students",description:"Available clinical rotations and training opportunities",icon:Px,path:"/emergency-medicine/clinical-rotations"},{title:"Voluntary Work",description:"Volunteer opportunities in emergency medicine and healthcare",icon:Gs,path:"/emergency-medicine/voluntary-work"},{title:"Masterthesis and Dissertation",description:"Resources for thesis and dissertation projects in emergency medicine",icon:Kr,path:"/emergency-medicine/masterthesis-dissertation"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Emergency Medicine Hub"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Comprehensive resources for emergency medicine students and professionals"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((t,n)=>{const s=t.icon;return r.jsxs(B,{className:"shadow-elevation-low flex flex-col",children:[r.jsxs(ne,{className:"text-center",children:[r.jsx("div",{className:"mx-auto mb-4 p-3 bg-primary/10 rounded-full w-fit",children:r.jsx(s,{className:"h-8 w-8 text-primary"})}),r.jsx(re,{className:"text-xl",children:t.title})]}
539),r.jsxs(H,{className:"text-center flex-grow flex flex-col",children:[r.jsx("p",{className:"text-muted-foreground flex-grow",children:t.description}),r.jsx("div",{className:"mt-6",children:t.path==="/emergency-medicine/masterthesis-dissertation"?r.jsx(Ue,{className:"w-full opacity-50 cursor-not-allowed",disabled:!0,children:"Coming Soon"}):r.jsx(be,{to:t.path,children:r.jsx(Ue,{className:"w-full",children:"Explore"})})})]})]},n)})}),r.jsx("div",{className:"mt-16 text-center",children:r.jsx(B,{className:"mx-auto max-w-4xl bg-muted/30 border-dashed",children:r.jsxs(H,{className:"py-8",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Important Notice"}),r.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["We are continuously working to improve and expand the information available in this hub. Please note that this resource is not comprehensive and is constantly being updated. If you notice any missing information or have suggestions for improvement, we welcome your feedback at"," ",r.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline font-medium",children:"[email protected]"})]})]})})})]}),r.jsx(qe,{})]})},Gz=()=>{const e=[{title:"Doctors",description:"Explore specializations, certification courses, and career opportunities for physicians in emergency medicine.",icon:fi,path:"/emergency-medicine/career-paths/doctors",available:!0},{title:"Nurses",description:"Discover career paths, advanced certifications, and specialization options for nurses in emergency care.",icon:Gs,path:"/emergency-medicine/career-paths/nurses",available:!0},{title:"Paramedics",description:"Learn about career progression, specialized training, and advancement opportunities for paramedics.",icon:My,path:"/emergency-medicine/career-paths/paramedics",available:!0}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Career Paths & Specializations"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Explore diverse career opportunities in emergency medicine for different healthcare professions"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 max-w-5xl mx-auto",children:e.map((t,n)=>{const s=t.icon;return r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"p-8 text-center",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(s,{className:"h-10 w-10 text-primary"})}),r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:t.title}),r.jsx("p",{className:"text-muted-foreground mb-6",children:t.description}),r.jsx(be,{to:t.path,className:"block",children:r.jsx(Ue,{className:"w-full",children:"Explore"})})]})},n)})})]}),r.jsx(qe,{})]})};var uw="Tabs",[Kz,hK]=zr(uw,[sc]),MA=sc(),[Zz,mw]=Kz(uw),DA=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=hu(l),[h,f]=es({prop:s,onChange:a,defaultProp:i});return r.jsx(Zz,{scope:n,baseId:wr(),value:h,onValueChange:f,orientation:o,dir:u,activationMode:c,children:r.jsx(Le.div,{dir:u,"data-orientation":o,...d,ref:t})})});DA.displayName=uw;var OA="TabsList",IA=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,i=mw(OA,n),o=MA(n);return r.jsx(aw,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:s,children:r.jsx(Le.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});IA.displayName=OA;var LA="TabsTrigger",FA=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...i}=e,o=mw(LA,n),l=MA(n),c=UA(o.baseId,s),d=BA(o.baseId,s),u=s===o.value;return r.jsx(iw,{asChild:!0,...l,focusable:!a,active:u,children:r.jsx(Le.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:we(e.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?o.onValueChange(s):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(s)}),onFocus:we(e.onFocus,()=>{const h=o.activationMode!=="manual";!u&&!a&&h&&o.onValueChange(s)})})})});FA.displayName=LA;var $A="TabsContent",zA=m.forwardRef((e,t)=>
539{const{__scopeTabs:n,value:s,forceMount:a,children:i,...o}=e,l=mw($A,n),c=UA(l.baseId,s),d=BA(l.baseId,s),u=s===l.value,h=m.useRef(u);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),r.jsx(Nr,{present:a||u,children:({present:f})=>r.jsx(Le.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&i})})});zA.displayName=$A;function UA(e,t){return`${e}-trigger-${t}`}function BA(e,t){return`${e}-content-${t}`}var Xz=DA,HA=IA,WA=FA,qA=zA;const yi=Xz,ka=m.forwardRef(({className:e,...t},n)=>r.jsx(HA,{ref:n,className:le("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ka.displayName=HA.displayName;const bn=m.forwardRef(({className:e,...t},n)=>r.jsx(WA,{ref:n,className:le("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));bn.displayName=WA.displayName;const Fn=m.forwardRef(({className:e,...t},n)=>r.jsx(qA,{ref:n,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fn.displayName=qA.displayName;const Qz=()=>{const e=[{title:"ATLS / ETC",description:"Advanced Trauma Life Support",duration:"3 days",studentFriendly:!1},{title:"ACLS / ALS",description:"Advanced Cardiac Life Support",duration:"2 days",studentFriendly:!1},{title:"PALS / EPLS",description:"Pediatric Advanced Life Support",duration:"2 days",studentFriendly:!1},{title:"PHTLS",description:"Prehospital Trauma Life Support",duration:"2 days",studentFriendly:!0},{title:"AMLS",description:"Advanced Medical Life Support",duration:"2 days",studentFriendly:!0},{title:"TCCC / TECC",description:"Tactical Combat / Emergency Casualty Care",duration:"2-3 days",studentFriendly:!0},{title:"International Diploma in Mountain Medicine",description:"Specialized training for mountain rescue and alpine medicine with summer and winter modules",duration:"7 days",studentFriendly:!1},{title:"SFG-H / CSAM Module 6",description:"Medical Service Leadership for Major Events in Clinical Care",duration:"3 days",studentFriendly:!1}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(fi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Career Paths for Doctors"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Explore specializations and certification courses for physicians in emergency medicine"})]}),r.jsxs(yi,{defaultValue:"specializations",className:"w-full",children:[r.jsxs(ka,{className:"grid w-full grid-cols-2",children:[r.jsx(bn,{value:"specializations",children:"Specializations"}),r.jsx(bn,{value:"courses",children:"Certification Courses"})]}),r.jsx(Fn,{value:"specializations",className:"mt-8",children:r.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"p-6",children:[r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Focus Clinical Emergency Medicine"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"SGNOR – Schwerpunkt Klinische Notfallmedizin / Formation approfondie en médecine d'urgence hospital
539ière"}),r.jsx("div",{className:"flex justify-end",children:r.jsx(be,{to:"/emergency-medicine/focus-clinical-em",children:r.jsx(Ue,{size:"sm",children:"Learn More"})})})]})}),r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"p-6",children:[r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Certificate of Competence in Prehospital Emergency Medicine"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"SGNOR - Fähigkeitsausweis präklinische Notfallmedizin [Notarzt] / Attestation de formation complémentaire en médecine d'urgence préhospitalière"}),r.jsx("div",{className:"flex justify-end",children:r.jsx(be,{to:"/emergency-medicine/prehospital-em",children:r.jsx(Ue,{size:"sm",children:"Learn More"})})})]})}),r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"p-6",children:[r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Air Ambulance Services"}),r.jsx("div",{className:"flex justify-end",children:r.jsx(be,{to:"/emergency-medicine/air-ambulance",children:r.jsx(Ue,{size:"sm",children:"Learn More"})})})]})})]})}),r.jsx(Fn,{value:"courses",className:"mt-8",children:r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsx(re,{className:"text-lg",children:t.title}),t.studentFriendly&&r.jsx(Me,{variant:"secondary",children:"Student Friendly"})]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:t.description}),r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Duration: ",t.duration]}),t.title==="International Diploma in Mountain Medicine"||t.title==="SFG-H / CSAM Module 6"?r.jsx(Ue,{variant:"white",size:"sm",disabled:!0,children:"Coming Soon"}):r.jsx(be,{to:`/emergency-medicine/courses/${t.title.toLowerCase().replace(/[\s\/]+/g,"-").replace(/^-+|-+$/g,"")}`,children:r.jsx(Ue,{size:"sm",children:"Learn More"})})]})]})]},n))})})]})]}),r.jsx(qe,{})]})},Jz=()=>{const e=[{number:"1",shortTitle:"FaGe",title:"Federal VET Diploma in Healthcare (FaGe)",icon:Gs,details:["3-year vocational education and training","One possible entry route into professional nursing education","Not a mandatory prerequisite for becoming a registered nurse"]},{number:"2",shortTitle:"Nursing HF/FH",title:"Registered Nurse – Nursing HF/FH",icon:Ey,details:["Higher Professional Education (HF) or Bachelor of Science in Nursing (FH)","Duration and admission requirements depend on previous education and programme","Leads to a recognised professional nursing qualification"]},{number:"3",shortTitle:"Specialisation",title:"Specialisation in Acute & Emergency Care",icon:fi,details:["Emergency Nursing","Anaesthesia Nursing","Intensive Care Nursing"]}],t=[{title:"NDS HF Emergency Nursing",description:"Direct specialisation for emergency nursing",highlight:!0},{title:"NDS HF Anaesthesia Nursing",description:"Related acute-care specialisation",highlight:!1},{title:"NDS HF Intensive Care Nursing",description:"Related acute-care specialisation",highlight:!1}],n=[{name:"OdASanté",description:"National organisation of the world of work in healthcare. Relevant for professional education, nursing education and AIN specialisations.",cta:"Visit OdASanté",url:"https://www.odasante.ch/"},{name:"SBFI",description:"State Secretariat for Education, Research and Innovation. Official information on higher professional education, qualifications and current regulatory developments.",cta:"Visit SBFI",url:"https://www.sbfi.admin.ch/"},{name:"Berufsberatung.ch",description:"Swiss career and education information platform. Useful for career pathways, education programmes and admission information.",cta:"Visit Berufsberatung.ch",url:"https://www.berufsberatung.ch/"},{name:"XUND",description:"Education provider offering healthcare education and continuing education, including Nursing HF and AIN postgraduate programmes.",cta:"Explore XUND programmes",url:"https://xund.ch/bildungsangebote/"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Gs,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Career Paths for Nurses"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Your pathway into emergency and acute care nursing in Switzerland"})]}
539),r.jsxs("section",{"aria-labelledby":"career-pathway",className:"mb-16",children:[r.jsx("h2",{id:"career-pathway",className:"mb-8 text-center text-2xl font-bold text-foreground",children:"Career pathway"}),r.jsx("div",{className:"mb-8 flex flex-col items-center justify-center gap-3 text-center md:flex-row md:gap-4",children:e.map((s,a)=>r.jsxs("div",{className:"contents",children:[r.jsx(Me,{variant:"secondary",className:"px-4 py-2 text-sm font-semibold",children:s.shortTitle}),a<e.length-1&&r.jsx(pr,{className:"h-5 w-5 rotate-90 text-primary md:rotate-0","aria-hidden":"true"})]},s.number))}),r.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-3",children:e.map(s=>{const a=s.icon;return r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"flex h-full flex-col p-6",children:[r.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[r.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary text-base font-bold text-primary-foreground",children:s.number}),r.jsx(a,{className:"h-6 w-6 text-primary","aria-hidden":"true"})]}),r.jsx("h3",{className:"mb-3 text-lg font-semibold leading-snug text-foreground",children:s.title}),r.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.details.map(i=>r.jsxs("li",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"mt-2 h-1.5 w-1.5 shrink-0 rounded-full bg-primary","aria-hidden":"true"}),r.jsx("span",{children:i})]},i))})]})},s.number)})})]}),r.jsxs("section",{className:"mb-16","aria-labelledby":"specialisation",children:[r.jsx("h2",{id:"specialisation",className:"mb-8 text-center text-2xl font-bold text-foreground",children:"Specialisation in Acute & Emergency Care"}),r.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-3",children:t.map(s=>r.jsx(B,{className:s.highlight?"border-primary bg-primary/5 shadow-elevation-medium":"shadow-elevation-medium",children:r.jsxs(H,{className:"flex h-full flex-col p-6",children:[s.highlight&&r.jsx(Me,{className:"mb-4 w-fit",children:"Most direct route into emergency medicine"}),r.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:s.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]})},s.title))}),r.jsx(B,{className:"mt-6 bg-muted/40 shadow-elevation-medium",children:r.jsx(H,{className:"p-6",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(nl,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary","aria-hidden":"true"}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 font-semibold text-foreground",children:"Swiss education system currently evolving"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"The Swiss education system for Anaesthesia, Intensive Care and Emergency Nursing is currently being revised. For the latest information on qualifications, admission requirements and transition arrangements, please refer to the official Swiss sources below."}),r.jsxs("a",{href:"https://www.sbfi.admin.ch/de/faq-massnahmenpaket-hoeheren-berufsbildung-absolventen",target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center text-sm font-medium text-primary hover:underline",children:["Official information from the SBFI",r.jsx(pr,{className:"ml-1 h-4 w-4","aria-hidden":"true"})]})]})]})})})]}
539),r.jsx("section",{className:"mb-16","aria-labelledby":"xund-card",children:r.jsx(B,{className:"border-primary/40 bg-primary/5 shadow-elevation-medium",children:r.jsxs(H,{className:"p-6 md:p-8",children:[r.jsx("h2",{id:"xund-card",className:"mb-3 text-2xl font-bold text-foreground",children:"Explore education programmes at XUND"}),r.jsx("p",{className:"mb-6 max-w-3xl text-muted-foreground",children:"XUND offers education and continuing education in healthcare, including Nursing HF and postgraduate programmes in Emergency Nursing, Anaesthesia Nursing and Intensive Care Nursing. XUND is an education provider, while OdASanté and SBFI provide broader official information about the Swiss education system."}),r.jsx("a",{href:"https://xund.ch/bildungsangebote/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:["Explore XUND education programmes",r.jsx(pr,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]})})]})})}),r.jsxs("section",{"aria-labelledby":"latest-information",children:[r.jsx("h2",{id:"latest-information",className:"mb-3 text-center text-2xl font-bold text-foreground",children:"Find the latest information"}),r.jsx("p",{className:"mx-auto mb-8 max-w-3xl text-center text-muted-foreground",children:"SEMSA provides an overview of possible career pathways. For current admission requirements, programme structures, qualifications and training opportunities, please use the official Swiss sources below."}),r.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:n.map(s=>r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(H,{className:"flex h-full flex-col p-6",children:[r.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:s.name}),r.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:s.description}),r.jsx("div",{className:"mt-auto flex justify-end",children:r.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{size:"sm",children:[s.cta,r.jsx(At,{className:"ml-1.5 h-4 w-4","aria-hidden":"true"})]})})})]})},s.name))}),r.jsx("p",{className:"mx-auto mt-10 max-w-3xl text-center text-sm text-muted-foreground",children:"Education pathways and admission requirements may change. SEMSA provides an orientation only. Please refer to the linked official Swiss sources and education providers for the latest information."})]})]}),r.jsx(qe,{})]})},eU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(My,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Career Paths for Paramedics"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Explore specializations and certification courses for paramedics in emergency medicine"})]}),r.jsx(B,{className:"max-w-2xl mx-auto",children:r.jsxs(H,{className:"p-12 text-center",children:[r.jsx(D4,{className:"h-16 w-16 text-muted-foreground mx-auto mb-6"}),r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"Coming soon…"})]})})]}),r.jsx(qe,{})]}),tU=()=>{const e=["At least 24 months of training in SGNOR-approved emergency departments","Valid ACLS/ALS and ATLS/ETC certification","Completion of the SFG-H / CSAM Module 6 (hospital response to extraordinary situations)","A basic POCUS (Point-of-Care Ultrasound) emergency medicine course"],t=["Internal Medicine","Anesthesiology","Surgery","Cardiac/Vascular Surgery","Intensive Care Medicine","Cardiology","Orthopedic and Trauma Surgery"];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(fi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Focus Clinical Emergency Medicine"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"SGNOR – Schwerpunkt Klinische Notfallmedizin / Formation approfondie en médecine d'urgence hospital
539ière"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(fi,{className:"h-5 w-5"}),"Overview"]})}),r.jsx(H,{className:"space-y-4",children:r.jsx("p",{className:"text-muted-foreground",children:"In Switzerland, there is no medical specialty designated as Emergency Medicine (yet). Instead, physicians can obtain the Focus title in Clinical Emergency Medicine (Schwerpunkt Klinische Notfallmedizin), which is available to doctors from various specialties."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Eligible Specialties"})}),r.jsx(H,{children:r.jsx("div",{className:"grid grid-cols-1 gap-2",children:t.map((n,s)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(pa,{className:"h-4 w-4 text-primary"}),r.jsx("span",{className:"text-sm",children:n})]},s))})})]}),r.jsxs(B,{className:"lg:col-span-2",children:[r.jsx(ne,{children:r.jsx(re,{children:"Requirements"})}),r.jsx(H,{children:r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map((n,s)=>r.jsxs("div",{className:"flex items-start gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(pa,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-sm",children:n})]},s))})})]}),r.jsxs(B,{className:"lg:col-span-2",children:[r.jsx(ne,{children:r.jsx(re,{children:"Additional Information"})}),r.jsx(H,{children:r.jsxs("div",{className:"bg-muted/50 p-6 rounded-lg",children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:"For the full list of requirements and application details, please consult the SIWF or SGNOR websites."}),r.jsxs(G,{variant:"outline",className:"inline-flex items-center gap-2",children:[r.jsx(At,{className:"h-4 w-4"}),"Visit SIWF Website"]})]})})]})]})]}),r.jsx(qe,{})]})},nU=()=>{const e=[{duration:"1 year",specialties:"Internal Medicine, Intensive Care, Pediatrics, or surgical specialties (Visceral Surgery, Orthopedic/Trauma Surgery, Cardiac/Vascular Surgery, Hand Surgery, Pediatric Surgery, Neurosurgery, or Thoracic Surgery)"},{duration:"1 year",specialties:"Anesthesiology"},{duration:"3 months",specialties:"Interdisciplinary emergency department or working as an anesthesiologist treating patients in the emergency department"}],t=["Prehospital Emergency Medicine Course SGNOR (Notarztkurs)","ACLS/ALS","PALS/EPLS"];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(hh,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Certificate of Competence in Prehospital Emergency Medicine"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"SGNOR - Fähigkeitsausweis präklinische Notfallmedizin [Notarzt] / Attestation de formation complémentaire en médecine d'urgence préhospitalière"})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(hh,{className:"h-5 w-5"}),"Overview"]})}),r.jsx(H,{className:"space-y-4",children:r.jsx("p",{className:"text-muted-foreground",children:"In Switzerland, there is no standalone specialty in Prehospital Emergency Medicine. Instead, physicians can obtain the Certificate of Competence (Fähigkeitsausweis) in Prehospital Emergency Medicine, available to any Swiss-licensed physician who meets the requirements — no specialty title is needed."})})]}),r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(_s,{className:"h-5 w-5"}),"Clinical Training Requirements (3 years total)"]}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"The following are minimum requirements for each specialty area. Additional training may be needed to reach the total 3-year requirement."})]}),r.jsx(H,{children:r.jsx("div",{className:"space-y-4",children:e.map((n,s)=>r.jsxs("div",{className:"flex gap-4 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Me,{variant:"outline",className:"font-mono text-xs whitespace-nowrap",children:n.duration}),r.jsx("span",{className:"text-sm",children:n.specialties})]},s))})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Required Courses"})}),r.jsx(H,{children:r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((n,s)=>r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(pa,{className:"h-5 w-5 text-primary flex-shrink-0"}),r.jsx("span",{className:"text-sm font-medium",children:n})]},s))})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Final Requirement"})}),r.jsx(H,{children:r.jsxs("div",{className:"bg-primary/10 p-6 rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx(pa,{className:"h-6 w-6 text-primary"}),r.jsx("span",{className:"font-semibold",children:"Emergency Call Experience"})]}),r.jsxs("p",{className:"text-muted-foreground",children:["After completing the required courses, candidates must perform ",r.jsx("strong",{children:"50 emergency calls"})," involving patients with a NACA index of 4 or higher."]}
539)]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Additional Information"})}),r.jsx(H,{children:r.jsxs("div",{className:"bg-muted/50 p-6 rounded-lg",children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:"For the full list of requirements and official guidelines, please refer to the SIWF or SGNOR websites."}),r.jsxs(G,{variant:"outline",className:"inline-flex items-center gap-2",children:[r.jsx(At,{className:"h-4 w-4"}),"Visit SIWF Website"]})]})})]})]})]}),r.jsx(qe,{})]})},rU=()=>{const e=["Swiss-licensed physician","Specialty title in Anesthesiology or Intensive Care Medicine (or both)","Certificate of Competence in Prehospital Emergency Medicine (SGNOR)","Certificate in Prehospital Emergency Sonography (SGNOR)","Completed Mountain Medicine courses SGGM (summer and winter) or the International Diploma of Mountain Medicine (which includes both courses)","ACLS, PHTLS, and PALS certification"],t=["Swiss-licensed physician","Swiss work visa","Category B driver's license","At least 4 years of clinical experience (preferably in Anesthesiology or Intensive Care Medicine)","Very good language skills in German, English, French, and Italian or Spanish"],n=["Swiss-licensed physician","At least 4 years of clinical experience (preferably in Internal Medicine)","Knowledge of Intensive Care Medicine","Excellent language skills"],s=["REGA (most prominent)","Air Glaciers","Air Zermatt","Alpine Air Ambulance (AAA)"];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Rp,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Air Ambulance Services"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"Medical aviation careers in Switzerland"})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Rp,{className:"h-5 w-5"}),"Overview"]})}),r.jsxs(H,{className:"space-y-4",children:[r.jsx("p",{className:"text-muted-foreground",children:"In Switzerland, several air ambulance providers operate. REGA is the most prominent, and the following information focuses on REGA's physician positions and their requirements, which are generally similar for other providers."}),r.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mt-4",children:s.map((a,i)=>r.jsx(Me,{variant:"secondary",className:"text-center py-2",children:a},i))})]})]}),r.jsxs(yi,{defaultValue:"helicopter",className:"w-full",children:[r.jsxs(ka,{className:"grid w-full grid-cols-3",children:[r.jsx(bn,{value:"helicopter",children:"Helicopter Physician"}),r.jsx(bn,{value:"jet",children:"Jet Physician"}),r.jsx(bn,{value:"consultant",children:"Consultant Physician"})]}),r.jsx(Fn,{value:"helicopter",className:"mt-8",children:r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(q4,{className:"h-5 w-5"}),"Helicopter Physician"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-6",children:"As a helicopter physician, you are responsible for the medical care of patients during primary or secondary missions, such as accidents, mountain rescues, resuscitations, and critical transfers."}),r.jsx("h4",{className:"font-semibold mb-4",children:"Requirements:"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map((a,i)=>r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-muted/50 rounded-lg",children:[r.jsx(pa,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-sm",children:a})]},i))}),r.jsx("div",{className:"mt-6 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg border border-yellow-200 dark:border-yellow-800",children:r.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:[r.jsx("strong",{children:"Note:"})," REGA also expects strong physical and mental resilience, excellent teamwork, and outstanding language skills. Positions are highly competitive."]})}),r.jsx("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800",children:r.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:[r.jsx("strong",{children:"REGA Rotation for Residents:"})," In some larger hospitals, anesthesiology residents may be able to complete a six-month REGA rotation during their training."]})})]})]})}),r.jsx(Fn,{value:"jet",className:"mt-8",children:r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Rp,{className:"h-5 w-5"}),"Jet Physician"]})}
539),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-6",children:"As a jet physician, you work on REGA's private jets, mainly repatriating sick or injured patients from abroad."}),r.jsx("h4",{className:"font-semibold mb-4",children:"Requirements:"}),r.jsx("div",{className:"grid grid-cols-1 gap-3",children:t.map((a,i)=>r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-muted/50 rounded-lg",children:[r.jsx(pa,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-sm",children:a})]},i))})]})]})}),r.jsx(Fn,{value:"consultant",className:"mt-8",children:r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(pa,{className:"h-5 w-5"}),"Consultant Physician"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-6",children:"As a consultant physician, you assess the condition of patients abroad, determine whether repatriation is necessary, and decide on the safest mode of transport."}),r.jsx("h4",{className:"font-semibold mb-4",children:"Requirements:"}),r.jsx("div",{className:"grid grid-cols-1 gap-3",children:n.map((a,i)=>r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-muted/50 rounded-lg",children:[r.jsx(pa,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-sm",children:a})]},i))})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Additional Information"})}),r.jsx(H,{children:r.jsxs("div",{className:"bg-muted/50 p-6 rounded-lg",children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:"For more detailed information about career opportunities and specific requirements, visit the REGA website."}),r.jsxs(G,{variant:"outline",className:"inline-flex items-center gap-2",children:[r.jsx(At,{className:"h-4 w-4"}),"Visit REGA Website"]})]})})]})]})]}),r.jsx(qe,{})]})},sU=()=>{const e=[{title:"AO Courses",provider:"AO Foundation",description:"Orthopedic trauma and emergency surgery training"},{title:"Medventura",provider:"Medical Education Provider",description:"Comprehensive emergency medicine training program",path:"/emergency-medicine/student-courses/medventura"},{title:"STEWI Provider / Advanced",provider:"STEWI Association",description:"Emergency medicine provider and advanced training courses",path:"/emergency-medicine/student-courses/stewi"},{title:"Summer Academy of Disaster Medicine",provider:"Disaster Medicine Institute",description:"Comprehensive training in disaster and emergency response medicine"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Ey,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Student Courses"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Training programs for emergency medicine enthusiasts"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-lg",children:t.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.provider})]}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:t.description}),t.path?r.jsx(be,{to:t.path,className:"block",children:r.jsx(Ue,{size:"sm",className:"w-full",children:"Learn More"})}):r.jsx(Ue,{size:"sm",variant:"white",className:"w-full",disabled:!0,children:"Coming Soon"})]})]},n))})]}),r.jsx(qe,{})]})},aU=()=>{const e=["Basiskurs (Bern)","Basiskurs (Basel)","Gebirgskurs (Zermatt)","Winterkurs","Chirurgiekurs (Bern)"];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/student-courses",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Student Courses"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx("img",{src:dC,alt:"Medventura",className:"h-12 w-auto"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Medventura"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-4xl mx-auto",children:"Medventura organizes exciting courses on emergency and rescue medicine for medical students and other interested individuals. Their courses provide an introduction to handling emergency situations. They not only offer a refreshing change from the routine of university life but also present an opportunity to make new connections. Medventura combines medicine with adventure."})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-8 text-center",children:"Available Courses"}),r.jsx("div",{className:"max-w-2xl mx-auto",children:r.jsx("ul",{className:"space-y-3 text-lg",children:e.map((t,n)=>r.jsxs("li",{className:"flex items-center",children:[r.jsx("span",{className:"w-2 h-2 bg-primary rounded-full mr-4 flex-shrink-0"}),t]},n))})})]}),r.jsx("div",{className:"text-center",children:r.jsxs(B,{className:"max-w-md mx-auto",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-lg",children:"Visit Medventura"})}),r.jsx(H,{children:r.jsx("a",{href:"https://medventura.ch/Joomla/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{className:"w-full",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Official Website"]})})})]})})]}),r.jsx(qe,{})]})},iU=()=>{const e=[{name:"Provider",description:"For medical students in their 3rd or 4th year"},{name:"Advanced",description:"For paramedic students in their last phase of training / medical students in their 6th year"},{name:"Sonographie",description:"Requires successful completion of the Sonographie basic abdomen course"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/student-courses",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Student Courses"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(fi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"STEWI"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-4xl mx-auto",children:"STEWI aims to promote emergency medicine skills among human medicine students. To this end, STEWI organizes emergency weekends and training sessions. In their own words, these offerings serve as a supplement to university education, focusing on topics that receive little attention in the curriculum with particular emphasis on practical application."})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-8 text-center",children:"Available Courses"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-lg",children:t.name})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground",children:t.description})})]},n))})]}),r.jsx("div",{className:"text-center",children:r.jsxs(B,{className:"max-w-md mx-auto",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-lg",children:"Visit STEWI"})}),r.jsx(H,{children:r.jsx("a",{href:"https://thestewi.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{className:"w-full",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Official Website"]})})})]})})]}),r.jsx(qe,{})]})},oU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(oo,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"ATLS & ETC"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Advanced Trauma Life Support & European Trauma Course"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{
vendor: 10,797 bytes, line 539
539className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"3 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Physicians & Healthcare Professionals"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Certification"}),r.jsx("p",{className:"text-muted-foreground",children:"International Recognition"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Advanced Trauma Life Support (ATLS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'The Advanced Trauma Life Support (ATLS) course is an internationally recognized training program designed to teach a systematic, concise approach to the care of trauma patients. It provides healthcare professionals with the knowledge and skills necessary to assess, prioritize, and manage critically injured patients during the "golden hour" following trauma.'}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"The ATLS curriculum covers the principles of rapid patient assessment, resuscitation, stabilization, and preparation for definitive care. Core topics include:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Primary and secondary surveys"}),r.jsx("li",{children:"Airway management and ventilation"}),r.jsx("li",{children:"Shock recognition and treatment"}),r.jsx("li",{children:"Thoracic, abdominal, and head trauma management"}),r.jsx("li",{children:"Spinal injuries and musculoskeletal trauma"}),r.jsx("li",{children:"Transfer of patients to appropriate facilities"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"The training combines interactive lectures, case discussions, and hands-on skill stations, culminating in practical and written examinations."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"The ATLS course is primarily intended for physicians, especially those working in emergency medicine, surgery, anesthesia, or trauma care. However, it is also suitable for advanced practice providers and other qualified healthcare professionals involved in the acute care of trauma patients. Medical students generally cannot take the full ATLS provider course."})]})]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"European Trauma Course (ETC)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"In addition to ATLS, the European Trauma Course (ETC) offers an alternative internationally recognized training pathway. While it covers the same essential principles of early trauma management, the ETC emphasizes a team-based, multidisciplinary approach. Doctors, nurses, and paramedics train together, reflecting how trauma care is delivered in real clinical settings."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"The ETC shares the same clinical focus areas as ATLS—airway and ventilation, shock recognition, major injuries, and safe transfer—but the teaching method is different. Rather than lectures and skill stations, the ETC relies heavily on realistic, scenario-based simulations and continuous assessment of both technical and non-technical skills, including leadership, decision-making, and communication."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"Where ATLS is primarily directed at physicians, the ETC is designed for the whole trauma team. This multidisciplinary format allows participants from different professional backgrounds to practice working together in high-pressure trauma situations."})]})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Recognition and Equivalence"})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"In many European countries, hospitals and training bodies regard ETC as broadly equivalent to ATLS for meeting trauma education requirements. Which course is accepted may vary depending on local regulations, but both are internationally respected standards for structured trauma care training."})})]})]}),r.jsx(qe,{})]}),lU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Gs,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"ACLS & ALS"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Advanced Cardiac Life Support & Advanced Life Support"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"2 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Licensed Healthcare Providers"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Prerequisites"}),r.jsx("p",{className:"text-muted-foreground",children:"BLS Certification Required"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Advanced Cardiac Life Support (ACLS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Advanced Cardiac Life Support (ACLS) course is an internationally recognized training program developed by the American Heart Association (AHA) and other accredited providers. It is designed to equip healthcare professionals with the skills and knowledge required to manage cardiac arrest, stroke, and other cardiovascular emergencies, using a systematic and evidence-based approach."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"ACLS builds on Basic Life Support (BLS) skills and focuses on advanced interventions for adult patients in critical situations. Key topics include:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Advanced airway management"}),r.jsx("li",{children:"Recognition and management of cardiac arrest and peri-arrest conditions"}),r.jsx("li",{children:"Interpretation of ECG rhythms"}),r.jsx("li",{children:"Pharmacology for cardiovascular emergencies"}),r.jsx("li",{children:"High-quality CPR and defibrillation techniques"}),r.jsx("li",{children:"Management of acute coronary syndromes and stroke"}),r.jsx("li",{children:"Team dynamics and effective communication during resuscitation"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"The course includes lectures, case-based discussions, and practical skill stations, culminating in written and practical examinations."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"ACLS is intended for licensed healthcare providers who may respond to cardiovascular emergencies, such as physicians, nurses, paramedics, and other advanced healthcare practitioners. Completion of BLS certification is a prerequisite. Medical students, nursing students, and other trainees can attend ACLS if they have completed BLS and possess foundational knowledge of anatomy, physiology, and ECG interpretation."})]})]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Advanced Life Support (ALS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"In addition to ACLS, the European Resuscitation Council (ERC) and other regional providers deliver the Advanced Life Support (ALS) course, which is widely recognized across Europe and internationally. While its aims mirror those of ACLS, ALS is closely aligned with European Resuscitation Guidelines and emphasizes structured, team-based resuscitation in both in-hospital and pre-hospital settings."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"ALS covers the same core areas as ACLS—airway management, recognition and treatment of cardiac arrest and peri-arrest conditions, ECG interpretation, and emergency pharmacology—but places particular emphasis on:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Early recognition and prevention of cardiac arrest"}),r.jsx("li",{children:"Standardized algorithms for adult life support"}),r.jsx("li",{children:"Use of manual defibrillators and pacing"}),r.jsx("li",{children:"Integration of post-resuscitation care"}),r.jsx("li",{children:"Team leadership, communication, and human factors in resuscitation"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Teaching is delivered through simulation-based scenarios, workshops, and group discussions, with continuous assessment of technical and n
539on-technical skills throughout the course."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"Like ACLS, ALS is aimed at healthcare professionals who are likely to be part of a resuscitation team, including doctors, nurses, paramedics, and other advanced practitioners. BLS certification and basic ECG knowledge are prerequisites."})]})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Recognition and Equivalence"})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Within Europe, ALS is generally regarded as equivalent to ACLS for professional requirements, and most hospitals accept either as fulfilling advanced resuscitation training standards. The preferred course may vary by country or institution, but both are internationally respected and evidence-based."})})]})]}),r.jsx(qe,{})]}),cU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(T4,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"PALS & EPLS"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Pediatric Advanced Life Support & European Pediatric Life Support"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"2 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Pediatric Healthcare Providers"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Prerequisites"}),r.jsx("p",{className:"text-muted-foreground",children:"BLS Certification Required"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Pediatric Advanced Life Support (PALS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Pediatric Advanced Life Support (PALS) course is an internationally recognized training program developed by the American Heart Association (AHA) and other accredited providers. It is designed to provide healthcare professionals with the knowledge and skills necessary to recognize and treat life-threatening emergencies in infants and children, using a systematic and evidence-based approach."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"PALS builds on Basic Life Support (BLS) principles, focusing on advanced pediatric assessment and intervention. Core topics include:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Pediatric assessment and early recognition of respiratory and circulatory compromise"}),r.jsx("li",{children:"Advanced airway management in children"}),r.jsx("li",{children:"Management of pediatric cardiac arrest and peri-arrest conditions"}),r.jsx("li",{children:"Recognition and treatment of shock (hypovolemic, distributive, cardiogenic, and obstructive)"}),r.jsx("li",{children:"Pediatric rhythm disturbances and their management"}),r.jsx("li",{children:"Pharmacology for pediatric resuscitation"}),r.jsx("li",{children:"Effective team dynamics and communication in pediatric emergencie
539s"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Training consists of lectures, case-based discussions, and practical skill stations, followed by written and skills assessments."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"The PALS course is intended for healthcare providers who respond to pediatric emergencies, including physicians, nurses, paramedics, and other advanced practitioners working in emergency care, intensive care, or pediatric settings. Completion of BLS is required before attending. Medical and nursing students may also participate if they have the necessary foundational knowledge and meet course prerequisites."})]})]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"European Pediatric Life Support (EPLS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Alongside PALS, the European Resuscitation Council (ERC) and affiliated providers offer the European Pediatric Life Support (EPLS) course. Like PALS, EPLS is an internationally recognized program that equips healthcare professionals to manage life-threatening pediatric emergencies, but it is aligned with European Resuscitation Guidelines and emphasizes a structured, team-based approach."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"EPLS covers the same core clinical areas as PALS—pediatric assessment, airway management, shock recognition, arrhythmia management, and pediatric cardiac arrest—but places additional emphasis on:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Early recognition of the seriously ill child"}),r.jsx("li",{children:"Standardized algorithms for pediatric life support"}),r.jsx("li",{children:"Safe and effective use of defibrillation and emergency drugs in children"}),r.jsx("li",{children:"Post-resuscitation stabilization and transfer of critically ill children"}),r.jsx("li",{children:"Team leadership, communication, and human factors in pediatric resuscitation"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"The course is delivered mainly through interactive workshops, skill stations, and scenario-based simulations, with ongoing assessment rather than a single final exam."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"EPLS is designed for all healthcare professionals involved in the resuscitation and stabilization of seriously ill or injured children, including doctors, nurses, and paramedics working in pediatric wards, emergency departments, intensive care, or pre-hospital settings. BLS certification is required, along with foundational pediatric knowledge."})]})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Recognition and Equivalence"})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"In most European hospitals, EPLS is regarded as equivalent to PALS, with both fulfilling advanced pediatric resuscitation training requirements. The choice between the two typically depends on local or institutional preference, but both are internationally respected and evidence-based."})})]})]}),r.jsx(qe,{})]}),dU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(My,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"PHTLS"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Prehospital Trauma Life Support"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{
539className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"2 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Prehospital Care Providers"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Access"}),r.jsx("p",{className:"text-muted-foreground",children:"Open to Students & Trainees"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Prehospital Trauma Life Support (PHTLS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Prehospital Trauma Life Support (PHTLS) course is an internationally recognized training program developed by the National Association of Emergency Medical Technicians (NAEMT) in cooperation with the American College of Surgeons Committee on Trauma. It is designed to improve the quality of trauma care provided in the prehospital setting and to enhance the chances of survival for trauma patients."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"PHTLS teaches a systematic, evidence-based approach to the assessment, management, and transport of trauma patients before they reach the hospital. Key topics include:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Scene safety and patient triage"}),r.jsx("li",{children:"Primary assessment and rapid trauma survey"}),r.jsx("li",{children:"Airway management and oxygenation"}),r.jsx("li",{children:"Hemorrhage control and shock management"}),r.jsx("li",{children:"Thoracic, abdominal, and head trauma"}),r.jsx("li",{children:"Musculoskeletal injuries"}),r.jsx("li",{children:"Patient packaging and rapid transport"}),r.jsx("li",{children:"Special considerations for pediatric, geriatric, and pregnant trauma patients"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Training is delivered through interactive lectures, case scenarios, and hands-on skill stations, with both written and practical evaluations."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"The PHTLS course is intended for prehospital care providers such as paramedics, emergency medical technicians (EMTs), and other emergency responders. It is also suitable for nurses, physicians, and other healthcare professionals who provide trauma care in the field or during patient transport."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Unlike ATLS, PHTLS is open to a broader range of participants, advanced medical students and rescue service trainees can attend."})]})]})]})]}),r.jsx(qe,{})]}),uU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(E4,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"AMLS"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Advanced Medical Life Support"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{
539className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"2 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Healthcare Professionals"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Access"}),r.jsx("p",{className:"text-muted-foreground",children:"Open to Students & Trainees"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Advanced Medical Life Support (AMLS)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Advanced Medical Life Support (AMLS) course is an internationally recognized training program developed by the National Association of Emergency Medical Technicians (NAEMT) in cooperation with the National Association of EMS Physicians (NAEMSP). It is designed to provide healthcare professionals with a comprehensive, systematic approach to the assessment and management of the most common medical emergencies in the pre-hospital and hospital settings."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"AMLS emphasizes critical thinking and structured assessment to identify life-threatening conditions and initiate timely interventions. Core topics include:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Systematic patient assessment and differential diagnosis"}),r.jsx("li",{children:"Airway, breathing, and circulatory emergencies"}),r.jsx("li",{children:"Neurological and metabolic disorders"}),r.jsx("li",{children:"Cardiovascular emergencies (e.g., chest pain, acute coronary syndromes, heart failure)"}),r.jsx("li",{children:"Respiratory emergencies (e.g., asthma, COPD, pulmonary edema)"}),r.jsx("li",{children:"Shock, sepsis, and toxicological emergencies"}),r.jsx("li",{children:"Endocrine, infectious, and environmental emergencies"}),r.jsx("li",{children:"Special considerations for geriatric and pediatric patients"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"The course uses interactive lectures, case-based discussions, and scenario-driven skill stations, enabling participants to apply knowledge to real-world clinical situations. Assessment is continuous, focusing on both knowledge and decision-making skills."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"The AMLS course is intended for healthcare professionals who encounter acute medical patients, including paramedics, emergency medical technicians, nurses, physicians, and other advanced practitioners working in pre-hospital, emergency, or acute care environments. Unlike ATLS, AMLS is open to a broader range of participants, advanced medical students and rescue service trainees can attend."})]})]})]})]}),r.jsx(qe,{})]}),mU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/career-paths",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Career Paths"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(uf,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"TCCC & TECC"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Tactical Combat Casualty Care & Tactical Emergency Casualty Care"})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12",children:[r.jsx(B,{children:r.jsxs(H,{
vendor: 5,770 bytes, line 539
539className:"p-6 text-center",children:[r.jsx(_s,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Duration"}),r.jsx("p",{className:"text-muted-foreground",children:"2-3 days"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(Ht,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Tactical & Emergency Responders"})]})}),r.jsx(B,{children:r.jsxs(H,{className:"p-6 text-center",children:[r.jsx(oo,{className:"h-8 w-8 text-primary mx-auto mb-4"}),r.jsx("h3",{className:"font-semibold mb-2",children:"Setting"}),r.jsx("p",{className:"text-muted-foreground",children:"High-Risk Environments"})]})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Overview"})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Tactical Combat Casualty Care (TCCC) and Tactical Emergency Casualty Care (TECC) are internationally recognized training programs that teach evidence-based, systematic approaches to providing life-saving interventions in high-risk environments. While they share the same clinical foundation, they are designed for different operational settings."})})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Tactical Combat Casualty Care (TCCC)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"TCCC was originally developed by the U.S. military to reduce preventable deaths on the battlefield. It provides combat medics and military personnel with structured algorithms to manage trauma under fire, focusing on interventions that can be delivered quickly in austere, resource-limited environments."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Care Under Fire, Tactical Field Care, and Tactical Evacuation Care phases"}),r.jsx("li",{children:"Hemorrhage control (tourniquets, wound packing, hemostatic agents)"}),r.jsx("li",{children:"Airway and breathing management in tactical settings"}),r.jsx("li",{children:"Management of shock and life-threatening trauma"}),r.jsx("li",{children:"Analgesia, fluid resuscitation, and hypothermia prevention"}),r.jsx("li",{children:"Evacuation considerations in combat environments"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"TCCC is primarily intended for military medical providers and combat forces, but is also offered in adapted versions for law enforcement and tactical teams."})]})]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Tactical Emergency Casualty Care (TECC)"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"TECC is the civilian adaptation of TCCC, created by the Committee for Tactical Emergency Casualty Care (C-TECC). It translates the principles of TCCC into guidelines suitable for civilian first responders, law enforcement, EMS, and healthcare providers operating in high-threat situations such as active shooter incidents, terrorist attacks, or disaster response."}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Course Content"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground ml-4",children:[r.jsx("li",{children:"Direct threat care and indirect threat care phases"}),r.jsx("li",{children:"Rapid bleeding control (tourniquets, wound packing, pressure dressings)"}),r.jsx("li",{children:"Airway management and rescue breathing in austere environments"}),r.jsx("li",{children:"Recognition and management of shock and trauma patterns"}),r.jsx("li",{children:"Evacuation and patient movement in civilian tactical incidents"}),r.jsx("li",{children:"Team communication, safety, and coordination with law enforcement"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Who Should Attend"}),r.jsx("p",{className:"text-muted-foreground",children:"TECC is designed for a broad range of civilian responders, including paramedics, EMTs, nurses, physicians, firefighters, and law enforcement officers. It is also accessible to non-medical personnel such as security staff who may be first on scene."})]})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Comparison and Equivalence"})}),r.jsx(H,{children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-2 text-primary",children:"Clinical Foundation"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Both TCCC and TECC are built on the same medical evidence and share the same core life-saving interventions (bleeding control, airway management, shock treatment, evacuation)."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-2 text-primary",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"TCCC is military-focused, while TECC adapts the guidelines for civilian and law enforcement contexts."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-2 text-primary",children:"Operational Environment"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"TCCC addresses battlefield trauma;
539 TECC addresses emergencies in civilian tactical or disaster settings."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-2 text-primary",children:"Recognition"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Both are internationally respected. In civilian healthcare and EMS systems, TECC is the more relevant course; in military contexts, TCCC remains the standard."})]})]})})]})]}),r.jsx(qe,{})]}),hU=()=>{const e=[{title:"Chris Medical Services",location:"Lausanne",description:"Medical services primarily in French-speaking Switzerland, including event coverage and first aid courses.",path:"/emergency-medicine/student-jobs/chris-medical"},{title:"Emergency Squad",location:"Küsnacht",description:"Medical services including event coverage and courses for a broad spectrum of clients.",path:"/emergency-medicine/student-jobs/emergency-squat"},{title:"JDMT",location:"Pfäffikon, Zurich",description:"Medical services for companies, events, and private clients with flexible part-time opportunities for medical students.",path:"/emergency-medicine/student-jobs/jdmt"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(hi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Student Jobs"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Student jobs related to emergency medicine"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-lg",children:t.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.location})]}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:t.description}),r.jsx(be,{to:t.path,className:"block",children:r.jsx(Ue,{size:"sm",className:"w-full",children:"Learn More"})})]})]},n))})]}),r.jsx(qe,{})]})},fU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/student-jobs",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Student Jobs"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(hi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"JDMT"}),r.jsxs("div",{className:"flex items-center justify-center text-muted-foreground mb-6",children:[r.jsx(Rn,{className:"h-5 w-5 mr-2"}),r.jsx("span",{className:"text-lg",children:"Pfäffikon, Zurich"})]})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(hi,{className:"h-6 w-6 mr-2"}),"About JDMT"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed text-lg mb-6",children:"JDMT is a company based in Pfäffikon, Zurich, offering a variety of medical services to companies, events, and private clients. Its primary mission is to involve medical students in different roles."}),r.jsx("a",{href:"https://www.jdmt.ch",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center",children:r.jsxs(Ue,{children:["Visit Website",r.jsx(At,{className:"h-4 w-4 ml-2"})]})})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(yh,{className:"h-6 w-6 mr-2"}),"Work Areas"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"First Aid Training"}),r.jsx("p",{className:"text-muted-foreground",children:"Teaching first aid courses primarily to company first responders and various organizations."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"Event Medical Services"}),r.jsx("p",{className:"text-muted-foreground",children:"Providing Samaritan services at events including football games, city festivals, concerts, and more."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(Ht,{className:"h-6 w-6 mr-2"}),"Functions & Opportunities"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Application Process"}),r.jsx("p",{className:"text-muted-foreground",children:"Each course or event requires a separate application, making JDMT a flexible part-time opportunity."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Geographic Coverage"}),r.jsx("p",{className:"text-muted-foreground",children:"Most courses and events are located in and around Zurich, but it is possible to work here coming from other big universities."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Target Audience"}),r.jsx("p",{className:"text-muted-foreground",children:"Medical students seeking flexible, practical experience in emergency medicine and first aid training."})]})]})})]})]})]}),r.jsx(qe,{})]}),pU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/student-jobs",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Student Jobs"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(hi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Chris Medical Services"}),r.jsxs("div",{className:"flex items-center justify-center text-muted-foreground mb-6",children:[r.jsx(Rn,{className:"h-5 w-5 mr-2"}),r.jsx("span",{className:"text-lg",children:"Lausanne"})]})]}
539),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(hi,{className:"h-6 w-6 mr-2"}),"About Chris Medical Services"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed text-lg mb-6",children:"Chris Medical Services is a company based in Lausanne offering different medical services, primarily in the French speaking part of Switzerland."}),r.jsx("a",{href:"https://chris-medical-services.ch/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center",children:r.jsxs(Ue,{children:["Visit Website",r.jsx(At,{className:"h-4 w-4 ml-2"})]})})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(yh,{className:"h-6 w-6 mr-2"}),"Work Areas"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"Event Medical Coverage"}),r.jsx("p",{className:"text-muted-foreground",children:"Providing comprehensive medical coverage for various events throughout French-speaking Switzerland."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"First Aid Training"}),r.jsx("p",{className:"text-muted-foreground",children:"Teaching first aid courses to individuals and organizations across the region."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(Ht,{className:"h-6 w-6 mr-2"}),"Team Composition"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Healthcare Professionals"}),r.jsxs("ul",{className:"text-muted-foreground space-y-1",children:[r.jsx("li",{children:"• Doctors"}),r.jsx("li",{children:"• Paramedics"}),r.jsx("li",{children:"• Nurses"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Students"}),r.jsxs("ul",{className:"text-muted-foreground space-y-1",children:[r.jsx("li",{children:"• Medical students"}),r.jsx("li",{children:"• Training opportunities"}),r.jsx("li",{children:"• Mentorship programs"})]})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(Rn,{className:"h-6 w-6 mr-2"}),"Geographic Focus"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Chris Medical Services primarily operates in the French-speaking part of Switzerland, with headquarters in Lausanne. This regional focus allows for specialized service delivery tailored to local needs and regulations."})})]})]})]}),r.jsx(qe,{})]}),gU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/student-jobs",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Student Jobs"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(hi,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Emergency Squad"}),r.jsxs("div",{className:"flex items-center justify-center text-muted-foreground mb-6",children:[r.jsx(Rn,{className:"h-5 w-5 mr-2"}),r.jsx("span",{className:"text-lg",children:"Küsnacht"})]})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(hi,{className:"h-6 w-6 mr-2"}),"About Emergency Squad"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed text-lg mb-6",children:"Emergency Squad is a company based in Küsnacht offering different medical services like medical coverage for events as well as teaching courses to a broad spectrum of clients."}),r.jsx("a",{href:"https://www.emergencysquad.ch/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center",children:r.jsxs(Ue,{children:["Visit Website",r.jsx(At,{className:"h-4 w-4 ml-2"})]})})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(yh,{className:"h-6 w-6 mr-2"}),"Work Areas"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"Event Medical Coverage"}),r.jsx("p",{className:"text-muted-foreground",children:"Comprehensive medical coverage for various types of events, ensuring safety and emergency response."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:"Educational Services"}),r.jsx("p",{className:"text-muted-foreground",children:"Teaching courses to a broad spectrum of clients, from corporate first aid to specialized medical training."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(Ht,{className:"h-6 w-6 mr-2"}),"Team Composition"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Healthcare Professionals"}),r.jsxs("ul",{className:"text-muted-foreground space-y-1",children:[r.jsx("li",{children:"• Doctors"}),r.jsx("li",{children:"• Paramedics"}),r.jsx("li",{children:"• Trained first aiders"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Students & Training"}),r.jsxs("ul",{className:"text-muted-foreground space-y-1",children:[r.jsx("li",{children:"• Medical students"}),r.jsx("li",{children:"• Hands-on experience"}),r.jsx("li",{children:"• Professional development"})]})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"text-2xl flex items-center",children:[r.jsx(yh,{className:"h-6 w-6 mr-2"}),"Functions & Approach"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Diverse Client Base"}),r.jsx("p",{className:"text-muted-foreground",children:"Serves a broad spectrum of clients with tailored medical services and training programs."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Location Advantage"}),r.jsx("p",{className:"text-muted-foreground",children:"Based in Küsnacht, providing easy access to the greater Zurich area and surrounding regions."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:"Multi-level Team"}),r.jsx("p",{className:"text-muted-foreground",children:"Integrates medical students with experienced professionals, creating opportunities for learning and career development."})]})]})})]})]})]}),r.jsx(qe,{})]}),rn={id:"podcast",title:"PINCAST – Emergency Medicine Podcast",shortDe
539scription:"PINCAST is a German-language medical education podcast focusing on clinical emergency medicine. SEMSA members receive one year of free access (regular student subscription value: €24.90).",guestCtaLabel:"Become a SEMSA Member",guestCtaHint:"Become a SEMSA Member to receive a free 1-year PINCAST subscription.",memberCtaLabel:"Show access instructions",registrationUrl:"https://www.pincast.net/freeAbo",websiteUrl:"https://www.pincast.net/",detailPath:"/emergency-medicine/useful-tools/pincast",accessCode:"SEMSA Member"};function hw({variant:e="card",className:t,showExplore:n=!1,showWebsite:s=!1,hideAccessToggle:a=!1,defaultAccessOpen:i=!1}){const{isMember:o,isTutor:l,isAdmin:c,isPending:d}=In(),u=(o||l||c)&&!d,[h,f]=m.useState(i||a),p=e==="featured";return r.jsxs(B,{id:`resource-${rn.id}`,className:le("shadow-elevation-medium flex flex-col",p&&"border-primary/40",t),children:[r.jsxs(ne,{children:[r.jsx("div",{className:"bg-white rounded-md border p-4 mb-3 flex items-center justify-center h-24",children:r.jsx("img",{src:cC.url,alt:"PINCAST logo",className:"max-h-full max-w-full object-contain"})}),r.jsx(re,{className:"text-lg",children:rn.title}),r.jsx(Pt,{className:"text-sm mt-1",children:rn.shortDescription})]}),r.jsxs(H,{className:"space-y-3 mt-auto",children:[u?r.jsxs(r.Fragment,{children:[!a&&r.jsxs(G,{className:"w-full",variant:p?"default":"outline",onClick:()=>f(w=>!w),children:[rn.memberCtaLabel,h?r.jsx(vS,{className:"h-4 w-4 ml-1"}):r.jsx(ky,{className:"h-4 w-4 ml-1"})]}),h&&r.jsxs("div",{className:"text-sm bg-muted/40 rounded-md p-4 border space-y-3",children:[r.jsx("p",{className:"font-medium",children:"As a SEMSA member, you receive one year of free access (regular student subscription value: €24.90)."}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium mb-1",children:"To activate your subscription:"}),r.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-muted-foreground",children:[r.jsxs("li",{children:["Complete the PINCAST registration form:"," ",r.jsxs("a",{href:rn.registrationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline inline-flex items-center gap-1",children:["pincast.net/freeAbo",r.jsx(At,{className:"h-3 w-3"})]})]}),r.jsxs("li",{children:["In the ",r.jsx("span",{className:"font-medium",children:"Comments"})," field enter the access code:"," ",r.jsx("code",{className:"px-1.5 py-0.5 rounded bg-background border font-mono text-foreground",children:rn.accessCode})]}),r.jsx("li",{children:"PINCAST will manually verify and activate your subscription."}),r.jsx("li",{children:"You will receive a confirmation email once your subscription is active."})]})]}),r.jsxs("ul",{className:"list-disc list-inside text-muted-foreground space-y-1 text-xs",children:[r.jsx("li",{children:"The subscription expires automatically after one year and does not renew."}),r.jsx("li",{children:"PINCAST keeps a record of redeemed subscriptions to prevent duplicate activations."}),r.jsx("li",{children:"You can also earn 2 SGNOR CME credits per monthly episode."})]}),r.jsx("a",{href:rn.registrationUrl,target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsxs(G,{className:"w-full",size:"sm",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Open PINCAST registration"]})})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:rn.guestCtaHint}),r.jsx(be,{to:"/membership",className:"block",children:r.jsxs(G,{className:"w-full",variant:p?"default":"outline",children:[r.jsx(gh,{className:"h-4 w-4 mr-2"}),rn.guestCtaLabel]})})]}),n&&r.jsx(be,{to:rn.detailPath,className:"block",children:r.jsx(G,{className:"w-full",variant:"outline",children:"Explore"})}),s&&r.jsx("a",{href:rn.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsxs(G,{className:"w-full",variant:"outline",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]})]})}const xU=()=>{const[e,t]=m.useState("apps"),n=()=>{t("websites"),setTimeout(()=>{const i=document.getElementById(`resource-${rn.id}`);i&&(i.scrollIntoView({behavior:"smooth",block:"start"}),i.classList.add("ring-2","ring-primary"),setTimeout(()=>i.classList.remove("ring-2","ring-primary"),2e3))},50)},s=[{name:"Defikarte.ch",description:"Map showing available AEDs around you",iosUrl:"https://apps.apple.com/ch/app/defikarte-ch/id1549569525",androidUrl:"https://play.google.com/store/apps/details?id=ch.defikarte.app&hl=de_CH"},{name:"Notfallguru",description:"Compact tool with step by step recommendations. 1-time buy",iosUrl:"https://apps.apple.com/ch/app/notfallguru/id6498866513",androidUrl:"https://play.google.com/store/apps/details?id=de.notfallguru.app"},{name:"Quick EM",description:"Quick references and calculators for Emergency medicine. 1-time buy",iosUrl:"https://apps.apple.com/ch/app/quickem/id930734530",androidUrl:"https://play.google.com/store/apps/details?id=com.BillDirkes.QuickEM2&hl=de_CH"},{name:"RETTEN TO GO NFS",description:"Collection of key facts and study cards",iosUrl:"https://apps.apple.com/ch/app/retten-to-go-nfs/id6443991454",androidUrl:"https://play.google.com/store/apps/details?id=de.thieme.rettentogo.nfs&hl=ln"}],a=[{name:"Die Kliniker",description:"Platform by physicians offering free clinical skills and s
539onography scripts, plus curated medical resources",url:"https://www.kliniker.ch/",path:"/emergency-medicine/useful-tools/die-kliniker"},{name:"emerge-edu",description:"Emergency medicine education platform with comprehensive learning resources and training materials",url:"https://www.emerge-edu.com/"},{name:"Les Bruits du Déchoc",description:"Swiss French FOAMed platform for emergency medicine with free podcasts, journal clubs, quizzes and clinical reviews",url:"https://www.bruits-dechoc.ch/",path:"/emergency-medicine/useful-tools/bruits-dechoc"},{name:"IBCC",description:"Internet Book of Critical Care with extensive articles on critical care conditions",url:"https://emcrit.org/",path:"/emergency-medicine/useful-tools/ibcc"},{name:"Life in the Fast Lane",description:"Comprehensive emergency and critical care education with ECG examples and clinical guides",url:"https://litfl.com/",path:"/emergency-medicine/useful-tools/life-in-the-fast-lane"},{name:"medStandards",description:"University Hospital Basel's emergency medicine knowledge management tool with flowcharts and guidelines",url:"https://www.medstandards.ch/",path:"/emergency-medicine/useful-tools/medstandards"},{name:"Notfallguru",description:"Compact emergency medicine resource by young German doctors with step-by-step protocols",url:"https://www.notfallguru.de/",path:"/emergency-medicine/useful-tools/notfallguru"}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Sd,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Useful Tools"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Essential resources for emergency medicine"})]}),r.jsx(B,{className:"mb-8 border-primary/40 bg-primary/5 shadow-elevation-medium",children:r.jsxs(H,{className:"p-6 flex flex-col md:flex-row items-start md:items-center gap-4",children:[r.jsx("div",{className:"p-3 rounded-md bg-primary/15 text-primary shrink-0",children:r.jsx(G4,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-primary mb-1",children:[r.jsx(wS,{className:"h-3.5 w-3.5"})," New"]}),r.jsx("h2",{className:"text-lg font-semibold",children:rn.title}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:rn.shortDescription})]}),r.jsx(G,{onClick:n,className:"shrink-0",children:"View Resource"})]})}),r.jsxs(yi,{value:e,onValueChange:t,className:"w-full",children:[r.jsxs(ka,{className:"grid w-full grid-cols-2 mb-8",children:[r.jsxs(bn,{value:"apps",className:"flex items-center gap-2",children:[r.jsx(Sd,{className:"h-4 w-4"}),"Mobile Apps"]}),r.jsxs(bn,{value:"websites",className:"flex items-center gap-2",children:[r.jsx(lo,{className:"h-4 w-4"}),"Websites & Resources"]})]}),r.jsx(Fn,{value:"apps",children:r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map((i,o)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-lg",children:i.name}),r.jsx(Pt,{className:"text-sm",children:i.description})]}),r.jsxs(H,{className:"space-y-2",children:[r.jsx("a",{href:i.androidUrl,target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsxs(Ue,{variant:"white",className:"w-full",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Android Store"]})}),r.jsx("a",{href:i.iosUrl,target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsxs(Ue,{variant:"white",className:"w-full",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"iOS App Store"]})})]})]},o))})}),r.jsx(Fn,{value:"websites",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[r.jsx(hw,{showExplore:!0,showWebsite:!0}),a.map((i,o)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-lg",children:i.name}),r.jsx(Pt,{className:"text-sm",children:i.description})]}
539),r.jsxs(H,{className:"space-y-2",children:[i.path&&r.jsx(be,{to:i.path,className:"block",children:r.jsx(Ue,{className:"w-full",children:"Explore"})}),r.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"block",children:r.jsxs(Ue,{className:"w-full",children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]})]},o))]})})]})]}),r.jsx(qe,{})]})},vU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(fh,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Die Kliniker"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Platform created by physicians for clinical excellence"}),r.jsx("a",{href:"https://www.kliniker.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Ht,{className:"h-5 w-5"}),"About Die Kliniker"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Kliniker:in is a platform created by a group of physicians to answer the rising requirements in daily clinical work. Their mission is to help navigate the tensions between diagnostic safety, smarter medicine, high workload and orientation in the jungle of evidence-based medicine."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(fh,{className:"h-5 w-5"}),"Free Educational Resources"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Clinical Skills Script"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:'Also known as the "Berner OSCE Skript" - a comprehensive guide for clinical skills, available completely free of charge.'})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Sonography Script"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Complete sonography guide covering essential ultrasound techniques and procedures."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Curated Medical Links"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Carefully selected and organized links to helpful resources across various medical specialties."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Tr,{className:"h-5 w-5"}),"Community Events"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Kliniker:in organizes engaging events in the Lucerne area, fostering community among medical professionals:"}),r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[r.jsx("li",{children:"Medical pub quizzes for networking and learning"}),r.jsx("li",{children:"Interesting case presentations"}),r.jsx("li",{children:"Educational workshops and seminars"}),r.jsx("li",{children:"Professional networking opportunities"})]})]})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access Die Kliniker"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Visit their website to access free educational resources and stay updated on community events."}),r.jsx("a",{href:"https://www.kliniker.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to Die Kliniker"]}
vendor: 20,545 bytes, line 539
539)})]})})})]})]}),r.jsx(qe,{})]}),yU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Px,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"medStandards"}),r.jsx("div",{className:"flex justify-center mb-4",children:r.jsxs(Me,{variant:"secondary",className:"flex items-center gap-1",children:[r.jsx(gh,{className:"h-3 w-3"}),"Login Required"]})}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"University Hospital Basel's Emergency Medicine Knowledge Management Tool"}),r.jsx("a",{href:"https://www.medstandards.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Px,{className:"h-5 w-5"}),"About medStandards"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"medStandards is the comprehensive knowledge management tool for emergency medicine at the University Hospital of Basel (Universitätsspital Basel). It serves as a centralized repository for evidence-based emergency medicine protocols and guidelines."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(X4,{className:"h-5 w-5"}),"Key Features"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Extensive Flowcharts"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Comprehensive collection of clinical decision flowcharts for emergency situations, providing step-by-step guidance for various conditions."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Evidence-Based Guidelines"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Current, research-backed guidelines covering a wide range of emergency medical scenarios and treatments."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Emergency Situations Coverage"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Protocols for diverse emergency conditions from trauma and cardiac events to toxicological emergencies and pediatric cases."})]})]})})]}),r.jsxs(B,{className:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/20 dark:border-yellow-800",children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2 text-yellow-800 dark:text-yellow-200",children:[r.jsx(gh,{className:"h-5 w-5"}),"Access Requirements"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 leading-relaxed mb-4",children:"Please note that medStandards requires user authentication and login credentials. Access is typically provided to medical professionals and students affiliated with the University Hospital of Basel or partner institutions."}),r.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"If you're a medical professional or student, contact your institution for access information."})]})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access medStandards"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Visit the University Hospital Basel's emergency medicine knowledge platform."}),r.jsx("a",{href:"https://www.medstandards.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to medStandards"]})})]})})})]})]}),r.jsx(qe,{})]}),wU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Kr,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Internet Book of Critical Care"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Comprehensive critical care resource by Dr. Josh Farkas"}),r.jsx("a",{href:"https://emcrit.org/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit IBCC"]})})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(mf,{className:"h-5 w-5"}),"About IBCC"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"The Internet Book of Critical Care (IBCC) is created and maintained by Dr. Josh Farkas, a critical care physician. This comprehensive online resource features detailed articles on various critical care conditions, many of which are directly relevant to emergency medicine practice."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Kr,{className:"h-5 w-5"}),"What's Covered"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Critical Care Conditions"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"In-depth articles covering sepsis, shock, respiratory failure, cardiac emergencies, and other life-threatening conditions commonly seen in emergency departments."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Evidence-Based Medicine"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Articles are grounded in current research and evidence-based practices, with regular updates to reflect the latest medical literature."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Practical Approach"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Content focuses on practical, actionable information that can be directly applied in clinical settings."})]})]})})]}),r.jsxs(B,{className:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/20 dark:border-yellow-800",children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2 text-yellow-800 dark:text-yellow-200",children:[r.jsx(NS,{className:"h-5 w-5"}),"Important Consideration"]})}),r.jsxs(H,{children:[r.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 leading-relaxed mb-4",children:"While IBCC is an excellent resource for understanding complex medical conditions, please note that some treatment algorithms are designed specifically for the US healthcare system and may not fully apply in Switzerland."}),r.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Always consult local guidelines and protocols when making clinical decisions."})]})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Key Features"})}),r.jsx(H,{children:r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[r.jsx("li",{children:"Free access to comprehensive critical care content"}),r.jsx("li",{children:"Regular updates with latest medical research"}),r.jsx("li",{children:"Searchable database of conditions and treatments"}),r.jsx("li",{children:"Mobile-friendly design for bedside reference"}),r.jsx("li",{children:"Integration with EMCrit podcast episodes"}),r.jsx("li",{children:"Community discussion and expert commentary"})]})})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access IBCC"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Explore the comprehensive Internet Book of Critical Care and enhance your emergency medicine knowledge."}),r.jsx("a",{href:"https://emcrit.org/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to IBCC"]})})]})})})]})]}),r.jsx(qe,{})]}),bU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Q4,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Life in the Fast Lane"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Global emergency and critical care education resource"}),r.jsx("a",{href:"https://litfl.com/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit LITFL"]})})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(lo,{className:"h-5 w-5"}),"About Life in the Fast Lane"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Life in the Fast Lane (LITFL) is a comprehensive online educational resource designed for emergency and critical care clinicians worldwide. It serves as a go-to platform for medical professionals seeking high-quality, evidence-based educational content in acute and critical care medicine."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Gs,{className:"h-5 w-5"}),"Key Educational Resources"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Extensive ECG Library"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Comprehensive collection of ECG examples with detailed interpretations, covering everything from basic rhythms to complex pathological findings."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Clinical Guides"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Step-by-step clinical guides for various emergency and critical care scenarios, providing practical approaches to patient management."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Evidence-Based Content"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"All resources are grounded in current medical evidence and best practices, regularly updated to reflect the latest developments in emergency medicine."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Kr,{className:"h-5 w-5"}),"Content Coverage"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Emergency Medicine"}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground text-sm",children:[r.jsx("li",{children:"Trauma management"}),r.jsx("li",{children:"Cardiac emergencies"}),r.jsx("li",{children:"Respiratory emergencies"}),r.jsx("li",{children:"Toxicology"}),r.jsx("li",{children:"Pediatric emergencies"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Critical Care"}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground text-sm",children:[r.jsx("li",{children:"Mechanical ventilation"}),r.jsx("li",{children:"Shock management"}),r.jsx("li",{children:"Sepsis protocols"}),r.jsx("li",{children:"Neurological emergencies"}),r.jsx("li",{children:"Post-operative care"})]})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Interactive Learning Features"})}),r.jsx(H,{children:r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[r.jsx("li",{children:"Interactive ECG quizzes and case studies"}),r.jsx("li",{children:"Searchable clinical calculator database"}),r.jsx("li",{children:"Medical acronym and terminology library"}),r.jsx("li",{children:"Mobile-optimized design for bedside learning"}),r.jsx("li",{children:"Regular webinars and educational events"}),r.jsx("li",{children:"Community discussion forums"})]})})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access LITFL"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Join the global community of emergency and critical care professionals learning with LITFL."}),r.jsx("a",{href:"https://litfl.com/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to Life in the Fast Lane"]})})]})})})]})]}),r.jsx(qe,{})]}),jU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Kr,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Notfallguru"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Compact emergency medicine resource by young German doctors"}),r.jsx("a",{href:"https://www.notfallguru.de/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Notfallguru"]})})]}),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(mf,{className:"h-5 w-5"}),"About Notfallguru"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Notfallguru began as a pocket-sized booklet created by a group of young German doctors who wanted a compact tool packed with pragmatic, step-by-step recommendations for emergency scenarios. Today, in addition to the classic handbook, all of the content is available free of charge on the website or conveniently as a one-time purchase app."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Kr,{className:"h-5 w-5"}),"What's Included"]})}),r.jsx(H,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Step-by-Step Protocols"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Clear, actionable emergency protocols designed for quick reference during high-pressure situations."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Compact Format"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Originally designed as a pocket reference, ensuring essential information is always accessible when you need it most."})]}),r.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Practical Focus"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Content created by young doctors with real-world emergency medicine experience, focusing on practical application over theory."})]})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Key Features"})}),r.jsx(H,{children:r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[r.jsx("li",{children:"Free access to all content via website"}),r.jsx("li",{children:"One-time purchase mobile app available"}),r.jsx("li",{children:"Compact, pocket-sized physical handbook"}),r.jsx("li",{children:"Step-by-step emergency protocols"}),r.jsx("li",{children:"Created by young emergency medicine doctors"}),r.jsx("li",{children:"German language content optimized for German-speaking regions"})]})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Sd,{className:"h-5 w-5"}),"Access Options"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[r.jsx(lo,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Website"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Free access to all content online"})]}),r.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[r.jsx(Sd,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Mobile App"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"One-time purchase for offline access"})]}),r.jsxs("div",{className:"text-center p-4 border rounded-lg",children:[r.jsx(Kr,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),r.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Handbook"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Pocket-sized physical reference"})]})]})})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access Notfallguru"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Explore the comprehensive emergency medicine protocols and enhance your practical skills."}),r.jsx("a",{href:"https://www.notfallguru.de/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to Notfallguru"]})})]})})})]})]}),r.jsx(qe,{})]}),_U=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(wS,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Les Bruits du Déchoc"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Swiss French FOAMed platform for emergency medicine"}),r.jsx("a",{href:"https://www.bruits-dechoc.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]}
539),r.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Ht,{className:"h-5 w-5"}),"About Les Bruits du Déchoc"]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Les Bruits du Déchoc is a Swiss FOAMed (Free Open Access Medical Education) platform in French dedicated to emergency medicine. Founded by a team of emergency physicians in Suisse romande, Dr. François-Xavier Ageron and Dr. Perrine Truong, and led by an independent editorial committee, it provides free and high-quality educational resources. The website includes podcasts, journal clubs, clinical reviews, evidence summaries, and practical learning material covering key topics in emergency and acute care medicine."})})]}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(Kr,{className:"h-5 w-5"}),"What You'll Find"]})}),r.jsx(H,{children:r.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[r.jsx("li",{children:"Podcasts on emergency medicine topics"}),r.jsx("li",{children:"Journal clubs and evidence summaries"}),r.jsx("li",{children:"Clinical reviews and quizzes"}),r.jsx("li",{children:"Practical learning material for acute care"}),r.jsx("li",{children:"Completely free and open to everyone"})]})})]}),r.jsx(B,{className:"bg-primary/5 border-primary/20",children:r.jsx(H,{className:"pt-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Access Les Bruits du Déchoc"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Visit their website to access podcasts, quizzes and free educational resources."}),r.jsx("a",{href:"https://www.bruits-dechoc.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Go to Les Bruits du Déchoc"]})})]})})})]})]}),r.jsx(qe,{})]}),NU=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/useful-tools",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Useful Tools"]}),r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:rn.title}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto mb-6",children:rn.shortDescription}),r.jsx("a",{href:rn.websiteUrl,target:"_blank",rel:"noopener noreferrer",children:r.jsxs(Ue,{children:[r.jsx(At,{className:"h-4 w-4 mr-2"}),"Visit Website"]})})]}),r.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-8 items-start",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(nl,{className:"h-5 w-5"}),"About PINCAST"]})}),r.jsxs(H,{className:"space-y-3 text-muted-foreground leading-relaxed",children:[r.jsx("p",{children:"PINCAST is a German-language medical education podcast focusing on clinical emergency medicine, produced by emergency physicians for clinicians, residents and students."}),r.jsx("p",{children:"Each monthly episode covers a relevant emergency-medicine topic in depth and is accredited with 2 SGNOR CME credits."}),r.jsx("p",{children:"Visit the official website to browse episodes, learn more about the team and subscribe."})]})]}),r.jsx(hw,{hideAccessToggle:!0,showWebsite:!0})]})]}),r.jsx(qe,{})]}),ei=m.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{className:le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
539ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));ei.displayName="Textarea";const Sc={medical_students:"Medical Students",residents:"Residents",paramedics:"Paramedics",nurses:"Nurses"},SU=()=>{const[e,t]=m.useState([]),[n,s]=m.useState([{id:"1",hospital:"Spitäler Schaffhausen",city:"Schaffhausen",country:"Switzerland",department:"Emergency Department",contact_email:"[email protected]",contact_person:"Judith Engeler",website:"",application_process:"Contact Judith Engeler directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2-8 weeks",requirements:"German language skills, Swiss/European medical education",housing_provided:!1,stipend_provided:!1,description:"Gain hands-on experience in emergency medicine at Spitäler Schaffhausen, a leading healthcare institution providing comprehensive emergency care."},{id:"2",hospital:"Universitätsspital Basel",city:"Basel",country:"Switzerland",department:"Notfallzentrum",contact_email:"[email protected]",contact_person:"Prof. Dr. Mueller",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents","Paramedics"],duration:"2-8 weeks",requirements:"German language skills, European medical education",housing_provided:!1,stipend_provided:!0,description:"Leading Swiss emergency department with diverse patient population."},{id:"2",hospital:"Spitalzentrum Biel",city:"Biel",country:"Switzerland",department:"Notfallzentrum",contact_email:"[email protected], [email protected]",contact_person:"Dr. Sabine Thomke",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2+ months",requirements:"Good knowledge of German and French, minimum internship duration 2 months",housing_provided:!1,stipend_provided:!1,description:"Emergency department serving the bilingual region of Biel/Bienne."},{id:"3",hospital:"Notfallzentrum Hirslanden Zürich",city:"Zürich",country:"Switzerland",department:"Notfallzentrum",contact_email:"coming soon",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2-8 weeks",requirements:"",housing_provided:!1,stipend_provided:!1,description:"Private hospital emergency department in Zürich."},{id:"4",hospital:"Inselspital Bern",city:"Bern",country:"Switzerland",department:"Notfallzentrum",contact_email:"coming soon",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2+ months",requirements:"minimum internship duration 2 months",housing_provided:!1,stipend_provided:!1,description:"University hospital emergency department in Bern."},{id:"5",hospital:"Stadtspital Triemli Zürich",city:"Zürich",country:"Switzerland",department:"Notfallzentrum",contact_email:"coming soon",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2-8 weeks",requirements:"",housing_provided:!1,stipend_provided:!1,description:"City hospital emergency department in Zürich."},{id:"6",hospital:"HOCH Health Ostschweiz, Spital Wil",city:"Wil",country:"Switzerland",department:"Notfallzentrum",contact_email:"coming soon",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2-8 weeks",requirements:"",housing_provided:!1,stipend_provided:!1,description:"Regional hospital emergency department in Eastern Switzerland."},{id:"7",hospital:"Spital Langenthal, Spital Region Oberaargau SRO AG",city:"Langenthal",country:"Switzerland",department:"Notfallzentrum",contact_email:"[email protected]",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Re
539sidents"],duration:"2-8 weeks",requirements:"",housing_provided:!1,stipend_provided:!1,description:"Regional hospital emergency department in Oberaargau."},{id:"8",hospital:"Bürgerspital Solothurn",city:"Solothurn",country:"Switzerland",department:"Notfallzentrum",contact_email:"[email protected]",contact_person:"",website:"",application_process:"Contact department directly with application documents",rotation_types:["Medical Students","Residents"],duration:"2-8 weeks",requirements:"",housing_provided:!1,stipend_provided:!1,description:"Emergency department in Solothurn."}]),[a,i]=m.useState(!1),[o,l]=m.useState("created_at"),[c,d]=m.useState("all"),[u,h]=m.useState("all"),[f,p]=m.useState("all"),[w,v]=m.useState("all"),[b,x]=m.useState(!0),{toast:g}=Sn(),[y,j]=m.useState({country:"",city:"",hospital:"",department:"",rotation_type:"",time_of_rotation:"",experience_description:"",teaching:"",leisure_time:"",rating:5,application_info:""});m.useEffect(()=>{N();const E=K.channel("schema-db-changes").on("postgres_changes",{event:"INSERT",schema:"public",table:"clinical_rotation_reviews_public"},S=>{console.log("New review added:",S),t(L=>[S.new,...L])}).subscribe();return()=>{K.removeChannel(E)}},[]);const N=async()=>{try{const{data:E,error:S}=await K.from("clinical_rotation_reviews_public").select("*").order("created_at",{ascending:!1});if(S)throw S;t(E||[])}catch(E){console.error("Error fetching reviews:",E),g({title:"Error",description:"Failed to load reviews",variant:"destructive"})}finally{x(!1)}},k=async E=>{if(E.preventDefault(),!y.country||!y.city||!y.hospital||!y.rotation_type||!y.time_of_rotation||!y.experience_description||!y.teaching||!y.leisure_time||!y.application_info){g({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{const{data:S,error:L}=await K.functions.invoke("submit-review",{body:y});if(L)throw L;if(S!=null&&S.error)throw new Error(S.error);g({title:"Success",description:"Your review has been submitted successfully!"}),j({country:"",city:"",hospital:"",department:"",rotation_type:"",time_of_rotation:"",experience_description:"",teaching:"",leisure_time:"",rating:5,application_info:""}),i(!1),N()}catch(S){console.error("Error submitting review:",S),g({title:"Error",description:S instanceof Error?S.message:"Failed to submit review",variant:"destructive"})}},_=e.reduce((E,S)=>{const L=`${S.hospital}, ${S.city}, ${S.country}`;return E[L]||(E[L]={total:0,count:0,ratings:[]}),E[L].total+=S.rating,E[L].count+=1,E[L].ratings.push(S.rating),E},{}),P=(E,S,L)=>{const C=`${E}, ${S}, ${L}`,D=_[C];return D?D.total/D.count:0},M=[...e.filter(E=>(c===""||c==="all"||E.country.toLowerCase().includes(c.toLowerCase()))&&(u===""||u==="all"||E.city.toLowerCase().includes(u.toLowerCase()))&&(f===""||f==="all"||E.hospital.toLowerCase().includes(f.toLowerCase()))&&(w===""||w==="all"||E.rotation_type===w))].sort((E,S)=>{switch(o){case"rating":return S.rating-E.rating;case"hospital_avg":const L=P(E.hospital,E.city,E.country);return P(S.hospital,S.city,S.country)-L;case"country":return E.country.localeCompare(S.country);case"hospital":return E.hospital.localeCompare(S.hospital);case"rotation_type":return Sc[E.rotation_type].localeCompare(Sc[S.rotation_type]);default:return new Date(S.created_at).getTime()-new Date(E.created_at).getTime()}}),O=[...new Set(e.map(E=>E.country))],A=[...new Set(e.map(E=>E.city))],U=[...new Set(e.map(E=>E.hospital))],W=E=>Array.from({length:5},(S,L)=>r.jsx(Rx,{className:`w-4 h-4 ${L<E?"fill-primary text-primary":"text-muted-foreground"}`},L));return b?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:"Loading..."}):r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"mb-16",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("h2",{className:"text-3xl font-bold text-foreground mb-4",children:"Emergency Medicine Clinical Rotations Opportunities for Medical Students"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"Discover available rotation opportunities at hospitals worldwide"})]}),r.jsx("div",{className:"grid gap-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:n.map(E=>
539r.jsx(B,{className:"h-full flex flex-col",children:r.jsxs(H,{className:"p-3 flex flex-col h-full",children:[r.jsxs("div",{className:"flex-grow",children:[r.jsx("h3",{className:"font-medium text-sm mb-1 capitalize",children:E.hospital}),r.jsxs("p",{className:"text-xs text-muted-foreground mb-2 capitalize",children:[E.city,", ",E.country]}),r.jsx("p",{className:"text-xs mb-2 capitalize",children:E.hospital==="Spitäler Schaffhausen"?"Gain hands-on experience in emergency medicine":E.hospital==="Universitätsspital Basel"||E.hospital==="HOCH Health Ostschweiz, Spital Wil"?"Possibility to ride-along with the emergency doctor":E.hospital==="Spitalzentrum Biel"?"Good knowledge of German and French required, minimum internship duration 2 months":E.hospital==="Inselspital Bern"?"Minimum internship duration 2 months":""})]}),r.jsxs("div",{className:"mt-auto",children:[r.jsxs("p",{className:"text-xs",children:[r.jsx("span",{className:"font-medium capitalize",children:"Apply:"})," ",E.contact_email]}),E.website&&r.jsx("div",{className:"pt-2 border-t mt-2",children:r.jsx("p",{className:"text-xs",children:r.jsx("a",{href:E.website,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline capitalize",children:"Website"})})})]})]})},E.id))}),r.jsx("div",{className:"mt-8 text-center",children:r.jsx(B,{className:"bg-muted/30",children:r.jsxs(H,{className:"p-6",children:[r.jsx("h3",{className:"text-lg font-medium mb-2",children:"More to Come"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"We're continuously adding new clinical rotation opportunities. Check back regularly for updates or suggest a hospital you'd like to see added."})]})})})]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Clinical Rotation Reviews for Medical Students"}),r.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:"Share and discover experiences from emergency medicine rotations worldwide"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-center justify-center",children:[r.jsxs("div",{className:"text-lg",children:[r.jsx("span",{className:"font-semibold",children:e.length})," reviews"]}),r.jsxs(G,{onClick:()=>i(!0),className:"gap-2",children:[r.jsx(vh,{className:"w-4 h-4"}),"Add Review"]})]})]}),a&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:r.jsxs(B,{className:"w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsx(ne,{children:r.jsx(re,{children:"Submit a Clinical Rotation Review"})}),r.jsx(H,{children:r.jsxs("form",{onSubmit:k,className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"country",children:"Country *"}),r.jsx(xe,{id:"country",value:y.country,onChange:E=>j({...y,country:E.target.value}),placeholder:"Enter country",required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"city",children:"City *"}),r.jsx(xe,{id:"city",value:y.city,onChange:E=>j({...y,city:E.target.value}),placeholder:"Enter city",required:!0})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"hospital",children:"Hospital *"}),r.jsx(xe,{id:"hospital",value:y.hospital,onChange:E=>j({...y,hospital:E.target.value}),placeholder:"Enter hospital name",required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"department",children:"Department"}),r.jsx(xe,{id:"department",value:y.department,onChange:E=>j({...y,department:E.target.value}),placeholder:"e.g., Emergency Department, ICU"})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Rotation Type *"}),r.jsx(rl,{value:y.rotation_type,onValueChange:E=>j({...y,rotation_type:E}
539),className:"flex flex-wrap gap-4 mt-2",children:Object.entries(Sc).map(([E,S])=>r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Is,{value:E,id:E}),r.jsx(Q,{htmlFor:E,children:S})]},E))})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"time_of_rotation",children:"Time of Rotation *"}),r.jsx(xe,{id:"time_of_rotation",value:y.time_of_rotation,onChange:E=>j({...y,time_of_rotation:E.target.value}),placeholder:"e.g., January 2024, Summer 2023, Q1 2024",required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"rating",children:"Rating (1-5) *"}),r.jsxs(mt,{value:y.rating.toString(),onValueChange:E=>j({...y,rating:parseInt(E)}),children:[r.jsx(ot,{children:r.jsx(ht,{})}),r.jsx(lt,{children:Array.from({length:5},(E,S)=>S+1).map(E=>r.jsx(fe,{value:E.toString(),children:r.jsxs("div",{className:"flex items-center justify-between w-full",children:[r.jsxs("span",{children:[E," out of 5"]}),r.jsx("div",{className:"flex ml-2",children:Array.from({length:5},(S,L)=>r.jsx(Rx,{className:`w-3 h-3 ${L<E?"fill-primary text-primary":"text-muted-foreground"}`},L))})]})},E))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"experience",children:"General Experience *"}),r.jsx(ei,{id:"experience",value:y.experience_description,onChange:E=>j({...y,experience_description:E.target.value}),placeholder:"Describe your overall rotation experience, patient mix, procedures, etc.",className:"min-h-[100px]",required:!0,maxLength:3e3}),r.jsxs("div",{className:`text-sm mt-1 ${y.experience_description.length>3e3?"text-destructive":"text-muted-foreground"}`,children:[y.experience_description.length," / 3000 characters"]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"teaching",children:"Teaching Quality *"}),r.jsx(ei,{id:"teaching",value:y.teaching,onChange:E=>j({...y,teaching:E.target.value}),placeholder:"Describe the teaching quality, supervision, feedback, learning opportunities, etc.",className:"min-h-[100px]",required:!0,maxLength:2e3}),r.jsxs("div",{className:`text-sm mt-1 ${y.teaching.length>2e3?"text-destructive":"text-muted-foreground"}`,children:[y.teaching.length," / 2000 characters"]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"leisure_time",children:"Leisure Time & Accommodation *"}),r.jsx(ei,{id:"leisure_time",value:y.leisure_time,onChange:E=>j({...y,leisure_time:E.target.value}),placeholder:"Describe leisure time opportunities, accommodation, city life, social activities, etc.",className:"min-h-[100px]",required:!0,maxLength:2e3}),r.jsxs("div",{className:`text-sm mt-1 ${y.leisure_time.length>2e3?"text-destructive":"text-muted-foreground"}`,children:[y.leisure_time.length," / 2000 characters"]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"application",children:"Where to Apply *"}),r.jsx(ei,{id:"application",value:y.application_info,onChange:E=>j({...y,application_info:E.target.value}),placeholder:"Provide information about how to apply for this rotation (contact details, website, application process, etc.)",className:"min-h-[80px]",required:!0,maxLength:1e3}),r.jsxs("div",{className:`text-sm mt-1 ${y.application_info.length>1e3?"text-destructive":"text-muted-foreground"}`,children:[y.application_info.length," / 1000 characters"]})]}),r.jsxs("div",{className:"flex gap-4 justify-end",children:[r.jsx(G,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),r.jsx(G,{type:"submit",children:"Submit Review"})]})]})})]})}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(L4,{className:"w-5 h-5"}),"Filter & Sort Reviews"]})}),r.jsx(H,{children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"Sort by"}),r.jsxs(mt,{value:o,onValueChange:l,children:[r.jsx(ot,{children:r.jsx(ht,{})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"created_at",children:"Newest First"}),r.jsx(fe,{value:"rating",children:"Highest Rating"}),r.jsx(fe,{value:"hospital_avg",children:"Hospital Avg Rating"}),r.jsx(fe,{value:"country",children:"Country"}),r.jsx(fe,{value:"hospital",children:"Hospital"}),r.jsx(fe,{value:"rotation_type",children:"Rotation Type"})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Filter by Country"}),r.jsxs(mt,{value:c,onValueChange:d,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"All countries"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Countries"}),O.map(E=>
539r.jsx(fe,{value:E,children:E},E))]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Filter by City"}),r.jsxs(mt,{value:u,onValueChange:h,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"All cities"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Cities"}),A.map(E=>r.jsx(fe,{value:E,children:E},E))]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Filter by Hospital"}),r.jsxs(mt,{value:f,onValueChange:p,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"All hospitals"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Hospitals"}),U.map(E=>r.jsx(fe,{value:E,children:E},E))]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Filter by Type"}),r.jsxs(mt,{value:w,onValueChange:v,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"All types"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Types"}),Object.entries(Sc).map(([E,S])=>r.jsx(fe,{value:E,children:S},E))]})]})]})]})})]}),r.jsxs("div",{className:"mb-16",children:[r.jsxs("h2",{className:"text-2xl font-bold mb-6",children:["Reviews (",M.length,")"]}),M.length===0?r.jsx(B,{children:r.jsxs(H,{className:"text-center py-12",children:[r.jsx("p",{className:"text-muted-foreground mb-4",children:"No reviews yet"}),r.jsxs(G,{onClick:()=>i(!0),className:"gap-2",children:[r.jsx(vh,{className:"w-4 h-4"}),"Be the first to add a review"]})]})}):r.jsx("div",{className:"grid gap-6",children:M.map(E=>r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex justify-between items-start",children:[r.jsxs("div",{children:[r.jsx(re,{className:"text-lg mb-2",children:E.hospital}),r.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[E.city,", ",E.country,E.department&&` • ${E.department}`]}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsx("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-sm text-xs",children:Sc[E.rotation_type]}),E.time_of_rotation&&r.jsx("span",{children:E.time_of_rotation})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("div",{className:"flex items-center gap-1 mb-1",children:W(E.rating)}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Avg: ",P(E.hospital,E.city,E.country).toFixed(1),"/5"]})]})]})}),r.jsxs(H,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-1",children:"General Experience"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:E.experience_description})]}),E.teaching&&r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-1",children:"Teaching Quality"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:E.teaching})]}),E.leisure_time&&r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-1",children:"Leisure Time & Accommodation"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:E.leisure_time})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-1",children:"Where to Apply"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:E.application_info})]}),r.jsx("div",{className:"pt-2 border-t",children:r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Posted on ",new Date(E.created_at).toLocaleDateString()]})})]})]},E.id))})]})]}),r.jsx(qe,{})]})},kU=()=>{const e=[{name:"Doctors Without Borders",path:"/emergency-medicine/voluntary-work/doctors-without-borders",description:"Provide emergency medical care to people affected by conflict, epidemics, and disasters worldwide."},{name:"First Responder",path:"/emergency-medicine/voluntary-work/first-responder",description:"Deliver immediate life-saving care for cardiac arrest patients in your local community."},{name:"humedica",path:"/emergency-medicine/voluntary-work/humedica",description:"Join structured international humanitarian missions with medical and coordination roles."}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Emergency Medicine Hub"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(Gs,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Voluntary Work"}),r.jsx("p",{className:"text-xl text-muted-foreground",children:"Make a difference through volunteer opportunities"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-lg",children:t.name}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]}),r.jsx(H,{children:r.jsx(be,{to:t.path,children:r.jsx(Ue,{variant:"white",className:"w-full",children:"Learn More"})})})]},n))})]}),r.jsx(qe,{})]})},CU=()=>{const e=[{title:"Emergency Deployments",description:"Mobilize medical teams at short notice for disaster situations, conducting needs assessments and providing emergency care according to WHO Type 1 standards.",icon:r.
539jsx(Gs,{className:"h-6 w-6"})},{title:"Planned Missions",description:"Recurring missions with long-standing partners including medical treatments, specialized training, and healthcare provision programs.",icon:r.jsx(Rn,{className:"h-6 w-6"})},{title:"Hospital Assignments",description:"Direct patient care placements in partner hospitals with knowledge transfer through specialized training sessions.",icon:r.jsx(Ht,{className:"h-6 w-6"})},{title:"Coordination & Monitoring",description:"Project coordination roles including program monitoring, compliance documentation, and activity reporting.",icon:r.jsx(lo,{className:"h-6 w-6"})}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/voluntary-work",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Voluntary Work"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(lo,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Medical Missions with humedica"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"humedica offers medical professionals opportunities to contribute their expertise in international humanitarian contexts through structured frameworks ensuring professional standards and meaningful impact."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-12",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:t.icon}),r.jsx(re,{className:"text-lg",children:t.title})]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground",children:t.description})})]},n))}),r.jsxs(B,{className:"mb-8",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Requirements for Participation"})}),r.jsxs(H,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Nursing Staff or Emergency Medical Personnel"}),r.jsx("p",{className:"text-muted-foreground",children:"Relevant professional training must be fully completed before the start of humedica's preparatory training."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Medical Doctors"}),r.jsx("p",{className:"text-muted-foreground",children:"At least the 10th semester of medical studies must be successfully completed."})]})]})]}),r.jsx("div",{className:"text-center",children:r.jsxs(B,{className:"p-8 bg-primary/5 border-primary/20",children:[r.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Ready to Make a Difference?"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"Learn more about volunteering opportunities and apply to join humedica's medical missions."}),r.jsx("a",{href:"https://humedica.org/de/ehrenamt-im-ausland",target:"_blank",rel:"noopener noreferrer",children:r.jsx(Ue,{children:"Visit humedica Website"})})]})})]}),r.jsx(qe,{})]})},AU=()=>{const e=[{title:"Basic Life Support",description:"Provide immediate BLS including high-quality chest compressions",icon:r.jsx(Gs,{className:"h-6 w-6"})},{title:"AED Usage",description:"Use automated external defibrillators when available",icon:r.jsx(NS,{className:"h-6 w-6"})},{title:"Family Support",description:"Support family members and bystanders until professional teams arrive",icon:r.jsx(Rn,{className:"h-6 w-6"})}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/voluntary-work",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Voluntary Work"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(_s,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"First Responder System"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Designed to improve outcomes for patients suffering out-of-hospital cardiac arrest (OHCA). Every minute counts: early recognition, immediate CPR, and rapid defibrillation significantly increase survival chances."})]}),r.jsxs(B,{className:"mb-12",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"How the System Works"})}
539),r.jsxs(H,{className:"space-y-4",children:[r.jsx("p",{className:"text-muted-foreground",children:"The system integrates professional emergency services with trained volunteer first responders - healthcare professionals, rescue organization members, or laypersons with certified CPR training."}),r.jsx("p",{className:"text-muted-foreground",children:"When a suspected cardiac arrest is reported via emergency number (144), dispatch centers alert both the ambulance service and nearby registered first responders through mobile applications or pager systems using geolocation-based alerting."})]})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:"First Responder Responsibilities"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:e.map((t,n)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:t.icon}),r.jsx(re,{className:"text-lg",children:t.title})]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground",children:t.description})})]},n))})]}),r.jsxs(B,{className:"mb-12 bg-accent/5 border-accent/20",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-xl",children:"Certification Requirements"})}),r.jsxs(H,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Standard First Responder"}),r.jsx("p",{className:"text-muted-foreground",children:"Laypersons will usually need a BLS AED certification."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"First Responder Plus"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:'In some cantons, a special category called First Responder Plus exists. The "plus" indicates that these responders are trained not only for cardiac arrest but also to assist in other acute medical emergencies such as severe shortness of breath, unconsciousness, or major bleeding.'}),r.jsx("p",{className:"font-semibold",children:"Laypersons will usually need an IVR 2 certification"})]})]})]}),r.jsxs(B,{className:"mb-8",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-2xl",children:"Regional Implementation (2025)"}),r.jsx("p",{className:"text-muted-foreground",children:"The First Responder system is organized cantonally. For each canton you want to be active, you need to reapply with some exceptions of cantons having combined systems."})]}),r.jsxs(H,{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-3 text-primary",children:"Individual Canton Systems"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:["Aargau (AG)","Appenzell Ausserrhoden (AR)","Appenzell Innerrhoden (AI)","Bern (BE)","Geneva / Genf (GE)","Glarus (GL) (im Aufbau)","Graubünden (GR)","Neuchâtel / Neuenburg (NE)","Schwyz (SZ)","Thurgau (TG)","Ticino / Tessin (TI)","Valais / Wallis (VS)","Zug (ZG)","Zurich / Zürich (ZH) (seit 2024 Pilotprojekt)"].map((t,n)=>r.jsx("div",{className:"p-2 bg-primary/10 border border-primary/20 rounded text-sm",children:t},n))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-3 text-blue-600",children:"Basel Region"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:["Basel-Landschaft (BL)","Basel-Stadt (BS)","Solothurn (SO)"].map((t,n)=>r.jsx("div",{className:"p-2 bg-blue-100 border border-blue-200 rounded text-sm",children:t},n))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-3 text-green-600",children:"Stiftung Fondation First Responders"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:["Fribourg / Freiburg (FR)","Jura (JU)","Vaud / Waadt (VD)"].map((t,n)=>r.jsx("div",{className:"p-2 bg-green-100 border border-green-200 rounded text-sm",children:t},n))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-3 text-orange-600",children:"First Responder Zentralschweiz"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:["Lucerne / Luzern (LU)","Nidwalden (NW)","Obwalden (OW)","Uri (UR)"].map((t,n)=>r.jsx("div",{className:"p-2 bg-orange-100 border border-orange-200 rounded text-sm",children:t},n))})]}),r.jsxs("div",{className:"mt-6 p-4 bg-destructive/10 border border-destructive/20 rounded-lg",children:[r.jsx("h4",{className:"font-semibold text-destructive mb-2",children:"No System for Laypers
539ons:"}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[r.jsx("li",{children:"• St. Gallen (SG) - System exists but usually organized through local firefighters"}),r.jsx("li",{children:"• Schaffhausen (SH) - No system in place, but Zurich first responders can assist"})]})]})]})]}),r.jsx("div",{className:"text-center",children:r.jsxs(B,{className:"p-8 bg-primary/5 border-primary/20",children:[r.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Join the First Responder Network"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"Help save lives in your community. Laypersons typically need BLS AED certification to participate."}),r.jsx("a",{href:"https://www.first-responder.ch/wissen/first-responder/first-responder-schweiz/",target:"_blank",rel:"noopener noreferrer",children:r.jsx(Ue,{children:"Learn More About First Responder"})})]})})]}),r.jsx(qe,{})]})},EU=()=>{const e=[{title:"Emergency Medical Aid",description:"Deliver urgent medical care in crisis areas worldwide affected by conflict, epidemics, and disasters",icon:r.jsx(Gs,{className:"h-6 w-6"})},{title:"Healthcare Operations",description:"Operate hospitals, mobile clinics, vaccination campaigns, and maternal health services",icon:r.jsx(fi,{className:"h-6 w-6"})},{title:"Specialized Care",description:"Provide surgical care, treatment for malnutrition, and mental health support",icon:r.jsx(Ht,{className:"h-6 w-6"})},{title:"Advocacy",description:"Advocate for access to essential medicines and fair global health policies",icon:r.jsx(lo,{className:"h-6 w-6"})}],t=[{category:"Medical Doctors",description:"General practitioners to specialists including surgeons, anesthesiologists, pediatricians, gynecologists, and psychiatrists",requirements:"Finished specialization and additional clinical experience required for field missions"},{category:"Nursing Staff",description:"Often the backbone of MSF projects, working in hospitals, clinics, vaccination campaigns, and maternal health",requirements:"Professional nursing qualification and relevant experience"},{category:"Paramedics & Emergency Staff",description:"Contributing to emergency care, triage, and stabilization of patients in acute settings",requirements:"Certified emergency medical training and field experience"},{category:"Other Specialists",description:"Midwives, laboratory technicians, pharmacists, and mental health specialists",requirements:"Relevant professional qualifications and experience"}],n=[{title:"Internships & Student Programs",description:"Available at some regional offices for hands-on experience",icon:r.
539jsx(Kr,{className:"h-6 w-6"})},{title:"Educational Resources",description:"Public events and resources to learn about humanitarian medicine",icon:r.jsx(Ht,{className:"h-6 w-6"})},{title:"Advocacy & Volunteering",description:"Raise awareness and support global health efforts",icon:r.jsx(K4,{className:"h-6 w-6"})}];return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs(be,{to:"/emergency-medicine/voluntary-work",className:"inline-flex items-center mb-8 text-primary hover:underline",children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Voluntary Work"]}),r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("div",{className:"mx-auto mb-6 p-4 bg-primary/10 rounded-full w-fit",children:r.jsx(lo,{className:"h-12 w-12 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Doctors Without Borders (MSF)"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Médecins Sans Frontières (MSF) is one of the world's leading humanitarian medical organizations, founded in 1971. We provide emergency medical care to people affected by conflict, epidemics, disasters, or exclusion from healthcare."})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:"What MSF Does"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((s,a)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:s.icon}),r.jsx(re,{className:"text-lg",children:s.title})]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground",children:s.description})})]},a))})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:"Roles for Healthcare Professionals"}),r.jsx("div",{className:"space-y-6",children:t.map((s,a)=>r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-xl",children:s.category})}),r.jsxs(H,{className:"space-y-3",children:[r.jsx("p",{className:"text-muted-foreground",children:s.description}),r.jsx("div",{className:"p-3 bg-accent/10 rounded-lg",children:r.jsxs("p",{className:"text-sm font-medium",children:["Requirements: ",s.requirements]})})]})]},a))})]}),r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:"Opportunities for Students"}),r.jsx("p",{className:"text-center text-muted-foreground mb-8",children:"While field missions typically require finished specialization and clinical experience, students can get involved through:"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:n.map((s,a)=>r.jsxs(B,{className:"shadow-elevation-medium",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:s.icon}),r.jsx(re,{className:"text-lg",children:s.title})]})}),r.jsx(H,{children:r.jsx("p",{className:"text-muted-foreground",children:s.description})})]},a))})]}),r.jsx("div",{className:"text-center",children:r.jsxs(B,{className:"p-8 bg-primary/5 border-primary/20",children:[r.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Ready to Serve Where You're Needed Most?"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"Explore career opportunities and learn how you can contribute to MSF's humanitarian medical missions worldwide."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsx("a",{href:"https://www.msf.org/",target:"_blank",rel:"noopener noreferrer",children:r.jsx(Ue,{children:"Visit MSF International"})}),r.jsx("a",{href:"https://www.msf.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsx(Ue,{variant:"white",children:"Visit MSF Switzerland"})})]})]})})]}),r.jsx(qe,{})]})};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:VA,setPrototypeOf:C0,isFrozen:TU,getPrototypeOf:PU,getOwnPropertyDescriptor:RU}=Object;let{freeze:sr,seal:ts,create:lv}=Object,{apply:cv,construct:dv}=typeof Reflect<"u"&&Reflect;sr||(sr=function(t){return t});ts||(ts=function(t){return t});cv||(cv=function(t,n){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];return t.apply(n,a)});dv||(dv=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return new t(...s)});const hm=ar(Array.prototype.forEach),MU=ar(Array.prototype.lastIndexOf),A0=ar(Array.prototype.pop),kc=ar(Array.prototype.push),DU=ar(Array.prototype.splice),zm=ar(String.prototype.toLowerCase),ng=ar(String.prototype.toString),rg=ar(String.prototype.match),Cc=ar(String.prototype.replace),OU=ar(String.prototype.indexOf),IU=ar(String.prototype.trim),ds=ar(Object.prototype.hasOwnProperty),Xn=ar(RegExp.prototype.test),Ac=LU(TypeError);function ar(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return cv(e,t,s)}}function LU(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return dv(e,n)}}function it(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zm;C0&&C0(e,null);let s=t.length;for(;s--;){let a=t[s];
vendor: 6,864 bytes, line 539
539if(typeof a=="string"){const i=n(a);i!==a&&(TU(t)||(t[s]=i),a=i)}e[a]=!0}return e}function FU(e){for(let t=0;t<e.length;t++)ds(e,t)||(e[t]=null);return e}function Ds(e){const t=lv(null);for(const[n,s]of VA(e))ds(e,n)&&(Array.isArray(s)?t[n]=FU(s):s&&typeof s=="object"&&s.constructor===Object?t[n]=Ds(s):t[n]=s);return t}function Ec(e,t){for(;e!==null;){const s=RU(e,t);if(s){if(s.get)return ar(s.get);if(typeof s.value=="function")return ar(s.value)}e=PU(e)}function n(){return null}return n}const E0=sr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sg=sr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ag=sr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$U=sr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ig=sr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zU=sr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),T0=sr(["#text"]),P0=sr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),og=sr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),R0=sr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","
539subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fm=sr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),UU=ts(/\{\{[\w\W]*|[\w\W]*\}\}/gm),BU=ts(/<%[\w\W]*|[\w\W]*%>/gm),HU=ts(/\$\{[\w\W]*/gm),WU=ts(/^data-[\-\w.\u00B7-\uFFFF]+$/),qU=ts(/^aria-[\-\w]+$/),YA=ts(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),VU=ts(/^(?:\w+script|data):/i),YU=ts(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),GA=ts(/^html$/i),GU=ts(/^[a-z][.\w]*(-[.\w]+)+$/i);var M0=Object.freeze({__proto__:null,ARIA_ATTR:qU,ATTR_WHITESPACE:YU,CUSTOM_ELEMENT:GU,DATA_ATTR:WU,DOCTYPE_NAME:GA,ERB_EXPR:BU,IS_ALLOWED_URI:YA,IS_SCRIPT_OR_DATA:VU,MUSTACHE_EXPR:UU,TMPLIT_EXPR:HU});const Tc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},KU=function(){return typeof window>"u"?null:window},ZU=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(s=n.getAttribute(a));const i="dompurify"+(s?"#"+s:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},D0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function KA(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:KU();const t=Oe=>KA(Oe);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Tc.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,a=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:p}=e,w=c.prototype,v=Ec(w,"cloneNode"),b=Ec(w,"remove"),x=Ec(w,"nextSibling"),g=Ec(w,"childNodes"),y=Ec(w,"parentNode");if(typeof o=="function"){const Oe=n.createElement("template");Oe.content&&Oe.content.ownerDocument&&(n=Oe.content.ownerDocument)}let j,N="";const{implementation:k,createNodeIterator:_,createDocumentFragment:P,getElementsByTagName:$}=n,{importNode:M}=s;let O=D0();t.isSupported=typeof VA=="function"&&typeof y=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:U,TMPLIT_EXPR:W,DATA_ATTR:E,ARIA_ATTR:S,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:D}=M0;let{IS_ALLOWED_URI:F}=M0,T=null;const q=it({},[...E0,...sg,...ag,...ig,...T0]);let I=null;const Y=it({},[...P0,...og,...R0,...fm]);let ie=Object.seal(lv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,pe=null;const _e=Object.seal(lv(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Pe=!0,ke=!0,Re=!1,De=!0,de=!1,R=!0,X=!1,ue=!1,te=!1,Ce=!1,he=!1,Be=!1,Nt=!0,dt=!1;const Ze="user-content-";let st=!0,Ke=!1,bt={},pt=null;const kn=it({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ot=null;const $t=it({},["audio","video","img","source","image","track"]);let pn=null;const Sr=it({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cn="http://www.w3.org/1998/Math/MathML",kr="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xhtml";let J=Wt,ae=!1,V=null;const oe=it({},[Cn,kr,Wt],ng);let Ae=it({},["mi","mo","mn","ms","mtext"]),$e=it({},["annotation-xml"]);const Ve=it({},["title","style","font","a","script"]);let gt=null;const qt=["application/xhtml+xml","text/html"],zt="text/html";let vt=null,Vt=null;const cr=n.createElement("form"),Jt=function(z){return z instanceof RegExp||z instanceof Function},Ur=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Vt&&Vt===z)){if((!z||typeof z!="object")&&(z={}
vendor: 12,889 bytes, lines 539-540
539),z=Ds(z),gt=qt.indexOf(z.PARSER_MEDIA_TYPE)===-1?zt:z.PARSER_MEDIA_TYPE,vt=gt==="application/xhtml+xml"?ng:zm,T=ds(z,"ALLOWED_TAGS")?it({},z.ALLOWED_TAGS,vt):q,I=ds(z,"ALLOWED_ATTR")?it({},z.ALLOWED_ATTR,vt):Y,V=ds(z,"ALLOWED_NAMESPACES")?it({},z.ALLOWED_NAMESPACES,ng):oe,pn=ds(z,"ADD_URI_SAFE_ATTR")?it(Ds(Sr),z.ADD_URI_SAFE_ATTR,vt):Sr,Ot=ds(z,"ADD_DATA_URI_TAGS")?it(Ds($t),z.ADD_DATA_URI_TAGS,vt):$t,pt=ds(z,"FORBID_CONTENTS")?it({},z.FORBID_CONTENTS,vt):kn,se=ds(z,"FORBID_TAGS")?it({},z.FORBID_TAGS,vt):Ds({}),pe=ds(z,"FORBID_ATTR")?it({},z.FORBID_ATTR,vt):Ds({}),bt=ds(z,"USE_PROFILES")?z.USE_PROFILES:!1,Pe=z.ALLOW_ARIA_ATTR!==!1,ke=z.ALLOW_DATA_ATTR!==!1,Re=z.ALLOW_UNKNOWN_PROTOCOLS||!1,De=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,de=z.SAFE_FOR_TEMPLATES||!1,R=z.SAFE_FOR_XML!==!1,X=z.WHOLE_DOCUMENT||!1,Ce=z.RETURN_DOM||!1,he=z.RETURN_DOM_FRAGMENT||!1,Be=z.RETURN_TRUSTED_TYPE||!1,te=z.FORCE_BODY||!1,Nt=z.SANITIZE_DOM!==!1,dt=z.SANITIZE_NAMED_PROPS||!1,st=z.KEEP_CONTENT!==!1,Ke=z.IN_PLACE||!1,F=z.ALLOWED_URI_REGEXP||YA,J=z.NAMESPACE||Wt,Ae=z.MATHML_TEXT_INTEGRATION_POINTS||Ae,$e=z.HTML_INTEGRATION_POINTS||$e,ie=z.CUSTOM_ELEMENT_HANDLING||{},z.CUSTOM_ELEMENT_HANDLING&&Jt(z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ie.tagNameCheck=z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),z.CUSTOM_ELEMENT_HANDLING&&Jt(z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ie.attributeNameCheck=z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),z.CUSTOM_ELEMENT_HANDLING&&typeof z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de&&(ke=!1),he&&(Ce=!0),bt&&(T=it({},T0),I=[],bt.html===!0&&(it(T,E0),it(I,P0)),bt.svg===!0&&(it(T,sg),it(I,og),it(I,fm)),bt.svgFilters===!0&&(it(T,ag),it(I,og),it(I,fm)),bt.mathMl===!0&&(it(T,ig),it(I,R0),it(I,fm))),z.ADD_TAGS&&(typeof z.ADD_TAGS=="function"?_e.tagCheck=z.ADD_TAGS:(T===q&&(T=Ds(T)),it(T,z.ADD_TAGS,vt))),z.ADD_ATTR&&(typeof z.ADD_ATTR=="function"?_e.attributeCheck=z.ADD_ATTR:(I===Y&&(I=Ds(I)),it(I,z.ADD_ATTR,vt))),z.ADD_URI_SAFE_ATTR&&it(pn,z.ADD_URI_SAFE_ATTR,vt),z.FORBID_CONTENTS&&(pt===kn&&(pt=Ds(pt)),it(pt,z.FORBID_CONTENTS,vt)),z.ADD_FORBID_CONTENTS&&(pt===kn&&(pt=Ds(pt)),it(pt,z.ADD_FORBID_CONTENTS,vt)),st&&(T["#text"]=!0),X&&it(T,["html","head","body"]),T.table&&(it(T,["tbody"]),delete se.tbody),z.TRUSTED_TYPES_POLICY){if(typeof z.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ac('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ac('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');j=z.TRUSTED_TYPES_POLICY,N=j.createHTML("")}else j===void 0&&(j=ZU(p,a)),j!==null&&typeof N=="string"&&(N=j.createHTML(""));sr&&sr(z),Vt=z}},Br=it({},[...sg,...ag,...$U]),na=it({},[...ig,...zU]),An=function(z){let ge=y(z);(!ge||!ge.tagName)&&(ge={namespaceURI:J,tagName:"template"});const Ee=zm(z.tagName),Et=zm(ge.tagName);return V[z.namespaceURI]?z.namespaceURI===kr?ge.namespaceURI===Wt?Ee==="svg":ge.namespaceURI===Cn?Ee==="svg"&&(Et==="annotation-xml"||Ae[Et]):!!Br[Ee]:z.namespaceURI===Cn?ge.namespaceURI===Wt?Ee==="math":ge.namespaceURI===kr?Ee==="math"&&$e[Et]:!!na[Ee]:z.namespaceURI===Wt?ge.namespaceURI===kr&&!$e[Et]||ge.namespaceURI===Cn&&!Ae[Et]?!1:!na[Ee]&&(Ve[Ee]||!Br[Ee]):!!(gt==="application/xhtml+xml"&&V[z.namespaceURI]):!1},dr=function(z){kc(t.removed,{element:z});try{y(z).removeChild(z)}catch{b(z)}},ra=function(z,ge){try{kc(t.removed,{attribute:ge.getAttributeNode(z),from:ge})}catch{kc(t.removed,{attribute:null,from:ge})}if(ge.removeAttribute(z),z==="is")if(Ce||he)try{dr(ge)}catch{}else try{ge.setAttribute(z,"")}catch{}},Cu=function(z){let ge=null,Ee=null;if(te)z="<remove></remove>"+z;else{const en=rg(z,/^[\r\n\t ]+/);Ee=en&&en[0]}gt==="application/xhtml+xml"&&J===Wt&&(z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+z+"</body></html>");const Et=j?j.createHTML(z):z;if(J===Wt)try{ge=new f().parseFromString(Et,gt)}catch{}if(!ge||!ge.documentElement){ge=k.createDocument(J,"template",null);try{ge.documentElement.innerHTML=ae?N:Et}catch{}}const gn=ge.body||ge.documentElement;return z&&Ee&&gn.insertBefore(n.createTextNode(Ee),gn.childNodes[0]||null),J===Wt?$.call(ge,X?"html":"body")[0]:X?ge.documentElement:gn},Au=function(z){return _.call(z.ownerDocument||z,z,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},uc=function(z){return z instanceof h&&(typeof z.nodeName!="string"||typeof z.textContent!="string"||typeof z.removeChild!="function"||!(z.attributes instanceof u)||typeof z.removeAttribute!="function"||typeof z.setAttribute!="function"||typeof z.namespaceURI!="string"||typeof z.insertBefore!="function"||typeof z.hasChildNodes!="function")},Eu=function(z){return typeof l=="function"&&z instanceof l};function ss(Oe,z,ge){hm(Oe,Ee=>{Ee.call(t,z,ge,Vt)})}const Tu=function(z){let ge=null;if(ss(O.beforeSanitizeElements,z,null),uc(z))return dr(z),!0;const Ee=vt(z.nodeName);if(ss(O.uponSanitizeElement,z,{tagName:Ee,allowedTags:T}),R&&z.hasChildNodes()&&!Eu(z.firstElementChild)&&Xn(/<[/\w!]/g,z.innerHTML)&&Xn(/<[/\w!]/g,z.textContent)||z.nodeType===Tc.progressingInstruction||R&&z.nodeType===Tc.comment&&Xn(/<[/\w]/g,z.data))return dr(z),!0;if(!(_e.tagCheck instanceof Function&&_e.tagCheck(Ee))&&(!T[Ee]||se[Ee])){if(!se[Ee]&&Ru(Ee)&&(ie.tagNameCheck instanceof RegExp&&Xn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee)))return!1;if(st&&!pt[Ee]){const Et=y(z)||z.parentNode,gn=g(z)||z.childNodes;if(gn&&Et){const en=gn.length;for(let Un=en-1;Un>=0;--Un){const as=v(gn[Un],!0);as.__removalCount=(z.__removalCount||0)+1,Et.insertBefore(as,x(z))}}}return dr(z),!0}return z instanceof c&&!An(z)||(Ee==="noscript"||Ee==="noembed"||Ee==="noframes")&&Xn(/<\/no(script|embed|frames)/i,z.innerHTML)?(dr(z),!0):(de&&z.nodeType===Tc.text&&(ge=z.textContent,hm([A,U,W],Et=>{ge=Cc(ge,Et," ")}),z.textContent!==ge&&(kc(t.removed,{element:z.cloneNode()}),z.textContent=ge)),ss(O.afterSanitizeElements,z,null),!1)},Pu=function(z,ge,Ee){if(Nt&&(ge==="id"||ge==="name")&&(Ee in n||Ee in cr))return!1;if(!(ke&&!pe[ge]&&Xn(E,ge))){if(!(Pe&&Xn(S,ge))){if(!(_e.attributeCheck instanceof Function&&_e.attributeCheck(ge,z))){if(!I[ge]||pe[ge]){if(!(Ru(z)&&(ie.tagNameCheck instanceof RegExp&&Xn(ie.tagNameCheck,z)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(z))&&(ie.attributeNameCheck instanceof RegExp&&Xn(ie.attributeNameCheck,ge)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(ge,z))||ge==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&Xn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee))))return!1}else if(!pn[ge]){if(!Xn(F,Cc(Ee,C,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&z!=="script"&&OU(Ee,"data:")===0&&Ot[z])){if(!(Re&&!Xn(L,Cc(Ee,C,"")))){if(Ee)return!1}}}}}}}return!0},Ru=function(z){return z!=="annotation-xml"&&rg(z,D)},Mu=function(z){ss(O.beforeSanitizeAttributes,z,null);const{attributes:ge}=z;if(!ge||uc(z))return;const Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0};let Et=ge.length;for(;Et--;){const gn=ge[Et],{name:en,namespaceURI:Un,value:as}=gn,Pa=vt(en),mc=as;let En=en==="value"?mc:IU(mc);if(Ee.attrName=Pa,Ee.attrValue=En,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,ss(O.uponSanitizeAttribute,z,Ee),En=Ee.attrValue,dt&&(Pa==="id"||Pa==="name")&&(ra(en,z),En=Ze+En),R&&Xn(/((--!?|])>)|<\/(style|title|textarea)/i,En)){ra(en,z);continue}if(Pa==="attributename"&&rg(En,"href")){ra(en,z);continue}if(Ee.forceKeepAttr)continue;if(!Ee.keepAttr){ra(en,z);continue}if(!De&&Xn(/\/>/i,En)){ra(en,z);continue}de&&hm([A,U,W],me=>{En=Cc(En,me," ")});const Du=vt(z.nodeName);if(!Pu(Du,Pa,En)){ra(en,z);continue}if(j&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Un)switch(p.getAttributeType(Du,Pa)){case"TrustedHTML":{En=j.createHTML(En);break}case"TrustedScriptURL":{En=j.createScriptURL(En);break}}if(En!==mc)try{Un?z.setAttributeNS(Un,en,En):z.setAttribute(en,En),uc(z)?dr(z):A0(t.removed)}catch{ra(en,z)}}ss(O.afterSanitizeAttributes,z,null)},ep=function Oe(z){let ge=null;const Ee=Au(z);for(ss(O.beforeSanitizeShadowDOM,z,null);ge=Ee.nextNode();)ss(O.uponSanitizeShadowNode,ge,null),Tu(ge),Mu(ge),ge.content instanceof i&&Oe(ge.content);ss(O.afterSanitizeShadowDOM,z,null)};return t.sanitize=function(Oe){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,Ee=null,Et=null,gn=null;if(ae=!Oe,ae&&(Oe="<!-->"),typeof Oe!="string"&&!Eu(Oe))if(typeof Oe.toString=="function"){if(Oe=Oe.toString(),typeof Oe!="string")throw Ac("dirty is not a string, aborting")}else throw Ac("toString is not a function");if(!t.isSupported)return Oe;if(ue||Ur(z),t.removed=[],typeof Oe=="string"&&(Ke=!1),Ke){if(Oe.nodeName){const as=vt(Oe.nodeName);if(!T[as]||se[as])throw Ac("root node is forbidden and cannot be sanitized in-place")}}else if(Oe instanceof l)ge=Cu("<!---->"),Ee=ge.ownerDocument.importNode(Oe,!0),Ee.nodeType===Tc.element&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?ge=Ee:ge.appendChild(Ee);else{if(!Ce&&!de&&!X&&Oe.indexOf("<")===-1)return j&&Be?j.createHTML(Oe):Oe;if(ge=Cu(Oe),!ge)return Ce?null:Be?N:""}ge&&te&&dr(ge.firstChild);const en=Au(Ke?Oe:ge);for(;Et=en.nextNode();)Tu(Et),Mu(Et),Et.content instanceof i&&ep(Et.content);if(Ke)return Oe;if(Ce){if(he)for(gn=P.call(ge.ownerDocument);ge.firstChild;)gn.appendChild(ge.firstChild);else gn=ge;return(I.shadowroot||I.shadowrootmode)&&(gn=M.call(s,gn,!0)),gn}let Un=X?ge.outerHTML:ge.innerHTML;return X&&T["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&Xn(GA,ge.ownerDocument.doctype.name)&&(Un="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
540`+Un),de&&hm([A,U,W],as=>{Un=Cc(Un,as," ")}),j&&Be?j.createHTML(Un):Un},t.setConfig=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ur(Oe),ue=!0},t.clearConfig=function(){Vt=null,ue=!1},t.isValidAttribute=function(Oe,z,ge){Vt||Ur({});const Ee=vt(Oe),Et=vt(z);return Pu(Ee,Et,ge)},t.addHook=function(Oe,z){typeof z=="function"&&kc(O[Oe],z)},t.removeHook=function(Oe,z){if(z!==void 0){const ge=MU(O[Oe],z);return ge===-1?void 0:DU(O[Oe],ge,1)[0]}return A0(O[Oe])},t.removeHooks=function(Oe){O[Oe]=[]},t.removeAllHooks=function(){O=D0()},t}var ZA=KA();const XU=["strong","b","em","i","u","s","strike","span","br","p","ul","ol","li","a"],QU=["style","class","href","target","rel"],JU=["color","background-color","font-weight","font-style","text-decoration","font-size"];function pl(e){return e&&ZA.sanitize(e,{ALLOWED_TAGS:XU,ALLOWED_ATTR:QU,ALLOW_DATA_ATTR:!1,ADD_ATTR:["target","rel"]})}ZA.addHook("afterSanitizeAttributes",e=>{if(e.tagName==="A"&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")),e.hasAttribute("style")){const n=(e.getAttribute("style")||"").split(";").filter(s=>{var i;const a=(i=s.split(":")[0])==null?void 0:i.trim().toLowerCase();return a&&JU.includes(a)}).join(";");n?e.setAttribute("style",n):e.removeAttribute("style")}});const eB={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&ndash;":"–","&mdash;":"—","&lsquo;":"‘","&rsquo;":"’","&ldquo;":"“","&rdquo;":"”","&bull;":"•","&hellip;":"…","&copy;":"©","&reg;":"®","&trade;":"™","&euro;":"€","&pound;":"£","&yen;":"¥","&cent;":"¢","&deg;":"°","&plusmn;":"±","&times;":"×","&divide;":"÷","&frac12;":"½","&frac14;":"¼","&frac34;":"¾"};function gl(e){if(!e)return e;let t=e;t=t.replace(/&#(\d+);/g,(n,s)=>{const a=parseInt(s,10);return a>=32&&a<=126||a>=160&&a<=255||a>=8192&&a<=8303?String.fromCharCode(a):`&#${s};`}),t=t.replace(/&#x([0-9A-Fa-f]+);/g,(n,s)=>{const a=parseInt(s,16);return a>=32&&a<=126||a>=160&&a<=255||a>=8192&&a<=8303?String.fromCharCode(a):`&#x${s};`});for(const[n,s]of Object.entries(eB))t=t.split(n).join(s);return t}const tB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nB=(e,t,n)=>{let s;const a=tB[e];
vendor: 19,272 bytes, line 540
540return typeof a=="string"?s=a:t===1?s=a.one:s=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function lg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iB={date:lg({formats:rB,defaultWidth:"full"}),time:lg({formats:sB,defaultWidth:"full"}),dateTime:lg({formats:aB,defaultWidth:"full"})},oB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lB=(e,t,n,s)=>oB[e];function Pc(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let a;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const cB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pB=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gB={ordinalNumber:pB,era:Pc({values:cB,defaultWidth:"wide"}),quarter:Pc({values:dB,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Pc({values:uB,defaultWidth:"wide"}),day:Pc({values:mB,defaultWidth:"wide"}),dayPeriod:Pc({values:hB,defaultWidth:"wide",formattingValues:fB,defaultFormattingWidth:"wide"})};function Rc(e){return(t,n={})=>{const s=n.width,a=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?vB(l,h=>h.test(o)):xB(l,h=>h.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function xB(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vB(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yB(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const a=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const wB=/^(\d+)(th|st|nd|rd)?/i,bB=/\d+/i,jB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},_B={any:[/^b/i,/^(a|c)/i]},NB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},SB={any:[/1/i,/2/i,/3/i,/4/i]},kB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},CB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},AB={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},TB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},PB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},RB={ordinalNumber:yB({matchPattern:wB,parsePattern:bB,valueCallback:e=>parseInt(e,10)}),era:Rc({matchPatterns:jB,defaultMatchWidth:"wide",parsePatterns:_B,defaultParseWidth:"any"}),quarter:Rc({matchPatterns:NB,defaultMatchWidth:"wide",parsePatterns:SB,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rc({matchPatterns:kB,defaultMatchWidth:"wide",parsePatterns:CB,defaultParseWidth:"any"}),day:Rc({matchPatterns:AB,defaultMatchWidth:"wide",parsePatterns:EB,defaultParseWidth:"any"}),dayPeriod:Rc({matchPatterns:TB,defaultMatchWidth:"any",parsePatterns:PB,defaultParseWidth:"any"})},fw={code:"en-US",formatDistance:nB,formatLong:iB,formatRelative:lB,localize:gB,match:RB,options:{weekStartsOn:0,firstWeekContainsDate:1}};let MB={};function So(){return MB}const pw=6048e5,DB=864e5,gw=6e4,xw=36e5,pm=43200,O0=1440;function We(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Fl(e){const t=We(e);return t.setHours(0,0,0,0),t}function $l(e){const t=We(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function xs(e,t){const n=Fl(e),s=Fl(t),a=+n-$l(n),i=+s-$l(s);return Math.round((a-i)/DB)}function _r(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function XA(e){const t=We(e),n=_r(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function OB(e){const t=We(e);return xs(t,XA(t))+1}function Zs(e,t){var l,c,d,u;const n=So(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=We(e),i=a.getDay(),o=(i<s?7:0)+i-s;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function mo(e){return Zs(e,{weekStartsOn:1})}function QA(e){const t=We(e),n=t.getFullYear(),s=_r(e,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const a=mo(s),i=_r(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=mo(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function IB(e){const t=QA(e),n=_r(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),mo(n)}function JA(e){const t=We(e),n=+mo(t)-+IB(t);return Math.round(n/pw)+1}function e2(e,t){var u,h,f,p;const n=We(e),s=n.getFullYear(),a=So(),i=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=_r(e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=Zs(o,t),c=_r(e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const d=Zs(c,t);return n.getTime()>=l.getTime()?s+1:n.getTime()>=d.getTime()?s:s-1}function LB(e,t){var l,c,d,u;const n=So(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=e2(e,t),i=_r(e,0);return i.setFullYear(a,0,s),i.setHours(0,0,0,0),Zs(i,t)}function t2(e,t){const n=We(e),s=+Zs(n,t)-+LB(n,t);return Math.round(s/pw)+1}function kt(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Ia={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return kt(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),a=Math.trunc(s*Math.pow(10,n-3));return kt(a,t.length)}},$o={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},I0={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),a=s>0?s:1-s;return n.ordinalNumber(a,{unit:"year"})}return Ia.y(e,t)},Y:function(e,t,n,s){const a=e2(e,s),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return kt(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):kt(i,t.length)},R:function(e,t){const n=QA(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return kt(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return kt(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Ia.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return kt(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const a=t2(e,s);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):kt(a,t.length)},I:function(e,t,n){const s=JA(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):kt(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ia.d(e,t)},D:function(e,t,n){const s=OB(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):kt(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return kt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return kt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),a=s===0?7:s;switch(t){case"i":return String(a);case"ii":return kt(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let a;switch(s===12?a=$o.noon:s===0?a=$o.midnight:a=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let a;switch(s>=17?a=$o.evening:s>=12?a=$o.afternoon:s>=4?a=$o.morning:a=$o.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ia.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ia.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):kt(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):kt(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ia.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ia.s(e,t)},S:function(e,t){return Ia.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return F0(s);case"XXXX":case"XX":return Wi(s);case"XXXXX":case"XXX":default:return Wi(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return F0(s);case"xxxx":case"xx":return Wi(s);case"xxxxx":case"xxx":default:return Wi(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+L0(s,":");case"OOOO":default:return"GMT"+Wi(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+L0(s,":");case"zzzz":default:return"GMT"+Wi(s,":")}},t:function(e,t,n){const s=Math.trunc(e.getTime()/1e3);return kt(s,t.length)},T:function(e,t,n){const s=e.getTime();return kt(s,t.length)}};function L0(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=Math.trunc(s/60),i=s%60;return i===0?n+String(a):n+String(a)+t+kt(i,2)}function F0(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):Wi(e,t)}function Wi(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=kt(Math.trunc(s/60),2),i=kt(s%60,2);return n+a+t+i}const $0=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},n2=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},FB=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],a=n[2];if(!a)return $0(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",$0(s,t)).replace("{{time}}",n2(a,t))},$B={p:n2,P:FB},zB=/^D+$/,UB=/^Y+$/,BB=["D","DD","YY","YYYY"];function HB(e){return zB.test(e)}function WB(e){return UB.test(e)}function qB(e,t,n){const s=VB(e,t,n);if(console.warn(s),BB.includes(e))throw new RangeError(s)}function VB(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function vw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function YB(e){if(!vw(e)&&typeof e!="number")return!1;const t=We(e);return!isNaN(Number(t))}const GB=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KB=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZB=/^'([^]*?)'?$/,XB=/''/g,QB=/[a-zA-Z]/;function an(e,t,n){var u,h,f,p,w,v,b,x;const s=So(),a=(n==null?void 0:n.locale)??s.locale??fw,i=(n==null?void 0:n.firstWeekContainsDate)??((h=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((x=(b=s.locale)==null?void 0:b.options)==null?void 0:x.weekStartsOn)??0,l=We(e);if(!YB(l))throw new RangeError("Invalid time value");let c=t.match(KB).map(g=>{const y=g[0];if(y==="p"||y==="P"){const j=$B[y];return j(g,a.formatLong)}return g}).join("").match(GB).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:JB(g)};if(I0[y])return{isToken:!0,value:g};
540if(y.match(QB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const y=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&WB(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&HB(y))&&qB(y,t,String(e));const j=I0[y[0]];return j(l,y,a.localize,d)}).join("")}function JB(e){const t=e.match(ZB);return t?t[1].replace(XB,"'"):e}function er(e,t){const n=We(e);return isNaN(t)?_r(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function As(e,t){const n=We(e);if(isNaN(t))return _r(e,NaN);if(!t)return n;const s=n.getDate(),a=_r(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const i=a.getDate();return s>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),s),n)}function uv(e,t){const n=t*7;return er(e,n)}function e9(e,t){return As(e,t*12)}function t9(e){let t;return e.forEach(function(n){const s=We(n);(t===void 0||t<s||isNaN(Number(s)))&&(t=s)}),t||new Date(NaN)}function n9(e){let t;return e.forEach(n=>{const s=We(n);(!t||t>s||isNaN(+s))&&(t=s)}),t||new Date(NaN)}function Um(e,t){const n=We(e),s=We(t),a=n.getTime()-s.getTime();return a<0?-1:a>0?1:a}function r9(e){return _r(e,Date.now())}function gr(e,t){const n=Fl(e),s=Fl(t);return+n==+s}function zl(e,t){const n=We(e),s=We(t),a=n.getFullYear()-s.getFullYear(),i=n.getMonth()-s.getMonth();return a*12+i}function s9(e,t,n){const s=Zs(e,n),a=Zs(t,n),i=+s-$l(s),o=+a-$l(a);return Math.round((i-o)/pw)}function r2(e,t){const n=We(e),s=We(t),a=z0(n,s),i=Math.abs(xs(n,s));n.setDate(n.getDate()-a*i);const o=+(z0(n,s)===-a),l=a*(i-o);return l===0?0:l}function z0(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function yw(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function ww(e,t){return+We(e)-+We(t)}function U0(e,t,n){const s=ww(e,t)/xw;return yw(n==null?void 0:n.roundingMethod)(s)}function B0(e,t,n){const s=ww(e,t)/gw;return yw(n==null?void 0:n.roundingMethod)(s)}function a9(e){const t=We(e);return t.setHours(23,59,59,999),t}function Hf(e){const t=We(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function i9(e){const t=We(e);return+a9(t)==+Hf(t)}function o9(e,t){const n=We(e),s=We(t),a=Um(n,s),i=Math.abs(zl(n,s));let o;if(i<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*i);let l=Um(n,s)===-a;i9(We(e))&&i===1&&Um(e,s)===1&&(l=!1),o=a*(i-Number(l))}return o===0?0:o}function l9(e,t,n){const s=ww(e,t)/1e3;return yw(n==null?void 0:n.roundingMethod)(s)}function br(e){const t=We(e);return t.setDate(1),t.setHours(0,0,0,0),t}function bw(e,t){var l,c,d,u;const n=So(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=We(e),i=a.getDay(),o=(i<s?-7:0)+6-(i-s);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function s2(e){return bw(e,{weekStartsOn:1})}function c9(e,t,n){const s=So(),a=(n==null?void 0:n.locale)??s.locale??fw,i=2520,o=Um(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,d;o>0?(c=We(t),d=We(e)):(c=We(e),d=We(t));const u=l9(d,c),h=($l(d)-$l(c))/1e3,f=Math.round((u-h)/60);let p;if(f<2)return n!=null&&n.includeSeconds?u<5?a.formatDistance("lessThanXSeconds",5,l):u<10?a.formatDistance("lessThanXSeconds",10,l):u<20?a.formatDistance("lessThanXSeconds",20,l):u<40?a.formatDistance("halfAMinute",0,l):u<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):f===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",f,l);if(f<45)return a.formatDistance("xMinutes",f,l);if(f<90)return a.formatDistance("aboutXHours",1,l);if(f<O0){const w=Math.round(f/60);return a.formatDistance("aboutXHours",w,l)}else{if(f<i)return a.formatDistance("xDays",1,l);if(f<pm){const w=Math.round(f/O0);return a.formatDistance("xDays",w,l)}else if(f<pm*2)return p=Math.round(f/pm),a.formatDistance("aboutXMonths",p,l)}if(p=o9(d,c),p<12){const w=Math.round(f/pm);return a.formatDistance("xMonths",w,l)}else{const w=p%12,v=Math.trunc(p/12);return w<3?a.formatDistance("aboutXYears",v,l):w<9?a.formatDistance("overXYears",v,l):a.formatDistance("almostXYears",v+1,l)}}function d9(e,t){return c9(e,r9(e),t)}function u9(e){const t=We(e),n=t.getFullYear(),s=t.getMonth(),a=_r(e,0);return a.setFullYear(n,s+1,0),a.setHours(0,0,0,0),a.getDate()}function m9(){return Object.assign({},So())}function h9(e){return Math.trunc(+We(e)/1e3)}function f9(e){const t=We(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function p9(e,t){return s9(f9(e),br(e),t)+1}function mv(e,t){const n=We(e),s=We(t);return n.getTime()>s.getTime()}function a2(e,t){const n=We(e),s=We(t);return+n<+s}function g9(e){return+We(e)<Date.now()}function jw(e,t){const n=We(e),s=We(t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function x9(e,t){const n=We(e),s=We(t);return n.getFullYear()===s.getFullYear()}function cg(e,t){return er(e,-t)}function di(e,t){const s=b9(e);let a;if(s.date){const c=j9(s.date,2);a=_9(c.restDateString,c.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,l;if(s.time&&(o=N9(s.time),isNaN(o)))return new Date(NaN);if(s.timezone){if(l=S9(s.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(i+o),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return new Date(i+o+l)}
vendor: 9,263 bytes, line 540
540const gm={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},v9=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,y9=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,w9=/^([+-])(\d{2})(?::?(\d{2}))?$/;function b9(e){const t={},n=e.split(gm.dateTimeDelimiter);let s;if(n.length>2)return t;if(/:/.test(n[0])?s=n[0]:(t.date=n[0],s=n[1],gm.timeZoneDelimiter.test(t.date)&&(t.date=e.split(gm.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){const a=gm.timezone.exec(s);a?(t.time=s.replace(a[1],""),t.timezone=a[1]):t.time=s}return t}function j9(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=e.match(n);if(!s)return{year:NaN,restDateString:""};const a=s[1]?parseInt(s[1]):null,i=s[2]?parseInt(s[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((s[1]||s[2]).length)}}function _9(e,t){if(t===null)return new Date(NaN);const n=e.match(v9);if(!n)return new Date(NaN);const s=!!n[4],a=Mc(n[1]),i=Mc(n[2])-1,o=Mc(n[3]),l=Mc(n[4]),c=Mc(n[5])-1;if(s)return T9(t,l,c)?k9(t,l,c):new Date(NaN);{const d=new Date(0);return!A9(t,i,o)||!E9(t,a)?new Date(NaN):(d.setUTCFullYear(t,i,Math.max(a,o)),d)}}function Mc(e){return e?parseInt(e):1}function N9(e){const t=e.match(y9);if(!t)return NaN;const n=dg(t[1]),s=dg(t[2]),a=dg(t[3]);return P9(n,s,a)?n*xw+s*gw+a*1e3:NaN}function dg(e){return e&&parseFloat(e.replace(",","."))||0}function S9(e){if(e==="Z")return 0;const t=e.match(w9);if(!t)return 0;const n=t[1]==="+"?-1:1,s=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return R9(s,a)?n*(s*xw+a*gw):NaN}function k9(e,t,n){const s=new Date(0);s.setUTCFullYear(e,0,4);const a=s.getUTCDay()||7,i=(t-1)*7+n+1-a;return s.setUTCDate(s.getUTCDate()+i),s}const C9=[31,null,31,30,31,30,31,31,30,31,30,31];function i2(e){return e%400===0||e%4===0&&e%100!==0}function A9(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(C9[t]||(i2(e)?29:28))}function E9(e,t){return t>=1&&t<=(i2(e)?366:365)}function T9(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function P9(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function R9(e,t){return t>=0&&t<=59}function ug(e,t){const n=We(e),s=n.getFullYear(),a=n.getDate(),i=_r(e,0);i.setFullYear(s,t,15),i.setHours(0,0,0,0);const o=u9(i);return n.setMonth(t,Math.min(a,o)),n}function H0(e,t){const n=We(e);return isNaN(+n)?_r(e,NaN):(n.setFullYear(t),n)}function W0(e,t,n){const s=m9(),a=O9(e,n.timeZone,n.locale??s.locale);return"formatToParts"in a?M9(a,t):D9(a,t)}function M9(e,t){const n=e.formatToParts(t);for(let s=n.length-1;s>=0;--s)if(n[s].type==="timeZoneName")return n[s].value}function D9(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/ [\w-+ ]+$/.exec(n);return s?s[0].substr(1):""}function O9(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function I9(e,t){const n=U9(t);return"formatToParts"in n?F9(n,e):$9(n,e)}const L9={year:0,month:1,day:2,hour:3,minute:4,second:5};function F9(e,t){try{const n=e.formatToParts(t),s=[];for(let a=0;a<n.length;a++){const i=L9[n[a].type];i!==void 0&&(s[i]=parseInt(n[a].value,10))}return s}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function $9(e,t){const n=e.format(t),s=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(s[3],10),parseInt(s[1],10),parseInt(s[2],10),parseInt(s[4],10),parseInt(s[5],10),parseInt(s[6],10)]}const mg={},q0=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),z9=q0==="06/25/2014, 00:00:00"||q0==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function U9(e){return mg[e]||(mg[e]=z9?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),mg[e]}function _w(e,t,n,s,a,i,o){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(s,a,i,o),l}const V0=36e5,B9=6e4,hg={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Wf(e,t,n){if(!e)return 0;let s=hg.timezoneZ.exec(e);if(s)return 0;let a,i;if(s=hg.timezoneHH.exec(e),s)return a=parseInt(s[1],10),Y0(a)?-(a*V0):NaN;if(s=hg.timezoneHHMM.exec(e),s){a=parseInt(s[2],10);const o=parseInt(s[3],10);return Y0(a,o)?(i=Math.abs(a)*V0+o*B9,s[1]==="+"?-i:i):NaN}if(q9(e)){t=new Date(t||Date.now());const o=n?t:H9(t),l=hv(o,e);return-(n?l:W9(t,l,e))}return NaN}function H9(e){return _w(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function hv(e,t){const n=I9(e,t),s=_w(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,s-a}function W9(e,t,n){let a=e.getTime()-t;const i=hv(new Date(a),n);if(t===i)return t;a-=i-t;const o=hv(new Date(a),n);return i===o?i:Math.max(i,o)}function Y0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const G0={};function q9(e){if(G0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),G0[e]=!0,!0}catch{return!1}}const V9=60*1e3,Y9={X:function(e,t,n){const s=fg(n.timeZone,e);if(s===0)return"Z";switch(t){case"X":return K0(s);case"XXXX":case"XX":return Bo(s);case"XXXXX":case"XXX":default:return Bo(s,":")}},x:function(e,t,n){const s=fg(n.timeZone,e);switch(t){case"x":return K0(s);case"xxxx":case"xx":return Bo(s);case"xxxxx":case"xxx":default:return Bo(s,":")}},O:function(e,t,n){const s=fg(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+G9(s,":");case"OOOO":default:return"GMT"+Bo(s,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return W0("short",e,n);case"zzzz":default:return W0("long",e,n)}}};function fg(e,t){const n=e?Wf(e,t,!0)/V9:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Eh(e,t){const n=e<0?"-":"";let s=Math.abs(e).toString();for(;s.length<t;)s="0"+s;return n+s}function Bo(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=Eh(Math.floor(s/60),2),i=Eh(Math.floor(s%60),2);return n+a+t+i}function K0(e,t){return e%60===0?(e>0?"-":"+")+Eh(Math.abs(e)/60,2):Bo(e,t)}function G9(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=Math.floor(s/60),i=s%60;return i===0?n+String(a):n+String(a)+t+Eh(i,2)}function Z0(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const o2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,pg=36e5,X0=6e4,K9=2,nr={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:o2};function Th(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?K9:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const s=Z9(e),{year:a,restDateString:i}=X9(s.date,n),o=Q9(i,a);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const l=o.getTime();let c=0,d;if(s.time&&(c=J9(s.time),c===null||isNaN(c)))return new Date(NaN);if(s.timeZone||t.timeZone){if(d=Wf(s.timeZone||t.timeZone,new Date(l+c)),isNaN(d))return new Date(NaN)}else d=Z0(new Date(l+c)),d=Z0(new Date(l+c+d));return new Date(l+c+d)}else return new Date(NaN)}function Z9(e){const t={};let n=nr.dateTimePattern.exec(e),s;if(n?(t.date=n[1],s=n[3]):(n=nr.datePattern.exec(e),n?(t.date=n[1],s=n[2]):(t.date=null,s=e)),s){const a=nr.timeZone.exec(s);a?(t.time=s.replace(a[1],""),t.timeZone=a[1].trim()):t.time=s}return t}function X9(e,t){if(e){const n=nr.YYY[t],s=nr.YYYYY[t];let a=nr.YYYY.exec(e)||s.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=nr.YY.exec(e)||n.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function Q9(e,t){if(t===null)return null;let n,s,a;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=nr.MM.exec(e);if(i)return n=new Date(0),s=parseInt(i[1],10)-1,J0(t,s)?(n.setUTCFullYear(t,s),n):new Date(NaN);if(i=nr.DDD.exec(e),i){n=new Date(0);const o=parseInt(i[1],10);return nH(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(i=nr.MMDD.exec(e),i){n=new Date(0),s=parseInt(i[1],10)-1;const o=parseInt(i[2],10);
540return J0(t,s,o)?(n.setUTCFullYear(t,s,o),n):new Date(NaN)}if(i=nr.Www.exec(e),i)return a=parseInt(i[1],10)-1,e_(a)?Q0(t,a):new Date(NaN);if(i=nr.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const o=parseInt(i[2],10)-1;return e_(a,o)?Q0(t,a,o):new Date(NaN)}return null}function J9(e){let t,n,s=nr.HH.exec(e);if(s)return t=parseFloat(s[1].replace(",",".")),gg(t)?t%24*pg:NaN;if(s=nr.HHMM.exec(e),s)return t=parseInt(s[1],10),n=parseFloat(s[2].replace(",",".")),gg(t,n)?t%24*pg+n*X0:NaN;if(s=nr.HHMMSS.exec(e),s){t=parseInt(s[1],10),n=parseInt(s[2],10);const a=parseFloat(s[3].replace(",","."));return gg(t,n,a)?t%24*pg+n*X0+a*1e3:NaN}return null}function Q0(e,t,n){t=t||0,n=n||0;const s=new Date(0);s.setUTCFullYear(e,0,4);const a=s.getUTCDay()||7,i=t*7+n+1-a;return s.setUTCDate(s.getUTCDate()+i),s}const eH=[31,28,31,30,31,30,31,31,30,31,30,31],tH=[31,29,31,30,31,30,31,31,30,31,30,31];function l2(e){return e%400===0||e%4===0&&e%100!==0}function J0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const s=l2(e);if(s&&n>tH[t]||!s&&n>eH[t])return!1}return!0}function nH(e,t){if(t<1)return!1;const n=l2(e);return!(n&&t>366||!n&&t>365)}function e_(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function gg(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const rH=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function sH(e,t,n={}){t=String(t);const s=t.match(rH);if(s){const a=Th(n.originalDate||e,n);t=s.reduce(function(i,o){if(o[0]==="'")return i;const l=i.indexOf(o),c=i[l-1]==="'",d=i.replace(o,"'"+Y9[o[0]](a,o,n)+"'");return c?d.substring(0,l-1)+d.substring(l+1):d},t)}return an(e,t,n)}function aH(e,t,n){e=Th(e,n);const s=Wf(t,e,!0),a=new Date(e.getTime()-s),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function iH(e,t,n,s){return s={...s,timeZone:t,originalDate:e},sH(aH(e,t,{timeZone:s.timeZone}),n,s)}function oH(e,t,n){if(typeof e=="string"&&!e.match(o2))return Th(e,{...n,timeZone:t});e=Th(e,n);const s=_w(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=Wf(t,new Date(s));return new Date(s+a)}const c2="Europe/Zurich";function rt(e,t){return iH(e,c2,t)}function Dc(e,t){const n=t?`${e}T${t}`:`${e}T00:00`;return oH(n,c2).toISOString()}const lH=()=>{const[e,t]=m.useState(""),[n,s]=m.useState(""),[a,i]=m.useState(""),[o,l]=m.useState(!1),{toast:c}=Sn(),{user:d,isMember:u,loading:h}=In(),f=async p=>{if(p.preventDefault(),!d||!u){c({title:"Authentication required",description:"You must be a member to submit a ride-along request",variant:"destructive"});return}if(!e||!n||!a){c({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}l(!0);try{const{data:{session:w}}=await K.auth.getSession();if(!w){c({title:"Session expired",description:"Please log in again",variant:"destructive"}),l(!1);return}const{data:v,error:b}=await K.functions.invoke("send-ride-along-request",{body:{email:d.email,location:e,yearOfStudies:n,age:a},headers:{Authorization:`Bearer ${w.access_token}`}});if(b)throw b;c({title:"Request submitted!",description:"We've received your ride-along request and will be in touch soon.",duration:8e3}),t(""),s(""),i("")}catch(w){console.error("Ride-along request error:",w),c({title:"Error",description:"Failed to submit request. Please try again.",variant:"destructive"})}finally{l(!1)}};return r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed mb-4",children:"As a SEMSA member, you can join a local EMS team for a supervised ride-along and experience prehospital care first-hand. You'll observe real-time clinical decision-making, teamwork under pressure, and the realities of emergency care in the field."}),r.jsx("p",{className:"text-md text-muted-foreground",children:"Due to varying organisational requirements of our partner EMS services, we ask for your age during registration to ensure appropriate placement."}),r.jsx("p",{className:"text-md text-muted-foreground",children:"Placements are limited and reserved for SEMSA members."})]}),r.jsx(B,{children:r.jsx(H,{className:"pt-6",children:h?r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):!d||!u?r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Bs,{className:"border-primary/50",children:[r.jsx(gh,{className:"h-4 w-4"}),r.jsx(sl,{children:"Members Only"}),r.jsx(Hs,{children:"This feature is exclusively available to SEMSA members. Please log in or become a member to request a ride-along opportunity."})]}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center max-w-md mx-auto",children:d?r.jsx(be,{to:"/member-dashboard",className:"flex-1",children:r.jsxs(G,{variant:"default",className:"w-full gap-2 shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:["Go to Dashboard",r.jsx(pr,{className:"h-4 w-4"})]})}):r.jsxs(r.Fragment,{children:[r.jsx(be,{to:"/auth",className:"flex-1",children:r.jsxs(G,{variant:"default",className:"w-full gap-2 shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:["Member Login",r.jsx(pr,{className:"h-4 w-4"})]})}),r.jsx(be,{to:"/membership",className:"flex-1",children:r.jsxs(G,{variant:"secondary",className:"w-full gap-2 shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:["Become a Member",r.jsx(pr,{className:"h-4 w-4"})]})})]})})]}
540):r.jsxs("form",{onSubmit:f,className:"max-w-md mx-auto space-y-4",children:[r.jsx("div",{children:r.jsx(xe,{type:"number",min:"16",max:"99",placeholder:"Your age",value:a,onChange:p=>i(p.target.value),disabled:o})}),r.jsx("div",{children:r.jsxs(mt,{value:n,onValueChange:s,disabled:o,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Year of studies you are currently in"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"1st year",children:"1st year"}),r.jsx(fe,{value:"2nd year",children:"2nd year"}),r.jsx(fe,{value:"3rd year",children:"3rd year"}),r.jsx(fe,{value:"4th year",children:"4th year"}),r.jsx(fe,{value:"5th year",children:"5th year"}),r.jsx(fe,{value:"6th year",children:"6th year"})]})]})}),r.jsx("div",{children:r.jsxs(mt,{value:e,onValueChange:t,disabled:o,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Choose your preferred location"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"zurich",children:"Zürich"}),r.jsx(fe,{value:"basel",children:"Basel"}),r.jsx(fe,{value:"aargau",children:"Aargau"}),r.jsx(fe,{value:"thurgau",children:"Thurgau"}),r.jsx(fe,{value:"stgallen",children:"St.Gallen"})]})]})}),r.jsx(G,{type:"submit",className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",disabled:o,children:o?"Submitting...":"Submit Request"})]})})})]})},cH="/assets/stewi-logo-3W_Zidpd.svg",dH=1,uH="193d99d7-eea6-4d8b-b979-d7b239c313ee",mH="83570890-54b0-41ca-9de9-10d29c6666a6",hH="/__l5e/assets-v1/193d99d7-eea6-4d8b-b979-d7b239c313ee/medventura-logo.png",fH="a/v1/83570890-54b0-41ca-9de9-10d29c6666a6/193d99d7-eea6-4d8b-b979-d7b239c313ee/medventura-logo.png",pH="medventura-logo.png",gH=11685,xH="image/png",vH="2026-09-12T18:34:18Z",yH={version:dH,asset_id:uH,project_id:mH,url:hH,r2_key:fH,original_filename:pH,size:gH,content_type:xH,created_at:vH},wH=m.lazy(()=>tc(()=>import("./EventsCalendarView-BK2fXWZ-.js"),[])),bH=()=>{const[e,t]=m.useState([]),[n,s]=m.useState(0),[a,i]=m.useState(!0),[o,l]=m.useState([]),[c,d]=m.useState(!0),[u,h]=m.useState([]),[f,p]=m.useState(null),[w,v]=m.useState(!0),[b,x]=m.useState([]),[g,y]=m.useState(!0),[j,N]=m.useState("list");Sn(),m.useEffect(()=>{k(),_(),P(),$(),K.rpc("auto_complete_past_sessions").then(()=>{},M=>console.error("auto_complete_past_sessions failed:",M))},[]);const k=async()=>{try{const{data:M,error:O,count:A}=await K.from("courses").select("*",{count:"exact"}).eq("status","upcoming").order("date",{ascending:!0}).limit(6);if(O)throw O;if(s(A||0),t(M||[]),i(!1),M&&M.length>0){const U=await Promise.all(M.map(async W=>{const{data:E,error:S}=await K.rpc("get_course_confirmed_count",{p_course_id:W.id});return S?W.current_participants??0:E??0}));t(M.map((W,E)=>({...W,current_participants:U[E]})))}}catch(M){console.error("Error fetching courses:",M)}finally{i(!1)}},_=async()=>{try{const{data:M,error:O}=await K.from("courses").select("id, name, date, end_date, region, location, is_members_only").eq("status","completed").order("date",{ascending:!1}).limit(30);if(O)throw O;l(M||[])}catch(M){console.error("Error fetching completed courses:",M)}finally{d(!1)}},P=async()=>{try{const{data:M,error:O}=await K.from("external_courses").select("*").eq("status","upcoming").order("date",{ascending:!0});if(O)throw O;const A=(M||[]).find(W=>W.name.includes("Schweizer Kongress für Notfallmedizin")),U=(M||[]).filter(W=>!W.name.includes("Schweizer Kongress für Notfallmedizin"));p(A||null),h(U)}catch(M){console.error("Error fetching external courses:",M)}finally{v(!1)}},$=async()=>{try{const{data:M,error:O}=await K.from("courses").select("id, name, date, region").eq("status","draft").eq("show_draft_preview",!0).order("date",{ascending:!0,nullsFirst:!1});if(O)throw O;const A=(M||[]).sort((U,W)=>{const E=U.date?new Date(U.date).getTime():1/0,S=W.date?new Date(W.date).getTime():1/0;return E-S});x(A)}catch(M){console.error("Error fetching preview courses:",M)}finally{y(!1)}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-12",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Events"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:"Join events to connect, learn and have hands-on training with other peers interested in emergency medicine"}),r.jsx("div",{className:"mt-8 flex justify-center",children:r.jsx(yi,{value:j,onValueChange:M=>N(M),children:r.jsxs(ka,{children:[r.jsxs(bn,{value:"list",className:"gap-2",children:[r.jsx(B4,{className:"h-4 w-4"}),"List View"]}),r.jsxs(bn,{value:"calendar",className:"gap-2",children:[r.jsx(su,{className:"h-4 w-4"}),"Calendar View"]})]})})})]}),j==="calendar"&&r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold mb-8 text-center",children:"Course Calendar"}),a||w||c?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading events..."})}
540):r.jsx(m.Suspense,{fallback:r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading calendar..."})}),children:r.jsx(wH,{courses:e,externalCourses:u,completedCourses:o})})]}),j==="list"&&r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold mb-8 text-center",children:"Up Next"}),a?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading courses..."})}):e.length===0?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"No upcoming courses at the moment. Check back soon!"})}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex flex-wrap justify-center gap-6 mb-8",children:e.map(M=>{const O=M.profession_limits,A=M.max_participants||(O&&Object.keys(O).length>0?Object.values(O).reduce((E,S)=>E+(S||0),0):null),U=A&&M.current_participants>=A,W=A?A-M.current_participants:null;return r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsxs(ne,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsx(re,{className:"text-xl",children:M.name}),M.is_members_only&&!M.public_registration_opens_at&&r.jsx(Me,{variant:"secondary",children:"Members Only"})]}),r.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",dangerouslySetInnerHTML:{__html:pl(gl(M.description||"Join us for this exciting course."))}})]}),r.jsxs(H,{className:"flex-grow space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Tr,{className:"h-4 w-4"}),r.jsxs("span",{children:[rt(new Date(M.date),"dd.MM.yyyy"),M.time&&r.jsxs("span",{children:[" at ",M.time]}),M.end_date&&r.jsxs("span",{children:[" ","- ",rt(new Date(M.end_date),"dd.MM.yyyy"),M.end_date&&new Date(M.end_date).getHours()!==0&&r.jsxs("span",{children:[" at ",rt(new Date(M.end_date),"HH:mm")]})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Rn,{className:"h-4 w-4"}),r.jsxs("span",{children:[M.location,M.region?` (${M.region})`:""]})]}),A&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{className:U?"text-destructive font-medium":"text-muted-foreground",children:U?"Course Full":`${W} spot${W!==1?"s":""} remaining`})]})]}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx(be,{to:`/courses/${M.id}`,className:"w-full block",children:r.jsx(G,{className:`w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all ${U?"text-primary":""}`,variant:U?"secondary":"default",children:U?"Join Waiting List":"View Details & Register"})})})]},M.id)})}),n>6&&r.jsx("div",{className:"text-center",children:r.jsx(be,{to:"/courses",children:r.jsx(G,{size:"lg",className:"shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"View All Courses"})})})]})]}),f&&r.jsx("section",{className:"mb-16",children:r.jsx("div",{className:"flex flex-wrap justify-center gap-6",children:r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsxs(ne,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsx(re,{className:"text-xl",children:f.name}),r.jsx(Me,{variant:"outline",children:"Partner Event"})]}),f.description&&r.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 whitespace-pre-line",dangerouslySetInnerHTML:{__html:pl(gl(f.description))}})]}),r.jsxs(H,{className:"flex-grow space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Tr,{className:"h-4 w-4"}),r.jsxs("span",{children:[rt(new Date(f.date),"dd.MM.yyyy"),f.time&&r.jsxs("span",{children:[" at ",f.time]}),f.end_date&&r.jsxs("span",{children:[" - ",rt(new Date(f.end_date),"dd.MM.yyyy")]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Rn,{className:"h-4 w-4"}),r.jsx("span",{children:f.region})]})]}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx(be,{to:`/external-courses/${f.id}`,className:"w-full block",children:r.jsx(G,{className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"View Details & Register"})})})]})})}),b.length>0&&r.jsxs("section",{className:"mb-16",children:[r.jsx("p",{className:"text-center text-muted-foreground mb-8 text-lg",children:"Coming soon"}),r.jsx("div",{className:"flex flex-wrap justify-center items-stretch gap-4 max-w-5xl mx-auto",children:b.map(M=>{const A=M.date&&!isNaN(new Date(M.date).getTime())?rt(new Date(M.date),"dd.MM.yyyy"):"To be announced",U=M.region||"To be announced";return r.jsx(B,{className:"overflow-hidden w-48 min-h-[140px] shadow-elevation-low",children:r.jsxs(H,{
540className:"p-4 flex flex-col h-full min-h-[140px]",children:[r.jsx("h3",{className:"font-semibold text-sm mb-2 min-h-[40px]",children:M.name}),r.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground mt-auto",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Tr,{className:"w-3 h-3"}),r.jsx("span",{children:A})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rn,{className:"w-3 h-3"}),r.jsx("span",{children:U})]})]})]})},M.id)})})]}),r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold mb-4 text-center",children:"Training Opportunities from Our Partners"}),r.jsx("p",{className:"text-center text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Additional courses and training opportunities in emergency medicine"}),w?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading external courses..."})}):r.jsxs("div",{className:"flex flex-wrap justify-center gap-6",children:[u.map(M=>r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-xl",children:M.name})}),r.jsxs(H,{className:"flex-grow",children:[M.description&&r.jsx("p",{className:"text-muted-foreground text-sm mb-4 whitespace-pre-line",dangerouslySetInnerHTML:{__html:pl(gl(M.description))}}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx(Tr,{className:"h-4 w-4"}),r.jsxs("span",{children:[rt(new Date(M.date),"dd.MM.yyyy"),M.end_date&&r.jsxs("span",{children:[" - ",rt(new Date(M.end_date),"dd.MM.yyyy")]}),M.time&&r.jsxs("span",{children:[" at ",M.time]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx(Rn,{className:"h-4 w-4"}),r.jsx("span",{children:M.region})]}),r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx(P4,{className:"h-4 w-4"}),r.jsx("span",{children:M.provider})]})]})]}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx("a",{href:M.website_url,target:"_blank",rel:"noopener noreferrer",children:r.jsx(G,{className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"View Details"})})})]},M.id)),r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-xl",children:"Medventura"}),r.jsx("img",{src:yH.url,alt:"Medventura",className:"h-16 w-auto object-contain mb-2",loading:"lazy",decoding:"async"})]}),r.jsx(H,{className:"flex-grow",children:r.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Exciting courses on emergency and rescue medicine for medical students. Combining medicine with adventure."})}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx("a",{href:"https://www.medventura.ch",target:"_blank",rel:"noopener noreferrer",children:r.jsx(G,{className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"Visit Website"})})})]}),r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-xl",children:"STEWI"}),r.jsx("img",{src:cH,alt:"STEWI",className:"h-16 w-auto object-contain mb-2",loading:"lazy",decoding:"async"})]}),r.jsx(H,{className:"flex-grow",children:r.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Emergency weekends and training sessions promoting emergency medicine skills among paramedic and medical students."})}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx("a",{href:"https://thestewi.ch/",target:"_blank",rel:"noopener noreferrer",children:r.jsx(G,{className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"Visit Website"})})})]}),r.jsxs(B,{className:"flex flex-col shadow-elevation-medium w-full max-w-sm",children:[r.jsxs(ne,{children:[r.jsx(re,{className:"text-xl",children:"SIRMED"}),r.jsx("img",{src:uC.url,alt:"SIRMED",className:"h-16 w-auto object-contain mb-2",loading:"lazy",decoding:"async"})]}),r.jsx(H,{className:"flex-grow",children:r.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Swiss Institute of Emergency Medicine offering webinars and booster trainings for professionals in prehospital and emergency care."})}),r.jsx("div",{className:"p-6 pt-0",children:r.jsx("a",{href:"https://www.paraplegie.ch/sirmed/de/professionals/wissen/webinare-und-booster-fuer-profis/",target:"_blank",rel:"noopener noreferrer",children:r.jsx(G,{className:"w-full shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:"Visit Website"})})})]})]})]})]}),r.jsxs("section",{className:"mb-16",children:[r.jsxs("h2",{className:"text-3xl md:text-4xl font-bold text-foreground mb-8 flex items-center justify-center gap-3",children:[r.jsx(hh,{className:"h-8 w-8 text-primary"}),"Ride Along Opportunities"]}),r.jsx(lH,{})]}),r.jsxs("section",{className:"mb-16",children:[r.jsx("h2",{className:"text-3xl font-bold mb-8 text-center",children:"Past Events"}),r.jsxs("div",{className:"flex flex-wrap justify-center items-stretch gap-4 max-w-4xl mx-auto",children:[o.map(M=>{const A={"2c05f2cf-a285-46ce-8179-0a6b8bdd5bd1":"https://www.instagram.com/p/DR5MXvriBSU/?utm_source=ig_web_copy_link&igsh=NTc4MTIwNjQ2YQ=="}[M.id],U=r.jsx(B,{className:`overflow-hidden h-full ${A?"shadow-elevation-low hover:shadow-elevation-medium hover:-translate-y-0.5 transition-all cursor-pointer":""}
540`,children:r.jsxs(H,{className:"p-4 flex flex-col h-full",children:[M.is_members_only&&r.jsx(Me,{variant:"secondary",className:"w-fit mb-2 text-xs",children:"Members Only"}),r.jsx("h3",{className:"font-semibold text-sm mb-2 flex-grow",children:M.name}),r.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground mt-auto",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Tr,{className:"w-3 h-3"}),r.jsx("span",{children:rt(new Date(M.date),"dd.MM.yyyy")})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rn,{className:"w-3 h-3"}),r.jsx("span",{children:M.region||M.location})]})]})]})});return A?r.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"block w-48",children:U},M.id):r.jsx("div",{className:"w-48",children:U},M.id)}),r.jsx("a",{href:"https://www.instagram.com/p/DRsQv7oCD7f/?utm_source=ig_web_copy_link&igsh=MzRlODBiNWFlZA==",target:"_blank",rel:"noopener noreferrer",className:"block w-48",children:r.jsx(B,{className:"overflow-hidden h-full shadow-elevation-low hover:shadow-elevation-medium hover:-translate-y-0.5 transition-all cursor-pointer",children:r.jsxs(H,{className:"p-4 flex flex-col h-full",children:[r.jsx(Me,{variant:"secondary",className:"w-fit mb-2 text-xs",children:"Members Only"}),r.jsx("h3",{className:"font-semibold text-sm mb-2 flex-grow",children:"First Get-together"}),r.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground mt-auto",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Tr,{className:"w-3 h-3"}),r.jsx("span",{children:"30.11.2025"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rn,{className:"w-3 h-3"}),r.jsx("span",{children:"Zürich"})]})]})]})})})]})]}),r.jsx("section",{className:"py-20 bg-background",children:r.jsx("div",{className:"container mx-auto px-4 text-center",children:r.jsxs("div",{className:"max-w-3xl mx-auto",children:[r.jsx("h2",{className:"text-3xl lg:text-4xl font-bold text-foreground mb-6",children:"Follow for Updates"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"Follow us on Social Media to get all information about upcoming courses and registrations."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 justify-center items-center",children:[r.jsx("a",{href:"https://www.instagram.com/semsa_ch?igsh=OGloaGhnbzYxZ2xo&utm_source=qr",target:"_blank",rel:"noopener noreferrer",className:"group",children:r.jsxs(Ue,{className:"flex items-center gap-3",children:[r.jsx(Ty,{className:"h-5 w-5"}),"Follow on Instagram"]})}),r.jsx("a",{href:"https://www.linkedin.com/company/swiss-emergency-medicine-student-association-semsa/",target:"_blank",rel:"noopener noreferrer",className:"group",children:r.jsxs(Ue,{className:"flex items-center gap-3",children:[r.jsx(Py,{className:"h-5 w-5"}),"Connect on LinkedIn"]})})]})]})})})]}),r.jsx(qe,{})]})},jH=()=>{const[e,t]=m.useState([]),[n,s]=m.useState(!0),[a,i]=m.useState("date"),[o,l]=m.useState("all"),{toast:c}=Sn();m.useEffect(()=>{d()},[]);const d=async()=>{try{const{data:x,error:g}=await K.from("courses").select("*").eq("status","upcoming").order("date",{ascending:!0});if(g)throw g;const{data:y}=await K.from("course_sessions").select("*"),j=await Promise.all((x||[]).map(async N=>{const{data:k,error:_}=await K.rpc("get_course_confirmed_count",{p_course_id:N.id});let P={};if(N.profession_limits&&Object.keys(N.profession_limits).length>0){const{data:M}=await K.rpc("get_course_profession_counts",{p_course_id:N.id});M&&(P=M)}const $=y==null?void 0:y.find(M=>M.course_id_legacy===N.id);return{...N,max_participants:($==null?void 0:$.capacity)??N.max_participants,price:($==null?void 0:$.price)??N.price,confirmed_count:_?0:k??0,profession_counts:P}}));t(j)}catch(x){console.error("Error fetching courses:",x),c({title:"Error",description:"Failed to load courses. Please try again.",variant:"destructive"})}finally{s(!1)}},u=x=>x.max_participants?x.max_participants:x.profession_limits&&Object.keys(x.profession_limits).length>0?Object.values(x.profession_limits).reduce((g,y)=>g+(y||0),0):null,h=x=>{const g=u(x);return g?g-x.confirmed_count:null},f=x=>{const g=u(x);return g?x.confirmed_count>=g:!1},p=x=>{const g=new Date;if(x.registration_opens_at){const y=new Date(x.registration_opens_at);if(g<y)return!1}return!0},w=Array.from(new Set(e.map(x=>
540x.region).filter(Boolean))).sort(),b=[...o==="all"?e:e.filter(x=>x.region===o)].sort((x,g)=>{if(a==="date")return new Date(x.date).getTime()-new Date(g.date).getTime();{const y=x.region||"",j=g.region||"";return y.localeCompare(j)}});return r.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-8 flex-grow",children:[r.jsx("div",{className:"mb-6",children:r.jsx(be,{to:"/",children:r.jsxs(G,{variant:"ghost",className:"gap-2",children:[r.jsx(et,{className:"h-4 w-4"}),"Back"]})})}),r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("h1",{className:"text-4xl font-bold mb-4 text-foreground",children:"Upcoming Courses"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-6",children:"Enhance your emergency medicine skills with our curated selection of courses and training opportunities."}),r.jsxs("div",{className:"flex flex-wrap justify-center items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"Filter by region:"}),r.jsxs(mt,{value:o,onValueChange:l,children:[r.jsx(ot,{className:"w-[180px]",children:r.jsx(ht,{})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Regions"}),w.map(x=>r.jsx(fe,{value:x,children:x},x))]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"Sort by:"}),r.jsxs(mt,{value:a,onValueChange:x=>i(x),children:[r.jsx(ot,{className:"w-[180px]",children:r.jsx(ht,{})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"date",children:"Date"}),r.jsx(fe,{value:"region",children:"Region"})]})]})]})]})]}),n?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading courses..."})}):e.length===0?r.jsx("div",{className:"text-center py-12",children:r.jsx("p",{className:"text-muted-foreground",children:"No upcoming courses at the moment. Check back soon!"})}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12",children:b.map(x=>r.jsxs(B,{className:"flex flex-col",children:[r.jsxs(ne,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsx(re,{className:"text-xl",children:x.name}),r.jsxs("div",{className:"flex flex-col gap-1",children:[x.is_members_only&&!x.public_registration_opens_at&&r.jsx(Me,{variant:"secondary",children:"Members Only"}),!p(x)&&r.jsx(Me,{variant:"outline",children:"Registration Opens Soon"})]})]}),r.jsx(Pt,{className:"line-clamp-2 whitespace-pre-line",dangerouslySetInnerHTML:{__html:pl(gl(x.description||"Join us for this exciting course."))}})]}),r.jsxs(H,{className:"flex-grow space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Tr,{className:"h-4 w-4"}),r.jsxs("span",{children:[rt(new Date(x.date),"dd.MM.yyyy 'at' HH:mm"),x.end_date&&(rt(new Date(x.date),"yyyy-MM-dd")===rt(new Date(x.end_date),"yyyy-MM-dd")?` - ${rt(new Date(x.end_date),"HH:mm")}`:` - ${rt(new Date(x.end_date),"dd.MM.yyyy 'at' HH:mm")}`)]})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Rn,{className:"h-4 w-4"}),r.jsxs("span",{children:[x.location,x.region?` (${x.region})`:""]})]}),x.price&&x.price>0&&r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[r.jsx("span",{className:"font-bold",children:"CHF"}),r.jsx("span",{children:x.price.toFixed(2)})]}),x.profession_limits&&Object.keys(x.profession_limits).length>0?r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{className:"text-muted-foreground font-medium",children:"Spots by profession:"})]}),Object.entries(x.profession_limits).map(([g,y])=>{var k;const j=((k=x.profession_counts)==null?void 0:k[g])||0,N=Math.max(0,y-j);return r.jsxs("div",{className:"flex items-center justify-between text-sm pl-6",children:[r.jsx("span",{className:"text-muted-foreground",children:g}),r.jsx("span",{className:N<=0?"text-destructive font-medium":"text-muted-foreground",children:N<=0?"Full":`${N} spot${N!==1?"s":""}`})]},g)})]}):u(x)?r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{className:f(x)?"text-destructive font-medium":"text-muted-foreground",children:f(x)?"Course Full":`${h(x)} spot${h(x)!==1?"s":""} remaining`})]}):null]}),r.jsx(lC,{children:r.jsx(be,{to:`/courses/${x.id}`,className:"w-full",children:r.jsx(G,{className:"w-full",variant:f(x)?"secondary":"default",children:f(x)?"Join Waiting List":p(x)?"View Details & Register":"View Details"})})})]},x.id))})]}),r.jsx(qe,{})]})};var yt;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o}
vendor: 7,115 bytes, line 540
540,e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function s(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(yt||(yt={}));var fv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fv||(fv={}));const Se=yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Va=e=>{switch(typeof e){case"undefined":return Se.undefined;case"string":return Se.string;case"number":return isNaN(e)?Se.nan:Se.number;case"boolean":return Se.boolean;case"function":return Se.function;case"bigint":return Se.bigint;case"symbol":return Se.symbol;case"object":return Array.isArray(e)?Se.array:e===null?Se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Se.promise:typeof Map<"u"&&e instanceof Map?Se.map:typeof Set<"u"&&e instanceof Set?Se.set:typeof Date<"u"&&e instanceof Date?Se.date:Se.object;default:return Se.unknown}},ye=yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_H=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Or extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},s={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)s._errors.push(n(o));else{let l=s,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return a(this),s}static assert(t){if(!(t instanceof Or))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},s=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):s.push(t(a));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}Or.create=e=>new Or(e);const Ul=(e,t)=>{let n;switch(e.code){case ye.invalid_type:e.received===Se.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ye.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,yt.jsonStringifyReplacer)}`;break;case ye.unrecognized_keys:n=`Unrecognized key(s) in object: ${yt.joinValues(e.keys,", ")}`;break;case ye.invalid_union:n="Invalid input";break;case ye.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${yt.joinValues(e.options)}`;break;case ye.invalid_enum_value:n=`Invalid enum value. Expected ${yt.joinValues(e.options)}, received '${e.received}'`;break;case ye.invalid_arguments:n="Invalid function arguments";break;case ye.invalid_return_type:n="Invalid function return type";break;case ye.invalid_date:n="Invalid date";break;case ye.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ye.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ye.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ye.custom:n="Invalid input";break;case ye.invalid_intersection_types:n="Intersection results could not be merged";break;case ye.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ye.not_finite:n="Number must be finite";break;default:n=t.defaultError,yt.assertNever(e)}return{message:n}};let d2=Ul;function NH(e){d2=e}function Ph(){return d2}const Rh=e=>{const{data:t,path:n,errorMaps:s,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=s.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}},SH=[];function Ne(e,t){const n=Ph(),s=Rh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ul?void 0:Ul].filter(a=>!!a)});e.common.issues.push(s)}class Kn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const s=[];for(const a of n){if(a.status==="aborted")return Ge;a.status==="dirty"&&t.dirty(),s.push(a.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,n){const s=[];for(const a of n){const i=await a.key,o=await a.value;s.push({key:i,value:o})}return Kn.mergeObjectSync(t,s)}static mergeObjectSync(t,n){const s={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Ge;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const Ge=Object.freeze({status:"aborted"}),al=e=>({status:"dirty",value:e}),ir=e=>
vendor: 5,699 bytes, line 540
540({status:"valid",value:e}),pv=e=>e.status==="aborted",gv=e=>e.status==="dirty",Md=e=>e.status==="valid",Dd=e=>typeof Promise<"u"&&e instanceof Promise;function Mh(e,t,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function u2(e,t,n,s,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ie||(Ie={}));var Wc,qc;class Xs{constructor(t,n,s,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=s,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const t_=(e,t)=>{if(Md(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Or(e.common.issues);return this._error=n,this._error}}};function Qe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:s,description:a}=e;if(t&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{var c,d;const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:(c=u??s)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(d=u??n)!==null&&d!==void 0?d:l.defaultError}},description:a}}class nt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Va(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Kn,ctx:{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Dd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const s=this.safeParse(t,n);if(s.success)return s.data;throw s.error}safeParse(t,n){var s;const a={common:{issues:[],async:(s=n==null?void 0:n.async)!==null&&s!==void 0?s:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},i=this._parseSync({data:t,path:a.path,parent:a});return t_(a,i)}async parseAsync(t,n){const s=await this.safeParseAsync(t,n);if(s.success)return s.data;throw s.error}async safeParseAsync(t,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},a=this._parse({data:t,path:s.path,parent:s}),i=await(Dd(a)?a:Promise.resolve(a));return t_(s,i)}refine(t,n){const s=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:ye.custom,...s(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((s,a)=>t(s)?!0:(a.addIssue(typeof n=="function"?n(s,a):n),!1))}_refinement(t){return new Es({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Vs.create(this,this._def)}nullable(){return _i.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bs.create(this,this._def)}promise(){return Hl.create(this,this._def)}or(t){return Fd.create([this,t],this._def)}and(t){return $d.create(this,t,this._def)}transform(t){return new Es({...Qe(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Wd({...Qe(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new Nw({typeName:He.ZodBranded,type:this,...Qe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qd({...Qe(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return xu.create(this,t)}readonly(){return Vd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kH=/^c[^\s-]{8,}
vendor: 44,884 bytes, line 540
540$/i,CH=/^[0-9a-z]+$/,AH=/^[0-9A-HJKMNP-TV-Z]{26}$/,EH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,TH=/^[a-z0-9_-]{21}$/i,PH=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,MH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xg;const DH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,OH=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,IH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,m2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",LH=new RegExp(`^${m2}$`);function h2(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function FH(e){return new RegExp(`^${h2(e)}$`)}function f2(e){let t=`${m2}T${h2(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $H(e,t){return!!((t==="v4"||!t)&&DH.test(e)||(t==="v6"||!t)&&OH.test(e))}class vs extends nt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Se.string){const i=this._getOrReturnCtx(t);return Ne(i,{code:ye.invalid_type,expected:Se.string,received:i.parsedType}),Ge}const s=new Kn;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(t,a),o?Ne(a,{code:ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ne(a,{code:ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")RH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"email",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")xg||(xg=new RegExp(MH,"u")),xg.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"emoji",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")EH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"uuid",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")TH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"nanoid",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")kH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"cuid",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")CH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"cuid2",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")AH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"ulid",code:ye.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),Ne(a,{validation:"url",code:ye.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"regex",code:ye.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?f2(i).test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?LH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?FH(i).test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?PH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"duration",code:ye.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?$H(t.data,i.version)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"ip",code:ye.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?IH.test(t.data)||(a=this._getOrReturnCtx(t,a),Ne(a,{validation:"base64",code:ye.invalid_string,message:i.message}),s.dirty()):yt.assertNever(i);return{status:s.value,value:t.data}}_regex(t,n,s){return this.refinement(a=>t.test(a),{validation:n,code:ye.invalid_string,...Ie.errToObj(s)})}_addCheck(t){return new vs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ie.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ie.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ie.errToObj(t)})}datetime(t){var n,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...Ie.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ie.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ie.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ie.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ie.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ie.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ie.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ie.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ie.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ie.errToObj(n)})}nonempty(t){return this.min(1,Ie.errToObj(t))}trim(){return new vs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vs.create=e=>{var t;return new vs({checks:[],typeName:He.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Qe(e)})};function zH(e,t){const n=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,a=n>s?n:s,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class wi extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Se.number){const i=this._getOrReturnCtx(t);return Ne(i,{code:ye.invalid_type,expected:Se.number,received:i.parsedType}),Ge}let s;const a=new Kn;for(const i of this._def.checks)i.kind==="int"?yt.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?zH(t.data,i.value)!==0&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.not_finite,message:i.message}),a.dirty()):yt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ie.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ie.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ie.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ie.toString(n))}setLimit(t,n,s,a){return new wi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:s,message:Ie.toString(a)}]})}_addCheck(t){return new wi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ie.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ie.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ie.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(n)&&Number.isFinite(t)}}wi.create=e=>new wi({checks:[],typeName:He.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Qe(e)});class bi extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Se.bigint){const i=this._getOrReturnCtx(t);return Ne(i,{code:ye.invalid_type,expected:Se.bigint,received:i.parsedType}),Ge}let s;const a=new Kn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),Ne(s,{code:ye.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):yt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ie.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ie.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ie.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ie.toString(n))}setLimit(t,n,s,a){return new bi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:s,message:Ie.toString(a)}]})}_addCheck(t){return new bi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ie.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}bi.create=e=>{var t;return new bi({checks:[],typeName:He.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Qe(e)})};class Od extends nt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Se.boolean){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.boolean,received:s.parsedType}),Ge}return ir(t.data)}}Od.create=e=>new Od({typeName:He.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Qe(e)});class ho extends nt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Se.date){const i=this._getOrReturnCtx(t);return Ne(i,{code:ye.invalid_type,expected:Se.date,received:i.parsedType}),Ge}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ne(i,{code:ye.invalid_date}),Ge}const s=new Kn;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),Ne(a,{code:ye.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):yt.assertNever(i);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ie.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ie.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ho.create=e=>new ho({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:He.ZodDate,...Qe(e)});class Dh extends nt{_parse(t){if(this._getType(t)!==Se.symbol){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.symbol,received:s.parsedType}),Ge}return ir(t.data)}}Dh.create=e=>new Dh({typeName:He.ZodSymbol,...Qe(e)});class Id extends nt{_parse(t){if(this._getType(t)!==Se.undefined){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.undefined,received:s.parsedType}),Ge}return ir(t.data)}}Id.create=e=>new Id({typeName:He.ZodUndefined,...Qe(e)});class Ld extends nt{_parse(t){if(this._getType(t)!==Se.null){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.null,received:s.parsedType}),Ge}return ir(t.data)}}Ld.create=e=>new Ld({typeName:He.ZodNull,...Qe(e)});class Bl extends nt{constructor(){super(...arguments),this._any=!0}_parse(t){return ir(t.data)}}Bl.create=e=>new Bl({typeName:He.ZodAny,...Qe(e)});class to extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ir(t.data)}}to.create=e=>new to({typeName:He.ZodUnknown,...Qe(e)});class Ca extends nt{_parse(t){const n=this._getOrReturnCtx(t);return Ne(n,{code:ye.invalid_type,expected:Se.never,received:n.parsedType}),Ge}}Ca.create=e=>new Ca({typeName:He.ZodNever,...Qe(e)});class Oh extends nt{_parse(t){if(this._getType(t)!==Se.undefined){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.void,received:s.parsedType}),Ge}return ir(t.data)}}Oh.create=e=>new Oh({typeName:He.ZodVoid,...Qe(e)});class bs extends nt{_parse(t){const{ctx:n,status:s}=this._processInputParams(t),a=this._def;if(n.parsedType!==Se.array)return Ne(n,{code:ye.invalid_type,expected:Se.array,received:n.parsedType}),Ge;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,l=n.data.length<a.exactLength.value;(o||l)&&(Ne(n,{code:o?ye.too_big:ye.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(Ne(n,{code:ye.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(Ne(n,{code:ye.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>a.type._parseAsync(new Xs(n,o,n.path,l)))).then(o=>Kn.mergeArray(s,o));const i=[...n.data].map((o,l)=>a.type._parseSync(new Xs(n,o,n.path,l)));return Kn.mergeArray(s,i)}get element(){return this._def.type}min(t,n){return new bs({...this._def,minLength:{value:t,message:Ie.toString(n)}})}max(t,n){return new bs({...this._def,maxLength:{value:t,message:Ie.toString(n)}})}length(t,n){return new bs({...this._def,exactLength:{value:t,message:Ie.toString(n)}})}nonempty(t){return this.min(1,t)}}bs.create=(e,t)=>new bs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Qe(t)});function Ho(e){if(e instanceof Gt){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Vs.create(Ho(s))}return new Gt({...e._def,shape:()=>t})}else return e instanceof bs?new bs({...e._def,type:Ho(e.element)}):e instanceof Vs?Vs.create(Ho(e.unwrap())):e instanceof _i?_i.create(Ho(e.unwrap())):e instanceof Qs?Qs.create(e.items.map(t=>Ho(t))):e}class Gt extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=yt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Se.object){const d=this._getOrReturnCtx(t);return Ne(d,{code:ye.invalid_type,expected:Se.object,received:d.parsedType}),Ge}const{status:s,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ca&&this._def.unknownKeys==="strip"))for(const d in a.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const u=i[d],h=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Xs(a,h,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof Ca){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of l)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(d==="strict")l.length>0&&(Ne(a,{code:ye.unrecognized_keys,keys:l}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of l){const h=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Xs(a,h,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,f=await u.value;d.push({key:h,value:f,alwaysSet:u.alwaysSet})}return d}).then(d=>Kn.mergeObjectSync(s,d)):Kn.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(t){return Ie.errToObj,new Gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,s)=>{var a,i,o,l;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,s).message)!==null&&o!==void 0?o:s.defaultError;return n.code==="unrecognized_keys"?{message:(l=Ie.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new Gt({...this._def,unknownKeys:"strip"})}passthrough(){return new Gt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Gt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Gt({...this._def,catchall:t})}pick(t){const n={};return yt.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(n[s]=this.shape[s])}),new Gt({...this._def,shape:()=>n})}omit(t){const n={};return yt.objectKeys(this.shape).forEach(s=>{t[s]||(n[s]=this.shape[s])}),new Gt({...this._def,shape:()=>n})}deepPartial(){return Ho(this)}partial(t){const n={};return yt.objectKeys(this.shape).forEach(s=>{const a=this.shape[s];t&&!t[s]?n[s]=a:n[s]=a.optional()}),new Gt({...this._def,shape:()=>n})}required(t){const n={};return yt.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])n[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof Vs;)i=i._def.innerType;n[s]=i}}),new Gt({...this._def,shape:()=>n})}keyof(){return p2(yt.objectKeys(this.shape))}}Gt.create=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strip",catchall:Ca.create(),typeName:He.ZodObject,...Qe(t)});Gt.strictCreate=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strict",catchall:Ca.create(),typeName:He.ZodObject,...Qe(t)});Gt.lazycreate=(e,t)=>new Gt({shape:e,unknownKeys:"strip",catchall:Ca.create(),typeName:He.ZodObject,...Qe(t)});class Fd extends nt{_parse(t){const{ctx:n}=this._processInputParams(t),s=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Or(l.ctx.common.issues));return Ne(n,{code:ye.invalid_union,unionErrors:o}),Ge}if(n.common.async)return Promise.all(s.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of s){const d={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Or(c));return Ne(n,{code:ye.invalid_union,unionErrors:l}),Ge}}get options(){return this._def.options}}Fd.create=(e,t)=>new Fd({options:e,typeName:He.ZodUnion,...Qe(t)});const la=e=>e instanceof Ud?la(e.schema):e instanceof Es?la(e.innerType()):e instanceof Bd?[e.value]:e instanceof ji?e.options:e instanceof Hd?yt.objectValues(e.enum):e instanceof Wd?la(e._def.innerType):e instanceof Id?[void 0]:e instanceof Ld?[null]:e instanceof Vs?[void 0,...la(e.unwrap())]:e instanceof _i?[null,...la(e.unwrap())]:e instanceof Nw||e instanceof Vd?la(e.unwrap()):e instanceof qd?la(e._def.innerType):[];class qf extends nt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Se.object)return Ne(n,{code:ye.invalid_type,expected:Se.object,received:n.parsedType}),Ge;const s=this.discriminator,a=n.data[s],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ne(n,{code:ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ge)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,s){const a=new Map;for(const i of n){const o=la(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,i)}}return new qf({typeName:He.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...Qe(s)})}}function xv(e,t){const n=Va(e),s=Va(t);if(e===t)return{valid:!0,data:e};if(n===Se.object&&s===Se.object){const a=yt.objectKeys(t),i=yt.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=xv(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Se.array&&s===Se.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=xv(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===Se.date&&s===Se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $d extends nt{_parse(t){const{status:n,ctx:s}=this._processInputParams(t),a=(i,o)=>{if(pv(i)||pv(o))return Ge;const l=xv(i.value,o.value);return l.valid?((gv(i)||gv(o))&&n.dirty(),{status:n.value,value:l.data}):(Ne(s,{code:ye.invalid_intersection_types}),Ge)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}$d.create=(e,t,n)=>new $d({left:e,right:t,typeName:He.ZodIntersection,...Qe(n)});class Qs extends nt{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==Se.array)return Ne(s,{code:ye.invalid_type,expected:Se.array,received:s.parsedType}),Ge;if(s.data.length<this._def.items.length)return Ne(s,{code:ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ge;!this._def.rest&&s.data.length>this._def.items.length&&(Ne(s,{code:ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...s.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Xs(s,o,s.path,l)):null}).filter(o=>!!o);return s.common.async?Promise.all(i).then(o=>Kn.mergeArray(n,o)):Kn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Qs({...this._def,rest:t})}}Qs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qs({items:e,typeName:He.ZodTuple,rest:null,...Qe(t)})};class zd extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==Se.object)return Ne(s,{code:ye.invalid_type,expected:Se.object,received:s.parsedType}),Ge;const a=[],i=this._def.keyType,o=this._def.valueType;for(const l in s.data)a.push({key:i._parse(new Xs(s,l,s.path,l)),value:o._parse(new Xs(s,s.data[l],s.path,l)),alwaysSet:l in s.data});return s.common.async?Kn.mergeObjectAsync(n,a):Kn.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,s){return n instanceof nt?new zd({keyType:t,valueType:n,typeName:He.ZodRecord,...Qe(s)}):new zd({keyType:vs.create(),valueType:t,typeName:He.ZodRecord,...Qe(n)})}}class Ih extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==Se.map)return Ne(s,{code:ye.invalid_type,expected:Se.map,received:s.parsedType}),Ge;const a=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([l,c],d)=>({key:a._parse(new Xs(s,l,s.path,[d,"key"])),value:i._parse(new Xs(s,c,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return Ge;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return Ge;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}}}}Ih.create=(e,t,n)=>new Ih({valueType:t,keyType:e,typeName:He.ZodMap,...Qe(n)});class fo extends nt{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==Se.set)return Ne(s,{code:ye.invalid_type,expected:Se.set,received:s.parsedType}),Ge;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(Ne(s,{code:ye.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(Ne(s,{code:ye.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const d=new Set;for(const u of c){if(u.status==="aborted")return Ge;u.status==="dirty"&&n.dirty(),d.add(u.value)}return{status:n.value,value:d}}const l=[...s.data.values()].map((c,d)=>i._parse(new Xs(s,c,s.path,d)));return s.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new fo({...this._def,minSize:{value:t,message:Ie.toString(n)}})}max(t,n){return new fo({...this._def,maxSize:{value:t,message:Ie.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fo.create=(e,t)=>new fo({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...Qe(t)});class xl extends nt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Se.function)return Ne(n,{code:ye.invalid_type,expected:Se.function,received:n.parsedType}),Ge;function s(l,c){return Rh({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ph(),Ul].filter(d=>!!d),issueData:{code:ye.invalid_arguments,argumentsError:c}})}function a(l,c){return Rh({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ph(),Ul].filter(d=>!!d),issueData:{code:ye.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Hl){const l=this;return ir(async function(...c){const d=new Or([]),u=await l._def.args.parseAsync(c,i).catch(p=>{throw d.addIssue(s(c,p)),d}),h=await Reflect.apply(o,this,u);return await l._def.returns._def.type.parseAsync(h,i).catch(p=>{throw d.addIssue(a(h,p)),d})})}else{const l=this;return ir(function(...c){const d=l._def.args.safeParse(c,i);if(!d.success)throw new Or([s(c,d.error)]);const u=Reflect.apply(o,this,d.data),h=l._def.returns.safeParse(u,i);if(!h.success)throw new Or([a(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new xl({...this._def,args:Qs.create(t).rest(to.create())})}returns(t){return new xl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,s){return new xl({args:t||Qs.create([]).rest(to.create()),returns:n||to.create(),typeName:He.ZodFunction,...Qe(s)})}}class Ud extends nt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ud.create=(e,t)=>new Ud({getter:e,typeName:He.ZodLazy,...Qe(t)});class Bd extends nt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ne(n,{received:n.data,code:ye.invalid_literal,expected:this._def.value}),Ge}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bd.create=(e,t)=>new Bd({value:e,typeName:He.ZodLiteral,...Qe(t)});function p2(e,t){return new ji({values:e,typeName:He.ZodEnum,...Qe(t)})}class ji extends nt{constructor(){super(...arguments),Wc.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),s=this._def.values;return Ne(n,{expected:yt.joinValues(s),received:n.parsedType,code:ye.invalid_type}),Ge}if(Mh(this,Wc)||u2(this,Wc,new Set(this._def.values)),!Mh(this,Wc).has(t.data)){const n=this._getOrReturnCtx(t),s=this._def.values;return Ne(n,{received:n.data,code:ye.invalid_enum_value,options:s}),Ge}return ir(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ji.create(t,{...this._def,...n})}exclude(t,n=this._def){return ji.create(this.options.filter(s=>!t.includes(s)),{...this._def,...n})}}Wc=new WeakMap;ji.create=p2;class Hd extends nt{constructor(){super(...arguments),qc.set(this,void 0)}_parse(t){const n=yt.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Se.string&&s.parsedType!==Se.number){const a=yt.objectValues(n);return Ne(s,{expected:yt.joinValues(a),received:s.parsedType,code:ye.invalid_type}),Ge}if(Mh(this,qc)||u2(this,qc,new Set(yt.getValidEnumValues(this._def.values))),!Mh(this,qc).has(t.data)){const a=yt.objectValues(n);return Ne(s,{received:s.data,code:ye.invalid_enum_value,options:a}),Ge}return ir(t.data)}get enum(){return this._def.values}}qc=new WeakMap;Hd.create=(e,t)=>new Hd({values:e,typeName:He.ZodNativeEnum,...Qe(t)});class Hl extends nt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Se.promise&&n.common.async===!1)return Ne(n,{code:ye.invalid_type,expected:Se.promise,received:n.parsedType}),Ge;const s=n.parsedType===Se.promise?n.data:Promise.resolve(n.data);return ir(s.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hl.create=(e,t)=>new Hl({type:e,typeName:He.ZodPromise,...Qe(t)});class Es extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:s}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{Ne(s,o),o.fatal?n.abort():n.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return Ge;const c=await this._def.schema._parseAsync({data:l,path:s.path,parent:s});return c.status==="aborted"?Ge:c.status==="dirty"||n.value==="dirty"?al(c.value):c});{if(n.value==="aborted")return Ge;const l=this._def.schema._parseSync({data:o,path:s.path,parent:s});return l.status==="aborted"?Ge:l.status==="dirty"||n.value==="dirty"?al(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?Ge:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>l.status==="aborted"?Ge:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Md(o))return o;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Md(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:n.value,value:l})):o);yt.assertNever(a)}}Es.create=(e,t,n)=>new Es({schema:e,typeName:He.ZodEffects,effect:t,...Qe(n)});Es.createWithPreprocess=(e,t,n)=>new Es({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...Qe(n)});class Vs extends nt{_parse(t){return this._getType(t)===Se.undefined?ir(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vs.create=(e,t)=>new Vs({innerType:e,typeName:He.ZodOptional,...Qe(t)});class _i extends nt{_parse(t){return this._getType(t)===Se.null?ir(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_i.create=(e,t)=>new _i({innerType:e,typeName:He.ZodNullable,...Qe(t)});class Wd extends nt{_parse(t){const{ctx:n}=this._processInputParams(t);let s=n.data;return n.parsedType===Se.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Wd.create=(e,t)=>new Wd({innerType:e,typeName:He.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Qe(t)});class qd extends nt{_parse(t){const{ctx:n}=this._processInputParams(t),s={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Dd(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Or(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Or(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}qd.create=(e,t)=>new qd({innerType:e,typeName:He.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Qe(t)});class Lh extends nt{_parse(t){if(this._getType(t)!==Se.nan){const s=this._getOrReturnCtx(t);return Ne(s,{code:ye.invalid_type,expected:Se.nan,received:s.parsedType}),Ge}return{status:"valid",value:t.data}}}Lh.create=e=>new Lh({typeName:He.ZodNaN,...Qe(e)});const UH=Symbol("zod_brand");class Nw extends nt{_parse(t){const{ctx:n}=this._processInputParams(t),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class xu extends nt{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?Ge:i.status==="dirty"?(n.dirty(),al(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Ge:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(t,n){return new xu({in:t,out:n,typeName:He.ZodPipeline})}}class Vd extends nt{_parse(t){const n=this._def.innerType._parse(t),s=a=>(Md(a)&&(a.value=Object.freeze(a.value)),a);return Dd(n)?n.then(a=>s(a)):s(n)}unwrap(){return this._def.innerType}}Vd.create=(e,t)=>new Vd({innerType:e,typeName:He.ZodReadonly,...Qe(t)});function g2(e,t={},n){return e?Bl.create().superRefine((s,a)=>{var i,o;if(!e(s)){const l=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,c=(o=(i=l.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,d=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...d,fatal:c})}}):Bl.create()}const BH={object:Gt.lazycreate};var He;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(He||(He={}));const HH=(e,t={message:`Input not instance of ${e.name}`})=>g2(n=>n instanceof e,t),x2=vs.create,v2=wi.create,WH=Lh.create,qH=bi.create,y2=Od.create,VH=ho.create,YH=Dh.create,GH=Id.create,KH=Ld.create,ZH=Bl.create,XH=to.create,QH=Ca.create,JH=Oh.create,eW=bs.create,tW=Gt.create,nW=Gt.strictCreate,rW=Fd.create,sW=qf.create,aW=$d.create,iW=Qs.create,oW=zd.create,lW=Ih.create,cW=fo.create,dW=xl.create,uW=Ud.create,mW=Bd.create,hW=ji.create,fW=Hd.create,pW=Hl.create,n_=Es.create,gW=Vs.create,xW=_i.create,vW=Es.createWithPreprocess,yW=xu.create,wW=()=>x2().optional(),bW=()=>v2().optional(),jW=()=>y2().optional(),_W={string:e=>vs.create({...e,coerce:!0}),number:e=>wi.create({...e,coerce:!0}),boolean:e=>Od.create({...e,coerce:!0}),bigint:e=>bi.create({...e,coerce:!0}),date:e=>ho.create({...e,coerce:!0})},NW=Ge;var Ut=Object.freeze({__proto__:null,defaultErrorMap:Ul,setErrorMap:NH,getErrorMap:Ph,makeIssue:Rh,EMPTY_PATH:SH,addIssueToContext:Ne,ParseStatus:Kn,INVALID:Ge,DIRTY:al,OK:ir,isAborted:pv,isDirty:gv,isValid:Md,isAsync:Dd,get util(){return yt},get objectUtil(){return fv},ZodParsedType:Se,getParsedType:Va,ZodType:nt,datetimeRegex:f2,ZodString:vs,ZodNumber:wi,ZodBigInt:bi,ZodBoolean:Od,ZodDate:ho,ZodSymbol:Dh,ZodUndefined:Id,ZodNull:Ld,ZodAny:Bl,ZodUnknown:to,ZodNever:Ca,ZodVoid:Oh,ZodArray:bs,ZodObject:Gt,ZodUnion:Fd,ZodDiscriminatedUnion:qf,ZodIntersection:$d,ZodTuple:Qs,ZodRecord:zd,ZodMap:Ih,ZodSet:fo,ZodFunction:xl,ZodLazy:Ud,ZodLiteral:Bd,ZodEnum:ji,ZodNativeEnum:Hd,ZodPromise:Hl,ZodEffects:Es,ZodTransformer:Es,ZodOptional:Vs,ZodNullable:_i,ZodDefault:Wd,ZodCatch:qd,ZodNaN:Lh,BRAND:UH,ZodBranded:Nw,ZodPipeline:xu,ZodReadonly:Vd,custom:g2,Schema:nt,ZodSchema:nt,late:BH,get ZodFirstPartyTypeKind(){return He},coerce:_W,any:ZH,array:eW,bigint:qH,boolean:y2,date:VH,discriminatedUnion:sW,effect:n_,enum:hW,function:dW,instanceof:HH,intersection:aW,lazy:uW,literal:mW,map:lW,nan:WH,nativeEnum:fW,never:QH,null:KH,nullable:xW,number:v2,object:tW,oboolean:jW,onumber:bW,optional:gW,ostring:wW,pipeline:yW,preprocess:vW,promise:pW,record:oW,set:cW,strictObject:nW,string:x2,symbol:YH,transformer:n_,tuple:iW,undefined:GH,union:rW,unknown:XH,void:JH,NEVER:NW,ZodIssueCode:ye,quotelessJson:_H,ZodError:Or}),Sw="Dialog",[w2,b2]=zr(Sw),[SW,Ps]=w2(Sw),j2=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[d=!1,u]=es({prop:s,defaultProp:a,onChange:i});return r.jsx(SW,{scope:t,triggerRef:l,contentRef:c,contentId:wr(),titleId:wr(),descriptionId:wr(),open:d,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(h=>!h),[u]),modal:o,children:n})};j2.displayName=Sw;var _2="DialogTrigger",N2=m.forwardRef((e,t)=>
vendor: 4,731 bytes, lines 540-544
540{const{__scopeDialog:n,...s}=e,a=Ps(_2,n),i=ct(t,a.triggerRef);return r.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Aw(a.open),...s,ref:i,onClick:we(e.onClick,a.onOpenToggle)})});N2.displayName=_2;var kw="DialogPortal",[kW,S2]=w2(kw,{forceMount:void 0}),k2=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,i=Ps(kw,t);return r.jsx(kW,{scope:t,forceMount:n,children:m.Children.map(s,o=>r.jsx(Nr,{present:n||i.open,children:r.jsx(Gl,{asChild:!0,container:a,children:o})}))})};k2.displayName=kw;var Fh="DialogOverlay",C2=m.forwardRef((e,t)=>{const n=S2(Fh,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,i=Ps(Fh,e.__scopeDialog);return i.modal?r.jsx(Nr,{present:s||i.open,children:r.jsx(CW,{...a,ref:t})}):null});C2.displayName=Fh;var CW=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ps(Fh,n);return r.jsx(pu,{as:jr,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(Le.div,{"data-state":Aw(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),po="DialogContent",A2=m.forwardRef((e,t)=>{const n=S2(po,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,i=Ps(po,e.__scopeDialog);return r.jsx(Nr,{present:s||i.open,children:i.modal?r.jsx(AW,{...a,ref:t}):r.jsx(EW,{...a,ref:t})})});A2.displayName=po;var AW=m.forwardRef((e,t)=>{const n=Ps(po,e.__scopeDialog),s=m.useRef(null),a=ct(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return Ff(i)},[]),r.jsx(E2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault())})}),EW=m.forwardRef((e,t)=>{const n=Ps(po,e.__scopeDialog),s=m.useRef(!1),a=m.useRef(!1);return r.jsx(E2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),E2=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=Ps(po,n),c=m.useRef(null),d=ct(t,c);return Lf(),r.jsxs(r.Fragment,{children:[r.jsx(fu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:r.jsx(wo,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Aw(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(PW,{titleId:l.titleId}),r.jsx(MW,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Cw="DialogTitle",T2=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ps(Cw,n);return r.jsx(Le.h2,{id:a.titleId,...s,ref:t})});T2.displayName=Cw;var P2="DialogDescription",R2=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ps(P2,n);return r.jsx(Le.p,{id:a.descriptionId,...s,ref:t})});R2.displayName=P2;var M2="DialogClose",D2=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ps(M2,n);return r.jsx(Le.button,{type:"button",...s,ref:t,onClick:we(e.onClick,()=>a.onOpenChange(!1))})});D2.displayName=M2;function Aw(e){return e?"open":"closed"}var O2="DialogTitleWarning",[TW,I2]=HM(O2,{contentName:po,titleName:Cw,docsSlug:"dialog"}),PW=({titleId:e})=>{const t=I2(O2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
541
542If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
543
544For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},RW="DialogDescriptionWarning",MW=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I2(RW).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},Vf=j2,Ew=N2,Yf=k2,ic=C2,oc=A2,lc=T2,cc=R2,vu=D2,L2="AlertDialog",[DW,fK]=zr(L2,[b2]),Ea=b2(),F2=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ea(t);return r.jsx(Vf,{...s,...n,modal:!0})};F2.displayName=L2;
544var OW="AlertDialogTrigger",IW=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Ea(n);return r.jsx(Ew,{...a,...s,ref:t})});IW.displayName=OW;var LW="AlertDialogPortal",$2=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ea(t);return r.jsx(Yf,{...s,...n})};$2.displayName=LW;var FW="AlertDialogOverlay",z2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Ea(n);return r.jsx(ic,{...a,...s,ref:t})});z2.displayName=FW;var vl="AlertDialogContent",[$W,zW]=DW(vl),U2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,i=Ea(n),o=m.useRef(null),l=ct(t,o),c=m.useRef(null);return r.jsx(TW,{contentName:vl,titleName:B2,docsSlug:"alert-dialog",children:r.jsx($W,{scope:n,cancelRef:c,children:r.jsxs(oc,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:we(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[r.jsx(by,{children:s}),r.jsx(BW,{contentRef:o})]})})})});U2.displayName=vl;var B2="AlertDialogTitle",H2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Ea(n);return r.jsx(lc,{...a,...s,ref:t})});H2.displayName=B2;var W2="AlertDialogDescription",q2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Ea(n);return r.jsx(cc,{...a,...s,ref:t})});q2.displayName=W2;var UW="AlertDialogAction",V2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Ea(n);return r.jsx(vu,{...a,...s,ref:t})});V2.displayName=UW;var Y2="AlertDialogCancel",G2=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=zW(Y2,n),i=Ea(n),o=ct(t,a);return r.jsx(vu,{...i,...s,ref:o})});G2.displayName=Y2;var BW=({contentRef:e})=>{const t=`\`${vl}\` requires a description for the component to be accessible for screen reader users.
545
546You can add a description to the \`${vl}\` by passing a \`${W2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
547
548Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${vl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
549
550For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},HW=F2,WW=$2,K2=z2,Z2=U2,X2=V2,Q2=G2,J2=H2,eE=q2;const _n=HW,qW=WW,tE=m.forwardRef(({className:e,...t},n)=>r.jsx(K2,{className:le("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));tE.displayName=K2.displayName;const ln=m.forwardRef(({className:e,...t},n)=>r.jsxs(qW,{children:[r.jsx(tE,{}),r.jsx(Z2,{ref:n,className:le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));ln.displayName=Z2.displayName;const cn=({className:e,...t})=>r.jsx("div",{className:le("flex flex-col space-y-2 text-center sm:text-left",e),...t});cn.displayName="AlertDialogHeader";const dn=({className:e,...t})=>r.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dn.displayName="AlertDialogFooter";const un=m.forwardRef(({className:e,...t},n)=>r.jsx(J2,{ref:n,className:le("text-lg font-semibold",e),...t}));un.displayName=J2.displayName;const mn=m.forwardRef(({className:e,...t},n)=>r.jsx(eE,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));mn.displayName=eE.displayName;const hn=m.forwardRef(({className:e,...t},n)=>r.jsx(X2,{ref:n,className:le(Rd(),e),...t}));hn.displayName=X2.displayName;const fn=m.forwardRef(({className:e,...t},n)=>r.jsx(Q2,{ref:n,className:le(Rd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));fn.displayName=Q2.displayName;const VW=e=>Ut.object({firstName:Ut.string().trim().min(1,"First name is required").max(100,"First name too long"),lastName:Ut.string().trim().min(1,"Last name is required").max(100,"Last name too long"),email:Ut.string().trim().email("Invalid email address").max(255,"Email too long").refine(t=>!e||t.toLowerCase().endsWith("@uzh.ch"),"Only UZH students can register for this course. Please use your @uzh.ch email address."),phone:Ut.string().trim().min(1,"Phone number is required").max(50,"Phone number too long")}),YW=()=>{var pn,Sr,Cn,kr,Wt;const{id:e}=Gy(),[t,n]=_o(),{user:s}=In(),[a,i]=m.useState(null),[o,l]=m.useState(!0),[c,d]=m.useState(!1),[u,h]=m.useState(!1),[f,p]=m.useState(!1),[w,v]=m.useState(!1),[b,x]=m.useState(null),[g,y]=m.useState({}),[j,N]=m.useState(""),[k,_]=m.useState(""),[P,$]=m.useState(!1),[M,O]=m.useState(null),[A,U]=m.useState(null),[W,E]=m.useState(null),[S,L]=m.useState(!1),[C,D]=m.useState(null),[F,T]=m.useState(null),[,q]=m.useState(0),{toast:I}
550=Sn(),[Y,ie]=m.useState({firstName:"",lastName:"",email:"",phone:"",profession:""}),[se,pe]=m.useState({}),_e=((pn=a==null?void 0:a.name)==null?void 0:pn.toLowerCase().includes("bls-aed"))??!1;m.useEffect(()=>{e&&Re()},[e]),m.useEffect(()=>{s&&e&&(Pe(),ke())},[s,e]),m.useEffect(()=>{if(e)try{const J=sessionStorage.getItem(`ext_access:${e}`);if(!J)return;const ae=JSON.parse(J),V=!ae.spotReservedUntil||new Date(ae.spotReservedUntil).getTime()>Date.now();ae!=null&&ae.ticket&&(ae!=null&&ae.email)&&V?(U(ae.ticket),E(ae.email),ie(oe=>({...oe,email:ae.email})),ae.spotReservedUntil&&T(new Date(ae.spotReservedUntil))):sessionStorage.removeItem(`ext_access:${e}`)}catch{}},[e]),m.useEffect(()=>{const J=t.get("ext_token"),ae=t.get("email");if(!J||!ae||!e||A||S)return;(async()=>{L(!0),D(null);try{const{data:oe,error:Ae}=await K.functions.invoke("verify-external-access",{body:{courseId:e,email:ae,token:J}});if(Ae)throw Ae;if((oe==null?void 0:oe.status)==="verified"&&(oe!=null&&oe.ticket)){const $e=oe.email||ae.toLowerCase();U(oe.ticket),E($e),ie(Ve=>({...Ve,email:$e})),oe.spotReservedUntil&&T(new Date(oe.spotReservedUntil));try{sessionStorage.setItem(`ext_access:${e}`,JSON.stringify({ticket:oe.ticket,email:$e,spotReservedUntil:oe.spotReservedUntil??null}))}catch{}I({title:"Email verified",description:oe.spotReservedUntil?"Your spot is reserved. Please complete registration before the timer runs out.":"You can now complete your registration below."})}else D((oe==null?void 0:oe.error)||"This verification link is invalid or has expired.")}catch(oe){D((oe==null?void 0:oe.message)||"This verification link is invalid or has expired.")}finally{L(!1);const oe=new URLSearchParams(t);oe.delete("ext_token"),oe.delete("email"),n(oe,{replace:!0})}})()},[t,e,A,S,n,I]),m.useEffect(()=>{if(!F)return;const J=setInterval(()=>q(ae=>ae+1),1e3);return()=>clearInterval(J)},[F]);const Pe=async()=>{try{const{data:J,error:ae}=await K.from("profiles").select("*").eq("id",s==null?void 0:s.id).single();if(ae)throw ae;J&&(x(J),ie({firstName:J.first_name||"",lastName:J.last_name||"",email:J.email||"",phone:J.phone||"",profession:""}))}catch(J){console.error("Error fetching profile:",J)}},ke=async()=>{if(!(!s||!e))try{const{data:J,error:ae}=await K.from("course_registrations").select("id").eq("course_id",e).eq("user_id",s.id).maybeSingle();if(ae&&ae.code!=="PGRST116")throw ae;if(J){p(!0),h(!0);return}const{data:V,error:oe}=await K.from("course_registrations").select("id").eq("course_id",e).eq("email",s.email).maybeSingle();if(oe&&oe.code!=="PGRST116")throw oe;V&&(p(!0),h(!0))}catch(J){console.error("Error checking registration:",J)}},Re=async()=>{try{const{data:J,error:ae}=await K.from("courses").select("*").eq("id",e).single();if(ae)throw ae;const{data:V}=await K.from("course_sessions").select("*").eq("course_id_legacy",e).limit(1).maybeSingle(),{data:oe,error:Ae}=await K.rpc("get_course_confirmed_count",{p_course_id:e});if(Ae&&console.error("Error counting registrations:",Ae),J!=null&&J.profession_limits){const{data:Ve,error:gt}=await K.rpc("get_course_profession_counts",{p_course_id:e});gt?console.error("Error fetching profession counts:",gt):Ve&&y(Ve)}const $e={...J,max_participants:(V==null?void 0:V.capacity)??(J==null?void 0:J.max_participants),price:(V==null?void 0:V.price)??(J==null?void 0:J.price),member_price:(V==null?void 0:V.member_price)??(J==null?void 0:J.member_price),location:(V==null?void 0:V.location)??(J==null?void 0:J.location),current_participants:typeof oe=="number"?oe:(J==null?void 0:J.current_participants)??0};i($e)}catch(J){console.error("Error fetching course:",J),I({title:"Error",description:"Failed to load course details. Please try again.",variant:"destructive"})}finally{l(!1)}},De=J=>{const{name:ae,value:V}=J.target;ie(oe=>({...oe,[ae]:V})),se[ae]&&pe(oe=>({...oe,[ae]:""})),ae==="email"&&_e&&V&&!V.toLowerCase().endsWith("@uzh.ch")&&pe(oe=>({...oe,email:"Only UZH students can register. Please use your @uzh.ch email address."}))},de=()=>
550{v(!0)},R=async J=>{J.preventDefault(),pe({});try{const V=VW(_e).parse(Y);if(!a)return;v(!1),d(!0);const{data:oe,error:Ae}=await K.functions.invoke("register-for-course",{body:{courseId:a.id,firstName:V.firstName,lastName:V.lastName,email:V.email,phone:V.phone,profession:Y.profession||void 0,...A&&W&&V.email.toLowerCase()===W?{externalAccessTicket:A}:{}}});if(Ae)throw Ae;const $e=(oe==null?void 0:oe.status)==="waiting_list";h(!0),p(!0);try{e&&sessionStorage.removeItem(`ext_access:${e}`)}catch{}I({title:$e?"Added to Waiting List!":"Registration Successful!",description:$e?"You have been added to the waiting list. We'll notify you if a spot opens up.":"You have been registered for this course. Check your email for confirmation."}),Re()}catch(ae){if(ae instanceof Ut.ZodError){const V={};ae.errors.forEach(oe=>{oe.path[0]&&(V[oe.path[0]]=oe.message)}),pe(V)}else I({title:"Registration Failed",description:ae.message||"Unable to register. Please try again.",variant:"destructive"})}finally{d(!1)}},X=a&&a.max_participants&&a.current_participants>=a.max_participants,ue=a&&a.max_participants?a.max_participants-a.current_participants:null,te=(a==null?void 0:a.profession_limits)&&Object.keys(a.profession_limits).length>0,Ce=te?Object.keys(a.profession_limits):[],he=J=>{if(!te||!(a!=null&&a.profession_limits))return null;const ae=a.profession_limits[J],V=g[J]||0;return Math.max(0,ae-V)},Be=J=>{const ae=he(J);return ae!==null&&ae<=0},dt=(()=>{if(!a)return{isOpen:!1,message:"",memberOpensAt:null,publicOpensAt:null,isMember:!1};const J=new Date,ae=a.registration_opens_at?new Date(a.registration_opens_at):null,V=a.public_registration_opens_at?new Date(a.public_registration_opens_at):null,oe=!!s;return a.is_members_only?oe?ae&&J<ae?{isOpen:!1,message:`Registration opens ${rt(ae,"PPP 'at' HH:mm")}`,memberOpensAt:ae,publicOpensAt:null,isMember:!0}:{isOpen:!0,message:"",memberOpensAt:ae,publicOpensAt:null,isMember:!0}:{isOpen:!1,message:"This course is for members only",memberOpensAt:ae,publicOpensAt:null,isMember:!1}:oe?ae&&J<ae?{isOpen:!1,message:`Member registration opens ${rt(ae,"PPP 'at' HH:mm")}`,memberOpensAt:ae,publicOpensAt:V,isMember:!0}:{isOpen:!0,message:"",memberOpensAt:ae,publicOpensAt:V,isMember:!0}:ae&&J<ae?{isOpen:!1,message:V?`Public registration opens ${rt(V,"PPP 'at' HH:mm")}`:`Registration opens ${rt(ae,"PPP 'at' HH:mm")}`,memberOpensAt:ae,publicOpensAt:V,isMember:!1}:V&&J<V?{isOpen:!1,message:`Public registration opens ${rt(V,"PPP 'at' HH:mm")}`,memberOpensAt:ae,publicOpensAt:V,isMember:!1}:{isOpen:!0,message:"",memberOpensAt:ae,publicOpensAt:V,isMember:!1}})(),Ze=new Date,st=a!=null&&a.registration_opens_at?new Date(a.registration_opens_at):null,Ke=a!=null&&a.public_registration_opens_at?new Date(a.public_registration_opens_at):null,bt=!!a&&!a.is_members_only&&!!st&&!!Ke&&Ze>=st&&Ze<Ke,pt=!!(a!=null&&a.external_early_access_enabled)&&(((Sr=a==null?void 0:a.external_early_access_domains)==null?void 0:Sr.length)||0)>0&&bt&&!s,kn=A&&pt?{...dt,isOpen:!0,message:""}:dt,Ot=((a==null?void 0:a.external_early_access_domains)||[]).map(J=>J.toLowerCase().replace(/^@/,"")),$t=async J=>{if(J.preventDefault(),!(!a||!j)){$(!0),O(null);try{const{data:ae,error:V}=await K.functions.invoke("request-external-access",{body:{courseId:a.id,email:j.trim(),honeypot:k}});if(V)throw V;if((ae==null?void 0:ae.status)==="use_login"){O(ae.message),I({title:"Account exists",description:ae.message});return}O((ae==null?void 0:ae.message)||"If your email is eligible for early access, we've sent you a verification link."),ae!=null&&ae.spotReservedUntil&&T(new Date(ae.spotReservedUntil))}catch{O("If your email is eligible for early access, we've sent you a verification link.")}finally{$(!1)}}};return o?r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading course details..."})}):a?r.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-8 flex-grow",children:[r.jsx("div",{className:"mb-6",children:r.jsx(be,{to:"/courses",children:r.jsxs(G,{variant:"ghost",className:"gap-2",children:[r.jsx(et,{className:"h-4 w-4"}),"Back to Courses"]})})}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[r.jsx("div",{className:"lg:col-span-2",children:r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[r.jsx(re,{className:"text-3xl",children:a.name}),a.is_members_only&&!a.public_registration_opens_at&&r.jsx(Me,{variant:"secondary",children:"Members Only"})]}),a.language&&r.jsxs("div",{className:"text-destructive font-medium text-sm space-y-1",children:[r.jsxs("p",{children:[a.language==="English"&&"This event is held in English only.",a.language==="Deutsch"&&"This event is held in German only.",a.language==="français"&&"This event is held in French only.",a.language==="italiano"&&"This event is held in Italian only."]}),r.jsxs("p",{children:[a.language==="English"&&"Diese Veranstaltung findet nur auf Englisch statt.",a.language==="Deutsch"&&"Diese Veranstaltung findet nur auf Deutsch statt.",a.language==="français"&&"Cet événement se tient uniquement en français.",a.language==="italiano"&&"Questo evento si tiene solo in italiano."]})]}),r.jsx(Pt,{className:"text-base whitespace-pre-line",dangerouslySetInnerHTML:{__html:pl(gl(a.description||"Join us for this exciting course to enhance your emergency medicine skills."))}})]}),r.jsx(H,{className:"space-y-6",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Tr,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Date & Time"}),r.jsxs("p",{className:"font-medium",children:[rt(new Date(a.date),"dd.MM.yyyy 'at' HH:mm"),a.end_date&&(rt(new Date(a.date),"yyyy-MM-dd")===rt(new Date(a.end_date),"yyyy-MM-dd")?` - ${rt(new Date(a.end_date),"HH:mm")}`:` - ${rt(new Date(a.end_date),"dd.MM.yyyy 'at' HH:mm")}
550`)]})]})]}),r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Rn,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Location"}),r.jsxs("p",{className:"font-medium",children:[a.location,a.region?` (${a.region})`:""]})]})]}),te?r.jsxs("div",{className:"flex items-start gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Ht,{className:"h-5 w-5 text-primary mt-0.5"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Availability by Profession"}),Ce.map(J=>{const ae=he(J),V=Be(J);return r.jsxs("div",{className:"flex items-center justify-between text-sm",children:[r.jsx("span",{className:"font-medium",children:J}),r.jsx("span",{className:V?"text-destructive font-medium":"text-muted-foreground",children:V?"Full":`${ae} spot${ae!==1?"s":""} left`})]},J)})]})]}):a.max_participants?r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Ht,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Availability"}),r.jsx("p",{className:`font-medium ${X?"text-destructive":""}`,children:X?"Course Full":`${ue} spot${ue!==1?"s":""} left`})]})]}):null,a.price&&a.price>0&&r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(M4,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Course Fee"}),a.member_price&&a.member_price>0&&a.member_price!==a.price?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium",children:["CHF ",a.price.toFixed(2)]}),r.jsxs("p",{className:"text-sm text-primary font-medium",children:["Members: CHF ",a.member_price.toFixed(2)]})]}):r.jsxs("p",{className:"font-medium",children:["CHF ",a.price.toFixed(2)]})]})]})]})})]})}),r.jsx("div",{className:"lg:col-span-1",children:r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Register for Course"}),r.jsx(Pt,{children:"Fill in your details to secure your spot"})]}),r.jsxs(H,{children:[F&&!u&&(()=>{const J=F.getTime()-Date.now();if(J<=0)return r.jsx("div",{className:"mb-4 p-3 rounded-lg border border-destructive/40 bg-destructive/10 text-sm text-destructive",children:"Your temporary spot reservation has expired. You can still try to register, but capacity is no longer guaranteed."});const ae=Math.floor(J/1e3),V=Math.floor(ae/60),oe=ae%60;return r.jsxs("div",{className:"mb-4 p-3 rounded-lg border border-primary/30 bg-primary/5 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Spot temporarily reserved"}),r.jsxs("p",{className:"text-muted-foreground mt-1",children:["We're holding one spot for ",W||j," for"," ",r.jsxs("span",{className:"font-mono font-semibold text-foreground",children:[V,":",oe.toString().padStart(2,"0")]}),". Complete your registration before the timer runs out to secure it."]})]})})(),u?r.jsxs("div",{className:"text-center py-8 space-y-4",children:[r.jsx(pa,{className:"h-16 w-16 text-green-500 mx-auto"}),r.jsx("h3",{className:"text-xl font-semibold",children:f?"Already Registered!":"Registration Complete!"}),r.jsx("p",{className:"text-muted-foreground",children:f?"You are already registered for this course. You'll receive updates via email.":"You'll receive a confirmation email shortly with more details."})]}):kn.isOpen?X?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"text-center py-4 space-y-3",children:[r.jsx("p",{className:"text-lg font-medium text-destructive",children:"This course is full"}),r.jsx("p",{className:"text-muted-foreground",children:"Join the waiting list and we'll notify you if a spot opens up."})]}),s&&b?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"Joining waiting list as:"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[b.first_name," ",b.last_name]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:b.email})]}),te&&r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"profession-waitlist-logged-in",children:"Profession *"}),r.jsxs(mt,{value:Y.profession,onValueChange:J=>{ie(ae=>({...ae,profession:J}))},children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Select your profession"})}),r.jsx(lt,{children:Ce.map(J=>{const ae=he(J),V=Be(J);return r.jsxs(fe,{value:J,children:[J," ",ae!==null&&(V?"(Waiting list)":`(${ae} spots left)`)]},J)})})]})]}),r.jsx(G,{onClick:de,className:"w-full",disabled:c||te&&!Y.profession,variant:"secondary",children:c?"Joining...":"Join Waiting List"})]}):r.jsxs("form",{onSubmit:R,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"firstName",children:"First Name *"}),r.jsx(xe,{id:"firstName",name:"firstName",value:Y.firstName,onChange:De,required:!0}),se.firstName&&r.jsx("p",{className:"text-sm text-destructive",children:se.firstName})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"lastName",children:"Last Name *"}),r.jsx(xe,{id:"lastName",name:"lastName",value:Y.lastName,onChange:De,required:!0}),se.lastName&&r.jsx("p",{className:"text-sm text-destructive",children:se.lastName})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"email",children:"Email *"}),_e&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"Only @uzh.ch email addresses are accepted"}),r.jsx(xe,{id:"email",name:"email",type:"email",value:Y.email,onChange:De,placeholder:_e?"[email protected]":void 0,required:!0}),se.email&&r.jsx("p",{className:"text-sm text-destructive",children:se.email})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"phone",children:"Phone Number *"}),r.jsx(xe,{id:"phone",name:"phone",type:"tel",value:Y.phone,onChange:De,required:!0}),se.phone&&r.jsx("p",{className:"text-sm text-destructive",children:se.ph
550one})]}),te&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"profession-waitlist",children:"Profession *"}),r.jsxs(mt,{value:Y.profession,onValueChange:J=>{ie(ae=>({...ae,profession:J})),se.profession&&pe(ae=>({...ae,profession:""}))},children:[r.jsx(ot,{className:se.profession?"border-destructive":"",children:r.jsx(ht,{placeholder:"Select your profession"})}),r.jsx(lt,{children:Ce.map(J=>{const ae=he(J),V=Be(J);return r.jsxs(fe,{value:J,children:[J," ",ae!==null&&(V?"(Waiting list)":`(${ae} spots left)`)]},J)})})]}),se.profession&&r.jsx("p",{className:"text-sm text-destructive",children:se.profession})]}),r.jsx(G,{type:"submit",className:"w-full",disabled:c||te&&!Y.profession,variant:"secondary",children:c?"Joining...":"Join Waiting List"})]})]}):s&&b?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"Registering as:"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[b.first_name," ",b.last_name]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:b.email}),b.phone&&r.jsx("p",{className:"text-sm text-muted-foreground",children:b.phone})]}),_e&&!((Cn=b.email)!=null&&Cn.toLowerCase().endsWith("@uzh.ch"))&&r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"uzh-email",children:"UZH Email Address *"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 mb-1",children:"Your profile email is not a @uzh.ch address. Please enter your UZH email to register."}),r.jsx(xe,{id:"uzh-email",name:"email",type:"email",value:Y.email,onChange:De,placeholder:"[email protected]",className:se.email?"border-destructive":""}),se.email&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.email})]}),te&&r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"profession-logged-in",children:"Profession *"}),r.jsxs(mt,{value:Y.profession,onValueChange:J=>{ie(ae=>({...ae,profession:J}))},children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Select your profession"})}),r.jsx(lt,{children:Ce.map(J=>{const ae=he(J),V=Be(J);return r.jsxs(fe,{value:J,children:[J," ",ae!==null&&(V?"(Waiting list)":`(${ae} spots left)`)]},J)})})]})]}),r.jsx(G,{onClick:de,className:"w-full",disabled:c||te&&!Y.profession||_e&&!((kr=b.email)!=null&&kr.toLowerCase().endsWith("@uzh.ch"))&&!((Wt=Y.email)!=null&&Wt.toLowerCase().endsWith("@uzh.ch")),children:c?"Registering...":"Register Now"}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"By registering, you agree to receive course-related communications."})]}):r.jsxs("form",{onSubmit:J=>{J.preventDefault(),v(!0)},className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"firstName",children:"First Name *"}),r.jsx(xe,{id:"firstName",name:"firstName",value:Y.firstName,onChange:De,placeholder:"John",className:se.firstName?"border-destructive":""}),se.firstName&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.firstName})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"lastName",children:"Last Name *"}),r.jsx(xe,{id:"lastName",name:"lastName",value:Y.lastName,onChange:De,placeholder:"Doe",className:se.lastName?"border-destructive":""}),se.lastName&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.lastName})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"email",children:"Email Address *"}),_e&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Only @uzh.ch email addresses are accepted"}),r.jsx(xe,{id:"email",name:"email",type:"email",value:Y.email,onChange:De,placeholder:_e?"[email protected]":"[email protected]",className:se.email?"border-destructive":""}),se.email&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.email})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"phone",children:"Phone Number *"}),r.jsx(xe,{id:"phone",name:"phone",type:"tel",value:Y.phone,onChange:De,placeholder:"+41 79 123 45 67",className:se.phone?"border-destructive":""}),se.phone&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.phone})]}),te&&r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"profession",children:"Profession *"}),r.jsxs(mt,{value:Y.profession,onValueChange:J=>{ie(ae=>({...ae,profession:J})),se.profession&&pe(ae=>({...ae,profession:""}))},children:[r.jsx(ot,{className:se.profession?"border-destructive":"",children:r.jsx(ht,{placeholder:"Select your profession"})}),r.jsx(lt,{children:Ce.map(J=>{const ae=he(J),V=Be(J);return r.jsxs(fe,{value:J,children:[J," ",ae!==null&&(V?"(Waiting list)":`(${ae} spots left)`)]},J)})})]}),se.profession&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:se.profession})]}),r.jsx(G,{type:"submit",className:"w-full",disabled:c||te&&!Y.profession,children:c?"Registering...":"Register Now"}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"By registering, you agree to re
550ceive course-related communications."})]}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"text-center py-6 space-y-4",children:[r.jsx(Tr,{className:"h-16 w-16 text-muted-foreground mx-auto"}),r.jsx("h3",{className:"text-xl font-semibold",children:"Registration Not Open Yet"}),r.jsxs("div",{className:"space-y-3 text-muted-foreground",children:[dt.memberOpensAt&&r.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg",children:[r.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:"Member Registration"}),r.jsx("p",{className:"text-sm",children:rt(dt.memberOpensAt,"PPP 'at' HH:mm")})]}),dt.publicOpensAt&&r.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg",children:[r.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:"Public Registration"}),r.jsx("p",{className:"text-sm",children:rt(dt.publicOpensAt,"PPP 'at' HH:mm")})]}),!dt.memberOpensAt&&!dt.publicOpensAt&&r.jsx("p",{children:dt.message})]}),!s&&a.is_members_only&&r.jsx("div",{className:"mt-4",children:r.jsx(be,{to:"/auth",children:r.jsx(G,{variant:"outline",className:"w-full",children:"Sign in as Member"})})})]}),pt&&r.jsxs("div",{className:"border-t pt-6 space-y-3",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-foreground",children:"Partner Organization Early Access"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"If your organization has early-access privileges, enter your work email to receive a one-time verification link."}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Accepted email domains: ",Ot.map(J=>`@${J}`).join(", ")]})]}),M?r.jsx("div",{className:"p-3 bg-muted/50 rounded-lg text-sm",children:M}):r.jsxs("form",{onSubmit:$t,className:"space-y-3",children:[r.jsx("input",{type:"text",tabIndex:-1,autoComplete:"off",value:k,onChange:J=>_(J.target.value),className:"hidden","aria-hidden":"true"}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"external-email",children:"Work email"}),r.jsx(xe,{id:"external-email",type:"email",value:j,onChange:J=>N(J.target.value),placeholder:"[email protected]",required:!0})]}),r.jsx(G,{type:"submit",className:"w-full",variant:"secondary",disabled:P||!j,children:P?"Sending...":"Send verification link"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Already a SEMSA member?"," ",r.jsx(be,{to:"/auth",className:"underline",children:"Sign in"})," to register directly."]})]})]}),S&&r.jsx("div",{className:"p-3 bg-muted/50 rounded-lg text-sm text-center",children:"Verifying your link…"}),C&&r.jsx("div",{className:"p-3 bg-destructive/10 rounded-lg text-sm text-destructive",children:C})]})]})]})})]})]}),r.jsx(_n,{open:w,onOpenChange:v,children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:X?"Join Waiting List":"Confirm Registration"}),r.jsx(mn,{className:"space-y-3",children:X?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"font-medium",children:"This course is currently full. You will be added to the waiting list."}),r.jsx("p",{className:"text-sm",children:"If a spot becomes available, you will be automatically promoted and receive a confirmation email."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"font-medium",children:[r.jsx("strong",{children:"Important:"})," Your registration is considered binding."]}),a!=null&&a.price&&a.price>0?r.jsxs("p",{className:"text-sm",children:["This course has a fee of ",r.jsxs("strong",{children:["CHF ",a.price.toFixed(2)]}),". Your registration will only be definitive once we have received payment."]}):r.jsx("p",{className:"text-sm",children:"If you can for some reason not attend, please let us know as soon as possible under [email protected]"}),r.jsx("p",{className:"text-sm",children:"You will receive a confirmation email with further details."})]})})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:R,children:X?"Join Waiting List":"Confirm Registration"})]})]})}),r.jsx(qe,{})]}):r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background",children:[r.jsx("h1",{className:"text-2xl font-bold mb-4 text-foreground",children:"Course Not Found"}),r.jsx(be,{to:"/courses",children:r.jsx(G,{variant:"outline",children:"Back to Courses"})})]})},GW=()=>{const{id:e}=Gy(),t=rs(),{user:n,loading:s}=In(),[a,i]=m.useState(null),[o,l]=m.useState(!0),{toast:c}=Sn();m.useEffect(()=>{e&&d()},[e]);const d=async()=>{try{const{data:u,error:h}=await K.from("external_courses").select("*").eq("id",e).single();if(h)throw h;i(u)}
550catch(u){console.error("Error fetching external course:",u),c({title:"Error",description:"Failed to load course details. Please try again.",variant:"destructive"})}finally{l(!1)}};return o?r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading course details..."})}):a?r.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[r.jsxs("div",{className:"container mx-auto px-4 py-8 flex-grow",children:[r.jsx("div",{className:"mb-6",children:r.jsx(be,{to:"/events",children:r.jsxs(G,{variant:"ghost",className:"gap-2",children:[r.jsx(et,{className:"h-4 w-4"}),"Back to Events"]})})}),r.jsx("div",{className:"max-w-4xl mx-auto",children:r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:a.provider}),r.jsx(re,{className:"text-3xl",children:a.name})]}),r.jsx(Me,{variant:"outline",children:"Partner Event"})]}),a.description&&r.jsx(Pt,{className:"text-base whitespace-pre-line",dangerouslySetInnerHTML:{__html:pl(gl(a.description))}})]}),r.jsxs(H,{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Tr,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Date & Time"}),r.jsxs("p",{className:"font-medium",children:[rt(new Date(a.date),"dd.MM.yyyy"),a.time&&` at ${a.time}`,a.end_date&&r.jsxs("span",{children:[" - ",rt(new Date(a.end_date),"dd.MM.yyyy")]})]})]})]}),r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/50 rounded-lg",children:[r.jsx(Rn,{className:"h-5 w-5 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Location"}),r.jsx("p",{className:"font-medium",children:a.region})]})]})]}),r.jsx("div",{className:"pt-4 border-t",children:r.jsx("a",{href:a.website_url,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:r.jsxs(G,{size:"lg",className:"gap-2 shadow-elevation-medium hover:shadow-elevation-high hover:-translate-y-0.5 active:shadow-elevation-low active:translate-y-0.5 transition-all",children:["Details & Registration",r.jsx(At,{className:"h-4 w-4"})]})})}),a.image_url&&r.jsx("div",{className:"pt-6 border-t",children:s?r.jsx("p",{className:"text-muted-foreground text-center py-4",children:"Loading..."}):n?r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:"Exclusive for members:"}),r.jsx("img",{src:a.image_url,alt:"Member exclusive content",className:"max-w-xs mx-auto rounded-lg shadow-md"})]}):r.jsxs("div",{className:"text-center space-y-3 py-4 bg-muted/30 rounded-lg",children:[r.jsx("p",{className:"text-muted-foreground",children:"Log in to see exclusive member content"}),r.jsx(be,{to:`/auth?redirect=${encodeURIComponent(t.pathname)}`,children:r.jsxs(G,{variant:"outline",className:"gap-2",children:[r.jsx(xh,{className:"h-4 w-4"}),"Log In"]})})]})})]})]})})]}),r.jsx(qe,{})]}):r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background",children:[r.jsx("h1",{className:"text-2xl font-bold mb-4 text-foreground",children:"Course Not Found"}),r.jsx(be,{to:"/events",children:r.jsx(G,{variant:"outline",children:"Back to Events"})})]})},KW=()=>r.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-medical-blue/5 via-white to-medical-green/5",children:[r.jsx("div",{className:"container mx-auto px-4 py-16",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-medical-dark mb-6",children:"Contact Us"}),r.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"We'd love to hear from you"})]}),r.jsx(B,{className:"shadow-elevation-low border-0 bg-white/80 backdrop-blur-sm",children:r.jsx(H,{className:"p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-medical-blue/10 rounded-full mb-6",children:r.jsx(_d,{className:"h-8 w-8 text-medical-blue"})}),r.jsx("h2",{className:"text-2xl font-semibold text-medical-dark mb-6",children:"Get in Touch"}),r.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"We love to hear from you! If you have any questions, feedback, or would like to learn more about SEMSA, please don't hesitate to reach out. We're here to help and look forward to connecting with you."}),r.jsxs("div",{className:"bg-medical-blue/5 rounded-lg p-6 mb-8",children:[r.jsx("p",{className:"text-sm text-muted-foreground mb-2 text-center",children:"Send us an email at:"}),r.jsx("div",{className:"text-center",children:r.jsx("a",{href:"mailto:[email protected]",className:"inline-block text-lg sm:text-xl md:text-2xl font-semibold text-medical-blue hover:text-medical-blue/80 transition-colors duration-200",children:"[email protected]"})})]}),r.jsx("p",{className:"text-muted-foreground",children:"We will get back to you as soon as possible!"})]})})})]})}),r.jsx(qe,{})]});var ZW="Separator",r_="horizontal",XW=["horizontal","vertical"],nE=m.forwardRef((e,t)=>
550{const{decorative:n,orientation:s=r_,...a}=e,i=QW(s)?s:r_,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return r.jsx(Le.div,{"data-orientation":i,...l,...a,ref:t})});nE.displayName=ZW;function QW(e){return XW.includes(e)}var rE=nE;const Tw=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...s},a)=>r.jsx(rE,{ref:a,decorative:n,orientation:t,className:le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Tw.displayName=rE.displayName;const JW=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("div",{className:"container mx-auto px-4 py-12",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsx("h1",{className:"text-4xl font-bold text-center text-foreground mb-12",children:"Imprint & Privacy Policy"}),r.jsxs(B,{className:"mb-12",children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Imprint"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Responsible for content"}),r.jsxs("p",{className:"text-muted-foreground",children:["Swiss Emergency Medicine Student Association (SEMSA)",r.jsx("br",{}),"E-Mail: [email protected]"]})]}),r.jsx("div",{}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Disclaimer"}),r.jsx("p",{className:"text-muted-foreground",children:"The content of our pages has been created with the greatest care. However, we cannot guarantee the accuracy, completeness and timeliness of the content. As a service provider, we are responsible for our own content on these pages according to general laws pursuant to § 7 para. 1 TMG."})]})]})]}),r.jsx(Tw,{className:"my-12"}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{className:"text-2xl",children:"Privacy Policy"})}),r.jsxs(H,{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"1. Data protection at a glance"}),r.jsx("h4",{className:"font-medium mb-2",children:"General information"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"The following information provides a simple overview of what happens to your personal data when you visit our website. Personal data is all data that can be used to personally identify you."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"2. Data collection on our website"}),r.jsx("h4",{className:"font-medium mb-2",children:"Who is responsible for data collection on this website?"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Data processing on this website is carried out by the website operator. You can find their contact details in the imprint of this website."}),r.jsx("h4",{className:"font-medium mb-2",children:"How do we collect your data?"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Your data is collected when you provide it to us. This could be data you enter in a contact form, for example. Other data is collected automatically when you visit the website through our IT systems."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"3. Membership data"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"When registering for membership, we collect the following data:"}),r.jsxs("ul",{className:"list-disc list-inside text-muted-foreground space-y-1 mb-4",children:[r.jsx("li",{children:"First and last name"}),r.jsx("li",{children:"Email address"}),r.jsx("li",{children:"Phone number"}),r.jsx("li",{children:"Study location"}),r.jsx("li",{children:"Status (Student/Resident)"})]}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"We use this data exclusively for managing your membership and communicating association-relevant information."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"4. Your rights"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"You have the right at any time to receive information free of charge about the origin, recipients and purpose of your stored personal data. You also have the right to request the correction, blocking or deleti
550on of this data."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"5. Contact"}),r.jsxs("p",{className:"text-muted-foreground",children:["For questions about data protection, please contact:",r.jsx("br",{}),"Email: [email protected]"]})]}),r.jsx("div",{className:"text-sm text-muted-foreground pt-4 border-t",children:r.jsx("p",{children:"Last updated: August 2025"})})]})]})]})}),r.jsx(qe,{})]}),e7=()=>{const e=rs();return m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),r.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),r.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),r.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]}),r.jsx(qe,{})]})},go=Vf,Gf=Ew,t7=Yf,sE=m.forwardRef(({className:e,...t},n)=>r.jsx(ic,{ref:n,className:le("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));sE.displayName=ic.displayName;const Ni=m.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(t7,{children:[r.jsx(sE,{}),r.jsxs(oc,{ref:s,className:le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,r.jsxs(vu,{className:"absolute right-4 top-4 roun
550ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsx(Nn,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ni.displayName=oc.displayName;const Si=({className:e,...t})=>r.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Si.displayName="DialogHeader";const Yd=({className:e,...t})=>r.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yd.displayName="DialogFooter";const ki=m.forwardRef(({className:e,...t},n)=>r.jsx(lc,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",e),...t}));ki.displayName=lc.displayName;const Ci=m.forwardRef(({className:e,...t},n)=>r.jsx(cc,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Ci.displayName=cc.displayName;function n7(){const e=ta(),[t]=_o(),n=t.get("redirect"),{signIn:s,user:a,isMember:i,loading:o}=In(),{toast:l}=Sn(),[c,d]=m.useState(!1),[u,h]=m.useState(""),[f,p]=m.useState(!1),[w,v]=m.useState(!1),[b,x]=m.useState(""),[g,y]=m.useState(!1),[j,N]=m.useState(""),[k,_]=m.useState(!1),[P,$]=m.useState(!1),[M,O]=m.useState(!1),[A,U]=m.useState(!1);m.useEffect(()=>{const C=async F=>{var ie;const T=F==null?void 0:F.id,I=((ie=F==null?void 0:F.user_metadata)==null?void 0:ie.last_name)==="Test";let Y=!1;if(T){const{data:se}=await K.from("user_roles").select("role").eq("user_id",T);Y=(se==null?void 0:se.some(pe=>pe.role==="tutor"))??!1}await K.auth.signOut(),Y?O(!0):I?U(!0):$(!0)};(async()=>{var Re,De,de,R,X,ue,te;const F=new URLSearchParams(window.location.hash.substring(1)),T=F.get("type"),q=F.get("access_token"),I=F.get("error"),Y=F.get("error_description"),ie=new URLSearchParams(window.location.search),se=ie.get("error")||ie.get("error_code"),pe=ie.get("error_description"),_e=ie.get("
550code"),Pe=ie.get("token_hash"),ke=ie.get("type");if(se){console.error("Auth error (query):",se,pe),l({title:"Link Invalid",description:pe||"The link has expired or been used. Please request a new one.",variant:"destructive"}),window.history.replaceState(null,"",window.location.pathname);return}if(_e||Pe){d(!0),window.history.replaceState(null,"",window.location.pathname);let Ce=null,he=null;if(_e){const{data:Be,error:Nt}=await K.auth.exchangeCodeForSession(_e);Ce=(Be==null?void 0:Be.user)??null,he=Nt}else if(Pe){const{data:Be,error:Nt}=await K.auth.verifyOtp({token_hash:Pe,type:ke||"signup"});Ce=(Be==null?void 0:Be.user)??null,he=Nt}if(he){console.error("Auth link verification failed:",he),l({title:"Link Invalid",description:he.message||"The link has expired or been used. Please request a new one.",variant:"destructive"}),d(!1);return}if(ke==="recovery"||ke==="invite"){v(!0),Ce!=null&&Ce.email&&x(Ce.email),d(!1);return}await C(Ce),d(!1);return}if(I){console.error("Auth error:",I,Y),l({title:"Link Invalid",description:Y||"The link has expired or been used. Please request a new one.",variant:"destructive"}),window.history.replaceState(null,"",window.location.pathname+window.location.search);return}if(T==="signup"){window.history.replaceState(null,"",window.location.pathname+window.location.search);const Ce=F.get("token_hash");if(Ce){d(!0);const{data:he,error:Be}=await K.auth.verifyOtp({token_hash:Ce,type:"signup"});if(Be)console.error("Email confirmation error:",Be),l({title:"Email Confirmation Failed",description:Be.message,variant:"destructive"}),d(!1);else{const Nt=(Re=he==null?void 0:he.user)==null?void 0:Re.id,Ze=((de=(De=he==null?void 0:he.user)==null?void 0:De.user_metadata)==null?void 0:de.last_name)==="Test";let st=!1;if(Nt){const{data:Ke}=await K.from("user_roles").select("role").eq("user_id",Nt);st=(Ke==null?void 0:Ke.some(bt=>bt.role==="tutor"))??!1}await K.auth.signOut(),Ze?st?O(!0):U(!0):st?O(!0):$(!0),d(!1)}}else if(q){d(!0);const{data:{session:he}}=await K.auth.getSession(),Be=(R=he==null?void 0:he.user)==null?void 0:R.id,dt=((ue=(X=he==null?void 0:he.user)==null?void 0:X.user_metadata)==null?void 0:ue.last_name)==="Test";let Ze=!1;if(Be){const{data:st}=await K.from("user_roles").select("role").eq("user_id",Be);Ze=(st==null?void 0:st.some(Ke=>Ke.role==="tutor"))??!1}await K.auth.signOut(),dt?Ze?O(!0):U(!0):Ze?O(!0):$(!0),d(!1)}return}if((T==="invite"||T==="recovery")&&q){v(!0);const{data:{session:Ce},error:he}=await K.auth.getSession();(te=Ce==null?void 0:Ce.user)!=null&&te.email&&x(Ce.user.email),he&&(console.error("Error getting session:",he),l({title:"Error",description:"Invalid or expired link. Please contact support.",variant:"destructive"}))}else a&&i&&!o&&e(n||"/member-dashboard")})()},[a,i,o,e,l,n]);const W=async C=>{var I;C.preventDefault(),d(!0),y(!1),_(!1);const D=new FormData(C.currentTarget),F=D.get("email"),T=D.get("password");N(F);const{error:q}=await s(F,T);q?(I=q.message)!=null&&I.toLowerCase().includes("email not confirmed")?(y(!0),l({title:"Email not confirmed",description:"Please confirm your email before logging in.",variant:"destructive"})):q.isPendingApproval&&_(!0):e(n||"/member-dashboard"),d(!1)},E=async()=>{if(!j)return;d(!0);const{error:C}=await K.auth.resend({type:"signup",email:j,options:{emailRedirectTo:"https://semsa.ch/auth"}});C?l({title:"Failed to resend",description:C.message,variant:"destructive"}):(l({title:"Confirmation email sent",description:"Please check your inbox for a new confirmation link."}),y(!1)),d(!1)},S=async C=>{C.preventDefault(),d(!0);const D=new FormData(C.currentTarget),F=D.get("password"),T=D.get("confirmPassword");if(F!==T){l({title:"Passwords don't match",description:"Please make sure both passwords are the same",variant:"destructive"}),d(!1);return}if(F.length<6){l({title:"Password too short",description:"Password must be at least 6 characters",variant:"destructive"}),d(!1);return}const{error:q}=await K.auth.updateUser({password:F});q?l({title:"Error setting password",description:q.message,variant:"destructive"}):(l({title:"Password set successfully",description:"You can now log in with your new password"}),v(!1),window.location.hash="",e("/member-dashboard")),d(!1)},L=async()=>
550{if(!u){l({title:"Email required",description:"Please enter your email address",variant:"destructive"});return}d(!0);const{error:C}=await K.auth.resetPasswordForEmail(u,{redirectTo:"https://semsa.ch/auth"});C?l({title:"Error sending reset email",description:C.message,variant:"destructive"}):(l({title:"Reset email sent",description:"Check your email for a password reset link"}),p(!1),h("")),d(!1)};return r.jsxs("div",{className:"min-h-screen flex flex-col",children:[r.jsx("main",{className:"flex-1 container mx-auto px-4 py-8 max-w-md",children:r.jsxs(B,{className:"w-full",children:[r.jsxs(ne,{children:[r.jsx(re,{children:w?"Set Your Password":"Member Login"}),r.jsx(Pt,{children:w?"Create a password for your SEMSA account. Do not reload this page until complete.":"Enter your credentials to access member features"})]}),r.jsx(H,{children:w?r.jsxs("form",{onSubmit:S,className:"space-y-4",children:[b&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"Email"}),r.jsx(xe,{value:b,disabled:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"password",children:"Password"}),r.jsx(xe,{id:"password",name:"password",type:"password",required:!0,minLength:6,placeholder:"••••••••"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"confirmPassword",children:"Confirm Password"}),r.jsx(xe,{id:"confirmPassword",name:"confirmPassword",type:"password",required:!0,minLength:6,placeholder:"••••••••"})]}),r.jsx(G,{type:"submit",className:"w-full",disabled:c,children:c?"Setting Password...":"Set Password"})]}):r.jsxs("form",{onSubmit:W,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"login-email",children:"Email"}),r.jsx(xe,{id:"login-email",name:"email",type:"email",required:!0,placeholder:"[email protected]"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"login-password",children:"Password"}),r.jsx(xe,{id:"login-password",name:"password",type:"password",required:!0,placeholder:"••••••••"})]}),r.jsx(G,{type:"submit",className:"w-full",disabled:c,children:c?"Logging in...":"Login"}),A&&r.jsxs(Bs,{className:"border-green-500 bg-green-50 text-green-900",children:[r.jsx(tm,{className:"h-4 w-4 text-green-600"}),r.jsx(sl,{className:"text-green-900",children:"Email confirmed — account pending"}),r.jsxs(Hs,{className:"text-green-800",children:["Thanks for confirming your email address. You should receive the annual invoice within the next 7 days. If not, please contact us at ",r.jsx("a",{href:"mailto:[email protected]",className:"underline font-medium",children:"[email protected]"}),".",r.jsx("br",{}),r.jsx("br",{}),"Once payment is completed and membership approved, your account will be activated.",r.jsx("br",{}),r.jsx("br",{}),"In the meantime you can still sign up for our events without logging in — just use the registration form on the ",r.jsx("a",{href:"/events",className:"underline font-medium",children:"events page"}),". The member price already applies to your registrations."]})]}),P&&r.jsxs(Bs,{className:"border-green-500 bg-green-50 text-green-900",children:[r.jsx(tm,{className:"h-4 w-4 text-green-600"}),r.jsx(sl,{className:"text-green-900",children:"Email confirmed — account pending"}),r.jsxs(Hs,{className:"text-green-800",children:["Thanks for confirming your email address. You should receive the annual invoice within the next 7 days. If not, please contact us at ",r.jsx("a",{href:"mailto:[email protected]",className:"underline font-medium",children:"[email protected]"}),".",r.jsx("br",{}),r.jsx("br",{}),"Once payment is completed and membership approved, your account will be activated.",r.jsx("br",{}),r.jsx("br",{}),"In the meantime you can still sign up for our events without logging in — just use the registration form on the ",r.jsx("a",{href:"/events",className:"underline font-medium",children:"events page"}),". The member price already applies to your registrations."]})]}),M&&r.jsxs(Bs,{className:"border-green-500 bg-green-50 text-green-900",children:[r.jsx(tm,{className:"h-4 w-4 text-green-600"}),r.jsx(sl,{className:"text-green-900",children:"Email confirmed — account pending"}
550),r.jsx(Hs,{className:"text-green-800",children:"Thank you for confirming your email address. Once your membership has been approved by the board, you will receive a notification about the activation of your account."})]}),k&&r.jsxs(Bs,{variant:"destructive",className:"border-amber-500 bg-amber-50 text-amber-900",children:[r.jsx(tm,{className:"h-4 w-4 text-amber-600"}),r.jsx(sl,{className:"text-amber-900",children:"Account not active yet"}),r.jsxs(Hs,{className:"text-amber-800",children:["Your account has been created, but it's not active yet. In most cases, this means the membership fee hasn't been paid.",r.jsx("br",{}),r.jsx("br",{}),"Once the payment is completed, you'll be able to log in. If you've already paid, please allow some time for approval by the board.",r.jsx("br",{}),r.jsx("br",{}),"If you haven't received the annual invoice by email yet, please contact us at ",r.jsx("a",{href:"mailto:[email protected]",className:"underline font-medium",children:"[email protected]"}),r.jsx("br",{}),r.jsx("br",{}),"In the meantime you can still sign up for our events without logging in — just use the registration form on the ",r.jsx("a",{href:"/events",className:"underline font-medium",children:"events page"}),". The member price already applies to your registrations."]})]}),g&&r.jsxs("div",{className:"p-4 border border-yellow-200 bg-yellow-50 rounded-lg space-y-2",children:[r.jsx("p",{className:"text-sm text-yellow-800",children:"Your email hasn't been confirmed yet. Please check your inbox or request a new confirmation link."}),r.jsx(G,{type:"button",variant:"outline",onClick:E,disabled:c,className:"w-full",children:c?"Sending...":"Resend Confirmation Email"})]}),r.jsxs(go,{open:f,onOpenChange:p,children:[r.jsx(Gf,{asChild:!0,children:r.jsx(G,{type:"button",variant:"link",className:"w-full",children:"Forgot Password?"})}),r.jsxs(Ni,{children:[r.jsxs(Si,{children:[r.jsx(ki,{children:"Reset Password"}),r.jsx(Ci,{children:"Enter your email address and we'll send you a link to reset your password."})]}),r.jsxs("div",{className:"space-y-4 pt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"reset-email",children:"Email"}),r.jsx(xe,{id:"reset-email",type:"email",value:u,onChange:C=>h(C.target.value),placeholder:"[email protected]"})]}),r.jsx(G,{onClick:L,className:"w-full",disabled:c,children:c?"Sending...":"Send Reset Link"})]})]})]}),r.jsx("div",{className:"mt-6 pt-6 border-t",children:r.jsxs("div",{className:"text-center space-y-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't have an account yet?"}),r.jsx(be,{to:"/membership",children:r.jsxs(G,{variant:"outline",className:"w-full group",children:["Become a Member",r.jsx(pr,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]})})]})})]})})]})}),r.jsx(qe,{})]})}const vg=768;function yu(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${vg-1}px)`),s=()=>{t(window.innerWidth<vg)};return n.addEventListener("change",s),t(window.innerWidth<vg),()=>n.removeEventListener("change",s)},[]),!!e}const Pw=Vf,r7=Yf,aE=m.forwardRef(({className:e,...t},n)=>r.jsx(ic,{className:le("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));aE.displayName=ic.displayName;const s7=Pi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kf=m.forwardRef(({side:e="right",className:t,children:n,...s},a)=>r.jsxs(r7,{children:[r.jsx(aE,{}),r.jsxs(oc,{ref:a,className:le(s7({side:e}),t),...s,children:[n,r.jsxs(vu,{className:"absolute right-4 top-4 roun
550ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[r.jsx(Nn,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kf.displayName=oc.displayName;const Rw=({className:e,...t})=>r.jsx("div",{className:le("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rw.displayName="SheetHeader";const Mw=m.forwardRef(({className:e,...t},n)=>r.jsx(lc,{ref:n,className:le("text-lg font-semibold text-foreground",e),...t}));Mw.displayName=lc.displayName;const Dw=m.forwardRef(({className:e,...t},n)=>r.jsx(cc,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Dw.displayName=cc.displayName;function s_({className:e,...t}){return r.jsx("div",{className:le("animate-pulse rounded-md bg-muted",e),...t})}const a7="sidebar:state",i7=60*60*24*7,o7="16rem",l7="18rem",c7="3rem",d7="b",iE=m.createContext(null);function Zf(){const e=m.useContext(iE);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const oE=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:s,style:a,children:i,...o},l)=>{const c=yu(),[d,u]=m.useState(!1),[h,f]=m.useState(e),p=t??h,w=m.useCallback(g=>{const y=typeof g=="function"?g(p):g;n?n(y):f(y),document.cookie=`${a7}=${y}; path=/; max-age=${i7}`},[n,p]),v=m.useCallback(()=>c?u(g=>!g):w(g=>!g),[c,w,u]);m.useEffect(()=>{const g=y=>{y.key===d7&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),v())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[v]);const b=p?"expanded":"collapsed",x=m.useMemo(()=>({state:b,open:p,setOpen:w,isMobile:c,openMobile:d,setOpenMobile:u,toggleSidebar:v}),[b,p,w,c,d,u,v]);return r.jsx(iE.Provider,{value:x,children:r.jsx(lk,{delayDuration:0,children:r.jsx("div",{style:{"--sidebar-width":o7,"--sidebar-width-icon":c7,...a},className:le("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",s),ref:l,...o,children:i})})})});oE.displayName="SidebarProvider";const lE=m.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:s,children:a,...i},o)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:u}=Zf();return n==="none"?r.jsx("div",{className:le("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",s),ref:o,...i,children:a}):l?r.jsx(Pw,{open:d,onOpenChange:u,...i,children:r.jsx(Kf,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":l7},side:e,children:r.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):r.jsxs("div",{ref:o,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,children:[r.jsx("div",{className:le("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),r.jsx("div",{className:le("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:r.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});lE.displayName="Sidebar";const cE=m.forwardRef(({className:e,onClick:t,...n},s)=>{const{toggleSidebar:a}=Zf();return r.jsxs(G,{ref:s,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:le("h-7 w-7",e),onClick:i=>{t==null||t(i),a()},...n,children:[r.jsx(V4,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});cE.displayName="SidebarTrigger";const u7=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:s}=Zf();return r.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:le("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});u7.displayName="SidebarRail";const m7=m.forwardRef(({className:e,...t},n)=>r.jsx("main",{ref:n,className:le("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
550h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));m7.displayName="SidebarInset";const h7=m.forwardRef(({className:e,...t},n)=>r.jsx(xe,{ref:n,"data-sidebar":"input",className:le("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));h7.displayName="SidebarInput";const dE=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"header",className:le("flex flex-col gap-2 p-2",e),...t}));dE.displayName="SidebarHeader";const uE=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"footer",className:le("flex flex-col gap-2 p-2",e),...t}));uE.displayName="SidebarFooter";const f7=m.forwardRef(({className:e,...t},n)=>r.jsx(Tw,{ref:n,"data-sidebar":"separator",className:le("mx-2 w-auto bg-sidebar-border",e),...t}));f7.displayName="SidebarSeparator";const mE=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"content",className:le("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mE.displayName="SidebarContent";const hE=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"group",className:le("relative flex w-full min-w-0 flex-col p-2",e),...t}));hE.displayName="SidebarGroup";const fE=m.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const a=t?jr:"div";return r.jsx(a,{ref:s,"data-sidebar":"group-label",className:le("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});fE.displayName="SidebarGroupLabel";const p7=m.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const a=t?jr:"button";return r.jsx(a,{ref:s,"data-sidebar":"group-action",className:le("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});p7.displayName="SidebarGroupAction";const pE=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"group-content",className:le("w-full text-sm",e),...t}));pE.displayName="SidebarGroupContent";const vv=m.forwardRef(({className:e,...t},n)=>r.jsx("ul",{ref:n,"data-sidebar":"menu",className:le("flex w-full min-w-0 flex-col gap-1",e),...t}));vv.displayName="SidebarMenu";const yv=m.forwardRef(({className:e,...t},n)=>r.jsx("li",{ref:n,"data-sidebar":"menu-item",className:le("group/menu-item relative",e),...t}));yv.displayName="SidebarMenuItem";const g7=Pi("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),wv=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:s="default",tooltip:a,className:i,...o},l)=>{const c=e?jr:"button",{isMobile:d,state:u}=Zf(),h=r.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:le(g7({variant:n,size:s}),i),...o});
550return a?(typeof a=="string"&&(a={children:a}),r.jsxs(LI,{children:[r.jsx(FI,{asChild:!0,children:h}),r.jsx(ck,{side:"right",align:"center",hidden:u!=="collapsed"||d,...a})]})):h});wv.displayName="SidebarMenuButton";const x7=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...s},a)=>{const i=t?jr:"button";return r.jsx(i,{ref:a,"data-sidebar":"menu-action",className:le("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...s})});x7.displayName="SidebarMenuAction";const v7=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:le("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));v7.displayName="SidebarMenuBadge";const y7=m.forwardRef(({className:e,showIcon:t=!1,...n},s)=>{const a=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return r.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:le("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&r.jsx(s_,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),r.jsx(s_,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});y7.displayName="SidebarMenuSkeleton";const w7=m.forwardRef(({className:e,...t},n)=>r.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:le("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));w7.displayName="SidebarMenuSub";const b7=m.forwardRef(({...e},t)=>r.jsx("li",{ref:t,...e}));b7.displayName="SidebarMenuSubItem";const j7=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:s,...a},i)=>{const o=e?jr:"a";return r.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:le("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...a})});j7.displayName="SidebarMenuSubButton";function _7({variant:e}){const{isAdmin:t,isMember:n,isTutor:s,isPending:a,signOut:i}=In(),o=rs(),[l]=_o(),c=l.get("section"),u=[{label:"Account",items:[{id:"overview",label:"Overview",icon:ph,to:"/member-dashboard?section=overview"},{id:"courses",label:"My Events",icon:Kr,to:"/member-dashboard?section=courses"},{id:"profile",label:"My Profile",icon:mf,to:"/member-dashboard?section=profile"}]},...(n||s||t)&&!a?[{label:"Resources",items:[{id:"resources",label:"Resources",icon:jS,to:"/member-dashboard?section=resources"}]}]:[],...t?[{label:"Admin",items:[{id:"admin",label:"Admin Dashboard",icon:uf,to:"/admin-dashboard",external:!0}]}]:[]],f=e==="admin"?[{label:"Admin",items:[{id:"members",label:"Members",
550icon:Ht,to:"/admin-dashboard?section=members"},{id:"courses",label:"Courses",icon:Kr,to:"/admin-dashboard?section=courses"},{id:"payments",label:"Payments",icon:O4,to:"/admin-dashboard?section=payments"},{id:"reviews",label:"Reviews",icon:Rx,to:"/admin-dashboard?section=reviews"}]},{label:"Account",items:[{id:"overview",label:"Member Dashboard",icon:ph,to:"/member-dashboard",external:!0}]}]:u,p=w=>w.external?o.pathname===w.to.split("?")[0]:c===w.id||!c&&w.id===(e==="admin"?"members":"overview");return r.jsxs(lE,{collapsible:"icon",children:[r.jsx(dE,{children:r.jsx("div",{className:"px-2 py-2 text-sm font-semibold",children:e==="admin"?"Admin":"Dashboard"})}),r.jsx(mE,{children:f.map(w=>r.jsxs(hE,{children:[r.jsx(fE,{children:w.label}),r.jsx(pE,{children:r.jsx(vv,{children:w.items.map(v=>r.jsx(yv,{children:r.jsx(wv,{asChild:!0,isActive:p(v),children:r.jsxs(Ok,{to:v.to,end:v.external,children:[r.jsx(v.icon,{className:"h-4 w-4"}),r.jsx("span",{children:v.label})]})})},v.id))})})]},w.label))}),r.jsx(uE,{children:r.jsx(vv,{children:r.jsx(yv,{children:r.jsxs(wv,{onClick:i,children:[r.jsx(H4,{className:"h-4 w-4"}),r.jsx("span",{children:"Sign out"})]})})})})]})}function gE({variant:e,title:t,children:n}){return r.jsx(oE,{children:r.jsxs("div",{className:"min-h-screen flex w-full",children:[r.jsx(_7,{variant:e}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[r.jsxs("header",{className:"h-12 flex items-center border-b px-4 gap-3",children:[r.jsx(cE,{}),r.jsx("h1",{className:"text-base font-semibold truncate",children:t})]}),r.jsx("main",{className:"flex-1 container mx-auto px-4 py-6 min-w-0",children:n}),r.jsx(qe,{})]})]})})}function a_(){const{user:e,isAdmin:t,isMember:n,isTutor:s,isPending:a}=In(),i=(n||s||t)&&!a;return r.jsxs("div",{className:"space-y-6 max-w-4xl",children:[r.jsxs("div",{children:[r.jsxs("h2",{className:"text-2xl font-bold",children:["Welcome",e!=null&&e.email?`, ${e.email}`:""]}),r.jsx("p",{className:"text-muted-foreground mt-1",children:a?"Your account is pending approval.":"Manage your profile, access resources, and more from the sidebar."})]}),a&&r.jsx(B,{className:"border-yellow-500",children:r.jsxs(ne,{children:[r.jsx(re,{children:"Pending Approval"}),r.jsx(Pt,{children:"Your account is awaiting admin approval. You'll receive an email once approved."})]})}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(mf,{className:"h-5 w-5"})," My Profile"]}),r.jsx(Pt,{children:"View and update your profile and password"})]}),r.jsx(H,{children:r.jsx(be,{to:"/member-dashboard?section=profile",children:r.jsxs(G,{variant:"outline",className:"gap-2",children:["Open Profile ",r.jsx(pr,{className:"h-4 w-4"})]})})})]}),r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(su,{className:"h-5 w-5"})," My Events"]}),r.jsx(Pt,{children:"Your upcoming, past and waitlisted SEMSA events"})]}),r.jsx(H,{children:r.jsx(be,{to:"/member-dashboard?section=courses",children:r.jsxs(G,{variant:"outline",className:"gap-2",children:["Open My Events ",r.jsx(pr,{className:"h-4 w-4"})]})})})]}),i&&r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(jS,{className:"h-5 w-5"})," Featured Resource"]}),r.jsx(Pt,{children:"Highlighted resource for SEMSA members"})]}),r.jsxs(H,{className:"space-y-3",children:[r.jsxs("div",{className:"text-sm",children:[r.jsx("div",{className:"font-medium",children:rn.title}),r.jsx("p",{className:"text-muted-foreground mt-1",children:rn.shortDescription})]}),r.jsx(be,{to:`/member-dashboard?section=resources&resource=${rn.id}`,children:r.jsxs(G,{variant:"outline",className:"gap-2",children:["Open Resource ",r.jsx(pr,{className:"h-4 w-4"})]})})]})]}),t&&r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{className:"flex items-center gap-2",children:[r.jsx(uf,{className:"h-5 w-5"})," Admin"]}),r.jsx(Pt,{children:"Administrative tools and management"})]}),r.jsx(H,{children:r.jsx(be,{to:"/admin-dashboard",children:r.jsxs(G,{variant:"outline",className:"gap-2",children:["Open Admin Dashboard ",r.jsx(pr,{className:"h-4 w-4"})]})})})]})]})]})}var Ow="Switch",[N7,pK]=zr(Ow),[S7,k7]=N7(Ow),xE=m.forwardRef((e,t)=>
550{const{__scopeSwitch:n,name:s,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...h}=e,[f,p]=m.useState(null),w=ct(t,y=>p(y)),v=m.useRef(!1),b=f?u||!!f.closest("form"):!0,[x=!1,g]=es({prop:a,defaultProp:i,onChange:d});return r.jsxs(S7,{scope:n,checked:x,disabled:l,children:[r.jsx(Le.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":wE(x),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:w,onClick:we(e.onClick,y=>{g(j=>!j),b&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),b&&r.jsx(C7,{control:f,bubbles:!v.current,name:s,value:c,checked:x,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});xE.displayName=Ow;var vE="SwitchThumb",yE=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...s}=e,a=k7(vE,n);return r.jsx(Le.span,{"data-state":wE(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})});yE.displayName=vE;var C7=e=>{const{control:t,checked:n,bubbles:s=!0,...a}=e,i=m.useRef(null),o=ow(n),l=Uy(t);return m.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&h){const f=new Event("click",{bubbles:s});h.call(c,n),c.dispatchEvent(f)}},[o,n,s]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function wE(e){return e?"checked":"unchecked"}var bE=xE,A7=yE;const ti=m.forwardRef(({className:e,...t},n)=>r.jsx(bE,{className:le("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:r.jsx(A7,{className:le("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ti.displayName=bE.displayName;const xm={doctor:["Medical Student","Resident Physician","Attending Physician","Senior Physician (Oberarzt/Oberärztin)","Consultant","Chief Physician (Chefarzt/Chefärztin)","Professor"],nurse:["Nursing Student","Registered Nurse","Specialist Nurse (NDS)","Nurse Practitioner","Head Nurse"],paramedic:["Transport Sanitarian","Paramedic (dipl. Rettungssanitäter HF)","Lead Paramedic","EMS Officer"],other:["Other"]},vm={doctor:["Clinical Practice","Teaching / Education","Research","Administration / Leadership","Prehospital / EMS"],nurse:["Clinical Practice","Teaching / Education","Research","Administration / Leadership","Prehospital / EMS"],paramedic:["Operational EMS","Teaching / Education","Dispatch","Administration / Leadership"],other:["Other"]},yg=["Emergency Medicine","Internal Medicine","Anesthesiology","Surgery / Trauma","Pediatrics","Intensive Care","Prehospital / EMS","Disaster Medicine","Wilderness Medicine","Toxicology","Cardiology","Neurology","Ultrasound (POCUS)","Airway Management","BLS / ACLS / ATLS Instruction"],La="__other__",E7=Ut.object({professional_title:Ut.string().trim().min(1,"Professional title is required").max(120),professional_function:Ut.string().trim().min(1,"Professional function is required").max(120),workplace:Ut.string().trim().max(200).optional().or(Ut.literal("")),bio:Ut.string().trim().max(1500).optional().or(Ut.literal("")),linkedin_url:Ut.string().trim().url("Must be a valid URL").max(300).optional().or(Ut.literal("")),website_url:Ut.string().trim().url("Must be a valid URL").max(300).optional().or(Ut.literal("")),specialties:Ut.array(Ut.string()).min(1,"Select at least one specialty").max(15)}),T7=5*1024*1024,P7=["image/jpeg","image/png","image/webp"];function wg(e){const t=(e||"").toLowerCase();return t.includes("doctor")||t.includes("physician")||t.includes("medical")?"doctor":t.includes("nurse")?"nurse":t.includes("paramedic")||t.includes("ems")||t.includes("rettung")?"paramedic":"other"}function jE(){var D,F;const{user:e}=In(),{toast:t}=Sn(),n=m.useRef(null),[s,a]=m.useState(null),[i,o]=m.useState(null),[l,c]=m.useState(!0),[d,u]=m.useState(!1),[h,f]=m.useState(!1),[p,w]=m.useState({}),[v,b]=m.useState(""),[x,g]=m.useState(""),[y,j]=m.useState(""),[N,k]=m.useState(""),[_,P]=m.useState("");m.useEffect(()=>{e&&M()},[e]);const $=m.useMemo(()=>wg(s==null?void 0:s.profession),[s==null?void 0:s.profession]);async function M(){if(!e)return;c(!0);const[{data:T},{data:q}]=await Promise.all([K.from("profiles").select("first_name,last_name,email,profession,career_stage,languages").eq("id",e.id).maybeSingle(),K.from("tutor_profiles").select("*").eq("user_id",e.id).maybeSingle()]);a(T);const I=q??{user_id:e.id,professional_title:null,professional_function:null,workplace:null,bio:null,linkedin_url:null,website_url:null,specialties:[],photo_url:null,is_public:!1};o(I);const Y=xm[wg(T==null?void 0:T.profession)]||xm.other;I.professional_title&&Y.includes(I.professional_title)?b(I.professional_title):I.professional_title&&(b(La),g(I.professional_title));const ie=vm[wg(T==null?void 0:T.profession)]||vm.other;I.professional_function&&ie.includes(I.professional_function)?j(I.professional_function):I.professional_function&&(j(La),k(I.professional_function)),c(!1)}const O=xm[$]||xm.other,A=vm[$]||vm.other;function U(T){if(!i)return;const q=i.specialties??[];o({...i,specialties:q.includes(T)?q.filter(I=>I!==T):[...q,T]})}function W(){if(!i)return;const T=_.trim();if(!T)return;const q=i.specialties??[];q.includes(T)||(o({...i,specialties:[...q,T]}),P(""))}async function E(T){var pe,_e;const q=(pe=T.target.files)==null?void 0:pe[0];if(!q||!e||!i)return;if(!P7.includes(q.type)){t({title:"Invalid file type",description:"Use JPEG, PNG or WebP.",variant:"destructive"});return}if(q.size>T7){t({title:"File too large",description:"Maximum 5 MB.",variant:"destructive"});return}f(!0);const I=((_e=q.name.split(".").pop())==null?void 0:_e.toLowerCase())||"jpg",Y=`${e.id}/photo-${Date.now()}.${I}`,{error:ie}=await K.storage.from("tutor-photos").upload(Y,q,{upsert:!0,contentType:q.type});if(ie){f(!1),t({title:"Upload failed",description:ie.message,variant:"destructive"});return}const{data:se}=K.storage.from("tutor-photos").getPublicUrl(Y);o({...i,photo_url:se.publicUrl}),f(!1),t({title:"Photo uploaded",description:"Remember to save your profile."})}async function S(){i&&o({...i,photo_url:null})}async function L(){if(!i||!e)return;const T={professional_title:v===La?x.trim():v,professional_function:y===La?N.trim():y,workplace:i.workplace??"",bio:i.bio??"",linkedin_url:i.linkedin_url??"",website_url:i.website_url??"",specialties:i.specialties??[]},q=E7.safeParse(T);if(!q.success){const ie={};
550q.error.issues.forEach(se=>{ie[se.path[0]]=se.message}),w(ie),t({title:"Please fix the highlighted fields",variant:"destructive"});return}w({}),u(!0);const I={user_id:e.id,professional_title:q.data.professional_title,professional_function:q.data.professional_function,workplace:q.data.workplace||null,bio:q.data.bio||null,linkedin_url:q.data.linkedin_url||null,website_url:q.data.website_url||null,specialties:q.data.specialties,photo_url:i.photo_url,is_public:i.is_public},{error:Y}=await K.from("tutor_profiles").upsert(I,{onConflict:"user_id"});if(u(!1),Y){t({title:"Save failed",description:Y.message,variant:"destructive"});return}t({title:"Tutor profile saved"}),M()}if(l||!i)return r.jsxs(B,{children:[r.jsx(ne,{children:r.jsx(re,{children:"Tutor Information"})}),r.jsx(H,{className:"flex items-center justify-center py-8",children:r.jsx(xa,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]});const C=`${((D=s==null?void 0:s.first_name)==null?void 0:D[0])??""}${((F=s==null?void 0:s.last_name)==null?void 0:F[0])??""}`.toUpperCase()||"T";return r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Tutor Information"}),r.jsx(Pt,{children:"Your public-facing profile in the SEMSA tutor directory. Personal details from your member profile are reused automatically."})]}),r.jsxs(H,{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs(Mf,{className:"h-20 w-20",children:[i.photo_url&&r.jsx(Df,{src:i.photo_url,alt:"Profile photo"}),r.jsx(Of,{children:C})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx("input",{ref:n,type:"file",accept:"image/jpeg,image/png,image/webp",className:"hidden",onChange:E}),r.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var T;return(T=n.current)==null?void 0:T.click()},disabled:h,children:[h?r.jsx(xa,{className:"h-4 w-4 animate-spin mr-2"}):r.jsx(SS,{className:"h-4 w-4 mr-2"}),i.photo_url?"Replace photo":"Upload photo"]}),i.photo_url&&r.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:S,children:[r.jsx(Nn,{className:"h-4 w-4 mr-2"})," Remove"]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"JPEG, PNG or WebP. Max 5 MB."})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"Professional Title *"}),r.jsxs(mt,{value:v,onValueChange:b,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Select your title"})}),r.jsxs(lt,{children:[O.map(T=>r.jsx(fe,{value:T,children:T},T)),r.jsx(fe,{value:La,children:"Other…"})]})]}),v===La&&r.jsx(xe,{placeholder:"Enter custom title",value:x,onChange:T=>g(T.target.value),maxLength:120}),p.professional_title&&r.jsx("p",{className:"text-sm text-destructive",children:p.professional_title})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"Professional Function *"}),r.jsxs(mt,{value:y,onValueChange:j,children:[r.jsx(ot,{children:r.jsx(ht,{placeholder:"Select your function"})}),r.jsxs(lt,{children:[A.map(T=>r.jsx(fe,{value:T,children:T},T)),r.jsx(fe,{value:La,children:"Other…"})]})]}),y===La&&r.jsx(xe,{placeholder:"Enter custom function",value:N,onChange:T=>k(T.target.value),maxLength:120}),p.professional_function&&r.jsx("p",{className:"text-sm text-destructive",children:p.professional_function})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"Specialties / Areas of Expertise *"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:yg.map(T=>{var I;const q=(I=i.specialties)==null?void 0:I.includes(T);return r.jsx("button",{type:"button",onClick:()=>U(T),className:`text-xs px-3 py-1 rounded-full border transition ${q?"bg-primary text-primary-foreground border-primary":"bg-background hover:bg-muted"}`,children:T},T)})}),i.specialties&&i.specialties.filter(T=>!yg.includes(T)).length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:i.specialties.filter(T=>!yg.includes(T)).map(T=>r.jsxs(Me,{variant:"secondary",className:"gap-1",children:[T,r.jsx("button",{onClick:()=>U(T),"aria-label":`Remove ${T}`,children:r.jsx(Nn,{className:"h-3 w-3"})})]},T))}),r.jsxs("div",{className:"flex gap-2 pt-2",children:[r.jsx(xe,{placeholder:"Add custom specialty",value:_,onCh
550ange:T=>P(T.target.value),maxLength:80,onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),W())}}),r.jsx(G,{type:"button",variant:"outline",onClick:W,children:"Add"})]}),p.specialties&&r.jsx("p",{className:"text-sm text-destructive",children:p.specialties})]}),r.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"tutor_linkedin",children:"LinkedIn URL"}),r.jsx(xe,{id:"tutor_linkedin",type:"url",value:i.linkedin_url??"",onChange:T=>o({...i,linkedin_url:T.target.value}),placeholder:"https://linkedin.com/in/…"}),p.linkedin_url&&r.jsx("p",{className:"text-sm text-destructive",children:p.linkedin_url})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"tutor_website",children:"Website URL"}),r.jsx(xe,{id:"tutor_website",type:"url",value:i.website_url??"",onChange:T=>o({...i,website_url:T.target.value}),placeholder:"https://…"}),p.website_url&&r.jsx("p",{className:"text-sm text-destructive",children:p.website_url})]})]}),r.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"font-medium text-sm",children:"Show in public tutor directory"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"When enabled, your profile will appear in the upcoming public tutor directory."})]}),r.jsx(ti,{checked:i.is_public,onCheckedChange:T=>o({...i,is_public:T})})]}),r.jsx("div",{className:"flex justify-end gap-2 pt-2",children:r.jsxs(G,{onClick:L,disabled:d,children:[d&&r.jsx(xa,{className:"h-4 w-4 animate-spin mr-2"}),"Save Tutor Information"]})})]})]})}function R7(){const{user:e,isTutor:t,isAdmin:n}=In(),{toast:s}=Sn(),a=t||n,[i,o]=m.useState(null),[l,c]=m.useState(!1),[d,u]=m.useState(!1),[h,f]=m.useState({first_name:"",last_name:"",email:"",job_title:"",university:"",year_of_study:"",phone:"",profession:null,career_stage:null,training_year:null,graduation_year:null,institution:null,languages:null}),[p,w]=m.useState({newPassword:"",confirmPassword:""});m.useEffect(()=>{e&&v()},[e]);const v=async()=>{if(!e)return;const{data:g,error:y}=await K.from("profiles").select("first_name, last_name, email, job_title, university, year_of_study, phone, profession, career_stage, training_year, graduation_year, institution, languages").eq("id",e.id).single();if(y)s({title:"Error loading profile",description:y.message,variant:"destructive"});else if(g){const j=g;o(j),f(j)}},b=async()=>{var j,N,k,_,P,$,M,O,A,U;if(!e)return;if(!((j=h.first_name)!=null&&j.trim())||!((N=h.last_name)!=null&&N.trim())){s({title:"Validation Error",description:"First name and last name are required",variant:"destructive"});return}const g=typeof h.graduation_year=="number"?h.graduation_year:h.graduation_year&&/^\d{4}$/.test(String(h.graduation_year).trim())?parseInt(String(h.graduation_year).trim(),10):null,{error:y}=await K.from("profiles").update({first_name:h.first_name.trim(),last_name:h.last_name.trim(),job_title:((k=h.job_title)==null?void 0:k.trim())||null,university:((_=h.university)==null?void 0:_.trim())||null,year_of_study:((P=h.year_of_study)==null?void 0:P.trim())||null,phone:(($=h.phone)==null?void 0:$.trim())||null,profession:((M=h.profession)==null?void 0:M.trim())||null,career_stage:((O=h.career_stage)==null?void 0:O.trim())||null,training_year:((A=h.training_year)==null?void 0:A.trim())||null,graduation_year:g,institution:((U=h.institution)==null?void 0:U.trim())||null,languages:h.languages&&h.languages.length>0?h.languages:null}).eq("id",e.id);y?s({title:"Error updating profile",description:y.message,variant:"destructive"}):(s({title:"Profile updated",description:"Your profile has been updated successfully"}),c(!1),v())},x=async()=>{if(!p.newPassword||!p.confirmPassword){s({title:"Validation Error",description:"Please fill in all password fields",variant:"destructive"});return}if(p.newPassword.length<6){s({title:"Validation Error",description:"Password must be at least 6 characters long",variant:"destructive"});return}if(!/[A-Z]/.test(p.newPassword)){s({title:"Validation Error",description:"Password must contain at least one capital letter",variant:"destructive"});return}if(!/[0-9]/.test(p.newPassword)){s({title:"Validation Error",description:"Password must contain at least one number",variant:"destructive"});return}if(p.newPassword!==p.confirmPassword){s({title:"Validation Error",description:"Passwords do not match",variant:"destructive"});return}const{error:g}=await K.auth.updateUser({password:p.newPassword});g?s({title:"Error changing password",description:g.message,variant:"destructive"}):(s({title:"Password changed",description:"Your password has been updated successfully"}),u(!1),w({newPassword:"",confirmPassword:""}))};return r.jsxs("div",{className:"space-y-6 max-w-4xl",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{children:[r.jsx(re,{children:"My Profile"}),r.jsx(Pt,{children:"View and update your profile information"})]}),!l&&r.jsx(G,{onClick:()=>c(!0),variant:"outline",children:"Edit Profile"})]})}),r.jsx(H,{children:i?l?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"first_name",children:"First Name *"}),r.jsx(xe,{id:"first_name",value:h.first_name||"",onChange:g=>f({...h,first_name:g.target.value}),required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"last_name",children:"Last Name *"}),r.jsx(xe,{id:"last_name",value:h.last_name||"",onChange:g=>f({...h,last_name:g.target.value}),required:!0})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"email",children:"Email"}),r.jsx(xe,{id:"email",value:h.email,disabled:!0,className:"bg-muted"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Email cannot be changed"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"job_title",children:"Job Title"}),r.jsx(xe,{id:"job_title",value:h.job_title||"",onChange:g=>f({...h,job_title:g.target.value}),placeholder:"e.g., Medical Student, Resident, Physician"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"university",children:"University/Workplace"}),r.jsx(xe,{id:"university",value:h.university||"",onChange:g=>f({...h,university:g.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"year_of_study",children:"Year of Study"}),r.jsx(xe,{id:"year_of_study",value:h.year_of_study||"",onChange:g=>f({...h,year_of_study:g.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"phone",children:"Phone"}),r.jsx(xe,{id:"phone",type:"tel",value:h.phone||"",onChange:g=>f({...h,phone:g.target.value})})]}),r.jsx("div",{className:"pt-2 border-t border-border",children:r.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Profile details (optional)"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"profession",children:"Profession"}),r.jsx(xe,{id:"profession",value:h.profession||"",onChange:g=>f({...h,profession:g.target.value}),placeholder:"e.g., medicine"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"career_stage",children:"Career Stage"}),r.jsx(xe,{id:"career_stage",value:h.career_stage||"",onChange:g=>f({...h,career_stage:g.target.value}),placeholder:"e.g., resident"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"institution",children:"Institution"}),r.jsx(xe,{id:"institution",value:h.institution||"",onChange:g=>f({...h,institution:g.target.value})})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"training_year",children:"Training Year"}),r.jsx(xe,{id:"training_year",value:h.training_year||"",onChange:g=>f({...h,training_year:g.target.value}),placeholder:"e.g., Bachelor Year 2"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"graduation_year",children:"Graduation Year"}),r.jsx(xe,{id:"graduation_year",type:"number",value:h.graduation_year??"",onChange:g=>f({...h,graduation_year:g.target.value?parseInt(g.target.value,10):null}),placeholder:"e.g., 2024"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"languages",children:"Languages (comma-separated)"}),r.jsx(xe,{id:"languages",value:(h.languages||[]).join(", "),onChange:g=>f({...h,languages:g.target.value.split(",").map(y=>
550y.trim()).filter(Boolean)}),placeholder:"German, French, English"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(G,{onClick:b,children:"Save Changes"}),r.jsx(G,{onClick:()=>{c(!1),i&&f(i)},variant:"outline",children:"Cancel"})]})]}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"First Name"}),r.jsx("p",{className:"text-base",children:i.first_name||"Not set"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Last Name"}),r.jsx("p",{className:"text-base",children:i.last_name||"Not set"})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Email"}),r.jsx("p",{className:"text-base",children:i.email})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Job Title"}),r.jsx("p",{className:"text-base",children:i.job_title||"Not set"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"University/Workplace"}),r.jsx("p",{className:"text-base",children:i.university||"Not set"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Year of Study"}),r.jsx("p",{className:"text-base",children:i.year_of_study||"Not set"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Phone"}),r.jsx("p",{className:"text-base",children:i.phone||"Not set"})]})]}):r.jsx("p",{className:"text-muted-foreground",children:"Loading profile..."})})]}),a&&r.jsx(jE,{}),r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{children:[r.jsx(re,{children:"Change Password"}),r.jsx(Pt,{children:"Password must be at least 6 characters and contain at least one capital letter and one number."})]}),!d&&r.jsx(G,{onClick:()=>u(!0),variant:"outline",children:"Change Password"})]})}),r.jsx(H,{children:d?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"newPassword",children:"New Password"}),r.jsx(xe,{id:"newPassword",type:"password",value:p.newPassword,onChange:g=>w({...p,newPassword:g.target.value}),placeholder:"Enter new password",minLength:6})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"confirmPassword",children:"Confirm New Password"}),r.jsx(xe,{id:"confirmPassword",type:"password",value:p.confirmPassword,onChange:g=>w({...p,confirmPassword:g.target.value}),placeholder:"Confirm new password",minLength:6})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(G,{onClick:x,children:"Update Password"}),r.jsx(G,{onClick:()=>{u(!1),w({newPassword:"",confirmPassword:""})},variant:"outline",children:"Cancel"})]})]}):r.jsx("p",{className:"text-muted-foreground",children:'Click "Change Password" to update your account password'})})]})]})}function M7(e){var t,n,s;return((n=(t=e.course_sessions)==null?void 0:t.course_templates)==null?void 0:n.title)||((s=e.courses)==null?void 0:s.name)||"Event"}function _E(e){var t,n;return((t=e.course_sessions)==null?void 0:t.date)||((n=e.courses)==null?void 0:n.date)||null}function D7(e){var t,n;return((t=e.course_sessions)==null?void 0:t.location)||((n=e.courses)==null?void 0:n.location)||null}function bv(e){const t=_E(e);return t?new Date(t).getTime()<Date.now():!1}function O7({status:e,past:t}){return e==="waiting_list"?r.jsx(Me,{variant:"secondary",children:"Waiting List"}):e==="pending_payment"?r.jsx(Me,{variant:"outline",className:"border-primary text-primary",children:"Pending Payment"}):e==="confirmed"?t?r.jsx(Me,{variant:"secondary",children:"Attended"}):r.jsx(Me,{children:"Registered"}):r.jsx(Me,{variant:"secondary",children:e})}function bg({reg:e}){const t=_E(e),n=D7(e),s=bv(e);return r.jsx(B,{className:"shadow-elevation-medium",children:r.jsx(H,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"font-medium",children:M7(e)}),r.jsx(O7,{status:e.status,past:s})]}),r.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[t&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(su,{className:"h-4 w-4"}),r.jsx("span",{children:rt(t,"dd.MM.yyyy, HH:mm")}
550)]}),n&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rn,{className:"h-4 w-4"}),r.jsx("span",{children:n})]}),e.status==="pending_payment"&&e.reservation_expires_at&&r.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[r.jsx(_s,{className:"h-4 w-4"}),r.jsxs("span",{children:["Spot reserved until ",rt(e.reservation_expires_at,"dd.MM.yyyy, HH:mm")," — please complete your payment by then."]})]}),e.status==="waiting_list"&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bS,{className:"h-4 w-4"}),r.jsx("span",{children:"You'll be notified by email if a spot opens up for you."})]})]})]}),r.jsx("div",{className:"shrink-0",children:r.jsx(be,{to:`/courses/${e.course_id}`,children:r.jsxs(Ue,{variant:"red",size:"sm",className:"gap-2",children:["View Event ",r.jsx(pr,{className:"h-4 w-4"})]})})})]})})})}function I7(){const{user:e}=In(),[t,n]=m.useState([]),[s,a]=m.useState(!0),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{if(!e)return;a(!0),o(null);const{data:h,error:f}=await K.from("course_registrations").select("id, status, registration_date, reservation_expires_at, course_id, session_id, courses(name, date, location), course_sessions(date, location, course_templates(title))").eq("user_id",e.id).order("registration_date",{ascending:!1});f?o(f.message):n(h||[]),a(!1)})()},[e]);const l=t.filter(u=>(u.status==="confirmed"||u.status==="pending_payment")&&!bv(u)),c=t.filter(u=>u.status==="waiting_list"),d=t.filter(u=>u.status==="confirmed"&&bv(u));return r.jsxs("div",{className:"space-y-6 max-w-4xl",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold",children:"My Events"}),r.jsx("p",{className:"text-muted-foreground mt-1",children:"All your SEMSA event registrations at a glance."})]}),r.jsx(be,{to:"/events",className:"shrink-0",children:r.jsxs(Ue,{variant:"red",className:"gap-2",children:["Browse Events ",r.jsx(pr,{className:"h-4 w-4"})]})})]}),s&&r.jsx("p",{className:"text-muted-foreground",children:"Loading your events…"}),i&&r.jsxs("p",{className:"text-destructive",children:["Could not load your events: ",i]}),!s&&!i&&t.length===0&&r.jsx(B,{className:"shadow-elevation-medium",children:r.jsxs(ne,{children:[r.jsx(re,{children:"No events yet"}),r.jsx(Pt,{children:"You haven't registered for any SEMSA events yet."})]})}),!s&&!i&&l.length>0&&r.jsxs("section",{className:"space-y-4",children:[r.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[r.jsx(U4,{className:"h-5 w-5"})," Upcoming"]}),l.map(u=>r.jsx(bg,{reg:u},u.id))]}),!s&&!i&&c.length>0&&r.jsxs("section",{className:"space-y-4",children:[r.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[r.jsx(bS,{className:"h-5 w-5"})," Waiting List"]}),c.map(u=>r.jsx(bg,{reg:u},u.id))]}),!s&&!i&&d.length>0&&r.jsxs("section",{className:"space-y-4",children:[r.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[r.jsx($4,{className:"h-5 w-5"})," Past Events"]}),d.map(u=>r.jsx(bg,{reg:u},u.id))]})]})}function L7(){const{isAdmin:e}=In();return r.jsxs(B,{id:"resource-file-share",className:"shadow-elevation-medium hover:shadow-elevation-high transition-shadow",children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"p-2 rounded-md bg-primary/10 text-primary",children:r.jsx(fh,{className:"h-5 w-5"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx(re,{className:"text-lg",children:"File Share"}),r.jsxs(Pt,{className:"text-sm mt-1",children:["Access shared documents, statutes, and member resources.",e&&" As an admin, you can also upload files."]})]})]})}),r.jsx(H,{children:r.jsx(be,{to:"/file-share",className:"block",children:r.jsxs(G,{className:"w-full gap-2",variant:"outline",children:["Open File Share",r.jsx(pr,{className:"h-4 w-4"})]})})})]})}const F7=[{id:"file-share",render:()=>r.jsx(L7,{})},{id:rn.id,render:()=>r.jsx(hw,{})}];function $7(){const[e]=_o(),t=e.get("resource"),n=m.useRef(!1);return m.useEffect(()=>{if(!t||n.current)return;const s=document.getElementById(`resource-${t}`);s&&(s.scrollIntoView({behavior:"smooth",block:"start"}),s.classList.add("ring-2","ring-primary"),setTimeout(()=>s.classList.remove("ring-2","ring-primary"),2e3),n.current=!0)},[t]),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold",children:"Resources"}),r.jsx("p",{className:"text-muted-foreground mt-1",children:"Curated tools, documents and learning material for SEMSA members."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:F7.map(s=>r.jsx("div",{children:s.render()},s.id))})]})}function z7(){const e=ta(),{user:t,loading:n,isMember:s,isTutor:a,isAdmin:i,isPending:o}=In(),[l]=_o(),c=l.get("section")||"overview",d=c==="files"?"resources":c;
550if(m.useEffect(()=>{!n&&!t&&e("/auth")},[t,n,e]),n)return r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."});if(!t)return null;const u=(s||a||i)&&!o;let h,f="Dashboard";switch(d){case"courses":h=r.jsx(I7,{}),f="My Events";break;case"profile":h=r.jsx(R7,{}),f="My Profile";break;case"resources":h=u?r.jsx($7,{}):r.jsx(a_,{}),f=u?"Resources":"Overview";break;case"overview":default:h=r.jsx(a_,{}),f="Overview";break}return r.jsx(gE,{variant:"member",title:f,children:h})}function U7(){const e=ta(),{user:t,isTutor:n,isAdmin:s,loading:a}=In();return m.useEffect(()=>{!a&&!t&&e("/auth"),!a&&t&&!n&&!s&&e("/member-dashboard")},[t,n,s,a,e]),a?r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:r.jsx(xa,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[r.jsxs("main",{className:"flex-1 container max-w-3xl py-8 px-4",children:[r.jsxs(G,{variant:"ghost",size:"sm",className:"mb-4 gap-2",onClick:()=>e("/member-dashboard?section=profile"),children:[r.jsx(et,{className:"h-4 w-4"})," Back to Profile"]}),r.jsx(jE,{})]}),r.jsx(qe,{})]})}const ko=m.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:le("w-full caption-bottom text-sm",e),...t})}));ko.displayName="Table";const Co=m.forwardRef(({className:e,...t},n)=>r.jsx("thead",{ref:n,className:le("[&_tr]:border-b",e),...t}));Co.displayName="TableHeader";const Ao=m.forwardRef(({className:e,...t},n)=>r.jsx("tbody",{ref:n,className:le("[&_tr:last-child]:border-0",e),...t}));Ao.displayName="TableBody";const B7=m.forwardRef(({className:e,...t},n)=>r.jsx("tfoot",{ref:n,className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));B7.displayName="TableFooter";const Lr=m.forwardRef(({className:e,...t},n)=>r.jsx("tr",{ref:n,className:le("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Lr.displayName="TableRow";const jt=m.forwardRef(({className:e,...t},n)=>r.jsx("th",{ref:n,className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));jt.displayName="TableHead";const xt=m.forwardRef(({className:e,...t},n)=>r.jsx("td",{ref:n,className:le("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));xt.displayName="TableCell";const H7=m.forwardRef(({className:e,...t},n)=>r.jsx("caption",{ref:n,className:le("mt-4 text-sm text-muted-foreground",e),...t}));H7.displayName="TableCaption";var jv=["Enter"," "],W7=["ArrowDown","PageUp","Home"],NE=["ArrowUp","PageDown","End"],q7=[...W7,...NE],V7={ltr:[...jv,"ArrowRight"],rtl:[...jv,"ArrowLeft"]},Y7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wu="Menu",[Gd,G7,K7]=of(wu),[Eo,SE]=zr(wu,[K7,Ri,sc]),bu=Ri(),kE=sc(),[CE,Ii]=Eo(wu),[Z7,ju]=Eo(wu),AE=e=>{const{__scopeMenu:t,open:n=!1,children:s,dir:a,onOpenChange:i,modal:o=!0}=e,l=bu(t),[c,d]=m.useState(null),u=m.useRef(!1),h=Dn(i),f=hu(a);return m.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),r.jsx(iu,{...l,children:r.jsx(CE,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:r.jsx(Z7,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:u,dir:f,modal:o,children:s})})})};AE.displayName=wu;var X7="MenuAnchor",Iw=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,a=bu(n);return r.jsx(ou,{...a,...s,ref:t})});Iw.displayName=X7;var Lw="MenuPortal",[Q7,EE]=Eo(Lw,{forceMount:void 0}),TE=e=>{const{__scopeMenu:t,forceMount:n,children:s,container:a}=e,i=Ii(Lw,t);return r.jsx(Q7,{scope:t,forceMount:n,children:r.jsx(Nr,{present:n||i.open,children:r.jsx(Gl,{asChild:!0,container:a,children:s})})})};TE.displayName=Lw;var Zr="MenuContent",[J7,Fw]=Eo(Zr),PE=m.forwardRef((e,t)=>
vendor: 12,850 bytes, line 550
550{const n=EE(Zr,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,i=Ii(Zr,e.__scopeMenu),o=ju(Zr,e.__scopeMenu);return r.jsx(Gd.Provider,{scope:e.__scopeMenu,children:r.jsx(Nr,{present:s||i.open,children:r.jsx(Gd.Slot,{scope:e.__scopeMenu,children:o.modal?r.jsx(eq,{...a,ref:t}):r.jsx(tq,{...a,ref:t})})})})}),eq=m.forwardRef((e,t)=>{const n=Ii(Zr,e.__scopeMenu),s=m.useRef(null),a=ct(t,s);return m.useEffect(()=>{const i=s.current;if(i)return Ff(i)},[]),r.jsx($w,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tq=m.forwardRef((e,t)=>{const n=Ii(Zr,e.__scopeMenu);return r.jsx($w,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$w=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:f,onDismiss:p,disableOutsideScroll:w,...v}=e,b=Ii(Zr,n),x=ju(Zr,n),g=bu(n),y=kE(n),j=G7(n),[N,k]=m.useState(null),_=m.useRef(null),P=ct(t,_,b.onContentChange),$=m.useRef(0),M=m.useRef(""),O=m.useRef(0),A=m.useRef(null),U=m.useRef("right"),W=m.useRef(0),E=w?pu:m.Fragment,S=w?{as:jr,allowPinchZoom:!0}:void 0,L=D=>{var pe,_e;const F=M.current+D,T=j().filter(Pe=>!Pe.disabled),q=document.activeElement,I=(pe=T.find(Pe=>Pe.ref.current===q))==null?void 0:pe.textValue,Y=T.map(Pe=>Pe.textValue),ie=hq(Y,F,I),se=(_e=T.find(Pe=>Pe.textValue===ie))==null?void 0:_e.ref.current;(function Pe(ke){M.current=ke,window.clearTimeout($.current),ke!==""&&($.current=window.setTimeout(()=>Pe(""),1e3))})(F),se&&setTimeout(()=>se.focus())};m.useEffect(()=>()=>window.clearTimeout($.current),[]),Lf();const C=m.useCallback(D=>{var T,q;return U.current===((T=A.current)==null?void 0:T.side)&&pq(D,(q=A.current)==null?void 0:q.area)},[]);return r.jsx(J7,{scope:n,searchRef:M,onItemEnter:m.useCallback(D=>{C(D)&&D.preventDefault()},[C]),onItemLeave:m.useCallback(D=>{var F;C(D)||((F=_.current)==null||F.focus(),k(null))},[C]),onTriggerLeave:m.useCallback(D=>{C(D)&&D.preventDefault()},[C]),pointerGraceTimerRef:O,onPointerGraceIntentChange:m.useCallback(D=>{A.current=D},[]),children:r.jsx(E,{...S,children:r.jsx(fu,{asChild:!0,trapped:a,onMountAutoFocus:we(i,D=>{var F;D.preventDefault(),(F=_.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:r.jsx(wo,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:f,onDismiss:p,children:r.jsx(aw,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:s,currentTabStopId:N,onCurrentTabStopIdChange:k,onEntryFocus:we(c,D=>{x.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(gf,{role:"menu","aria-orientation":"vertical","data-state":GE(b.open),"data-radix-menu-content":"",dir:x.dir,...g,...v,ref:P,style:{outline:"none",...v.style},onKeyDown:we(v.onKeyDown,D=>{const T=D.target.closest("[data-radix-menu-content]")===D.currentTarget,q=D.ctrlKey||D.altKey||D.metaKey,I=D.key.length===1;T&&(D.key==="Tab"&&D.preventDefault(),!q&&I&&L(D.key));const Y=_.current;if(D.target!==Y||!q7.includes(D.key))return;D.preventDefault();const se=j().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);NE.includes(D.key)&&se.reverse(),uq(se)}),onBlur:we(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout($.current),M.current="")}),onPointerMove:we(e.onPointerMove,Kd(D=>{const F=D.target,T=W.current!==D.clientX;if(D.currentTarget.contains(F)&&T){const q=D.clientX>W.current?"right":"left";U.current=q,W.current=D.clientX}}))})})})})})})});PE.displayName=Zr;var nq="MenuGroup",zw=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(Le.div,{role:"group",...s,ref:t})});zw.displayName=nq;var rq="MenuLabel",RE=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(Le.div,{...s,ref:t})});RE.displayName=rq;var $h="MenuItem",i_="menu.itemSelect",Xf=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:s,...a}=e,i=m.useRef(null),o=ju($h,e.__scopeMenu),l=Fw($h,e.__scopeMenu),c=ct(t,i),d=m.useRef(!1),u=()=>{const h=i.current;if(!n&&h){const f=new CustomEvent(i_,{bubbles:!0,cancelable:!0});h.addEventListener(i_,p=>s==null?void 0:s(p),{once:!0}),jy(h,f),f.defaultPrevented?d.current=!1:o.onClose()}};return r.jsx(ME,{...a,ref:c,disabled:n,onClick:we(e.onClick,u),onPointerDown:h=>{var f;(f=e.onPointerDown)==null||f.call(e,h),d.current=!0},onPointerUp:we(e.onPointerUp,h=>{var f;d.current||(f=h.currentTarget)==null||f.click()}),onKeyDown:we(e.onKeyDown,h=>{const f=l.searchRef.current!=="";n||f&&h.key===" "||jv.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Xf.displayName=$h;var ME=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:s=!1,textValue:a,...i}=e,o=Fw($h,n),l=kE(n),c=m.useRef(null),d=ct(t,c),[u,h]=m.useState(!1),[f,p]=m.useState("");return m.useEffect(()=>{const w=c.current;w&&p((w.textContent??"").trim())},[i.children]),r.jsx(Gd.ItemSlot,{scope:n,disabled:s,textValue:a??f,children:r.jsx(iw,{asChild:!0,...l,focusable:!s,children:r.jsx(Le.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...i,ref:d,onPointerMove:we(e.onPointerMove,Kd(w=>{s?o.onItemLeave(w):(o.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:we(e.onPointerLeave,Kd(w=>o.onItemLeave(w))),onFocus:we(e.onFocus,()=>h(!0)),onBlur:we(e.onBlur,()=>h(!1))})})})}),sq="MenuCheckboxItem",DE=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:s,...a}=e;return r.jsx($E,{scope:e.__scopeMenu,checked:n,children:r.jsx(Xf,{role:"menuitemcheckbox","aria-checked":zh(n)?"mixed":n,...a,ref:t,"data-state":Hw(n),onSelect:we(a.onSelect,()=>s==null?void 0:s(zh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});DE.displayName=sq;var OE="MenuRadioGroup",[aq,iq]=Eo(OE,{value:void 0,onValueChange:()=>{}}),IE=m.forwardRef((e,t)=>{const{value:n,onValueChange:s,...a}=e,i=Dn(s);return r.jsx(aq,{scope:e.__scopeMenu,value:n,onValueChange:i,children:r.jsx(zw,{...a,ref:t})})});IE.displayName=OE;var LE="MenuRadioItem",FE=m.forwardRef((e,t)=>{const{value:n,...s}=e,a=iq(LE,e.__scopeMenu),i=n===a.value;return r.jsx($E,{scope:e.__scopeMenu,checked:i,children:r.jsx(Xf,{role:"menuitemradio","aria-checked":i,...s,ref:t,"data-state":Hw(i),onSelect:we(s.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,n)},{checkForDefaultPrevented:!1})})})});FE.displayName=LE;var Uw="MenuItemIndicator",[$E,oq]=Eo(Uw,{checked:!1}),zE=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:s,...a}=e,i=oq(Uw,n);return r.jsx(Nr,{present:s||zh(i.checked)||i.checked===!0,children:r.jsx(Le.span,{...a,ref:t,"data-state":Hw(i.checked)})})});zE.displayName=Uw;var lq="MenuSeparator",UE=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(Le.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});UE.displayName=lq;var cq="MenuArrow",BE=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,a=bu(n);return r.jsx(xf,{...a,...s,ref:t})});BE.displayName=cq;var Bw="MenuSub",[dq,HE]=Eo(Bw),WE=e=>{const{__scopeMenu:t,children:n,open:s=!1,onOpenChange:a}=e,i=Ii(Bw,t),o=bu(t),[l,c]=m.useState(null),[d,u]=m.useState(null),h=Dn(a);return m.useEffect(()=>(i.open===!1&&h(!1),()=>h(!1)),[i.open,h]),r.jsx(iu,{...o,children:r.jsx(CE,{scope:t,open:s,onOpenChange:h,content:d,onContentChange:u,children:r.jsx(dq,{scope:t,contentId:wr(),triggerId:wr(),trigger:l,onTriggerChange:c,children:n})})})};WE.displayName=Bw;var Vc="MenuSubTrigger",qE=m.forwardRef((e,t)=>{const n=Ii(Vc,e.__scopeMenu),s=ju(Vc,e.__scopeMenu),a=HE(Vc,e.__scopeMenu),i=Fw(Vc,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),r.jsx(Iw,{asChild:!0,...d,children:r.jsx(ME,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":GE(n.open),...e,ref:af(t,a.onTriggerChange),onClick:h=>{var f;(f=e.onClick)==null||f.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,Kd(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:we(e.onPointerLeave,Kd(h=>{var p,w;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(w=n.content)==null?void 0:w.dataset.side,b=v==="right",x=b?-5:5,g=f[b?"left":"right"],y=f[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:g,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:g,y:f.bottom}],side:v}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:we(e.onKeyDown,h=>{var p;const f=i.searchRef.current!=="";e.disabled||f&&h.key===" "||V7[s.dir].includes(h.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),h.preventDefault())})})})});qE.displayName=Vc;var VE="MenuSubContent",YE=m.forwardRef((e,t)=>{const n=EE(Zr,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,i=Ii(Zr,e.__scopeMenu),o=ju(Zr,e.__scopeMenu),l=HE(VE,e.__scopeMenu),c=m.useRef(null),d=ct(t,c);return r.jsx(Gd.Provider,{scope:e.__scopeMenu,children:r.jsx(Nr,{present:s||i.open,children:r.jsx(Gd.Slot,{scope:e.__scopeMenu,children:r.jsx($w,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:we(e.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:we(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:we(e.onKeyDown,u=>{var p;const h=u.currentTarget.contains(u.target),f=Y7[o.dir].includes(u.key);h&&f&&(i.onOpenChange(!1),(p=l.trigger)==null||p.focus(),u.preventDefault())})})})})})});YE.displayName=VE;function GE(e){return e?"open":"closed"}function zh(e){return e==="indeterminate"}function Hw(e){return zh(e)?"indeterminate":e?"checked":"unchecked"}function uq(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mq(e,t){return e.map((n,s)=>e[(t+s)%e.length])}function hq(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=mq(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function fq(e,t){const{x:n,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i].x,c=t[i].y,d=t[o].x,u=t[o].y;c>s!=u>s&&n<(d-l)*(s-c)/(u-c)+l&&(a=!a)}return a}function pq(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return fq(n,t)}function Kd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var gq=AE,xq=Iw,vq=TE,yq=PE,wq=zw,bq=RE,jq=Xf,_q=DE,Nq=IE,Sq=FE,kq=zE,Cq=UE,Aq=BE,Eq=WE,Tq=qE,Pq=YE,Ww="DropdownMenu",[Rq,gK]=zr(Ww,[SE]),Zn=SE(),[Mq,KE]=Rq(Ww),ZE=e=>{const{__scopeDropdownMenu:t,children:n,dir:s,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=Zn(t),d=m.useRef(null),[u=!1,h]=es({prop:a,defaultProp:i,onChange:o});return r.jsx(Mq,{scope:t,triggerId:wr(),triggerRef:d,contentId:wr(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(f=>!f),[h]),modal:l,children:r.jsx(gq,{...c,open:u,onOpenChange:h,dir:s,modal:l,children:n})})};ZE.displayName=Ww;var XE="DropdownMenuTrigger",QE=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...a}=e,i=KE(XE,n),o=Zn(n);return r.jsx(xq,{asChild:!0,...o,children:r.jsx(Le.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:af(t,i.triggerRef),onPointerDown:we(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:we(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});QE.displayName=XE;var Dq="DropdownMenuPortal",JE=e=>{const{__scopeDropdownMenu:t,...n}=e,s=Zn(t);return r.jsx(vq,{...s,...n})};JE.displayName=Dq;var eT="DropdownMenuContent",tT=m.forwardRef((e,t)=>
550{const{__scopeDropdownMenu:n,...s}=e,a=KE(eT,n),i=Zn(n),o=m.useRef(!1);return r.jsx(yq,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...s,ref:t,onCloseAutoFocus:we(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:we(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;(!a.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tT.displayName=eT;var Oq="DropdownMenuGroup",Iq=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(wq,{...a,...s,ref:t})});Iq.displayName=Oq;var Lq="DropdownMenuLabel",nT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(bq,{...a,...s,ref:t})});nT.displayName=Lq;var Fq="DropdownMenuItem",rT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(jq,{...a,...s,ref:t})});rT.displayName=Fq;var $q="DropdownMenuCheckboxItem",sT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(_q,{...a,...s,ref:t})});sT.displayName=$q;var zq="DropdownMenuRadioGroup",Uq=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Nq,{...a,...s,ref:t})});Uq.displayName=zq;var Bq="DropdownMenuRadioItem",aT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Sq,{...a,...s,ref:t})});aT.displayName=Bq;var Hq="DropdownMenuItemIndicator",iT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(kq,{...a,...s,ref:t})});iT.displayName=Hq;var Wq="DropdownMenuSeparator",oT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Cq,{...a,...s,ref:t})});oT.displayName=Wq;var qq="DropdownMenuArrow",Vq=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Aq,{...a,...s,ref:t})});Vq.displayName=qq;var Yq=e=>{const{__scopeDropdownMenu:t,children:n,open:s,onOpenChange:a,defaultOpen:i}=e,o=Zn(t),[l=!1,c]=es({prop:s,defaultProp:i,onChange:a});return r.jsx(Eq,{...o,open:l,onOpenChange:c,children:n})},Gq="DropdownMenuSubTrigger",lT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Tq,{...a,...s,ref:t})});lT.displayName=Gq;var Kq="DropdownMenuSubContent",cT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=Zn(n);return r.jsx(Pq,{...a,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cT.displayName=Kq;var Zq=ZE,Xq=QE,Qq=JE,dT=tT,uT=nT,mT=rT,hT=sT,fT=aT,pT=iT,gT=oT,Jq=Yq,xT=lT,vT=cT;const qw=Zq,Vw=Xq,eV=Jq,yT=m.forwardRef(({className:e,inset:t,children:n,...s},a)=>r.jsxs(xT,{ref:a,className:le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...s,children:[n,r.jsx(Cy,{className:"ml-auto h-4 w-4"})]}));yT.displayName=xT.displayName;const wT=m.forwardRef(({className:e,...t},n)=>r.jsx(vT,{ref:n,className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
550de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));wT.displayName=vT.displayName;const Qf=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(Qq,{children:r.jsx(dT,{ref:s,sideOffset:t,className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Qf.displayName=dT.displayName;const Vr=m.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(mT,{ref:s,className:le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Vr.displayName=mT.displayName;const tV=m.forwardRef(({className:e,children:t,checked:n,...s},a)=>r.jsxs(hT,{ref:a,className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(pT,{children:r.jsx(Ys,{className:"h-4 w-4"})})}),t]}));tV.displayName=hT.displayName;const nV=m.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(fT,{ref:s,className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(pT,{children:r.jsx(yS,{className:"h-2 w-2 fill-current"})})}),t]}));nV.displayName=fT.displayName;const rV=m.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(uT,{ref:s,className:le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));rV.displayName=uT.displayName;const _v=m.forwardRef(({className:e,...t},n)=>r.jsx(gT,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));_v.displayName=gT.displayName;const sV=[{value:"all",label:"All Statuses"},{value:"draft",label:"Draft"},{value:"preview",label:"Preview"},{value:"upcoming",label:"Upcoming"},{value:"completed",label:"Completed"},{value:"archived",label:"Archived"}],o_=e=>{switch(e){case"draft":return r.jsx(Me,{variant:"secondary",children:"Draft"});case"preview":return r.jsx(Me,{variant:"default",children:"Preview"});case"upcoming":return r.jsx(Me,{variant:"outline",className:"border-green-400 text-green-700 dark:text-green-400",children:"Upcoming"});case"completed":return r.jsx(Me,{variant:"secondary",className:"border-muted-foreground/30",children:"Completed"});case"archived":return r.jsx(Me,{variant:"secondary",className:"opacity-60",children:"Archived"});default:return r.jsx(Me,{variant:"outline",children:e})}};function aV({onViewParticipants:e,onEdit:t,onDownloadCsv:n,refreshKey:s}){const a=yu(),{toast:i}=Sn(),[o,l]=m.useState([]),[c,d]=m.useState(!0),[u,h]=m.useState(""),[f,p]=m.useState("all"),[w,v]=m.useState("date"),[b,x]=m.useState("desc"),[g,y]=m.useState(null),[j,N]=m.useState(null);m.useEffect(()=>{k()},[s]);const k=async()=>{d(!0);try{const{data:A,error:U}=await K.from("course_sessions").select("*, course_templates(id, title)").order("date",{ascending:!1});if(U)throw U;const W=(A||[]).map(L=>L.course_id_legacy).filter(Boolean);let E={};if(W.length>0){const{data:L}=await K.from("course_registrations").select("course_id, status").in("course_id",W).in("status",["confirmed","pending_payment","waiting_list"]);L&&L.forEach(C=>{E[C.course_id]||(E[C.course_id]={confirmed:0,pending:0}),C.status==="confirmed"&&E[C.course_id].confirmed++,C.status==="pending_payment"&&E[C.course_id].pending++})}const S=(A||[]).map(L=>{var C,D;return{...L,bookings_confirmed:((C=E[L.course_id_legacy])==null?void 0:C.confirmed)||0,bookings_pending:((D=E[L.course_id_legacy])==null?void 0:D.pe
550nding)||0}});l(S)}catch(A){i({title:"Error loading sessions",description:A.message,variant:"destructive"})}finally{d(!1)}},_=async()=>{if(g)try{const{error:A}=await K.from("course_sessions").delete().eq("id",g);if(A)throw A;i({title:"Session deleted"}),y(null),k()}catch(A){i({title:"Error",description:A.message,variant:"destructive"})}},P=async()=>{if(j)try{const{error:A}=await K.from("course_sessions").update({status:"archived"}).eq("id",j);if(A)throw A;i({title:"Session cancelled and archived"}),N(null),k()}catch(A){i({title:"Error",description:A.message,variant:"destructive"})}},$=A=>{w===A?x(U=>U==="asc"?"desc":"asc"):(v(A),x("asc"))},M=({field:A})=>w!==A?r.jsx(Kl,{className:"h-3 w-3 ml-1 opacity-40"}):b==="asc"?r.jsx(jo,{className:"h-3 w-3 ml-1"}):r.jsx(bo,{className:"h-3 w-3 ml-1"}),O=m.useMemo(()=>{const A=u.toLowerCase().trim();let U=[...o];f!=="all"&&(U=U.filter(E=>E.status===f)),A&&(U=U.filter(E=>{var C,D,F;const S=((D=(C=E.course_templates)==null?void 0:C.title)==null?void 0:D.toLowerCase())||"",L=((F=E.location)==null?void 0:F.toLowerCase())||"";return S.includes(A)||L.includes(A)||E.id.toLowerCase().includes(A)}));const W=b==="asc"?1:-1;return U.sort((E,S)=>{var L,C;switch(w){case"title":return W*(((L=E.course_templates)==null?void 0:L.title)||"").localeCompare(((C=S.course_templates)==null?void 0:C.title)||"");case"date":return W*(E.date||"").localeCompare(S.date||"");case"location":return W*(E.location||"").localeCompare(S.location||"");case"bookings":return W*(E.bookings_confirmed+E.bookings_pending-(S.bookings_confirmed+S.bookings_pending));case"status":return W*E.status.localeCompare(S.status);default:return 0}}),U},[o,u,f,w,b]);return c?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading sessions..."}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(df,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(xe,{placeholder:"Search by title, location, or ID…",value:u,onChange:A=>h(A.target.value),className:"pl-9"})]}),r.jsxs(mt,{value:f,onValueChange:p,children:[r.jsx(ot,{className:"w-full sm:w-44",children:r.jsx(ht,{})}),r.jsx(lt,{children:sV.map(A=>r.jsx(fe,{value:A.value,children:A.label},A.value))})]})]}),O.length===0?r.jsx("p",{className:"text-center py-8 text-muted-foreground",children:o.length===0?"No sessions yet.":"No sessions match your filters."}):a?r.jsx("div",{className:"space-y-3",children:O.map(A=>{var U;return r.jsx(B,{className:"overflow-hidden",children:r.jsx(H,{className:"p-4",children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"space-y-2 flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-sm leading-tight truncate",children:((U=A.course_templates)==null?void 0:U.title)||"Untitled"}),r.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[A.date&&r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx(su,{className:"h-3 w-3"}),rt(new Date(A.date),"dd.MM.yyyy HH:mm")]}),A.location&&r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx(Rn,{className:"h-3 w-3"}),A.location]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("span",{className:"text-xs font-medium",children:[A.bookings_confirmed+A.bookings_pending," / ",A.capacity??"∞"]}),o_(A.status)]})]}),r.jsxs(qw,{children:[r.jsx(Vw,{asChild:!0,children:r.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",children:r.jsx(Ay,{className:"h-4 w-4"})})}),r.jsxs(Qf,{align:"end",children:[r.jsxs(Vr,{onClick:()=>e(A.id,A.course_id_legacy),children:[r.jsx(Ht,{className:"h-4 w-4 mr-2"}),"View Participants"]}),r.jsxs(Vr,{onClick:()=>t(A.id,A.course_id_legacy),children:[r.jsx(Nd,{className:"h-4 w-4 mr-2"}),"Edit"]}),r.jsxs(Vr,{onClick:()=>{var W;return n(A.id,A.course_id_legacy,((W=A.course_templates)==null?void 0:W.title)||"session")},children:[r.jsx(Tx,{className:"h-4 w-4 mr-2"}),"Download CSV"]}),A.status==="upcoming"&&r.jsxs(Vr,{onClick:()=>N(A.id),className:"text-destructive focus:text-destructive",children:[r.jsx(jd,{className:"h-4 w-4 mr-2"}),"Cancel"]}),r.jsxs(Vr,{onClick:()=>y(A.id),className:"text-destructive focus:text-destructive",children:[r.jsx(Ns,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})})},A.id)})}):r.jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:r.jsxs(ko,{children:[r.jsx(Co,{className:"sticky top-0 bg-background z-10",children:r.jsxs(Lr,{children:[r.jsx(jt,{className:"w-[100px] text-xs",children:"Session ID"}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>$("title"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Course Title ",r.jsx(M,{field:"title"})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>$("date"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Date ",r.jsx(M,{field:"date"})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>$("location"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Location ",r.jsx(M,{field:"location"})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>$("bookings"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Bookings ",r.jsx(M,{field:"bookings"})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>$("status"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Status ",r.jsx(M,{field:"status"})]})}),r.jsx(jt,{className:"text-right",children:"Actions"})]})}),r.jsx(Ao,{children:O.map(A=>{var U;return r.jsxs(Lr,{children:[r.jsxs(xt,{className:"font-mono text-xs text-muted-foreground",children:[A.id.slice(0,8),"…"]}),r.jsx(xt,{className:"font-medium",children:((U=A.course_templates)==null?void 0:U.title)||"Untitled"}),r.jsx(xt,{className:"whitespace-nowrap",children:A.date?rt(new Date(A.date),"dd.MM.yyyy HH:mm"):"—"}),r.jsx(xt,{children:A.location||"—"}),r.jsxs(xt,{children:[r.jsx("span",{className:"font-medium",children:A.bookings_confirmed+A.bookings_pending}),r.jsxs("span",{className:"text-muted-foreground",children:[" / ",A.capacity??"∞"]})]}),r.jsx(xt,{children:o_(A.status)}),r.jsx(xt,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[r.jsxs(G,{variant:"outline",size:"sm",onClick:()=>e(A.id,A.course_id_legacy),title:"View participants",children:[r.jsx(Ht,{className:"h-4 w-4 mr-1"}),"View"]}
550),r.jsx(G,{variant:"outline",size:"sm",onClick:()=>t(A.id,A.course_id_legacy),title:"Edit session",children:r.jsx(Nd,{className:"h-4 w-4"})}),r.jsx(G,{variant:"outline",size:"sm",onClick:()=>{var W;return n(A.id,A.course_id_legacy,((W=A.course_templates)==null?void 0:W.title)||"session")},title:"Download CSV",children:r.jsx(Tx,{className:"h-4 w-4"})}),A.status==="upcoming"&&r.jsx(G,{variant:"outline",size:"sm",onClick:()=>N(A.id),title:"Cancel session",children:r.jsx(jd,{className:"h-4 w-4"})}),r.jsx(G,{variant:"destructive",size:"sm",onClick:()=>y(A.id),title:"Delete session",children:r.jsx(Ns,{className:"h-4 w-4"})})]})})]},A.id)})})]})}),r.jsx(_n,{open:!!g,onOpenChange:A=>!A&&y(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Delete Session?"}),r.jsx(mn,{children:"This will permanently delete the session. Registrations linked via the legacy course will remain. This action cannot be undone."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:_,children:"Delete"})]})]})}),r.jsx(_n,{open:!!j,onOpenChange:A=>!A&&N(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Cancel Session?"}),r.jsx(mn,{children:"This will archive the session and prevent new registrations. Existing participants will not be notified automatically."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Keep Active"}),r.jsx(hn,{onClick:P,children:"Cancel Session"})]})]})})]})}const Oc=`Thank you for registering! We're pleased to confirm your registration for the following course:
551
552[Event Infos]
553
554⚠️ Important: Your registration is considered binding. If you can for some reason not attend, please let us know as soon as possible under [email protected]
555
556What's Next?
557• Please make sure to arrive 10-15 minutes before the start time
558• If you have any questions, feel free to contact us
559
560We look forward to seeing you at the course!`;function iV(){var Re,De,de;const e=ta(),[t,n]=m.useState([]),[s,a]=m.useState(!0),[i,o]=m.useState(!1),[l,c]=m.useState(null),[d,u]=m.useState(null),[h,f]=m.useState(null),[p,w]=m.useState(null),[v,b]=m.useState(null),[x,g]=m.useState(null),[y,j]=m.useState(null),[N,k]=m.useState(null),[_,P]=m.useState("asc"),[$,M]=m.useState(null),[O,A]=m.useState([]),[U,W]=m.useState({}),{toast:E}=Sn(),[S,L]=m.useState({name:"",description:"",language:"",date:"",end_date:"",time:"",end_time:"",location:"",meeting_point:"",region:"",max_participants:"",price:"",member_price:"",payment_deadline_hours:"48",is_members_only:!1,status:"draft",registration_opens_date:"",registration_opens_time:"",public_registration_opens_date:"",public_registration_opens_time:"",custom_confirmation_enabled:!1,registration_confirmation_text:Oc,show_draft_preview:!1,profession_limits_enabled:!1,profession_limits:{Medizin:"",Pflege:"",Rettungssanität:""},external_early_access_enabled:!1,external_early_access_domains:""});m.useEffect(()=>{C()},[]);const C=async()=>{try{const{data:R,error:X}=await K.from("courses").select("*").order("date",{ascending:!1});if(X)throw X;if(n(R||[]),R&&R.length>0){const ue=R.map(he=>he.id),{data:te,error:Ce}=await K.from("course_registrations").select("course_id").in("status",["confirmed","pending_payment"]).in("course_id",ue);if(!Ce&&te){const he={};te.forEach(Be=>{he[Be.course_id]=(he[Be.course_id]||0)+1}),W(he)}}}catch(R){E({title:"Error",description:R.message,variant:"destructive"})}finally{a(!1)}},D=async R=>{try{const{data:X,error:ue}=await K.from("course_registrations").select("*").eq("course_id",R).order("registration_date",{ascending:!1});if(ue)throw ue;const te=X||[];return A(te),te}catch(X){return E({title:"Error",description:X.message,variant:"destructive"}),[]}},F=async R=>{R.preventDefault();const X=S.status==="upcoming",ue=S.status==="preview"||S.status==="draft"&&S.show_draft_preview;S.status;const te=ue?"draft":S.status,Ce=ue;if(X&&(!S.date||!S.time||!S.location)){E({title:"Missing Required Fields",description:"Published courses require date, time, and location.",variant:"destructive"});return}try{let he=null;S.date&&S.time?he=Dc(S.date,S.time):S.date&&(he=Dc(S.date));let Be=null;S.end_date&&S.end_time&&(Be=Dc(S.end_date,S.end_time));let Nt=null;S.registration_opens_date&&S.registration_opens_time&&(Nt=Dc(S.registration_opens_date,S.registration_opens_time));let dt=null;!S.is_members_only&&S.public_registration_opens_date&&S.public_registration_opens_time&&(dt=
560Dc(S.public_registration_opens_date,S.public_registration_opens_time));let Ze=null;S.profession_limits_enabled&&(Ze={},Object.entries(S.profession_limits).forEach(([Ke,bt])=>{bt&&parseInt(bt)>0&&(Ze[Ke]=parseInt(bt))}),Object.keys(Ze).length===0&&(Ze=null));const st={name:S.name.trim(),description:S.description||null,language:S.language||null,date:he,end_date:Be,time:S.time||null,location:S.location||null,meeting_point:S.meeting_point||null,region:S.region||null,max_participants:S.max_participants?parseInt(S.max_participants):null,price:S.price?parseFloat(S.price):null,member_price:S.member_price?parseFloat(S.member_price):null,payment_deadline_hours:S.payment_deadline_hours?parseInt(S.payment_deadline_hours):48,is_members_only:S.is_members_only,status:te,registration_opens_at:Nt,public_registration_opens_at:dt,registration_confirmation_text:S.custom_confirmation_enabled&&S.registration_confirmation_text||null,show_draft_preview:Ce,profession_limits:Ze,external_early_access_enabled:S.external_early_access_enabled,external_early_access_domains:S.external_early_access_enabled?S.external_early_access_domains.split(/[\s,;]+/).map(Ke=>Ke.trim().toLowerCase().replace(/^@/,"")).filter(Ke=>Ke.length>0&&Ke.includes(".")):[]};if(l){const{error:Ke}=await K.from("courses").update(st).eq("id",l.id);if(Ke)throw Ke;const{data:bt}=await K.from("course_sessions").select("id, template_id").eq("course_id_legacy",l.id).maybeSingle();bt&&(await K.from("course_sessions").update({date:he,location:S.location||null,capacity:S.max_participants?parseInt(S.max_participants):null,price:S.price?parseFloat(S.price):null,member_price:S.member_price?parseFloat(S.member_price):null,payment_deadline_hours:S.payment_deadline_hours?parseInt(S.payment_deadline_hours):48,status:te==="draft"&&Ce?"preview":te}).eq("id",bt.id),await K.from("course_templates").update({title:S.name.trim(),description:S.description||null}).eq("id",bt.template_id)),E({title:"Success",description:`Course ${X?"published":ue?"saved as preview":"saved as draft"} successfully`})}else{const{data:Ke,error:bt}=await K.from("courses").insert(st).select("id").single();if(bt)throw bt;const{data:pt,error:kn}=await K.from("course_templates").insert({title:S.name.trim(),description:S.description||null,default_capacity:S.max_participants?parseInt(S.max_participants):null,default_price:S.price?parseFloat(S.price):null,default_member_price:S.member_price?parseFloat(S.member_price):null,default_payment_deadline_hours:S.payment_deadline_hours?parseInt(S.payment_deadline_hours):48}).select("id").single();if(kn)throw kn;const{error:Ot}=await K.from("course_sessions").insert({template_id:pt.id,course_id_legacy:Ke.id,date:he,location:S.location||null,capacity:S.max_participants?parseInt(S.max_participants):null,price:S.price?parseFloat(S.price):null,member_price:S.member_price?parseFloat(S.member_price):null,payment_deadline_hours:S.payment_deadline_hours?parseInt(S.payment_deadline_hours):48,status:te==="draft"&&Ce?"preview":te});if(Ot)throw Ot;E({title:"Success",description:`Course ${X?"published":ue?"saved as preview":"saved as draft"} successfully`})}o(!1),c(null),L({name:"",description:"",language:"",date:"",end_date:"",time:"",end_time:"",location:"",meeting_point:"",region:"",max_participants:"",price:"",member_price:"",payment_deadline_hours:"48",is_members_only:!1,status:"draft",registration_opens_date:"",registration_opens_time:"",public_registration_opens_date:"",public_registration_opens_time:"",custom_confirmation_enabled:!1,registration_confirmation_text:Oc,show_draft_preview:!1,profession_limits_enabled:!1,profession_limits:{Medizin:"",Pflege:"",Rettungssanität:""},external_early_access_enabled:!1,external_early_access_domains:""}),C()}catch(he){E({title:"Error",description:he.message,variant:"destructive"})}},T=async()=>{if(d)try{const{data:R}=await K.from("course_sessions").select("id, template_id").eq("course_id_legacy",d).maybeSingle();if(R){await K.from("course_sessions").delete().eq("id",R.id);const{count:ue}=await K.from("course_sessions").select("id",{count:"exact",head:!0}).eq("template_id",R.template_id);ue===0&&await K.from("course_templates").delete().eq("id",R.template_id)}const{error:X}=await K.from("courses").delete().eq("id",d);if(X)throw X;E({title:"Success",description:"Course deleted successfully"}),u(null),C()}catch(R){E({title:"Error",description:R.message,variant:"destructive"})}},q=R=>{var pt,kn,Ot;c(R);let X="",ue="";if(R.date){const $t=new Date(R.date);
560X=$t.toISOString().split("T")[0],ue=$t.toTimeString().slice(0,5)}let te="",Ce="";if(R.end_date){const $t=new Date(R.end_date);te=$t.toISOString().split("T")[0],Ce=$t.toTimeString().slice(0,5)}let he="",Be="";if(R.registration_opens_at){const $t=new Date(R.registration_opens_at);he=$t.toISOString().split("T")[0],Be=$t.toTimeString().slice(0,5)}let Nt="",dt="";if(R.public_registration_opens_at){const $t=new Date(R.public_registration_opens_at);Nt=$t.toISOString().split("T")[0],dt=$t.toTimeString().slice(0,5)}const Ze=R.profession_limits||{},st=Object.keys(Ze).length>0,Ke=R.registration_confirmation_text,bt=!!Ke&&Ke.trim().length>0;L({name:R.name,description:R.description||"",language:R.language||"",date:X,end_date:te,time:R.time||ue,end_time:Ce,location:R.location,meeting_point:R.meeting_point||"",region:R.region||"",max_participants:R.max_participants?R.max_participants.toString():"",price:R.price?R.price.toString():"",member_price:R.member_price?R.member_price.toString():"",payment_deadline_hours:R.payment_deadline_hours?R.payment_deadline_hours.toString():"48",is_members_only:R.is_members_only,status:R.status==="draft"&&R.show_draft_preview?"preview":R.status||"draft",registration_opens_date:he,registration_opens_time:Be,public_registration_opens_date:Nt,public_registration_opens_time:dt,custom_confirmation_enabled:bt,registration_confirmation_text:bt?Ke:Oc,show_draft_preview:R.show_draft_preview||!1,profession_limits_enabled:st,profession_limits:{Medizin:((pt=Ze.Medizin)==null?void 0:pt.toString())||"",Pflege:((kn=Ze.Pflege)==null?void 0:kn.toString())||"",Rettungssanität:((Ot=Ze.Rettungssanität)==null?void 0:Ot.toString())||""},external_early_access_enabled:R.external_early_access_enabled||!1,external_early_access_domains:(R.external_early_access_domains||[]).join(", ")}),o(!0)},I=R=>{const X=t.find(ue=>ue.id===R);X&&D(R).then(ue=>{const te=X.profession_limits&&Object.keys(X.profession_limits).length>0,Ce=["First Name","Last Name","Email","Phone",...te?["Profession"]:[],"Registration Date","Status"],he=st=>`"${(st==null?"":String(st)).replace(/"/g,'""')}"`,Be=[Ce.map(he).join(","),...ue.map(st=>[st.first_name,st.last_name,st.email,st.phone,...te?[st.profession||""]:[],new Date(st.registration_date).toLocaleString("de-CH",{timeZone:"Europe/Zurich",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),st.status].map(he).join(","))].join(`
561`),Nt=new Blob(["\uFEFF"+Be],{type:"text/csv;charset=utf-8;"}),dt=window.URL.createObjectURL(Nt),Ze=document.createElement("a");Ze.href=dt,Ze.download=`${X.name.replace(/\s+/g,"_")}_registrations.csv`,Ze.click(),window.URL.revokeObjectURL(dt),E({title:"Success",description:`Exported ${ue.length} registration(s)`})})},Y=async()=>{if(!h)return;const R=O.find(ue=>ue.id===h),X=R?t.find(ue=>ue.id===R.course_id):null;try{const{data:{user:ue}}=await K.auth.getUser(),{error:te}=await K.from("course_registrations").update({status:"cancelled",cancelled_at:new Date().toISOString(),cancelled_by:(ue==null?void 0:ue.id)??null}).eq("id",h);if(te)throw te;if(R&&X)try{await K.functions.invoke("send-cancellation-notification",{body:{participantEmail:R.email,participantName:`${R.first_name} ${R.last_name}`,courseName:X.name,courseDate:X.date,courseLocation:X.location}})}catch(Ce){console.error("Failed to send cancellation email:",Ce)}E({title:"Success",description:"Registration cancelled and cancellation notification sent"}),f(null),$&&D($),C()}catch(ue){E({title:"Error",description:ue.message,variant:"destructive"})}},ie=async(R,X)=>{try{const ue=O.find(he=>he.id===R),te=t.find(he=>he.id===X),{error:Ce}=await K.from("course_registrations").update({status:"confirmed"}).eq("id",R);if(Ce)throw Ce;if(ue&&te)try{await K.functions.invoke("send-course-confirmation",{body:{participantEmail:ue.email,participantName:`${ue.first_name} ${ue.last_name}`,courseName:te.name,courseDate:te.date,courseLocation:te.location,courseMeetingPoint:te.meeting_point,courseRegion:te.region,courseDescription:te.description,coursePrice:te.price,maxParticipants:te.max_participants,currentParticipants:te.current_participants+1,registrationDate:new Date().toISOString(),customConfirmationText:te.registration_confirmation_text,paymentDeadlineHours:te.payment_deadline_hours||48}})}catch(he){console.error("Failed to send confirmation email:",he)}E({title:"Success",description:"Registration confirmed and confirmation email sent"}),D(X),C()}catch(ue){E({title:"Error",description:ue.message,variant:"destructive"})}},se=async R=>{const X=t.find(he=>he.id===R.course_id);if(!X)return;const ue=!!R.user_id,te=X.member_price,Ce=ue&&te?te:X.price;g(R.id);try{await K.functions.invoke("send-course-confirmation",{body:{participantEmail:R.email,participantName:`${R.first_name} ${R.last_name}`,courseName:X.name,courseDate:X.date,courseLocation:X.location,courseMeetingPoint:X.meeting_point,courseRegion:X.region,courseDescription:X.description,coursePrice:Ce,maxParticipants:X.max_participants,currentParticipants:X.current_participants,registrationDate:R.registration_date,customConfirmationText:X.registration_confirmation_text,paymentDeadlineHours:X.payment_deadline_hours||48}}),E({title:"Success",description:`Confirmation email resent to ${R.email}`})}catch(he){E({title:"Error",description:`Failed to resend email: ${he.message}`,variant:"destructive"})}finally{g(null)}},pe=async(R,X)=>{j(R);try{const ue=t.find(Be=>Be.id===X),te=(ue==null?void 0:ue.payment_deadline_hours)||48,Ce=new Date(Date.now()+te*60*60*1e3).toISOString(),{error:he}=await K.from("course_registrations").update({reservation_expires_at:Ce}).eq("id",R);if(he)throw he;E({title:"Reservation extended",description:`Extended by ${te} hours`}),D(X)}catch(ue){E({title:"Error",description:ue.message,variant:"destructive"})}finally{j(null)}},_e=async()=>
561{if(v)try{const R=O.find(ue=>ue.id===v.id),{error:X}=await K.from("course_registrations").update({status:"cancelled",reservation_expires_at:null}).eq("id",v.id);if(X)throw X;E({title:"Spot freed up",description:"Registration cancelled and spot released"}),b(null),D(v.courseId),C()}catch(R){E({title:"Error",description:R.message,variant:"destructive"})}},Pe=async R=>{const X=t.find(te=>te.id===R.course_id);if(!X)return;const ue=!!R.user_id;g(R.id);try{const{data:te,error:Ce}=await K.functions.invoke("admin-queue-email",{body:{emailType:"pending_payment_reservation",payload:{participantEmail:R.email,participantName:`${R.first_name} ${R.last_name}`,courseName:X.name,courseDate:X.date,courseLocation:X.location,courseMeetingPoint:X.meeting_point,courseRegion:X.region,courseDescription:X.description,coursePrice:X.price,memberPrice:X.member_price,isMember:ue,maxParticipants:X.max_participants,currentParticipants:X.current_participants,registrationDate:R.registration_date,paymentDeadlineHours:X.payment_deadline_hours||48}}});if(Ce)throw Ce;E({title:"Payment reminder sent",description:`Spot reserved reminder sent to ${R.email}`})}catch(te){console.error("Failed to send payment reminder:",te),E({title:"Error",description:`Failed to send reminder: ${te.message}`,variant:"destructive"})}finally{g(null)}},ke=R=>{if(R.status!=="pending_payment"||!R.reservation_expires_at)return null;const X=new Date(R.reservation_expires_at),ue=new Date;if(g9(X)){const he=U0(ue,X);return he<1?{expired:!0,text:`Expired ${B0(ue,X)}m ago`,urgent:!0}:{expired:!0,text:`Expired ${he}h ago`,urgent:!0}}const Ce=U0(X,ue);return Ce<1?{expired:!1,text:`${B0(X,ue)}m left`,urgent:!0}:{expired:!1,text:`${Ce}h left`,urgent:Ce<=6}};return s?r.jsx("div",{className:"text-center py-8",children:"Loading courses..."}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs(B,{children:[r.jsx(ne,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(re,{children:"Course Management"}),r.jsx(Pt,{children:"Create and manage courses and view registrations"})]}),r.jsxs(go,{open:i,onOpenChange:R=>{o(R),R||(c(null),L({name:"",description:"",language:"",date:"",end_date:"",time:"",end_time:"",location:"",meeting_point:"",region:"",max_participants:"",price:"",member_price:"",payment_deadline_hours:"48",is_members_only:!1,status:"draft",registration_opens_date:"",registration_opens_time:"",public_registration_opens_date:"",public_registration_opens_time:"",custom_confirmation_enabled:!1,registration_confirmation_text:"",show_draft_preview:!1,profession_limits_enabled:!1,profession_limits:{Medizin:"",Pflege:"",Rettungssanität:""},external_early_access_enabled:!1,external_early_access_domains:""}))},children:[r.jsx(Gf,{asChild:!0,children:r.jsxs(G,{children:[r.jsx(vh,{className:"h-4 w-4 mr-2"}),"Add Course"]})}),r.jsxs(Ni,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(Si,{children:[r.jsx(ki,{children:l?"Edit Course":"Create New Course"}),r.jsx(Ci,{children:l?"Update the course details below":"Fill in the course details below"})]}),r.jsxs("form",{onSubmit:F,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"name",children:"Course Name *"}),r.jsx(xe,{id:"name",value:S.name,onChange:R=>L({...S,name:R.target.value}),required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"description",children:"Description"}),r.jsx(ei,{id:"description",value:S.description,onChange:R=>L({...S,description:R.target.value}),rows:3})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"language",children:"Specific Course Language (Optional)"}),r.jsxs(mt,{value:S.language,onValueChange:R=>L({...S,language:R==="none"?"":R}),children:[r.jsx(ot,{id:"language",children:r.jsx(ht,{placeholder:"Select language (if applicable)"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"none",children:"No specific language"}),r.jsx(fe,{value:"English",children:"English"}),r.jsx(fe,{value:"Deutsch",children:"Deutsch"}),r.jsx(fe,{value:"français",children:"français"}),r.jsx(fe,{value:"italiano",children:"italiano"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"If selected, a warning will appear on the registration page."})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsxs(Q,{htmlFor:"date",children:["Start Date ",S.status==="upcoming"&&"*"]}),r.jsx(xe,{id:"date",type:"date",value:S.date,onChange:R=>L({...S,date:R.target.value})})]}),r.jsxs("div",{children:[r.jsxs(Q,{htmlFor:"time",children:["Start Time ",S.status==="upcoming"&&"*"]}),r.jsx(xe,{id:"time",type:"time",value:S.time,onChange:R=>L({...S,time:R.target.value})})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"end_date",children:"End Date (optional)"}),r.jsx(xe,{id:"end_date",type:"date",value:S.end_date,onChange:R=>L({...S,end_date:R.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"end_time",children:"End Time (optional)"}),r.jsx(xe,{id:"end_time",type:"time",value:S.end_time,onChange:R=>L({...S,end_time:R.target.value})})]})]}),r.jsxs("div",{children:[r.jsxs(Q,{htmlFor:"location",children:["Location ",S.status==="upcoming"&&"*"]}),r.jsx(xe,{id:"location",value:S.location,onChange:R=>L({...S,location:R.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"meeting_point",children:"Meeting Point and Time (Optional)"}),r.jsx(xe,{id:"meeting_point",placeholder:"e.g. 13:00 at the main entrance",value:S.meeting_point,onChange:R=>L({...S,meeting_point:R.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Only shown in confirmation email, not on the website."})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"region",children:"Region"}),r.jsx(xe,{id:"region",placeholder:"e.g., Zurich, Bern, Geneva",value:S.region,onChange:R=>L({...S,region:R.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"max_participants",children:"Maximum Participants"}),r.jsx(xe,{id:"max_participants",type:"number",min:"1",placeholder:S.profession_limits_enabled?"Calculated from profession limits":"Leave empty for unlimited",value:S.profession_limits_enabled?"":S.max_participants,onChange:R=>L({...S,max_participants:R.target.value}),disabled:S.profession_limits_enabled}),S.profession_limits_enabled&&r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Disabled 
561when profession-specific limits are enabled"})]}),r.jsxs("div",{className:"space-y-4 border rounded-lg p-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ti,{id:"profession_limits_enabled",checked:S.profession_limits_enabled,onCheckedChange:R=>L({...S,profession_limits_enabled:R})}),r.jsx(Q,{htmlFor:"profession_limits_enabled",children:"Enable Profession-Specific Limits"})]}),S.profession_limits_enabled&&r.jsxs("div",{className:"space-y-3 pl-6 border-l-2 border-muted",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Set maximum participants for each profession. Leave empty to not limit that profession."}),r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"limit_medizin",className:"text-sm",children:"Medizin"}),r.jsx(xe,{id:"limit_medizin",type:"number",min:"0",placeholder:"5",value:S.profession_limits.Medizin,onChange:R=>L({...S,profession_limits:{...S.profession_limits,Medizin:R.target.value}})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"limit_pflege",className:"text-sm",children:"Pflege"}),r.jsx(xe,{id:"limit_pflege",type:"number",min:"0",placeholder:"5",value:S.profession_limits.Pflege,onChange:R=>L({...S,profession_limits:{...S.profession_limits,Pflege:R.target.value}})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"limit_rettung",className:"text-sm",children:"Rettungssanität"}),r.jsx(xe,{id:"limit_rettung",type:"number",min:"0",placeholder:"5",value:S.profession_limits.Rettungssanität,onChange:R=>L({...S,profession_limits:{...S.profession_limits,Rettungssanität:R.target.value}})})]})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"price",children:"Price (CHF)"}),r.jsx(xe,{id:"price",type:"number",min:"0",step:"0.01",placeholder:"Leave empty for free",value:S.price,onChange:R=>L({...S,price:R.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"member_price",children:"Member Price (CHF)"}),r.jsx(xe,{id:"member_price",type:"number",min:"0",step:"0.01",placeholder:"Leave empty if same",value:S.member_price,onChange:R=>L({...S,member_price:R.target.value})})]})]}),(S.price||S.member_price)&&r.jsxs("div",{children:[r.jsxs(Q,{htmlFor:"payment_deadline_hours",className:"flex items-center gap-1",children:["Payment Deadline (hours)",r.jsx("span",{className:"text-xs text-muted-foreground",title:"Deadline for course fee payment from registration time",children:"ⓘ"})]}),r.jsx(xe,{id:"payment_deadline_hours",type:"number",min:"1",step:"1",placeholder:"48",value:S.payment_deadline_hours,onChange:R=>L({...S,payment_deadline_hours:R.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Time participants have to pay after registration (default: 48h)"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ti,{id:"is_members_only",checked:S.is_members_only,onCheckedChange:R=>L({...S,is_members_only:R})}),r.jsx(Q,{htmlFor:"is_members_only",children:"Members Only"})]}),r.jsxs("div",{className:"space-y-3 border rounded-lg p-4 bg-muted/30",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"external_early_access_enabled",className:"text-base",children:"External Partner Early Access"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Allow people from specific email domains to register during the early-access window (before public registration opens), via a one-time email verification link."})]}),r.jsx(ti,{id:"external_early_access_enabled",checked:S.external_early_access_enabled,onCheckedChange:R=>L({...S,external_early_access_enabled:R})})]}),S.external_early_access_enabled&&r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"external_early_access_domains",children:"Allowed email domains"}),r.jsx(xe,{id:"external_early_access_domains",value:S.external_early_access_domains,onChange:R=>L({...S,external_early_access_domains:R.target.value}),placeholder:"e.g. partner.org, hospital.ch"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated list of email domains (without @). Exter
561nal users with these email addresses receive a one-time verification link to register early. No persistent account is created."})]})]}),r.jsxs("div",{className:"space-y-4 border-t pt-4",children:[r.jsx("h3",{className:"text-sm font-medium",children:"Registration Timing (Optional)"}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm text-muted-foreground mb-2 block",children:S.is_members_only?"When should registration open?":"When should registration open for members? (Members get early access)"}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"registration_opens_date",children:"Date"}),r.jsx(xe,{id:"registration_opens_date",type:"date",value:S.registration_opens_date,onChange:R=>{const X=R.target.value,ue={registration_opens_date:X};if(!S.is_members_only&&X&&!S.public_registration_opens_date){const te=new Date(X);te.setDate(te.getDate()+2),ue.public_registration_opens_date=te.toISOString().split("T")[0],S.registration_opens_time&&!S.public_registration_opens_time&&(ue.public_registration_opens_time=S.registration_opens_time)}L({...S,...ue})}})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"registration_opens_time",children:"Time"}),r.jsx(xe,{id:"registration_opens_time",type:"time",value:S.registration_opens_time,onChange:R=>{const X=R.target.value,ue={registration_opens_time:X};!S.is_members_only&&!S.public_registration_opens_time&&(ue.public_registration_opens_time=X),L({...S,...ue})}})]})]})]}),!S.is_members_only&&r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm text-muted-foreground mb-2 block",children:"When should registration open for non-members (public)? (defaults to 2 days after member registration)"}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"public_registration_opens_date",children:"Date"}),r.jsx(xe,{id:"public_registration_opens_date",type:"date",value:S.public_registration_opens_date,onChange:R=>L({...S,public_registration_opens_date:R.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"public_registration_opens_time",children:"Time"}),r.jsx(xe,{id:"public_registration_opens_time",type:"time",value:S.public_registration_opens_time,onChange:R=>L({...S,public_registration_opens_time:R.target.value})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Members can register from the first date. Non-members must wait until the public registration date."})]}),S.is_members_only&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"This course is members-only. Only logged-in members can register."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:"custom_confirmation_toggle",children:"Custom Registration Confirmation Message"}),r.jsx(ti,{id:"custom_confirmation_toggle",checked:S.custom_confirmation_enabled,onCheckedChange:R=>L({...S,custom_confirmation_enabled:R,registration_confirmation_text:R&&S.registration_confirmation_text||Oc})})]}),S.custom_confirmation_enabled?r.jsxs(r.Fragment,{children:[r.jsx(ei,{id:"registration_confirmation_text",value:S.registration_confirmation_text,onChange:R=>L({...S,registration_confirmation_text:R.target.value}),rows:12}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Customize the message sent in the confirmation email. Use ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"[Event Infos]"})," as a placeholder for course details (name, date, location, price). Use ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"[Payment Info]"})," to place the payment block (TWINT QR code & instructions) at a specific position — if omitted, it will be appended automatically for paid courses."]})]}):r.jsx("p",{className:"text-xs text-muted-foreground",children:"The default confirmation template will be used. Toggle on to customize."})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"status",children:"Status"}),r.jsxs("select",{id:"status",value:S.show_draft_preview?"preview":S.status,onChange:R=>{const X=R.target.value;L({...S,status:X==="preview"?"draft":X,show_draft_preview:X==="preview"})},className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
561ing-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[r.jsx("option",{value:"draft",children:"Draft"}),r.jsx("option",{value:"preview",children:"Preview"}),r.jsx("option",{value:"upcoming",children:"Published"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Draft: hidden from website. Preview: visible in "Coming Soon". Published: fully visible and open for registration.'})]}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(G,{type:"button",variant:"outline",className:"shadow-elevation-medium hover:shadow-elevation-high active:shadow-elevation-low transition-shadow",onClick:()=>{o(!1),c(null),L({name:"",description:"",language:"",date:"",end_date:"",time:"",end_time:"",location:"",meeting_point:"",region:"",max_participants:"",price:"",member_price:"",payment_deadline_hours:"48",is_members_only:!1,status:"draft",registration_opens_date:"",registration_opens_time:"",public_registration_opens_date:"",public_registration_opens_time:"",custom_confirmation_enabled:!1,registration_confirmation_text:"",show_draft_preview:!1,profession_limits_enabled:!1,profession_limits:{Medizin:"",Pflege:"",Rettungssanität:""},external_early_access_enabled:!1,external_early_access_domains:""})},children:"Cancel"}),r.jsx(G,{type:"submit",className:"shadow-elevation-medium hover:shadow-elevation-high active:shadow-elevation-low transition-shadow",disabled:!S.name.trim()||S.status==="upcoming"&&(!S.date||!S.time||!S.location),children:"Save"})]})]})]})]})]})}),r.jsx(H,{children:r.jsx(aV,{refreshKey:t.length,onViewParticipants:(R,X)=>{e(`/admin/sessions/${R}`)}
561,onEdit:(R,X)=>{if(X){const ue=t.find(te=>te.id===X);ue&&q(ue)}},onDownloadCsv:(R,X,ue)=>{X&&I(X)}})})]}),r.jsx(go,{open:!!$,onOpenChange:R=>!R&&M(null),children:r.jsxs(Ni,{className:"max-w-4xl",children:[r.jsxs(Si,{children:[r.jsx(ki,{children:"Course Registrations"}),r.jsx(Ci,{children:(Re=t.find(R=>R.id===$))==null?void 0:Re.name})]}),O.length>0&&r.jsxs("div",{className:"flex gap-4 py-3 border-y flex-wrap",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Me,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300 dark:bg-green-950 dark:text-green-400 dark:border-green-800",children:["✓ Confirmed: ",O.filter(R=>R.status==="confirmed").length]})}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Me,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800",children:["💳 Pending Payment: ",O.filter(R=>R.status==="pending_payment").length]})}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Me,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800",children:["⏳ Waiting List: ",O.filter(R=>R.status==="waiting_list").length]})}),O.some(R=>R.status==="cancelled")&&r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Me,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300 dark:bg-red-950 dark:text-red-400 dark:border-red-800",children:["✕ Cancelled: ",O.filter(R=>R.status==="cancelled").length]})}),r.jsxs("div",{className:"text-sm text-muted-foreground ml-auto self-center",children:["Total: ",O.length]})]}),r.jsx("div",{className:"max-h-96 overflow-y-auto",children:O.length===0?r.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No registrations yet"}):r.jsxs(ko,{children:[r.jsx(Co,{children:r.jsxs(Lr,{children:[[["name","Name"],["email","Email"],["phone","Phone"],...(De=t.find(R=>R.id===$))!=null&&De.profession_limits&&Object.keys(((de=t.find(R=>R.id===$))==null?void 0:de.profession_limits)||{}).length>0?[["profession","Profession"]]:[],["registration_date","Registered"],["status","Status"]].map(([R,X])=>{const ue=N===R?_==="asc"?jo:bo:Kl;return r.jsx(jt,{className:"cursor-pointer select-none hover:bg-muted/50",onClick:()=>{N===R?P(te=>te==="asc"?"desc":"asc"):(k(R),P("asc"))},children:r.jsxs("span",{className:"inline-flex items-center gap-1",children:[X,r.jsx(ue,{className:"h-3 w-3 text-muted-foreground"})]})},R)}),r.jsx(jt,{className:"text-right",children:"Actions"})]})}),r.jsx(Ao,{children:[...O].sort((R,X)=>{if(!N)return 0;const ue=_==="asc"?1:-1;let te,Ce;return N==="name"?(te=`${R.first_name} ${R.last_name}`.toLowerCase(),Ce=`${X.first_name} ${X.last_name}`.toLowerCase()):(te=(R[N]??"").toString().toLowerCase(),Ce=(X[N]??"").toString().toLowerCase()),te<Ce?-ue:te>Ce?ue:0}).map(R=>{var X,ue;return r.jsxs(Lr,{className:R.status==="cancelled"?"opacity-50 bg-muted/40":void 0,children:[r.jsxs(xt,{children:[R.first_name," ",R.last_name]}),r.jsx(xt,{children:R.email}),r.jsx(xt,{children:R.phone}),((X=t.find(te=>te.id===$))==null?void 0:X.profession_limits)&&Object.keys(((ue=t.find(te=>te.id===$))==null?void 0:ue.profession_limits)||{}).length>0&&r.jsx(xt,{children:R.profession||"—"}),r.jsx(xt,{children:rt(new Date(R.registration_date),"dd.MM.yyyy HH:mm")}),r.jsx(xt,{children:R.status==="waiting_list"?r.jsx(Me,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800",children:"⏳ Waiting List"}):R.status==="pending_payment"?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Me,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800",children:"💳 Pending Payment"}),(()=>{const te=ke(R);return te?r.jsxs("p",{className:`text-xs font-medium ${te.expired?"text-red-600 dark:text-red-400":te.urgent?"text-orange-600 dark:text-orange-400":"text-muted-foreground"}`,children:[r.jsx(_s,{className:"inline h-3 w-3 mr-0.5"}),te.text]}):null})()]}):R.status==="cancelled"?r.jsxs("div",{className:"space-y-1",children:[r.jsx(Me,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300 dark:bg-red-950 dark:text-red-400 dark:border-red-800",children:"✕ Cancelled"}),R.cancelled_at&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.jsx(_s,{className:"inline h-3 w-3 mr-0.5"}),rt(new Date(R.cancelled_at),"dd.MM.yyyy HH:mm")]})]}):r.jsx(Me,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300 dark:bg-green-950 dark:text-green-400 dark:border-green-800",children:"✓ Confirmed"})}),r.jsx(xt,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[R.status==="waiting_list"&&r.jsx(G,{variant:"outline",size:"sm",className:"text-green-700 border-green-300 hover:bg-green-50",onClick:()=>
561w({id:R.id,courseId:R.course_id}),title:"Promote to confirmed",children:r.jsx(Ys,{className:"h-4 w-4"})}),R.status==="pending_payment"&&r.jsxs(r.Fragment,{children:[r.jsx(G,{variant:"outline",size:"sm",onClick:()=>pe(R.id,R.course_id),disabled:y===R.id,title:"Extend reservation",children:r.jsx(Y4,{className:"h-4 w-4"})}),r.jsx(G,{variant:"outline",size:"sm",onClick:()=>Pe(R),disabled:x===R.id,title:"Send payment reminder",children:r.jsx(_d,{className:"h-4 w-4"})}),r.jsx(G,{variant:"outline",size:"sm",className:"text-red-700 border-red-300 hover:bg-red-50",onClick:()=>b({id:R.id,courseId:R.course_id}),title:"Free up spot",children:r.jsx(jd,{className:"h-4 w-4"})})]}),R.status==="confirmed"&&r.jsx(G,{variant:"outline",size:"sm",onClick:()=>se(R),disabled:x===R.id,title:"Resend confirmation email",children:r.jsx(_d,{className:"h-4 w-4"})}),R.status!=="cancelled"&&r.jsx(G,{variant:"destructive",size:"sm",onClick:()=>f(R.id),children:r.jsx(Ns,{className:"h-4 w-4"})})]})})]},R.id)})})]})})]})}),r.jsx(_n,{open:!!d,onOpenChange:R=>!R&&u(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Delete Course?"}),r.jsx(mn,{children:"This will permanently delete the course and all its registrations. This action cannot be undone."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:T,children:"Delete"})]})]})}),r.jsx(_n,{open:!!h,onOpenChange:R=>!R&&f(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Really cancel participation?"}),r.jsx(mn,{asChild:!0,children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{children:["The registration will be kept and marked as ",r.jsx("strong",{children:"Cancelled"})," (greyed out in the list). The spot is freed up and the participant receives a cancellation notification email."]}),(()=>{const R=O.find(te=>te.id===h),X=(R==null?void 0:R.status)==="confirmed",ue=O.some(te=>te.status==="waiting_list");return X?r.jsxs("div",{className:"rounded-md border border-yellow-300 bg-yellow-50 p-3 text-yellow-800 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-400 text-sm",children:[r.jsx("p",{className:"font-semibold",children:"⚠️ Warning: This is a confirmed participant."}),r.jsx("p",{children:"The participant count will be decreased by 1."}),ue&&r.jsxs("p",{className:"mt-1",children:["The next person on the waiting list will be ",r.jsx("strong",{children:"automatically promoted"})," to confirmed and notified by email."]})]}):null})()]})})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:Y,children:"Cancel Participation"})]})]})}),r.jsx(_n,{open:!!p,onOpenChange:R=>!R&&w(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Confirm Registration?"}),r.jsx(mn,{children:"This will move the participant from the waiting list to confirmed. The participant count will be increased and a confirmation email will be sent automatically."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:()=>{p&&(ie(p.id,p.courseId),w(null))},children:"Confirm"})]})]})}),r.jsx(_n,{open:!!v,onOpenChange:R=>!R&&b(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Free Up Spot?"}),r.jsx(mn,{asChild:!0,children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{children:"This will cancel the pending payment registration and release the reserved spot."}),O.some(R=>R.status==="waiting_list")&&r.jsx("div",{className:"rounded-md border border-yellow-300 bg-yellow-50 p-3 text-yellow-800 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-400 text-sm",children:r.jsxs("p",{children:["The next person on the waiting list will be ",r.jsx("strong",{children:"automatically promoted"}),"."]})})]})})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:_e,children:"Free Up Spot"})]})]})})]})}const l_=["professional_title","professional_function","specialties"];function jg(e){const t=[!!e.professional_title,!!e.professional_function,!!(e.specialties&&e.specialties.length>0),!!e.workplace,!!e.bio,!!e.photo_url,!!(e.linkedin_url||e.website_url)];return Math.round(t.filter(Boolean).length/t.length*100)}function oV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[a,i]=m.useState(""),[o,l]=m.useState("all"),[c,d]=m.useState("all"),[u,h]=m.useState("all"),[f,p]=m.useState(!1),[w,v]=m.useState("name"),[b,x]=m.useState("asc"),g=A=>{A===w?x(b==="asc"?"desc":"asc"):(v(A),x("asc"))},y=({col:A})=>A!==w?r.jsx(Kl,{className:"h-3 w-3 ml-1 inline opacity-40"}):b==="asc"?r.jsx(jo,{className:"h-3 w-3 ml-1 inline"}):r.jsx(bo,{className:"h-3 w-3 ml-1 inline"});m.useEffect(()=>{j()},[]);async function j(){s(!0);const{data:A}=await K.from("user_roles").select("user_id").eq("role","tutor"),U=(A??[]).map(D=>
561D.user_id);if(U.length===0){t([]),s(!1);return}const[{data:W},{data:E}]=await Promise.all([K.from("profiles").select("id,first_name,last_name,email,profession").in("id",U),K.from("tutor_profiles").select("*").in("user_id",U)]),S=new Map((W??[]).map(D=>[D.id,D])),L=new Map((E??[]).map(D=>[D.user_id,D])),C=U.map(D=>{const F=L.get(D)??{};return{user_id:D,professional_title:F.professional_title??null,professional_function:F.professional_function??null,workplace:F.workplace??null,bio:F.bio??null,linkedin_url:F.linkedin_url??null,website_url:F.website_url??null,specialties:F.specialties??null,photo_url:F.photo_url??null,is_public:!!F.is_public,profile:S.get(D)??null}});C.sort((D,F)=>{var I,Y,ie,se;const T=`${((I=D.profile)==null?void 0:I.last_name)??""} ${((Y=D.profile)==null?void 0:Y.first_name)??""}`.trim(),q=`${((ie=F.profile)==null?void 0:ie.last_name)??""} ${((se=F.profile)==null?void 0:se.first_name)??""}`.trim();return T.localeCompare(q)}),t(C),s(!1)}const N=m.useMemo(()=>{const A=new Set;return e.forEach(U=>{var W;(W=U.profile)!=null&&W.profession&&A.add(U.profile.profession)}),Array.from(A).sort()},[e]),k=m.useMemo(()=>{const A=a.trim().toLowerCase();return e.filter(U=>{var E,S,L,C,D;if(o!=="all"&&((E=U.profile)==null?void 0:E.profession)!==o||c==="public"&&!U.is_public||c==="hidden"&&U.is_public)return!1;const W=l_.some(F=>{const T=U[F];return Array.isArray(T)?T.length===0:!T});return!(u==="complete"&&W||u==="incomplete"&&!W||A&&![(S=U.profile)==null?void 0:S.first_name,(L=U.profile)==null?void 0:L.last_name,(C=U.profile)==null?void 0:C.email,(D=U.profile)==null?void 0:D.profession,U.professional_title,U.professional_function,U.workplace,...U.specialties??[]].filter(Boolean).join(" ").toLowerCase().includes(A))})},[e,a,o,c,u]),_=m.useMemo(()=>{const A=[...k],U=(W,E)=>{const S=b==="asc"?1:-1,L=C=>{var D,F;return`${((D=C.profile)==null?void 0:D.last_name)??""} ${((F=C.profile)==null?void 0:F.first_name)??""}`.trim().toLowerCase()};switch(w){case"name":return L(W).localeCompare(L(E))*S;case"professional_title":return(W.professional_title??"").localeCompare(E.professional_title??"")*S;case"professional_function":return(W.professional_function??"").localeCompare(E.professional_function??"")*S;case"workplace":return(W.workplace??"").localeCompare(E.workplace??"")*S;case"is_public":return((W.is_public?1:0)-(E.is_public?1:0))*S;case"completion":return(jg(W)-jg(E))*S;default:return 0}};return A.sort(U),A},[k,w,b]),P=(o!=="all"?1:0)+(c!=="all"?1:0)+(u!=="all"?1:0),$=P>0||a.length>0,M=()=>{i(""),l("all"),d("all"),h("all")},O=r.jsxs(r.Fragment,{children:[r.jsxs(mt,{value:o,onValueChange:l,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Profession"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Professions"}),N.map(A=>r.jsx(fe,{value:A,children:A},A))]})]}),r.jsxs(mt,{value:c,onValueChange:d,children:[r.jsx(ot,{className:"w-full md:w-[140px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Visibility"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Visibility"}),r.jsx(fe,{value:"public",children:"Public"}),r.jsx(fe,{value:"hidden",children:"Hidden"})]})]}),r.jsxs(mt,{value:u,onValueChange:h,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Completion"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Completion"}),r.jsx(fe,{value:"complete",children:"Required complete"}),r.jsx(fe,{value:"incomplete",children:"Required incomplete"})]})]})]});return r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsxs(re,{children:["Tutors (",e.length,")"]}),r.jsx(Pt,{children:"Read-only view of all approved tutors and their profile completion. Tutors maintain their own data via the member dashboard."})]}),r.jsxs(H,{className:"px-0 pb-0",children:[r.jsxs("div",{className:"sticky top-0 z-10 bg-card border-b border-border",children:[r.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(df,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(xe,{placeholder:"Search by name, email, profession, specialty…",value:a,onChange:A=>i(A.target.value),className:"pl-9 pr-9"}),a&&r.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r.jsx(Nn,{className:"h-4 w-4"})})]}),r.jsxs(G,{variant:"outline",size:"icon",className:"md:hidden h-10 w-10 shrink-0 relative",onClick:()=>
561p(!f),children:[r.jsx(Ry,{className:"h-4 w-4"}),P>0&&r.jsx("span",{className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-primary text-primary-foreground text-[10px] flex items-center justify-center",children:P})]})]}),r.jsxs("div",{className:"hidden md:flex items-center gap-3 px-4 pb-3 flex-wrap",children:[O,$&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 text-xs text-muted-foreground hover:text-foreground",onClick:M,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]}),r.jsx("div",{className:"ml-auto",children:r.jsx("span",{className:"text-xs text-muted-foreground",children:$?`${k.length} of ${e.length} ${e.length!==1?"tutors":"tutor"}`:`${e.length} ${e.length!==1?"tutors":"tutor"}`})})]}),f&&r.jsxs("div",{className:"md:hidden px-4 pb-3 space-y-2",children:[O,$&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:M,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]})]}),r.jsx("div",{className:"md:hidden flex items-center justify-between px-4 pb-2",children:r.jsx("span",{className:"text-xs text-muted-foreground",children:$?`${k.length} of ${e.length} ${e.length!==1?"tutors":"tutor"}`:`${e.length} ${e.length!==1?"tutors":"tutor"}`})})]}),r.jsx("div",{className:"overflow-x-auto",children:n?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(xa,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.length===0?r.jsx("p",{className:"text-sm text-muted-foreground py-6 px-4",children:"No tutors yet."}):_.length===0?r.jsx("p",{className:"text-sm text-muted-foreground py-6 px-4",children:"No tutors match the current filters."}):r.jsxs(ko,{children:[r.jsx(Co,{children:r.jsxs(Lr,{children:[r.jsx(jt,{children:r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors",onClick:()=>g("name"),children:["Tutor ",r.jsx(y,{col:"name"})]})}),r.jsxs(jt,{children:[r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors",onClick:()=>g("professional_title"),children:["Title ",r.jsx(y,{col:"professional_title"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-xs text-muted-foreground",onClick:()=>g("professional_function"),children:["Function ",r.jsx(y,{col:"professional_function"})]})]}),r.jsx(jt,{children:r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors",onClick:()=>g("workplace"),children:["Workplace ",r.jsx(y,{col:"workplace"})]})}),r.jsx(jt,{children:"Specialties"}),r.jsx(jt,{children:r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors",onClick:()=>g("is_public"),children:["Public ",r.jsx(y,{col:"is_public"})]})}),r.jsx(jt,{children:r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors",onClick:()=>g("completion"),children:["Completion ",r.jsx(y,{col:"completion"})]})})]})}),r.jsx(Ao,{children:_.map(A=>{var E,S,L,C,D,F,T,q,I;const U=jg(A),W=l_.some(Y=>{const ie=A[Y];return Array.isArray(ie)?ie.length===0:!ie});return r.jsxs(Lr,{children:[r.jsx(xt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(Mf,{className:"h-9 w-9",children:[A.photo_url&&r.jsx(Df,{src:A.photo_url}),r.jsx(Of,{children:(((S=(E=A.profile)==null?void 0:E.first_name)==null?void 0:S[0])??"")+(((C=(L=A.profile)==null?void 0:L.last_name)==null?void 0:C[0])??"")||"T"})]}),r.jsxs("div",{className:"text-sm",children:[r.jsxs("div",{className:"font-medium",children:[(D=A.profile)==null?void 0:D.first_name," ",(F=A.profile)==null?void 0:F.last_name]}),r.jsx("div",{className:"text-xs text-muted-foreground",children:(T=A.profile)==null?void 0:T.email})]})]})}),r.jsxs(xt,{className:"text-sm",children:[r.jsx("div",{children:A.professional_title??r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("div",{className:"text-xs text-muted-foreground",children:A.professional_function??"—"})]}),r.jsx(xt,{className:"text-sm",children:A.workplace??r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx(xt,{children:r.jsxs("div",{className:"flex flex-wrap gap-1 max-w-xs",children:[(A.specialties??[]).slice(0,4).map(Y=>r.jsx(Me,{variant:"secondary",className:"text-xs",children:Y},Y)),(((q=A.specialties)==null?void 0:q.length)??0)>4&&r.jsxs(Me,{variant:"outline",className:"text-xs",children:["+",(((I=A.specialties)==null?void 0:I.length)??0)-4]}),(!A.specialties||A.specialties.length===0)&&r.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})]})}),r.jsx(xt,{children:r.jsx(Me,{variant:A.is_public?"default":"outline",children:A.is_public?"Public":"Hidden"})}),r.jsx(xt,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-20 h-2 rounded bg-muted overflow-hidden",children:r.jsx("div",{className:`h-full ${W?"bg-destructive":"bg-primary"}`,style:{width:`${U}%`}})}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[U,"%"]})]})})]},A.user_id)})})]})})]})]})}const Nv=130,lV=Nv*1024;function cV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[a,i]=m.useState(!1),[o,l]=m.useState(null),[c,d]=m.useState(!1),[u,h]=m.useState(null),f=m.useRef(null),[p,w]=m.useState({name:"",provider:"",date:"",end_date:"",time:"",region:"",website_url:"",description:"",status:"draft",image_url:""});m.useEffect(()=>
561{v()},[]);const v=async()=>{try{const{data:_,error:P}=await K.from("external_courses").select("*").order("date",{ascending:!0});if(P)throw P;t(_||[])}catch(_){console.error("Error fetching external courses:",_),Ms.error("Failed to load external courses")}finally{s(!1)}},b=()=>{w({name:"",provider:"",date:"",end_date:"",time:"",region:"",website_url:"",description:"",status:"draft",image_url:""}),l(null),h(null),f.current&&(f.current.value="")},x=async _=>{var $;const P=($=_.target.files)==null?void 0:$[0];if(P){if(!P.type.includes("jpeg")&&!P.type.includes("jpg")){Ms.error("Only JPEG images are allowed"),f.current&&(f.current.value="");return}if(P.size>lV){Ms.error(`File size must be less than ${Nv}KB`),f.current&&(f.current.value="");return}d(!0);try{const A=`${Date.now()}-${Math.random().toString(36).substring(2)}.jpg`,{error:U}=await K.storage.from("external-course-images").upload(A,P);if(U)throw U;const{data:{publicUrl:W}}=K.storage.from("external-course-images").getPublicUrl(A);w({...p,image_url:W}),h(W),Ms.success("Image uploaded successfully")}catch(M){console.error("Error uploading image:",M),Ms.error("Failed to upload image")}finally{d(!1),f.current&&(f.current.value="")}}},g=()=>{w({...p,image_url:""}),h(null),f.current&&(f.current.value="")},y=_=>{_?(l(_),w({name:_.name,provider:_.provider,date:_.date,end_date:_.end_date||"",time:_.time||"",region:_.region,website_url:_.website_url,description:_.description||"",status:_.status,image_url:_.image_url||""}),h(_.image_url||null)):b(),i(!0)},j=()=>{i(!1),b()},N=async _=>{_.preventDefault();try{const P={name:p.name,provider:p.provider,date:p.date,end_date:p.end_date||null,time:p.time||null,region:p.region,website_url:p.website_url,description:p.description||null,status:p.status,image_url:p.image_url||null};if(o){const{error:$}=await K.from("external_courses").update(P).eq("id",o.id);if($)throw $;Ms.success("External course updated successfully")}else{const{error:$}=await K.from("external_courses").insert([P]);if($)throw $;Ms.success("External course created successfully")}v(),j()}catch(P){console.error("Error saving external course:",P),Ms.error("Failed to save external course")}},k=async _=>{if(confirm("Are you sure you want to delete this external course?"))try{const{error:P}=await K.from("external_courses").delete().eq("id",_);if(P)throw P;Ms.success("External course deleted successfully"),v()}catch(P){console.error("Error deleting external course:",P),Ms.error("Failed to delete external course")}};return n?r.jsx("div",{className:"text-center py-8",children:"Loading external courses..."}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold",children:"External Courses"}),r.jsx("p",{className:"text-muted-foreground",children:"Manage courses from external providers"})]}),r.jsxs(go,{open:a,onOpenChange:i,children:[r.jsx(Gf,{asChild:!0,children:r.jsxs(G,{onClick:()=>y(),children:[r.jsx(vh,{className:"mr-2 h-4 w-4"}),"Add External Course"]})}),r.jsxs(Ni,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(Si,{children:[r.jsx(ki,{children:o?"Edit External Course":"Add External Course"}),r.jsx(Ci,{children:o?"Update the external course information":"Add a new course from an external provider"})]}),r.jsxs("form",{onSubmit:N,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"name",children:"Course Name *"}),r.jsx(xe,{id:"name",value:p.name,onChange:_=>w({...p,name:_.target.value}),required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"provider",children:"Provider/Company *"}),r.jsx(xe,{id:"provider",value:p.provider,onChange:_=>w({...p,provider:_.target.value}),required:!0})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"date",children:"Start Date *"}),r.jsx(xe,{id:"date",type:"date",value:p.date,onChange:_=>w({...p,date:_.target.value}),required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"end_date",children:"End Date (optional)"}),r.jsx(xe,{id:"end_date",type:"date",value:p.end_date,onChange:_=>w({...p,end_date:_.target.value})})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"time",children:"Time (optional)"}),r.jsx(xe,{id:"time",type:"text",placeholder:"e.g., 09:00 or Morning",value:p.time,onChange:_=>w({...p,time:_.target.value})})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"region",children:"Region *"}),r.jsx(xe,{id:"region",value:p.region,onChange:_=>w({...p,region:_.target.value}),placeholder:"e.g., Zürich, Bern, etc.",required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"website_url",children:"Website URL *"}),r.jsx(xe,{id:"website_url",type:"url",value:p.website_url,onChange:_=>w({...p,website_url:_.target.value}),placeholder:"https://...",required:!0})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"description",children:"Description (optional)"}),r.jsx(ei,{id:"description",value:p.description,onChange:_=>w({...p,description:_.target.value}),rows:4})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"status",children:"Status"}),r.jsxs(mt,{value:p.status,onValueChange:_=>w({...p,status:_}),children:[r.jsx(ot,{children:r.jsx(ht,{})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"draft",children:"Draft"}),r.jsx(fe,{value:"upcoming",children:"Published"}),r.jsx(fe,{value:"past",children:"Past"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Draft courses are only visible to admins. Published courses appear on the Events page."})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"Member-Only Image (optional)"}),r.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["JPEG only, max ",Nv,"KB. This image will only be shown to logged-in users."]}),u?r.jsxs("div",{className:"relative inline-block",children:[r.jsx("img",{src:u,alt:"Preview",className:"max-w-[200px] max-h-[200px] rounded-md border"}),r.jsx(G,{type:"button",variant:"destructive",size:"icon",className:"absolute -top-2 -right-2 h-6 w-6",onClick:g,children:r.jsx(Nn,{className:"h-4 w-4"})})]}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xe,{ref:f,type:"file",accept:"image/jpeg,image/jpg",onChange:x,disabled:c,
561className:"max-w-[300px]"}),c&&r.jsx("span",{className:"text-sm text-muted-foreground",children:"Uploading..."})]})]}),r.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[r.jsx(G,{type:"button",variant:"outline",onClick:j,children:"Cancel"}),r.jsx(G,{type:"submit",children:o?"Update Course":"Create Course"})]})]})]})]})]}),e.length===0?r.jsx("div",{className:"text-center py-12 border rounded-lg",children:r.jsx("p",{className:"text-muted-foreground",children:"No external courses yet. Add your first one!"})}):r.jsx("div",{className:"border rounded-lg",children:r.jsxs(ko,{children:[r.jsx(Co,{children:r.jsxs(Lr,{children:[r.jsx(jt,{children:"Course Name"}),r.jsx(jt,{children:"Provider"}),r.jsx(jt,{children:"Date"}),r.jsx(jt,{children:"Region"}),r.jsx(jt,{children:"Status"}),r.jsx(jt,{className:"text-right",children:"Actions"})]})}),r.jsx(Ao,{children:e.map(_=>r.jsxs(Lr,{children:[r.jsx(xt,{className:"font-medium",children:_.name}),r.jsx(xt,{children:_.provider}),r.jsxs(xt,{children:[an(new Date(_.date),"dd.MM.yyyy"),_.time&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(",_.time,")"]})]}),r.jsx(xt,{children:_.region}),r.jsx(xt,{children:r.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs ${_.status==="upcoming"?"bg-primary/10 text-primary":_.status==="draft"?"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400":"bg-muted text-muted-foreground"}`,children:_.status==="upcoming"?"Published":_.status==="draft"?"Draft":"Past"})}),r.jsx(xt,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(G,{variant:"ghost",size:"sm",onClick:()=>y(_),children:r.jsx(Nd,{className:"h-4 w-4"})}),r.jsx(G,{variant:"ghost",size:"sm",onClick:()=>k(_.id),children:r.jsx(Ns,{className:"h-4 w-4"})})]})})]},_.id))})]})})]})}function dV({searchQuery:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:s,typeFilter:a,onTypeFilterChange:i,memberStatusFilter:o,onMemberStatusFilterChange:l,resultCount:c}){const[d,u]=m.useState(!1),h=[n,a,o].filter(v=>v!=="all").length,f=h>0||e.length>0,p=()=>{t(""),s("all"),i("all"),l("all")},w=r.jsxs(r.Fragment,{children:[r.jsxs(mt,{value:n,onValueChange:s,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Payment Status"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Statuses"}),r.jsx(fe,{value:"pending",children:"Pending"}),r.jsx(fe,{value:"reminder_sent",children:"Reminder Sent"}),r.jsx(fe,{value:"overdue",children:"Overdue"}),r.jsx(fe,{value:"paid",children:"Paid"}),r.jsx(fe,{value:"cancelled",children:"Cancelled"})]})]}),r.jsxs(mt,{value:a,onValueChange:i,children:[r.jsx(ot,{className:"w-full md:w-[150px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Type"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Types"}),r.jsx(fe,{value:"membership",children:"Membership"}),r.jsx(fe,{value:"course",children:"Course"})]})]}),r.jsxs(mt,{value:o,onValueChange:l,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Member Status"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Members"}),r.jsx(fe,{value:"member",children:"Members"}),r.jsx(fe,{value:"non-member",children:"Non-members"})]})]})]});return r.jsxs("div",{className:"sticky top-0 z-10 bg-card border-b border-border",children:[r.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(df,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(xe,{placeholder:"Search by name, email, or reference…",value:e,onChange:v=>t(v.target.value),className:"pl-9 pr-9"}),e&&r.jsx("button",{onClick:()=>t(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r.jsx(Nn,{className:"h-4 w-4"})})]}),r.jsxs(G,{variant:"outline",size:"icon",className:"md:hidden h-10 w-10 shrink-0 relative",onClick:()=>u(!d),children:[r.jsx(Ry,{className:"h-4 w-4"}),h>0&&r.jsx("span",{className:"absolute -top-1 -right-1 h-4 w-4 roun
561ded-full bg-primary text-primary-foreground text-[10px] flex items-center justify-center",children:h})]})]}),r.jsxs("div",{className:"hidden md:flex items-center gap-3 px-4 pb-3 flex-wrap",children:[w,f&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 text-xs text-muted-foreground hover:text-foreground",onClick:p,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]}),r.jsxs("span",{className:"ml-auto text-xs text-muted-foreground",children:[c," payment",c!==1?"s":""]})]}),d&&r.jsxs("div",{className:"md:hidden px-4 pb-3 space-y-2",children:[w,f&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:p,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]})]}),r.jsx("div",{className:"md:hidden flex items-center px-4 pb-2",children:r.jsxs("span",{className:"text-xs text-muted-foreground",children:[c," payment",c!==1?"s":""]})})]})}const Uh={pending:{label:"Pending",className:"bg-muted text-muted-foreground border-border"},reminder_sent:{label:"Reminder sent",className:"bg-amber-100 text-amber-800 border-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-800"},overdue:{label:"Overdue",className:"bg-red-100 text-red-800 border-red-200 dark:bg-red-900/30 dark:text-red-400 dark:border-red-800"},paid:{label:"Paid",className:"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-300 dark:border-emerald-800"},cancelled:{label:"Cancelled",className:"bg-muted text-muted-foreground border-border line-through"}};function c_({payment:e,isActionable:t,onSendReminder:n,onCancelClick:s,onEdit:a}){return r.jsxs(qw,{children:[r.jsx(Vw,{asChild:!0,children:r.jsxs(G,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:[r.jsx(Ay,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Actions"})]})}),r.jsxs(Qf,{align:"end",children:[r.jsxs(Vr,{onClick:()=>a(e),children:[r.jsx(Nd,{className:"h-4 w-4 mr-2"}),"Edit payment"]}),t&&r.jsxs(r.Fragment,{children:[r.jsxs(Vr,{onClick:()=>n(e.id),children:[r.jsx(_S,{className:"h-4 w-4 mr-2 text-amber-600"}),"Send reminder"]}),r.jsxs(Vr,{onClick:s,children:[r.jsx(jd,{className:"h-4 w-4 mr-2 text-destructive"}),"Cancel payment"]})]})]})]})}function uV({payment:e,onViewDetail:t,onMarkPaid:n,onSendReminder:s,onCancel:a,onEdit:i}){const[o,l]=m.useState(!1),[c,d]=m.useState(!1),u=Uh[e.status]||Uh.pending,h=e.status!=="paid"&&e.status!=="cancelled",f=(()=>{if(!h)return 0;const p=new Date;p.setHours(0,0,0,0);const w=di(e.due_date);w.setHours(0,0,0,0);const v=r2(p,w);return v>0?v:0})();return r.jsxs("div",{className:"border-b border-border last:border-b-0 hover:bg-muted/40 transition-colors group",children:[r.jsxs("div",{className:"hidden md:grid md:grid-cols-[1fr_1.2fr_1.2fr_0.8fr_100px_100px_110px_110px] md:items-center md:gap-3 px-4 py-3",children:[r.jsx("button",{className:"text-xs text-muted-foreground font-mono truncate text-left hover:underline cursor-pointer",onClick:()=>t(e),children:e.id.slice(0,8)}),r.jsx("span",{className:"text-sm font-medium truncate",children:e.member_first_name||"—"}),r.jsx("span",{className:"text-sm font-medium truncate",children:e.member_last_name||"—"}),r.jsxs("div",{children:[r.jsxs("span",{className:"text-sm font-medium",children:["CHF ",Number(e.amount).toFixed(2)]}),f>0&&r.jsxs("p",{className:"text-[11px] text-destructive font-medium",children:["overdue ",f,"d"]})]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:an(di(e.due_date),"dd.MM.yyyy")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:an(new Date(e.created_at),"dd.MM.yyyy")}),r.jsx(Me,{variant:"outline",className:u.className,children:u.label}),r.jsxs("div",{className:"flex items-center gap-1",children:[h&&r.jsxs(G,{size:"sm",className:"h-8 bg-emerald-600 text-white hover:bg-emerald-700 shrink-0",onClick:()=>l(!0),children:[r.jsx(Ys,{className:"h-4 w-4 mr-1"}),"Paid"]}),r.jsx(c_,{payment:e,isActionable:h,onSendReminder:s,onCancelClick:()=>d(!0),onEdit:i})]})]}),r.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3",children:[r.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer block",onClick:()=>t(e),children:e.id.slice(0,8)}),r.jsx("span",{className:"text-sm truncate block",children:e.member_name}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-xs font-medium",children:["CHF ",Number(e.amount).toFixed(2)]}),f>0&&r.jsxs("span",{className:"text-[10px] text-destructive font-medium",children:["overdue ",f,"d"]}),r.jsx(Me,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${u.className}`,children:u.label})]})]}),h&&r.jsx(G,{size:"sm",className:"h-8 bg-emerald-600 text-white hover:bg-emerald-700 shrink-0",onClick:()=>l(!0),children:r.jsx(Ys,{className:"h-4 w-4"})}),r.jsx(c_,{payment:e,isActionable:h,onSendReminder:s,onCancelClick:()=>d(!0),onEdit:i})]}),r.jsx(_n,{open:o,onOpenChange:l,children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Mark payment as paid?"}),r.jsxs(mn,{children:["This will mark the payment of CHF ",Number(e.amount).toFixed(2)," for ",e.member_name," as paid."]})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{className:"bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>n(e.id),children:"Confirm"})]})]})}),r.jsx(_n,{open:c,onOpenChange:d,children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Cancel this payment?"}),r.jsxs(mn,{children:["This will cancel the payment of CHF ",Number(e.amount).toFixed(2)," for ",e.member_name,". This action cannot be undone."]})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Keep payment"}),r.jsx(hn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>a(e.id),children:"Cancel payment"})]})]})})]})}function mV(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const bT=Z.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{}
561,openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),dc=()=>{const e=Z.useContext(bT);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};mV(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
562[data-state=closed]
563){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;
563left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const hV=24,fV=typeof window<"u"?m.useLayoutEffect:m.useEffect;function d_(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function pV(){return Yw(/^Mac/)}function gV(){return Yw(/^iPhone/)}function u_(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function xV(){return Yw(/^iPad/)||pV()&&navigator.maxTouchPoints>1}function jT(){return gV()||xV()}function Yw(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const _g=typeof document<"u"&&window.visualViewport;function m_(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function _T(e){for(m_(e)&&(e=e.parentElement);e&&!m_(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const vV=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ym=0,Ng;function yV(e={}){let{isDisabled:t}=e;fV(()=>{if(!t)return ym++,ym===1&&jT()&&(Ng=wV()),()=>{ym--,ym===0&&(Ng==null||Ng())}},[t])}function wV(){let e,t=0,n=h=>{e=_T(h.target),!(e===document.documentElement&&e===document.body)&&(t=h.changedTouches[0].pageY)},s=h=>{if(!e||e===document.documentElement||e===document.body){h.preventDefault();return}let f=h.changedTouches[0].pageY,p=e.scrollTop,w=e.scrollHeight-e.clientHeight;w!==0&&((p<=0&&f>t||p>=w&&f<t)&&h.preventDefault(),t=f)},a=h=>{let f=h.target;Sv(f)&&f!==document.activeElement&&(h.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=h=>{let f=h.target;Sv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",_g&&(_g.height<window.innerHeight?requestAnimationFrame(()=>{h_(f)}):_g.addEventListener("resize",()=>h_(f),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=d_(bV(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=d_(Ic(document,"touchstart",n,{passive:!1,capture:!0}),Ic(document,"touchmove",s,{passive:!1,capture:!0}),Ic(document,"touchend",a,{passive:!1,capture:!0}),Ic(document,"focus",i,!0),Ic(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function bV(e,t,n){let s=e.style[t];return e.style[t]=n,()=>{e.style[t]=s}}function Ic(e,t,n,s){return e.addEventListener(t,n,s),()=>{e.removeEventListener(t,n,s)}}function h_(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=_T(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let s=n.getBoundingClientRect().top,a=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom+hV;i>o&&(n.scrollTop+=a-s)}e=n.parentElement}}function Sv(e){return e instanceof HTMLInputElement&&!vV.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function jV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _V(...e){return t=>e.forEach(n=>jV(n,t))}function NT(...e){return m.useCallback(_V(...e),e)}const ST=new WeakMap;function vn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let s={};Object.entries(t).forEach(([a,i])=>{if(a.startsWith("--")){e.style.setProperty(a,i);return}s[a]=e.style[a],e.style[a]=i}),!n&&ST.set(e,s)}function NV(e,t){if(!e||!(e instanceof HTMLElement))return;let n=ST.get(e);n&&(e.style[t]=n[t])}const yn=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function wm(e,t){if(!e)return null;const n=window.getComputedStyle(e),s=n.transform||n.webkitTransform||n.mozTransform;let a=s.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[yn(t)?13:12]):(a=s.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[yn(t)?5:4]):null)}function SV(e){return 8*(Math.log(e+1)-2)}function Sg(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function kV(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Yt={DURATION:.5,EASE:[.32,.72,0,1]},kT=.4,CV=.25,AV=100,CT=8,zi=16,kv=26,kg="vaul-dragging";function AT(e){const t=Z.useRef(e);return Z.useEffect(()=>{t.current=e}),Z.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function EV({defaultProp:e,onChange:t}){const n=Z.useState(e),[s]=n,a=Z.useRef(s),i=AT(t);return Z.useEffect(()=>{a.current!==s&&(i(s),a.current=s)},[s,a,i]),n}function ET({prop:e,defaultProp:t,onChange:n=()=>{}}){const[s,a]=EV({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:s,l=AT(n),c=Z.useCallback(d=>
563{if(i){const h=typeof d=="function"?d(e):d;h!==e&&l(h)}else a(d)},[i,e,a,l]);return[o,c]}function TV({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:s,overlayRef:a,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,h]=ET({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,p]=Z.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);Z.useEffect(()=>{function _(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const w=Z.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),v=Z.useMemo(()=>n==null?void 0:n.findIndex(_=>_===u),[n,u]),b=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,x=Z.useMemo(()=>{const _=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var P;return(P=n==null?void 0:n.map($=>{const M=typeof $=="string";let O=0;if(M&&(O=parseInt($,10)),yn(l)){const U=M?O:f?$*_.height:0;return f?l==="bottom"?_.height-U:-_.height+U:U}const A=M?O:f?$*_.width:0;return f?l==="right"?_.width-A:-_.width+A:A}))!=null?P:[]},[n,f,c]),g=Z.useMemo(()=>v!==null?x==null?void 0:x[v]:null,[x,v]),y=Z.useCallback(_=>{var P;const $=(P=x==null?void 0:x.findIndex(M=>M===_))!=null?P:null;o($),vn(s.current,{transition:`transform ${Yt.DURATION}
563s cubic-bezier(${Yt.EASE.join(",")})`,transform:yn(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`}),x&&$!==x.length-1&&$!==i&&$<i?vn(a.current,{transition:`opacity ${Yt.DURATION}s cubic-bezier(${Yt.EASE.join(",")})`,opacity:"0"}):vn(a.current,{transition:`opacity ${Yt.DURATION}s cubic-bezier(${Yt.EASE.join(",")})`,opacity:"1"}),h(n==null?void 0:n[Math.max($,0)])},[s.current,n,x,i,a,h]);Z.useEffect(()=>{if(u||e){var _;const P=(_=n==null?void 0:n.findIndex($=>$===e||$===u))!=null?_:-1;x&&P!==-1&&typeof x[P]=="number"&&y(x[P])}},[u,e,n,x,y]);function j({draggedDistance:_,closeDrawer:P,velocity:$,dismissible:M}){if(i===void 0)return;const O=l==="bottom"||l==="right"?(g??0)-_:(g??0)+_,A=v===i-1,U=v===0,W=_>0;if(A&&vn(a.current,{transition:`opacity ${Yt.DURATION}s cubic-bezier(${Yt.EASE.join(",")})`}),!d&&$>2&&!W){M?P():y(x[0]);return}if(!d&&$>2&&W&&x&&n){y(x[n.length-1]);return}const E=x==null?void 0:x.reduce((L,C)=>typeof L!="number"||typeof C!="number"?L:Math.abs(C-O)<Math.abs(L-O)?C:L),S=yn(l)?window.innerHeight:window.innerWidth;if($>kT&&Math.abs(_)<S*.4){const L=W?1:-1;if(L>0&&w){y(x[n.length-1]);return}if(U&&L<0&&M&&P(),v===null)return;y(x[v+L]);return}y(E)}function N({draggedDistance:_}){if(g===null)return;const P=l==="bottom"||l==="right"?g-_:g+_;(l==="bottom"||l==="right")&&P<x[x.length-1]||(l==="top"||l==="left")&&P>x[x.length-1]||vn(s.current,{transform:yn(l)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`})}function k(_,P){if(!n||typeof v!="number"||!x||i===void 0)return null;const $=v===i-1;if(v>=i&&P)return 0;if($&&!P)return 1;if(!b&&!$)return null;const O=$?v+1:v-1,A=$?x[O]-x[O-1]:x[O+1]-x[O],U=_/Math.abs(A);return $?1-U:U}return{isLastSnapPoint:w,activeSnapPoint:u,shouldFade:b,getPercentageDragged:k,setActiveSnapPoint:h,activeSnapPointIndex:v,onRelease:j,onDrag:N,snapPointsOffset:x}}const PV=()=>()=>{};function RV(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:s,noBodyStyles:a}=dc(),i=Z.useRef(null),o=m.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-kv)/window.innerWidth}Z.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;kV(s&&!a?Sg(document.body,{background:"black"}):PV,Sg(c,{transformOrigin:yn(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Yt.DURATION}
563s`,transitionTimingFunction:`cubic-bezier(${Yt.EASE.join(",")})`}));const d=Sg(c,{borderRadius:`${CT}px`,overflow:"hidden",...yn(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},Yt.DURATION*1e3)}}},[t,n,o])}let Lc=null;function MV({isOpen:e,modal:t,nested:n,hasBeenOpened:s,preventScrollRestoration:a,noBodyStyles:i}){const[o,l]=Z.useState(()=>typeof window<"u"?window.location.href:""),c=Z.useRef(0),d=Z.useCallback(()=>{if(u_()&&Lc===null&&e&&!i){Lc={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:h,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-h}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&c.current>=f&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[e]),u=Z.useCallback(()=>{if(u_()&&Lc!==null&&!i){const h=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Lc),window.requestAnimationFrame(()=>{if(a&&o!==window.location.href){l(window.location.href);return}window.scrollTo(f,h)}),Lc=null}},[o]);return Z.useEffect(()=>{function h(){c.current=window.scrollY}return h(),window.addEventListener("scroll",h),()=>{window.removeEventListener("scroll",h)}},[]),Z.useEffect(()=>{n||!s||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{u()},500)):u())},[e,s,o,t,n,d,u]),{restorePositionSetting:u}}function TT({open:e,onOpenChange:t,children:n,onDrag:s,onRelease:a,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=CV,scrollLockTimeout:d=AV,dismissible:u=!0,handleOnly:h=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:w,fixed:v,modal:b=!0,onClose:x,nested:g,noBodyStyles:y,direction:j="bottom",defaultOpen:N=!1,disablePreventScroll:k=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:P=!1,repositionInputs:$=!0,onAnimationEnd:M,container:O,autoFocus:A=!1}){var U,W;const[E=!1,S]=ET({defaultProp:N,prop:e,onChange:V=>{t==null||t(V),!V&&!g&&bt(),setTimeout(()=>{M==null||M(V)},Yt.DURATION*1e3),V&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),V||(document.body.style.pointerEvents="auto")}}),[L,C]=Z.useState(!1),[D,F]=Z.useState(!1),[T,q]=Z.useState(!1),I=Z.useRef(null),Y=Z.useRef(null),ie=Z.useRef(null),se=Z.useRef(null),pe=Z.useRef(null),_e=Z.useRef(!1),Pe=Z.useRef(null),ke=Z.useRef(0),Re=Z.useRef(!1),De=Z.useRef(0),de=Z.useRef(null),R=Z.useRef(((U=de.current)==null?void 0:U.getBoundingClientRect().height)||0),X=Z.useRef(((W=de.current)==null?void 0:W.getBoundingClientRect().width)||0),ue=Z.useRef(0),te=Z.useCallback(V=>{i&&V===dt.length-1&&(Y.current=new Date)},[]),{activeSnapPoint:Ce,activeSnapPointIndex:he,setActiveSnapPoint:Be,onRelease:Nt,snapPointsOffset:dt,onDrag:Ze,shouldFade:st,getPercentageDragged:Ke}=TV({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:w,drawerRef:de,fadeFromIndex:f,overlayRef:I,onSnapPointChange:te,direction:j,container:O,snapToSequentialPoint:_});yV({isDisabled:!E||D||!b||T||!L||!$||!k});const{restorePositionSetting:bt}=MV({isOpen:E,modal:b,nested:g,hasBeenOpened:L,preventScrollRestoration:P,noBodyStyles:y});function pt(){return(window.innerWidth-kv)/window.innerWidth}function kn(V){var oe,Ae;!u&&!i||de.current&&!de.current.contains(V.target)||(R.current=((oe=de.current)==null?void 0:oe.getBoundingClientRect().height)||0,X.current=((Ae=de.current)==null?void 0:Ae.getBoundingClientRect().width)||0,F(!0),ie.current=new Date,jT()&&window.addEventListener("touchend",()=>_e.current=!1,{once:!0}),V.target.setPointerCapture(V.pointerId),ke.current=yn(j)?V.pageY:V.pageX)}function Ot(V,oe){var Ae,$e;let Ve=V;const gt=(Ae=window.getSelection())==null?void 0:Ae.toString(),qt=de.current?wm(de.current,j):null,zt=new Date;if(Ve.hasAttribute("data-vaul-no-drag")||Ve.closest("[data-vaul-no-drag]"))return!1;if(j==="right"||j==="left")return!0;
563if(Y.current&&zt.getTime()-Y.current.getTime()<500)return!1;if(qt!==null&&(j==="bottom"?qt>0:qt<0))return!0;if(gt&&gt.length>0)return!1;if(zt.getTime()-(($e=pe.current)==null?void 0:$e.getTime())<d&&qt===0||oe)return pe.current=zt,!1;for(;Ve;){if(Ve.scrollHeight>Ve.clientHeight){if(Ve.scrollTop!==0)return pe.current=new Date,!1;if(Ve.getAttribute("role")==="dialog")return!0}Ve=Ve.parentNode}return!0}function $t(V){if(de.current&&D){const oe=j==="bottom"||j==="right"?1:-1,Ae=(ke.current-(yn(j)?V.pageY:V.pageX))*oe,$e=Ae>0,Ve=i&&!u&&!$e;if(Ve&&he===0)return;const gt=Math.abs(Ae),qt=document.querySelector("[data-vaul-drawer-wrapper]"),zt=j==="bottom"||j==="top"?R.current:X.current;let vt=gt/zt;const Vt=Ke(gt,$e);if(Vt!==null&&(vt=Vt),Ve&&vt>=1||!_e.current&&!Ot(V.target,$e))return;if(de.current.classList.add(kg),_e.current=!0,vn(de.current,{transition:"none"}),vn(I.current,{transition:"none"}),i&&Ze({draggedDistance:Ae}),$e&&!i){const Jt=SV(Ae),Ur=Math.min(Jt*-1,0)*oe;vn(de.current,{transform:yn(j)?`translate3d(0, ${Ur}px, 0)`:`translate3d(${Ur}px, 0, 0)`});return}const cr=1-vt;if((st||f&&he===f-1)&&(s==null||s(V,vt),vn(I.current,{opacity:`${cr}`,transition:"none"},!0)),qt&&I.current&&o){const Jt=Math.min(pt()+vt*(1-pt()),1),Ur=8-vt*8,Br=Math.max(0,14-vt*14);vn(qt,{borderRadius:`${Ur}px`,transform:yn(j)?`scale(${Jt}) translate3d(0, ${Br}px, 0)`:`scale(${Jt}) translate3d(${Br}px, 0, 0)`,transition:"none"},!0)}if(!i){const Jt=gt*oe;vn(de.current,{transform:yn(j)?`translate3d(0, ${Jt}px, 0)`:`translate3d(${Jt}px, 0, 0)`})}}}Z.useEffect(()=>{var V;function oe(){if(!de.current||!$)return;const Ae=document.activeElement;if(Sv(Ae)||Re.current){var $e;const Ve=(($e=window.visualViewport)==null?void 0:$e.height)||0,gt=window.innerHeight;let qt=gt-Ve;const zt=de.current.getBoundingClientRect().height||0,vt=zt>gt*.8;ue.current||(ue.current=zt);const Vt=de.current.getBoundingClientRect().top;if(Math.abs(De.current-qt)>60&&(Re.current=!Re.current),i&&i.length>0&&dt&&he){const cr=dt[he]||0;qt+=cr}if(De.current=qt,zt>Ve||Re.current){const cr=de.current.getBoundingClientRect().height;let Jt=cr;cr>Ve&&(Jt=Ve-(vt?Vt:kv)),v?de.current.style.height=`${cr-Math.max(qt,0)}px`:de.current.style.height=`${Math.max(Jt,Ve-Vt)}px`}else de.current.style.height=`${ue.current}px`;i&&i.length>0&&!Re.current?de.current.style.bottom="0px":de.current.style.bottom=`${Math.max(qt,0)}px`}}return(V=window.visualViewport)==null||V.addEventListener("resize",oe),()=>{var Ae;return(Ae=window.visualViewport)==null?void 0:Ae.removeEventListener("resize",oe)}},[he,i,dt]);function pn(V){Cn(),x==null||x(),V||S(!1),setTimeout(()=>{i&&Be(i[0])},Yt.DURATION*1e3)}function Sr(){if(!de.current)return;const V=document.querySelector("[data-vaul-drawer-wrapper]"),oe=wm(de.current,j);vn(de.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Yt.DURATION}
563s cubic-bezier(${Yt.EASE.join(",")})`}),vn(I.current,{transition:`opacity ${Yt.DURATION}s cubic-bezier(${Yt.EASE.join(",")})`,opacity:"1"}),o&&oe&&oe>0&&E&&vn(V,{borderRadius:`${CT}px`,overflow:"hidden",...yn(j)?{transform:`scale(${pt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${pt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Yt.EASE.join(",")})`},!0)}function Cn(){!D||!de.current||(de.current.classList.remove(kg),_e.current=!1,F(!1),se.current=new Date)}function kr(V){if(!D||!de.current)return;de.current.classList.remove(kg),_e.current=!1,F(!1),se.current=new Date;const oe=wm(de.current,j);if(!Ot(V.target,!1)||!oe||Number.isNaN(oe)||ie.current===null)return;const Ae=se.current.getTime()-ie.current.getTime(),$e=ke.current-(yn(j)?V.pageY:V.pageX),Ve=Math.abs($e)/Ae;if(Ve>.05&&(q(!0),setTimeout(()=>{q(!1)},200)),i){Nt({draggedDistance:$e*(j==="bottom"||j==="right"?1:-1),closeDrawer:pn,velocity:Ve,dismissible:u}),a==null||a(V,!0);return}if(j==="bottom"||j==="right"?$e>0:$e<0){Sr(),a==null||a(V,!0);return}if(Ve>kT){pn(),a==null||a(V,!1);return}var gt;const qt=Math.min((gt=de.current.getBoundingClientRect().height)!=null?gt:0,window.innerHeight);var zt;const vt=Math.min((zt=de.current.getBoundingClientRect().width)!=null?zt:0,window.innerWidth),Vt=j==="left"||j==="right";if(Math.abs(oe)>=(Vt?vt:qt)*c){pn(),a==null||a(V,!1);return}a==null||a(V,!0),Sr()}Z.useEffect(()=>(E&&(vn(document.documentElement,{scrollBehavior:"auto"}),Y.current=new Date),()=>{NV(document.documentElement,"scrollBehavior")}),[E]);function Wt(V){const oe=V?(window.innerWidth-zi)/window.innerWidth:1,Ae=V?-zi:0;Pe.current&&window.clearTimeout(Pe.current),vn(de.current,{transition:`transform ${Yt.DURATION}
563s cubic-bezier(${Yt.EASE.join(",")})`,transform:`scale(${oe}) translate3d(0, ${Ae}px, 0)`}),!V&&de.current&&(Pe.current=setTimeout(()=>{const $e=wm(de.current,j);vn(de.current,{transition:"none",transform:yn(j)?`translate3d(0, ${$e}px, 0)`:`translate3d(${$e}px, 0, 0)`})},500))}function J(V,oe){if(oe<0)return;const Ae=(window.innerWidth-zi)/window.innerWidth,$e=Ae+oe*(1-Ae),Ve=-zi+oe*zi;vn(de.current,{transform:yn(j)?`scale(${$e}) translate3d(0, ${Ve}px, 0)`:`scale(${$e}) translate3d(${Ve}px, 0, 0)`,transition:"none"})}function ae(V,oe){const Ae=yn(j)?window.innerHeight:window.innerWidth,$e=oe?(Ae-zi)/Ae:1,Ve=oe?-zi:0;oe&&vn(de.current,{transition:`transform ${Yt.DURATION}s cubic-bezier(${Yt.EASE.join(",")})`,transform:yn(j)?`scale(${$e}) translate3d(0, ${Ve}px, 0)`:`scale(${$e}) translate3d(${Ve}px, 0, 0)`})}return Z.createElement(Vf,{defaultOpen:N,onOpenChange:V=>{!u&&!V||(V?C(!0):pn(!0),S(V))},open:E},Z.createElement(bT.Provider,{value:{activeSnapPoint:Ce,snapPoints:i,setActiveSnapPoint:Be,drawerRef:de,overlayRef:I,onOpenChange:t,onPress:kn,onRelease:kr,onDrag:$t,dismissible:u,handleOnly:h,isOpen:E,isDragging:D,shouldFade:st,closeDrawer:pn,onNestedDrag:J,onNestedOpenChange:Wt,onNestedRelease:ae,keyboardIsOpen:Re,modal:b,snapPointsOffset:dt,direction:j,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:y,container:O,autoFocus:A}},n))}const PT=Z.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:s,onRelease:a,shouldFade:i,isOpen:o,modal:l}=dc(),c=NT(t,n),d=s&&s.length>0;return l?Z.createElement(ic,{onMouseUp:a,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":o&&d?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});PT.displayName="Drawer.Overlay";const RT=Z.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...s},a){const{drawerRef:i,onPress:o,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,modal:h,isOpen:f,direction:p,snapPoints:w,container:v,handleOnly:b,autoFocus:x}=dc(),[g,y]=Z.useState(!1),j=NT(a,i),N=Z.useRef(null),k=Z.useRef(null),_=Z.useRef(!1),P=w&&w.length>0;RV();const $=(O,A,U=0)=>
563{if(_.current)return!0;const W=Math.abs(O.y),E=Math.abs(O.x),S=E>W,L=["bottom","right"].includes(A)?1:-1;if(A==="left"||A==="right"){if(!(O.x*L<0)&&E>=0&&E<=U)return S}else if(!(O.y*L<0)&&W>=0&&W<=U)return!S;return _.current=!0,!0};Z.useEffect(()=>{P&&window.requestAnimationFrame(()=>{y(!0)})},[]);function M(O){N.current=null,_.current=!1,l(O)}return Z.createElement(oc,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":g?"true":"false","data-vaul-snap-points":f&&P?"true":"false","data-vaul-custom-container":v?"true":"false",...s,ref:j,style:u&&u.length>0?{"--snap-point-height":`${u[0]}px`,...t}:t,onPointerDown:O=>{b||(s.onPointerDown==null||s.onPointerDown.call(s,O),N.current={x:O.pageX,y:O.pageY},o(O))},onOpenAutoFocus:O=>{n==null||n(O),x||O.preventDefault()},onPointerDownOutside:O=>{if(e==null||e(O),!h||O.defaultPrevented){O.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:O=>{if(!h){O.preventDefault();return}},onPointerMove:O=>{if(k.current=O,b||(s.onPointerMove==null||s.onPointerMove.call(s,O),!N.current))return;const A=O.pageY-N.current.y,U=O.pageX-N.current.x,W=O.pointerType==="touch"?10:2;$({x:U,y:A},p,W)?c(O):(Math.abs(U)>W||Math.abs(A)>W)&&(N.current=null)},onPointerUp:O=>{s.onPointerUp==null||s.onPointerUp.call(s,O),N.current=null,_.current=!1,l(O)},onPointerOut:O=>{s.onPointerOut==null||s.onPointerOut.call(s,O),M(k.current)},onContextMenu:O=>{s.onContextMenu==null||s.onContextMenu.call(s,O),M(k.current)}})});RT.displayName="Drawer.Content";const DV=250,OV=120,MT=Z.forwardRef(function({preventCycle:e=!1,children:t,...n},s){const{closeDrawer:a,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:h,onPress:f,onDrag:p}=dc(),w=Z.useRef(null),v=Z.useRef(!1);function b(){if(v.current){y();return}window.setTimeout(()=>{x()},OV)}function x(){if(i||e||v.current){y();return}if(y(),(!o||o.length===0)&&d){a();return}if(l===o[o.length-1]&&d){a();return}const N=o.findIndex(_=>_===l);if(N===-1)return;const k=o[N+1];c(k)}function g(){w.current=window.setTimeout(()=>{v.current=!0},DV)}function y(){window.clearTimeout(w.current),v.current=!1}return Z.createElement("div",{onClick:b,onPointerCancel:y,onPointerDown:j=>{u&&f(j),g()},onPointerMove:j=>{u&&p(j)},ref:s,"data-vaul-drawer-visible":h?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},Z.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});MT.displayName="Drawer.Handle";function IV({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:s,onNestedOpenChange:a,onNestedRelease:i}=dc();if(!s)throw new Error("Drawer.NestedRoot must be placed in another drawer");return Z.createElement(TT,{nested:!0,onClose:()=>{a(!1)},onDrag:(o,l)=>{s(o,l),e==null||e(o,l)},onOpenChange:o=>{o&&a(o)},onRelease:i,...n})}function LV(e){const t=dc(),{container:n=t.container,...s}=e;return Z.createElement(Yf,{container:n,...s})}const Ta={Root:TT,NestedRoot:IV,Content:RT,Overlay:PT,Trigger:Ew,Portal:LV,Handle:MT,Close:vu,Title:lc,Description:cc},Gw=({shouldScaleBackground:e=!0,...t})=>r.jsx(Ta.Root,{shouldScaleBackground:e,...t});Gw.displayName="Drawer";const FV=Ta.Portal,DT=m.forwardRef(({className:e,...t},n)=>r.jsx(Ta.Overlay,{ref:n,className:le("fixed inset-0 z-50 bg-black/80",e),...t}));DT.displayName=Ta.Overlay.displayName;const Kw=m.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(FV,{children:[r.jsx(DT,{}),r.jsxs(Ta.Content,{ref:s,className:le("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[r.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));Kw.displayName="DrawerContent";const Zw=({className:e,...t})=>r.jsx("div",{className:le("grid gap-1.5 p-4 text-center sm:text-left",e),...t});Zw.displayName="DrawerHeader";const Xw=m.forwardRef(({className:e,...t},n)=>r.jsx(Ta.Title,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",e),...t}));Xw.displayName=Ta.Title.displayName;const Qw=m.forwardRef(({className:e,...t},n)=>r.jsx(Ta.Description,{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Qw.displayName=Ta.Description.displayName;function $V(e){const t=new Date;t.setHours(0,0,0,0);const n=di(e);n.setHours(0,0,0,0);const s=r2(n,t);return s===0?{text:"Due today",urgent:!0}:s>0?{text:`Due in ${s} day${s!==1?"s":""}`,urgent:s<=3}:{text:`Overdue by ${Math.abs(s)} day${Math.abs(s)!==1?"s":""}`,urgent:!0}}function f_({payment:e,onMarkPaid:t,onSendReminder:n,onCancel:s,onEdit:a}){const[i,o]=m.useState(!1),[l,c]=m.useState(String(Number(e.amount).toFixed(2))),[d,u]=m.useState(!1),[h,f]=m.useState(!1),p=e.status!=="paid"&&e.status!=="c
563ancelled",w=p?$V(e.due_date):null,v=()=>{const x=parseFloat(l);isNaN(x)||x<0||(a(e.id,x),o(!1))},b=[{label:"Payment ID",value:r.jsx("span",{className:"font-mono text-xs",children:e.id})},{label:"Email",value:e.member_email},{label:"Phone",value:e.member_phone||"—"},{label:"Member Status",value:r.jsx(Me,{variant:"outline",className:`text-xs ${e.member_status==="member"?"border-emerald-300 text-emerald-700 dark:border-emerald-700 dark:text-emerald-400":"border-muted-foreground/30 text-muted-foreground"}`,children:e.member_status==="member"?"Member":"Non-member"})},{label:"Payment Type",value:r.jsx("span",{className:"capitalize",children:e.payment_type})},{label:"Reference",value:e.reference},{label:"Amount",value:i?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm",children:"CHF"}),r.jsx(xe,{type:"number",step:"0.01",min:"0",value:l,onChange:x=>c(x.target.value),className:"h-8 w-24 text-sm",autoFocus:!0}),r.jsx(G,{size:"sm",className:"h-8",onClick:v,children:"Save"}),r.jsx(G,{size:"sm",variant:"ghost",className:"h-8",onClick:()=>{o(!1),c(String(Number(e.amount).toFixed(2)))},children:"Cancel"})]}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{children:["CHF ",Number(e.amount).toFixed(2)]}),r.jsx(G,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>o(!0),children:r.jsx(Nd,{className:"h-3 w-3"})})]})},{label:"Due Date",value:r.jsxs("div",{className:"text-right",children:[r.jsx("span",{children:an(di(e.due_date),"dd.MM.yyyy")}),w&&r.jsx("p",{className:`text-xs ${w.urgent?"text-red-600 dark:text-red-400 font-medium":"text-muted-foreground"}`,children:w.text})]})},...e.paid_at?[{label:"Paid At",value:an(di(e.paid_at),"dd.MM.yyyy HH:mm")}]:[],...e.notes?[{label:"Notes",value:e.notes}]:[],{label:"Created",value:an(di(e.created_at),"dd.MM.yyyy")}];return r.jsxs("div",{className:"space-y-3 pt-2",children:[b.map(({label:x,value:g})=>r.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[r.jsx("span",{className:"text-sm text-muted-foreground shrink-0",children:x}),r.jsx("span",{className:"text-sm font-medium text-right",children:g||"—"})]},x)),p&&r.jsxs("div",{className:"flex flex-wrap gap-2 pt-4 border-t border-border",children:[r.jsxs(G,{size:"sm",className:"h-8 bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>u(!0),children:[r.jsx(Ys,{className:"h-4 w-4 mr-1"}),"Mark as Paid"]}),r.jsxs(G,{size:"sm",variant:"outline",className:"h-8 border-amber-300 text-amber-700 hover:bg-amber-50 dark:border-amber-700 dark:text-amber-400 dark:hover:bg-amber-900/20",onClick:()=>n(e.id),children:[r.jsx(_S,{className:"h-4 w-4 mr-1"}),"Send Reminder"]}),r.jsxs(G,{size:"sm",variant:"outline",className:"h-8 text-destructive border-destructive/30 hover:bg-destructive/10",onClick:()=>f(!0),children:[r.jsx(jd,{className:"h-4 w-4 mr-1"}),"Cancel"]})]}),r.jsx(_n,{open:d,onOpenChange:u,children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Mark payment as paid?"}),r.jsxs(mn,{children:["This will mark the payment of CHF ",Number(e.amount).toFixed(2)," for ",e.member_name," as paid."]})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{className:"bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>t(e.id),children:"Confirm"})]})]})}),r.jsx(_n,{open:h,onOpenChange:f,children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Cancel this payment?"}),r.jsxs(mn,{children:["This will cancel the payment of CHF ",Number(e.amount).toFixed(2)," for ",e.member_name,". This action cannot be undone."]})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Keep payment"}),r.jsx(hn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>s(e.id),children:"Cancel payment"})]})]})})]})}function zV({payment:e,open:t,onOpenChange:n,onMarkPaid:s,onSendReminder:a,onCancel:i,onEdit:o}){const l=yu();if(!e)return null;const c=e.member_name||"—",d=`Payment: CHF ${Number(e.amount).toFixed(2)} · ${e.payment_type}`;return l?r.jsx(Gw,{open:t,onOpenChange:n,children:r.jsxs(Kw,{className:"max-h-[85vh]",children:[r.jsxs(Zw,{children:[r.jsx(Xw,{children:c}),r.jsx(Qw,{children:d})]}),r.jsx("div",{className:"px-4 pb-6 overflow-y-auto",children:r.jsx(f_,{payment:e,onMarkPaid:s,onSendReminder:a,onCancel:i,onEdit:o})})]})}):r.jsx(Pw,{open:t,onOpenChange:n,children:r.jsxs(Kf,{side:"right",className:"sm:max-w-md",children:[r.jsxs(Rw,{children:[r.jsx(Mw,{children:c}),r.jsx(Dw,{children:d})]}),r.jsx("div",{className:"pt-4",children:r.jsx(f_,{payment:e,onMarkPaid:s,onSendReminder:a,onCancel:i,onEdit:o})})]})})}function UV(){const{toast:e}=Sn(),[t,n]=m.useState([]),[s,a]=m.useState(!0),[i,o]=m.useState(""),[l,c]=m.useState("all"),[d,u]=m.useState("all"),[h,f]=m.useState("all"),[p,w]=m.useState("due_date"),[v,b]=m.useState("asc"),[x,g]=m.useState(null),[y,j]=m.useState(null),[N,k]=m.useState(null),[_,P]=m.useState(""),$=async()=>{a(!0);const{data:T,error:q}=await K.from("member_payments").select("*").order("due_date",{ascending:!0});if(q){e({title:"Error loading payments",description:q.message,variant:"destructive"}),a(!1);return}if(!T||T.length===0){n([]),a(!1);return}const I=[...new Set(T.filter(de=>de.member_id).map(de=>de.member_id))],Y=[...new Set(T.filter(de=>de.participant_id).map(de=>de.participant_id))],ie=[...new Set(T.filter(de=>!de.member_id&&!de.participant_id&&de.registration_id).map(de=>de.registration_id))],[{data:se},{data:pe},{data:_e}]=await Promise.all([I.length>0?K.from("profiles").select("id, first_name, last_name, email, phone, status").in("id",I):Promise.resolve({data:[]}),Y.length>0?K.from("participants").select("id, first_name, last_name, email, phone").in("id",Y):Promise.resolve({data:[]}),ie.length>0?K.from("course_registrations").select("id, first_name, last_name, email, phone").in("id",ie):Promise.resolve({data:[]})]),Pe=new Map((se||[]).map(de=>[de.id,de])),ke=new Map((pe||[]).map(de=>[de.id,de])),Re=new Map((_e||[]).map(de=>[de.id,de])),De=T.map(de=>{const R=de.member_id?Pe.get(de.member_id):null,X=de.participant_id?ke.get(de.participant_id):null,ue=!R&&!X&&de.registration_id?Re.get(de.registration_id):null,te=R||X||ue;return{...de,member_name:te?`${te.first_name||""} ${te.last_name||""}`.trim():"Unknown",member_first_name:(te==null?void 0:te.first_name)||"",member_last_name:(te==null?void 0:te.last_name)||"",member_email:(te==null?void 0:te.email)||"",member_phone:(te==null?void 0:te.phone)||"",member_status:R&&R.status==="approved"?"member":"non-member"}});n(De),a(!1)};m.useEffect(()=>{$()},[]);const M=T=>{p===T?b(v==="asc"?"desc":"asc"):(w(T),b("asc"))},O=({column:T})=>T!==p?r.jsx(Kl,{className:"h-3 w-3 ml-1 opacity-40"}):v==="asc"?r.jsx(jo,{className:"h-3 w-3 ml-1"}):r.jsx(bo,{className:"h-3 w-3 ml-1"}),A=m.useMemo(()=>{const T=i.toLowerCase().trim();return t.filter(q=>!(l!=="all"&&q.status!==l||d!=="all"&&q.payment_type!==d||h!=="all"&&q.member_status!==
563h||T&&![q.member_name,q.member_email,q.reference].join(" ").toLowerCase().includes(T))).sort((q,I)=>{const Y=v==="asc"?1:-1;switch(p){case"first_name":return Y*(q.member_first_name||"").localeCompare(I.member_first_name||"");case"last_name":return Y*(q.member_last_name||"").localeCompare(I.member_last_name||"");case"amount":return Y*(Number(q.amount)-Number(I.amount));case"due_date":return Y*(new Date(q.due_date).getTime()-new Date(I.due_date).getTime());case"created_at":return Y*(new Date(q.created_at).getTime()-new Date(I.created_at).getTime());case"status":return Y*q.status.localeCompare(I.status);default:return 0}})},[t,i,l,d,h,p,v]),U=async(T,q)=>{const I=t.find(se=>se.id===T),Y={status:q};q==="paid"&&(Y.paid_at=new Date().toISOString());const{error:ie}=await K.from("member_payments").update(Y).eq("id",T);if(ie){e({title:"Error updating payment",description:ie.message,variant:"destructive"});return}if(q==="reminder_sent"&&I&&I.member_email)try{let se="payment_reminder",pe={participantEmail:I.member_email,participantName:I.member_name,amount:I.amount,reference:I.reference,paymentType:I.payment_type,dueDate:I.due_date};if(I.payment_type==="membership")se="membership_invoice",pe={paymentId:I.id,participantEmail:I.member_email,participantName:I.member_name,amount:I.amount,reference:I.reference};else if(I.payment_type==="course"&&I.course_id){const[{data:Pe},{data:ke},{data:Re}]=await Promise.all([K.from("courses").select("name, date, location, meeting_point, region, description, price, member_price, payment_deadline_hours").eq("id",I.course_id).single(),I.session_id?K.from("course_sessions").select("location, capacity, price, member_price, payment_deadline_hours").eq("id",I.session_id).single():Promise.resolve({data:null}),I.registration_id?K.from("course_registrations").select("registration_date, user_id").eq("id",I.registration_id).single():Promise.resolve({data:null})]);Pe&&(pe={...pe,courseName:Pe.name,courseDate:Pe.date,courseLocation:(ke==null?void 0:ke.location)||Pe.location,courseMeetingPoint:Pe.meeting_point,courseRegion:Pe.region,courseDescription:Pe.description,coursePrice:(ke==null?void 0:ke.price)||Pe.price,memberPrice:(ke==null?void 0:ke.member_price)||Pe.member_price,isMember:!!(Re!=null&&Re.user_id),registrationDate:(Re==null?void 0:Re.registration_date)||I.created_at,paymentDeadlineHours:(ke==null?void 0:ke.payment_deadline_hours)||Pe.payment_deadline_hours||48})}const{error:_e}=await K.functions.invoke("admin-queue-email",{body:{emailType:se,payload:pe}});_e?(console.error("Failed to queue reminder email:",_e),e({title:"Reminder status updated",description:"But the email could not be sent.",variant:"destructive"})):e({title:"Reminder sent",description:`Payment reminder email queued for ${I.member_email}`})}catch(se){console.error("Failed to queue reminder email:",se),e({title:"Reminder status updated",description:"But the email could not be sent."})}else e({title:q==="paid"?"Marked as paid":q==="cancelled"?"Payment cancelled":"Reminder sent"});(x==null?void 0:x.id)===T&&g(null),$()},W=async(T,q)=>{const{error:I}=await K.from("member_payments").update({amount:q}).eq("id",T);if(I){e({title:"Error updating amount",description:I.message,variant:"destructive"});return}e({title:"Amount updated"}),k(null),(x==null?void 0:x.id)===T&&g(null),$()},E=async()=>{if(!y)return;const{error:T}=await K.from("member_payments").delete().eq("id",y);T?e({title:"Error deleting payment",description:T.message,variant:"destructive"}):(e({title:"Payment deleted"}),(x==null?void 0:x.id)===y&&g(null)),j(null),$()},S=T=>{k(T),P(String(Number(T.amount).toFixed(2)))},L=new Date;L.setHours(0,0,0,0);const C=T=>{if(T.status==="paid"||T.status==="cancelled")return!1;const q=new Date(T.due_date);return q.setHours(0,0,0,0),q<L},D=t.filter(T=>T.status==="pending"||T.status==="reminder_sent").length,F=t.filter(C).length;return r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Member Payments"}),r.jsx(Pt,{children:"Track and manage all member payment obligations"})]}),r.jsxs(H,{className:"px-0 pb-0",children:[!s&&t.length>0&&r.jsxs("div",{className:"flex gap-4 px-4 pb-4",children:[r.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:"Pending payments:"}),r.jsx("span",{className:"font-semibold",children:D})]}),r.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:"Overdue payments:"}),r.jsx("span",{className:`font-semibold ${F>0?"text-destructive":""}`,children:F})]})]}),r.jsx(dV,{searchQuery:i,onSearchChange:o,statusFilter:l,onStatusFilterChange:c,typeFilter:d,onTypeFilterChange:u,memberStatusFilter:h,onMemberStatusFilterChange:f,resultCount:A.length}),r.jsxs("div",{className:"hidden md:grid md:grid-cols-[1fr_1.2fr_1.2fr_0.8fr_100px_100px_110px_110px] md:items-center md:gap-3 px-4 py-2 border-b border-border text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[r.jsx("span",{children:"ID"}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("first_name"),children:["First Name ",r.jsx(O,{column:"first_name"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("last_name"),children:["Last Name ",r.jsx(O,{column:"last_name"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("amount"),children:["Amount ",r.jsx(O,{column:"amount"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("due_date"),children:["Due Date ",r.jsx(O,{column:"due_date"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("created_at"),children:["Created ",r.jsx(O,{column:"created_at"})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>M("status"),children:["Status ",r.jsx(O,{column:"status"})]}),r.jsx("span",{children:"Actions"})]}),s?r.jsx("p",{className:"text-muted-foreground px-4 py-6",children:"Loading..."}):A.length===0?r.jsx("p",{className:"text-muted-foreground px-4 py-6",children:i||l!=="all"||d!=="all"||h!=="all"?"No payments found":"No payments recorded yet"}):r.jsx("div",{children:A.map(T=>r.jsx(uV,{payment:T,onViewDetail:g,onMarkPaid:q=>U(q,"paid"),onSendReminder:q=>U(q,"reminder_sent"),onCancel:q=>U(q,"cancelled"),onEdit:S},T.id))})]}),r.jsx(zV,{payment:x,open:!!x,onOpenChange:T=>{T||g(null)},onMarkPaid:T=>U(T,"paid"),onSendReminder:T=>U(T,"reminder_sent"),onCancel:T=>U(T,"cancelled"),onEdit:(T,q)=>W(T,q)}),r.jsx(go,{open:!!N,onOpenChange:T=>{T||k(null)},children:r.jsxs(Ni,{className:"sm:max-w-sm",children:[r.jsxs(Si,{children:[r.jsx(ki,{children:"Edit Payment Amount"}),r.jsxs(Ci,{children:[N==null?void 0:N.member_name," — ",N==null?void 0:N.reference]})]}),r.jsxs("div",{className:"space-y-2 py-2",children:[r.jsx(Q,{htmlFor:"edit-amount",children:"Amount (CHF)"}),r.jsx(xe,{id:"edit-amount",type:"number",step:"0.01",min:"0",value:_,onCh
563ange:T=>P(T.target.value)})]}),r.jsxs(Yd,{children:[r.jsx(G,{variant:"outline",onClick:()=>k(null),children:"Cancel"}),r.jsx(G,{onClick:()=>{const T=parseFloat(_);!isNaN(T)&&T>=0&&N&&W(N.id,T)},children:"Save"})]})]})}),r.jsx(_n,{open:!!y,onOpenChange:()=>j(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Delete Payment"}),r.jsx(mn,{children:"Are you sure you want to permanently delete this payment record? This action cannot be undone."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}const BV=[{value:"email_not_confirmed",label:"Email not confirmed"},{value:"awaiting_payment",label:"Awaiting payment"},{value:"reminder_sent",label:"Reminder sent"},{value:"paid",label:"Paid"}];function HV({memberId:e}){const[t,n]=m.useState([]),[s,a]=m.useState(!0);return m.useEffect(()=>{(async()=>{a(!0);const{data:o}=await K.from("member_payments").select("id, payment_type, reference, amount, status, due_date, paid_at, created_at").eq("member_id",e).order("created_at",{ascending:!1});n(o||[]),a(!1)})()},[e]),s?r.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"Loading payments…"}):t.length===0?r.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"No payments found"}):r.jsx("div",{className:"space-y-2",children:t.map(i=>{const o=Uh[i.status]||Uh.pending;return r.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border px-3 py-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("p",{className:"text-sm font-medium truncate capitalize",children:[i.payment_type,": ",i.reference]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Due ",an(di(i.due_date),"dd.MM.yyyy"),i.paid_at&&` · Paid ${an(di(i.paid_at),"dd.MM.yyyy")}`]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsxs("span",{className:"text-sm font-medium",children:["CHF ",Number(i.amount).toFixed(2)]}),r.jsx(Me,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${o.className}`,children:o.label})]})]},i.id)})})}function p_({member:e,onUpdatePaymentStatus:t}){const n=e.status==="pending",s=[{label:"Email",value:e.email},{label:"Profession",value:e.job_title},{label:"University / Workplace",value:e.university},{label:"Year of Study",value:e.year_of_study},{label:"Phone",value:e.phone},{label:"Status",value:e.status},...e.role?[{label:"Role",value:e.role}]:[],...e.profession?[{label:"Profession (new)",value:e.profession}]:[],...e.career_stage?[{label:"Career Stage",value:e.career_stage.replace(/_/g," ")}]:[],...e.training_year?[{label:"Training Year",value:e.training_year}]:[],...e.graduation_year?[{label:"Graduation Year",value:String(e.graduation_year)}]:[],...e.institution?[{label:"Institution",value:e.institution}]:[],...e.languages&&e.languages.length>0?[{label:"Languages",value:e.languages.join(", ")}]:[],...e.member_category?[{label:"Member Category",value:e.member_category}]:[],...e.bio?[{label:"Bio",value:e.bio}]:[],{label:"Registered",value:an(new Date(e.created_at),"dd.MM.yyyy")}];return r.jsxs("div",{className:"space-y-3 pt-2",children:[e.tutor_interest===!0&&r.jsx("div",{className:"pb-2",children:r.jsx(Me,{variant:"secondary",className:"text-xs",children:"Interested in tutoring"})}),s.map(({label:a,value:i})=>r.jsxs("div",{className:"flex justify-between items-baseline gap-4",children:[r.jsx("span",{className:"text-sm text-muted-foreground shrink-0",children:a}),r.jsx("span",{className:"text-sm font-medium text-right break-words",children:i||"—"})]},a)),n&&t&&r.jsxs("div",{className:"flex justify-between items-center gap-4",children:[r.jsx("span",{className:"text-sm text-muted-foreground shrink-0",children:"Payment Status"}),r.jsxs(mt,{value:e.payment_status||"email_not_confirmed",onValueChange:a=>t(e.id,a),children:[r.jsx(ot,{className:"h-8 text-xs w-[160px]",children:r.jsx(ht,{})}),r.jsx(lt,{children:BV.map(a=>r.jsx(fe,{value:a.value,className:"text-xs",children:a.label},a.value))})]})]}),r.jsxs("div",{className:"pt-4 border-t border-border",children:[r.jsx("h4",{className:"text-sm font-medium mb-2",children:"Payment History"}),r.jsx(HV,{memberId:e.id})]})]})}function WV({member:e,open:t,onOpenChange:n,onUpdatePaymentStatus:s}){const a=yu();if(!e)return null;const i=`${e.first_name||""} ${e.last_name||""}`.trim()||"—";return a?r.jsx(Gw,{open:t,onOpenChange:n,children:r.jsxs(Kw,{className:"max-h-[85vh]",children:[r.jsxs(Zw,{children:[r.jsx(Xw,{children:i}),r.jsx(Qw,{children:"Member details"})]}),r.jsx("div",{className:"px-4 pb-6 overflow-y-auto",children:r.jsx(p_,{member:e,onUpdatePaymentStatus:s})})]})}):r.jsx(Pw,{open:t,onOpenChange:n,children:r.jsxs(Kf,{side:"right",className:"sm:max-w-md",children:[r.jsxs(Rw,{children:[r.jsx(Mw,{children:i}),r.jsx(Dw,{children:"Member details"})]}),r.jsx("div",{className:"pt-4",children:r.jsx(p_,{member:e,onUpdatePaymentStatus:s})})]})})}const qV=e=>{switch(e){case"admin":return"default";case"tutor":return"secondary";default:return"outline"}},Cg=e=>{switch(e){case"admin":return"Admin";case"tutor":return"Tutor";
563case"member":return"Member";default:return e}};function VV({member:e,onViewDetail:t,onChangeRole:n,onDeactivate:s,onDelete:a}){const i=`${e.first_name||""} ${e.last_name||""}`.trim()||"—";return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border last:border-b-0 hover:bg-muted/40 transition-colors group",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"hidden md:grid md:grid-cols-[1.5fr_1.5fr_2fr_1fr_120px] md:items-center md:gap-4",children:[r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer",onClick:()=>t(e),children:e.first_name||"—"}),r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer",onClick:()=>t(e),children:e.last_name||"—"}),r.jsx("span",{className:"text-sm text-muted-foreground truncate",children:e.job_title||"—"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:e.year_of_study||"—"}),r.jsxs(mt,{value:e.role,onValueChange:o=>n(e.id,o),children:[r.jsx(ot,{className:"h-7 text-xs w-[110px]",children:r.jsx(ht,{})}),r.jsx(lt,{children:["member","tutor","admin"].map(o=>r.jsx(fe,{value:o,className:"text-xs",children:Cg(o)},o))})]})]}),r.jsxs("div",{className:"md:hidden space-y-0.5",children:[r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer block",onClick:()=>t(e),children:i}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.job_title||"—"}),r.jsxs("div",{className:"flex items-center gap-2",children:[e.year_of_study&&r.jsx("span",{className:"text-xs text-muted-foreground",children:e.year_of_study}),r.jsx(Me,{variant:qV(e.role),className:"text-[10px] px-1.5 py-0",children:Cg(e.role)})]})]})]}),r.jsxs(qw,{children:[r.jsx(Vw,{asChild:!0,children:r.jsxs(G,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:[r.jsx(Ay,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Actions"})]})}),r.jsxs(Qf,{align:"end",className:"w-48",children:[r.jsxs("div",{className:"md:hidden",children:[r.jsxs(eV,{children:[r.jsxs(yT,{children:[r.jsx(uf,{className:"h-4 w-4 mr-2"}),"Change role"]}),r.jsx(wT,{children:["member","tutor","admin"].map(o=>r.jsxs(Vr,{disabled:e.role===o,onClick:()=>n(e.id,o),children:[Cg(o),e.role===o&&r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"current"})]},o))})]}),r.jsx(_v,{})]}),r.jsxs(Vr,{onClick:()=>s(e.id),children:[r.jsx(Z4,{className:"h-4 w-4 mr-2"}),"Deactivate"]}),r.jsx(_v,{}),r.jsxs(Vr,{className:"text-destructive focus:text-destructive",onClick:()=>a(e.id),children:[r.jsx(Ns,{className:"h-4 w-4 mr-2"}),"Delete member"]})]})]})]})}const g_={email_not_confirmed:{label:"Email not confirmed",className:"bg-muted text-muted-foreground border-border"},awaiting_payment:{label:"Awaiting payment",className:"bg-amber-100 text-amber-800 border-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-800"},reminder_sent:{label:"Reminder sent",className:"bg-orange-100 text-orange-800 border-orange-200 dark:bg-orange-900/30 dark:text-orange-300 dark:border-orange-800"},paid:{label:"Paid",className:"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-300 dark:border-emerald-800"},exempt:{label:"Awaiting tutor approval",className:"bg-pink-100 text-pink-800 border-pink-200 dark:bg-pink-900/30 dark:text-pink-300 dark:border-pink-800"}};function YV({member:e,onViewDetail:t,onApprove:n,onReject:s,onDelete:a}){const i=`${e.first_name||""} ${e.last_name||""}`.trim()||"—",o=d9(new Date(e.created_at),{addSuffix:!0}),l=e.status==="rejected",c=e.payment_status||"email_not_confirmed",d=l?{label:"Rejected",className:"bg-destructive/10 text-destructive border-destructive/20"}:g_[c]||g_.email_not_confirmed,u=e.tutor_interest===!0||e.payment_status==="exempt",h="bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-800",f=l?r.jsxs(G,{size:"sm",variant:"outline",className:"h-8 text-destructive border-destructive hover:bg-destructive/10",onClick:()=>a==null?void 0:a(e.id),children:[r.jsx(Ns,{className:"h-4 w-4 mr-1"}),"Delete"]}):r.jsxs(G,{size:"sm",variant:"outline",className:"h-8 text-destructive border-destructive hover:bg-destructive/10",onClick:()=>s(e.id),children:[r.jsx(Nn,{className:"h-4 w-4 mr-1"}),"Reject"]}),p=l?r.jsx(G,{size:"sm",variant:"outline",className:"h-8 text-destructive border-destructive hover:bg-destructive/10",onClick:()=>a==null?void 0:a(e.id),children:r.jsx(Ns,{className:"h-4 w-4"})}):r.jsx(G,{size:"sm",variant:"outline",className:"h-8 text-destructive border-destructive hover:bg-destructive/10",onClick:()=>s(e.id),children:r.jsx(Nn,{className:"h-4 w-4"})});return r.jsxs("div",{className:"border-b border-border last:border-b-0 hover:bg-muted/40 transition-colors group",children:[r.jsxs("div",{className:"hidden md:grid md:grid-cols-[1.5fr_1.5fr_2fr_1fr_150px_200px] md:items-center md:gap-4 px-4 py-3",children:[r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer",onClick:()=>t(e),children:e.first_name||"—"}),r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer",onClick:()=>t(e),children:e.last_name||"—"}),r.jsx("span",{className:"text-sm text-muted-foreground truncate",children:e.email}),r.jsx("span",{className:"text-sm text-muted-foreground",children:o}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u&&r.jsx(Me,{variant:"outline",className:h,children:"Tutor Applicant"}),r.jsx(Me,{variant:"outline",className:d.className,children:d.label})]}),r.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[r.jsxs(G,{size:"sm",className:"h-8 bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>n(e.id),children:[r.jsx(Ys,{className:"h-4 w-4 mr-1"}),"Approve"]}),f]})]}),r.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3",children:[r.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[r.jsx("button",{className:"text-sm font-medium truncate text-left hover:underline cursor-pointer block",onClick:()=>t(e),children:i}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.email}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:o}),u&&r.jsx(Me,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${h}`,children:"Tutor Applicant"}),r.jsx(Me,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${d.className}`,children:d.label})]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(G,{size:"sm",className:"h-8 bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>n(e.id),children:r.jsx(Ys,{className:"h-4 w-4"})}),p]})]})]})}var Ye=function(){return Ye=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ye.apply(this,arguments)};function GV(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function OT(e,t,n){for(var s=0,a=t.length,i;s<a;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function _u(e){return e.mode==="multiple"}function Nu(e){return e.mode==="range"}function Jf(e){return e.mode==="single"}var KV={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rd
563p-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function ZV(e,t){return an(e,"LLLL y",t)}function XV(e,t){return an(e,"d",t)}function QV(e,t){return an(e,"LLLL",t)}function JV(e){return"".concat(e)}function eY(e,t){return an(e,"cccccc",t)}function tY(e,t){return an(e,"yyyy",t)}var nY=Object.freeze({__proto__:null,formatCaption:ZV,formatDay:XV,formatMonthCaption:QV,formatWeekNumber:JV,formatWeekdayName:eY,formatYearCaption:tY}),rY=function(e,t,n){return an(e,"do MMMM (EEEE)",n)},sY=function(){return"Month: "},aY=function(){return"Go to next month"},iY=function(){return"Go to previous month"},oY=function(e,t){return an(e,"cccc",t)},lY=function(e){return"Week n. ".concat(e)},cY=function(){return"Year: "},dY=Object.freeze({__proto__:null,labelDay:rY,labelMonthDropdown:sY,labelNext:aY,labelPrevious:iY,labelWeekNumber:lY,labelWeekday:oY,labelYearDropdown:cY});function uY(){var e="buttons",t=KV,n=fw,s={},a={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:nY,labels:dY,locale:n,modifiersClassNames:s,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function mY(e){var t=e.fromYear,n=e.toYear,s=e.fromMonth,a=e.toMonth,i=e.fromDate,o=e.toDate;return s?i=br(s):t&&(i=new Date(t,0,1)),a?o=Hf(a):n&&(o=new Date(n,11,31)),{fromDate:i?Fl(i):void 0,toDate:o?Fl(o):void 0}}var IT=m.createContext(void 0);function hY(e){var t,n=e.initialProps,s=uY(),a=mY(n),i=a.fromDate,o=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:s.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(Jf(n)||_u(n)||Nu(n))&&(c=n.onSelect);var d=Ye(Ye(Ye({},s),n),{captionLayout:l,classNames:Ye(Ye({},s.classNames),n.classNames),components:Ye({},n.components),formatters:Ye(Ye({},s.formatters),n.formatters),fromDate:i,labels:Ye(Ye({},s.labels),n.labels),mode:n.mode||s.mode,modifiers:Ye(Ye({},s.modifiers),n.modifiers),modifiersClassNames:Ye(Ye({},s.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Ye(Ye({},s.styles),n.styles),toDate:o});return r.jsx(IT.Provider,{value:d,children:e.children})}function Dt(){var e=m.useContext(IT);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function LT(e){var t=Dt(),n=t.locale,s=t.classNames,a=t.styles,i=t.formatters.formatCaption;return r.jsx("div",{className:s.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function fY(e){return r.jsx("svg",Ye({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:r.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function FT(e){var t,n,s=e.onChange,a=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,d=Dt(),u=(n=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:fY;return r.jsxs("div",{className:l,style:c,children:[r.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),r.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:s,children:i}),r.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,r.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function pY(e){var t,n=Dt(),s=n.fromDate,a=n.toDate,i=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!s)return r.jsx(r.Fragment,{});if(!a)return r.jsx(r.Fragment,{});var h=[];if(x9(s,a))for(var f=br(s),p=s.getMonth();p<=a.getMonth();p++)h.push(ug(f,p));else for(var f=br(new Date),p=0;p<=11;p++)h.push(ug(f,p));var w=function(b){var x=Number(b.target.value),g=ug(br(e.displayMonth),x);e.onChange(g)},v=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:FT;return r.jsx(v,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:w,value:e.displayMonth.getMonth(),c
563aption:l(e.displayMonth,{locale:o}),children:h.map(function(b){return r.jsx("option",{value:b.getMonth(),children:l(b,{locale:o})},b.getMonth())})})}function gY(e){var t,n=e.displayMonth,s=Dt(),a=s.fromDate,i=s.toDate,o=s.locale,l=s.styles,c=s.classNames,d=s.components,u=s.formatters.formatYearCaption,h=s.labels.labelYearDropdown,f=[];if(!a)return r.jsx(r.Fragment,{});if(!i)return r.jsx(r.Fragment,{});for(var p=a.getFullYear(),w=i.getFullYear(),v=p;v<=w;v++)f.push(H0(XA(new Date),v));var b=function(g){var y=H0(br(n),Number(g.target.value));e.onChange(y)},x=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:FT;return r.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:b,value:n.getFullYear(),caption:u(n,{locale:o}),children:f.map(function(g){return r.jsx("option",{value:g.getFullYear(),children:u(g,{locale:o})},g.getFullYear())})})}function xY(e,t){var n=m.useState(e),s=n[0],a=n[1],i=t===void 0?s:t;return[i,a]}function vY(e){var t=e.month,n=e.defaultMonth,s=e.today,a=t||n||s||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&zl(i,a)<0){var d=-1*(c-1);a=As(i,d)}return o&&zl(a,o)<0&&(a=o),br(a)}function yY(){var e=Dt(),t=vY(e),n=xY(t,e.month),s=n[0],a=n[1],i=function(o){var l;if(!e.disableNavigation){var c=br(o);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[s,i]}function wY(e,t){for(var n=t.reverseMonths,s=t.numberOfMonths,a=br(e),i=br(As(a,s)),o=zl(i,a),l=[],c=0;c<o;c++){var d=As(a,c);l.push(d)}return n&&(l=l.reverse()),l}function bY(e,t){if(!t.disableNavigation){var n=t.toDate,s=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=s?i:1,l=br(e);if(!n)return As(l,o);var c=zl(n,e);if(!(c<i))return As(l,o)}}function jY(e,t){if(!t.disableNavigation){var n=t.fromDate,s=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=s?i:1,l=br(e);if(!n)return As(l,-o);var c=zl(l,n);if(!(c<=0))return As(l,-o)}}var $T=m.createContext(void 0);function _Y(e){var t=Dt(),n=yY(),s=n[0],a=n[1],i=wY(s,t),o=bY(s,t),l=jY(s,t),c=function(h){return i.some(function(f){return jw(h,f)})},d=function(h,f){c(h)||(f&&a2(h,f)?a(As(h,1+t.numberOfMonths*-1)):a(h))},u={currentMonth:s,displayMonths:i,goToMonth:a,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:c};return r.jsx($T.Provider,{value:u,children:e.children})}function Su(){var e=m.useContext($T);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function x_(e){var t,n=Dt(),s=n.classNames,a=n.styles,i=n.components,o=Su().goToMonth,l=function(u){o(As(u,e.displayIndex?-e.dis
563playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:LT,d=r.jsx(c,{id:e.id,displayMonth:e.displayMonth});return r.jsxs("div",{className:s.caption_dropdowns,style:a.caption_dropdowns,children:[r.jsx("div",{className:s.vhidden,children:d}),r.jsx(pY,{onChange:l,displayMonth:e.displayMonth}),r.jsx(gY,{onChange:l,displayMonth:e.displayMonth})]})}function NY(e){return r.jsx("svg",Ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:r.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function SY(e){return r.jsx("svg",Ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:r.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Bh=m.forwardRef(function(e,t){var n=Dt(),s=n.classNames,a=n.styles,i=[s.button_reset,s.button];e.className&&i.push(e.className);var o=i.join(" "),l=Ye(Ye({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),r.jsx("button",Ye({},e,{ref:t,type:"button",className:o,style:l}))});function kY(e){var t,n,s=Dt(),a=s.dir,i=s.locale,o=s.classNames,l=s.styles,c=s.labels,d=c.labelPrevious,u=c.labelNext,h=s.components;if(!e.nextMonth&&!e.previousMonth)return r.jsx(r.Fragment,{});var f=d(e.previousMonth,{locale:i}),p=[o.nav_button,o.nav_button_previous].join(" "),w=u(e.nextMonth,{locale:i}),v=[o.nav_button,o.nav_button_next].join(" "),b=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:SY,x=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:NY;return r.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&r.jsx(Bh,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?r.jsx(b,{className:o.nav_icon,style:l.nav_icon}):r.jsx(x,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&r.jsx(Bh,{name:"next-month","aria-label":w,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?r.jsx(x,{className:o.nav_icon,style:l.nav_icon}):r.jsx(b,{className:o.nav_icon,style:l.nav_icon})})]})}function v_(e){var t=Dt().numberOfMonths,n=Su(),s=n.previousMonth,a=n.nextMonth,i=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(w){return jw(e.displayMonth,w)}),c=l===0,d=l===o.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),f=function(){s&&i(s)},p=function(){a&&i(a)};return r.jsx(kY,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:a,previousMonth:s,onPreviousClick:f,onNextClick:p})}function CY(e){var t,n=Dt(),s=n.classNames,a=n.disableNavigation,i=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:LT,d;return a?d=r.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=r.jsx(x_,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=r.jsxs(r.Fragment,{children:[r.jsx(x_,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),r.jsx(v_,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=r.jsxs(r.Fragment,{children:[r.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),r.jsx(v_,{displayMonth:e.displayMonth,id:e.id})]}),r.jsx("div",{className:s.caption,style:i.caption,children:d})}function AY(e){var t=Dt(),n=t.footer,s=t.styles,a=t.classNames.tfoot;return n?r.jsx("tfoot",{className:a,style:s.tfoot,children:r.jsx("tr",{children:r.jsx("td",{colSpan:8,children:n})})}):r.jsx(r.Fragment,{})}function EY(e,t,n){for(var s=n?mo(new Date):Zs(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=er(s,i);a.push(o)}return a}function TY(){var e=Dt(),t=e.classNames,n=e.styles,s=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=EY(a,i,o);return r.jsxs("tr",{style:n.head_row,className:t.head_row,children:[s&&r.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(u,h){return r.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(u,{locale:a}),children:l(u,{locale:a})},h)})]})}function PY(){var e,t=Dt(),n=t.classNames,s=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:TY;return r.jsx("thead",{style:s.head,className:n.head,children:r.jsx(i,{})})}function RY(e){var t=Dt(),n=t.locale,s=t.formatters.formatDay;return r.jsx(r.Fragment,{children:s(e.date,{locale:n})})}var Jw=m.createContext(void 0);function MY(e){if(!_u(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return r.jsx(Jw.Provider,{value:t,children:e.children})}return r.jsx(DY,{initialProps:e.initialProps,children:e.children})}function DY(e){var t=e.initialProps,n=e.children,s=t.selected,a=t.min,i=t.max,o=function(d,u,h){var f,p;(f=t.onDayClick)===null||f===void 0||f.call(t,d,u,h);var w=!!(u.selected&&a&&(s==null?void 0:s.length)===a);if(!w){var v=!!(!u.selected&&i&&(s==null?void 0:s.length)===i);if(!v){var b=s?OT([],s):[];if(u.selected){var x=b.findIndex(function(g){return gr(d,g)});b.splice(x,1)}else b.push(d);(p=t.onSelect)===null||p===void 0||p.call(t,b,d,u,h)}}},l={disabled:[]};s&&l.disabled.push(function(d){var u=i&&s.length>i-1,h=s.some(function(f){return gr(f,d)});return!!(u&&!h)});
563var c={selected:s,onDayClick:o,modifiers:l};return r.jsx(Jw.Provider,{value:c,children:n})}function eb(){var e=m.useContext(Jw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function OY(e,t){var n=t||{},s=n.from,a=n.to;return s&&a?gr(a,e)&&gr(s,e)?void 0:gr(a,e)?{from:a,to:void 0}:gr(s,e)?void 0:mv(s,e)?{from:e,to:a}:{from:s,to:e}:a?mv(e,a)?{from:a,to:e}:{from:e,to:a}:s?a2(e,s)?{from:e,to:s}:{from:s,to:e}:{from:e,to:void 0}}var tb=m.createContext(void 0);function IY(e){if(!Nu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return r.jsx(tb.Provider,{value:t,children:e.children})}return r.jsx(LY,{initialProps:e.initialProps,children:e.children})}function LY(e){var t=e.initialProps,n=e.children,s=t.selected,a=s||{},i=a.from,o=a.to,l=t.min,c=t.max,d=function(p,w,v){var b,x;(b=t.onDayClick)===null||b===void 0||b.call(t,p,w,v);var g=OY(p,s);(x=t.onSelect)===null||x===void 0||x.call(t,g,p,w,v)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],o?(u.range_end=[o],gr(i,o)||(u.range_middle=[{after:i,before:o}])):u.range_end=[i]):o&&(u.range_start=[o],u.range_end=[o]),l&&(i&&!o&&u.disabled.push({after:cg(i,l-1),before:er(i,l-1)}),i&&o&&u.disabled.push({after:i,before:er(i,l-1)}),!i&&o&&u.disabled.push({after:cg(o,l-1),before:er(o,l-1)})),c){if(i&&!o&&(u.disabled.push({before:er(i,-c+1)}),u.disabled.push({after:er(i,c-1)})),i&&o){var h=xs(o,i)+1,f=c-h;u.disabled.push({before:cg(i,f)}),u.disabled.push({after:er(o,f)})}!i&&o&&(u.disabled.push({before:er(o,-c+1)}),u.disabled.push({after:er(o,c-1)}))}return r.jsx(tb.Provider,{value:{selected:s,onDayClick:d,modifiers:u},children:n})}function nb(){var e=m.useContext(tb);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Bm(e){return Array.isArray(e)?OT([],e):e!==void 0?[e]:[]}function FY(e){var t={};return Object.entries(e).forEach(function(n){var s=n[0],a=n[1];t[s]=Bm(a)}),t}var Ts;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ts||(Ts={}));var $Y=Ts.Selected,aa=Ts.Disabled,zY=Ts.Hidden,UY=Ts.Today,Ag=Ts.RangeEnd,Eg=Ts.RangeMiddle,Tg=Ts.RangeStart,BY=Ts.Outside;function HY(e,t,n){var s,a=(s={},s[$Y]=Bm(e.selected),s[aa]=Bm(e.disabled),s[zY]=Bm(e.hidden),s[UY]=[e.today],s[Ag]=[],s[Eg]=[],s[Tg]=[],s[BY]=[],s);return e.fromDate&&a[aa].push({before:e.fromDate}),e.toDate&&a[aa].push({after:e.toDate}),_u(e)?a[aa]=a[aa].concat(t.modifiers[aa]):Nu(e)&&(a[aa]=a[aa].concat(n.modifiers[aa]),a[Tg]=n.modifiers[Tg],a[Eg]=n.modifiers[Eg],a[Ag]=n.modifiers[Ag]),a}var zT=m.createContext(void 0);function WY(e){var t=Dt(),n=eb(),s=nb(),a=HY(t,n,s),i=FY(t.modifiers),o=Ye(Ye({},a),i);return r.jsx(zT.Provider,{value:o,children:e.children})}function UT(){var e=m.useContext(zT);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function qY(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function VY(e){return!!(e&&typeof e=="object"&&"from"in e)}function YY(e){return!!(e&&typeof e=="object"&&"after"in e)}function GY(e){return!!(e&&typeof e=="object"&&"before"in e)}function KY(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function ZY(e,t){var n,s=t.from,a=t.to;if(s&&a){var i=xs(a,s)<0;i&&(n=[a,s],s=n[0],a=n[1]);var o=xs(e,s)>=0&&xs(a,e)>=0;return o}return a?gr(a,e):s?gr(s,e):!1}function XY(e){return vw(e)}function QY(e){return Array.isArray(e)&&e.every(vw)}function JY(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(XY(n))return gr(e,n);if(QY(n))return n.includes(e);if(VY(n))return ZY(e,n);if(KY(n))return n.dayOfWeek.includes(e.getDay());if(qY(n)){var s=xs(n.before,e),a=xs(n.after,e),i=s>0,o=a<0,l=mv(n.before,n.after);return l?o&&i:i||o}return YY(n)?xs(e,n.after)>0:GY(n)?xs(n.before,e)>0:typeof n=="function"?n(e):!1})}function rb(e,t,n){var s=Object.keys(t).reduce(function(i,o){var l=t[o];return JY(e,l)&&i.push(o),i},[]),a={};
563return s.forEach(function(i){return a[i]=!0}),n&&!jw(e,n)&&(a.outside=!0),a}function eG(e,t){for(var n=br(e[0]),s=Hf(e[e.length-1]),a,i,o=n;o<=s;){var l=rb(o,t),c=!l.disabled&&!l.hidden;if(!c){o=er(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=er(o,1)}return i||a}var tG=365;function BT(e,t){var n=t.moveBy,s=t.direction,a=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=a.weekStartsOn,d=a.fromDate,u=a.toDate,h=a.locale,f={day:er,week:uv,month:As,year:e9,startOfWeek:function(b){return a.ISOWeek?mo(b):Zs(b,{locale:h,weekStartsOn:c})},endOfWeek:function(b){return a.ISOWeek?s2(b):bw(b,{locale:h,weekStartsOn:c})}},p=f[n](e,s==="after"?1:-1);s==="before"&&d?p=t9([d,p]):s==="after"&&u&&(p=n9([u,p]));var w=!0;if(i){var v=rb(p,i);w=!v.disabled&&!v.hidden}return w?p:l.count>tG?l.lastFocused:BT(p,{moveBy:n,direction:s,context:a,modifiers:i,retry:Ye(Ye({},l),{count:l.count+1})})}var HT=m.createContext(void 0);function nG(e){var t=Su(),n=UT(),s=m.useState(),a=s[0],i=s[1],o=m.useState(),l=o[0],c=o[1],d=eG(t.displayMonths,n),u=a??(l&&t.isDateDisplayed(l))?l:d,h=function(){c(a),i(void 0)},f=function(b){i(b)},p=Dt(),w=function(b,x){if(a){var g=BT(a,{moveBy:b,direction:x,context:p,modifiers:n});gr(a,g)||(t.goToDate(g,a),f(g))}},v={focusedDay:a,focusTarget:u,blur:h,focus:f,focusDayAfter:function(){return w("day","after")},focusDayBefore:function(){return w("day","before")},focusWeekAfter:function(){return w("week","after")},focusWeekBefore:function(){return w("week","before")},focusMonthBefore:function(){return w("month","before")},focusMonthAfter:function(){return w("month","after")},focusYearBefore:function(){return w("year","before")},focusYearAfter:function(){return w("year","after")},focusStartOfWeek:function(){return w("startOfWeek","before")},focusEndOfWeek:function(){return w("endOfWeek","after")}};return r.jsx(HT.Provider,{value:v,children:e.children})}function sb(){var e=m.useContext(HT);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function rG(e,t){var n=UT(),s=rb(e,n,t);return s}var ab=m.createContext(void 0);function sG(e){if(!Jf(e.initialProps)){var t={selected:void 0};return r.jsx(ab.Provider,{value:t,children:e.children})}return r.jsx(aG,{initialProps:e.initialProps,children:e.children})}function aG(e){var t=e.initialProps,n=e.children,s=function(i,o,l){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,l);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,o,l)},a={selected:t.selected,onDayClick:s};return r.jsx(ab.Provider,{value:a,children:n})}function WT(){var e=m.useContext(ab);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function iG(e,t){var n=Dt(),s=WT(),a=eb(),i=nb(),o=sb(),l=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,u=o.focusWeekBefore,h=o.blur,f=o.focus,p=o.focusMonthBefore,w=o.focusMonthAfter,v=o.focusYearBefore,b=o.focusYearAfter,x=o.focusStartOfWeek,g=o.focusEndOfWeek,y=function(L){var C,D,F,T;Jf(n)?(C=s.onDayClick)===null||C===void 0||C.call(s,e,t,L):_u(n)?(D=a.onDayCl
563ick)===null||D===void 0||D.call(a,e,t,L):Nu(n)?(F=i.onDayClick)===null||F===void 0||F.call(i,e,t,L):(T=n.onDayClick)===null||T===void 0||T.call(n,e,t,L)},j=function(L){var C;f(e),(C=n.onDayFocus)===null||C===void 0||C.call(n,e,t,L)},N=function(L){var C;h(),(C=n.onDayBlur)===null||C===void 0||C.call(n,e,t,L)},k=function(L){var C;(C=n.onDayMouseEnter)===null||C===void 0||C.call(n,e,t,L)},_=function(L){var C;(C=n.onDayMouseLeave)===null||C===void 0||C.call(n,e,t,L)},P=function(L){var C;(C=n.onDayPointerEnter)===null||C===void 0||C.call(n,e,t,L)},$=function(L){var C;(C=n.onDayPointerLeave)===null||C===void 0||C.call(n,e,t,L)},M=function(L){var C;(C=n.onDayTouchCancel)===null||C===void 0||C.call(n,e,t,L)},O=function(L){var C;(C=n.onDayTouchEnd)===null||C===void 0||C.call(n,e,t,L)},A=function(L){var C;(C=n.onDayTouchMove)===null||C===void 0||C.call(n,e,t,L)},U=function(L){var C;(C=n.onDayTouchStart)===null||C===void 0||C.call(n,e,t,L)},W=function(L){var C;(C=n.onDayKeyUp)===null||C===void 0||C.call(n,e,t,L)},E=function(L){var C;switch(L.key){case"ArrowLeft":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":L.preventDefault(),L.stopPropagation(),d();break;case"ArrowUp":L.preventDefault(),L.stopPropagation(),u();break;case"PageUp":L.preventDefault(),L.stopPropagation(),L.shiftKey?v():p();break;case"PageDown":L.preventDefault(),L.stopPropagation(),L.shiftKey?b():w();break;case"Home":L.preventDefault(),L.stopPropagation(),x();break;case"End":L.preventDefault(),L.stopPropagation(),g();break}(C=n.onDayKeyDown)===null||C===void 0||C.call(n,e,t,L)},S={onClick:y,onFocus:j,onBlur:N,onKeyDown:E,onKeyUp:W,onMouseEnter:k,onMouseLeave:_,onPointerEnter:P,onPointerLeave:$,onTouchCancel:M,onTouchEnd:O,onTouchMove:A,onTouchStart:U};return S}function oG(){var e=Dt(),t=WT(),n=eb(),s=nb(),a=Jf(e)?t.selected:_u(e)?n.selected:Nu(e)?s.selected:void 0;return a}function lG(e){return Object.values(Ts).includes(e)}function cG(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(s){var a=e.modifiersClassNames[s];if(a)n.push(a);else if(lG(s)){var i=e.classNames["day_".concat(s)];i&&n.push(i)}}),n}function dG(e,t){var n=Ye({},e.styles.day);return Object.keys(t).forEach(function(s){var a;n=Ye(Ye({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[s])}),n}function uG(e,t,n){var s,a,i,o=Dt(),l=sb(),c=rG(e,t),d=iG(e,c),u=oG(),h=!!(o.onDayCl
563ick||o.mode!=="default");m.useEffect(function(){var k;c.outside||l.focusedDay&&h&&gr(l.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[l.focusedDay,e,n,h,c.outside]);var f=cG(o,c).join(" "),p=dG(o,c),w=!!(c.outside&&!o.showOutsideDays||c.hidden),v=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:RY,b=r.jsx(v,{date:e,displayMonth:t,activeModifiers:c}),x={style:p,className:f,children:b,role:"gridcell"},g=l.focusTarget&&gr(l.focusTarget,e)&&!c.outside,y=l.focusedDay&&gr(l.focusedDay,e),j=Ye(Ye(Ye({},x),(s={disabled:c.disabled,role:"gridcell"},s["aria-selected"]=c.selected,s.tabIndex=y||g?0:-1,s)),d),N={isButton:h,isHidden:w,activeModifiers:c,selectedDays:u,buttonProps:j,divProps:x};return N}function mG(e){var t=m.useRef(null),n=uG(e.date,e.displayMonth,t);return n.isHidden?r.jsx("div",{role:"gridcell"}):n.isButton?r.jsx(Bh,Ye({name:"day",ref:t},n.buttonProps)):r.jsx("div",Ye({},n.divProps))}function hG(e){var t=e.number,n=e.dates,s=Dt(),a=s.onWeekNumberClick,i=s.styles,o=s.classNames,l=s.locale,c=s.labels.labelWeekNumber,d=s.formatters.formatWeekNumber,u=d(Number(t),{locale:l});if(!a)return r.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:u});var h=c(Number(t),{locale:l}),f=function(p){a(t,n,p)};return r.jsx(Bh,{name:"week-number","aria-label":h,className:o.weeknumber,style:i.weeknumber,onClick:f,children:u})}function fG(e){var t,n,s=Dt(),a=s.styles,i=s.classNames,o=s.showWeekNumber,l=s.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:mG,d=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:hG,u;return o&&(u=r.jsx("td",{className:i.cell,style:a.cell,children:r.jsx(d,{number:e.weekNumber,dates:e.dates})})),r.jsxs("tr",{className:i.row,style:a.row,children:[u,e.dates.map(function(h){return r.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:r.jsx(c,{displayMonth:e.displayMonth,date:h})},h9(h))})]})}function y_(e,t,n){for(var s=n!=null&&n.ISOWeek?s2(t):bw(t,n),a=n!=null&&n.ISOWeek?mo(e):Zs(e,n),i=xs(s,a),o=[],l=0;l<=i;l++)o.push(er(a,l));var c=o.reduce(function(d,u){var h=n!=null&&n.ISOWeek?JA(u):t2(u,n),f=d.find(function(p){return p.weekNumber===h});return f?(f.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function pG(e,t){var n=y_(br(e),Hf(e),t);if(t!=null&&t.useFixedWeeks){var s=p9(e,t);if(s<6){var a=n[n.length-1],i=a.dates[a.dates.length-1],o=uv(i,6-s),l=y_(uv(i,1),o,t);n.push.apply(n,l)}}return n}function gG(e){var t,n,s,a=Dt(),i=a.locale,o=a.classNames,l=a.styles,c=a.hideHead,d=a.fixedWeeks,u=a.components,h=a.weekStartsOn,f=a.firstWeekContainsDate,p=a.ISOWeek,w=pG(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:p,locale:i,weekStartsOn:h,firstWeekContainsDate:f}),v=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:PY,b=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:fG,x=(s=u==null?void 0:u.Footer)!==null&&s!==void 0?s:AY;return r.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&r.jsx(v,{}),r.jsx("tbody",{className:o.tbody,style:l.tbody,children:w.map(function(g){return r.jsx(b,{displayMonth:e.displayMonth,dates:g.dates,weekNumber:g.weekNumber},g.weekNumber)})}),r.jsx(x,{displayMonth:e.displayMonth})]})}function xG(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var vG=xG()?m.useLayoutEffect:m.useEffect,Pg=!1,yG=0;function w_(){return"react-day-picker-".concat(++yG)}function wG(e){var t,n=e??(Pg?w_():null),s=m.useState(n),a=s[0],i=s[1];return vG(function(){a===null&&i(w_())},[]),m.useEffect(function(){Pg===!1&&(Pg=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function bG(e){var t,n,s=Dt(),a=s.dir,i=s.classNames,o=s.styles,l=s.components,c=Su().displayMonths,d=wG(s.id?"".concat(s.id,"-").concat(e.displayIndex):void 0),u=s.id?"".concat(s.id,"-grid-").concat(e.displayIndex):void 0,h=[i.month],f=o.month,p=e.displayIndex===0,w=e.displayIndex===c.length-1,v=!p&&!w;a==="rtl"&&(t=[p,w],w=t[0],p=t[1]),p&&(h.push(i.caption_start),f=Ye(Ye({},f),o.caption_start)),w&&(h.push(i.caption_end),f=Ye(Ye({},f),o.caption_end)),v&&(h.push(i.caption_between),f=Ye(Ye({},f),o.caption_between));var b=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:CY;return r.jsxs("div",{className:h.join(" "),style:f,children:[r.jsx(b,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),r.jsx(gG,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function jG(e){var t=Dt(),n=t.classNames,s=t.styles;return r.jsx("div",{className:n.months,style:s.months,children:e.children})}function _G(e){var t,n,s=e.initialProps,a=Dt(),i=sb(),o=Su(),l=m.useState(!1),c=l[0],d=l[1];m.useEffect(function(){a.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[a.initialFocus,c,i.focus,i.focusTarget,i]);var u=[a.classNames.root,a.className];a.numberOfMonths>1&&u.push(a.classNames.multiple_months),a.showWeekNumber&&u.push(a.classNames.with_weeknumber);var h=Ye(Ye({},a.styles.root),a.style),f=Object.keys(s).filter(function(w){return w.startsWith("data-")}).reduce(function(w,v){var b;return Ye(Ye({},w),(b={},b[v]=s[v],b))},{}),p=(n=(t=s.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:jG;return r.jsx("div",Ye({className:u.join(" "),style:h,dir:a.dir,id:a.id,nonce:s.nonce,title:s.title,lang:s.lang},f,{children:r.jsx(p,{children:o.displayMonths.map(function(w,v){return r.jsx(bG,{displayIndex:v,displayMonth:w},v)})})}))}function NG(e){var t=e.children,n=GV(e,["children"]);return r.jsx(hY,{initialProps:n,children:r.jsx(_Y,{children:r.jsx(sG,{initialProps:n,children:r.jsx(MY,{initialProps:n,children:r.jsx(IY,{initialProps:n,children:r.jsx(WY,{children:r.jsx(nG,{children:t})})})})})})})}function SG(e){return r.jsx(NG,Ye({},e,{children:r.jsx(_G,{initialProps:e})}))}function qT({className:e,classNames:t,showOutsideDays:n=!0,...s}){return r.jsx(SG,{showOutsideDays:n,className:le("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
563ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:le(Rd({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:le(Rd({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>r.jsx(R4,{className:"h-4 w-4"}),IconRight:({...a})=>r.jsx(Cy,{className:"h-4 w-4"})},...s})}qT.displayName="Calendar";var ib="Popover",[VT,xK]=zr(ib,[Ri]),ku=Ri(),[kG,Li]=VT(ib),YT=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=ku(t),c=m.useRef(null),[d,u]=m.useState(!1),[h=!1,f]=es({prop:s,defaultProp:a,onChange:i});return r.jsx(iu,{...l,children:r.jsx(kG,{scope:t,contentId:wr(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};YT.displayName=ib;var GT="PopoverAnchor",CG=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=Li(GT,n),i=ku(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),r.jsx(ou,{...i,...s,ref:t})});CG.displayName=GT;var KT="PopoverTrigger",ZT=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=Li(KT,n),i=ku(n),o=ct(t,a.triggerRef),l=r.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tP(a.open),...s,ref:o,onClick:we(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:r.jsx(ou,{asChild:!0,...i,children:l})});ZT.displayName=KT;var ob="PopoverPortal",[AG,EG]=VT(ob,{forceMount:void 0}),XT=e=>{const{__scopePopover:t,forceMount:n,children:s,container:a}=e,i=Li(ob,t);return r.jsx(AG,{scope:t,forceMount:n,children:r.jsx(Nr,{present:n||i.open,children:r.jsx(Gl,{asChild:!0,container:a,children:s})})})};XT.displayName=ob;var Wl="PopoverContent",QT=m.forwardRef((e,t)=>{const n=EG(Wl,e.__scopePopover),{forceMount:s=n.forceMount,...a}=e,i=Li(Wl,e.__scopePopover);return r.jsx(Nr,{present:s||i.open,children:i.modal?r.jsx(TG,{...a,ref:t}):r.jsx(PG,{...a,ref:t})})});QT.displayName=Wl;var TG=m.forwardRef((e,t)=>{const n=Li(Wl,e.__scopePopover),s=m.useRef(null),a=ct(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return Ff(o)},[]),r.jsx(pu,{as:jr,allowPinchZoom:!0,children:r.jsx(JT,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),PG=m.forwardRef((e,t)=>{const n=Li(Wl,e.__scopePopover),s=m.useRef(!1),a=m.useRef(!1);return r.jsx(JT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),JT=m.forwardRef((e,t)=>
563{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,f=Li(Wl,n),p=ku(n);return Lf(),r.jsx(fu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:r.jsx(wo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:r.jsx(gf,{"data-state":tP(f.open),role:"dialog",id:f.contentId,...p,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eP="PopoverClose",RG=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=Li(eP,n);return r.jsx(Le.button,{type:"button",...s,ref:t,onClick:we(e.onClick,()=>a.onOpenChange(!1))})});RG.displayName=eP;var MG="PopoverArrow",DG=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=ku(n);return r.jsx(xf,{...a,...s,ref:t})});DG.displayName=MG;function tP(e){return e?"open":"closed"}var OG=YT,IG=ZT,LG=XT,nP=QT;const FG=OG,$G=IG,rP=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},a)=>r.jsx(LG,{children:r.jsx(nP,{ref:a,align:t,sideOffset:n,className:le("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));rP.displayName=nP.displayName;function b_({searchQuery:e,onSearchChange:t,searchPlaceholder:n="Search by name, email, profession, university…",resultCount:s,totalCount:a,itemLabelSingular:i="member",itemLabelPlural:o="members",roleFilter:l,onRoleFilterChange:c,paymentStatusFilter:d,onPaymentStatusFilterChange:u,yearFilter:h,onYearFilterChange:f,professionFilter:p,onProfessionFilterChange:w,universityFilter:v,onUniversityFilterChange:b,uniqueYears:x,uniqueProfessions:g,uniqueUniversities:y,professionNewFilter:j,onProfessionNewFilterChange:N,uniqueProfessionsNew:k,careerStageFilter:_,onCareerStageFilterChange:P,uniqueCareerStages:$,graduationYearFilter:M,onGraduationYearFilterChange:O,uniqueGraduationYears:A,dateRange:U,onDateRangeChange:W,showRejected:E,onShowRejectedChange:S}){const[L,C]=m.useState(!1),D=[l&&l!=="all"?1:0,d&&d!=="all"?1:0,h!=="all"?1:0,p!=="all"?1:0,v!=="all"?1:0,j&&j!=="all"?1:0,_&&_!=="all"?1:0,M&&M!=="all"?1:0,U!=null&&U.from||U!=null&&U.to?1:0].reduce((Y,ie)=>Y+ie,0),F=D>0||e.length>0,T=()=>{t(""),c==null||c("all"),u==null||u("all"),f("all"),w("all"),b("all"),N==null||N("all"),P==null||P("all"),O==null||O("all"),W(void 0)},q=U!=null&&U.from?U.to?`${an(U.from,"dd.MM.yyyy")} – ${an(U.to,"dd.MM.yyyy")}`:an(U.from,"dd.MM.yyyy"):"Registered",I=r.jsxs(r.Fragment,{children:[c&&l!==void 0&&r.jsxs(mt,{value:l,onValueChange:c,children:[r.jsx(ot,{className:"w-full md:w-[140px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Role"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Roles"}),r.jsx(fe,{value:"admin",children:"Admin"}),r.jsx(fe,{value:"member",children:"Member"}),r.jsx(fe,{value:"tutor",children:"Tutor"}),r.jsx(fe,{value:"pending",children:"Pending"}),r.jsx(fe,{value:"none",children:"No Role"})]})]}),u&&d!==void 0&&r.jsxs(mt,{value:d,onValueChange:u,children:[r.jsx(ot,{className:"w-full md:w-[180px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Status"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Statuses"}),r.jsx(fe,{value:"email_not_confirmed",children:"Email not confirmed"}),r.jsx(fe,{value:"awaiting_payment",children:"Awaiting payment"}),r.jsx(fe,{value:"reminder_sent",children:"Reminder sent"}),r.jsx(fe,{value:"paid",children:"Paid"}),r.jsx(fe,{value:"exempt",children:"Awaiting tutor approval"}),E&&r.jsx(fe,{value:"rejected",children:"Rejected"})]})]}),r.jsxs(mt,{value:h,onValueChange:f,children:[r.jsx(ot,{className:"w-full md:w-[140px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Year of study"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Years"}),x.map(Y=>r.jsx(fe,{value:Y,children:Y},Y))]})]}),r.jsxs(mt,{value:p,onValueChange:w,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Profession"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Professions"}),g.map(Y=>r.jsx(fe,{value:Y,children:Y},Y))]})]}),r.jsxs(mt,{value:v,onValueChange:b,children:[r.jsx(ot,{className:"w-full md:w-[180px] h-8 text-xs",children:r.jsx(ht,{placeholder:"University / Workplace"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Universities"}),y.map(Y=>r.jsx(fe,{value:Y,children:Y},Y))]})]}),N&&j!==void 0&&k&&k.length>0&&r.jsxs(mt,{value:j,onValueChange:N,children:[r.jsx(ot,{className:"w-full md:w-[150px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Profession (new)"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Professions (new)"}),k.map(Y=>r.jsx(fe,{value:Y,className:"capitalize",children:Y},Y))]})]}),P&&_!==void 0&&$&&$.length>0&&r.jsxs(mt,{value:_,onValueChange:P,children:[r.jsx(ot,{className:"w-full md:w-[160px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Career stage"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Career Stages"}),$.map(Y=>r.jsx(fe,{value:Y,className:"capitalize",children:Y.replace(/_/g," ")},Y))]})]}),O&&M!==void 0&&A&&A.length>0&&r.jsxs(mt,{value:M,onValueChange:O,children:[r.jsx(ot,{className:"w-full md:w-[140px] h-8 text-xs",children:r.jsx(ht,{placeholder:"Graduation year"})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"all",children:"All Graduation Years"}),A.map(Y=>r.jsx(fe,{value:Y,children:Y},Y))]})]}),r.jsxs(FG,{children:[r.jsx($G,{asChild:!0,children:r.jsxs(G,{variant:"outline",size:"sm",className:le("h-8 text-xs justify-start font-normal w-full md:w-auto",!(U!=null&&U.from)&&"text-muted-foreground"),children:[r.jsx(Tr,{className:"h-3.5 w-3.5 mr-1.5"}),q]})}),r.jsxs(rP,{className:"w-auto p-0",align:"start",children:[r.jsx(qT,{mode:"range",selected:U,onSelect:W,numberOfMonths:2,initialFocus:!0,className:le("p-3 pointer-events-auto")}),((U==null?void 0:U.from)||(U==null?void 0:U.to))&&r.jsx("div",{className:"flex justify-end p-2 border-t border-border",children:r.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>W(void 0),children:"Clear dates"})})]})]})]});return r.jsxs("div",{className:"sticky top-0 z-10 bg-card border-b border-border",children:[r.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(df,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}
563),r.jsx(xe,{placeholder:n,value:e,onChange:Y=>t(Y.target.value),className:"pl-9 pr-9"}),e&&r.jsx("button",{onClick:()=>t(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r.jsx(Nn,{className:"h-4 w-4"})})]}),r.jsxs(G,{variant:"outline",size:"icon",className:"md:hidden h-10 w-10 shrink-0 relative",onClick:()=>C(!L),children:[r.jsx(Ry,{className:"h-4 w-4"}),D>0&&r.jsx("span",{className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-primary text-primary-foreground text-[10px] flex items-center justify-center",children:D})]})]}),r.jsxs("div",{className:"hidden md:flex items-center gap-3 px-4 pb-3 flex-wrap",children:[I,F&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 text-xs text-muted-foreground hover:text-foreground",onClick:T,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]}),r.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[S!==void 0&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ti,{id:"show-rejected",checked:!!E,onCheckedChange:S}),r.jsx(Q,{htmlFor:"show-rejected",className:"text-xs text-muted-foreground cursor-pointer",children:"Show rejected"})]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:F?`${s} of ${a} ${a!==1?o:i}`:`${a} ${a!==1?o:i}`})]})]}),L&&r.jsxs("div",{className:"md:hidden px-4 pb-3 space-y-2",children:[I,F&&r.jsxs(G,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:T,children:[r.jsx(Nn,{className:"h-3 w-3 mr-1"}),"Clear all"]})]}),r.jsxs("div",{className:"md:hidden flex items-center justify-between px-4 pb-2 gap-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:F?`${s} of ${a} ${a!==1?o:i}`:`${a} ${a!==1?o:i}`}),S!==void 0&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ti,{id:"show-rejected-mobile",checked:!!E,onCheckedChange:S}),r.jsx(Q,{htmlFor:"show-rejected-mobile",className:"text-xs text-muted-foreground cursor-pointer",children:"Show rejected"})]})]})]})}function zG(){const e=ta(),[t,n]=_o(),s=t.get("section"),a=t.get("tab"),o=a?{members:{section:"members",sub:"pending"},"all-members":{section:"members",sub:"all"},tutors:{section:"members",sub:"tutors"},reviews:{section:"reviews"},courses:{section:"courses",sub:"semsa"},"external-courses":{section:"courses",sub:"external"},"member-payments":{section:"payments"}}[a]:void 0,c=(s==="tutors"?"members":s)||(o==null?void 0:o.section)||"members",d=(s==="tutors"?"tutors":t.get("sub"))||(o==null?void 0:o.sub),u=c==="members"?d==="all"?"all":d==="tutors"?"tutors":"pending":"pending",h=c==="courses"&&d==="external"?"external":"semsa",f=(me,ee)=>{const at={section:me};ee&&(at.sub=ee),n(at)},{user:p,isAdmin:w,loading:v}=In(),{toast:b}=Sn(),[x,g]=m.useState([]),[y,j]=m.useState([]),[N,k]=m.useState(!1),[_,P]=m.useState([]),[$,M]=m.useState([]),[O,A]=m.useState(!0),[U,W]=m.useState(null),[E,S]=m.useState({}),[L,C]=m.useState(null),[D,F]=m.useState(null),[T,q]=m.useState(null),[I,Y]=m.useState("all"),[ie,se]=m.useState("all"),[pe,_e]=m.useState("all"),[Pe,ke]=m.useState("all"),[Re,De]=m.useState("all"),[de,R]=m.useState("all"),[X,ue]=m.useState("all"),[te,Ce]=m.useState(""),[he,Be]=m.useState(""),[Nt,dt]=m.useState(null),[Ze,st]=m.useState(void 0),[Ke,bt]=m.useState(void 0),[pt,kn]=m.useState("all"),[Ot,$t]=m.useState("all"),[pn,Sr]=m.useState("all"),[Cn,kr]=m.useState("all"),[Wt,J]=m.useState("all"),[ae,V]=m.useState("all"),[oe,Ae]=m.useState("all"),[$e,Ve]=m.useState(0),[gt,qt]=m.useState("created_at"),[zt,vt]=m.useState("desc"),[Vt,cr]=m.useState("last_name"),[Jt,Ur]=m.useState("asc"),Br=(me,ee,at,Fe,St)=>{ee===me?St(at==="asc"?"desc":"asc"):(Fe(me),St("asc"))},na=({column:me,activeCol:ee,dir:at})=>me!==ee?r.jsx(Kl,{className:"h-3 w-3 ml-1 opacity-40"}):at==="asc"?r.jsx(jo,{className:"h-3 w-3 ml-1"}):r.jsx(bo,{className:"h-3 w-3 ml-1"}),An=m.useMemo(()=>N?[...x,...y.map(ee=>({...ee,status:"rejected"}))]:x.map(ee=>({...ee,status:"pending"})),[x,y,N]),dr=m.useMemo(()=>{const me=he.toLowerCase().trim();let ee=[...An];if(me&&(ee=ee.filter(Fe=>[Fe.first_name,Fe.last_name,Fe.email,Fe.job_title,Fe.university].filter(
563Boolean).join(" ").toLowerCase().includes(me))),pt!=="all"&&(ee=ee.filter(Fe=>Fe.year_of_study===pt)),Ot!=="all"&&(ee=ee.filter(Fe=>Fe.job_title===Ot)),pn!=="all"&&(ee=ee.filter(Fe=>Fe.university===pn)),Wt!=="all"&&(ee=ee.filter(Fe=>Fe.profession===Wt)),ae!=="all"&&(ee=ee.filter(Fe=>Fe.career_stage===ae)),oe!=="all"&&(ee=ee.filter(Fe=>String(Fe.graduation_year??"")===oe)),Cn!=="all"&&(ee=ee.filter(Fe=>Cn==="rejected"?Fe.status==="rejected":Fe.payment_status===Cn&&Fe.status!=="rejected")),Ke!=null&&Ke.from){const Fe=new Date(Ke.from);Fe.setHours(0,0,0,0),ee=ee.filter(St=>new Date(St.created_at)>=Fe)}if(Ke!=null&&Ke.to){const Fe=new Date(Ke.to);Fe.setHours(23,59,59,999),ee=ee.filter(St=>new Date(St.created_at)<=Fe)}const at=zt==="asc"?1:-1;return ee.sort((Fe,St)=>gt==="first_name"?at*(Fe.first_name||"").localeCompare(St.first_name||""):gt==="last_name"?at*(Fe.last_name||"").localeCompare(St.last_name||""):at*(new Date(Fe.created_at).getTime()-new Date(St.created_at).getTime())),ee},[An,he,gt,zt,pt,Ot,pn,Cn,Ke,Wt,ae,oe]),ra=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.year_of_study).filter(Boolean));return Array.from(me).sort()},[An]),Cu=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.job_title).filter(Boolean));return Array.from(me).sort()},[An]),Au=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.university).filter(Boolean));return Array.from(me).sort()},[An]),uc=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.profession).filter(Boolean));return Array.from(me).sort()},[An]),Eu=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.career_stage).filter(Boolean));return Array.from(me).sort()},[An]),ss=m.useMemo(()=>{const me=new Set(An.map(ee=>ee.graduation_year).filter(Boolean).map(String));return Array.from(me).sort()},[An]),Tu=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.year_of_study).filter(Boolean));return Array.from(me).sort()},[_]),Pu=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.job_title).filter(Boolean));return Array.from(me).sort()},[_]),Ru=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.university).filter(Boolean));return Array.from(me).sort()},[_]),Mu=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.profession).filter(Boolean));return Array.from(me).sort()},[_]),ep=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.career_stage).filter(Boolean));return Array.from(me).sort()},[_]),Oe=m.useMemo(()=>{const me=new Set(_.map(ee=>ee.graduation_year).filter(Boolean).map(String));return Array.from(me).sort()},[_]),z=m.useMemo(()=>{const me=te.toLowerCase().trim(),ee=Ze!=null&&Ze.from?new Date(Ze.from).setHours(0,0,0,0):null,at=Ze!=null&&Ze.to?new Date(Ze.to).setHours(23,59,59,999):null,Fe=_.filter(Tt=>!(I!=="all"&&Tt.role!==I||ie!=="all"&&Tt.year_of_study!==ie||pe!=="all"&&Tt.job_title!==pe||Pe!=="all"&&Tt.university!==Pe||Re!=="all"&&Tt.profession!==Re||de!=="all"&&Tt.career_stage!==de||X!=="all"&&String(Tt.graduation_year??"")!==X||ee!==null&&new Date(Tt.created_at).getTime()<ee||at!==null&&new Date(Tt.created_at).getTime()>at||me&&![Tt.first_name,Tt.last_name,Tt.email,Tt.job_title,Tt.university,Tt.year_of_study,Tt.phone,Tt.role].filter(
563Boolean).join(" ").toLowerCase().includes(me))),St=Jt==="asc"?1:-1;return Fe.sort((Tt,xn)=>{switch(Vt){case"first_name":return St*(Tt.first_name||"").localeCompare(xn.first_name||"");case"last_name":return St*(Tt.last_name||"").localeCompare(xn.last_name||"");case"university":return St*(Tt.university||"").localeCompare(xn.university||"");case"job_title":return St*(Tt.job_title||"").localeCompare(xn.job_title||"");case"created_at":return St*(new Date(Tt.created_at).getTime()-new Date(xn.created_at).getTime());default:return 0}}),Fe},[_,I,ie,pe,Pe,Re,de,X,Ze,te,Vt,Jt]);m.useEffect(()=>{!v&&(!p||!w)&&e("/auth")},[p,w,v,e]),m.useEffect(()=>{w&&(ge(),Ee(),Et())},[w]);const ge=async()=>{const{data:me,error:ee}=await K.from("profiles").select("*").eq("status","pending").order("created_at",{ascending:!1});ee?b({title:"Error loading pending members",description:ee.message,variant:"destructive"}):g(me||[]);const{data:at,error:Fe}=await K.from("profiles").select("*").eq("status","rejected").order("created_at",{ascending:!1});Fe||j(at||[]),A(!1)},Ee=async()=>{const{data:me,error:ee}=await K.from("profiles").select("*").in("status",["approved"]).order("created_at",{ascending:!1});if(ee){b({title:"Error loading members",description:ee.message,variant:"destructive"});return}const at=(me||[]).map(xn=>xn.id),{data:Fe,error:St}=await K.from("user_roles").select("user_id, role").in("user_id",at);if(St){b({title:"Error loading user roles",description:St.message,variant:"destructive"});return}const Tt=(me||[]).map(xn=>{const is=(Fe||[]).find(tp=>tp.user_id===xn.id);return{...xn,role:(is==null?void 0:is.role)||"none"}});P(Tt),Ve((Fe||[]).filter(xn=>xn.role==="tutor").length)},Et=async()=>{const{data:me,error:ee}=await K.from("clinical_rotation_reviews").select("id, hospital, country, city, rating, created_at").order("created_at",{ascending:!1}).limit(50);ee?(console.error("Review fetch error:",ee),b({title:"Error loading reviews",description:ee.message,variant:"destructive"})):(console.log("Reviews loaded:",me),M(me||[]))},gn=async me=>{const ee=x.find(xn=>xn.id===me),at=(ee==null?void 0:ee.last_name)==="Test",Fe=(ee==null?void 0:ee.payment_status)==="exempt",{error:St}=await K.from("profiles").update({status:"approved"}).eq("id",me);if(St){b({title:"Error approving member",description:St.message,variant:"destructive"});return}await K.from("user_roles").delete().eq("user_id",me).eq("role","pending");const Tt=Fe?["member","tutor"]:["member"];for(const xn of Tt){const{error:is}=await K.from("user_roles").insert({user_id:me,role:xn});if(is&&!is.message.includes("duplicate")){b({title:"Error updating role",description:is.message,variant:"destructive"});return}}if(ee){const xn=`${ee.first_name||""} ${ee.last_name||""}`.trim()||"Member";let is;Fe?is=at?"test_tutor_activated":"tutor_activated":is=at?"test_membership_activated":"membership_activated";try{await K.functions.invoke("admin-queue-email",{body:{emailType:is,payload:{participantEmail:ee.email,participantName:xn,memberSince:new Date().toISOString()}}})}catch(tp){console.error("Failed to queue activation email:",tp)}}b({title:Fe?"Tutor approved":"Member approved",description:`The ${Fe?"tutor":"member"} has been approved successfully`}),ge()},en=async me=>{const ee=x.find(Fe=>Fe.id===me);ee==null||ee.last_name;const{error:at}=await K.from("profiles").update({status:"rejected"}).eq("id",me);if(at){b({title:"Error rejecting member",description:at.message,variant:"destructive"});return}if(await K.from("member_payments").update({status:"cancelled"}).eq("member_id",me).eq("payment_type","membership").eq("status","pending"),await K.from("user_roles").delete().eq("user_id",me),ee!=null&&ee.email){const Fe=`${ee.first_name||""} ${ee.last_name||""}`.trim()||"Applicant";try{await K.functions.invoke("admin-queue-email",{body:{emailType:"membership_rejected",payload:{participantEmail:ee.email,participantName:Fe}}})}catch(St){console.error("Failed to queue rejection email:",St)}}b({title:"Member rejected",description:"The member application has been rejected and notified"}),ge()},Un=async(me,ee)=>{const{error:at}=await K.from("profiles").update({payment_status:ee}).eq("id",me);if(at){b({title:"Error updating payment status",description:at.message,variant:"destructive"});return}g(Fe=>Fe.map(St=>St.id===me?{...St,payment_status:ee}:St)),Nt&&Nt.id===me&&dt({...Nt,payment_status:ee}),b({title:"Payment status updated"})},as=async()=>
563{if(!U)return;const{error:me}=await K.from("clinical_rotation_reviews").delete().eq("id",U);me?b({title:"Error deleting review",description:me.message,variant:"destructive"}):(b({title:"Review deleted",description:"The review has been removed successfully"}),Et()),W(null)},Pa=async(me,ee)=>{await K.from("user_roles").delete().eq("user_id",me);const{error:at}=await K.from("user_roles").insert({user_id:me,role:ee});if(at){b({title:"Error updating role",description:at.message,variant:"destructive"});return}b({title:"Role updated",description:`Member role has been updated to ${ee}`}),S({}),Ee()},mc=async()=>{if(L)try{const{data:me,error:ee}=await K.functions.invoke("delete-user",{body:{userId:L}});if(ee)throw new Error(ee.message||"Failed to delete user");b({title:"Member removed",description:me!=null&&me.anonymisedRegistrations||me!=null&&me.cancelledPayments?`Account removed. ${me.anonymisedRegistrations??0} registration(s) anonymised, ${me.cancelledPayments??0} payment(s) cancelled.`:"The member has been completely removed from the system"}),C(null),Ee(),ge()}catch(me){b({title:"Error removing member",description:me.message,variant:"destructive"})}};if(v||!w)return r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."});const Du=c==="courses"?"Courses":c==="payments"?"Member Payments":c==="reviews"?"Reviews":`Members · ${u==="tutors"?"Tutors":u==="all"?"All Members":"Pending Members"}`;return r.jsxs(gE,{variant:"admin",title:`Admin · ${Du}`,children:[r.jsxs("div",{className:"space-y-6",children:[c==="members"&&r.jsxs(yi,{value:u,onValueChange:me=>f("members",me),className:"w-full",children:[r.jsxs(ka,{children:[r.jsxs(bn,{value:"pending",children:["Pending Members (",x.length,")"]}),r.jsxs(bn,{value:"all",children:["All Members (",_.length,")"]}),r.jsxs(bn,{value:"tutors",children:["Tutors",$e?` (${$e})`:""]})]}),r.jsx(Fn,{value:"pending",className:"space-y-4",children:r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Pending Member Approvals"}),r.jsx(Pt,{children:"Review and approve new member registrations"})]}),r.jsxs(H,{className:"px-0 pb-0",children:[r.jsx(b_,{searchQuery:he,onSearchChange:Be,searchPlaceholder:"Search by name or email…",resultCount:dr.length,totalCount:An.length,itemLabelSingular:N?"member":"pending member",itemLabelPlural:N?"members":"pending members",paymentStatusFilter:Cn,onPaymentStatusFilterChange:kr,yearFilter:pt,onYearFilterChange:kn,professionFilter:Ot,onProfessionFilterChange:$t,universityFilter:pn,onUniversityFilterChange:Sr,uniqueYears:ra,uniqueProfessions:Cu,uniqueUniversities:Au,professionNewFilter:Wt,onProfessionNewFilterChange:J,uniqueProfessionsNew:uc,careerStageFilter:ae,onCareerStageFilterChange:V,uniqueCareerStages:Eu,graduationYearFilter:oe,onGraduationYearFilterChange:Ae,uniqueGraduationYears:ss,dateRange:Ke,onDateRangeChange:bt,showRejected:N,onShowRejectedChange:k}),r.jsxs("div",{className:"hidden md:grid md:grid-cols-[1.5fr_1.5fr_2fr_1fr_150px_200px] md:items-center md:gap-4 px-4 py-2 border-b border-border text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("first_name",gt,zt,qt,vt),children:["First Name ",r.jsx(na,{column:"first_name",activeCol:gt,dir:zt})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("last_name",gt,zt,qt,vt),children:["Last Name ",r.jsx(na,{column:"last_name",activeCol:gt,dir:zt})]}),r.jsx("span",{children:"Email"}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("created_at",gt,zt,qt,vt),children:["Registered ",r.jsx(na,{column:"created_at",activeCol:gt,dir:zt})]}),r.jsx("span",{children:"Status"}),r.jsx("span",{children:"Actions"})]}),O?r.jsx("p",{className:"text-muted-foreground px-4 py-6",children:"Loading..."}):dr.length===0?r.jsx("p",{className:"text-muted-foreground px-4 py-6",children:he?"No pending members found":"No pending members"}):r.jsx("div",{children:dr.map(me=>r.jsx(YV,{member:me,onViewDetail:ee=>dt(ee),onApprove:ee=>{const at=An.find(Fe=>Fe.id===ee);(at==null?void 0:at.payment_status)==="awaiting_payment"?q(ee):gn(ee)},onReject:ee=>en(ee),onDelete:ee=>F(ee)},me.id))})]})]})}),r.jsx(Fn,{value:"all",className:"space-y-4",children:r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"All Members"}),r.jsx(Pt,{children:"View all registered members and their information"})]}
563),r.jsxs(H,{className:"px-0 pb-0",children:[r.jsx(b_,{searchQuery:te,onSearchChange:Ce,roleFilter:I,onRoleFilterChange:Y,yearFilter:ie,onYearFilterChange:se,professionFilter:pe,onProfessionFilterChange:_e,universityFilter:Pe,onUniversityFilterChange:ke,resultCount:z.length,totalCount:_.length,uniqueYears:Tu,uniqueProfessions:Pu,uniqueUniversities:Ru,professionNewFilter:Re,onProfessionNewFilterChange:De,uniqueProfessionsNew:Mu,careerStageFilter:de,onCareerStageFilterChange:R,uniqueCareerStages:ep,graduationYearFilter:X,onGraduationYearFilterChange:ue,uniqueGraduationYears:Oe,dateRange:Ze,onDateRangeChange:st}),r.jsxs("div",{className:"hidden md:flex items-center gap-3 px-4 py-2 border-b border-border text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsxs("div",{className:"grid grid-cols-[1.5fr_1.5fr_2fr_1fr_120px] items-center gap-4",children:[r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("first_name",Vt,Jt,cr,Ur),children:["First Name ",r.jsx(na,{column:"first_name",activeCol:Vt,dir:Jt})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("last_name",Vt,Jt,cr,Ur),children:["Last Name ",r.jsx(na,{column:"last_name",activeCol:Vt,dir:Jt})]}),r.jsxs("button",{className:"flex items-center hover:text-foreground transition-colors text-left",onClick:()=>Br("job_title",Vt,Jt,cr,Ur),children:["Profession ",r.jsx(na,{column:"job_title",activeCol:Vt,dir:Jt})]}),r.jsx("span",{children:"Year"}),r.jsx("span",{children:"Role"})]})}),r.jsx("div",{className:"w-8 shrink-0"})]}),z.length===0?r.jsx("p",{className:"text-muted-foreground px-4 py-6",children:"No members found"}):r.jsx("div",{children:z.map(me=>r.jsx(VV,{member:me,onViewDetail:ee=>dt(ee),onChangeRole:(ee,at)=>Pa(ee,at),onDeactivate:ee=>{K.from("profiles").update({status:"rejected"}).eq("id",ee).then(()=>{b({title:"Member deactivated"}),Ee()})},onDelete:ee=>C(ee)},me.id))})]})]})}),r.jsx(Fn,{value:"tutors",className:"space-y-4",children:r.jsx(oV,{})})]}),c==="courses"&&r.jsxs(yi,{value:h,onValueChange:me=>f("courses",me),className:"w-full",children:[r.jsxs(ka,{children:[r.jsx(bn,{value:"semsa",children:"SEMSA Courses"}),r.jsx(bn,{value:"external",children:"External Courses"})]}),r.jsx(Fn,{value:"semsa",children:r.jsx(iV,{})}),r.jsx(Fn,{value:"external",children:r.jsx(cV,{})})]}),c==="payments"&&r.jsx(UV,{}),c==="reviews"&&r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Manage Reviews"}),r.jsx(Pt,{children:"Delete inappropriate or spam reviews"})]}),r.jsx(H,{children:$.length===0?r.jsx("p",{className:"text-muted-foreground",children:"No reviews found"}):r.jsxs(ko,{children:[r.jsx(Co,{children:r.jsxs(Lr,{children:[r.jsx(jt,{children:"Hospital"}),r.jsx(jt,{children:"Location"}),r.jsx(jt,{children:"Rating"}),r.jsx(jt,{children:"Date"}),r.jsx(jt,{children:"Actions"})]})}),r.jsx(Ao,{children:$.map(me=>r.jsxs(Lr,{children:[r.jsx(xt,{children:me.hospital}),r.jsxs(xt,{children:[me.city,", ",me.country]}),r.jsxs(xt,{children:[me.rating,"/5"]}),r.jsx(xt,{children:an(new Date(me.created_at),"dd.MM.yyyy")}),r.jsx(xt,{children:r.jsx(G,{size:"sm",variant:"destructive",onClick:()=>W(me.id),children:"Delete"})})]},me.id))})]})})]})]}),r.jsx(_n,{open:!!U,onOpenChange:()=>W(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Delete Review"}),r.jsx(mn,{children:"Are you sure you want to delete this review? This action cannot be undone."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:as,children:"Delete"})]})]})}),r.jsx(_n,{open:!!L,onOpenChange:()=>C(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Remove Member"}),r.jsx(mn,{children:"Are you sure you want to remove this member? They will lose access to all member features. Their course registrations and payments remain as historical records (anonymised), and courses they created stay intact. This action cannot be undone."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:mc,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove Member"})]})]})}),r.jsx(_n,{open:!!T,onOpenChange:()=>q(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Confirm manual approval"}),r.jsx(mn,{children:"This member is still awaiting payment. Normally members are automatically approved via the Payment Dashboard when the invoice is marked as paid. Do you still want to approve this member manually?"})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:()=>{const me=T;q(null),me&&gn(me)},children:"Approve anyway"})]})]})}),r.jsx(_n,{open:!!D,onOpenChange:()=>F(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Delete member account?"}),r.jsx(mn,{children:"This will permanently delete the user account and cannot be undone. Course registrations and payments are kept as anonymised historical records."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:async()=>{const me=D;if(F(null),!!me)try{const{data:ee,error:at}=await K.functions.invoke("delete-user",{body:{userId:me}});if(at)throw new Error(at.message||"Failed to delete user");
563b({title:"Member deleted",description:"The account has been permanently removed"}),ge()}catch(ee){b({title:"Error deleting member",description:ee.message,variant:"destructive"})}},children:"Delete"})]})]})}),r.jsx(WV,{member:Nt,open:!!Nt,onOpenChange:me=>{me||dt(null)},onUpdatePaymentStatus:Un})]})}const UG=Ut.object({firstName:Ut.string().trim().min(1,"Required").max(100),lastName:Ut.string().trim().min(1,"Required").max(100),email:Ut.string().trim().toLowerCase().email("Invalid email").max(255),phone:Ut.string().trim().min(1,"Required").max(50)});function BG({courseId:e,open:t,onOpenChange:n,onAdded:s}){const{toast:a}=Sn(),[i,o]=m.useState(!1),[l,c]=m.useState(""),[d,u]=m.useState(!1),[h,f]=m.useState([]),[p,w]=m.useState(null),[v,b]=m.useState({firstName:"",lastName:"",email:"",phone:""}),[x,g]=m.useState({});m.useEffect(()=>{t||(c(""),f([]),w(null),b({firstName:"",lastName:"",email:"",phone:""}),g({}))},[t]),m.useEffect(()=>{if(!t)return;const k=l.trim();if(k.length<2){f([]);return}u(!0);const _=setTimeout(async()=>{const P=`%${k}%`,{data:$,error:M}=await K.from("profiles").select("id, first_name, last_name, email, phone, status").or(`first_name.ilike.${P},last_name.ilike.${P},email.ilike.${P}`).in("status",["approved","pending"]).limit(10);M||f($||[]),u(!1)},250);return()=>clearTimeout(_)},[l,t]);const y=async k=>{o(!0);try{const{data:_,error:P}=await K.functions.invoke("admin-add-to-waiting-list",{body:k});if(P)throw P;if(_!=null&&_.error)throw new Error(_.error);a({title:"Added to waiting list",description:"Confirmation email queued."}),s(),n(!1)}catch(_){a({title:"Failed to add",description:_.message,variant:"destructive"})}finally{o(!1)}},j=()=>{p&&y({courseId:e,userId:p.id})},N=()=>{const k=UG.safeParse(v);if(!k.success){const _={};for(const P of k.error.issues)_[P.path[0]]=P.message;g(_);return}g({}),y({courseId:e,external:k.data})};return r.jsx(go,{open:t,onOpenChange:n,children:r.jsxs(Ni,{className:"sm:max-w-lg",children:[r.jsxs(Si,{children:[r.jsx(ki,{children:"Add to waiting list"}),r.jsx(Ci,{children:"Manually add a participant. They will receive the same waiting list confirmation email as a self-registered entry."})]}),r.jsxs(yi,{defaultValue:"member",className:"space-y-4",children:[r.jsxs(ka,{className:"grid grid-cols-2",children:[r.jsx(bn,{value:"member",children:"Existing member"}),r.jsx(bn,{value:"external",children:"External"})]}),r.jsxs(Fn,{value:"member",className:"space-y-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"Search by name or email"}),r.jsx(xe,{value:l,onChange:k=>{c(k.target.value),w(null)},placeholder:"Type at least 2 characters…"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Approved and pending members can both be added. Both are charged the member price."})]}),d&&r.jsxs("div",{className:"flex items-center text-sm text-muted-foreground gap-2",children:[r.jsx(xa,{className:"h-3.5 w-3.5 animate-spin"})," Searching…"]}),!d&&l.trim().length>=2&&h.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"No members found."}),r.jsx("div",{className:"space-y-1 max-h-60 overflow-auto",children:h.map(k=>{const _=(p==null?void 0:p.id)===k.id;return r.jsxs("button",{type:"button",onClick:()=>w(k),className:`w-full text-left px-3 py-2 rounded-md border text-sm ${_?"border-primary bg-primary/5":"border-border hover:bg-muted"}`,children:[r.jsxs("div",{className:"font-medium flex items-center gap-2",children:[r.jsxs("span",{children:[k.first_name," ",k.last_name]}),k.status==="pending"&&r.jsx("span",{className:"text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"Pending"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:[k.email,k.phone?` · ${k.phone}`:""]})]},k.id)})}),r.jsxs(Yd,{children:[r.jsx(G,{variant:"ghost",onClick:()=>n(!1),children:"Cancel"}),r.jsxs(G,{onClick:j,disabled:!p||i,children:[i?r.jsx(xa,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(Sj,{className:"h-4 w-4 mr-2"}),"Add to waiting list"]})]})]}),r.jsxs(Fn,{value:"external",className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{children:"First name"}),r.jsx(xe,{value:v.firstName,onChange:k=>b({...v,firstName:k.target.value})}),x.firstName&&r.jsx("p",{className:"text-xs text-destructive",children:x.firstName})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{children:"Last name"}),r.jsx(xe,{value:v.lastName,onChange:k=>b({...v,lastName:k.target.value})}),x.lastName&&r.jsx("p",{className:"text-xs text-destructive",children:x.lastName})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{children:"Email"}),r.jsx(xe,{type:"email",value:v.email,onChange:k=>b({...v,email:k.target.value})}),x.email&&r.jsx("p",{className:"text-xs text-destructive",children:x.email})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{children:"Phone"}),r.jsx(xe,{value:v.phone,onChange:k=>b({...v,phone:k.target.value})}),x.phone&&r.jsx("p",{className:"text-xs text-destructive",children:x.phone})]}),r.jsxs(Yd,{children:[r.jsx(G,{variant:"ghost",onClick:()=>n(!1),children:"Cancel"}
563),r.jsxs(G,{onClick:N,disabled:i,children:[i?r.jsx(xa,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(Sj,{className:"h-4 w-4 mr-2"}),"Add to waiting list"]})]})]})]})]})})}const j_=e=>{switch(e){case"confirmed":return r.jsx(Me,{variant:"outline",className:"border-green-400 text-green-700 dark:text-green-400",children:"Confirmed"});case"pending_payment":return r.jsx(Me,{variant:"secondary",className:"border-yellow-400 text-yellow-700 dark:text-yellow-400",children:"Pending Payment"});case"waiting_list":return r.jsx(Me,{variant:"secondary",className:"border-blue-400 text-blue-700 dark:text-blue-400",children:"Waiting List"});case"cancelled":return r.jsx(Me,{variant:"outline",className:"border-destructive text-destructive",children:"✕ Cancelled"});default:return r.jsx(Me,{variant:"outline",children:e})}},HG=e=>{switch(e){case"draft":return r.jsx(Me,{variant:"secondary",children:"Draft"});case"preview":return r.jsx(Me,{variant:"default",children:"Preview"});case"upcoming":return r.jsx(Me,{variant:"outline",className:"border-green-400 text-green-700 dark:text-green-400",children:"Upcoming"});case"completed":return r.jsx(Me,{variant:"secondary",className:"border-muted-foreground/30",children:"Completed"});case"archived":return r.jsx(Me,{variant:"secondary",className:"opacity-60",children:"Archived"});default:return r.jsx(Me,{variant:"outline",children:e})}};function WG(e,t,n){return m.useMemo(()=>{const s=[...e];return s.sort((a,i)=>{let o=0;switch(t){case"name":o=`${a.first_name} ${a.last_name}`.localeCompare(`${i.first_name} ${i.last_name}`);break;case"status":o=a.status.localeCompare(i.status);break;case"registered":o=new Date(a.registration_date).getTime()-new Date(i.registration_date).getTime();break}return n==="asc"?o:-o}),s},[e,t,n])}function Rg({field:e,current:t,dir:n}){return e!==t?r.jsx(Kl,{className:"h-3.5 w-3.5 ml-1 opacity-40"}):n==="asc"?r.jsx(jo,{className:"h-3.5 w-3.5 ml-1"}):r.jsx(bo,{className:"h-3.5 w-3.5 ml-1"})}function qG(){var q;const{sessionId:e}=Gy(),t=ta(),{user:n,isAdmin:s,loading:a}=In(),i=yu(),{toast:o}=Sn(),[l,c]=m.useState(null),[d,u]=m.useState([]),[h,f]=m.useState(!0),[p,w]=m.useState(null),[v,b]=m.useState(null),[x,g]=m.useState(null),[y,j]=m.useState(!1),[N,k]=m.useState("registered"),[_,P]=m.useState("desc"),[$,M]=m.useState(!1);m.useEffect(()=>{!a&&(!n||!s)&&t("/auth")},[n,s,a,t]),m.useEffect(()=>{e&&s&&O()},[e,s]);const O=async()=>{if(e){f(!0);try{const{data:I,error:Y}=await K.from("course_sessions").select("id, template_id, course_id_legacy, date, location, capacity, status, course_templates(title)").eq("id",e).single();if(Y)throw Y;if(c(I),I!=null&&I.course_id_legacy){const{data:ie,error:se}=await K.from("course_registrations").select("id, first_name, last_name, email, phone, registration_date, status, cancelled_at").eq("course_id",I.course_id_legacy).order("registration_date",{ascending:!1});if(se)throw se;u(ie||[])}}catch(I){o({title:"Error loading session",description:I.message,variant:"destructive"})}finally{f(!1)}}},A=async()=>{if(p)try{const{error:I}=await K.from("course_registrations").update({status:"confirmed"}).eq("id",p);if(I)throw I;o({title:"Registration confirmed"}),w(null),O()}catch(I){o({title:"Error",description:I.message,variant:"destructive"})}},U=async()=>{var Y;if(!v||!(l!=null&&l.course_id_legacy))return;const I=d.find(ie=>ie.id===v);if((I==null?void 0:I.status)==="cancelled"){b(null);return}try{const{error:ie}=await K.from("course_registrations").update({status:"cancelled",cancelled_at:new Date().toISOString(),cancelled_by:(n==null?void 0:n.id)??null}).eq("id",v);if(ie)throw ie;if(I)try{await K.functions.invoke("send-cancellation-notification",{body:{participantEmail:I.email,participantName:`${I.first_name} ${I.last_name}`,courseName:((Y=l.course_templates)==null?void 0:Y.title)||"Course",courseDate:l.date,courseLocation:l.location}})}catch(se){console.error("Failed to send cancellation email:",se)}o({title:"Participation cancelled"}),b(null),O()}catch(ie){o({title:"Error",description:ie.message,variant:"destructive"})}},W=d.find(I=>I.id===x),E=async()=>{if(x){j(!0);try{const{error:I}=await K.functions.invoke("admin-resend-confirmation",{body:{registrationId:x}});if(I)throw I;o({title:"Confirmation email resent"}),g(null)}catch(I){o({title:"Error",description:I.message,variant:"destructive"})}finally{j(!1)}}},S=d.filter(I=>I.status==="confirmed"||I.status==="pending_payment"),L=d.filter(I=>I.status==="cancelled"),C=d.filter(I=>I.status==="waiting_list"),D=d.filter(I=>I.status==="confirmed").length,F=d.filter(I=>I.status==="pending_payment").length,T=I=>{N===I?P(Y=>Y==="asc"?"desc":"asc"):(k(I),P("asc"))};return a||h?r.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground",children:"Loading…"}):l?r.jsxs("div",{className:"min-h-screen flex flex-col",children:[r.jsx("main",{className:"flex-1 container mx-auto px-4 py-8",children:r.jsxs("div",{className:"max-w-5xl mx-auto 
563space-y-6",children:[r.jsxs(G,{variant:"ghost",size:"sm",onClick:()=>t("/admin-dashboard?tab=courses"),children:[r.jsx(et,{className:"h-4 w-4 mr-2"})," Back to Dashboard"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[r.jsx("h1",{className:"text-2xl font-bold",children:((q=l.course_templates)==null?void 0:q.title)||"Untitled Session"}),HG(l.status)]}),r.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-muted-foreground",children:[l.date&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(su,{className:"h-4 w-4"}),rt(new Date(l.date),"dd.MM.yyyy HH:mm")]}),l.location&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Rn,{className:"h-4 w-4"}),l.location]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Ht,{className:"h-4 w-4"}),D+F," / ",l.capacity??"∞"]})]}),r.jsxs("div",{className:"flex flex-wrap gap-3",children:[r.jsxs(Me,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300 dark:bg-green-950 dark:text-green-400 dark:border-green-800",children:["Confirmed: ",D]}),r.jsxs(Me,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800",children:["Pending Payment: ",F]}),r.jsxs(Me,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800",children:["Waiting List: ",C.length]})]})]}),r.jsxs(yi,{defaultValue:"active",className:"space-y-4",children:[r.jsxs(ka,{children:[r.jsxs(bn,{value:"active",children:["Active Bookings (",S.length,")"]}),r.jsxs(bn,{value:"waiting",children:["Waiting List (",C.length,")"]})]}),r.jsx(Fn,{value:"active",children:r.jsx(__,{registrations:[...S,...L],sortField:N,sortDir:_,toggleSort:T,setSortField:k,setSortDir:P,isMobile:i,onConfirm:w,onDelete:b,onResend:g,emptyMessage:"No active bookings yet."})}),r.jsxs(Fn,{value:"waiting",className:"space-y-3",children:[r.jsx("div",{className:"flex justify-end",children:r.jsx(G,{size:"sm",onClick:()=>M(!0),children:"Add to waiting list"})}),r.jsx(__,{registrations:C,sortField:N,sortDir:_,toggleSort:T,setSortField:k,setSortDir:P,isMobile:i,onConfirm:w,onDelete:b,onResend:g,emptyMessage:"No one on the waiting list."})]})]})]})}),r.jsx(_n,{open:!!p,onOpenChange:I=>!I&&w(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Confirm Registration?"}),r.jsx(mn,{children:"This will change the participant's status to confirmed. They will count towards the session capacity."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Cancel"}),r.jsx(hn,{onClick:A,children:"Confirm"})]})]})}),r.jsx(_n,{open:!!v,onOpenChange:I=>!I&&b(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Really cancel participation?"}),r.jsx(mn,{children:"The registration stays in the list marked as cancelled, the spot is freed up, and the participant receives a cancellation notification."})]}),r.jsxs(dn,{children:[r.jsx(fn,{children:"Back"}),r.jsx(hn,{onClick:U,children:"Cancel Participation"})]})]})}),r.jsx(_n,{open:!!x,onOpenChange:I=>!I&&!y&&g(null),children:r.jsxs(ln,{children:[r.jsxs(cn,{children:[r.jsx(un,{children:"Resend confirmation email?"}),r.jsx(mn,{children:W?r.jsxs(r.Fragment,{children:["This will re-send the ",W.status==="waiting_list"?"waiting list confirmation":W.status==="pending_payment"?"payment reservation":"course confirmation"," email to ",r.jsx("strong",{children:W.email}),"."]}):"This will re-send the confirmation email."})]}),r.jsxs(dn,{children:[r.jsx(fn,{disabled:y,children:"Cancel"}),r.jsx(hn,{onClick:E,disabled:y,children:y?"Sending…":"Resend"})]})]})}),e&&r.jsx(BG,{courseId:l.course_id_legacy||"",open:$&&!!l.course_id_legacy,onOpenChange:M,onAdded:O}),r.jsx(qe,{})]}):r.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground",children:"Session not found."})}function __({registrations:e,sortField:t,sortDir:n,toggleSort:s,setSortField:a,setSortDir:i,isMobile:o,onConfirm:l,onDelete:c,onResend:d,emptyMessage:u}){const h=WG(e,t,n);return e.length===0?r.jsx("p",{className:"text-center py-8 text-muted-foreground",children:u}):o?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Sort by:"}),r.jsxs(mt,{value:t,onValueChange:f=>a(f),children:[r.jsx(ot,{className:"w-[140px] h-8 text-sm",children:r.jsx(ht,{})}),r.jsxs(lt,{children:[r.jsx(fe,{value:"name",children:"Name"}),r.jsx(fe,{value:"status",children:"Status"}),r.jsx(fe,{value:"registered",children:"Registered"})]})]}),r.jsx(G,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>i(n==="asc"?"desc":"asc"),children:n==="asc"?r.jsx(jo,{className:"h-4 w-4"}):r.jsx(bo,{className:"h-4 w-4"})})]}),h.map(f=>r.jsx(B,{className:f.status==="cancelled"?"opacity-50 bg-muted/40":void 0,children:r.jsxs(H,{
563className:"p-4 space-y-2",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("p",{className:"font-semibold text-sm truncate",children:[f.first_name," ",f.last_name]}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.email}),r.jsx("p",{className:"text-xs text-muted-foreground",children:f.phone}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Registered: ",rt(new Date(f.registration_date),"dd.MM.yyyy HH:mm")]})]}),r.jsxs("div",{className:"text-right",children:[j_(f.status),f.status==="cancelled"&&f.cancelled_at&&r.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:rt(new Date(f.cancelled_at),"dd.MM.yyyy HH:mm")})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[f.status!=="confirmed"&&f.status!=="cancelled"&&r.jsxs(G,{size:"sm",variant:"outline",onClick:()=>l(f.id),children:[r.jsx(Ys,{className:"h-3.5 w-3.5 mr-1"})," Confirm"]}),(f.status==="confirmed"||f.status==="waiting_list"||f.status==="pending_payment")&&r.jsxs(G,{size:"sm",variant:"outline",onClick:()=>d(f.id),children:[r.jsx(_d,{className:"h-3.5 w-3.5 mr-1"})," Resend"]}),f.status!=="cancelled"&&r.jsxs(G,{size:"sm",variant:"destructive",onClick:()=>c(f.id),children:[r.jsx(Ns,{className:"h-3.5 w-3.5 mr-1"})," Cancel"]})]})]})},f.id))]}):r.jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:r.jsxs(ko,{children:[r.jsx(Co,{children:r.jsxs(Lr,{children:[r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>s("name"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Name ",r.jsx(Rg,{field:"name",current:t,dir:n})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>s("status"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Status ",r.jsx(Rg,{field:"status",current:t,dir:n})]})}),r.jsx(jt,{className:"cursor-pointer select-none",onClick:()=>s("registered"),children:r.jsxs("span",{className:"inline-flex items-center",children:["Registered ",r.jsx(Rg,{field:"registered",current:t,dir:n})]})}),r.jsx(jt,{className:"text-right",children:"Actions"})]})}),r.jsx(Ao,{children:h.map(f=>r.jsxs(Lr,{className:f.status==="cancelled"?"opacity-50 bg-muted/40":void 0,children:[r.jsx(xt,{children:r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium",children:[f.first_name," ",f.last_name]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.email," · ",f.phone]})]})}),r.jsxs(xt,{children:[j_(f.status),f.status==="cancelled"&&f.cancelled_at&&r.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:rt(new Date(f.cancelled_at),"dd.MM.yyyy HH:mm")})]}),r.jsx(xt,{className:"whitespace-nowrap",children:rt(new Date(f.registration_date),"dd.MM.yyyy HH:mm")}),r.jsx(xt,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[f.status!=="confirmed"&&f.status!=="cancelled"&&r.jsxs(G,{size:"sm",variant:"outline",onClick:()=>l(f.id),children:[r.jsx(Ys,{className:"h-4 w-4 mr-1"})," Confirm"]}),(f.status==="confirmed"||f.status==="waiting_list"||f.status==="pending_payment")&&r.jsx(G,{size:"sm",variant:"outline",onClick:()=>d(f.id),title:"Resend confirmation email",children:r.jsx(_d,{className:"h-4 w-4"})}),f.status!=="cancelled"&&r.jsx(G,{size:"sm",variant:"destructive",onClick:()=>c(f.id),children:r.jsx(Ns,{className:"h-4 w-4"})})]})})]},f.id))})]})})}function VG(){const e=ta(),{user:t,isMember:n,isAdmin:s,loading:a}=In(),{toast:i}=Sn(),[o,l]=m.useState([]),[c,d]=m.useState([]),[u,h]=m.useState(null),[f,p]=m.useState(!1),[w,v]=m.useState(!0),[b,x]=m.useState([]),[g,y]=m.useState(""),[j,N]=m.useState(!1),[k,_]=m.useState(!1);m.useEffect(()=>{!a&&(!t||!n&&!s)&&e("/auth")},[t,n,s,a,e]),m.useEffect(()=>{(n||s)&&$()},[n,s,b]);const P=()=>b.length>0?b.join("/"):"",$=async()=>{v(!0);try{const D=P(),{data:F,error:T}=await K.storage.from("member-files").list(D||void 0,{sortBy:{column:"name",order:"asc"}});if(T)throw T;const q=[],I=[];(F||[]).forEach(Y=>{Y.id===null||Y.name===".emptyFolderPlaceholder"?Y.name!==".emptyFolderPlaceholder"&&q.push(Y):Y.name!==".emptyFolderPlaceholder"&&I.push(Y)}),d(q),l(I)}catch(D){console.error("Error fetching contents:",D),i({title:"Error loading files",description:D instanceof Error?D.message:"Unknown error",variant:"destructive"})}finally{v(!1)}},M=async()=>
563{if(!g.trim()||!s)return;const D=g.trim().replace(/[^a-zA-Z0-9-_\s]/g,"");if(!D){i({title:"Invalid folder name",description:"Please use only letters, numbers, dashes, underscores, and spaces",variant:"destructive"});return}N(!0);try{const F=P(),T=F?`${F}/${D}/.emptyFolderPlaceholder`:`${D}/.emptyFolderPlaceholder`,q=new Blob([""],{type:"text/plain"}),{error:I}=await K.storage.from("member-files").upload(T,q,{cacheControl:"3600",upsert:!1});if(I)throw I;i({title:"Folder created",description:`Created folder "${D}"`}),y(""),_(!1),$()}catch(F){console.error("Create folder error:",F),i({title:"Failed to create folder",description:F instanceof Error?F.message:"Unknown error",variant:"destructive"})}finally{N(!1)}},O=async D=>{if(D.preventDefault(),!(!u||!s)){p(!0);try{const F=P(),T=F?`${F}/${u.name}`:u.name,{error:q}=await K.storage.from("member-files").upload(T,u,{cacheControl:"3600",upsert:!1});if(q)throw q;i({title:"File uploaded",description:"The file has been uploaded successfully"}),h(null);const I=document.getElementById("file");I&&(I.value=""),$()}catch(F){console.error("Upload error:",F),i({title:"Upload failed",description:F instanceof Error?F.message:"Unknown error",variant:"destructive"})}finally{p(!1)}}},A=async D=>{try{const F=P(),T=F?`${F}/${D}`:D,{data:q,error:I}=await K.storage.from("member-files").download(T);if(I)throw I;const Y=URL.createObjectURL(q),ie=document.createElement("a");ie.href=Y,ie.download=D,document.body.appendChild(ie),ie.click(),document.body.removeChild(ie),URL.revokeObjectURL(Y),i({title:"Download started",description:`Downloading ${D}`})}catch(F){console.error("Download error:",F),i({title:"Download failed",description:F instanceof Error?F.message:"Unknown error",variant:"destructive"})}},U=async D=>{if(s)try{const F=P(),T=F?`${F}/${D}`:D,{error:q}=await K.storage.from("member-files").remove([T]);if(q)throw q;i({title:"File deleted",description:"The file has been removed"}),$()}catch(F){console.error("Delete error:",F),i({title:"Delete failed",description:F instanceof Error?F.message:"Unknown error",variant:"destructive"})}},W=async D=>{if(s)try{const F=P(),T=F?`${F}/${D}`:D,{data:q,error:I}=await K.storage.from("member-files").list(T);if(I)throw I;if(q&&q.length>0){const Y=q.map(se=>`${T}/${se.name}`),{error:ie}=await K.storage.from("member-files").remove(Y);if(ie)throw ie}i({title:"Folder deleted",description:"The folder and its contents have been removed"}),$()}catch(F){console.error("Delete folder error:",F),i({title:"Delete failed",description:F instanceof Error?F.message:"Unknown error",variant:"destructive"})}},E=D=>{x([...b,D])},S=()=>{x(b.slice(0,-1))},L=D=>{D<0?x([]):x(b.slice(0,D+1))},C=D=>{if(D===0)return"0 Bytes";const F=1024,T=["Bytes","KB","MB","GB"],q=Math.floor(Math.log(D)/Math.log(F));return Math.round(D/Math.pow(F,q)*100)/100+" "+T[q]};return a?r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):r.jsxs("div",{className:"min-h-screen flex flex-col",children:[r.jsx("main",{className:"flex-1 container mx-auto px-4 py-8",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs(G,{variant:"outline",onClick:()=>e("/member-dashboard"),children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]}),r.jsx("h1",{className:"text-3xl font-bold",children:"Member File Share"})]})}),r.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground flex-wrap",children:[r.jsx(G,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>L(-1),children:r.jsx(z4,{className:"h-4 w-4"})}),b.map((D,F)=>r.jsxs("div",{className:"flex items-center",children:[r.jsx(Cy,{className:"h-4 w-4"}),r.jsx(G,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>L(F),children:D})]},F))]}),r.jsxs("div",{className:"space-y-6",children:[s&&r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:"Admin Actions"}),r.jsx(Pt,{children:"Upload files or create folders in the current directory"})]}
563),r.jsxs(H,{className:"space-y-4",children:[r.jsxs("form",{onSubmit:O,className:"flex items-end gap-4",children:[r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx(Q,{htmlFor:"file",children:"Upload File"}),r.jsx(xe,{id:"file",type:"file",onChange:D=>{var F;return h(((F=D.target.files)==null?void 0:F[0])||null)},disabled:f})]}),r.jsxs(G,{type:"submit",disabled:!u||f,children:[r.jsx(SS,{className:"h-4 w-4 mr-2"}),f?"Uploading...":"Upload"]})]}),r.jsx("div",{className:"border-t pt-4",children:r.jsxs(go,{open:k,onOpenChange:_,children:[r.jsx(Gf,{asChild:!0,children:r.jsxs(G,{variant:"outline",children:[r.jsx(F4,{className:"h-4 w-4 mr-2"}),"Create New Folder"]})}),r.jsxs(Ni,{children:[r.jsxs(Si,{children:[r.jsx(ki,{children:"Create New Folder"}),r.jsx(Ci,{children:"Enter a name for the new folder. Only letters, numbers, dashes, underscores, and spaces are allowed."})]}),r.jsxs("div",{className:"py-4",children:[r.jsx(Q,{htmlFor:"folderName",children:"Folder Name"}),r.jsx(xe,{id:"folderName",value:g,onChange:D=>y(D.target.value),placeholder:"My Folder",className:"mt-2"})]}),r.jsxs(Yd,{children:[r.jsx(G,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),r.jsx(G,{onClick:M,disabled:!g.trim()||j,children:j?"Creating...":"Create Folder"})]})]})]})})]})]}),r.jsxs(B,{children:[r.jsxs(ne,{children:[r.jsx(re,{children:b.length>0?b[b.length-1]:"Files"}),r.jsx(Pt,{children:b.length>0?`Browsing: /${b.join("/")}`:"Browse folders and files"})]}),r.jsx(H,{children:w?r.jsx("p",{className:"text-muted-foreground",children:"Loading..."}):c.length===0&&o.length===0?r.jsxs("div",{className:"text-center py-8",children:[r.jsx(Nj,{className:"h-12 w-12 mx-auto text-muted-foreground/50 mb-2"}),r.jsx("p",{className:"text-muted-foreground",children:"This folder is empty"}),b.length>0&&r.jsxs(G,{variant:"ghost",className:"mt-4",onClick:S,children:[r.jsx(et,{className:"h-4 w-4 mr-2"}),"Go Back"]})]}):r.jsxs("div",{className:"space-y-2",children:[b.length>0&&r.jsx("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50 cursor-pointer",onClick:S,children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(et,{className:"h-5 w-5 text-muted-foreground"}),r.jsx("p",{className:"font-medium",children:".."})]})}),c.map(D=>r.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50",children:[r.jsxs("div",{className:"flex items-center gap-3 cursor-pointer flex-1",onClick:()=>E(D.name),children:[r.jsx(Nj,{className:"h-5 w-5 text-primary"}),r.jsx("p",{className:"font-medium",children:D.name})]}),s&&r.jsx(G,{size:"sm",variant:"destructive",onClick:F=>{F.stopPropagation(),W(D.name)},children:r.jsx(Ns,{className:"h-4 w-4"})})]},D.name)),o.map(D=>{var F;return r.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(I4,{className:"h-5 w-5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:D.name}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[C(((F=D.metadata)==null?void 0:F.size)||0)," •",new Date(D.created_at).toLocaleDateString()]})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(G,{size:"sm",variant:"outline",onClick:()=>A(D.name),children:r.jsx(Tx,{className:"h-4 w-4"})}),s&&r.jsx(G,{size:"sm",variant:"destructive",onClick:()=>U(D.name),children:r.jsx(Ns,{className:"h-4 w-4"})})]})]},D.id)})]})})]})]})]})}),r.jsx(qe,{})]})}const YG=()=>{const[e]=_o(),t=ta(),[n,s]=m.useState(!1);return m.useEffect(()=>{const a=e.get("link");if(!a){t("/auth");return}try{const i=decodeURIComponent(a);if(!new URL(i).hostname.endsWith(".supabase.co")){console.error("Invalid redirect URL - not a Supabase domain"),s(!0),setTimeout(()=>t("/auth"),2e3);return}window.location.replace(i)}catch(i){console.error("Failed to decode or validate link:",i),s(!0),setTimeout(()=>t("/auth"),2e3)}},[e,t]),r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:r.jsx("div",{className:"max-w-md w-full text-center space-y-4",children:n?r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"text-2xl font-bold text-destructive",children:"Invalid Link"}),r.jsxs("p",{className:"text-muted-foreground",children:["Redirecting you to login..."," ",r.jsx("a",{href:"/auth",className:"text-primary hover:underline",children:"continue here"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"animate-pulse",children:r.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent roun
563ded-full animate-spin mx-auto mb-4"})}),r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Opening your secure link..."}),r.jsxs("p",{className:"text-muted-foreground",children:["If nothing happens,"," ",r.jsx("a",{href:"/auth",className:"text-primary hover:underline",children:"continue here"})]})]})})})},GG=new iL,KG=()=>r.jsx(lL,{client:GG,children:r.jsx(lk,{children:r.jsxs(nF,{children:[r.jsx(DD,{}),r.jsx(cO,{}),r.jsxs(T3,{children:[r.jsx(rF,{}),r.jsxs(a3,{children:[r.jsx(ze,{path:"/",element:r.jsx(r$,{})}),r.jsx(ze,{path:"/about",element:r.jsx(K$,{})}),r.jsx(ze,{path:"/membership",element:r.jsx(Vz,{})}),r.jsx(ze,{path:"/emergency-medicine",element:r.jsx(Yz,{})}),r.jsx(ze,{path:"/emergency-medicine/career-paths",element:r.jsx(Gz,{})}),r.jsx(ze,{path:"/emergency-medicine/career-paths/doctors",element:r.jsx(Qz,{})}),r.jsx(ze,{path:"/emergency-medicine/career-paths/nurses",element:r.jsx(Jz,{})}),r.jsx(ze,{path:"/emergency-medicine/career-paths/paramedics",element:r.jsx(eU,{})}),r.jsx(ze,{path:"/emergency-medicine/focus-clinical-em",element:r.jsx(tU,{})}),r.jsx(ze,{path:"/emergency-medicine/prehospital-em",element:r.jsx(nU,{})}),r.jsx(ze,{path:"/emergency-medicine/air-ambulance",element:r.jsx(rU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-courses",element:r.jsx(sU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-courses/medventura",element:r.jsx(aU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-courses/stewi",element:r.jsx(iU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/atls-etc",element:r.jsx(oU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/acls-als",element:r.jsx(lU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/pals-epls",element:r.jsx(cU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/phtls",element:r.jsx(dU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/amls",element:r.jsx(uU,{})}),r.jsx(ze,{path:"/emergency-medicine/courses/tccc-tecc",element:r.jsx(mU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-jobs",element:r.jsx(hU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-jobs/jdmt",element:r.jsx(fU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-jobs/chris-medical",element:r.jsx(pU,{})}),r.jsx(ze,{path:"/emergency-medicine/student-jobs/emergency-squat",element:r.jsx(gU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools",element:r.jsx(xU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/die-kliniker",element:r.jsx(vU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/medstandards",element:r.jsx(yU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/ibcc",element:r.jsx(wU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/life-in-the-fast-lane",element:r.jsx(bU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/notfallguru",element:r.jsx(jU,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/bruits-dechoc",element:r.jsx(_U,{})}),r.jsx(ze,{path:"/emergency-medicine/useful-tools/pincast",element:r.jsx(NU,{})}),r.jsx(ze,{path:"/emergency-medicine/clinical-rotations",element:r.jsx(SU,{})}),r.jsx(ze,{path:"/emergency-medicine/voluntary-work",element:r.jsx(kU,{})}),r.jsx(ze,{path:"/emergency-medicine/voluntary-work/humedica",element:r.jsx(CU,{})}),r.jsx(ze,{path:"/emergency-medicine/voluntary-work/first-responder",element:r.jsx(AU,{})}),r.jsx(ze,{path:"/emergency-medicine/voluntary-work/doctors-without-borders",element:r.jsx(EU,{})}),r.jsx(ze,{path:"/events",element:r.jsx(bH,{})}),r.jsx(ze,{path:"/courses",element:r.jsx(jH,{})}),r.jsx(ze,{path:"/courses/:id",element:r.jsx(YW,{})}),r.jsx(ze,{path:"/external-courses/:id",element:r.jsx(GW,{})}),r.jsx(ze,{path:"/contact",element:r.jsx(KW,{})}),r.jsx(ze,{path:"/legal",element:r.jsx(JW,{})}),r.jsx(ze,{path:"/auth",element:r.jsx(n7,{})}),r.jsx(ze,{path:"/recover",element:r.jsx(YG,{})}),r.jsx(ze,{path:"/member-dashboard",element:r.jsx(z7,{})}),r.jsx(ze,{path:"/member-dashboard/tutor-profile",element:r.jsx(U7,{})}),r.jsx(ze,{path:"/admin-dashboard",element:r.jsx(zG,{})}),r.jsx(ze,{path:"/admin/sessions/:sessionId",element:r.jsx(qG,{})}),r.jsx(ze,{path:"/file-share",element:r.jsx(VG,{})}),r.jsx(ze,{path:"*",element:r.jsx(e7,{})})]})]})]})})});V1(document.getElementById("root")).render(r.jsx(KG,{}));export{G as B,B as C,At as E,be as L,Rn as M,Ht as U,As as a,Zs as b,bw as c,R4 as d,Hf as e,an as f,Cy as g,gr as h,jw as i,r as j,H as k,Me as l,m as r,br as s,We as t};

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.