function xh(n,a){for(var i=0;iu[d]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function wh(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var a=n.default;if(typeof a=="function"){var i=function u(){var d=!1;try{d=this instanceof u}catch{}return d?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};i.prototype=a.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(u){var d=Object.getOwnPropertyDescriptor(n,u);Object.defineProperty(i,u,d.get?d:{enumerable:!0,get:function(){return n[u]}})}),i}var ul={exports:{}},ha={},cl={exports:{}},me={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ud;function jh(){if(Ud)return me;Ud=1;var n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.iterator;function N(T){return T===null||typeof T!="object"?null:(T=y&&T[y]||T["@@iterator"],typeof T=="function"?T:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,z={};function P(T,U,de){this.props=T,this.context=U,this.refs=z,this.updater=de||O}P.prototype.isReactComponent={},P.prototype.setState=function(T,U){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,U,"setState")},P.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function W(){}W.prototype=P.prototype;function _(T,U,de){this.props=T,this.context=U,this.refs=z,this.updater=de||O}var k=_.prototype=new W;k.constructor=_,$(k,P.prototype),k.isPureReactComponent=!0;var j=Array.isArray,D=Object.prototype.hasOwnProperty,R={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function Q(T,U,de){var he,ve={},ye=null,_e=null;if(U!=null)for(he in U.ref!==void 0&&(_e=U.ref),U.key!==void 0&&(ye=""+U.key),U)D.call(U,he)&&!A.hasOwnProperty(he)&&(ve[he]=U[he]);var we=arguments.length-2;if(we===1)ve.children=de;else if(1>>1,U=F[T];if(0>>1;Td(ve,Y))yed(_e,ve)?(F[T]=_e,F[ye]=Y,T=ye):(F[T]=ve,F[he]=Y,T=he);else if(yed(_e,Y))F[T]=_e,F[ye]=Y,T=ye;else break e}}return J}function d(F,J){var Y=F.sortIndex-J.sortIndex;return Y!==0?Y:F.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();n.unstable_now=function(){return m.now()-v}}var g=[],w=[],h=1,y=null,N=3,O=!1,$=!1,z=!1,P=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(F){for(var J=i(w);J!==null;){if(J.callback===null)u(w);else if(J.startTime<=F)u(w),J.sortIndex=J.expirationTime,a(g,J);else break;J=i(w)}}function j(F){if(z=!1,k(F),!$)if(i(g)!==null)$=!0,le(D);else{var J=i(w);J!==null&&E(j,J.startTime-F)}}function D(F,J){$=!1,z&&(z=!1,W(Q),Q=-1),O=!0;var Y=N;try{for(k(J),y=i(g);y!==null&&(!(y.expirationTime>J)||F&&!ce());){var T=y.callback;if(typeof T=="function"){y.callback=null,N=y.priorityLevel;var U=T(y.expirationTime<=J);J=n.unstable_now(),typeof U=="function"?y.callback=U:y===i(g)&&u(g),k(J)}else u(g);y=i(g)}if(y!==null)var de=!0;else{var he=i(w);he!==null&&E(j,he.startTime-J),de=!1}return de}finally{y=null,N=Y,O=!1}}var R=!1,A=null,Q=-1,oe=5,fe=-1;function ce(){return!(n.unstable_now()-feF||125T?(F.sortIndex=Y,a(w,F),i(g)===null&&F===i(w)&&(z?(W(Q),Q=-1):z=!0,E(j,Y-T))):(F.sortIndex=U,a(g,F),$||O||($=!0,le(D))),F},n.unstable_shouldYield=ce,n.unstable_wrapCallback=function(F){var J=N;return function(){var Y=N;N=J;try{return F.apply(this,arguments)}finally{N=Y}}}})(ml)),ml}var Vd;function _h(){return Vd||(Vd=1,fl.exports=Sh()),fl.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var qd;function Ch(){if(qd)return dt;qd=1;var n=Il(),a=_h();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,w=/^[: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]*$/,h={},y={};function N(e){return g.call(y,e)?!0:g.call(h,e)?!1:w.test(e)?y[e]=!0:(h[e]=!0,!1)}function O(e,t,r,o){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $(e,t,r,o){if(t===null||typeof t>"u"||O(e,t,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function z(e,t,r,o,l,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new z(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];P[t]=new z(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new z(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new z(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){P[e]=new z(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new z(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new z(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new z(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new z(e,5,!1,e.toLowerCase(),null,!1,!1)});var W=/[\-:]([a-z])/g;function _(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(W,_);P[t]=new z(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(W,_);P[t]=new z(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(W,_);P[t]=new z(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new z(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new z("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new z(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,t,r,o){var l=P.hasOwnProperty(t)?P[t]:null;(l!==null?l.type!==0:o||!(2x||l[p]!==c[x]){var b=` `+l[p].replace(" at new "," at ");return e.displayName&&b.includes("")&&(b=b.replace("",e.displayName)),b}while(1<=p&&0<=x);break}}}finally{de=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?U(e):""}function ve(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=he(e.type,!1),e;case 11:return e=he(e.type.render,!1),e;case 1:return e=he(e.type,!0),e;default:return""}}function ye(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 A:return"Fragment";case R:return"Portal";case oe:return"Profiler";case Q:return"StrictMode";case pe:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case fe:return(e._context.displayName||"Context")+".Provider";case ie:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function _e(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 ye(t);case 8:return t===Q?"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 we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ft(e){var t=Pe(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(p){o=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(p){o=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){e._valueTracker||(e._valueTracker=ft(e))}function ql(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=Pe(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function Ea(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 hs(e,t){var r=t.checked;return Y({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ql(e,t){var r=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;r=we(t.value!=null?t.value:r),e._wrapperState={initialChecked:o,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Yl(e,t){t=t.checked,t!=null&&k(e,"checked",t,!1)}function gs(e,t){Yl(e,t);var r=we(t.value),o=t.type;if(r!=null)o==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vs(e,t.type,r):t.hasOwnProperty("defaultValue")&&vs(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vs(e,t,r){(t!=="number"||Ea(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Pn=Array.isArray;function Kr(e,t,r,o){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ta.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Mn={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},bm=["Webkit","ms","Moz","O"];Object.keys(Mn).forEach(function(e){bm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mn[t]=Mn[e]})});function tu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Mn.hasOwnProperty(e)&&Mn[e]?(""+t).trim():t+"px"}function ru(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=r.indexOf("--")===0,l=tu(r,t[r],o);r==="float"&&(r="cssFloat"),o?e.setProperty(r,l):e[r]=l}}var km=Y({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 ws(e,t){if(t){if(km[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function js(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 Ns=null;function bs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ks=null,Gr=null,Jr=null;function nu(e){if(e=ea(e)){if(typeof ks!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ja(t),ks(e.stateNode,e.type,t))}}function au(e){Gr?Jr?Jr.push(e):Jr=[e]:Gr=e}function ou(){if(Gr){var e=Gr,t=Jr;if(Jr=Gr=null,nu(e),t)for(e=0;e>>=0,e===0?32:31-(Rm(e)/Im|0)|0}var La=64,Ra=4194304;function In(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 Ia(e,t){var r=e.pendingLanes;if(r===0)return 0;var o=0,l=e.suspendedLanes,c=e.pingedLanes,p=r&268435455;if(p!==0){var x=p&~l;x!==0?o=In(x):(c&=p,c!==0&&(o=In(c)))}else p=r&~l,p!==0?o=In(p):c!==0&&(o=In(c));if(o===0)return 0;if(t!==0&&t!==o&&(t&l)===0&&(l=o&-o,c=t&-t,l>=c||l===16&&(c&4194240)!==0))return t;if((o&4)!==0&&(o|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0r;r++)t.push(e);return t}function zn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=r}function Um(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=Vn),Ou=" ",Lu=!1;function Ru(e,t){switch(e){case"keyup":return pp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tn=!1;function gp(e,t){switch(e){case"compositionend":return Iu(t);case"keypress":return t.which!==32?null:(Lu=!0,Ou);case"textInput":return e=t.data,e===Ou&&Lu?null:e;default:return null}}function vp(e,t){if(tn)return e==="compositionend"||!Hs&&Ru(e,t)?(e=Cu(),Fa=Is=sr=null,tn=!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)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Bu(r)}}function Vu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qu(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ea(e.document)}return t}function Vs(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 _p(e){var t=qu(),r=e.focusedElem,o=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Vu(r.ownerDocument.documentElement,r)){if(o!==null&&Vs(r)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,c=Math.min(o.start,l);o=o.end===void 0?c:Math.min(o.end,l),!e.extend&&c>o&&(l=o,o=c,c=l),l=Wu(r,c);var p=Wu(r,o);l&&p&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),c>o?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,rn=null,qs=null,Xn=null,Qs=!1;function Qu(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Qs||rn==null||rn!==Ea(o)||(o=rn,"selectionStart"in o&&Vs(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Xn&&Yn(Xn,o)||(Xn=o,o=Xa(qs,"onSelect"),0ln||(e.current=oi[ln],oi[ln]=null,ln--)}function Ce(e,t){ln++,oi[ln]=e.current,e.current=t}var cr={},Ge=ur(cr),st=ur(!1),Or=cr;function un(e,t){var r=e.type.contextTypes;if(!r)return cr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in r)l[c]=t[c];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function it(e){return e=e.childContextTypes,e!=null}function Za(){Te(st),Te(Ge)}function lc(e,t,r){if(Ge.current!==cr)throw Error(i(168));Ce(Ge,t),Ce(st,r)}function uc(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var l in o)if(!(l in t))throw Error(i(108,_e(e)||"Unknown",l));return Y({},r,o)}function eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,Or=Ge.current,Ce(Ge,e),Ce(st,st.current),!0}function cc(e,t,r){var o=e.stateNode;if(!o)throw Error(i(169));r?(e=uc(e,t,Or),o.__reactInternalMemoizedMergedChildContext=e,Te(st),Te(Ge),Ce(Ge,e)):Te(st),Ce(st,r)}var Bt=null,to=!1,si=!1;function dc(e){Bt===null?Bt=[e]:Bt.push(e)}function $p(e){to=!0,dc(e)}function dr(){if(!si&&Bt!==null){si=!0;var e=0,t=je;try{var r=Bt;for(je=1;e>=p,l-=p,Wt=1<<32-St(t)+l|r<se?(Qe=ae,ae=null):Qe=ae.sibling;var xe=H(M,ae,L[se],q);if(xe===null){ae===null&&(ae=Qe);break}e&&ae&&xe.alternate===null&&t(M,ae),S=c(xe,S,se),ne===null?te=xe:ne.sibling=xe,ne=xe,ae=Qe}if(se===L.length)return r(M,ae),De&&Rr(M,se),te;if(ae===null){for(;sese?(Qe=ae,ae=null):Qe=ae.sibling;var wr=H(M,ae,xe.value,q);if(wr===null){ae===null&&(ae=Qe);break}e&&ae&&wr.alternate===null&&t(M,ae),S=c(wr,S,se),ne===null?te=wr:ne.sibling=wr,ne=wr,ae=Qe}if(xe.done)return r(M,ae),De&&Rr(M,se),te;if(ae===null){for(;!xe.done;se++,xe=L.next())xe=V(M,xe.value,q),xe!==null&&(S=c(xe,S,se),ne===null?te=xe:ne.sibling=xe,ne=xe);return De&&Rr(M,se),te}for(ae=o(M,ae);!xe.done;se++,xe=L.next())xe=K(ae,M,se,xe.value,q),xe!==null&&(e&&xe.alternate!==null&&ae.delete(xe.key===null?se:xe.key),S=c(xe,S,se),ne===null?te=xe:ne.sibling=xe,ne=xe);return e&&ae.forEach(function(yh){return t(M,yh)}),De&&Rr(M,se),te}function $e(M,S,L,q){if(typeof L=="object"&&L!==null&&L.type===A&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case D:e:{for(var te=L.key,ne=S;ne!==null;){if(ne.key===te){if(te=L.type,te===A){if(ne.tag===7){r(M,ne.sibling),S=l(ne,L.props.children),S.return=M,M=S;break e}}else if(ne.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===le&&vc(te)===ne.type){r(M,ne.sibling),S=l(ne,L.props),S.ref=ta(M,ne,L),S.return=M,M=S;break e}r(M,ne);break}else t(M,ne);ne=ne.sibling}L.type===A?(S=Br(L.props.children,M.mode,q,L.key),S.return=M,M=S):(q=Po(L.type,L.key,L.props,null,M.mode,q),q.ref=ta(M,S,L),q.return=M,M=q)}return p(M);case R:e:{for(ne=L.key;S!==null;){if(S.key===ne)if(S.tag===4&&S.stateNode.containerInfo===L.containerInfo&&S.stateNode.implementation===L.implementation){r(M,S.sibling),S=l(S,L.children||[]),S.return=M,M=S;break e}else{r(M,S);break}else t(M,S);S=S.sibling}S=nl(L,M.mode,q),S.return=M,M=S}return p(M);case le:return ne=L._init,$e(M,S,ne(L._payload),q)}if(Pn(L))return Z(M,S,L,q);if(J(L))return ee(M,S,L,q);oo(M,L)}return typeof L=="string"&&L!==""||typeof L=="number"?(L=""+L,S!==null&&S.tag===6?(r(M,S.sibling),S=l(S,L),S.return=M,M=S):(r(M,S),S=rl(L,M.mode,q),S.return=M,M=S),p(M)):r(M,S)}return $e}var mn=yc(!0),xc=yc(!1),so=ur(null),io=null,pn=null,fi=null;function mi(){fi=pn=io=null}function pi(e){var t=so.current;Te(so),e._currentValue=t}function hi(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function hn(e,t){io=e,fi=pn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(lt=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(fi!==e)if(e={context:e,memoizedValue:t,next:null},pn===null){if(io===null)throw Error(i(308));pn=e,io.dependencies={lanes:0,firstContext:e}}else pn=pn.next=e;return t}var Ir=null;function gi(e){Ir===null?Ir=[e]:Ir.push(e)}function wc(e,t,r,o){var l=t.interleaved;return l===null?(r.next=r,gi(t)):(r.next=l.next,l.next=r),t.interleaved=r,qt(e,o)}function qt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fr=!1;function vi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jc(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 Qt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mr(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(ge&2)!==0){var l=o.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),o.pending=t,qt(e,r)}return l=o.interleaved,l===null?(t.next=t,gi(o)):(t.next=l.next,l.next=t),o.interleaved=t,qt(e,r)}function lo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,Ds(e,r)}}function Nc(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var l=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var p={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?l=c=p:c=c.next=p,r=r.next}while(r!==null);c===null?l=c=t:c=c.next=t}else l=c=t;r={baseState:o.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:o.shared,effects:o.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function uo(e,t,r,o){var l=e.updateQueue;fr=!1;var c=l.firstBaseUpdate,p=l.lastBaseUpdate,x=l.shared.pending;if(x!==null){l.shared.pending=null;var b=x,I=b.next;b.next=null,p===null?c=I:p.next=I,p=b;var B=e.alternate;B!==null&&(B=B.updateQueue,x=B.lastBaseUpdate,x!==p&&(x===null?B.firstBaseUpdate=I:x.next=I,B.lastBaseUpdate=b))}if(c!==null){var V=l.baseState;p=0,B=I=b=null,x=c;do{var H=x.lane,K=x.eventTime;if((o&H)===H){B!==null&&(B=B.next={eventTime:K,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var Z=e,ee=x;switch(H=t,K=r,ee.tag){case 1:if(Z=ee.payload,typeof Z=="function"){V=Z.call(K,V,H);break e}V=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=ee.payload,H=typeof Z=="function"?Z.call(K,V,H):Z,H==null)break e;V=Y({},V,H);break e;case 2:fr=!0}}x.callback!==null&&x.lane!==0&&(e.flags|=64,H=l.effects,H===null?l.effects=[x]:H.push(x))}else K={eventTime:K,lane:H,tag:x.tag,payload:x.payload,callback:x.callback,next:null},B===null?(I=B=K,b=V):B=B.next=K,p|=H;if(x=x.next,x===null){if(x=l.shared.pending,x===null)break;H=x,x=H.next,H.next=null,l.lastBaseUpdate=H,l.shared.pending=null}}while(!0);if(B===null&&(b=V),l.baseState=b,l.firstBaseUpdate=I,l.lastBaseUpdate=B,t=l.shared.interleaved,t!==null){l=t;do p|=l.lane,l=l.next;while(l!==t)}else c===null&&(l.shared.lanes=0);Ar|=p,e.lanes=p,e.memoizedState=V}}function bc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var o=Ni.transition;Ni.transition={};try{e(!1),t()}finally{je=r,Ni.transition=o}}function Hc(){return wt().memoizedState}function Hp(e,t,r){var o=vr(e);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},Bc(e))Wc(t,r);else if(r=wc(e,t,r,o),r!==null){var l=nt();Dt(r,e,o,l),Vc(r,t,o)}}function Bp(e,t,r){var o=vr(e),l={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(Bc(e))Wc(t,l);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,x=c(p,r);if(l.hasEagerState=!0,l.eagerState=x,_t(x,p)){var b=t.interleaved;b===null?(l.next=l,gi(t)):(l.next=b.next,b.next=l),t.interleaved=l;return}}catch{}finally{}r=wc(e,t,l,o),r!==null&&(l=nt(),Dt(r,e,o,l),Vc(r,t,o))}}function Bc(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function Wc(e,t){oa=mo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Vc(e,t,r){if((r&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,Ds(e,r)}}var go={readContext:xt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},Wp={readContext:xt,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:Lc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,po(4194308,4,zc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return po(4194308,4,e,t)},useInsertionEffect:function(e,t){return po(4,2,e,t)},useMemo:function(e,t){var r=zt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var o=zt();return t=r!==void 0?r(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Hp.bind(null,Oe,e),[o.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:Mc,useDebugValue:Ti,useDeferredValue:function(e){return zt().memoizedState=e},useTransition:function(){var e=Mc(!1),t=e[0];return e=Fp.bind(null,e[1]),zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=Oe,l=zt();if(De){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),qe===null)throw Error(i(349));($r&30)!==0||Cc(o,t,r)}l.memoizedState=r;var c={value:r,getSnapshot:t};return l.queue=c,Lc(Tc.bind(null,o,c,e),[e]),o.flags|=2048,la(9,Ec.bind(null,o,c,r,t),void 0,null),r},useId:function(){var e=zt(),t=qe.identifierPrefix;if(De){var r=Vt,o=Wt;r=(o&~(1<<32-St(o)-1)).toString(32)+r,t=":"+t+"R"+r,r=sa++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=p.createElement(r,{is:o.is}):(e=p.createElement(r),r==="select"&&(p=e,o.multiple?p.multiple=!0:o.size&&(p.size=o.size))):e=p.createElementNS(e,r),e[Rt]=t,e[Zn]=o,dd(e,t,!1,!1),t.stateNode=e;e:{switch(p=js(r,o),r){case"dialog":Ee("cancel",e),Ee("close",e),l=o;break;case"iframe":case"object":case"embed":Ee("load",e),l=o;break;case"video":case"audio":for(l=0;lwn&&(t.flags|=128,o=!0,ua(c,!1),t.lanes=4194304)}else{if(!o)if(e=co(p),e!==null){if(t.flags|=128,o=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ua(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!De)return Ze(t),null}else 2*ze()-c.renderingStartTime>wn&&r!==1073741824&&(t.flags|=128,o=!0,ua(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(r=c.last,r!==null?r.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=ze(),t.sibling=null,r=Me.current,Ce(Me,o?r&1|2:r&1),t):(Ze(t),null);case 22:case 23:return Zi(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(gt&1073741824)!==0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Jp(e,t){switch(li(t),t.tag){case 1:return it(t.type)&&Za(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gn(),Te(st),Te(Ge),ji(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return xi(t),null;case 13:if(Te(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Me),null;case 4:return gn(),null;case 10:return pi(t.type._context),null;case 22:case 23:return Zi(),null;case 24:return null;default:return null}}var wo=!1,et=!1,Zp=typeof WeakSet=="function"?WeakSet:Set,G=null;function yn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){Ie(e,t,o)}else r.current=null}function Fi(e,t,r){try{r()}catch(o){Ie(e,t,o)}}var pd=!1;function eh(e,t){if(Zs=Aa,e=qu(),Vs(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var l=o.anchorOffset,c=o.focusNode;o=o.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var p=0,x=-1,b=-1,I=0,B=0,V=e,H=null;t:for(;;){for(var K;V!==r||l!==0&&V.nodeType!==3||(x=p+l),V!==c||o!==0&&V.nodeType!==3||(b=p+o),V.nodeType===3&&(p+=V.nodeValue.length),(K=V.firstChild)!==null;)H=V,V=K;for(;;){if(V===e)break t;if(H===r&&++I===l&&(x=p),H===c&&++B===o&&(b=p),(K=V.nextSibling)!==null)break;V=H,H=V.parentNode}V=K}r=x===-1||b===-1?null:{start:x,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(ei={focusedElem:e,selectionRange:r},Aa=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var Z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Z!==null){var ee=Z.memoizedProps,$e=Z.memoizedState,M=t.stateNode,S=M.getSnapshotBeforeUpdate(t.elementType===t.type?ee:Et(t.type,ee),$e);M.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var L=t.stateNode.containerInfo;L.nodeType===1?L.textContent="":L.nodeType===9&&L.documentElement&&L.removeChild(L.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(q){Ie(t,t.return,q)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return Z=pd,pd=!1,Z}function ca(e,t,r){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&e)===e){var c=l.destroy;l.destroy=void 0,c!==void 0&&Fi(t,r,c)}l=l.next}while(l!==o)}}function jo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var o=r.create;r.destroy=o()}r=r.next}while(r!==t)}}function Hi(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function hd(e){var t=e.alternate;t!==null&&(e.alternate=null,hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Zn],delete t[ai],delete t[Ip],delete t[zp])),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 gd(e){return e.tag===5||e.tag===3||e.tag===4}function vd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gd(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 Bi(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ga));else if(o!==4&&(e=e.child,e!==null))for(Bi(e,t,r),e=e.sibling;e!==null;)Bi(e,t,r),e=e.sibling}function Wi(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Wi(e,t,r),e=e.sibling;e!==null;)Wi(e,t,r),e=e.sibling}var Ye=null,Tt=!1;function pr(e,t,r){for(r=r.child;r!==null;)yd(e,t,r),r=r.sibling}function yd(e,t,r){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Oa,r)}catch{}switch(r.tag){case 5:et||yn(r,t);case 6:var o=Ye,l=Tt;Ye=null,pr(e,t,r),Ye=o,Tt=l,Ye!==null&&(Tt?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Tt?(e=Ye,r=r.stateNode,e.nodeType===8?ni(e.parentNode,r):e.nodeType===1&&ni(e,r),Hn(e)):ni(Ye,r.stateNode));break;case 4:o=Ye,l=Tt,Ye=r.stateNode.containerInfo,Tt=!0,pr(e,t,r),Ye=o,Tt=l;break;case 0:case 11:case 14:case 15:if(!et&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){l=o=o.next;do{var c=l,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&Fi(r,t,p),l=l.next}while(l!==o)}pr(e,t,r);break;case 1:if(!et&&(yn(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(x){Ie(r,t,x)}pr(e,t,r);break;case 21:pr(e,t,r);break;case 22:r.mode&1?(et=(o=et)||r.memoizedState!==null,pr(e,t,r),et=o):pr(e,t,r);break;default:pr(e,t,r)}}function xd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Zp),t.forEach(function(o){var l=uh.bind(null,e,o);r.has(o)||(r.add(o),o.then(l,l))})}}function Pt(e,t){var r=t.deletions;if(r!==null)for(var o=0;ol&&(l=p),o&=~c}if(o=l,o=ze()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*rh(o/1960))-o,10e?16:e,gr===null)var o=!1;else{if(e=gr,gr=null,_o=0,(ge&6)!==0)throw Error(i(331));var l=ge;for(ge|=4,G=e.current;G!==null;){var c=G,p=c.child;if((G.flags&16)!==0){var x=c.deletions;if(x!==null){for(var b=0;bze()-Qi?Fr(e,0):qi|=r),ct(e,t)}function Md(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ra,Ra<<=1,(Ra&130023424)===0&&(Ra=4194304)));var r=nt();e=qt(e,t),e!==null&&(zn(e,t,r),ct(e,r))}function lh(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Md(e,r)}function uh(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(i(314))}o!==null&&o.delete(t),Md(e,r)}var Od;Od=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)lt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return lt=!1,Kp(e,t,r);lt=(e.flags&131072)!==0}else lt=!1,De&&(t.flags&1048576)!==0&&fc(t,no,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;xo(e,t),e=t.pendingProps;var l=un(t,Ge.current);hn(t,r),l=ki(null,t,o,e,l,r);var c=Si();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,it(o)?(c=!0,eo(t)):c=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,vi(t),l.updater=vo,t.stateNode=l,l._reactInternals=t,Di(t,o,e,r),t=Ri(null,t,o,!0,c,r)):(t.tag=0,De&&c&&ii(t),rt(null,t,l,r),t=t.child),t;case 16:o=t.elementType;e:{switch(xo(e,t),e=t.pendingProps,l=o._init,o=l(o._payload),t.type=o,l=t.tag=dh(o),e=Et(o,e),l){case 0:t=Li(null,t,o,e,r);break e;case 1:t=od(null,t,o,e,r);break e;case 11:t=ed(null,t,o,e,r);break e;case 14:t=td(null,t,o,Et(o.type,e),r);break e}throw Error(i(306,o,""))}return t;case 0:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Et(o,l),Li(e,t,o,l,r);case 1:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Et(o,l),od(e,t,o,l,r);case 3:e:{if(sd(t),e===null)throw Error(i(387));o=t.pendingProps,c=t.memoizedState,l=c.element,jc(e,t),uo(t,o,null,r);var p=t.memoizedState;if(o=p.element,c.isDehydrated)if(c={element:o,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){l=vn(Error(i(423)),t),t=id(e,t,o,r,l);break e}else if(o!==l){l=vn(Error(i(424)),t),t=id(e,t,o,r,l);break e}else for(ht=lr(t.stateNode.containerInfo.firstChild),pt=t,De=!0,Ct=null,r=xc(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(fn(),o===l){t=Yt(e,t,r);break e}rt(e,t,o,r)}t=t.child}return t;case 5:return kc(t),e===null&&ci(t),o=t.type,l=t.pendingProps,c=e!==null?e.memoizedProps:null,p=l.children,ti(o,l)?p=null:c!==null&&ti(o,c)&&(t.flags|=32),ad(e,t),rt(e,t,p,r),t.child;case 6:return e===null&&ci(t),null;case 13:return ld(e,t,r);case 4:return yi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=mn(t,null,o,r):rt(e,t,o,r),t.child;case 11:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Et(o,l),ed(e,t,o,l,r);case 7:return rt(e,t,t.pendingProps,r),t.child;case 8:return rt(e,t,t.pendingProps.children,r),t.child;case 12:return rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,l=t.pendingProps,c=t.memoizedProps,p=l.value,Ce(so,o._currentValue),o._currentValue=p,c!==null)if(_t(c.value,p)){if(c.children===l.children&&!st.current){t=Yt(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var x=c.dependencies;if(x!==null){p=c.child;for(var b=x.firstContext;b!==null;){if(b.context===o){if(c.tag===1){b=Qt(-1,r&-r),b.tag=2;var I=c.updateQueue;if(I!==null){I=I.shared;var B=I.pending;B===null?b.next=b:(b.next=B.next,B.next=b),I.pending=b}}c.lanes|=r,b=c.alternate,b!==null&&(b.lanes|=r),hi(c.return,r,t),x.lanes|=r;break}b=b.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=r,x=p.alternate,x!==null&&(x.lanes|=r),hi(p,r,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}rt(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,o=t.pendingProps.children,hn(t,r),l=xt(l),o=o(l),t.flags|=1,rt(e,t,o,r),t.child;case 14:return o=t.type,l=Et(o,t.pendingProps),l=Et(o.type,l),td(e,t,o,l,r);case 15:return rd(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,l=t.pendingProps,l=t.elementType===o?l:Et(o,l),xo(e,t),t.tag=1,it(o)?(e=!0,eo(t)):e=!1,hn(t,r),Qc(t,o,l),Di(t,o,l,r),Ri(null,t,o,!0,e,r);case 19:return cd(e,t,r);case 22:return nd(e,t,r)}throw Error(i(156,t.tag))};function Ld(e,t){return mu(e,t)}function ch(e,t,r,o){this.tag=e,this.key=r,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,r,o){return new ch(e,t,r,o)}function tl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dh(e){if(typeof e=="function")return tl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ie)return 11;if(e===re)return 14}return 2}function xr(e,t){var r=e.alternate;return r===null?(r=Nt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Po(e,t,r,o,l,c){var p=2;if(o=e,typeof e=="function")tl(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case A:return Br(r.children,l,c,t);case Q:p=8,l|=8;break;case oe:return e=Nt(12,r,t,l|2),e.elementType=oe,e.lanes=c,e;case pe:return e=Nt(13,r,t,l),e.elementType=pe,e.lanes=c,e;case X:return e=Nt(19,r,t,l),e.elementType=X,e.lanes=c,e;case E:return Do(r,l,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fe:p=10;break e;case ce:p=9;break e;case ie:p=11;break e;case re:p=14;break e;case le:p=16,o=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Nt(p,r,t,l),t.elementType=e,t.type=o,t.lanes=c,t}function Br(e,t,r,o){return e=Nt(7,e,o,t),e.lanes=r,e}function Do(e,t,r,o){return e=Nt(22,e,o,t),e.elementType=E,e.lanes=r,e.stateNode={isHidden:!1},e}function rl(e,t,r){return e=Nt(6,e,null,t),e.lanes=r,e}function nl(e,t,r){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fh(e,t,r,o,l){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=Ps(0),this.expirationTimes=Ps(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.identifierPrefix=o,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function al(e,t,r,o,l,c,p,x,b){return e=new fh(e,t,r,x,b),t===1?(t=1,c===!0&&(t|=8)):t=0,c=Nt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},vi(c),e}function mh(e,t,r){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),dl.exports=Ch(),dl.exports}var Yd;function Eh(){if(Yd)return $o;Yd=1;var n=Of();return $o.createRoot=n.createRoot,$o.hydrateRoot=n.hydrateRoot,$o}var Th=Eh();Of();/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ya(){return ya=Object.assign?Object.assign.bind():function(n){for(var a=1;a"u")throw new Error(a)}function Lf(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Dh(){return Math.random().toString(36).substr(2,8)}function Kd(n,a){return{usr:n.state,key:n.key,idx:a}}function yl(n,a,i,u){return i===void 0&&(i=null),ya({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof a=="string"?_n(a):a,{state:i,key:a&&a.key||u||Dh()})}function Zo(n){let{pathname:a="/",search:i="",hash:u=""}=n;return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),u&&u!=="#"&&(a+=u.charAt(0)==="#"?u:"#"+u),a}function _n(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substr(i),n=n.substr(0,i));let u=n.indexOf("?");u>=0&&(a.search=n.substr(u),n=n.substr(0,u)),n&&(a.pathname=n)}return a}function Mh(n,a,i,u){u===void 0&&(u={});let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,v=br.Pop,g=null,w=h();w==null&&(w=0,m.replaceState(ya({},m.state,{idx:w}),""));function h(){return(m.state||{idx:null}).idx}function y(){v=br.Pop;let P=h(),W=P==null?null:P-w;w=P,g&&g({action:v,location:z.location,delta:W})}function N(P,W){v=br.Push;let _=yl(z.location,P,W);w=h()+1;let k=Kd(_,w),j=z.createHref(_);try{m.pushState(k,"",j)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;d.location.assign(j)}f&&g&&g({action:v,location:z.location,delta:1})}function O(P,W){v=br.Replace;let _=yl(z.location,P,W);w=h();let k=Kd(_,w),j=z.createHref(_);m.replaceState(k,"",j),f&&g&&g({action:v,location:z.location,delta:0})}function $(P){let W=d.location.origin!=="null"?d.location.origin:d.location.href,_=typeof P=="string"?P:Zo(P);return _=_.replace(/ $/,"%20"),Ue(W,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,W)}let z={get action(){return v},get location(){return n(d,m)},listen(P){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Xd,y),g=P,()=>{d.removeEventListener(Xd,y),g=null}},createHref(P){return a(d,P)},createURL:$,encodeLocation(P){let W=$(P);return{pathname:W.pathname,search:W.search,hash:W.hash}},push:N,replace:O,go(P){return m.go(P)}};return z}var Gd;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Gd||(Gd={}));function Oh(n,a,i){return i===void 0&&(i="/"),Lh(n,a,i)}function Lh(n,a,i,u){let d=typeof a=="string"?_n(a):a,f=zl(d.pathname||"/",i);if(f==null)return null;let m=Rf(n);Rh(m);let v=null;for(let g=0;v==null&&g{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};g.relativePath.startsWith("/")&&(Ue(g.relativePath.startsWith(u),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+u+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(u.length));let w=Sr([u,g.relativePath]),h=i.concat(g);f.children&&f.children.length>0&&(Ue(f.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+w+'".')),Rf(f.children,a,h,w)),!(f.path==null&&!f.index)&&a.push({path:w,score:Hh(w,f.index),routesMeta:h})};return n.forEach((f,m)=>{var v;if(f.path===""||!((v=f.path)!=null&&v.includes("?")))d(f,m);else for(let g of If(f.path))d(f,m,g)}),a}function If(n){let a=n.split("/");if(a.length===0)return[];let[i,...u]=a,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=If(u.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>n.startsWith("/")&&g===""?"/":g)}function Rh(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:Bh(a.routesMeta.map(u=>u.childrenIndex),i.routesMeta.map(u=>u.childrenIndex)))}const Ih=/^:[\w-]+$/,zh=3,$h=2,Ah=1,Uh=10,Fh=-2,Jd=n=>n==="*";function Hh(n,a){let i=n.split("/"),u=i.length;return i.some(Jd)&&(u+=Fh),a&&(u+=$h),i.filter(d=>!Jd(d)).reduce((d,f)=>d+(Ih.test(f)?zh:f===""?Ah:Uh),u)}function Bh(n,a){return n.length===a.length&&n.slice(0,-1).every((u,d)=>u===a[d])?n[n.length-1]-a[a.length-1]:0}function Wh(n,a,i){let{routesMeta:u}=n,d={},f="/",m=[];for(let v=0;v{let{paramName:N,isOptional:O}=h;if(N==="*"){let z=v[y]||"";m=f.slice(0,f.length-z.length).replace(/(.)\/+$/,"$1")}const $=v[y];return O&&!$?w[N]=void 0:w[N]=($||"").replace(/%2F/g,"/"),w},{}),pathname:f,pathnameBase:m,pattern:n}}function qh(n,a,i){a===void 0&&(a=!1),i===void 0&&(i=!0),Lf(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let u=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(u.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(u.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,a?void 0:"i"),u]}function Qh(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Lf(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),n}}function zl(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,u=n.charAt(i);return u&&u!=="/"?null:n.slice(i)||"/"}function Yh(n,a){a===void 0&&(a="/");let{pathname:i,search:u="",hash:d=""}=typeof n=="string"?_n(n):n;return{pathname:i?i.startsWith("/")?i:Xh(i,a):a,search:Jh(u),hash:Zh(d)}}function Xh(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function pl(n,a,i,u){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(u)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Kh(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function $l(n,a){let i=Kh(n);return a?i.map((u,d)=>d===i.length-1?u.pathname:u.pathnameBase):i.map(u=>u.pathnameBase)}function Al(n,a,i,u){u===void 0&&(u=!1);let d;typeof n=="string"?d=_n(n):(d=ya({},n),Ue(!d.pathname||!d.pathname.includes("?"),pl("?","pathname","search",d)),Ue(!d.pathname||!d.pathname.includes("#"),pl("#","pathname","hash",d)),Ue(!d.search||!d.search.includes("#"),pl("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=i;else{let y=a.length-1;if(!u&&m.startsWith("..")){let N=m.split("/");for(;N[0]==="..";)N.shift(),y-=1;d.pathname=N.join("/")}v=y>=0?a[y]:"/"}let g=Yh(d,v),w=m&&m!=="/"&&m.endsWith("/"),h=(f||m===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(w||h)&&(g.pathname+="/"),g}const Sr=n=>n.join("/").replace(/\/\/+/g,"/"),Gh=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Jh=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Zh=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function e0(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const zf=["post","put","patch","delete"];new Set(zf);const t0=["get",...zf];new Set(t0);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function xa(){return xa=Object.assign?Object.assign.bind():function(n){for(var a=1;a{v.current=!0}),C.useCallback(function(w,h){if(h===void 0&&(h={}),!v.current)return;if(typeof w=="number"){u.go(w);return}let y=Al(w,JSON.parse(m),f,h.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Sr([a,y.pathname])),(h.replace?u.replace:u.push)(y,h.state,h)},[a,u,m,f,n])}function Uf(n,a){let{relative:i}=a===void 0?{}:a,{future:u}=C.useContext(Cr),{matches:d}=C.useContext(Er),{pathname:f}=En(),m=JSON.stringify($l(d,u.v7_relativeSplatPath));return C.useMemo(()=>Al(n,JSON.parse(m),f,i==="path"),[n,m,f,i])}function o0(n,a){return s0(n,a)}function s0(n,a,i,u){Cn()||Ue(!1);let{navigator:d}=C.useContext(Cr),{matches:f}=C.useContext(Er),m=f[f.length-1],v=m?m.params:{};m&&m.pathname;let g=m?m.pathnameBase:"/";m&&m.route;let w=En(),h;if(a){var y;let P=typeof a=="string"?_n(a):a;g==="/"||(y=P.pathname)!=null&&y.startsWith(g)||Ue(!1),h=P}else h=w;let N=h.pathname||"/",O=N;if(g!=="/"){let P=g.replace(/^\//,"").split("/");O="/"+N.replace(/^\//,"").split("/").slice(P.length).join("/")}let $=Oh(n,{pathname:O}),z=d0($&&$.map(P=>Object.assign({},P,{params:Object.assign({},v,P.params),pathname:Sr([g,d.encodeLocation?d.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?g:Sr([g,d.encodeLocation?d.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),f,i,u);return a&&z?C.createElement(is.Provider,{value:{location:xa({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:br.Pop}},z):z}function i0(){let n=h0(),a=e0(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,d={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},a),i?C.createElement("pre",{style:d},i):null,null)}const l0=C.createElement(i0,null);class u0 extends C.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){console.error("React Router caught the following error during render",a,i)}render(){return this.state.error!==void 0?C.createElement(Er.Provider,{value:this.props.routeContext},C.createElement($f.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function c0(n){let{routeContext:a,match:i,children:u}=n,d=C.useContext(Ul);return d&&d.static&&d.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(d.staticContext._deepestRenderedBoundaryId=i.route.id),C.createElement(Er.Provider,{value:a},u)}function d0(n,a,i,u){var d;if(a===void 0&&(a=[]),i===void 0&&(i=null),u===void 0&&(u=null),n==null){var f;if(!i)return null;if(i.errors)n=i.matches;else if((f=u)!=null&&f.v7_partialHydration&&a.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let m=n,v=(d=i)==null?void 0:d.errors;if(v!=null){let h=m.findIndex(y=>y.route.id&&v?.[y.route.id]!==void 0);h>=0||Ue(!1),m=m.slice(0,Math.min(m.length,h+1))}let g=!1,w=-1;if(i&&u&&u.v7_partialHydration)for(let h=0;h=0?m=m.slice(0,w+1):m=[m[0]];break}}}return m.reduceRight((h,y,N)=>{let O,$=!1,z=null,P=null;i&&(O=v&&y.route.id?v[y.route.id]:void 0,z=y.route.errorElement||l0,g&&(w<0&&N===0?(v0("route-fallback"),$=!0,P=null):w===N&&($=!0,P=y.route.hydrateFallbackElement||null)));let W=a.concat(m.slice(0,N+1)),_=()=>{let k;return O?k=z:$?k=P:y.route.Component?k=C.createElement(y.route.Component,null):y.route.element?k=y.route.element:k=h,C.createElement(c0,{match:y,routeContext:{outlet:h,matches:W,isDataRoute:i!=null},children:k})};return i&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?C.createElement(u0,{location:i.location,revalidation:i.revalidation,component:z,error:O,children:_(),routeContext:{outlet:null,matches:W,isDataRoute:!0}}):_()},null)}var Ff=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(Ff||{}),Hf=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(Hf||{});function f0(n){let a=C.useContext(Ul);return a||Ue(!1),a}function m0(n){let a=C.useContext(r0);return a||Ue(!1),a}function p0(n){let a=C.useContext(Er);return a||Ue(!1),a}function Bf(n){let a=p0(),i=a.matches[a.matches.length-1];return i.route.id||Ue(!1),i.route.id}function h0(){var n;let a=C.useContext($f),i=m0(),u=Bf();return a!==void 0?a:(n=i.errors)==null?void 0:n[u]}function g0(){let{router:n}=f0(Ff.UseNavigateStable),a=Bf(Hf.UseNavigateStable),i=C.useRef(!1);return Af(()=>{i.current=!0}),C.useCallback(function(d,f){f===void 0&&(f={}),i.current&&(typeof d=="number"?n.navigate(d):n.navigate(d,xa({fromRouteId:a},f)))},[n,a])}const Zd={};function v0(n,a,i){Zd[n]||(Zd[n]=!0)}function y0(n,a){n?.v7_startTransition,n?.v7_relativeSplatPath}function x0(n){let{to:a,replace:i,state:u,relative:d}=n;Cn()||Ue(!1);let{future:f,static:m}=C.useContext(Cr),{matches:v}=C.useContext(Er),{pathname:g}=En(),w=Tr(),h=Al(a,$l(v,f.v7_relativeSplatPath),g,d==="path"),y=JSON.stringify(h);return C.useEffect(()=>w(JSON.parse(y),{replace:i,state:u,relative:d}),[w,y,d,i,u]),null}function Mt(n){Ue(!1)}function w0(n){let{basename:a="/",children:i=null,location:u,navigationType:d=br.Pop,navigator:f,static:m=!1,future:v}=n;Cn()&&Ue(!1);let g=a.replace(/^\/*/,"/"),w=C.useMemo(()=>({basename:g,navigator:f,static:m,future:xa({v7_relativeSplatPath:!1},v)}),[g,v,f,m]);typeof u=="string"&&(u=_n(u));let{pathname:h="/",search:y="",hash:N="",state:O=null,key:$="default"}=u,z=C.useMemo(()=>{let P=zl(h,g);return P==null?null:{location:{pathname:P,search:y,hash:N,state:O,key:$},navigationType:d}},[g,h,y,N,O,$,d]);return z==null?null:C.createElement(Cr.Provider,{value:w},C.createElement(is.Provider,{children:i,value:z}))}function j0(n){let{children:a,location:i}=n;return o0(xl(a),i)}new Promise(()=>{});function xl(n,a){a===void 0&&(a=[]);let i=[];return C.Children.forEach(n,(u,d)=>{if(!C.isValidElement(u))return;let f=[...a,d];if(u.type===C.Fragment){i.push.apply(i,xl(u.props.children,f));return}u.type!==Mt&&Ue(!1),!u.props.index||!u.props.children||Ue(!1);let m={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,loader:u.props.loader,action:u.props.action,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(m.children=xl(u.props.children,f)),i.push(m)}),i}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function wl(){return wl=Object.assign?Object.assign.bind():function(n){for(var a=1;a=0)&&(i[d]=n[d]);return i}function b0(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function k0(n,a){return n.button===0&&(!a||a==="_self")&&!b0(n)}const S0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_0="6";try{window.__reactRouterVersion=_0}catch{}const C0="startTransition",ef=kh[C0];function E0(n){let{basename:a,children:i,future:u,window:d}=n,f=C.useRef();f.current==null&&(f.current=Ph({window:d,v5Compat:!0}));let m=f.current,[v,g]=C.useState({action:m.action,location:m.location}),{v7_startTransition:w}=u||{},h=C.useCallback(y=>{w&&ef?ef(()=>g(y)):g(y)},[g,w]);return C.useLayoutEffect(()=>m.listen(h),[m,h]),C.useEffect(()=>y0(u),[u]),C.createElement(w0,{basename:a,children:i,location:v.location,navigationType:v.action,navigator:m,future:u})}const T0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kt=C.forwardRef(function(a,i){let{onClick:u,relative:d,reloadDocument:f,replace:m,state:v,target:g,to:w,preventScrollReset:h,viewTransition:y}=a,N=N0(a,S0),{basename:O}=C.useContext(Cr),$,z=!1;if(typeof w=="string"&&P0.test(w)&&($=w,T0))try{let k=new URL(window.location.href),j=w.startsWith("//")?new URL(k.protocol+w):new URL(w),D=zl(j.pathname,O);j.origin===k.origin&&D!=null?w=D+j.search+j.hash:z=!0}catch{}let P=n0(w,{relative:d}),W=D0(w,{replace:m,state:v,target:g,preventScrollReset:h,relative:d,viewTransition:y});function _(k){u&&u(k),k.defaultPrevented||W(k)}return C.createElement("a",wl({},N,{href:$||P,onClick:z||f?u:_,ref:i,target:g}))});var tf;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(tf||(tf={}));var rf;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(rf||(rf={}));function D0(n,a){let{target:i,replace:u,state:d,preventScrollReset:f,relative:m,viewTransition:v}=a===void 0?{}:a,g=Tr(),w=En(),h=Uf(n,{relative:m});return C.useCallback(y=>{if(k0(y,i)){y.preventDefault();let N=u!==void 0?u:Zo(w)===Zo(h);g(n,{replace:N,state:d,preventScrollReset:f,relative:m,viewTransition:v})}},[w,g,h,u,d,i,n,f,m,v])}let M0={data:""},O0=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||M0,L0=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,R0=/\/\*[^]*?\*\/| +/g,nf=/\n+/g,Nr=(n,a)=>{let i="",u="",d="";for(let f in n){let m=n[f];f[0]=="@"?f[1]=="i"?i=f+" "+m+";":u+=f[1]=="f"?Nr(m,f):f+"{"+Nr(m,f[1]=="k"?"":a)+"}":typeof m=="object"?u+=Nr(m,a?a.replace(/([^,])+/g,v=>f.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,g=>/&/.test(g)?g.replace(/&/g,v):v?v+" "+g:g)):f):m!=null&&(f=/^--/.test(f)?f:f.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=Nr.p?Nr.p(f,m):f+":"+m+";")}return i+(a&&d?a+"{"+d+"}":d)+u},Gt={},Wf=n=>{if(typeof n=="object"){let a="";for(let i in n)a+=i+Wf(n[i]);return a}return n},I0=(n,a,i,u,d)=>{let f=Wf(n),m=Gt[f]||(Gt[f]=(g=>{let w=0,h=11;for(;w>>0;return"go"+h})(f));if(!Gt[m]){let g=f!==n?n:(w=>{let h,y,N=[{}];for(;h=L0.exec(w.replace(R0,""));)h[4]?N.shift():h[3]?(y=h[3].replace(nf," ").trim(),N.unshift(N[0][y]=N[0][y]||{})):N[0][h[1]]=h[2].replace(nf," ").trim();return N[0]})(n);Gt[m]=Nr(d?{["@keyframes "+m]:g}:g,i?"":"."+m)}let v=i&&Gt.g?Gt.g:null;return i&&(Gt.g=Gt[m]),((g,w,h,y)=>{y?w.data=w.data.replace(y,g):w.data.indexOf(g)===-1&&(w.data=h?g+w.data:w.data+g)})(Gt[m],a,u,v),m},z0=(n,a,i)=>n.reduce((u,d,f)=>{let m=a[f];if(m&&m.call){let v=m(i),g=v&&v.props&&v.props.className||/^go/.test(v)&&v;m=g?"."+g:v&&typeof v=="object"?v.props?"":Nr(v,""):v===!1?"":v}return u+d+(m??"")},"");function ls(n){let a=this||{},i=n.call?n(a.p):n;return I0(i.unshift?i.raw?z0(i,[].slice.call(arguments,1),a.p):i.reduce((u,d)=>Object.assign(u,d&&d.call?d(a.p):d),{}):i,O0(a.target),a.g,a.o,a.k)}let Vf,jl,Nl;ls.bind({g:1});let Zt=ls.bind({k:1});function $0(n,a,i,u){Nr.p=a,Vf=n,jl=i,Nl=u}function Pr(n,a){let i=this||{};return function(){let u=arguments;function d(f,m){let v=Object.assign({},f),g=v.className||d.className;i.p=Object.assign({theme:jl&&jl()},v),i.o=/ *go\d+/.test(g),v.className=ls.apply(i,u)+(g?" "+g:"");let w=n;return n[0]&&(w=v.as||n,delete v.as),Nl&&w[0]&&Nl(v),Vf(w,v)}return d}}var A0=n=>typeof n=="function",es=(n,a)=>A0(n)?n(a):n,U0=(()=>{let n=0;return()=>(++n).toString()})(),qf=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let a=matchMedia("(prefers-reduced-motion: reduce)");n=!a||a.matches}return n}})(),F0=20,Fl="default",Qf=(n,a)=>{let{toastLimit:i}=n.settings;switch(a.type){case 0:return{...n,toasts:[a.toast,...n.toasts].slice(0,i)};case 1:return{...n,toasts:n.toasts.map(m=>m.id===a.toast.id?{...m,...a.toast}:m)};case 2:let{toast:u}=a;return Qf(n,{type:n.toasts.find(m=>m.id===u.id)?1:0,toast:u});case 3:let{toastId:d}=a;return{...n,toasts:n.toasts.map(m=>m.id===d||d===void 0?{...m,dismissed:!0,visible:!1}:m)};case 4:return a.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(m=>m.id!==a.toastId)};case 5:return{...n,pausedAt:a.time};case 6:let f=a.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(m=>({...m,pauseDuration:m.pauseDuration+f}))}}},Bo=[],Yf={toasts:[],pausedAt:void 0,settings:{toastLimit:F0}},Ft={},Xf=(n,a=Fl)=>{Ft[a]=Qf(Ft[a]||Yf,n),Bo.forEach(([i,u])=>{i===a&&u(Ft[a])})},Kf=n=>Object.keys(Ft).forEach(a=>Xf(n,a)),H0=n=>Object.keys(Ft).find(a=>Ft[a].toasts.some(i=>i.id===n)),us=(n=Fl)=>a=>{Xf(a,n)},B0={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},W0=(n={},a=Fl)=>{let[i,u]=C.useState(Ft[a]||Yf),d=C.useRef(Ft[a]);C.useEffect(()=>(d.current!==Ft[a]&&u(Ft[a]),Bo.push([a,u]),()=>{let m=Bo.findIndex(([v])=>v===a);m>-1&&Bo.splice(m,1)}),[a]);let f=i.toasts.map(m=>{var v,g,w;return{...n,...n[m.type],...m,removeDelay:m.removeDelay||((v=n[m.type])==null?void 0:v.removeDelay)||n?.removeDelay,duration:m.duration||((g=n[m.type])==null?void 0:g.duration)||n?.duration||B0[m.type],style:{...n.style,...(w=n[m.type])==null?void 0:w.style,...m.style}}});return{...i,toasts:f}},V0=(n,a="blank",i)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:a,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...i,id:i?.id||U0()}),Na=n=>(a,i)=>{let u=V0(a,n,i);return us(u.toasterId||H0(u.id))({type:2,toast:u}),u.id},We=(n,a)=>Na("blank")(n,a);We.error=Na("error");We.success=Na("success");We.loading=Na("loading");We.custom=Na("custom");We.dismiss=(n,a)=>{let i={type:3,toastId:n};a?us(a)(i):Kf(i)};We.dismissAll=n=>We.dismiss(void 0,n);We.remove=(n,a)=>{let i={type:4,toastId:n};a?us(a)(i):Kf(i)};We.removeAll=n=>We.remove(void 0,n);We.promise=(n,a,i)=>{let u=We.loading(a.loading,{...i,...i?.loading});return typeof n=="function"&&(n=n()),n.then(d=>{let f=a.success?es(a.success,d):void 0;return f?We.success(f,{id:u,...i,...i?.success}):We.dismiss(u),d}).catch(d=>{let f=a.error?es(a.error,d):void 0;f?We.error(f,{id:u,...i,...i?.error}):We.dismiss(u)}),n};var q0=1e3,Q0=(n,a="default")=>{let{toasts:i,pausedAt:u}=W0(n,a),d=C.useRef(new Map).current,f=C.useCallback((y,N=q0)=>{if(d.has(y))return;let O=setTimeout(()=>{d.delete(y),m({type:4,toastId:y})},N);d.set(y,O)},[]);C.useEffect(()=>{if(u)return;let y=Date.now(),N=i.map(O=>{if(O.duration===1/0)return;let $=(O.duration||0)+O.pauseDuration-(y-O.createdAt);if($<0){O.visible&&We.dismiss(O.id);return}return setTimeout(()=>We.dismiss(O.id,a),$)});return()=>{N.forEach(O=>O&&clearTimeout(O))}},[i,u,a]);let m=C.useCallback(us(a),[a]),v=C.useCallback(()=>{m({type:5,time:Date.now()})},[m]),g=C.useCallback((y,N)=>{m({type:1,toast:{id:y,height:N}})},[m]),w=C.useCallback(()=>{u&&m({type:6,time:Date.now()})},[u,m]),h=C.useCallback((y,N)=>{let{reverseOrder:O=!1,gutter:$=8,defaultPosition:z}=N||{},P=i.filter(k=>(k.position||z)===(y.position||z)&&k.height),W=P.findIndex(k=>k.id===y.id),_=P.filter((k,j)=>jk.visible).slice(...O?[_+1]:[0,_]).reduce((k,j)=>k+(j.height||0)+$,0)},[i]);return C.useEffect(()=>{i.forEach(y=>{if(y.dismissed)f(y.id,y.removeDelay);else{let N=d.get(y.id);N&&(clearTimeout(N),d.delete(y.id))}})},[i,f]),{toasts:i,handlers:{updateHeight:g,startPause:v,endPause:w,calculateOffset:h}}},Y0=Zt` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,X0=Zt` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,K0=Zt` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,G0=Pr("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${Y0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${X0} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${n=>n.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${K0} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,J0=Zt` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,Z0=Pr("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${n=>n.secondary||"#e0e0e0"}; border-right-color: ${n=>n.primary||"#616161"}; animation: ${J0} 1s linear infinite; `,eg=Zt` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,tg=Zt` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,rg=Pr("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${eg} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${tg} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${n=>n.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,ng=Pr("div")` position: absolute; `,ag=Pr("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,og=Zt` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,sg=Pr("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${og} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,ig=({toast:n})=>{let{icon:a,type:i,iconTheme:u}=n;return a!==void 0?typeof a=="string"?C.createElement(sg,null,a):a:i==="blank"?null:C.createElement(ag,null,C.createElement(Z0,{...u}),i!=="loading"&&C.createElement(ng,null,i==="error"?C.createElement(G0,{...u}):C.createElement(rg,{...u})))},lg=n=>` 0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,ug=n=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} `,cg="0%{opacity:0;} 100%{opacity:1;}",dg="0%{opacity:1;} 100%{opacity:0;}",fg=Pr("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,mg=Pr("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,pg=(n,a)=>{let i=n.includes("top")?1:-1,[u,d]=qf()?[cg,dg]:[lg(i),ug(i)];return{animation:a?`${Zt(u)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Zt(d)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},hg=C.memo(({toast:n,position:a,style:i,children:u})=>{let d=n.height?pg(n.position||a||"top-center",n.visible):{opacity:0},f=C.createElement(ig,{toast:n}),m=C.createElement(mg,{...n.ariaProps},es(n.message,n));return C.createElement(fg,{className:n.className,style:{...d,...i,...n.style}},typeof u=="function"?u({icon:f,message:m}):C.createElement(C.Fragment,null,f,m))});$0(C.createElement);var gg=({id:n,className:a,style:i,onHeightUpdate:u,children:d})=>{let f=C.useCallback(m=>{if(m){let v=()=>{let g=m.getBoundingClientRect().height;u(n,g)};v(),new MutationObserver(v).observe(m,{subtree:!0,childList:!0,characterData:!0})}},[n,u]);return C.createElement("div",{ref:f,className:a,style:i},d)},vg=(n,a)=>{let i=n.includes("top"),u=i?{top:0}:{bottom:0},d=n.includes("center")?{justifyContent:"center"}:n.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${a*(i?1:-1)}px)`,...u,...d}},yg=ls` z-index: 9999; > * { pointer-events: auto; } `,Ao=16,xg=({reverseOrder:n,position:a="top-center",toastOptions:i,gutter:u,children:d,toasterId:f,containerStyle:m,containerClassName:v})=>{let{toasts:g,handlers:w}=Q0(i,f);return C.createElement("div",{"data-rht-toaster":f||"",style:{position:"fixed",zIndex:9999,top:Ao,left:Ao,right:Ao,bottom:Ao,pointerEvents:"none",...m},className:v,onMouseEnter:w.startPause,onMouseLeave:w.endPause},g.map(h=>{let y=h.position||a,N=w.calculateOffset(h,{reverseOrder:n,gutter:u,defaultPosition:a}),O=vg(y,N);return C.createElement(gg,{id:h.id,key:h.id,onHeightUpdate:w.updateHeight,className:h.visible?yg:"",style:O},h.type==="custom"?es(h.message,h):d?d(h):C.createElement(hg,{toast:h,position:y}))}))},ue=We;/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wg=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jg=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,i,u)=>u?u.toUpperCase():i.toLowerCase()),af=n=>{const a=jg(n);return a.charAt(0).toUpperCase()+a.slice(1)},Gf=(...n)=>n.filter((a,i,u)=>!!a&&a.trim()!==""&&u.indexOf(a)===i).join(" ").trim(),Ng=n=>{for(const a in n)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var bg={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"};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kg=C.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:m,...v},g)=>C.createElement("svg",{ref:g,...bg,width:a,height:a,stroke:n,strokeWidth:u?Number(i)*24/Number(a):i,className:Gf("lucide",d),...!f&&!Ng(v)&&{"aria-hidden":"true"},...v},[...m.map(([w,h])=>C.createElement(w,h)),...Array.isArray(f)?f:[f]]));/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Se=(n,a)=>{const i=C.forwardRef(({className:u,...d},f)=>C.createElement(kg,{ref:f,iconNode:a,className:Gf(`lucide-${wg(af(n))}`,`lucide-${n}`,u),...d}));return i.displayName=af(n),i};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sg=[["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"}]],bl=Se("activity",Sg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _g=[["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"}]],_r=Se("calendar",_g);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cg=[["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"}]],Jf=Se("circle-alert",Cg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eg=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ts=Se("circle-check-big",Eg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tg=[["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"}]],of=Se("circle-x",Tg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pg=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],kl=Se("clipboard",Pg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dg=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bn=Se("clock",Dg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mg=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Og=Se("eye",Mg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lg=[["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"}]],cs=Se("file-text",Lg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rg=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ig=Se("funnel",Rg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zg=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],sf=Se("heart",zg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $g=[["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"}]],Hl=Se("lock",$g);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ag=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Zf=Se("log-out",Ag);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ug=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],ba=Se("mail",Ug);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fg=[["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"}]],Hg=Se("map-pin",Fg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bg=[["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"}]],Wg=Se("pen",Bg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vg=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Bl=Se("phone",Vg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lf=Se("plus",qg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qg=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wo=Se("search",Qg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yg=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Xg=Se("square-pen",Yg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kg=[["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"}]],Vo=Se("stethoscope",Kg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],em=Se("trash-2",Gg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jg=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],uf=Se("user-check",Jg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zg=[["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"}]],rs=Se("user-plus",Zg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ev=[["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"}]],Sn=Se("user",ev);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tv=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],qr=Se("users",tv);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sl=Se("x",rv),nv=()=>{const n=En(),a=i=>n.pathname===i;return s.jsx("header",{className:"bg-white shadow-lg border-b border-gray-200",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"flex items-center justify-between h-16",children:[s.jsxs(Kt,{to:"/",className:"flex items-center space-x-3",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 p-2 rounded-lg",children:s.jsx(Vo,{className:"h-6 w-6 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"MediConnect"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Sistema de Agendamento"})]})]}),s.jsxs("nav",{className:"hidden md:flex items-center space-x-1",children:[s.jsxs(Kt,{to:"/",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a("/")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[s.jsx(sf,{className:"w-4 h-4"}),s.jsx("span",{children:"Início"})]}),s.jsxs(Kt,{to:"/paciente",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a("/paciente")||a("/agendamento")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[s.jsx(Sn,{className:"w-4 h-4"}),s.jsx("span",{children:"Sou Paciente"})]}),s.jsxs(Kt,{to:"/login-secretaria",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a("/login-secretaria")||a("/secretaria")?"bg-gradient-to-r from-green-600 to-green-400 text-white":"text-gray-600 hover:text-green-600 hover:bg-green-50"}`,children:[s.jsx(kl,{className:"w-4 h-4"}),s.jsx("span",{children:" Menu da Secretaria"})]}),s.jsxs(Kt,{to:"/login-medico",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a("/login-medico")||a("/medico")?"bg-gradient-to-r from-indigo-600 to-indigo-400 text-white":"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50"}`,children:[s.jsx(Vo,{className:"w-4 h-4"}),s.jsx("span",{children:"Sou Médico"})]})]}),s.jsx("div",{className:"md:hidden",children:s.jsx("button",{className:"text-gray-600 hover:text-blue-600",children:s.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})]}),s.jsx("div",{className:"md:hidden border-t border-gray-200 py-3",children:s.jsxs("div",{className:"flex flex-col space-y-2",children:[s.jsxs(Kt,{to:"/",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a("/")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[s.jsx(sf,{className:"w-4 h-4"}),s.jsx("span",{children:"Início"})]}),s.jsxs(Kt,{to:"/paciente",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a("/paciente")||a("/agendamento")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[s.jsx(Sn,{className:"w-4 h-4"}),s.jsx("span",{children:"Sou Paciente"})]}),s.jsxs(Kt,{to:"/login-secretaria",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a("/login-secretaria")||a("/secretaria")?"bg-gradient-to-r from-green-600 to-green-400 text-white":"text-gray-600 hover:text-green-600 hover:bg-green-50"}`,children:[s.jsx(kl,{className:"w-4 h-4"}),s.jsx("span",{children:"Secretaria"})]}),s.jsxs(Kt,{to:"/login-medico",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a("/login-medico")||a("/medico")?"bg-gradient-to-r from-indigo-600 to-indigo-400 text-white":"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50"}`,children:[s.jsx(Vo,{className:"w-4 h-4"}),s.jsx("span",{children:"Sou Médico"})]})]})})]})})},Ke=[];for(let n=0;n<256;++n)Ke.push((n+256).toString(16).slice(1));function av(n,a=0){return(Ke[n[a+0]]+Ke[n[a+1]]+Ke[n[a+2]]+Ke[n[a+3]]+"-"+Ke[n[a+4]]+Ke[n[a+5]]+"-"+Ke[n[a+6]]+Ke[n[a+7]]+"-"+Ke[n[a+8]]+Ke[n[a+9]]+"-"+Ke[n[a+10]]+Ke[n[a+11]]+Ke[n[a+12]]+Ke[n[a+13]]+Ke[n[a+14]]+Ke[n[a+15]]).toLowerCase()}let hl;const ov=new Uint8Array(16);function sv(){if(!hl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");hl=crypto.getRandomValues.bind(crypto)}return hl(ov)}const iv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cf={randomUUID:iv};function lv(n,a,i){if(cf.randomUUID&&!n)return cf.randomUUID();n=n||{};const u=n.random??n.rng?.()??sv();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,av(u)}var qo={exports:{}};function uv(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Qo={exports:{}};const cv={},dv=Object.freeze(Object.defineProperty({__proto__:null,default:cv},Symbol.toStringTag,{value:"Module"})),fv=wh(dv);var mv=Qo.exports,df;function ka(){return df||(df=1,(function(n,a){(function(i,u){n.exports=u()})(mv,function(){var i=i||(function(u,d){var f;if(typeof window<"u"&&window.crypto&&(f=window.crypto),typeof self<"u"&&self.crypto&&(f=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(f=globalThis.crypto),!f&&typeof window<"u"&&window.msCrypto&&(f=window.msCrypto),!f&&typeof ll<"u"&&ll.crypto&&(f=ll.crypto),!f&&typeof uv=="function")try{f=fv}catch{}var m=function(){if(f){if(typeof f.getRandomValues=="function")try{return f.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof f.randomBytes=="function")try{return f.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},v=Object.create||(function(){function _(){}return function(k){var j;return _.prototype=k,j=new _,_.prototype=null,j}})(),g={},w=g.lib={},h=w.Base=(function(){return{extend:function(_){var k=v(this);return _&&k.mixIn(_),(!k.hasOwnProperty("init")||this.init===k.init)&&(k.init=function(){k.$super.init.apply(this,arguments)}),k.init.prototype=k,k.$super=this,k},create:function(){var _=this.extend();return _.init.apply(_,arguments),_},init:function(){},mixIn:function(_){for(var k in _)_.hasOwnProperty(k)&&(this[k]=_[k]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),y=w.WordArray=h.extend({init:function(_,k){_=this.words=_||[],k!=d?this.sigBytes=k:this.sigBytes=_.length*4},toString:function(_){return(_||O).stringify(this)},concat:function(_){var k=this.words,j=_.words,D=this.sigBytes,R=_.sigBytes;if(this.clamp(),D%4)for(var A=0;A>>2]>>>24-A%4*8&255;k[D+A>>>2]|=Q<<24-(D+A)%4*8}else for(var oe=0;oe>>2]=j[oe>>>2];return this.sigBytes+=R,this},clamp:function(){var _=this.words,k=this.sigBytes;_[k>>>2]&=4294967295<<32-k%4*8,_.length=u.ceil(k/4)},clone:function(){var _=h.clone.call(this);return _.words=this.words.slice(0),_},random:function(_){for(var k=[],j=0;j<_;j+=4)k.push(m());return new y.init(k,_)}}),N=g.enc={},O=N.Hex={stringify:function(_){for(var k=_.words,j=_.sigBytes,D=[],R=0;R>>2]>>>24-R%4*8&255;D.push((A>>>4).toString(16)),D.push((A&15).toString(16))}return D.join("")},parse:function(_){for(var k=_.length,j=[],D=0;D>>3]|=parseInt(_.substr(D,2),16)<<24-D%8*4;return new y.init(j,k/2)}},$=N.Latin1={stringify:function(_){for(var k=_.words,j=_.sigBytes,D=[],R=0;R>>2]>>>24-R%4*8&255;D.push(String.fromCharCode(A))}return D.join("")},parse:function(_){for(var k=_.length,j=[],D=0;D>>2]|=(_.charCodeAt(D)&255)<<24-D%4*8;return new y.init(j,k)}},z=N.Utf8={stringify:function(_){try{return decodeURIComponent(escape($.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(_){return $.parse(unescape(encodeURIComponent(_)))}},P=w.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(_){typeof _=="string"&&(_=z.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},_process:function(_){var k,j=this._data,D=j.words,R=j.sigBytes,A=this.blockSize,Q=A*4,oe=R/Q;_?oe=u.ceil(oe):oe=u.max((oe|0)-this._minBufferSize,0);var fe=oe*A,ce=u.min(fe*4,R);if(fe){for(var ie=0;ie>>2]>>>24-O%4*8&255,z=w[O+1>>>2]>>>24-(O+1)%4*8&255,P=w[O+2>>>2]>>>24-(O+2)%4*8&255,W=$<<16|z<<8|P,_=0;_<4&&O+_*.75>>6*(3-_)&63));var k=y.charAt(64);if(k)for(;N.length%4;)N.push(k);return N.join("")},parse:function(g){var w=g.length,h=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var N=0;N>>6-O%4*2,P=$|z;y[N>>>2]|=P<<24-N%4*8,N++}return f.create(y,N)}})(),i.enc.Base64})})(qo)),qo.exports}var gv=hv();const vv=ja(gv);var Yo={exports:{}},yv=Yo.exports,mf;function xv(){return mf||(mf=1,(function(n,a){(function(i,u){n.exports=u(ka())})(yv,function(i){return i.enc.Hex})})(Yo)),Yo.exports}var wv=xv();const jv=ja(wv);var Xo={exports:{}},Ko={exports:{}},Nv=Ko.exports,pf;function tm(){return pf||(pf=1,(function(n,a){(function(i,u){n.exports=u(ka())})(Nv,function(i){return(function(u){var d=i,f=d.lib,m=f.WordArray,v=f.Hasher,g=d.algo,w=[],h=[];(function(){function O(W){for(var _=u.sqrt(W),k=2;k<=_;k++)if(!(W%k))return!1;return!0}function $(W){return(W-(W|0))*4294967296|0}for(var z=2,P=0;P<64;)O(z)&&(P<8&&(w[P]=$(u.pow(z,1/2))),h[P]=$(u.pow(z,1/3)),P++),z++})();var y=[],N=g.SHA256=v.extend({_doReset:function(){this._hash=new m.init(w.slice(0))},_doProcessBlock:function(O,$){for(var z=this._hash.words,P=z[0],W=z[1],_=z[2],k=z[3],j=z[4],D=z[5],R=z[6],A=z[7],Q=0;Q<64;Q++){if(Q<16)y[Q]=O[$+Q]|0;else{var oe=y[Q-15],fe=(oe<<25|oe>>>7)^(oe<<14|oe>>>18)^oe>>>3,ce=y[Q-2],ie=(ce<<15|ce>>>17)^(ce<<13|ce>>>19)^ce>>>10;y[Q]=fe+y[Q-7]+ie+y[Q-16]}var pe=j&D^~j&R,X=P&W^P&_^W&_,re=(P<<30|P>>>2)^(P<<19|P>>>13)^(P<<10|P>>>22),le=(j<<26|j>>>6)^(j<<21|j>>>11)^(j<<7|j>>>25),E=A+le+pe+h[Q]+y[Q],F=re+X;A=R,R=D,D=j,j=k+E|0,k=_,_=W,W=P,P=E+F|0}z[0]=z[0]+P|0,z[1]=z[1]+W|0,z[2]=z[2]+_|0,z[3]=z[3]+k|0,z[4]=z[4]+j|0,z[5]=z[5]+D|0,z[6]=z[6]+R|0,z[7]=z[7]+A|0},_doFinalize:function(){var O=this._data,$=O.words,z=this._nDataBytes*8,P=O.sigBytes*8;return $[P>>>5]|=128<<24-P%32,$[(P+64>>>9<<4)+14]=u.floor(z/4294967296),$[(P+64>>>9<<4)+15]=z,O.sigBytes=$.length*4,this._process(),this._hash},clone:function(){var O=v.clone.call(this);return O._hash=this._hash.clone(),O}});d.SHA256=v._createHelper(N),d.HmacSHA256=v._createHmacHelper(N)})(Math),i.SHA256})})(Ko)),Ko.exports}var Go={exports:{}},bv=Go.exports,hf;function kv(){return hf||(hf=1,(function(n,a){(function(i,u){n.exports=u(ka())})(bv,function(i){(function(){var u=i,d=u.lib,f=d.Base,m=u.enc,v=m.Utf8,g=u.algo;g.HMAC=f.extend({init:function(w,h){w=this._hasher=new w.init,typeof h=="string"&&(h=v.parse(h));var y=w.blockSize,N=y*4;h.sigBytes>N&&(h=w.finalize(h)),h.clamp();for(var O=this._oKey=h.clone(),$=this._iKey=h.clone(),z=O.words,P=$.words,W=0;W`${gl(n)}=${_l(i)}`).join("&"):`${gl(n)}=${_l(a)}`:gl(n)}function Kv(n){return Object.keys(n).filter(a=>n[a]!==void 0).map(a=>Xv(a,n[a])).filter(Boolean).join("&")}const Gv=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Jv=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Zv=/^([/\\]\s*){2,}[^/\\]/,ey=/^\.?\//;function nm(n,a={}){return typeof a=="boolean"&&(a={acceptRelative:a}),a.strict?Gv.test(n):Jv.test(n)||(a.acceptRelative?Zv.test(n):!1)}function ty(n="",a){return n.endsWith("/")}function ry(n="",a){return(ty(n)?n.slice(0,-1):n)||"/"}function ny(n="",a){return n.endsWith("/")?n:n+"/"}function ay(n,a){if(sy(a)||nm(n))return n;const i=ry(a);return n.startsWith(i)?n:ly(i,n)}function oy(n,a){const i=uy(n),u={...Yv(i.search),...a};return i.search=Kv(u),cy(i)}function sy(n){return!n||n==="/"}function iy(n){return n&&n!=="/"}function ly(n,...a){let i=n||"";for(const u of a.filter(d=>iy(d)))if(i){const d=u.replace(ey,"");i=ny(i)+d}else i=u;return i}const am=Symbol.for("ufo:protocolRelative");function uy(n="",a){const i=n.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(i){const[,y,N=""]=i;return{protocol:y.toLowerCase(),pathname:N,href:y+N,auth:"",host:"",search:"",hash:""}}if(!nm(n,{acceptRelative:!0}))return vf(n);const[,u="",d,f=""]=n.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,m="",v=""]=f.match(/([^#/?]*)(.*)?/)||[];u==="file:"&&(v=v.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:g,search:w,hash:h}=vf(v);return{protocol:u.toLowerCase(),auth:d?d.slice(0,Math.max(0,d.length-1)):"",host:m,pathname:g,search:w,hash:h,[am]:!u}}function vf(n=""){const[a="",i="",u=""]=(n.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:a,search:i,hash:u}}function cy(n){const a=n.pathname||"",i=n.search?(n.search.startsWith("?")?"":"?")+n.search:"",u=n.hash||"",d=n.auth?n.auth+"@":"",f=n.host||"";return(n.protocol||n[am]?(n.protocol||"")+"//":"")+d+f+a+i+u}class dy extends Error{constructor(a,i){super(a,i),this.name="FetchError",i?.cause&&!this.cause&&(this.cause=i.cause)}}function fy(n){const a=n.error?.message||n.error?.toString()||"",i=n.request?.method||n.options?.method||"GET",u=n.request?.url||String(n.request)||"/",d=`[${i}] ${JSON.stringify(u)}`,f=n.response?`${n.response.status} ${n.response.statusText}`:"",m=`${d}: ${f}${a?` ${a}`:""}`,v=new dy(m,n.error?{cause:n.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(v,g,{get(){return n[g]}});for(const[g,w]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(v,g,{get(){return n.response&&n.response[w]}});return v}const my=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function yf(n="GET"){return my.has(n.toUpperCase())}function py(n){if(n===void 0)return!1;const a=typeof n;return a==="string"||a==="number"||a==="boolean"||a===null?!0:a!=="object"?!1:Array.isArray(n)?!0:n.buffer?!1:n.constructor&&n.constructor.name==="Object"||typeof n.toJSON=="function"}const hy=new Set(["image/svg","application/xml","application/xhtml","application/html"]),gy=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vy(n=""){if(!n)return"json";const a=n.split(";").shift()||"";return gy.test(a)?"json":hy.has(a)||a.startsWith("text/")?"text":"blob"}function yy(n,a,i,u){const d=xy(a?.headers??n?.headers,i?.headers,u);let f;return(i?.query||i?.params||a?.params||a?.query)&&(f={...i?.params,...i?.query,...a?.params,...a?.query}),{...i,...a,query:f,params:f,headers:d}}function xy(n,a,i){if(!a)return new i(n);const u=new i(a);if(n)for(const[d,f]of Symbol.iterator in n||Array.isArray(n)?n:new i(n))u.set(d,f);return u}async function Uo(n,a){if(a)if(Array.isArray(a))for(const i of a)await i(n);else await a(n)}const wy=new Set([408,409,425,429,500,502,503,504]),jy=new Set([101,204,205,304]);function om(n={}){const{fetch:a=globalThis.fetch,Headers:i=globalThis.Headers,AbortController:u=globalThis.AbortController}=n;async function d(v){const g=v.error&&v.error.name==="AbortError"&&!v.options.timeout||!1;if(v.options.retry!==!1&&!g){let h;typeof v.options.retry=="number"?h=v.options.retry:h=yf(v.options.method)?0:1;const y=v.response&&v.response.status||500;if(h>0&&(Array.isArray(v.options.retryStatusCodes)?v.options.retryStatusCodes.includes(y):wy.has(y))){const N=typeof v.options.retryDelay=="function"?v.options.retryDelay(v):v.options.retryDelay||0;return N>0&&await new Promise(O=>setTimeout(O,N)),f(v.request,{...v.options,retry:h-1})}}const w=fy(v);throw Error.captureStackTrace&&Error.captureStackTrace(w,f),w}const f=async function(g,w={}){const h={request:g,options:yy(g,w,n.defaults,i),response:void 0,error:void 0};h.options.method&&(h.options.method=h.options.method.toUpperCase()),h.options.onRequest&&await Uo(h,h.options.onRequest),typeof h.request=="string"&&(h.options.baseURL&&(h.request=ay(h.request,h.options.baseURL)),h.options.query&&(h.request=oy(h.request,h.options.query),delete h.options.query),"query"in h.options&&delete h.options.query,"params"in h.options&&delete h.options.params),h.options.body&&yf(h.options.method)&&(py(h.options.body)?(h.options.body=typeof h.options.body=="string"?h.options.body:JSON.stringify(h.options.body),h.options.headers=new i(h.options.headers||{}),h.options.headers.has("content-type")||h.options.headers.set("content-type","application/json"),h.options.headers.has("accept")||h.options.headers.set("accept","application/json")):("pipeTo"in h.options.body&&typeof h.options.body.pipeTo=="function"||typeof h.options.body.pipe=="function")&&("duplex"in h.options||(h.options.duplex="half")));let y;if(!h.options.signal&&h.options.timeout){const O=new u;y=setTimeout(()=>{const $=new Error("[TimeoutError]: The operation was aborted due to timeout");$.name="TimeoutError",$.code=23,O.abort($)},h.options.timeout),h.options.signal=O.signal}try{h.response=await a(h.request,h.options)}catch(O){return h.error=O,h.options.onRequestError&&await Uo(h,h.options.onRequestError),await d(h)}finally{y&&clearTimeout(y)}if((h.response.body||h.response._bodyInit)&&!jy.has(h.response.status)&&h.options.method!=="HEAD"){const O=(h.options.parseResponse?"json":h.options.responseType)||vy(h.response.headers.get("content-type")||"");switch(O){case"json":{const $=await h.response.text(),z=h.options.parseResponse||Iv;h.response._data=z($);break}case"stream":{h.response._data=h.response.body||h.response._bodyInit;break}default:h.response._data=await h.response[O]()}}return h.options.onResponse&&await Uo(h,h.options.onResponse),!h.options.ignoreResponseError&&h.response.status>=400&&h.response.status<600?(h.options.onResponseError&&await Uo(h,h.options.onResponseError),await d(h)):h.response},m=async function(g,w){return(await f(g,w))._data};return m.raw=f,m.native=(...v)=>a(...v),m.create=(v={},g={})=>om({...n,...g,defaults:{...n.defaults,...g.defaults,...v}}),m}const ns=(function(){if(typeof globalThis<"u")return globalThis;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")})(),Ny=ns.fetch?(...n)=>ns.fetch(...n):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),by=ns.Headers,ky=ns.AbortController,Sy=om({fetch:Ny,Headers:by,AbortController:ky});var _y=Object.defineProperty,Cy=Object.defineProperties,Ey=Object.getOwnPropertyDescriptors,xf=Object.getOwnPropertySymbols,Ty=Object.prototype.hasOwnProperty,Py=Object.prototype.propertyIsEnumerable,sm=n=>{throw TypeError(n)},wf=(n,a,i)=>a in n?_y(n,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[a]=i,Cl=(n,a)=>{for(var i in a||(a={}))Ty.call(a,i)&&wf(n,i,a[i]);if(xf)for(var i of xf(a))Py.call(a,i)&&wf(n,i,a[i]);return n},Dy=(n,a)=>Cy(n,Ey(a)),im=(n,a,i)=>a.has(n)||sm("Cannot "+i),Le=(n,a,i)=>(im(n,a,"read from private field"),i?i.call(n):a.get(n)),Yr=(n,a,i)=>a.has(n)?sm("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,i),Tn=(n,a,i,u)=>(im(n,a,"write to private field"),a.set(n,i),i),Ot=(n,a,i)=>new Promise((u,d)=>{var f=g=>{try{v(i.next(g))}catch(w){d(w)}},m=g=>{try{v(i.throw(g))}catch(w){d(w)}},v=g=>g.done?u(g.value):Promise.resolve(g.value).then(f,m);v((i=i.apply(n,a)).next())}),My="6QrJZ7pFCmBZAeIJF7IArvkCz+EtzA0RVcpHkiQIsQyhs7QtCS9P+CueZdHfB2OtJcgX3BbqY9pfpWeAVTqCwQ==";function jf(n){return encodeURIComponent(n).replace(/[!'()*]/g,a=>`%${a.charCodeAt(0).toString(16).toUpperCase()}`)}function Oy(n){return a=>{let{options:i}=a,u=Math.floor(Date.now()/1e3).toString(),d=Math.random().toString(36).substring(2,15),f=Cl({},i.query),m=Object.keys(f).sort().map($=>`${jf($)}=${jf(String(f[$]))}`).join("&"),v={"x-timestamp":u,"x-nonce":d},g=Object.keys(v).sort().map($=>`${$}:${v[$]}`).join(` `),w=i.body&&!(i.body instanceof FormData)?JSON.stringify(i.body):"",h=Pv(w).toString(jv),y=[m,g,h].join(` `);console.warn(`Client-side Canonical Request V3: `,y);let N=vv.stringify(Ev(y,n)),O=new Headers(i.headers);Object.entries(v).forEach(([$,z])=>{O.set($,z)}),O.set("X-Sign",N),i.headers=O}}function kt(n,a,i={}){return n.auth.accessToken&&(i.headers=Cl({Authorization:`Bearer ${n.auth.accessToken}`},i.headers)),Sy(a,Dy(Cl({baseURL:n.config.apiBaseUrl},i),{onRequest:Oy(My)}))}function Ly(){var n,a;return(a=(n=document.querySelector('link[rel="icon"]'))==null?void 0:n.href)!=null?a:null}function Ry(){var n;return(n=document.title)!=null?n:null}function Nf(n,a,i=localStorage){let u=i.getItem(n),d=a?JSON.stringify(a):null;d?i.setItem(n,d):i.removeItem(n),window.dispatchEvent(new StorageEvent("storage",{key:n,oldValue:u,newValue:d,storageArea:i}))}function bf(n,a=localStorage){let i=a.getItem(n);try{return i?JSON.parse(i):null}catch{return null}}var Jt,El,Iy=class{constructor(a){Yr(this,Jt),Yr(this,El,`lumi-auth-${lv()}`),Tn(this,Jt,a)}get accessToken(){return bf("lumi-access-token")}set accessToken(a){Nf("lumi-access-token",a)}get user(){return bf("lumi-user")}set user(a){Nf("lumi-user",a)}get isAuthenticated(){return!!this.accessToken}signIn(){let a=(window.screen.width-800)/2,i=(window.screen.height-600)/2,u=window.open(Le(this,Jt).config.authOrigin,Le(this,El),`width=800,height=600,left=${a},top=${i}`),d;return new Promise((f,m)=>{if(!u)return m(new Error("Open auth window failed"));let v=setInterval(()=>{u.closed&&m(new Error("Auth window closed"))},1e3),g=h=>{u.closed||(u.focus(),h.stopPropagation(),h.preventDefault())},w=({data:h,origin:y,source:N})=>{if(!(y!==Le(this,Jt).config.authOrigin||N!==u))switch(h?.type){case"lumi-ready":{u.postMessage({type:"lumi-init",data:{projectId:Le(this,Jt).config.projectId,icon:Ly(),title:Ry()}},Le(this,Jt).config.authOrigin);break}case"lumi-sign-in":{if(h.data.projectId!==Le(this,Jt).config.projectId)break;u.close(),window.focus(),this.accessToken=h.data.accessToken,this.user=h.data.user,f(h.data);break}}};window.addEventListener("message",w),document.addEventListener("click",g,!0),d=()=>{clearInterval(v),window.removeEventListener("message",w),document.removeEventListener("click",g,!0)}}).finally(()=>d?.())}signOut(){this.accessToken=null,this.user=null}refreshUser(){return Ot(this,null,function*(){let a=yield kt(Le(this,Jt),"/lm/user/info",{method:"POST"});if(a.code!==200)throw new Error(a.message);return this.user=a.data,a.data})}onAuthChange(a){let i=u=>{(u.key==="lumi-access-token"||u.key==="lumi-user"||u.key===null)&&a({isAuthenticated:this.isAuthenticated,user:this.user})};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i)}}};Jt=new WeakMap,El=new WeakMap;var bt,zy=class{constructor(n,a){Yr(this,bt),Tn(this,bt,n),this.entityName=a}list(){return Ot(this,arguments,function*({filter:n,sort:a,limit:i,skip:u}={}){if(i){let d=yield kt(Le(this,bt),this.uri("/find"),{method:"POST",body:{filter:n,sort:a,limit:i,skip:u}});if(d.code!==200)throw new Error(d.message);return d.data}else{let d=yield kt(Le(this,bt),this.uri("/list"),{method:"POST",body:{filter:n,sort:a}});if(d.code!==200)throw new Error(d.message);return{total:d.data.length,list:d.data}}})}get(n){return Ot(this,null,function*(){let a=yield kt(Le(this,bt),this.uri(`/${n}`),{method:"GET"});if(a.code!==200)throw new Error(a.message);return a.data})}create(n){return Ot(this,null,function*(){let a=yield kt(Le(this,bt),this.uri(),{method:"POST",body:n});if(a.code!==200)throw new Error(a.message);return a.data})}createMany(n){return Ot(this,null,function*(){let a=yield kt(Le(this,bt),this.uri("/batch"),{method:"POST",body:n});if(a.code!==200)throw new Error(a.message);return a.data})}update(n,a){return Ot(this,null,function*(){let i=yield kt(Le(this,bt),this.uri(),{method:"PUT",body:{filter:{_id:n},update:a}});if(i.code!==200)throw new Error(i.message);return i.data})}delete(n){return Ot(this,null,function*(){let a=yield kt(Le(this,bt),this.uri(`/${n}`),{method:"DELETE"});if(a.code!==200)throw new Error(a.message)})}deleteMany(n){return Ot(this,null,function*(){let a=yield kt(Le(this,bt),this.uri("/batch-by-ids"),{method:"DELETE",params:{ids:n}});if(a.code!==200)throw new Error(a.message)})}uri(n=""){return`/lm/${Le(this,bt).config.projectId}/${this.entityName}/documents${n}`}};bt=new WeakMap;var Jo,$y=class{constructor(a){return Yr(this,Jo),Tn(this,Jo,a),new Proxy(this,{get(i,u){return u in i||(i[u]=new zy(Le(i,Jo),u)),i[u]}})}};Jo=new WeakMap;var Tl=class extends Error{constructor(n,a){super(a),this.name="LumiError",this.code=n}},va,Ay=class{constructor(n){Yr(this,va),Tn(this,va,n)}send(n){return Ot(this,arguments,function*({to:a,subject:i,fromName:u,html:d,text:f="",replyTo:m,scheduledAt:v}){if(!a||!i||!d&&!f)throw new Error("Failed to send email: Missing required parameters.");typeof a=="string"&&(a=[a]),typeof m=="string"&&(m=[m]);let g=yield kt(Le(this,va),`/lm/${Le(this,va).config.projectId}/email/send`,{method:"POST",body:{to:a,subject:i,fromName:u,html:d,text:f,replyTo:m,scheduledAt:v}});if(g.code!==200)throw new Tl(g.code,g.message)})}};va=new WeakMap;var Wr,Uy=class{constructor(n){Yr(this,Wr),Tn(this,Wr,n)}upload(n){return Ot(this,null,function*(){let a=new FormData;n.forEach(u=>{a.append("files",u)});let i=yield kt(Le(this,Wr),`/lm/${Le(this,Wr).config.projectId}/file/batch`,{method:"POST",body:a});if(i.code!==200)throw new Tl(i.code,i.message);return i.data})}delete(n){return Ot(this,null,function*(){let a=yield kt(Le(this,Wr),`/lm/${Le(this,Wr).config.projectId}/file/batch`,{method:"DELETE",body:{fileUrls:n}});if(a.code!==200)throw new Tl(a.code,a.message)})}};Wr=new WeakMap;var Pl,Fy=class{constructor(n){Yr(this,Pl),Tn(this,Pl,n),this.email=new Ay(n),this.file=new Uy(n)}};Pl=new WeakMap;var Hy=class{constructor(a){this.config=a,this.auth=new Iy(this),this.entities=new $y(this),this.tools=new Fy(this)}};function By(n){return new Hy(n)}const Ae=By({projectId:"p355815126673022976",apiBaseUrl:"https://api.lumi.new",authOrigin:"https://auth.lumi.new"}),Wy=()=>{const[n,a]=C.useState({totalPacientes:0,totalMedicos:0,consultasHoje:0,consultasPendentes:0});return C.useEffect(()=>{(async()=>{try{const[u,d,f]=await Promise.all([Ae.entities.pacientes.list(),Ae.entities.medicos.list(),Ae.entities.consultas.list()]),m=new Date().toISOString().split("T")[0],v=f.list?.filter(w=>w.dataHora?.startsWith(m)).length||0,g=f.list?.filter(w=>w.status==="agendada"||w.status==="confirmada").length||0;a({totalPacientes:u.list?.length||0,totalMedicos:d.list?.length||0,consultasHoje:v,consultasPendentes:g})}catch(u){console.error("Erro ao carregar estatísticas:",u)}})()},[]),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"text-center py-12 bg-gradient-to-l from-blue-800 to-blue-500 text-white rounded-xl shadow-lg",children:[s.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Sistema de Agendamento Médico"}),s.jsx("p",{className:"text-xl opacity-90",children:"Gerencie consultas, pacientes e médicos de forma eficiente"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-gradient-to-l from-blue-700 to-blue-400 rounded-full",children:s.jsx(qr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total de Pacientes"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.totalPacientes})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-green-100 rounded-full",children:s.jsx(uf,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Médicos Ativos"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.totalMedicos})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-yellow-100 rounded-full",children:s.jsx(_r,{className:"w-6 h-6 text-yellow-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Hoje"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.consultasHoje})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-purple-100 rounded-full",children:s.jsx(bn,{className:"w-6 h-6 text-purple-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Pendentes"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.consultasPendentes})]})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsx("div",{className:"w-12 h-12 bg-gradient-to-l from-blue-700 to-blue-400 rounded-lg flex items-center justify-center mb-4",children:s.jsx(_r,{className:"w-6 h-6 text-white"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Agendar Consulta"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Interface para pacientes agendarem suas consultas médicas"}),s.jsx("a",{href:"/paciente",className:"btn-primary inline-block",children:"Acessar Agendamento"})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsx(uf,{className:"w-12 h-12 text-green-600 mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Painel do Médico"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Gerencie suas consultas, horários e informações dos pacientes"}),s.jsx("a",{href:"/login-medico",className:"btn-primary inline-block",children:"Acessar Painel"})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsx(qr,{className:"w-12 h-12 text-purple-600 mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Cadastro de Pacientes"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Área da secretaria para cadastrar e gerenciar pacientes"}),s.jsx("a",{href:"/login-secretaria",className:"btn-primary inline-block",children:"Acessar Cadastro"})]})]})]})},Vy=()=>{const[n,a]=C.useState({email:"",senha:""}),[i,u]=C.useState(!1),[d,f]=C.useState(!1),[m,v]=C.useState({nome:"",email:"",senha:"",confirmarSenha:"",telefone:"",cpf:"",dataNascimento:"",convenio:"",altura:"",peso:""}),g=Tr(),w=async y=>{y.preventDefault(),u(!0);try{const O=(await Ae.entities.pacientes.list({filter:{email:n.email,ativo:!0}})).list?.[0];if(!O){ue.error("Email não encontrado. Cadastre-se primeiro."),u(!1);return}O.senha===n.senha?(ue.success(`Bem-vindo(a), ${O.nome}!`),localStorage.setItem("pacienteLogado",JSON.stringify(O)),g("/acompanhamento")):ue.error("Senha incorreta")}catch(N){console.error("Erro no login:",N),ue.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}},h=async y=>{if(y.preventDefault(),m.senha!==m.confirmarSenha){ue.error("As senhas não coincidem");return}if(m.senha.length<6){ue.error("A senha deve ter pelo menos 6 caracteres");return}u(!0);try{const N=await Ae.entities.pacientes.list({filter:{email:m.email}});if(N.list&&N.list.length>0){ue.error("Este email já está cadastrado"),u(!1);return}const O=await Ae.entities.pacientes.create({nome:m.nome,email:m.email,senha:m.senha,telefone:m.telefone,cpf:m.cpf,dataNascimento:m.dataNascimento,convenio:m.convenio||"Particular",altura:m.altura?parseFloat(m.altura):void 0,peso:m.peso?parseFloat(m.peso):void 0,ativo:!0,criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()});ue.success("Cadastro realizado com sucesso!"),localStorage.setItem("pacienteLogado",JSON.stringify(O)),g("/acompanhamento")}catch(N){console.error("Erro no cadastro:",N),ue.error("Erro ao criar cadastro. Tente novamente.")}finally{u(!1)}};return s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-white flex items-center justify-center p-4",children:s.jsxs("div",{className:"max-w-md w-full",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(Sn,{className:"w-8 h-8 text-white"})}),s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:d?"Criar Conta":"Área do Paciente"}),s.jsx("p",{className:"text-gray-600",children:d?"Preencha seus dados para criar sua conta":"Faça login para acompanhar suas consultas"})]}),s.jsx("div",{className:"bg-white rounded-lg shadow-lg p-8",children:d?s.jsxs("form",{onSubmit:h,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Nome Completo"}),s.jsx("input",{type:"text",value:m.nome,onChange:y=>v(N=>({...N,nome:y.target.value})),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"CPF"}),s.jsx("input",{type:"text",value:m.cpf,onChange:y=>v(N=>({...N,cpf:y.target.value})),className:"form-input",placeholder:"000.000.000-00",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),s.jsx("input",{type:"email",value:m.email,onChange:y=>v(N=>({...N,email:y.target.value})),className:"form-input",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Senha"}),s.jsx("input",{type:"password",value:m.senha,onChange:y=>v(N=>({...N,senha:y.target.value})),className:"form-input",minLength:6,required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmar Senha"}),s.jsx("input",{type:"password",value:m.confirmarSenha,onChange:y=>v(N=>({...N,confirmarSenha:y.target.value})),className:"form-input",required:!0})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Telefone"}),s.jsx("input",{type:"tel",value:m.telefone,onChange:y=>v(N=>({...N,telefone:y.target.value})),className:"form-input",placeholder:"(11) 99999-9999",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Data de Nascimento"}),s.jsx("input",{type:"date",value:m.dataNascimento,onChange:y=>v(N=>({...N,dataNascimento:y.target.value})),className:"form-input",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Convênio"}),s.jsxs("select",{value:m.convenio,onChange:y=>v(N=>({...N,convenio:y.target.value})),className:"form-input",children:[s.jsx("option",{value:"",children:"Selecione"}),s.jsx("option",{value:"Particular",children:"Particular"}),s.jsx("option",{value:"Unimed",children:"Unimed"}),s.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),s.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),s.jsx("option",{value:"Amil",children:"Amil"}),s.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Altura (cm)"}),s.jsx("input",{type:"number",value:m.altura,onChange:y=>v(N=>({...N,altura:y.target.value})),className:"form-input",placeholder:"170",min:"50",max:"250"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Peso (kg)"}),s.jsx("input",{type:"number",value:m.peso,onChange:y=>v(N=>({...N,peso:y.target.value})),className:"form-input",placeholder:"70",min:"20",max:"300",step:"0.1"})]})]}),s.jsxs("div",{className:"flex space-x-4",children:[s.jsx("button",{type:"button",onClick:()=>f(!1),className:"flex-1 bg-gray-100 text-gray-700 py-3 px-4 rounded-lg font-medium hover:bg-gray-200 transition-colors",children:"Voltar"}),s.jsx("button",{type:"submit",disabled:i,className:"flex-1 bg-gradient-to-r from-blue-700 to-blue-400 text-white py-3 px-4 rounded-lg font-medium hover:from-blue-800 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Cadastrando...":"Cadastrar"})]})]}):s.jsxs("form",{onSubmit:w,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(ba,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"email",value:n.email,onChange:y=>a(N=>({...N,email:y.target.value})),className:"form-input pl-10",placeholder:"seu@email.com",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),s.jsxs("div",{className:"relative",children:[s.jsx(Hl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"password",value:n.senha,onChange:y=>a(N=>({...N,senha:y.target.value})),className:"form-input pl-10",placeholder:"Sua senha",required:!0})]})]}),s.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-blue-700 to-blue-400 text-white py-3 px-4 rounded-lg font-medium hover:from-blue-800 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Entrando...":"Entrar"}),s.jsx("div",{className:"text-center",children:s.jsx("button",{type:"button",onClick:()=>f(!0),className:"text-blue-600 hover:text-blue-800 text-sm font-medium",children:"Não tem conta? Cadastre-se aqui"})})]})})]})})},qy=()=>{const[n,a]=C.useState({email:"",senha:""}),[i,u]=C.useState(!1),d=Tr(),f={email:"secretaria@clinica.com",senha:"secretaria123"},m=async v=>{v.preventDefault(),u(!0);try{n.email===f.email&&n.senha===f.senha?(ue.success("Login realizado com sucesso!"),localStorage.setItem("secretariaLogada",JSON.stringify({nome:"Secretária",email:n.email,tipo:"secretaria"})),d("/painel-secretaria")):ue.error("Email ou senha incorretos")}catch(g){console.error("Erro no login:",g),ue.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}};return s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-green-50 to-white flex items-center justify-center p-4",children:s.jsxs("div",{className:"max-w-md w-full",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"bg-gradient-to-r from-green-600 to-green-400 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(kl,{className:"w-8 h-8 text-white"})}),s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Área da Secretaria"}),s.jsx("p",{className:"text-gray-600",children:"Faça login para acessar o sistema de gestão"})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-8",children:[s.jsxs("form",{onSubmit:m,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(ba,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"email",value:n.email,onChange:v=>a(g=>({...g,email:v.target.value})),className:"form-input pl-10",placeholder:"secretaria@clinica.com",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),s.jsxs("div",{className:"relative",children:[s.jsx(Hl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"password",value:n.senha,onChange:v=>a(g=>({...g,senha:v.target.value})),className:"form-input pl-10",placeholder:"Sua senha",required:!0})]})]}),s.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-green-600 to-green-400 text-white py-3 px-4 rounded-lg font-medium hover:from-green-700 hover:to-green-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Entrando...":"Entrar"})]}),s.jsxs("div",{className:"mt-6 p-4 bg-green-50 rounded-lg",children:[s.jsx("h3",{className:"text-sm font-medium text-green-800 mb-2",children:"Credenciais de Demonstração:"}),s.jsxs("div",{className:"text-sm text-green-700",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Email:"})," secretaria@clinica.com"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Senha:"})," secretaria123"]})]})]})]})]})})},Qy=()=>{const[n,a]=C.useState({email:"",senha:""}),[i,u]=C.useState(!1),d=Tr(),f=async m=>{m.preventDefault(),u(!0);try{const g=(await Ae.entities.medicos.list({filter:{email:n.email,ativo:!0}})).list?.[0];if(!g){ue.error("Email não encontrado"),u(!1);return}g.senha===n.senha?(ue.success(`Bem-vindo(a), Dr(a). ${g.nome}!`),localStorage.setItem("medicoLogado",JSON.stringify(g)),d("/painel-medico")):ue.error("Senha incorreta")}catch(v){console.error("Erro no login:",v),ue.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}};return s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-indigo-50 to-white flex items-center justify-center p-4",children:s.jsxs("div",{className:"max-w-md w-full",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(Vo,{className:"w-8 h-8 text-white"})}),s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Área do Médico"}),s.jsx("p",{className:"text-gray-600",children:"Faça login para acessar seu painel médico"})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-8",children:[s.jsxs("form",{onSubmit:f,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(ba,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"email",value:n.email,onChange:m=>a(v=>({...v,email:m.target.value})),className:"form-input pl-10",placeholder:"dr.medico@clinica.com",required:!0})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),s.jsxs("div",{className:"relative",children:[s.jsx(Hl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"password",value:n.senha,onChange:m=>a(v=>({...v,senha:m.target.value})),className:"form-input pl-10",placeholder:"Sua senha",required:!0})]})]}),s.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-indigo-600 to-indigo-400 text-white py-3 px-4 rounded-lg font-medium hover:from-indigo-700 hover:to-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Entrando...":"Entrar"})]}),s.jsxs("div",{className:"mt-6 p-4 bg-indigo-50 rounded-lg",children:[s.jsx("h3",{className:"text-sm font-medium text-indigo-800 mb-2",children:"Para Demonstração:"}),s.jsx("p",{className:"text-sm text-indigo-700",children:"Use as credenciais de qualquer médico cadastrado no sistema. Se não houver médicos cadastrados, acesse primeiro a área da secretaria para criar um."})]})]})]})})};function as(n){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},as(n)}function er(n){if(n===null||n===!0||n===!1)return NaN;var a=Number(n);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}function Re(n,a){if(a.length1?"s":"")+" required, but only "+a.length+" present")}function tt(n){Re(1,arguments);var a=Object.prototype.toString.call(n);return n instanceof Date||as(n)==="object"&&a==="[object Date]"?new Date(n.getTime()):typeof n=="number"||a==="[object Number]"?new Date(n):((typeof n=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Vl(n,a){Re(2,arguments);var i=tt(n),u=er(a);return isNaN(u)?new Date(NaN):(u&&i.setDate(i.getDate()+u),i)}function Yy(n,a){Re(2,arguments);var i=tt(n).getTime(),u=er(a);return new Date(i+u)}var Xy={};function ds(){return Xy}function Ky(n){var a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),n.getTime()-a.getTime()}function kf(n){Re(1,arguments);var a=tt(n);return a.setHours(0,0,0,0),a}var lm=6e4,um=36e5;function cm(n,a){Re(2,arguments);var i=kf(n),u=kf(a);return i.getTime()===u.getTime()}function Gy(n){return Re(1,arguments),n instanceof Date||as(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Jy(n){if(Re(1,arguments),!Gy(n)&&typeof n!="number")return!1;var a=tt(n);return!isNaN(Number(a))}function Zy(n,a){Re(2,arguments);var i=er(a);return Yy(n,-i)}var ex=864e5;function tx(n){Re(1,arguments);var a=tt(n),i=a.getTime();a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0);var u=a.getTime(),d=i-u;return Math.floor(d/ex)+1}function os(n){Re(1,arguments);var a=1,i=tt(n),u=i.getUTCDay(),d=(u=d.getTime()?i+1:a.getTime()>=m.getTime()?i:i-1}function rx(n){Re(1,arguments);var a=dm(n),i=new Date(0);i.setUTCFullYear(a,0,4),i.setUTCHours(0,0,0,0);var u=os(i);return u}var nx=6048e5;function ax(n){Re(1,arguments);var a=tt(n),i=os(a).getTime()-rx(a).getTime();return Math.round(i/nx)+1}function ss(n,a){var i,u,d,f,m,v,g,w;Re(1,arguments);var h=ds(),y=er((i=(u=(d=(f=a?.weekStartsOn)!==null&&f!==void 0?f:a==null||(m=a.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&d!==void 0?d:h.weekStartsOn)!==null&&u!==void 0?u:(g=h.locale)===null||g===void 0||(w=g.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&i!==void 0?i:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var N=tt(n),O=N.getUTCDay(),$=(O=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=new Date(0);$.setUTCFullYear(y+1,0,O),$.setUTCHours(0,0,0,0);var z=ss($,a),P=new Date(0);P.setUTCFullYear(y,0,O),P.setUTCHours(0,0,0,0);var W=ss(P,a);return h.getTime()>=z.getTime()?y+1:h.getTime()>=W.getTime()?y:y-1}function ox(n,a){var i,u,d,f,m,v,g,w;Re(1,arguments);var h=ds(),y=er((i=(u=(d=(f=a?.firstWeekContainsDate)!==null&&f!==void 0?f:a==null||(m=a.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:h.firstWeekContainsDate)!==null&&u!==void 0?u:(g=h.locale)===null||g===void 0||(w=g.options)===null||w===void 0?void 0:w.firstWeekContainsDate)!==null&&i!==void 0?i:1),N=fm(n,a),O=new Date(0);O.setUTCFullYear(N,0,y),O.setUTCHours(0,0,0,0);var $=ss(O,a);return $}var sx=6048e5;function ix(n,a){Re(1,arguments);var i=tt(n),u=ss(i,a).getTime()-ox(i,a).getTime();return Math.round(u/sx)+1}function Ne(n,a){for(var i=n<0?"-":"",u=Math.abs(n).toString();u.length0?u:1-u;return Ne(i==="yy"?d%100:d,i.length)},M:function(a,i){var u=a.getUTCMonth();return i==="M"?String(u+1):Ne(u+1,2)},d:function(a,i){return Ne(a.getUTCDate(),i.length)},a:function(a,i){var u=a.getUTCHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(a,i){return Ne(a.getUTCHours()%12||12,i.length)},H:function(a,i){return Ne(a.getUTCHours(),i.length)},m:function(a,i){return Ne(a.getUTCMinutes(),i.length)},s:function(a,i){return Ne(a.getUTCSeconds(),i.length)},S:function(a,i){var u=i.length,d=a.getUTCMilliseconds(),f=Math.floor(d*Math.pow(10,u-3));return Ne(f,i.length)}},Nn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lx={G:function(a,i,u){var d=a.getUTCFullYear()>0?1:0;switch(i){case"G":case"GG":case"GGG":return u.era(d,{width:"abbreviated"});case"GGGGG":return u.era(d,{width:"narrow"});case"GGGG":default:return u.era(d,{width:"wide"})}},y:function(a,i,u){if(i==="yo"){var d=a.getUTCFullYear(),f=d>0?d:1-d;return u.ordinalNumber(f,{unit:"year"})}return jr.y(a,i)},Y:function(a,i,u,d){var f=fm(a,d),m=f>0?f:1-f;if(i==="YY"){var v=m%100;return Ne(v,2)}return i==="Yo"?u.ordinalNumber(m,{unit:"year"}):Ne(m,i.length)},R:function(a,i){var u=dm(a);return Ne(u,i.length)},u:function(a,i){var u=a.getUTCFullYear();return Ne(u,i.length)},Q:function(a,i,u){var d=Math.ceil((a.getUTCMonth()+1)/3);switch(i){case"Q":return String(d);case"QQ":return Ne(d,2);case"Qo":return u.ordinalNumber(d,{unit:"quarter"});case"QQQ":return u.quarter(d,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(d,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(d,{width:"wide",context:"formatting"})}},q:function(a,i,u){var d=Math.ceil((a.getUTCMonth()+1)/3);switch(i){case"q":return String(d);case"qq":return Ne(d,2);case"qo":return u.ordinalNumber(d,{unit:"quarter"});case"qqq":return u.quarter(d,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(d,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(d,{width:"wide",context:"standalone"})}},M:function(a,i,u){var d=a.getUTCMonth();switch(i){case"M":case"MM":return jr.M(a,i);case"Mo":return u.ordinalNumber(d+1,{unit:"month"});case"MMM":return u.month(d,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(d,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(d,{width:"wide",context:"formatting"})}},L:function(a,i,u){var d=a.getUTCMonth();switch(i){case"L":return String(d+1);case"LL":return Ne(d+1,2);case"Lo":return u.ordinalNumber(d+1,{unit:"month"});case"LLL":return u.month(d,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(d,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(d,{width:"wide",context:"standalone"})}},w:function(a,i,u,d){var f=ix(a,d);return i==="wo"?u.ordinalNumber(f,{unit:"week"}):Ne(f,i.length)},I:function(a,i,u){var d=ax(a);return i==="Io"?u.ordinalNumber(d,{unit:"week"}):Ne(d,i.length)},d:function(a,i,u){return i==="do"?u.ordinalNumber(a.getUTCDate(),{unit:"date"}):jr.d(a,i)},D:function(a,i,u){var d=tx(a);return i==="Do"?u.ordinalNumber(d,{unit:"dayOfYear"}):Ne(d,i.length)},E:function(a,i,u){var d=a.getUTCDay();switch(i){case"E":case"EE":case"EEE":return u.day(d,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(d,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(d,{width:"short",context:"formatting"});case"EEEE":default:return u.day(d,{width:"wide",context:"formatting"})}},e:function(a,i,u,d){var f=a.getUTCDay(),m=(f-d.weekStartsOn+8)%7||7;switch(i){case"e":return String(m);case"ee":return Ne(m,2);case"eo":return u.ordinalNumber(m,{unit:"day"});case"eee":return u.day(f,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(f,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(f,{width:"short",context:"formatting"});case"eeee":default:return u.day(f,{width:"wide",context:"formatting"})}},c:function(a,i,u,d){var f=a.getUTCDay(),m=(f-d.weekStartsOn+8)%7||7;switch(i){case"c":return String(m);case"cc":return Ne(m,i.length);case"co":return u.ordinalNumber(m,{unit:"day"});case"ccc":return u.day(f,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(f,{width:"narrow",context:"standalone"});case"cccccc":return u.day(f,{width:"short",context:"standalone"});case"cccc":default:return u.day(f,{width:"wide",context:"standalone"})}},i:function(a,i,u){var d=a.getUTCDay(),f=d===0?7:d;switch(i){case"i":return String(f);case"ii":return Ne(f,i.length);case"io":return u.ordinalNumber(f,{unit:"day"});case"iii":return u.day(d,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(d,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(d,{width:"short",context:"formatting"});case"iiii":default:return u.day(d,{width:"wide",context:"formatting"})}},a:function(a,i,u){var d=a.getUTCHours(),f=d/12>=1?"pm":"am";switch(i){case"a":case"aa":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},b:function(a,i,u){var d=a.getUTCHours(),f;switch(d===12?f=Nn.noon:d===0?f=Nn.midnight:f=d/12>=1?"pm":"am",i){case"b":case"bb":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},B:function(a,i,u){var d=a.getUTCHours(),f;switch(d>=17?f=Nn.evening:d>=12?f=Nn.afternoon:d>=4?f=Nn.morning:f=Nn.night,i){case"B":case"BB":case"BBB":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},h:function(a,i,u){if(i==="ho"){var d=a.getUTCHours()%12;return d===0&&(d=12),u.ordinalNumber(d,{unit:"hour"})}return jr.h(a,i)},H:function(a,i,u){return i==="Ho"?u.ordinalNumber(a.getUTCHours(),{unit:"hour"}):jr.H(a,i)},K:function(a,i,u){var d=a.getUTCHours()%12;return i==="Ko"?u.ordinalNumber(d,{unit:"hour"}):Ne(d,i.length)},k:function(a,i,u){var d=a.getUTCHours();return d===0&&(d=24),i==="ko"?u.ordinalNumber(d,{unit:"hour"}):Ne(d,i.length)},m:function(a,i,u){return i==="mo"?u.ordinalNumber(a.getUTCMinutes(),{unit:"minute"}):jr.m(a,i)},s:function(a,i,u){return i==="so"?u.ordinalNumber(a.getUTCSeconds(),{unit:"second"}):jr.s(a,i)},S:function(a,i){return jr.S(a,i)},X:function(a,i,u,d){var f=d._originalDate||a,m=f.getTimezoneOffset();if(m===0)return"Z";switch(i){case"X":return _f(m);case"XXXX":case"XX":return Vr(m);case"XXXXX":case"XXX":default:return Vr(m,":")}},x:function(a,i,u,d){var f=d._originalDate||a,m=f.getTimezoneOffset();switch(i){case"x":return _f(m);case"xxxx":case"xx":return Vr(m);case"xxxxx":case"xxx":default:return Vr(m,":")}},O:function(a,i,u,d){var f=d._originalDate||a,m=f.getTimezoneOffset();switch(i){case"O":case"OO":case"OOO":return"GMT"+Sf(m,":");case"OOOO":default:return"GMT"+Vr(m,":")}},z:function(a,i,u,d){var f=d._originalDate||a,m=f.getTimezoneOffset();switch(i){case"z":case"zz":case"zzz":return"GMT"+Sf(m,":");case"zzzz":default:return"GMT"+Vr(m,":")}},t:function(a,i,u,d){var f=d._originalDate||a,m=Math.floor(f.getTime()/1e3);return Ne(m,i.length)},T:function(a,i,u,d){var f=d._originalDate||a,m=f.getTime();return Ne(m,i.length)}};function Sf(n,a){var i=n>0?"-":"+",u=Math.abs(n),d=Math.floor(u/60),f=u%60;if(f===0)return i+String(d);var m=a;return i+String(d)+m+Ne(f,2)}function _f(n,a){if(n%60===0){var i=n>0?"-":"+";return i+Ne(Math.abs(n)/60,2)}return Vr(n,a)}function Vr(n,a){var i=a||"",u=n>0?"-":"+",d=Math.abs(n),f=Ne(Math.floor(d/60),2),m=Ne(d%60,2);return u+f+i+m}var Cf=function(a,i){switch(a){case"P":return i.date({width:"short"});case"PP":return i.date({width:"medium"});case"PPP":return i.date({width:"long"});case"PPPP":default:return i.date({width:"full"})}},mm=function(a,i){switch(a){case"p":return i.time({width:"short"});case"pp":return i.time({width:"medium"});case"ppp":return i.time({width:"long"});case"pppp":default:return i.time({width:"full"})}},ux=function(a,i){var u=a.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return Cf(a,i);var m;switch(d){case"P":m=i.dateTime({width:"short"});break;case"PP":m=i.dateTime({width:"medium"});break;case"PPP":m=i.dateTime({width:"long"});break;case"PPPP":default:m=i.dateTime({width:"full"});break}return m.replace("{{date}}",Cf(d,i)).replace("{{time}}",mm(f,i))},cx={p:mm,P:ux},dx=["D","DD"],fx=["YY","YYYY"];function mx(n){return dx.indexOf(n)!==-1}function px(n){return fx.indexOf(n)!==-1}function Ef(n,a,i){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(a,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(a,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(a,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(a,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var hx={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"}},gx=function(a,i,u){var d,f=hx[a];return typeof f=="string"?d=f:i===1?d=f.one:d=f.other.replace("{{count}}",i.toString()),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"in "+d:d+" ago":d};function kn(n){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=a.width?String(a.width):n.defaultWidth,u=n.formats[i]||n.formats[n.defaultWidth];return u}}var vx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wx={date:kn({formats:vx,defaultWidth:"full"}),time:kn({formats:yx,defaultWidth:"full"}),dateTime:kn({formats:xx,defaultWidth:"full"})},jx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Nx=function(a,i,u,d){return jx[a]};function At(n){return function(a,i){var u=i!=null&&i.context?String(i.context):"standalone",d;if(u==="formatting"&&n.formattingValues){var f=n.defaultFormattingWidth||n.defaultWidth,m=i!=null&&i.width?String(i.width):f;d=n.formattingValues[m]||n.formattingValues[f]}else{var v=n.defaultWidth,g=i!=null&&i.width?String(i.width):n.defaultWidth;d=n.values[g]||n.values[v]}var w=n.argumentCallback?n.argumentCallback(a):a;return d[w]}}var bx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sx={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"]},_x={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"]},Cx={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"}},Ex={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"}},Tx=function(a,i){var u=Number(a),d=u%100;if(d>20||d<10)switch(d%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},Px={ordinalNumber:Tx,era:At({values:bx,defaultWidth:"wide"}),quarter:At({values:kx,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:At({values:Sx,defaultWidth:"wide"}),day:At({values:_x,defaultWidth:"wide"}),dayPeriod:At({values:Cx,defaultWidth:"wide",formattingValues:Ex,defaultFormattingWidth:"wide"})};function Ut(n){return function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=i.width,d=u&&n.matchPatterns[u]||n.matchPatterns[n.defaultMatchWidth],f=a.match(d);if(!f)return null;var m=f[0],v=u&&n.parsePatterns[u]||n.parsePatterns[n.defaultParseWidth],g=Array.isArray(v)?Mx(v,function(y){return y.test(m)}):Dx(v,function(y){return y.test(m)}),w;w=n.valueCallback?n.valueCallback(g):g,w=i.valueCallback?i.valueCallback(w):w;var h=a.slice(m.length);return{value:w,rest:h}}}function Dx(n,a){for(var i in n)if(n.hasOwnProperty(i)&&a(n[i]))return i}function Mx(n,a){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:{},u=a.match(n.matchPattern);if(!u)return null;var d=u[0],f=a.match(n.parsePattern);if(!f)return null;var m=n.valueCallback?n.valueCallback(f[0]):f[0];m=i.valueCallback?i.valueCallback(m):m;var v=a.slice(d.length);return{value:m,rest:v}}}var Ox=/^(\d+)(th|st|nd|rd)?/i,Lx=/\d+/i,Rx={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},Ix={any:[/^b/i,/^(a|c)/i]},zx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},Ax={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},Ux={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]},Fx={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},Hx={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]},Bx={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},Wx={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}},Vx={ordinalNumber:pm({matchPattern:Ox,parsePattern:Lx,valueCallback:function(a){return parseInt(a,10)}}),era:Ut({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),quarter:Ut({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:Ut({matchPatterns:Ax,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),day:Ut({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),dayPeriod:Ut({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Wx,defaultParseWidth:"any"})},qx={code:"en-US",formatDistance:gx,formatLong:wx,formatRelative:Nx,localize:Px,match:Vx,options:{weekStartsOn:0,firstWeekContainsDate:1}},Qx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Kx=/''/g,Gx=/[a-zA-Z]/;function at(n,a,i){var u,d,f,m,v,g,w,h,y,N,O,$,z,P,W,_,k,j;Re(2,arguments);var D=String(a),R=ds(),A=(u=(d=i?.locale)!==null&&d!==void 0?d:R.locale)!==null&&u!==void 0?u:qx,Q=er((f=(m=(v=(g=i?.firstWeekContainsDate)!==null&&g!==void 0?g:i==null||(w=i.locale)===null||w===void 0||(h=w.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&v!==void 0?v:R.firstWeekContainsDate)!==null&&m!==void 0?m:(y=R.locale)===null||y===void 0||(N=y.options)===null||N===void 0?void 0:N.firstWeekContainsDate)!==null&&f!==void 0?f:1);if(!(Q>=1&&Q<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var oe=er((O=($=(z=(P=i?.weekStartsOn)!==null&&P!==void 0?P:i==null||(W=i.locale)===null||W===void 0||(_=W.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&z!==void 0?z:R.weekStartsOn)!==null&&$!==void 0?$:(k=R.locale)===null||k===void 0||(j=k.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&O!==void 0?O:0);if(!(oe>=0&&oe<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!A.localize)throw new RangeError("locale must contain localize property");if(!A.formatLong)throw new RangeError("locale must contain formatLong property");var fe=tt(n);if(!Jy(fe))throw new RangeError("Invalid time value");var ce=Ky(fe),ie=Zy(fe,ce),pe={firstWeekContainsDate:Q,weekStartsOn:oe,locale:A,_originalDate:fe},X=D.match(Yx).map(function(re){var le=re[0];if(le==="p"||le==="P"){var E=cx[le];return E(re,A.formatLong)}return re}).join("").match(Qx).map(function(re){if(re==="''")return"'";var le=re[0];if(le==="'")return Jx(re);var E=lx[le];if(E)return!(i!=null&&i.useAdditionalWeekYearTokens)&&px(re)&&Ef(re,a,String(n)),!(i!=null&&i.useAdditionalDayOfYearTokens)&&mx(re)&&Ef(re,a,String(n)),E(ie,re,A.localize,pe);if(le.match(Gx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+le+"`");return re}).join("");return X}function Jx(n){var a=n.match(Xx);return a?a[1].replace(Kx,"'"):n}function Tf(n,a){Re(2,arguments);var i=tt(n),u=tt(a);return i.getTime()>u.getTime()}function Pf(n,a){Re(2,arguments);var i=tt(n),u=tt(a);return i.getTime()2)return a;if(/:/.test(i[0])?u=i[0]:(a.date=i[0],u=i[1],Fo.timeZoneDelimiter.test(a.date)&&(a.date=n.split(Fo.timeZoneDelimiter)[0],u=n.substr(a.date.length,n.length))),u){var d=Fo.timezone.exec(u);d?(a.time=u.replace(d[1],""),a.timezone=d[1]):a.time=u}return a}function a1(n,a){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+a)+"})|(\\d{2}|[+-]\\d{"+(2+a)+"})$)"),u=n.match(i);if(!u)return{year:NaN,restDateString:""};var d=u[1]?parseInt(u[1]):null,f=u[2]?parseInt(u[2]):null;return{year:f===null?d:f*100,restDateString:n.slice((u[1]||u[2]).length)}}function o1(n,a){if(a===null)return new Date(NaN);var i=n.match(e1);if(!i)return new Date(NaN);var u=!!i[4],d=ga(i[1]),f=ga(i[2])-1,m=ga(i[3]),v=ga(i[4]),g=ga(i[5])-1;if(u)return f1(a,v,g)?l1(a,v,g):new Date(NaN);var w=new Date(0);return!c1(a,f,m)||!d1(a,d)?new Date(NaN):(w.setUTCFullYear(a,f,Math.max(d,m)),w)}function ga(n){return n?parseInt(n):1}function s1(n){var a=n.match(t1);if(!a)return NaN;var i=vl(a[1]),u=vl(a[2]),d=vl(a[3]);return m1(i,u,d)?i*um+u*lm+d*1e3:NaN}function vl(n){return n&&parseFloat(n.replace(",","."))||0}function i1(n){if(n==="Z")return 0;var a=n.match(r1);if(!a)return 0;var i=a[1]==="+"?-1:1,u=parseInt(a[2]),d=a[3]&&parseInt(a[3])||0;return p1(u,d)?i*(u*um+d*lm):NaN}function l1(n,a,i){var u=new Date(0);u.setUTCFullYear(n,0,4);var d=u.getUTCDay()||7,f=(a-1)*7+i+1-d;return u.setUTCDate(u.getUTCDate()+f),u}var u1=[31,null,31,30,31,30,31,31,30,31,30,31];function hm(n){return n%400===0||n%4===0&&n%100!==0}function c1(n,a,i){return a>=0&&a<=11&&i>=1&&i<=(u1[a]||(hm(n)?29:28))}function d1(n,a){return a>=1&&a<=(hm(n)?366:365)}function f1(n,a,i){return a>=1&&a<=53&&i>=0&&i<=6}function m1(n,a,i){return n===24?a===0&&i===0:i>=0&&i<60&&a>=0&&a<60&&n>=0&&n<25}function p1(n,a){return a>=0&&a<=59}var h1={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},g1=function(a,i,u){var d,f=h1[a];return typeof f=="string"?d=f:i===1?d=f.one:d=f.other.replace("{{count}}",String(i)),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"em "+d:"há "+d:d},v1={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},y1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},x1={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},w1={date:kn({formats:v1,defaultWidth:"full"}),time:kn({formats:y1,defaultWidth:"full"}),dateTime:kn({formats:x1,defaultWidth:"full"})},j1={lastWeek:function(a){var i=a.getUTCDay(),u=i===0||i===6?"último":"última";return"'"+u+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},N1=function(a,i,u,d){var f=j1[a];return typeof f=="function"?f(i):f},b1={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},k1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},S1={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},_1={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},C1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},E1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},T1=function(a,i){var u=Number(a);return i?.unit==="week"?u+"ª":u+"º"},P1={ordinalNumber:T1,era:At({values:b1,defaultWidth:"wide"}),quarter:At({values:k1,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:At({values:S1,defaultWidth:"wide"}),day:At({values:_1,defaultWidth:"wide"}),dayPeriod:At({values:C1,defaultWidth:"wide",formattingValues:E1,defaultFormattingWidth:"wide"})},D1=/^(\d+)[ºªo]?/i,M1=/\d+/i,O1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},L1={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},R1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},I1={any:[/1/i,/2/i,/3/i,/4/i]},z1={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},$1={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,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},A1={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},U1={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},F1={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},H1={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},B1={ordinalNumber:pm({matchPattern:D1,parsePattern:M1,valueCallback:function(a){return parseInt(a,10)}}),era:Ut({matchPatterns:O1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:Ut({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:I1,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:Ut({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any"}),day:Ut({matchPatterns:A1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),dayPeriod:Ut({matchPatterns:F1,defaultMatchWidth:"any",parsePatterns:H1,defaultParseWidth:"any"})},kr={code:"pt-BR",formatDistance:g1,formatLong:w1,formatRelative:N1,localize:P1,match:B1,options:{weekStartsOn:0,firstWeekContainsDate:1}};const W1=()=>{const[n,a]=C.useState([]),[i,u]=C.useState(null),[d,f]=C.useState(!1),[m,v]=C.useState(1),[g,w]=C.useState({medicoId:"",data:"",horario:"",tipoConsulta:"primeira-vez",motivoConsulta:"",observacoes:""}),[h,y]=C.useState([]),N=Tr();C.useEffect(()=>{const R=localStorage.getItem("pacienteLogado");if(!R){N("/paciente");return}try{const A=JSON.parse(R);u(A),O()}catch(A){console.error("Erro ao carregar dados do paciente:",A),N("/paciente")}},[N]);const O=async()=>{try{const R=await Ae.entities.medicos.list({filter:{ativo:!0}});a(R.list||[])}catch(R){console.error("Erro ao carregar médicos:",R),ue.error("Erro ao carregar lista de médicos")}},$=async(R,A)=>{try{const Q=n.find(le=>le._id===R);if(!Q)return;const oe=new Date(A),fe=["domingo","segunda","terca","quarta","quinta","sexta","sabado"][oe.getDay()],ce=Q.horarioAtendimento[fe]||[],X=((await Ae.entities.consultas.list({filter:{medicoId:R,dataHora:{$regex:A.split("T")[0]}}})).list||[]).map(le=>new Date(le.dataHora).toTimeString().slice(0,5)),re=ce.filter(le=>!X.includes(le));y(re)}catch(Q){console.error("Erro ao buscar horários:",Q),ue.error("Erro ao carregar horários disponíveis")}},z=R=>{w(A=>({...A,medicoId:R,data:"",horario:""})),y([])},P=R=>{w(A=>({...A,data:R,horario:""})),g.medicoId&&R&&$(g.medicoId,R)},W=async()=>{if(i)try{f(!0);const R=new Date(`${g.data}T${g.horario}:00.000Z`);await Ae.entities.consultas.create({pacienteId:i._id,medicoId:g.medicoId,dataHora:R.toISOString(),status:"agendada",tipoConsulta:g.tipoConsulta,motivoConsulta:g.motivoConsulta,observacoes:g.observacoes,lembrete:!1,criadoPor:"paciente",criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()}),ue.success("Consulta agendada com sucesso!"),v(4)}catch(R){console.error("Erro ao agendar consulta:",R),ue.error("Erro ao agendar consulta. Tente novamente.")}finally{f(!1)}},_=()=>{w({medicoId:"",data:"",horario:"",tipoConsulta:"primeira-vez",motivoConsulta:"",observacoes:""}),y([]),v(1)},k=()=>{localStorage.removeItem("pacienteLogado"),N("/paciente")},j=()=>{const R=[];for(let A=1;A<=7;A++){const Q=Vl(new Date,A);R.push({valor:at(Q,"yyyy-MM-dd"),label:at(Q,"EEEE, dd/MM",{locale:kr})})}return R},D=n.find(R=>R._id===g.medicoId);return i?m===4?s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-8 text-center",children:[s.jsx(ts,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Consulta Agendada com Sucesso!"}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 mb-6 text-left",children:[s.jsx("h3",{className:"font-semibold mb-3",children:"Detalhes do Agendamento:"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Paciente:"})," ",i.nome]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Médico:"})," ",D?.nome]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Especialidade:"})," ",D?.especialidade]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Data:"})," ",at(new Date(g.data),"dd/MM/yyyy",{locale:kr})]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Horário:"})," ",g.horario]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Tipo:"})," ",g.tipoConsulta]}),g.motivoConsulta&&s.jsxs("p",{children:[s.jsx("strong",{children:"Motivo:"})," ",g.motivoConsulta]})]})]}),s.jsx("button",{onClick:_,className:"btn-primary",children:"Fazer Novo Agendamento"})]})}):s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 rounded-lg p-6 mb-8 text-white",children:s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold",children:["Bem-vindo(a), ",i.nome,"!"]}),s.jsx("p",{className:"opacity-90",children:"Agende sua consulta médica"})]}),s.jsxs("button",{onClick:k,className:"flex items-center space-x-2 bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:[s.jsx(Zf,{className:"w-4 h-4"}),s.jsx("span",{children:"Sair"})]})]})}),s.jsx("div",{className:"flex items-center justify-center mb-8",children:[1,2,3].map(R=>s.jsxs(ke.Fragment,{children:[s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${m>=R?"bg-blue-600 text-white":"bg-gray-300 text-gray-600"}`,children:R}),R<3&&s.jsx("div",{className:`w-16 h-1 ${m>R?"bg-blue-600":"bg-gray-300"}`})]},R))}),s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[m===1&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[s.jsx(Sn,{className:"w-5 h-5 mr-2"}),"Selecione o Médico"]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Médico/Especialidade"}),s.jsxs("select",{value:g.medicoId,onChange:R=>z(R.target.value),className:"form-input",required:!0,children:[s.jsx("option",{value:"",children:"Selecione um médico"}),n.map(R=>s.jsxs("option",{value:R._id,children:[R.nome," - ",R.especialidade," (R$ ",R.valorConsulta,")"]},R._id))]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{onClick:()=>v(2),disabled:!g.medicoId,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Próximo"})})]}),m===2&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[s.jsx(_r,{className:"w-5 h-5 mr-2"}),"Selecione Data e Horário"]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data da Consulta"}),s.jsxs("select",{value:g.data,onChange:R=>P(R.target.value),className:"form-input",required:!0,children:[s.jsx("option",{value:"",children:"Selecione uma data"}),j().map(R=>s.jsx("option",{value:R.valor,children:R.label},R.valor))]})]}),g.data&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Horário Disponível"}),h.length>0?s.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-3",children:h.map(R=>s.jsx("button",{onClick:()=>w(A=>({...A,horario:R})),className:`p-3 border rounded-lg text-center transition-colors ${g.horario===R?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:border-blue-300"}`,children:R},R))}):s.jsx("p",{className:"text-gray-500 text-center py-4",children:"Nenhum horário disponível para esta data"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{onClick:()=>v(1),className:"btn-secondary",children:"Voltar"}),s.jsx("button",{onClick:()=>v(3),disabled:!g.data||!g.horario,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Próximo"})]})]}),m===3&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[s.jsx(cs,{className:"w-5 h-5 mr-2"}),"Informações da Consulta"]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Tipo de Consulta"}),s.jsxs("select",{value:g.tipoConsulta,onChange:R=>w(A=>({...A,tipoConsulta:R.target.value})),className:"form-input",children:[s.jsx("option",{value:"primeira-vez",children:"Primeira Consulta"}),s.jsx("option",{value:"retorno",children:"Retorno"}),s.jsx("option",{value:"urgencia",children:"Urgência"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Motivo da Consulta"}),s.jsx("textarea",{value:g.motivoConsulta,onChange:R=>w(A=>({...A,motivoConsulta:R.target.value})),className:"form-input",rows:3,placeholder:"Descreva brevemente o motivo da consulta"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações (opcional)"}),s.jsx("textarea",{value:g.observacoes,onChange:R=>w(A=>({...A,observacoes:R.target.value})),className:"form-input",rows:2,placeholder:"Informações adicionais relevantes"})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("h3",{className:"font-semibold mb-3",children:"Resumo do Agendamento:"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Paciente:"})," ",i.nome]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Médico:"})," ",D?.nome]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Data:"})," ",at(new Date(g.data),"dd/MM/yyyy",{locale:kr})]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Horário:"})," ",g.horario]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Valor:"})," R$ ",D?.valorConsulta]})]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{onClick:()=>v(2),className:"btn-secondary",children:"Voltar"}),s.jsx("button",{onClick:W,disabled:d,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:d?"Agendando...":"Confirmar Agendamento"})]})]})]})]}):s.jsx("div",{className:"flex justify-center items-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})},V1=()=>{const[n,a]=C.useState([]),[i,u]=C.useState([]),[d,f]=C.useState(null),[m,v]=C.useState(!0),[g,w]=C.useState("todas"),[h,y]=C.useState("todos"),[N,O]=C.useState(null),[$,z]=C.useState(!1),P=Tr();C.useEffect(()=>{const X=localStorage.getItem("pacienteLogado");if(!X){P("/paciente");return}try{const re=JSON.parse(X);f(re),W(re._id),_()}catch(re){console.error("Erro ao carregar dados do paciente:",re),P("/paciente")}},[P]);const W=async X=>{try{const re=await Ae.entities.consultas.list({filter:{pacienteId:X},sort:{dataHora:-1}});a(re.list||[])}catch(re){console.error("Erro ao carregar consultas:",re),ue.error("Erro ao carregar suas consultas")}finally{v(!1)}},_=async()=>{try{const X=await Ae.entities.medicos.list({});u(X.list||[])}catch(X){console.error("Erro ao carregar médicos:",X)}},k=X=>{const re=i.find(le=>le._id===X);return re?re.nome:"Médico não encontrado"},j=X=>{const re=i.find(le=>le._id===X);return re?re.especialidade:""},D=X=>{switch(X){case"agendada":return"bg-blue-100 text-blue-800";case"confirmada":return"bg-green-100 text-green-800";case"realizada":return"bg-gray-100 text-gray-800";case"cancelada":return"bg-red-100 text-red-800";case"faltou":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}},R=X=>{switch(X){case"agendada":return s.jsx(bn,{className:"w-4 h-4"});case"confirmada":return s.jsx(ts,{className:"w-4 h-4"});case"realizada":return s.jsx(ts,{className:"w-4 h-4"});case"cancelada":return s.jsx(of,{className:"w-4 h-4"});case"faltou":return s.jsx(Jf,{className:"w-4 h-4"});default:return s.jsx(bn,{className:"w-4 h-4"})}},A=X=>{switch(X){case"agendada":return"Agendada";case"confirmada":return"Confirmada";case"realizada":return"Realizada";case"cancelada":return"Cancelada";case"faltou":return"Faltou";default:return X}},Q=()=>{let X=[...n];g!=="todas"&&(X=X.filter(le=>le.status===g));const re=new Date;switch(h){case"proximas":X=X.filter(E=>Tf(new Date(E.dataHora),re)&&(E.status==="agendada"||E.status==="confirmada"));break;case"hoje":X=X.filter(E=>Dl(new Date(E.dataHora)));break;case"semana":const le=Vl(re,7);X=X.filter(E=>Tf(new Date(E.dataHora),re)&&Pf(new Date(E.dataHora),le));break;case"historico":X=X.filter(E=>Pf(new Date(E.dataHora),re));break}return X},oe=X=>{O(X),z(!0)},fe=()=>{O(null),z(!1)},ce=()=>{P("/agendamento")},ie=()=>{localStorage.removeItem("pacienteLogado"),P("/paciente")};if(!d)return s.jsx("div",{className:"flex justify-center items-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})});const pe=Q();return s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 rounded-lg p-6 mb-8 text-white",children:s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold",children:["Olá, ",d.nome,"!"]}),s.jsx("p",{className:"opacity-90",children:"Acompanhe suas consultas e exames"})]}),s.jsxs("div",{className:"flex space-x-4",children:[s.jsx("button",{onClick:ce,className:"bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:"Nova Consulta"}),s.jsxs("button",{onClick:ie,className:"flex items-center space-x-2 bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:[s.jsx(Zf,{className:"w-4 h-4"}),s.jsx("span",{children:"Sair"})]})]})]})}),s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-4 mb-4",children:[s.jsx(Ig,{className:"w-5 h-5 text-gray-600"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Filtros"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Status"}),s.jsxs("select",{value:g,onChange:X=>w(X.target.value),className:"form-input",children:[s.jsx("option",{value:"todas",children:"Todas"}),s.jsx("option",{value:"agendada",children:"Agendadas"}),s.jsx("option",{value:"confirmada",children:"Confirmadas"}),s.jsx("option",{value:"realizada",children:"Realizadas"}),s.jsx("option",{value:"cancelada",children:"Canceladas"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Período"}),s.jsxs("select",{value:h,onChange:X=>y(X.target.value),className:"form-input",children:[s.jsx("option",{value:"todos",children:"Todos"}),s.jsx("option",{value:"proximas",children:"Próximas"}),s.jsx("option",{value:"hoje",children:"Hoje"}),s.jsx("option",{value:"semana",children:"Próximos 7 dias"}),s.jsx("option",{value:"historico",children:"Histórico"})]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow-md",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",children:s.jsxs("h2",{className:"text-xl font-semibold",children:["Suas Consultas (",pe.length,")"]})}),m?s.jsx("div",{className:"flex justify-center items-center p-8",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):pe.length===0?s.jsxs("div",{className:"text-center p-8",children:[s.jsx(_r,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Nenhuma consulta encontrada"}),s.jsx("p",{className:"text-gray-500 mb-4",children:g!=="todas"||h!=="todos"?"Tente ajustar os filtros para ver mais consultas.":"Você ainda não tem consultas agendadas."}),s.jsx("button",{onClick:ce,className:"btn-primary",children:"Agendar Primeira Consulta"})]}):s.jsx("div",{className:"divide-y divide-gray-200",children:pe.map(X=>s.jsx("div",{className:"p-6 hover:bg-gray-50 transition-colors",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center space-x-4 mb-2",children:[s.jsxs("span",{className:`inline-flex items-center space-x-1 px-2.5 py-0.5 rounded-full text-xs font-medium ${D(X.status)}`,children:[R(X.status),s.jsx("span",{children:A(X.status)})]}),s.jsx("span",{className:"text-sm text-gray-500",children:X.tipoConsulta})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Sn,{className:"w-4 h-4 text-gray-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:k(X.medicoId)}),s.jsx("p",{className:"text-sm text-gray-500",children:j(X.medicoId)})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(_r,{className:"w-4 h-4 text-gray-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:at(new Date(X.dataHora),"dd/MM/yyyy",{locale:kr})}),s.jsx("p",{className:"text-sm text-gray-500",children:at(new Date(X.dataHora),"EEEE",{locale:kr})})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(bn,{className:"w-4 h-4 text-gray-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:at(new Date(X.dataHora),"HH:mm")}),s.jsx("p",{className:"text-sm text-gray-500",children:X.motivoConsulta||"Consulta de rotina"})]})]})]})]}),s.jsx("button",{onClick:()=>oe(X),className:"ml-4 p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(Og,{className:"w-5 h-5"})})]})},X._id))})]}),$&&N&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:s.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",children:s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Detalhes da Consulta"}),s.jsx("button",{onClick:fe,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(of,{className:"w-5 h-5"})})]})}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-3",children:"Informações da Consulta"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Médico:"}),s.jsx("p",{className:"font-medium",children:k(N.medicoId)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Especialidade:"}),s.jsx("p",{className:"font-medium",children:j(N.medicoId)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Data:"}),s.jsx("p",{className:"font-medium",children:at(new Date(N.dataHora),"dd/MM/yyyy - HH:mm",{locale:kr})})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Status:"}),s.jsxs("span",{className:`inline-flex items-center space-x-1 px-2.5 py-0.5 rounded-full text-xs font-medium ${D(N.status)}`,children:[R(N.status),s.jsx("span",{children:A(N.status)})]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Tipo:"}),s.jsx("p",{className:"font-medium",children:N.tipoConsulta})]})]})]}),N.motivoConsulta&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Motivo da Consulta"}),s.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded-lg",children:N.motivoConsulta})]}),N.observacoes&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Observações"}),s.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded-lg",children:N.observacoes})]}),N.status==="realizada"&&N.resultados&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Resultados da Consulta"}),s.jsx("p",{className:"text-gray-700 bg-green-50 p-3 rounded-lg border-l-4 border-green-400",children:N.resultados})]}),N.prescricoes&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Prescrições Médicas"}),s.jsx("p",{className:"text-gray-700 bg-blue-50 p-3 rounded-lg border-l-4 border-blue-400",children:N.prescricoes})]}),N.proximaConsulta&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Próxima Consulta Recomendada"}),s.jsx("p",{className:"text-gray-700 bg-yellow-50 p-3 rounded-lg border-l-4 border-yellow-400",children:N.proximaConsulta})]}),s.jsxs("div",{className:"text-xs text-gray-500 pt-4 border-t",children:["Agendado em: ",at(new Date(N.criadoEm),"dd/MM/yyyy às HH:mm",{locale:kr})]})]})]})})]})},q1=()=>{const[n,a]=C.useState([]),[i,u]=C.useState(!0),[d,f]=C.useState(""),[m,v]=C.useState(!1),[g,w]=C.useState(null),[h,y]=C.useState({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""});C.useEffect(()=>{N()},[]);const N=async()=>{try{u(!0);const j=await Ae.entities.pacientes.list({filter:{ativo:!0},sort:{nome:1}});a(j.list||[])}catch(j){console.error("Erro ao carregar pacientes:",j),ue.error("Erro ao carregar lista de pacientes")}finally{u(!1)}},O=(j,D)=>{if(!j||!D)return null;const R=j/100;return(D/(R*R)).toFixed(1)},$=j=>j<18.5?{status:"Abaixo do peso",color:"text-blue-600"}:j<25?{status:"Peso normal",color:"text-green-600"}:j<30?{status:"Sobrepeso",color:"text-yellow-600"}:{status:"Obesidade",color:"text-red-600"},z=async j=>{j.preventDefault();try{u(!0);const D={...h,altura:h.altura?parseFloat(h.altura):void 0,peso:h.peso?parseFloat(h.peso):void 0,ativo:!0,criadoPor:"secretaria",criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()};g?(await Ae.entities.pacientes.update(g._id,{...D,atualizadoEm:new Date().toISOString()}),ue.success("Paciente atualizado com sucesso!")):(await Ae.entities.pacientes.create(D),ue.success("Paciente cadastrado com sucesso!")),P(),N()}catch(D){console.error("Erro ao salvar paciente:",D),ue.error("Erro ao salvar paciente. Tente novamente.")}finally{u(!1)}},P=()=>{y({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),w(null),v(!1)},W=j=>{y({nome:j.nome||"",cpf:j.cpf||"",telefone:j.telefone||"",email:j.email||"",dataNascimento:j.dataNascimento?j.dataNascimento.split("T")[0]:"",altura:j.altura?.toString()||"",peso:j.peso?.toString()||"",endereco:{rua:j.endereco?.rua||"",numero:j.endereco?.numero||"",bairro:j.endereco?.bairro||"",cidade:j.endereco?.cidade||"",cep:j.endereco?.cep||""},convenio:j.convenio||"",numeroCarteirinha:j.numeroCarteirinha||"",observacoes:j.observacoes||""}),w(j),v(!0)},_=async j=>{if(window.confirm("Tem certeza que deseja excluir este paciente?"))try{await Ae.entities.pacientes.update(j,{ativo:!1,atualizadoEm:new Date().toISOString()}),ue.success("Paciente removido com sucesso!"),N()}catch(D){console.error("Erro ao remover paciente:",D),ue.error("Erro ao remover paciente")}},k=n.filter(j=>(j.nome||"").toLowerCase().includes(d.toLowerCase())||(j.cpf||"").includes(d)||(j.telefone||"").includes(d));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Cadastro de Pacientes"}),s.jsx("p",{className:"text-gray-600",children:"Gerencie o cadastro de pacientes da clínica"})]}),s.jsxs("button",{onClick:()=>v(!0),className:"btn-primary mt-4 md:mt-0",children:[s.jsx(rs,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-gradient-to-l from-blue-700 to-blue-400 rounded-full",children:s.jsx(qr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total de Pacientes"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.length})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-green-100 rounded-full",children:s.jsx(cs,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Com Convênio"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(j=>j.convenio&&j.convenio!=="Particular").length})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-purple-100 rounded-full",children:s.jsx(rs,{className:"w-6 h-6 text-purple-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Cadastros Hoje"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(j=>{const D=new Date().toISOString().split("T")[0];return j.criadoEm?.startsWith(D)}).length})]})]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-3 bg-orange-100 rounded-full",children:s.jsx(bl,{className:"w-6 h-6 text-orange-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Com Dados Físicos"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(j=>j.altura&&j.peso).length})]})]})})]}),s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"relative",children:[s.jsx(Wo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),s.jsx("input",{type:"text",placeholder:"Buscar por nome, CPF ou telefone...",value:d,onChange:j=>f(j.target.value),className:"pl-10 form-input"})]})}),i?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):s.jsx("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gradient-to-l from-blue-700 to-blue-400",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Paciente"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Contato"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Dados Físicos"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Convênio"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Ações"})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:k.map(j=>{const D=O(j.altura,j.peso),R=D?$(parseFloat(D)):null;return s.jsxs("tr",{className:"hover:bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:j.nome||"Nome não informado"}),s.jsxs("div",{className:"text-sm text-gray-500",children:["CPF: ",j.cpf||"Não informado"]}),s.jsxs("div",{className:"text-sm text-gray-500",children:["Nascimento: ",j.dataNascimento?at(new Date(j.dataNascimento),"dd/MM/yyyy"):"Não informado"]})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[s.jsx(Bl,{className:"w-4 h-4 mr-2 text-gray-400"}),j.telefone||"Não informado"]}),s.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[s.jsx(ba,{className:"w-4 h-4 mr-2 text-gray-400"}),j.email||"Não informado"]}),s.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[s.jsx(Hg,{className:"w-4 h-4 mr-2 text-gray-400"}),j.endereco?.cidade||"Cidade não informada"]})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"space-y-1",children:[j.altura&&s.jsxs("div",{className:"text-sm text-gray-900",children:["Altura: ",j.altura," cm"]}),j.peso&&s.jsxs("div",{className:"text-sm text-gray-900",children:["Peso: ",j.peso," kg"]}),D&&R&&s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"IMC: "}),s.jsxs("span",{className:`font-medium ${R.color}`,children:[D," (",R.status,")"]})]}),!j.altura&&!j.peso&&s.jsx("div",{className:"text-sm text-gray-400",children:"Dados não informados"})]})}),s.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[s.jsx("div",{className:"text-sm text-gray-900",children:j.convenio||"Não informado"}),j.numeroCarteirinha&&s.jsxs("div",{className:"text-sm text-gray-500",children:["Carteirinha: ",j.numeroCarteirinha]})]}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:s.jsxs("div",{className:"flex space-x-2",children:[s.jsx("button",{onClick:()=>W(j),className:"text-blue-600 hover:text-blue-900",children:s.jsx(Xg,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>_(j._id),className:"text-red-600 hover:text-red-900",children:s.jsx(em,{className:"w-4 h-4"})})]})})]},j._id)})})]})})}),m&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:s.jsx("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:s.jsxs("div",{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-6",children:g?"Editar Paciente":"Novo Paciente"}),s.jsxs("form",{onSubmit:z,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo"}),s.jsx("input",{type:"text",value:h.nome,onChange:j=>y({...h,nome:j.target.value}),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CPF"}),s.jsx("input",{type:"text",value:h.cpf,onChange:j=>y({...h,cpf:j.target.value}),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone"}),s.jsx("input",{type:"tel",value:h.telefone,onChange:j=>y({...h,telefone:j.target.value}),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),s.jsx("input",{type:"email",value:h.email,onChange:j=>y({...h,email:j.target.value}),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data de Nascimento"}),s.jsx("input",{type:"date",value:h.dataNascimento,onChange:j=>y({...h,dataNascimento:j.target.value}),className:"form-input",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Altura (cm)"}),s.jsx("input",{type:"number",min:"50",max:"250",step:"0.1",value:h.altura,onChange:j=>y({...h,altura:j.target.value}),className:"form-input",placeholder:"Ex: 170"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Peso (kg)"}),s.jsx("input",{type:"number",min:"10",max:"300",step:"0.1",value:h.peso,onChange:j=>y({...h,peso:j.target.value}),className:"form-input",placeholder:"Ex: 70.5"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CEP"}),s.jsx("input",{type:"text",value:h.endereco.cep,onChange:j=>y({...h,endereco:{...h.endereco,cep:j.target.value}}),className:"form-input"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Rua"}),s.jsx("input",{type:"text",value:h.endereco.rua,onChange:j=>y({...h,endereco:{...h.endereco,rua:j.target.value}}),className:"form-input"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Número"}),s.jsx("input",{type:"text",value:h.endereco.numero,onChange:j=>y({...h,endereco:{...h.endereco,numero:j.target.value}}),className:"form-input"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bairro"}),s.jsx("input",{type:"text",value:h.endereco.bairro,onChange:j=>y({...h,endereco:{...h.endereco,bairro:j.target.value}}),className:"form-input"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cidade"}),s.jsx("input",{type:"text",value:h.endereco.cidade,onChange:j=>y({...h,endereco:{...h.endereco,cidade:j.target.value}}),className:"form-input"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Convênio"}),s.jsxs("select",{value:h.convenio,onChange:j=>y({...h,convenio:j.target.value}),className:"form-input",children:[s.jsx("option",{value:"",children:"Selecione"}),s.jsx("option",{value:"Particular",children:"Particular"}),s.jsx("option",{value:"Unimed",children:"Unimed"}),s.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),s.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),s.jsx("option",{value:"Amil",children:"Amil"}),s.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Número da Carteirinha"}),s.jsx("input",{type:"text",value:h.numeroCarteirinha,onChange:j=>y({...h,numeroCarteirinha:j.target.value}),className:"form-input"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações"}),s.jsx("textarea",{value:h.observacoes,onChange:j=>y({...h,observacoes:j.target.value}),className:"form-input",rows:3})]}),s.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[s.jsx("button",{type:"button",onClick:P,className:"btn-secondary",children:"Cancelar"}),s.jsx("button",{type:"submit",disabled:i,className:"btn-primary disabled:opacity-50",children:i?"Salvando...":g?"Atualizar":"Cadastrar"})]})]})]})})})]})},Q1=()=>{const[n,a]=C.useState([]),[i,u]=C.useState({}),[d,f]=C.useState([]),[m,v]=C.useState(""),[g,w]=C.useState("hoje"),[h,y]=C.useState(!0),[N,O]=C.useState(null);C.useEffect(()=>{$()},[]),C.useEffect(()=>{m&&z()},[m,g]);const $=async()=>{try{const D=await Ae.entities.medicos.list({filter:{ativo:!0}});f(D.list||[]),D.list&&D.list.length>0&&v(D.list[0]._id)}catch(D){console.error("Erro ao carregar médicos:",D),ue.error("Erro ao carregar lista de médicos")}},z=async()=>{try{y(!0);let D={};const R=new Date,A=new Date(R);if(A.setDate(R.getDate()+1),g==="hoje")D={dataHora:{$regex:at(R,"yyyy-MM-dd")}};else if(g==="amanha")D={dataHora:{$regex:at(A,"yyyy-MM-dd")}};else if(g==="semana"){const ie=new Date(R);ie.setDate(R.getDate()-R.getDay());const pe=new Date(ie);pe.setDate(ie.getDate()+6),D={dataHora:{$gte:ie.toISOString(),$lte:pe.toISOString()}}}const oe=(await Ae.entities.consultas.list({filter:{medicoId:m,...D},sort:{dataHora:1}})).list||[];a(oe);const fe=[...new Set(oe.map(ie=>ie.pacienteId))],ce={};for(const ie of fe)try{const pe=await Ae.entities.pacientes.get(ie);pe&&(ce[ie]=pe)}catch(pe){console.error(`Erro ao carregar paciente ${ie}:`,pe)}u(ce)}catch(D){console.error("Erro ao carregar consultas:",D),ue.error("Erro ao carregar consultas")}finally{y(!1)}},P=async(D,R)=>{try{await Ae.entities.consultas.update(D,{status:R,atualizadoEm:new Date().toISOString()}),a(A=>A.map(Q=>Q._id===D?{...Q,status:R}:Q)),ue.success("Status da consulta atualizado")}catch(A){console.error("Erro ao atualizar status:",A),ue.error("Erro ao atualizar status da consulta")}},W=async(D,R)=>{try{await Ae.entities.consultas.update(D,{observacoes:R,atualizadoEm:new Date().toISOString()}),a(A=>A.map(Q=>Q._id===D?{...Q,observacoes:R}:Q)),ue.success("Observação adicionada"),O(null)}catch(A){console.error("Erro ao adicionar observação:",A),ue.error("Erro ao adicionar observação")}},_=D=>({agendada:"bg-yellow-100 text-yellow-800",confirmada:"bg-gradient-to-l from-blue-700 to-blue-400 text-white",realizada:"bg-green-100 text-green-800",cancelada:"bg-red-100 text-red-800",faltou:"bg-gray-100 text-gray-800"})[D]||"bg-gray-100 text-gray-800",k=D=>{const R=Df(D);return Dl(R)?`Hoje, ${at(R,"HH:mm")}`:Zx(R)?`Amanhã, ${at(R,"HH:mm")}`:at(R,"dd/MM/yyyy, HH:mm",{locale:kr})},j=d.find(D=>D._id===m);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Painel do Médico"}),s.jsx("p",{className:"text-gray-600",children:"Gerencie suas consultas e agenda"})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mt-4 md:mt-0",children:[s.jsxs("select",{value:m,onChange:D=>v(D.target.value),className:"form-input",children:[s.jsx("option",{value:"",children:"Selecione um médico"}),d.map(D=>s.jsxs("option",{value:D._id,children:[D.nome," - ",D.especialidade]},D._id))]}),s.jsxs("select",{value:g,onChange:D=>w(D.target.value),className:"form-input",children:[s.jsx("option",{value:"hoje",children:"Hoje"}),s.jsx("option",{value:"amanha",children:"Amanhã"}),s.jsx("option",{value:"semana",children:"Esta Semana"}),s.jsx("option",{value:"todas",children:"Todas"})]})]})]}),j&&s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-4",children:["Dr(a). ",j.nome," - ",j.especialidade]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsx("div",{className:"bg-gradient-to-l from-blue-600 to-blue-400 rounded-lg p-4 text-white",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(_r,{className:"w-6 h-6 mr-2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm opacity-90",children:"Consultas Hoje"}),s.jsx("p",{className:"text-2xl font-bold",children:n.filter(D=>Dl(Df(D.dataHora))).length})]})]})}),s.jsx("div",{className:"bg-green-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(ts,{className:"w-6 h-6 text-green-600 mr-2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Realizadas"}),s.jsx("p",{className:"text-2xl font-bold text-green-600",children:n.filter(D=>D.status==="realizada").length})]})]})}),s.jsx("div",{className:"bg-yellow-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(bn,{className:"w-6 h-6 text-yellow-600 mr-2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Pendentes"}),s.jsx("p",{className:"text-2xl font-bold text-yellow-600",children:n.filter(D=>D.status==="agendada"||D.status==="confirmada").length})]})]})})]})]}),h?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):n.length>0?s.jsx("div",{className:"space-y-4",children:n.map(D=>{const R=i[D.pacienteId];return s.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center space-x-4 mb-3",children:[s.jsx("h3",{className:"text-lg font-semibold",children:R?.nome||"Paciente não encontrado"}),s.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${_(D.status)}`,children:D.status})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(bn,{className:"w-4 h-4 mr-2"}),k(D.dataHora)]}),R?.telefone&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bl,{className:"w-4 h-4 mr-2"}),R.telefone]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(Sn,{className:"w-4 h-4 mr-2"}),D.tipoConsulta]}),R?.convenio&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(cs,{className:"w-4 h-4 mr-2"}),R.convenio]})]}),D.motivoConsulta&&s.jsx("div",{className:"mt-3",children:s.jsxs("p",{className:"text-sm text-gray-700",children:[s.jsx("strong",{children:"Motivo:"})," ",D.motivoConsulta]})}),D.observacoes&&s.jsx("div",{className:"mt-2",children:s.jsxs("p",{className:"text-sm text-gray-700",children:[s.jsx("strong",{children:"Observações:"})," ",D.observacoes]})})]}),s.jsxs("div",{className:"flex flex-col space-y-2 mt-4 md:mt-0 md:ml-4",children:[D.status==="agendada"&&s.jsx("button",{onClick:()=>P(D._id,"confirmada"),className:"btn-primary text-sm",children:"Confirmar"}),(D.status==="confirmada"||D.status==="agendada")&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>P(D._id,"realizada"),className:"bg-green-600 text-white px-3 py-1 rounded text-sm hover:bg-green-700",children:"Realizada"}),s.jsx("button",{onClick:()=>P(D._id,"faltou"),className:"bg-gray-600 text-white px-3 py-1 rounded text-sm hover:bg-gray-700",children:"Faltou"}),s.jsx("button",{onClick:()=>P(D._id,"cancelada"),className:"bg-red-600 text-white px-3 py-1 rounded text-sm hover:bg-red-700",children:"Cancelar"})]}),s.jsx("button",{onClick:()=>O(D),className:"btn-secondary text-sm",children:"Observações"})]})]})},D._id)})}):s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-12 text-center",children:[s.jsx(Jf,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Nenhuma consulta encontrada"}),s.jsx("p",{className:"text-gray-600",children:"Não há consultas agendadas para o período selecionado."})]}),N&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Observações da Consulta"}),s.jsx("button",{onClick:()=>O(null),className:"text-gray-400 hover:text-gray-600",children:s.jsx(Sl,{className:"w-5 h-5"})})]}),s.jsxs("form",{onSubmit:D=>{D.preventDefault();const A=new FormData(D.currentTarget).get("observacao");W(N._id,A)},children:[s.jsx("textarea",{name:"observacao",defaultValue:N.observacoes,className:"form-input",rows:4,placeholder:"Digite suas observações sobre a consulta..."}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-4",children:[s.jsx("button",{type:"button",onClick:()=>O(null),className:"btn-secondary",children:"Cancelar"}),s.jsx("button",{type:"submit",className:"btn-primary",children:"Salvar"})]})]})]})})]})},Ho="https://mock.apidog.com/m1/1053378-0-default/pacientes",Y1=()=>{const[n,a]=C.useState("dashboard"),[i,u]=C.useState([]),[d,f]=C.useState([]),[m,v]=C.useState([]),[g,w]=C.useState(!0),[h,y]=C.useState(""),[N,O]=C.useState(!1),[$,z]=C.useState(!1),[P,W]=C.useState(null),_=Tr(),[k,j]=C.useState({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),[D,R]=C.useState({nome:"",especialidade:"",crm:"",telefone:"",email:"",senha:""});C.useEffect(()=>{if(!localStorage.getItem("secretariaLogada")){_("/secretaria");return}A()},[_]);const A=async()=>{try{w(!0);const F=await(await fetch(Ho)).json();u(Array.isArray(F.data)?F.data:Array.isArray(F)?F:[])}catch(E){console.error("Erro ao carregar dados:",E),ue.error("Erro ao carregar dados do sistema")}finally{w(!1)}},Q=()=>{localStorage.removeItem("secretariaLogada"),ue.success("Logout realizado com sucesso!"),_("/secretaria")},oe=()=>{W(null),j({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),O(!0),a("pacientes")},fe=E=>{W(E),j({nome:E.nome||"",cpf:E.cpf||"",telefone:E.telefone||"",email:E.email||"",dataNascimento:E.dataNascimento?E.dataNascimento.split("T")[0]:"",altura:E.altura!==void 0?String(E.altura):"",peso:E.peso!==void 0?String(E.peso):"",endereco:{rua:E.endereco?.rua||"",numero:E.endereco?.numero||"",bairro:E.endereco?.bairro||"",cidade:E.endereco?.cidade||"",cep:E.endereco?.cep||""},convenio:E.convenio||"",numeroCarteirinha:E.numeroCarteirinha||"",observacoes:E.observacoes||""}),O(!0),a("pacientes")},ce=()=>{j({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),W(null),O(!1)},ie=()=>{R({nome:"",especialidade:"",crm:"",telefone:"",email:"",senha:""}),z(!1)},pe=async E=>{E.preventDefault();try{w(!0);const F={nome:k.nome,cpf:k.cpf,data_nascimento:k.dataNascimento,telefone:k.telefone,email:k.email,altura:k.altura?Number(k.altura):void 0,peso:k.peso?Number(k.peso):void 0,endereco:k.endereco,convenio:k.convenio,numeroCarteirinha:k.numeroCarteirinha,observacoes:k.observacoes};if(P&&P._id){const J=await fetch(`${Ho}/${P._id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)});if(!J.ok)throw new Error("Erro ao atualizar paciente na API");const Y=await J.json();u(T=>T.map(U=>U._id===P._id?Y||{...U,...F}:U)),ue.success("Paciente atualizado com sucesso!")}else{const J=await fetch(Ho,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)});if(!J.ok)throw new Error("Erro ao cadastrar paciente na API");const Y=await J.json(),T=Y?.data||Y||F;u(U=>[...U,T]),ue.success("Paciente cadastrado com sucesso!")}ce()}catch(F){console.error("Erro ao cadastrar/atualizar paciente:",F),ue.error("Erro ao salvar paciente. Tente novamente.")}finally{w(!1)}},X=async E=>{if(window.confirm(`Você tem certeza que deseja remover ${E.nome}? Essa ação não pode ser desfeita.`))try{w(!0);const J=await fetch(`${Ho}/${E._id}`,{method:"DELETE"});if(J.ok)u(Y=>Y.filter(T=>T._id!==E._id)),ue.success("Paciente removido com sucesso!");else{const Y=await J.text();throw console.error("Erro ao remover paciente:",Y),new Error("Erro ao remover paciente")}}catch(J){console.error("Erro ao remover paciente:",J),ue.error("Não foi possível remover o paciente. Tente novamente.")}finally{w(!1)}},re=E=>{if(!E)return"Não informado";try{return new Date(E).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return E}},le=i.filter(E=>(E.nome||"").toLowerCase().includes(h.toLowerCase())||(E.email||"").toLowerCase().includes(h.toLowerCase())||(E.telefone||"").toLowerCase().includes(h.toLowerCase()));return g&&!N&&!$?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-green-600 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-600",children:"Carregando painel da secretária..."})]})}):s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("div",{className:"bg-white shadow-sm border-b",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center py-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Painel da Secretária"}),s.jsx("p",{className:"text-gray-600",children:"Sistema de Gestão Médica"})]}),s.jsxs("div",{className:"flex space-x-3",children:[s.jsxs("button",{onClick:oe,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors flex items-center",children:[s.jsx(lf,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]}),s.jsxs("button",{onClick:()=>{z(!0),a("medicos")},className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors flex items-center",children:[s.jsx(rs,{className:"w-5 h-5 mr-2"}),"Novo Médico"]}),s.jsx("button",{onClick:Q,className:"bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors",children:"Sair"})]})]})})}),s.jsx("div",{className:"bg-white border-b",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsx("nav",{className:"flex space-x-8",children:[{id:"dashboard",label:"Dashboard",icon:bl},{id:"pacientes",label:"Pacientes",icon:qr},{id:"medicos",label:"Médicos",icon:qr},{id:"consultas",label:"Consultas",icon:_r},{id:"relatorios",label:"Relatórios",icon:cs}].map(E=>{const F=E.icon;return s.jsxs("button",{onClick:()=>a(E.id),className:`flex items-center px-3 py-4 border-b-2 font-medium text-sm ${n===E.id?"border-green-500 text-green-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[s.jsx(F,{className:"w-5 h-5 mr-2"}),E.label]},E.id)})})})}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[n==="dashboard"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[s.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(qr,{className:"w-8 h-8 text-blue-600"}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Pacientes"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:i.length})]})]})}),s.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(qr,{className:"w-8 h-8 text-green-600"}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Médicos"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:d.length})]})]})}),s.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(_r,{className:"w-8 h-8 text-purple-600"}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Hoje"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:m.filter(E=>{const F=new Date().toDateString();return new Date(E.dataHora).toDateString()===F}).length})]})]})}),s.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(bl,{className:"w-8 h-8 text-orange-600"}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Pendentes"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:m.filter(E=>E.status==="agendada").length})]})]})})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow",children:[s.jsx("div",{className:"px-6 py-4 border-b",children:s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Próximas Consultas"})}),s.jsx("div",{className:"p-6",children:s.jsx("div",{className:"space-y-4",children:m.filter(E=>new Date(E.dataHora)>=new Date).sort((E,F)=>new Date(E.dataHora).getTime()-new Date(F.dataHora).getTime()).slice(0,5).map(E=>s.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:E.pacienteNome}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Dr(a). ",E.medicoNome]}),s.jsx("p",{className:"text-sm text-gray-500",children:re(E.dataHora)})]}),s.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:E.status})]},E._id))})})]})]}),n==="pacientes"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Pacientes"}),s.jsxs("button",{onClick:oe,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors flex items-center",children:[s.jsx(lf,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow",children:[s.jsx("div",{className:"p-6 border-b",children:s.jsx("div",{className:"flex items-center space-x-4",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Wo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"text",placeholder:"Buscar pacientes...",value:h,onChange:E=>y(E.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})})}),s.jsx("div",{className:"p-6",children:le.length===0?s.jsx("p",{className:"text-gray-500",children:"Nenhum paciente encontrado."}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:le.map(E=>s.jsxs("div",{className:"bg-white rounded-xl shadow p-5 flex flex-col justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-1",children:E.nome}),s.jsx("p",{className:"text-sm text-gray-500",children:E.endereco?.cidade||"Cidade não informada"}),s.jsxs("div",{className:"mt-3 text-sm text-gray-700 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{children:E.email})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bl,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{children:E.telefone})]}),s.jsxs("p",{children:["Nascimento: ",E.dataNascimento||"Não informado"]}),s.jsxs("p",{children:["Altura/Peso: ",E.altura||"—"," / ",E.peso||"—"]})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[s.jsxs("button",{onClick:()=>fe(E),className:"flex items-center gap-1 bg-green-600 hover:bg-green-700 text-white text-sm px-3 py-1.5 rounded-md transition",children:[s.jsx(Wg,{className:"w-4 h-4"})," Editar"]}),s.jsxs("button",{onClick:()=>X(E),className:"flex items-center gap-1 bg-red-500 hover:bg-red-600 text-white text-sm px-3 py-1.5 rounded-md transition",children:[s.jsx(em,{className:"w-4 h-4"})," Remover"]})]})]},E._id))})})]})]}),n==="medicos"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Médicos"}),s.jsxs("button",{onClick:()=>{z(!0)},className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors flex items-center",children:[s.jsx(rs,{className:"w-5 h-5 mr-2"}),"Novo Médico"]})]}),s.jsxs("div",{className:"bg-white rounded-lg shadow",children:[s.jsx("div",{className:"p-6 border-b",children:s.jsxs("div",{className:"relative",children:[s.jsx(Wo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"text",placeholder:"Buscar médicos...",value:h,onChange:E=>y(E.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Médico"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Especialidade"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"CRM"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Contato"})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:d.filter(E=>(E.nome||"").toLowerCase().includes(h.toLowerCase())).map(E=>s.jsxs("tr",{className:"hover:bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"text-sm font-medium text-gray-900",children:["Dr(a). ",E.nome||"Nome não informado"]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"text-sm text-gray-900",children:E.especialidade||"Não informado"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"text-sm text-gray-900",children:E.crm||"Não informado"})}),s.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[s.jsx("div",{className:"text-sm text-gray-900",children:E.email||"Email não informado"}),s.jsx("div",{className:"text-sm text-gray-500",children:E.telefone||"Telefone não informado"})]})]},E._id))})]})})]})]}),n==="consultas"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex justify-between items-center",children:s.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Consultas"})}),s.jsxs("div",{className:"bg-white rounded-lg shadow",children:[s.jsx("div",{className:"p-6 border-b",children:s.jsxs("div",{className:"relative",children:[s.jsx(Wo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),s.jsx("input",{type:"text",placeholder:"Buscar consultas...",value:h,onChange:E=>y(E.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Paciente"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Médico"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Data/Hora"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Tipo"}),s.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:m.filter(E=>(E.pacienteNome||"").toLowerCase().includes(h.toLowerCase())||(E.medicoNome||"").toLowerCase().includes(h.toLowerCase())).map(E=>s.jsxs("tr",{className:"hover:bg-gray-50",children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"text-sm font-medium text-gray-900",children:E.pacienteNome})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"text-sm text-gray-900",children:["Dr(a). ",E.medicoNome]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"text-sm text-gray-900",children:re(E.dataHora)})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"text-sm text-gray-900",children:E.tipo||"Não informado"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:E.status})})]},E._id))})]})})]})]}),n==="relatorios"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Relatórios"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white p-6 rounded-lg shadow",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Consultas por Status"}),s.jsx("div",{className:"space-y-3",children:["agendada","confirmada","realizada","cancelada"].map(E=>{const F=m.filter(Y=>Y.status===E).length,J=m.length>0?F/m.length*100:0;return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600 capitalize",children:E}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-20 bg-gray-200 rounded-full h-2",children:s.jsx("div",{className:"bg-green-600 h-2 rounded-full",style:{width:`${J}%`}})}),s.jsx("span",{className:"text-sm font-medium text-gray-900",children:F})]})]},E)})})]}),s.jsxs("div",{className:"bg-white p-6 rounded-lg shadow",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Médicos por Especialidade"}),s.jsx("div",{className:"space-y-3",children:[...new Set(d.map(E=>E.especialidade).filter(Boolean))].map(E=>{const F=d.filter(J=>J.especialidade===E).length;return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:E}),s.jsx("span",{className:"text-sm font-medium text-gray-900",children:F})]},E)})})]})]})]})]}),N&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:s.jsx("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold",children:P?"Editar Paciente":"Cadastrar Novo Paciente"}),s.jsx("button",{onClick:ce,className:"text-gray-400 hover:text-gray-600",children:s.jsx(Sl,{className:"w-6 h-6"})})]}),s.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo *"}),s.jsx("input",{type:"text",value:k.nome,onChange:E=>j({...k,nome:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CPF *"}),s.jsx("input",{type:"text",value:k.cpf,onChange:E=>j({...k,cpf:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone *"}),s.jsx("input",{type:"tel",value:k.telefone,onChange:E=>j({...k,telefone:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email *"}),s.jsx("input",{type:"email",value:k.email,onChange:E=>j({...k,email:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data de Nascimento *"}),s.jsx("input",{type:"date",value:k.dataNascimento,onChange:E=>j({...k,dataNascimento:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Altura (cm)"}),s.jsx("input",{type:"number",min:"50",max:"250",step:"0.1",value:k.altura,onChange:E=>j({...k,altura:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 170"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Peso (kg)"}),s.jsx("input",{type:"number",min:"10",max:"300",step:"0.1",value:k.peso,onChange:E=>j({...k,peso:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 70.5"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CEP"}),s.jsx("input",{type:"text",value:k.endereco.cep,onChange:E=>j({...k,endereco:{...k.endereco,cep:E.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cidade"}),s.jsx("input",{type:"text",value:k.endereco.cidade,onChange:E=>j({...k,endereco:{...k.endereco,cidade:E.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Convênio"}),s.jsxs("select",{value:k.convenio,onChange:E=>j({...k,convenio:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",children:[s.jsx("option",{value:"",children:"Selecione"}),s.jsx("option",{value:"Particular",children:"Particular"}),s.jsx("option",{value:"Unimed",children:"Unimed"}),s.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),s.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),s.jsx("option",{value:"Amil",children:"Amil"}),s.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações"}),s.jsx("textarea",{value:k.observacoes,onChange:E=>j({...k,observacoes:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",rows:3})]}),s.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[s.jsx("button",{type:"button",onClick:ce,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancelar"}),s.jsx("button",{type:"submit",disabled:g,className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors disabled:opacity-50",children:g?"Salvando...":P?"Salvar alterações":"Cadastrar Paciente"})]})]})]})})}),$&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:s.jsx("div",{className:"bg-white rounded-lg max-w-md w-full max-h-[90vh] overflow-y-auto",children:s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Cadastrar Novo Médico"}),s.jsx("button",{onClick:ie,className:"text-gray-400 hover:text-gray-600",children:s.jsx(Sl,{className:"w-6 h-6"})})]}),s.jsxs("form",{onSubmit:E=>{E.preventDefault(),ue.success("Médico cadastrado com sucesso!"),ie()},children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo *"}),s.jsx("input",{type:"text",value:D.nome,onChange:E=>R({...D,nome:E.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0})]}),s.jsxs("div",{className:"mt-4 flex justify-end space-x-3",children:[s.jsx("button",{type:"button",onClick:ie,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancelar"}),s.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Cadastrar Médico"})]})]})]})})})]})};function X1(){return s.jsx(E0,{children:s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx(nv,{}),s.jsx("main",{className:"container mx-auto px-4 py-8",children:s.jsxs(j0,{children:[s.jsx(Mt,{path:"/",element:s.jsx(Wy,{})}),s.jsx(Mt,{path:"/paciente",element:s.jsx(Vy,{})}),s.jsx(Mt,{path:"/login-secretaria",element:s.jsx(qy,{})}),s.jsx(Mt,{path:"/login-medico",element:s.jsx(Qy,{})}),s.jsx(Mt,{path:"/agendamento",element:s.jsx(W1,{})}),s.jsx(Mt,{path:"/acompanhamento",element:s.jsx(V1,{})}),s.jsx(Mt,{path:"/cadastro",element:s.jsx(q1,{})}),s.jsx(Mt,{path:"/painel-medico",element:s.jsx(Q1,{})}),s.jsx(Mt,{path:"/painel-secretaria",element:s.jsx(Y1,{})}),s.jsx(Mt,{path:"*",element:s.jsx(x0,{to:"/",replace:!0})})]})}),s.jsx(xg,{position:"top-right"})]})})}function gm(n){var a,i,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(a=0;a"u")return;let a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}K1(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}} `);var Sa=n=>typeof n=="number"&&!isNaN(n),Xr=n=>typeof n=="string",tr=n=>typeof n=="function",G1=n=>Xr(n)||Sa(n),Ml=n=>Xr(n)||tr(n)?n:null,J1=(n,a)=>n===!1||Sa(n)&&n>0?n:a,Ol=n=>C.isValidElement(n)||Xr(n)||tr(n)||Sa(n);function Z1(n,a,i=300){let{scrollHeight:u,style:d}=n;requestAnimationFrame(()=>{d.minHeight="initial",d.height=u+"px",d.transition=`all ${i}ms`,requestAnimationFrame(()=>{d.height="0",d.padding="0",d.margin="0",setTimeout(a,i)})})}function ew({enter:n,exit:a,appendPosition:i=!1,collapse:u=!0,collapseDuration:d=300}){return function({children:f,position:m,preventExitTransition:v,done:g,nodeRef:w,isIn:h,playToast:y}){let N=i?`${n}--${m}`:n,O=i?`${a}--${m}`:a,$=C.useRef(0);return C.useLayoutEffect(()=>{let z=w.current,P=N.split(" "),W=_=>{_.target===w.current&&(y(),z.removeEventListener("animationend",W),z.removeEventListener("animationcancel",W),$.current===0&&_.type!=="animationcancel"&&z.classList.remove(...P))};z.classList.add(...P),z.addEventListener("animationend",W),z.addEventListener("animationcancel",W)},[]),C.useEffect(()=>{let z=w.current,P=()=>{z.removeEventListener("animationend",P),u?Z1(z,g,d):g()};h||(v?P():($.current=1,z.className+=` ${O}`,z.addEventListener("animationend",P)))},[h]),ke.createElement(ke.Fragment,null,f)}}function Mf(n,a){return{content:vm(n.content,n.props),containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,reason:n.removalReason,status:a}}function vm(n,a,i=!1){return C.isValidElement(n)&&!Xr(n.type)?C.cloneElement(n,{closeToast:a.closeToast,toastProps:a,data:a.data,isPaused:i}):tr(n)?n({closeToast:a.closeToast,toastProps:a,data:a.data,isPaused:i}):n}function tw({closeToast:n,theme:a,ariaLabel:i="close"}){return ke.createElement("button",{className:`Toastify__close-button Toastify__close-button--${a}`,type:"button",onClick:u=>{u.stopPropagation(),n(!0)},"aria-label":i},ke.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},ke.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function rw({delay:n,isRunning:a,closeToast:i,type:u="default",hide:d,className:f,controlledProgress:m,progress:v,rtl:g,isIn:w,theme:h}){let y=d||m&&v===0,N={animationDuration:`${n}ms`,animationPlayState:a?"running":"paused"};m&&(N.transform=`scaleX(${v})`);let O=Qr("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${u}`,{"Toastify__progress-bar--rtl":g}),$=tr(f)?f({rtl:g,type:u,defaultClassName:O}):Qr(O,f),z={[m&&v>=1?"onTransitionEnd":"onAnimationEnd"]:m&&v<1?null:()=>{w&&i()}};return ke.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":y},ke.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${h} Toastify__progress-bar--${u}`}),ke.createElement("div",{role:"progressbar","aria-hidden":y?"true":"false","aria-label":"notification timer",className:$,style:N,...z}))}var nw=1,ym=()=>`${nw++}`;function aw(n,a,i){let u=1,d=0,f=[],m=[],v=a,g=new Map,w=new Set,h=_=>(w.add(_),()=>w.delete(_)),y=()=>{m=Array.from(g.values()),w.forEach(_=>_())},N=({containerId:_,toastId:k,updateId:j})=>{let D=_?_!==n:n!==1,R=g.has(k)&&j==null;return D||R},O=(_,k)=>{g.forEach(j=>{var D;(k==null||k===j.props.toastId)&&((D=j.toggle)==null||D.call(j,_))})},$=_=>{var k,j;(j=(k=_.props)==null?void 0:k.onClose)==null||j.call(k,_.removalReason),_.isActive=!1},z=_=>{if(_==null)g.forEach($);else{let k=g.get(_);k&&$(k)}y()},P=()=>{d-=f.length,f=[]},W=_=>{var k,j;let{toastId:D,updateId:R}=_.props,A=R==null;_.staleId&&g.delete(_.staleId),_.isActive=!0,g.set(D,_),y(),i(Mf(_,A?"added":"updated")),A&&((j=(k=_.props).onOpen)==null||j.call(k))};return{id:n,props:v,observe:h,toggle:O,removeToast:z,toasts:g,clearQueue:P,buildToast:(_,k)=>{if(N(k))return;let{toastId:j,updateId:D,data:R,staleId:A,delay:Q}=k,oe=D==null;oe&&d++;let fe={...v,style:v.toastStyle,key:u++,...Object.fromEntries(Object.entries(k).filter(([ie,pe])=>pe!=null)),toastId:j,updateId:D,data:R,isIn:!1,className:Ml(k.className||v.toastClassName),progressClassName:Ml(k.progressClassName||v.progressClassName),autoClose:k.isLoading?!1:J1(k.autoClose,v.autoClose),closeToast(ie){g.get(j).removalReason=ie,z(j)},deleteToast(){let ie=g.get(j);if(ie!=null){if(i(Mf(ie,"removed")),g.delete(j),d--,d<0&&(d=0),f.length>0){W(f.shift());return}y()}}};fe.closeButton=v.closeButton,k.closeButton===!1||Ol(k.closeButton)?fe.closeButton=k.closeButton:k.closeButton===!0&&(fe.closeButton=Ol(v.closeButton)?v.closeButton:!0);let ce={content:_,props:fe,staleId:A};v.limit&&v.limit>0&&d>v.limit&&oe?f.push(ce):Sa(Q)?setTimeout(()=>{W(ce)},Q):W(ce)},setProps(_){v=_},setToggle:(_,k)=>{let j=g.get(_);j&&(j.toggle=k)},isToastActive:_=>{var k;return(k=g.get(_))==null?void 0:k.isActive},getSnapshot:()=>m}}var ot=new Map,wa=[],Ll=new Set,ow=n=>Ll.forEach(a=>a(n)),xm=()=>ot.size>0;function sw(){wa.forEach(n=>jm(n.content,n.options)),wa=[]}var iw=(n,{containerId:a})=>{var i;return(i=ot.get(a||1))==null?void 0:i.toasts.get(n)};function wm(n,a){var i;if(a)return!!((i=ot.get(a))!=null&&i.isToastActive(n));let u=!1;return ot.forEach(d=>{d.isToastActive(n)&&(u=!0)}),u}function lw(n){if(!xm()){wa=wa.filter(a=>n!=null&&a.options.toastId!==n);return}if(n==null||G1(n))ot.forEach(a=>{a.removeToast(n)});else if(n&&("containerId"in n||"id"in n)){let a=ot.get(n.containerId);a?a.removeToast(n.id):ot.forEach(i=>{i.removeToast(n.id)})}}var uw=(n={})=>{ot.forEach(a=>{a.props.limit&&(!n.containerId||a.id===n.containerId)&&a.clearQueue()})};function jm(n,a){Ol(n)&&(xm()||wa.push({content:n,options:a}),ot.forEach(i=>{i.buildToast(n,a)}))}function cw(n){var a;(a=ot.get(n.containerId||1))==null||a.setToggle(n.id,n.fn)}function Nm(n,a){ot.forEach(i=>{(a==null||!(a!=null&&a.containerId)||a?.containerId===i.id)&&i.toggle(n,a?.id)})}function dw(n){let a=n.containerId||1;return{subscribe(i){let u=aw(a,n,ow);ot.set(a,u);let d=u.observe(i);return sw(),()=>{d(),ot.delete(a)}},setProps(i){var u;(u=ot.get(a))==null||u.setProps(i)},getSnapshot(){var i;return(i=ot.get(a))==null?void 0:i.getSnapshot()}}}function fw(n){return Ll.add(n),()=>{Ll.delete(n)}}function mw(n){return n&&(Xr(n.toastId)||Sa(n.toastId))?n.toastId:ym()}function _a(n,a){return jm(n,a),a.toastId}function fs(n,a){return{...a,type:a&&a.type||n,toastId:mw(a)}}function ms(n){return(a,i)=>_a(a,fs(n,i))}function be(n,a){return _a(n,fs("default",a))}be.loading=(n,a)=>_a(n,fs("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...a}));function pw(n,{pending:a,error:i,success:u},d){let f;a&&(f=Xr(a)?be.loading(a,d):be.loading(a.render,{...d,...a}));let m={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},v=(w,h,y)=>{if(h==null){be.dismiss(f);return}let N={type:w,...m,...d,data:y},O=Xr(h)?{render:h}:h;return f?be.update(f,{...N,...O}):be(O.render,{...N,...O}),y},g=tr(n)?n():n;return g.then(w=>v("success",u,w)).catch(w=>v("error",i,w)),g}be.promise=pw;be.success=ms("success");be.info=ms("info");be.error=ms("error");be.warning=ms("warning");be.warn=be.warning;be.dark=(n,a)=>_a(n,fs("default",{theme:"dark",...a}));function hw(n){lw(n)}be.dismiss=hw;be.clearWaitingQueue=uw;be.isActive=wm;be.update=(n,a={})=>{let i=iw(n,a);if(i){let{props:u,content:d}=i,f={delay:100,...u,...a,toastId:a.toastId||n,updateId:ym()};f.toastId!==n&&(f.staleId=n);let m=f.render||d;delete f.render,_a(m,f)}};be.done=n=>{be.update(n,{progress:1})};be.onChange=fw;be.play=n=>Nm(!0,n);be.pause=n=>Nm(!1,n);function gw(n){var a;let{subscribe:i,getSnapshot:u,setProps:d}=C.useRef(dw(n)).current;d(n);let f=(a=C.useSyncExternalStore(i,u,u))==null?void 0:a.slice();function m(v){if(!f)return[];let g=new Map;return n.newestOnTop&&f.reverse(),f.forEach(w=>{let{position:h}=w.props;g.has(h)||g.set(h,[]),g.get(h).push(w)}),Array.from(g,w=>v(w[0],w[1]))}return{getToastToRender:m,isToastActive:wm,count:f?.length}}function vw(n){let[a,i]=C.useState(!1),[u,d]=C.useState(!1),f=C.useRef(null),m=C.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:v,pauseOnHover:g,closeToast:w,onClick:h,closeOnClick:y}=n;cw({id:n.toastId,containerId:n.containerId,fn:i}),C.useEffect(()=>{if(n.pauseOnFocusLoss)return N(),()=>{O()}},[n.pauseOnFocusLoss]);function N(){document.hasFocus()||W(),window.addEventListener("focus",P),window.addEventListener("blur",W)}function O(){window.removeEventListener("focus",P),window.removeEventListener("blur",W)}function $(A){if(n.draggable===!0||n.draggable===A.pointerType){_();let Q=f.current;m.canCloseOnClick=!0,m.canDrag=!0,Q.style.transition="none",n.draggableDirection==="x"?(m.start=A.clientX,m.removalDistance=Q.offsetWidth*(n.draggablePercent/100)):(m.start=A.clientY,m.removalDistance=Q.offsetHeight*(n.draggablePercent===80?n.draggablePercent*1.5:n.draggablePercent)/100)}}function z(A){let{top:Q,bottom:oe,left:fe,right:ce}=f.current.getBoundingClientRect();A.nativeEvent.type!=="touchend"&&n.pauseOnHover&&A.clientX>=fe&&A.clientX<=ce&&A.clientY>=Q&&A.clientY<=oe?W():P()}function P(){i(!0)}function W(){i(!1)}function _(){m.didMove=!1,document.addEventListener("pointermove",j),document.addEventListener("pointerup",D)}function k(){document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",D)}function j(A){let Q=f.current;if(m.canDrag&&Q){m.didMove=!0,a&&W(),n.draggableDirection==="x"?m.delta=A.clientX-m.start:m.delta=A.clientY-m.start,m.start!==A.clientX&&(m.canCloseOnClick=!1);let oe=n.draggableDirection==="x"?`${m.delta}px, var(--y)`:`0, calc(${m.delta}px + var(--y))`;Q.style.transform=`translate3d(${oe},0)`,Q.style.opacity=`${1-Math.abs(m.delta/m.removalDistance)}`}}function D(){k();let A=f.current;if(m.canDrag&&m.didMove&&A){if(m.canDrag=!1,Math.abs(m.delta)>m.removalDistance){d(!0),n.closeToast(!0),n.collapseAll();return}A.style.transition="transform 0.2s, opacity 0.2s",A.style.removeProperty("transform"),A.style.removeProperty("opacity")}}let R={onPointerDown:$,onPointerUp:z};return v&&g&&(R.onMouseEnter=W,n.stacked||(R.onMouseLeave=P)),y&&(R.onClick=A=>{h&&h(A),m.canCloseOnClick&&w(!0)}),{playToast:P,pauseToast:W,isRunning:a,preventExitTransition:u,toastRef:f,eventHandlers:R}}var yw=typeof window<"u"?C.useLayoutEffect:C.useEffect,ps=({theme:n,type:a,isLoading:i,...u})=>ke.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:n==="colored"?"currentColor":`var(--toastify-icon-color-${a})`,...u});function xw(n){return ke.createElement(ps,{...n},ke.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function ww(n){return ke.createElement(ps,{...n},ke.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function jw(n){return ke.createElement(ps,{...n},ke.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Nw(n){return ke.createElement(ps,{...n},ke.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function bw(){return ke.createElement("div",{className:"Toastify__spinner"})}var Rl={info:ww,warning:xw,success:jw,error:Nw,spinner:bw},kw=n=>n in Rl;function Sw({theme:n,type:a,isLoading:i,icon:u}){let d=null,f={theme:n,type:a};return u===!1||(tr(u)?d=u({...f,isLoading:i}):C.isValidElement(u)?d=C.cloneElement(u,f):i?d=Rl.spinner():kw(a)&&(d=Rl[a](f))),d}var _w=n=>{let{isRunning:a,preventExitTransition:i,toastRef:u,eventHandlers:d,playToast:f}=vw(n),{closeButton:m,children:v,autoClose:g,onClick:w,type:h,hideProgressBar:y,closeToast:N,transition:O,position:$,className:z,style:P,progressClassName:W,updateId:_,role:k,progress:j,rtl:D,toastId:R,deleteToast:A,isIn:Q,isLoading:oe,closeOnClick:fe,theme:ce,ariaLabel:ie}=n,pe=Qr("Toastify__toast",`Toastify__toast-theme--${ce}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":fe}),X=tr(z)?z({rtl:D,position:$,type:h,defaultClassName:pe}):Qr(pe,z),re=Sw(n),le=!!j||!g,E={closeToast:N,type:h,theme:ce},F=null;return m===!1||(tr(m)?F=m(E):C.isValidElement(m)?F=C.cloneElement(m,E):F=tw(E)),ke.createElement(O,{isIn:Q,done:A,position:$,preventExitTransition:i,nodeRef:u,playToast:f},ke.createElement("div",{id:R,tabIndex:0,onClick:w,"data-in":Q,className:X,...d,style:P,ref:u,...Q&&{role:k,"aria-label":ie}},re!=null&&ke.createElement("div",{className:Qr("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!oe})},re),vm(v,n,!a),F,!n.customProgressBar&&ke.createElement(rw,{..._&&!le?{key:`p-${_}`}:{},rtl:D,theme:ce,delay:g,isRunning:a,isIn:Q,closeToast:N,hide:y,type:h,className:W,controlledProgress:le,progress:j||0})))},Cw=(n,a=!1)=>({enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:a}),Ew=ew(Cw("bounce",!0)),Tw={position:"top-right",transition:Ew,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:n=>n.altKey&&n.code==="KeyT"};function Pw(n){let a={...Tw,...n},i=n.stacked,[u,d]=C.useState(!0),f=C.useRef(null),{getToastToRender:m,isToastActive:v,count:g}=gw(a),{className:w,style:h,rtl:y,containerId:N,hotKeys:O}=a;function $(P){let W=Qr("Toastify__toast-container",`Toastify__toast-container--${P}`,{"Toastify__toast-container--rtl":y});return tr(w)?w({position:P,rtl:y,defaultClassName:W}):Qr(W,Ml(w))}function z(){i&&(d(!0),be.play())}return yw(()=>{var P;if(i){let W=f.current.querySelectorAll('[data-in="true"]'),_=12,k=(P=a.position)==null?void 0:P.includes("top"),j=0,D=0;Array.from(W).reverse().forEach((R,A)=>{let Q=R;Q.classList.add("Toastify__toast--stacked"),A>0&&(Q.dataset.collapsed=`${u}`),Q.dataset.pos||(Q.dataset.pos=k?"top":"bot");let oe=j*(u?.2:1)+(u?0:_*A);Q.style.setProperty("--y",`${k?oe:oe*-1}px`),Q.style.setProperty("--g",`${_}`),Q.style.setProperty("--s",`${1-(u?D:0)}`),j+=Q.offsetHeight,D+=.025})}},[u,g,i]),C.useEffect(()=>{function P(W){var _;let k=f.current;O(W)&&((_=k.querySelector('[tabIndex="0"]'))==null||_.focus(),d(!1),be.pause()),W.key==="Escape"&&(document.activeElement===k||k!=null&&k.contains(document.activeElement))&&(d(!0),be.play())}return document.addEventListener("keydown",P),()=>{document.removeEventListener("keydown",P)}},[O]),ke.createElement("section",{ref:f,className:"Toastify",id:N,onMouseEnter:()=>{i&&(d(!1),be.pause())},onMouseLeave:z,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":a["aria-label"]},m((P,W)=>{let _=W.length?{...h}:{...h,pointerEvents:"none"};return ke.createElement("div",{tabIndex:-1,className:$(P),"data-stacked":i,style:_,key:`c-${P}`},W.map(({content:k,props:j})=>ke.createElement(_w,{...j,stacked:i,collapseAll:z,isIn:v(j.toastId,j.containerId),key:`t-${j.key}`},k)))}))}Th.createRoot(document.getElementById("root")).render(s.jsxs(C.StrictMode,{children:[s.jsx(X1,{}),s.jsx(Pw,{position:"top-right",autoClose:3e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"colored"})]}));