diff --git a/MICA.php b/MICA.php index 677f60a..6234d66 100644 --- a/MICA.php +++ b/MICA.php @@ -299,7 +299,7 @@ public function loginUser($payload): array $check = reset($json); // Ensure completed users cannot login again - if (isset($check["user_complete"]) && $check['user_complete'] !== "2") { + if (isset($check["user_complete"]) && $check['user_complete'] == "2") { $time_completed = $check['completion_timestamp']; throw new \Exception("Your MICA session was completed on $time_completed, thank you for participating"); } diff --git a/mica-chatbot/dist/assets/index-ABqdDKET.js b/mica-chatbot/dist/assets/index-BXI-ZlRe.js similarity index 88% rename from mica-chatbot/dist/assets/index-ABqdDKET.js rename to mica-chatbot/dist/assets/index-BXI-ZlRe.js index b47b265..1372ea1 100644 --- a/mica-chatbot/dist/assets/index-ABqdDKET.js +++ b/mica-chatbot/dist/assets/index-BXI-ZlRe.js @@ -71,7 +71,7 @@ Error generating stack: `+o.message+` * @license MIT */function cc(){return cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function d2(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=j.useState(n.state),[a,l]=j.useState(),[u,c]=j.useState({isTransitioning:!1}),[p,d]=j.useState(),[m,g]=j.useState(),[v,k]=j.useState(),_=j.useRef(new Map),{v7_startTransition:b}=r||{},w=j.useCallback(L=>{b?c2(L):L()},[b]),E=j.useCallback((L,U)=>{let{deletedFetchers:G,unstable_flushSync:W,unstable_viewTransitionOpts:Q}=U;G.forEach(oe=>_.current.delete(oe)),L.fetchers.forEach((oe,fe)=>{oe.data!==void 0&&_.current.set(fe,oe.data)});let ne=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!Q||ne){W?fl(()=>o(L)):w(()=>o(L));return}if(W){fl(()=>{m&&(p&&p.resolve(),m.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let oe=n.window.document.startViewTransition(()=>{fl(()=>o(L))});oe.finished.finally(()=>{fl(()=>{d(void 0),g(void 0),l(void 0),c({isTransitioning:!1})})}),fl(()=>g(oe));return}m?(p&&p.resolve(),m.skipTransition(),k({state:L,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(l(L),c({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[n.window,m,p,_,w]);j.useLayoutEffect(()=>n.subscribe(E),[n,E]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&d(new f2)},[u]),j.useEffect(()=>{if(p&&a&&n.window){let L=a,U=p.promise,G=n.window.document.startViewTransition(async()=>{w(()=>o(L)),await U});G.finished.finally(()=>{d(void 0),g(void 0),l(void 0),c({isTransitioning:!1})}),g(G)}},[w,a,p,n.window]),j.useEffect(()=>{p&&a&&i.location.key===a.location.key&&p.resolve()},[p,m,i.location,a]),j.useEffect(()=>{!u.isTransitioning&&v&&(l(v.state),c({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),k(void 0))},[u.isTransitioning,v]),j.useEffect(()=>{},[]);let O=j.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:L=>n.navigate(L),push:(L,U,G)=>n.navigate(L,{state:U,preventScrollReset:G==null?void 0:G.preventScrollReset}),replace:(L,U,G)=>n.navigate(L,{replace:!0,state:U,preventScrollReset:G==null?void 0:G.preventScrollReset})}),[n]),I=n.basename||"/",S=j.useMemo(()=>({router:n,navigator:O,static:!1,basename:I}),[n,O,I]);return j.createElement(j.Fragment,null,j.createElement(Fc.Provider,{value:S},j.createElement($x.Provider,{value:i},j.createElement(l2.Provider,{value:_.current},j.createElement(a2.Provider,{value:u},j.createElement(e2,{basename:I,location:i.location,navigationType:i.historyAction,navigator:O,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?j.createElement(p2,{routes:n.routes,future:n.future,state:i}):t))))),null)}function p2(e){let{routes:t,future:n,state:r}=e;return UO(t,void 0,r,n)}var _v;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_v||(_v={}));var Pv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pv||(Pv={}));var Hx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Lu,function(){var n=function(s,f){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(h[x]=y[x])})(s,f)},r=function(){return(r=Object.assign||function(s){for(var f,h=1,y=arguments.length;h"u"||o.Promise||(o.Promise=Promise);var c=Object.getPrototypeOf,p={}.hasOwnProperty;function d(s,f){return p.call(s,f)}function m(s,f){typeof f=="function"&&(f=f(c(s))),(typeof Reflect>"u"?a:Reflect.ownKeys)(f).forEach(function(h){v(s,h,f[h])})}var g=Object.defineProperty;function v(s,f,h,y){g(s,f,u(h&&d(h,"get")&&typeof h.get=="function"?{get:h.get,set:h.set,configurable:!0}:{value:h,configurable:!0,writable:!0},y))}function k(s){return{from:function(f){return s.prototype=Object.create(f.prototype),v(s.prototype,"constructor",s),{extend:m.bind(null,s.prototype)}}}}var _=Object.getOwnPropertyDescriptor,b=[].slice;function w(s,f,h){return b.call(s,f,h)}function E(s,f){return f(s)}function O(s){if(!s)throw new Error("Assertion Failed")}function I(s){o.setImmediate?setImmediate(s):setTimeout(s,0)}function S(s,f){if(typeof f=="string"&&d(s,f))return s[f];if(!f)return s;if(typeof f!="string"){for(var h=[],y=0,x=f.length;y"u"?[]:function(){var s=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[s,c(s),s];var f=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[f,c(f),s]}(),fn=Yr[0],ir=Yr[1],Yr=Yr[2],ir=ir&&ir.then,te=fn&&fn.constructor,he=!!Yr,Ae=function(s,f){$t.push([s,f]),lt&&(queueMicrotask(rf),lt=!1)},Ue=!0,lt=!0,Ot=[],In=[],zt=qe,rn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},Re=rn,$t=[],dn=0,on=[];function be(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Re;if(typeof s!="function"){if(s!==Mt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&hi(this,this._value))}this._state=null,this._value=null,++f.ref,function h(y,x){try{x(function(C){if(y._state===null){if(C===y)throw new TypeError("A promise cannot be resolved with itself.");var T=y._lib&&Wr();C&&typeof C.then=="function"?h(y,function(A,B){C instanceof be?C._then(A,B):C.then(A,B)}):(y._state=!0,y._value=C,Ho(y)),T&&Kr()}},hi.bind(null,y))}catch(C){hi(y,C)}}(this,s)}var Uo={get:function(){var s=Re,f=Le;function h(y,x){var C=this,T=!s.global&&(s!==Re||f!==Le),A=T&&!Pe(),B=new be(function(z,K){Va(C,new Vo(Kt(y,s,T,A),Kt(x,s,T,A),z,K,s))});return this._consoleTask&&(B._consoleTask=this._consoleTask),B}return h.prototype=Mt,h},set:function(s){v(this,"then",s&&s.prototype===Mt?Uo:{get:function(){return s},set:Uo.set})}};function Vo(s,f,h,y,x){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof f=="function"?f:null,this.resolve=h,this.reject=y,this.psd=x}function hi(s,f){var h,y;In.push(f),s._state===null&&(h=s._lib&&Wr(),f=zt(f),s._state=!1,s._value=f,y=s,Ot.some(function(x){return x._value===y._value})||Ot.push(y),Ho(s),h&&Kr())}function Ho(s){var f=s._listeners;s._listeners=[];for(var h=0,y=f.length;h.",qr="String expected.",Hn=[],En="__dbnames",gi="readonly",yi="readwrite";function nr(s,f){return s?f?function(){return s.apply(this,arguments)&&f.apply(this,arguments)}:s:f}var Qe={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function wt(s){return typeof s!="string"||/\./.test(s)?function(f){return f}:function(f){return f[s]===void 0&&s in f&&delete(f=oe(f))[s],f}}function mn(){throw ae.Type()}function ze(s,f){try{var h=rr(s),y=rr(f);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return fee+re&&X(ee+q)})})}var Z=Ko(h)&&h.limit===1/0&&(typeof s!="function"||s===lf)&&{index:h.index,range:h.range};return X(0).then(function(){if(0<$.length)throw new Me("Error modifying one or more objects",$,H,Y);return V.length})})})},ut.prototype.delete=function(){var s=this._ctx,f=s.range;return Ko(s)&&(s.isPrimKey||f.type===3)?this._write(function(h){var y=s.table.core.schema.primaryKey,x=f;return s.table.core.count({trans:h,query:{index:y,range:x}}).then(function(C){return s.table.core.mutate({trans:h,type:"deleteRange",range:x}).then(function(T){var A=T.failures;if(T.lastResult,T.results,T=T.numFailures,T)throw new Me("Could not delete some values",Object.keys(A).map(function(B){return A[B]}),C-T);return C-T})})}):this.modify(lf)},ut);function ut(){}var lf=function(s,f){return f.value=null};function pS(s,f){return s=q})).length!==0?(K.forEach(function(X){Y.push(function(){var Z=V,ee=X._cfg.dbschema;Ds(M,Z,H),Ds(M,ee,H),V=M._dbSchema=ee;var re=pf(Z,ee);re.add.forEach(function(Ce){hf(H,Ce[0],Ce[1].primKey,Ce[1].indexes)}),re.change.forEach(function(Ce){if(Ce.recreate)throw new ae.Upgrade("Not yet support for changing primary key");var ve=H.objectStore(Ce.name);Ce.add.forEach(function(Ye){return Ls(ve,Ye)}),Ce.change.forEach(function(Ye){ve.deleteIndex(Ye.name),Ls(ve,Ye)}),Ce.del.forEach(function(Ye){return ve.deleteIndex(Ye)})});var ue=X._cfg.contentUpgrade;if(ue&&X._cfg.version>q){Ns(M,H),$._memoizedTables={};var ke=U(ee);re.del.forEach(function(Ce){ke[Ce]=Z[Ce]}),df(M,[M.Transaction.prototype]),Is(M,[M.Transaction.prototype],a(ke),ke),$.schema=ke;var me,xe=Oe(ue);return xe&&Ve(),re=be.follow(function(){var Ce;(me=ue($))&&xe&&(Ce=Pe.bind(null,null),me.then(Ce,Ce))}),me&&typeof me.then=="function"?be.resolve(me):re.then(function(){return me})}}),Y.push(function(Z){var ee,re,ue=X._cfg.dbschema;ee=ue,re=Z,[].slice.call(re.db.objectStoreNames).forEach(function(ke){return ee[ke]==null&&re.db.deleteObjectStore(ke)}),df(M,[M.Transaction.prototype]),Is(M,[M.Transaction.prototype],M._storeNames,M._dbSchema),$.schema=M._dbSchema}),Y.push(function(Z){M.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(M.idbdb.version/10)===X._cfg.version?(M.idbdb.deleteObjectStore("$meta"),delete M._dbSchema.$meta,M._storeNames=M._storeNames.filter(function(ee){return ee!=="$meta"})):Z.objectStore("$meta").put(X._cfg.version,"version"))})}),function X(){return Y.length?be.resolve(Y.shift()($.idbtrans)).then(X):be.resolve()}().then(function(){wg(V,H)})):be.resolve();var M,q,$,H,Y,V}).catch(T)):(a(x).forEach(function(K){hf(h,K,x[K].primKey,x[K].indexes)}),Ns(s,h),void be.follow(function(){return s.on.populate.fire(C)}).catch(T));var B,z})}function bS(s,f){wg(s._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var h=As(0,s.idbdb,f);Ds(s,s._dbSchema,f);for(var y=0,x=pf(h,s._dbSchema).change;yMath.pow(2,62)?0:V.oldVersion,M=V<1,s.idbdb=Y.result,C&&bS(s,K),xS(s,V/10,K,$))},$),Y.onsuccess=D(function(){K=null;var V,X,Z,ee,re,ue=s.idbdb=Y.result,ke=w(ue.objectStoreNames);if(0"u"?be.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(q){function $(){return indexedDB.databases().finally(q)}B=setInterval($,100),$()}).finally(function(){return clearInterval(B)}):Promise.resolve()).then(A)]).then(function(){return T(),f.onReadyBeingFired=[],be.resolve(yf(function(){return s.on.ready.fire(s.vip)})).then(function q(){if(0f.limit?q.length=f.limit:s.length===f.limit&&q.length=X.limit&&(!X.values||ue.req.values)&&OS(ue.req.query.range,X.query.range)}),!1,Z,ee];case"count":return re=ee.find(function(ue){return Tg(ue.req.query.range,X.query.range)}),[re,!!re,Z,ee]}}(f,h,"query",C),K=z[0],M=z[1],q=z[2],$=z[3];return K&&M?K.obsSet=C.obsSet:(M=y.query(C).then(function(H){var Y=H.result;if(K&&(K.res=Y),T){for(var V=0,X=Y.length;V{const[t,n]=j.useState([]),[r,i]=j.useState([]),[o,a]=j.useState(!1),[l,u]=j.useState(Date.now().toString()),[c,p]=j.useState([]),[d,m]=j.useState(0),g=j.useRef(t),v=j.useRef(r);j.useEffect(()=>{console.log("apiContext updated: ",t)},[t]);const k=async()=>{var Q;const W=await Tv();if(console.log("fucker bitch fetchSavedSession",W),W.length>0&&W[0]&&((Q=W[0])!=null&&Q.id)&&Date.now()-W[0].timestamp<=30*60*1e3){const fe={participant_id:W[0].id,name:W[0].name};window.mica_jsmo_module.fetchSavedQueries(fe,ge=>{if(ge.current_session&&ge.current_session.length>0){const we={session_id:Date.now().toString(),queries:ge.current_session};S(we)}},ge=>{console.error("Error fetching session:",ge)})}},_=W=>{g.current=W,n(W)},b=async()=>{l&&v.current.length>0&&(await w2(l)?await y2(l,v.current):await g2(l,Date.now(),v.current))},w=async(W,Q=!0)=>{v.current=W,i(W),Q&&await b()},E=async W=>{var ne;const Q=await Tv();if((ne=Q[0])!=null&&ne.id){const oe=v.current.length,fe=[...g.current,{role:W.role,content:W.content,index:oe,user_id:Q[0].id}];if(_(fe),W.role=="system")return;const ge=[...v.current,{user_content:W.role==="user"?W.content:null,assistant_content:W.role==="assistant"?W.content:null,timestamp:new Date().getTime()}];w(ge)}},O=async(W,Q)=>{const{response:ne,usage:oe,id:fe,model:ge}=W,we=[...v.current];we[Q]={...we[Q],assistant_content:ne.content,input_tokens:oe?oe.prompt_tokens:null,output_tokens:oe?oe.completion_tokens:null,input_cost:oe?oe.input_cost:null,output_cost:oe?oe.output_cost:null,id:fe||null,model:ge||null},await w(we);const Ee=[...g.current,{role:"assistant",content:ne.content,index:Q}];_(Ee)},I=async()=>{const W=Date.now().toString();m(0),p([]),u(W);const Q=g.current.filter(ne=>ne.role==="system");v.current=[],g.current=Q,i([]),n(Q)},S=async W=>{u(W.session_id),p(W.queries),m(W.queries.length),w(W.queries)},L=async(W,Q)=>{if(g.current.length===0){const fe=window.mica_jsmo_module.getInitialSystemContext().pop();console.log("initial apiContext, if empty , inject system context before first query",fe),await E(fe)}await E({role:"user",content:W.content});const ne=v.current.length-1,oe=[...g.current];console.log("calling callAI with ",oe),window.mica_jsmo_module.callAI(oe,fe=>{fe&&fe.response?(O(fe,ne),Q&&Q()):console.log("Unexpected response format:",fe)},fe=>{console.log("callAI error",fe),Q&&Q()})},U=async(W,Q)=>{const ne=[...v.current];ne[W]={...ne[W],rating:Q},await w(ne)},G=async W=>{const Q=[...v.current];Q.splice(W,1);const ne=g.current.filter(oe=>oe.index!==W);ne.forEach((oe,fe)=>{oe.index>W&&(oe.index-=1)}),w(Q),_(ne)};return R.jsx($o.Provider,{value:{messages:c,addMessage:E,clearMessages:I,replaceSession:S,showRatingPO:o,setShowRatingPO:a,msgCount:d,setMsgCount:m,sessionId:l,setSessionId:u,callAjax:L,chatContext:r,updateChatContext:w,updateVote:U,deleteInteraction:G,fetchSavedSession:k},children:e})},Wx=j.createContext();function S2(){const[e,t]=j.useState(!1),n=async()=>{try{const i=await So.table("current_user").toArray();return i.length?i[0]:null}catch(i){return console.error("Failed to retrieve user from cache:",i),null}},r=async i=>{let{participant_id:o,name:a}=i==null?void 0:i.user;if(o&&a){let l={id:parseInt(o),name:a,timestamp:Date.now()};await So.current_user.clear(),await So.current_user.put(l)}else console.log("unable to cache user... skipping")};return{authed:e,login(i,o){return new Promise(async(a,l)=>{try{const u=await n();if(u){let p=Date.now()-u.timestamp<=30*60*1e3;if(u.name===i&&p)t(!0),a("pass");else if(mica_jsmo_module){let m=await mica_jsmo_module.login({name:i,email:o},a,l)}}else if(mica_jsmo_module){let p=await mica_jsmo_module.login({name:i,email:o},a,l)}else console.error("MICA EM is not injected, cannot execute function login"),l()}catch(u){console.error("Login failed: ",u),l(u)}})},logout(){return new Promise(i=>{t(!1),i()})},verifyEmail(i){return new Promise(async(o,a)=>{mica_jsmo_module?await mica_jsmo_module.verifyEmail({code:i},u=>{console.log("valid user, logging in..."),r(u),t(!0),o(u)},a):(console.error("MICA EM is not injected, cannot execute function login"),a())})}}}function k2({children:e}){const t=S2();return R.jsx(Wx.Provider,{value:t,children:e})}function Em(){return j.useContext(Wx)}function Cm(){const e=km(),{clearMessages:t}=j.useContext($o),{logout:n}=Em(),r=async()=>{await So.current_user.clear(),await t(),await n(),e("/")},i=async()=>{if(mica_jsmo_module){const a=await So.current_user.toArray();if(a.length>0){const{id:l,name:u}=a[0];mica_jsmo_module.completeSession({participant_id:l},async c=>{console.log("Session ended successfully."),r()},c=>{console.error("Error ending session:",c),r()})}else console.error("No user data found in IndexedDB"),r()}else console.error("MICA EM is not injected, cannot execute endSession"),r()};return R.jsxs(gs,{className:"rcchat_header handle",children:[R.jsxs("h1",{children:[R.jsx("span",{className:"logo"}),"MICA AI Chatbot"]}),R.jsxs("div",{className:"buttons",children:[R.jsx("button",{onClick:i,children:"End Session"}),R.jsx("button",{onClick:r,children:R.jsx(fm,{size:20})})]})]})}function Kx(){const e=j.useContext($o),[t,n]=j.useState("Ask a question..."),[r,i]=j.useState(""),[o,a]=j.useState(!1),l=()=>{r.trim()!==""&&(a(!0),e.callAjax({role:"user",content:r},()=>a(!1)),i(""))},u=c=>{c.key==="Enter"&&(c.preventDefault(),l())};return j.useEffect(()=>{o||a(!1)},[e.chatContext]),R.jsxs(gs,{className:"container footer",children:[R.jsx("button",{onClick:e.clearMessages,className:"clear_chat",children:R.jsx(dm,{color:"#ccc",size:20})}),R.jsx("input",{className:"user_input",placeholder:t,value:r,onChange:c=>i(c.target.value),onKeyDown:u}),R.jsx("div",{className:"send-container",children:R.jsxs("button",{onClick:l,children:[R.jsx(hm,{color:"#ccc",size:20,className:`send ${o?"off":""}`}),R.jsx(cm,{color:"#ccc",size:20,className:`sendfill ${o?"rotate":""}`})]})})]})}function Jt(e){return Object.keys(e)}function sd(e){return e&&typeof e=="object"&&!Array.isArray(e)}function _m(e,t){const n={...e},r=t;return sd(e)&&sd(t)&&Object.keys(t).forEach(i=>{sd(r[i])&&i in e?n[i]=_m(n[i],r[i]):n[i]=r[i]}),n}function E2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function C2(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Bp(e){const t=C2(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function ud(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function qx(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?ud(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?ud(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const o=`${Number(i)/16}${e}`;return t?ud(o):o}}return r}return n}const se=qx("rem",{shouldScale:!0}),Rv=qx("em");function $a(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Yx(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Pm(e){const t=j.createContext(null);return[({children:i,value:o})=>R.jsx(t.Provider,{value:o,children:i}),()=>{const i=j.useContext(t);if(i===null)throw new Error(e);return i}]}function _2(e=null){const t=j.createContext(e);return[({children:i,value:o})=>R.jsx(t.Provider,{value:o,children:i}),()=>j.useContext(t)]}function mr(e,t="size",n=!0){if(e!==void 0)return Yx(e)?n?se(e):e:`var(--${t}-${e})`}function ko(e){return mr(e,"mantine-spacing")}function Fa(e){return e===void 0?"var(--mantine-radius-default)":mr(e,"mantine-radius")}function Br(e){return mr(e,"mantine-font-size")}function P2(e){return mr(e,"mantine-line-height",!1)}function O2(e){if(e)return mr(e,"mantine-shadow",!1)}function T2(e,t){return e in t.breakpoints?Bp(t.breakpoints[e]):Bp(e)}function Om(e,t){const n=e.map(r=>({value:r,px:T2(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function yo(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function R2(e,t,n){return n===void 0?Math.max(e,t):Math.min(Math.max(e,t),n)}function j2(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function N2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function I2(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function L2(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=j.useState(n?t:I2(e)),o=j.useRef();return j.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),i(o.current.matches),N2(o.current,a=>i(a.matches))},[e]),r}const Tm=typeof document<"u"?j.useLayoutEffect:j.useEffect;function A2(e,t){const n=j.useRef(!1);j.useEffect(()=>()=>{n.current=!1},[]),j.useEffect(()=>{if(n.current)return e();n.current=!0},t)}const D2=ot.useId||(()=>{});function M2(){const e=D2();return e?`mantine-${e.replace(/:/g,"")}`:""}function Qx(e){const t=M2(),[n,r]=j.useState(t);return Tm(()=>{r(j2())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function z2(e,t){return L2("(prefers-reduced-motion: reduce)",e,t)}function Gx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=Ji(t[r],i):t[r]=i})}),t}function Rm({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,n,r):a||$2);return F2(o)}function Up({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,a)=>typeof a=="function"?{...o,...a(e,n,r)}:{...o,...a},{})}const Xx=j.createContext(null);function Fo(){const e=j.useContext(Xx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function B2(){return Fo().cssVariablesResolver}function U2(){return Fo().classNamesPrefix}function jm(){return Fo().getStyleNonce}function V2(){return Fo().withStaticClasses}function H2(){return Fo().headless}function W2(){var e;return(e=Fo().stylesTransform)==null?void 0:e.sx}function K2(){var e;return(e=Fo().stylesTransform)==null?void 0:e.styles}function q2(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Y2(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,o=n&255;return{r,g:i,b:o,a:1}}function Q2(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i||1}}function G2(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,a=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*o-1))*i,u=r/60,c=l*(1-Math.abs(u%2-1)),p=o-l/2;let d,m,g;return u>=0&&u<1?(d=l,m=c,g=0):u>=1&&u<2?(d=c,m=l,g=0):u>=2&&u<3?(d=0,m=l,g=c):u>=3&&u<4?(d=0,m=c,g=l):u>=4&&u<5?(d=c,m=0,g=l):(d=l,m=0,g=c),{r:Math.round((d+p)*255),g:Math.round((m+p)*255),b:Math.round((g+p)*255),a:a||1}}function Nm(e){return q2(e)?Y2(e):e.startsWith("rgb")?Q2(e):e.startsWith("hsl")?G2(e):{r:0,g:0,b:0,a:1}}function cu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:o}=Nm(e),a=1-t,l=u=>Math.round(u*a);return`rgba(${l(n)}, ${l(r)}, ${l(i)}, ${o})`}function ss(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function cd(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function X2(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function J2(e){if(e.startsWith("oklch("))return(X2(e)||0)/100;const{r:t,g:n,b:r}=Nm(e),i=t/255,o=n/255,a=r/255,l=cd(i),u=cd(o),c=cd(a);return .2126*l+.7152*u+.0722*c}function dl(e,t=.179){return e.startsWith("var(")?!1:J2(e)>t}function ks({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:dl(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:dl(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:dl(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),o=i?Number(i):void 0,a=r in t.colors;if(a){const l=o!==void 0?t.colors[r][o]:t.colors[r][ss(t,n||"light")];return{color:r,value:l,shade:o,isThemeColor:a,isLight:dl(l,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:dl(e,t.luminanceThreshold),shade:o,variable:void 0}}function dc(e,t){const n=ks({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Vp(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=dc(n.from,t),i=dc(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function Gr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=Nm(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Jo=Gr,Z2=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const o=ks({color:e,theme:t}),a=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const l=a&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${se(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:l,border:`${se(1)} solid transparent`}:{background:e,hover:cu(e,.1),color:l,border:`${se(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`};const l=t.colors[o.color][o.shade];return{background:Gr(l,.1),hover:Gr(l,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}}return{background:Gr(e,.1),hover:Gr(e,.12),color:e,border:`${se(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${se(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Gr(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${se(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:Gr(e,.05),color:e,border:`${se(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`};const l=t.colors[o.color][o.shade];return{background:"transparent",hover:Gr(l,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}}return{background:"transparent",hover:Gr(e,.12),color:e,border:`${se(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${se(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${se(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${se(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:e,border:`${se(1)} solid transparent`}:n==="gradient"?{background:Vp(r,t),hover:Vp(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${se(1)} solid var(--mantine-color-default-border)`}:{}},eT={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},jv="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Im={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:eT,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:Z2,autoContrast:!1,luminanceThreshold:.3,fontFamily:jv,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:jv,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:se(34),lineHeight:"1.3"},h2:{fontSize:se(26),lineHeight:"1.35"},h3:{fontSize:se(22),lineHeight:"1.4"},h4:{fontSize:se(18),lineHeight:"1.45"},h5:{fontSize:se(16),lineHeight:"1.5"},h6:{fontSize:se(14),lineHeight:"1.5"}}},fontSizes:{xs:se(12),sm:se(14),md:se(16),lg:se(18),xl:se(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:se(2),sm:se(4),md:se(8),lg:se(16),xl:se(32)},spacing:{xs:se(10),sm:se(12),md:se(16),lg:se(20),xl:se(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), 0 ${se(1)} ${se(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(10)} ${se(15)} ${se(-5)}, rgba(0, 0, 0, 0.04) 0 ${se(7)} ${se(7)} ${se(-5)}`,md:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(20)} ${se(25)} ${se(-5)}, rgba(0, 0, 0, 0.04) 0 ${se(10)} ${se(10)} ${se(-5)}`,lg:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(28)} ${se(23)} ${se(-7)}, rgba(0, 0, 0, 0.04) 0 ${se(12)} ${se(12)} ${se(-7)}`,xl:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(36)} ${se(28)} ${se(-7)}, rgba(0, 0, 0, 0.04) 0 ${se(17)} ${se(17)} ${se(-7)}`},other:{},components:{}};function Nv(e){return e==="auto"||e==="dark"||e==="light"}function tT({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return Nv(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&Nv(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const nT="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Iv="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function fd(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Lv(e){if(!(e.primaryColor in e.colors))throw new Error(nT);if(typeof e.primaryShade=="object"&&(!fd(e.primaryShade.dark)||!fd(e.primaryShade.light)))throw new Error(Iv);if(typeof e.primaryShade=="number"&&!fd(e.primaryShade))throw new Error(Iv)}function rT(e,t){var r;if(!t)return Lv(e),e;const n=_m(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Lv(n),n}const Lm=j.createContext(null),iT=()=>j.useContext(Lm)||Im;function Vr(){const e=j.useContext(Lm);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function Jx({theme:e,children:t,inherit:n=!0}){const r=iT(),i=j.useMemo(()=>rT(n?r:Im,e),[e,r,n]);return R.jsx(Lm.Provider,{value:i,children:t})}Jx.displayName="@mantine/core/MantineThemeProvider";function oT(){const e=Vr(),t=jm(),n=Jt(e.breakpoints).reduce((r,i)=>{const o=e.breakpoints[i].includes("px"),a=Bp(e.breakpoints[i]),l=o?`${a-.1}px`:Rv(a-.1),u=o?`${a}px`:Rv(a);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${u}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return R.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function dd(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function pl(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function aT(e,t){const n=dd(e.variables),r=n?pl(t,n):"",i=dd(e.dark),o=dd(e.light),a=i?pl(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",l=o?pl(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${a}${l}`}function lT({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&ks({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Av(e,t){return lT({color:e.colors[e.primaryColor][ss(e,t)],theme:e,autoContrast:null})}function fu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const l=ss(e,"light"),u={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:Jo(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:Jo(e.colors[t][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:Jo(e.colors[t][l],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...u}:u}const o=ss(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Jo(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Jo(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Jo(e.colors[t][Math.max(o-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}function sT(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Zo(e,t,n){Jt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const Zx=e=>{const t=ss(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:se(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":Av(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":Av(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};Zo(r.variables,e.breakpoints,"breakpoint"),Zo(r.variables,e.spacing,"spacing"),Zo(r.variables,e.fontSizes,"font-size"),Zo(r.variables,e.lineHeights,"line-height"),Zo(r.variables,e.shadows,"shadow"),Zo(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),Jt(e.colors).forEach(o=>{const a=e.colors[o];if(sT(a)){Object.assign(r.light,fu({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,fu({theme:e,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0}));return}a.forEach((l,u)=>{r.variables[`--mantine-color-${o}-${u}`]=l}),Object.assign(r.light,fu({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,fu({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return Jt(i).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=i[o].fontSize,r.variables[`--mantine-${o}-line-height`]=i[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=i[o].fontWeight||e.headings.fontWeight}),r};function uT({theme:e,generator:t}){const n=Zx(e),r=t==null?void 0:t(e);return r?_m(n,r):n}const pd=Zx(Im);function cT(e){const t={variables:{},light:{},dark:{}};return Jt(e.variables).forEach(n=>{pd.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Jt(e.light).forEach(n=>{pd.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Jt(e.dark).forEach(n=>{pd.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function fT(e){return` + `+C:""),this.inner=C||null):typeof x=="object"&&(this.message="".concat(x.name," ").concat(x.message),this.inner=x):(this.message=De[f]||h,this.inner=null)}return k(y).from($e),s[f]=y,s},{});ae.Syntax=SyntaxError,ae.Type=TypeError,ae.Range=RangeError;var _e=fn.reduce(function(s,f){return s[f+"Error"]=ae[f],s},{}),Je=ir.reduce(function(s,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(s[f+"Error"]=ae[f]),s},{});function Ie(){}function qe(s){return s}function xt(s,f){return s==null||s===qe?f:function(h){return f(s(h))}}function gt(s,f){return function(){s.apply(this,arguments),f.apply(this,arguments)}}function At(s,f){return s===Ie?f:function(){var h=s.apply(this,arguments);h!==void 0&&(arguments[0]=h);var y=this.onsuccess,x=this.onerror;this.onsuccess=null,this.onerror=null;var C=f.apply(this,arguments);return y&&(this.onsuccess=this.onsuccess?gt(y,this.onsuccess):y),x&&(this.onerror=this.onerror?gt(x,this.onerror):x),C!==void 0?C:h}}function nn(s,f){return s===Ie?f:function(){s.apply(this,arguments);var h=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),h&&(this.onsuccess=this.onsuccess?gt(h,this.onsuccess):h),y&&(this.onerror=this.onerror?gt(y,this.onerror):y)}}function Vn(s,f){return s===Ie?f:function(h){var y=s.apply(this,arguments);u(h,y);var x=this.onsuccess,C=this.onerror;return this.onsuccess=null,this.onerror=null,h=f.apply(this,arguments),x&&(this.onsuccess=this.onsuccess?gt(x,this.onsuccess):x),C&&(this.onerror=this.onerror?gt(C,this.onerror):C),y===void 0?h===void 0?void 0:h:u(y,h)}}function cn(s,f){return s===Ie?f:function(){return f.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function Dt(s,f){return s===Ie?f:function(){var h=s.apply(this,arguments);if(h&&typeof h.then=="function"){for(var y=this,x=arguments.length,C=new Array(x);x--;)C[x]=arguments[x];return h.then(function(){return f.apply(y,C)})}return f.apply(this,arguments)}}Je.ModifyError=Me,Je.DexieError=N,Je.BulkError=Te;var Ut=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function yt(s){Ut=s}var Mt={},Nn=100,Yr=typeof Promise>"u"?[]:function(){var s=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[s,c(s),s];var f=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[f,c(f),s]}(),fn=Yr[0],ir=Yr[1],Yr=Yr[2],ir=ir&&ir.then,te=fn&&fn.constructor,he=!!Yr,Ae=function(s,f){$t.push([s,f]),lt&&(queueMicrotask(rf),lt=!1)},Ue=!0,lt=!0,Ot=[],In=[],zt=qe,rn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},Re=rn,$t=[],dn=0,on=[];function be(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Re;if(typeof s!="function"){if(s!==Mt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&hi(this,this._value))}this._state=null,this._value=null,++f.ref,function h(y,x){try{x(function(C){if(y._state===null){if(C===y)throw new TypeError("A promise cannot be resolved with itself.");var T=y._lib&&Wr();C&&typeof C.then=="function"?h(y,function(A,B){C instanceof be?C._then(A,B):C.then(A,B)}):(y._state=!0,y._value=C,Ho(y)),T&&Kr()}},hi.bind(null,y))}catch(C){hi(y,C)}}(this,s)}var Uo={get:function(){var s=Re,f=Le;function h(y,x){var C=this,T=!s.global&&(s!==Re||f!==Le),A=T&&!Pe(),B=new be(function(z,K){Va(C,new Vo(Kt(y,s,T,A),Kt(x,s,T,A),z,K,s))});return this._consoleTask&&(B._consoleTask=this._consoleTask),B}return h.prototype=Mt,h},set:function(s){v(this,"then",s&&s.prototype===Mt?Uo:{get:function(){return s},set:Uo.set})}};function Vo(s,f,h,y,x){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof f=="function"?f:null,this.resolve=h,this.reject=y,this.psd=x}function hi(s,f){var h,y;In.push(f),s._state===null&&(h=s._lib&&Wr(),f=zt(f),s._state=!1,s._value=f,y=s,Ot.some(function(x){return x._value===y._value})||Ot.push(y),Ho(s),h&&Kr())}function Ho(s){var f=s._listeners;s._listeners=[];for(var h=0,y=f.length;h.",qr="String expected.",Hn=[],En="__dbnames",gi="readonly",yi="readwrite";function nr(s,f){return s?f?function(){return s.apply(this,arguments)&&f.apply(this,arguments)}:s:f}var Qe={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function wt(s){return typeof s!="string"||/\./.test(s)?function(f){return f}:function(f){return f[s]===void 0&&s in f&&delete(f=oe(f))[s],f}}function mn(){throw ae.Type()}function ze(s,f){try{var h=rr(s),y=rr(f);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return fee+re&&X(ee+q)})})}var Z=Ko(h)&&h.limit===1/0&&(typeof s!="function"||s===lf)&&{index:h.index,range:h.range};return X(0).then(function(){if(0<$.length)throw new Me("Error modifying one or more objects",$,H,Y);return V.length})})})},ut.prototype.delete=function(){var s=this._ctx,f=s.range;return Ko(s)&&(s.isPrimKey||f.type===3)?this._write(function(h){var y=s.table.core.schema.primaryKey,x=f;return s.table.core.count({trans:h,query:{index:y,range:x}}).then(function(C){return s.table.core.mutate({trans:h,type:"deleteRange",range:x}).then(function(T){var A=T.failures;if(T.lastResult,T.results,T=T.numFailures,T)throw new Me("Could not delete some values",Object.keys(A).map(function(B){return A[B]}),C-T);return C-T})})}):this.modify(lf)},ut);function ut(){}var lf=function(s,f){return f.value=null};function pS(s,f){return s=q})).length!==0?(K.forEach(function(X){Y.push(function(){var Z=V,ee=X._cfg.dbschema;Ds(M,Z,H),Ds(M,ee,H),V=M._dbSchema=ee;var re=pf(Z,ee);re.add.forEach(function(Ce){hf(H,Ce[0],Ce[1].primKey,Ce[1].indexes)}),re.change.forEach(function(Ce){if(Ce.recreate)throw new ae.Upgrade("Not yet support for changing primary key");var ve=H.objectStore(Ce.name);Ce.add.forEach(function(Ye){return Ls(ve,Ye)}),Ce.change.forEach(function(Ye){ve.deleteIndex(Ye.name),Ls(ve,Ye)}),Ce.del.forEach(function(Ye){return ve.deleteIndex(Ye)})});var ue=X._cfg.contentUpgrade;if(ue&&X._cfg.version>q){Ns(M,H),$._memoizedTables={};var ke=U(ee);re.del.forEach(function(Ce){ke[Ce]=Z[Ce]}),df(M,[M.Transaction.prototype]),Is(M,[M.Transaction.prototype],a(ke),ke),$.schema=ke;var me,xe=Oe(ue);return xe&&Ve(),re=be.follow(function(){var Ce;(me=ue($))&&xe&&(Ce=Pe.bind(null,null),me.then(Ce,Ce))}),me&&typeof me.then=="function"?be.resolve(me):re.then(function(){return me})}}),Y.push(function(Z){var ee,re,ue=X._cfg.dbschema;ee=ue,re=Z,[].slice.call(re.db.objectStoreNames).forEach(function(ke){return ee[ke]==null&&re.db.deleteObjectStore(ke)}),df(M,[M.Transaction.prototype]),Is(M,[M.Transaction.prototype],M._storeNames,M._dbSchema),$.schema=M._dbSchema}),Y.push(function(Z){M.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(M.idbdb.version/10)===X._cfg.version?(M.idbdb.deleteObjectStore("$meta"),delete M._dbSchema.$meta,M._storeNames=M._storeNames.filter(function(ee){return ee!=="$meta"})):Z.objectStore("$meta").put(X._cfg.version,"version"))})}),function X(){return Y.length?be.resolve(Y.shift()($.idbtrans)).then(X):be.resolve()}().then(function(){wg(V,H)})):be.resolve();var M,q,$,H,Y,V}).catch(T)):(a(x).forEach(function(K){hf(h,K,x[K].primKey,x[K].indexes)}),Ns(s,h),void be.follow(function(){return s.on.populate.fire(C)}).catch(T));var B,z})}function bS(s,f){wg(s._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var h=As(0,s.idbdb,f);Ds(s,s._dbSchema,f);for(var y=0,x=pf(h,s._dbSchema).change;yMath.pow(2,62)?0:V.oldVersion,M=V<1,s.idbdb=Y.result,C&&bS(s,K),xS(s,V/10,K,$))},$),Y.onsuccess=D(function(){K=null;var V,X,Z,ee,re,ue=s.idbdb=Y.result,ke=w(ue.objectStoreNames);if(0"u"?be.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(q){function $(){return indexedDB.databases().finally(q)}B=setInterval($,100),$()}).finally(function(){return clearInterval(B)}):Promise.resolve()).then(A)]).then(function(){return T(),f.onReadyBeingFired=[],be.resolve(yf(function(){return s.on.ready.fire(s.vip)})).then(function q(){if(0f.limit?q.length=f.limit:s.length===f.limit&&q.length=X.limit&&(!X.values||ue.req.values)&&OS(ue.req.query.range,X.query.range)}),!1,Z,ee];case"count":return re=ee.find(function(ue){return Tg(ue.req.query.range,X.query.range)}),[re,!!re,Z,ee]}}(f,h,"query",C),K=z[0],M=z[1],q=z[2],$=z[3];return K&&M?K.obsSet=C.obsSet:(M=y.query(C).then(function(H){var Y=H.result;if(K&&(K.res=Y),T){for(var V=0,X=Y.length;V{const[t,n]=j.useState([]),[r,i]=j.useState([]),[o,a]=j.useState(!1),[l,u]=j.useState(Date.now().toString()),[c,p]=j.useState([]),[d,m]=j.useState(0),g=j.useRef(t),v=j.useRef(r);j.useEffect(()=>{console.log("apiContext updated: ",t)},[t]);const k=async()=>{var Q;const W=await Tv();if(W.length>0&&W[0]&&((Q=W[0])!=null&&Q.id)&&Date.now()-W[0].timestamp<=30*60*1e3){const fe={participant_id:W[0].id,name:W[0].name};window.mica_jsmo_module.fetchSavedQueries(fe,ge=>{if(ge.current_session&&ge.current_session.length>0){const we={session_id:Date.now().toString(),queries:ge.current_session};S(we)}},ge=>{console.error("Error fetching session:",ge)})}},_=W=>{g.current=W,n(W)},b=async()=>{l&&v.current.length>0&&(await w2(l)?await y2(l,v.current):await g2(l,Date.now(),v.current))},w=async(W,Q=!0)=>{v.current=W,i(W),Q&&await b()},E=async W=>{var ne;const Q=await Tv();if((ne=Q[0])!=null&&ne.id){const oe=v.current.length,fe=[...g.current,{role:W.role,content:W.content,index:oe,user_id:Q[0].id}];if(_(fe),W.role=="system")return;const ge=[...v.current,{user_content:W.role==="user"?W.content:null,assistant_content:W.role==="assistant"?W.content:null,timestamp:new Date().getTime()}];w(ge)}},O=async(W,Q)=>{const{response:ne,usage:oe,id:fe,model:ge}=W,we=[...v.current];we[Q]={...we[Q],assistant_content:ne.content,input_tokens:oe?oe.prompt_tokens:null,output_tokens:oe?oe.completion_tokens:null,input_cost:oe?oe.input_cost:null,output_cost:oe?oe.output_cost:null,id:fe||null,model:ge||null},await w(we);const Ee=[...g.current,{role:"assistant",content:ne.content,index:Q}];_(Ee)},I=async()=>{const W=Date.now().toString();m(0),p([]),u(W);const Q=g.current.filter(ne=>ne.role==="system");v.current=[],g.current=Q,i([]),n(Q)},S=async W=>{u(W.session_id),p(W.queries),m(W.queries.length),w(W.queries)},L=async(W,Q)=>{if(g.current.length===0){const fe=window.mica_jsmo_module.getInitialSystemContext().pop();console.log("initial apiContext, if empty , inject system context before first query",fe),await E(fe)}await E({role:"user",content:W.content});const ne=v.current.length-1,oe=[...g.current];console.log("calling callAI with ",oe),window.mica_jsmo_module.callAI(oe,fe=>{fe&&fe.response?(O(fe,ne),Q&&Q()):console.log("Unexpected response format:",fe)},fe=>{console.log("callAI error",fe),Q&&Q()})},U=async(W,Q)=>{const ne=[...v.current];ne[W]={...ne[W],rating:Q},await w(ne)},G=async W=>{const Q=[...v.current];Q.splice(W,1);const ne=g.current.filter(oe=>oe.index!==W);ne.forEach((oe,fe)=>{oe.index>W&&(oe.index-=1)}),w(Q),_(ne)};return R.jsx($o.Provider,{value:{messages:c,addMessage:E,clearMessages:I,replaceSession:S,showRatingPO:o,setShowRatingPO:a,msgCount:d,setMsgCount:m,sessionId:l,setSessionId:u,callAjax:L,chatContext:r,updateChatContext:w,updateVote:U,deleteInteraction:G,fetchSavedSession:k},children:e})},Wx=j.createContext();function S2(){const[e,t]=j.useState(!1),n=async()=>{try{const i=await So.table("current_user").toArray();return i.length?i[0]:null}catch(i){return console.error("Failed to retrieve user from cache:",i),null}},r=async i=>{let{participant_id:o,name:a}=i==null?void 0:i.user;if(o&&a){let l={id:parseInt(o),name:a,timestamp:Date.now()};await So.current_user.clear(),await So.current_user.put(l)}else console.log("unable to cache user... skipping")};return{authed:e,login(i,o){return new Promise(async(a,l)=>{try{const u=await n();if(u){let p=Date.now()-u.timestamp<=30*60*1e3;if(u.name===i&&p)t(!0),a("pass");else if(mica_jsmo_module){let m=await mica_jsmo_module.login({name:i,email:o},a,l)}}else if(mica_jsmo_module){let p=await mica_jsmo_module.login({name:i,email:o},a,l)}else console.error("MICA EM is not injected, cannot execute function login"),l()}catch(u){console.error("Login failed: ",u),l(u)}})},logout(){return new Promise(i=>{t(!1),i()})},verifyEmail(i){return new Promise(async(o,a)=>{mica_jsmo_module?await mica_jsmo_module.verifyEmail({code:i},u=>{console.log("valid user, logging in..."),r(u),t(!0),o(u)},a):(console.error("MICA EM is not injected, cannot execute function login"),a())})}}}function k2({children:e}){const t=S2();return R.jsx(Wx.Provider,{value:t,children:e})}function Em(){return j.useContext(Wx)}function Cm(){const e=km(),{clearMessages:t}=j.useContext($o),{logout:n}=Em(),r=async()=>{await So.current_user.clear(),await t(),await n(),e("/")},i=async()=>{if(mica_jsmo_module){const a=await So.current_user.toArray();if(a.length>0){const{id:l,name:u}=a[0];mica_jsmo_module.completeSession({participant_id:l},async c=>{console.log("Session ended successfully."),r()},c=>{console.error("Error ending session:",c),r()})}else console.error("No user data found in IndexedDB"),r()}else console.error("MICA EM is not injected, cannot execute endSession"),r()};return R.jsxs(gs,{className:"rcchat_header handle",children:[R.jsxs("h1",{children:[R.jsx("span",{className:"logo"}),"MICA AI Chatbot"]}),R.jsxs("div",{className:"buttons",children:[R.jsx("button",{onClick:i,children:"End Session"}),R.jsx("button",{onClick:r,children:R.jsx(fm,{size:20})})]})]})}function Kx(){const e=j.useContext($o),[t,n]=j.useState("Ask a question..."),[r,i]=j.useState(""),[o,a]=j.useState(!1),l=()=>{r.trim()!==""&&(a(!0),e.callAjax({role:"user",content:r},()=>a(!1)),i(""))},u=c=>{c.key==="Enter"&&(c.preventDefault(),l())};return j.useEffect(()=>{o||a(!1)},[e.chatContext]),R.jsxs(gs,{className:"container footer",children:[R.jsx("button",{onClick:e.clearMessages,className:"clear_chat",children:R.jsx(dm,{color:"#ccc",size:20})}),R.jsx("input",{className:"user_input",placeholder:t,value:r,onChange:c=>i(c.target.value),onKeyDown:u}),R.jsx("div",{className:"send-container",children:R.jsxs("button",{onClick:l,children:[R.jsx(hm,{color:"#ccc",size:20,className:`send ${o?"off":""}`}),R.jsx(cm,{color:"#ccc",size:20,className:`sendfill ${o?"rotate":""}`})]})})]})}function Jt(e){return Object.keys(e)}function sd(e){return e&&typeof e=="object"&&!Array.isArray(e)}function _m(e,t){const n={...e},r=t;return sd(e)&&sd(t)&&Object.keys(t).forEach(i=>{sd(r[i])&&i in e?n[i]=_m(n[i],r[i]):n[i]=r[i]}),n}function E2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function C2(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Bp(e){const t=C2(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function ud(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function qx(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?ud(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?ud(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const o=`${Number(i)/16}${e}`;return t?ud(o):o}}return r}return n}const se=qx("rem",{shouldScale:!0}),Rv=qx("em");function $a(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Yx(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Pm(e){const t=j.createContext(null);return[({children:i,value:o})=>R.jsx(t.Provider,{value:o,children:i}),()=>{const i=j.useContext(t);if(i===null)throw new Error(e);return i}]}function _2(e=null){const t=j.createContext(e);return[({children:i,value:o})=>R.jsx(t.Provider,{value:o,children:i}),()=>j.useContext(t)]}function mr(e,t="size",n=!0){if(e!==void 0)return Yx(e)?n?se(e):e:`var(--${t}-${e})`}function ko(e){return mr(e,"mantine-spacing")}function Fa(e){return e===void 0?"var(--mantine-radius-default)":mr(e,"mantine-radius")}function Br(e){return mr(e,"mantine-font-size")}function P2(e){return mr(e,"mantine-line-height",!1)}function O2(e){if(e)return mr(e,"mantine-shadow",!1)}function T2(e,t){return e in t.breakpoints?Bp(t.breakpoints[e]):Bp(e)}function Om(e,t){const n=e.map(r=>({value:r,px:T2(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function yo(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function R2(e,t,n){return n===void 0?Math.max(e,t):Math.min(Math.max(e,t),n)}function j2(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function N2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function I2(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function L2(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=j.useState(n?t:I2(e)),o=j.useRef();return j.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),i(o.current.matches),N2(o.current,a=>i(a.matches))},[e]),r}const Tm=typeof document<"u"?j.useLayoutEffect:j.useEffect;function A2(e,t){const n=j.useRef(!1);j.useEffect(()=>()=>{n.current=!1},[]),j.useEffect(()=>{if(n.current)return e();n.current=!0},t)}const D2=ot.useId||(()=>{});function M2(){const e=D2();return e?`mantine-${e.replace(/:/g,"")}`:""}function Qx(e){const t=M2(),[n,r]=j.useState(t);return Tm(()=>{r(j2())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function z2(e,t){return L2("(prefers-reduced-motion: reduce)",e,t)}function Gx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=Ji(t[r],i):t[r]=i})}),t}function Rm({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,n,r):a||$2);return F2(o)}function Up({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,a)=>typeof a=="function"?{...o,...a(e,n,r)}:{...o,...a},{})}const Xx=j.createContext(null);function Fo(){const e=j.useContext(Xx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function B2(){return Fo().cssVariablesResolver}function U2(){return Fo().classNamesPrefix}function jm(){return Fo().getStyleNonce}function V2(){return Fo().withStaticClasses}function H2(){return Fo().headless}function W2(){var e;return(e=Fo().stylesTransform)==null?void 0:e.sx}function K2(){var e;return(e=Fo().stylesTransform)==null?void 0:e.styles}function q2(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Y2(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,o=n&255;return{r,g:i,b:o,a:1}}function Q2(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i||1}}function G2(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,a=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*o-1))*i,u=r/60,c=l*(1-Math.abs(u%2-1)),p=o-l/2;let d,m,g;return u>=0&&u<1?(d=l,m=c,g=0):u>=1&&u<2?(d=c,m=l,g=0):u>=2&&u<3?(d=0,m=l,g=c):u>=3&&u<4?(d=0,m=c,g=l):u>=4&&u<5?(d=c,m=0,g=l):(d=l,m=0,g=c),{r:Math.round((d+p)*255),g:Math.round((m+p)*255),b:Math.round((g+p)*255),a:a||1}}function Nm(e){return q2(e)?Y2(e):e.startsWith("rgb")?Q2(e):e.startsWith("hsl")?G2(e):{r:0,g:0,b:0,a:1}}function cu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:o}=Nm(e),a=1-t,l=u=>Math.round(u*a);return`rgba(${l(n)}, ${l(r)}, ${l(i)}, ${o})`}function ss(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function cd(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function X2(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function J2(e){if(e.startsWith("oklch("))return(X2(e)||0)/100;const{r:t,g:n,b:r}=Nm(e),i=t/255,o=n/255,a=r/255,l=cd(i),u=cd(o),c=cd(a);return .2126*l+.7152*u+.0722*c}function dl(e,t=.179){return e.startsWith("var(")?!1:J2(e)>t}function ks({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:dl(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:dl(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:dl(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),o=i?Number(i):void 0,a=r in t.colors;if(a){const l=o!==void 0?t.colors[r][o]:t.colors[r][ss(t,n||"light")];return{color:r,value:l,shade:o,isThemeColor:a,isLight:dl(l,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:dl(e,t.luminanceThreshold),shade:o,variable:void 0}}function dc(e,t){const n=ks({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Vp(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=dc(n.from,t),i=dc(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function Gr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=Nm(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Jo=Gr,Z2=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const o=ks({color:e,theme:t}),a=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const l=a&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${se(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:l,border:`${se(1)} solid transparent`}:{background:e,hover:cu(e,.1),color:l,border:`${se(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`};const l=t.colors[o.color][o.shade];return{background:Gr(l,.1),hover:Gr(l,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}}return{background:Gr(e,.1),hover:Gr(e,.12),color:e,border:`${se(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${se(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Gr(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${se(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:Gr(e,.05),color:e,border:`${se(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`};const l=t.colors[o.color][o.shade];return{background:"transparent",hover:Gr(l,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}}return{background:"transparent",hover:Gr(e,.12),color:e,border:`${se(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${se(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${se(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${se(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${se(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${se(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:cu(t.white,.01),color:e,border:`${se(1)} solid transparent`}:n==="gradient"?{background:Vp(r,t),hover:Vp(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${se(1)} solid var(--mantine-color-default-border)`}:{}},eT={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},jv="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Im={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:eT,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:Z2,autoContrast:!1,luminanceThreshold:.3,fontFamily:jv,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:jv,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:se(34),lineHeight:"1.3"},h2:{fontSize:se(26),lineHeight:"1.35"},h3:{fontSize:se(22),lineHeight:"1.4"},h4:{fontSize:se(18),lineHeight:"1.45"},h5:{fontSize:se(16),lineHeight:"1.5"},h6:{fontSize:se(14),lineHeight:"1.5"}}},fontSizes:{xs:se(12),sm:se(14),md:se(16),lg:se(18),xl:se(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:se(2),sm:se(4),md:se(8),lg:se(16),xl:se(32)},spacing:{xs:se(10),sm:se(12),md:se(16),lg:se(20),xl:se(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), 0 ${se(1)} ${se(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(10)} ${se(15)} ${se(-5)}, rgba(0, 0, 0, 0.04) 0 ${se(7)} ${se(7)} ${se(-5)}`,md:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(20)} ${se(25)} ${se(-5)}, rgba(0, 0, 0, 0.04) 0 ${se(10)} ${se(10)} ${se(-5)}`,lg:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(28)} ${se(23)} ${se(-7)}, rgba(0, 0, 0, 0.04) 0 ${se(12)} ${se(12)} ${se(-7)}`,xl:`0 ${se(1)} ${se(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${se(36)} ${se(28)} ${se(-7)}, rgba(0, 0, 0, 0.04) 0 ${se(17)} ${se(17)} ${se(-7)}`},other:{},components:{}};function Nv(e){return e==="auto"||e==="dark"||e==="light"}function tT({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return Nv(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&Nv(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const nT="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Iv="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function fd(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Lv(e){if(!(e.primaryColor in e.colors))throw new Error(nT);if(typeof e.primaryShade=="object"&&(!fd(e.primaryShade.dark)||!fd(e.primaryShade.light)))throw new Error(Iv);if(typeof e.primaryShade=="number"&&!fd(e.primaryShade))throw new Error(Iv)}function rT(e,t){var r;if(!t)return Lv(e),e;const n=_m(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Lv(n),n}const Lm=j.createContext(null),iT=()=>j.useContext(Lm)||Im;function Vr(){const e=j.useContext(Lm);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function Jx({theme:e,children:t,inherit:n=!0}){const r=iT(),i=j.useMemo(()=>rT(n?r:Im,e),[e,r,n]);return R.jsx(Lm.Provider,{value:i,children:t})}Jx.displayName="@mantine/core/MantineThemeProvider";function oT(){const e=Vr(),t=jm(),n=Jt(e.breakpoints).reduce((r,i)=>{const o=e.breakpoints[i].includes("px"),a=Bp(e.breakpoints[i]),l=o?`${a-.1}px`:Rv(a-.1),u=o?`${a}px`:Rv(a);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${u}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return R.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function dd(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function pl(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function aT(e,t){const n=dd(e.variables),r=n?pl(t,n):"",i=dd(e.dark),o=dd(e.light),a=i?pl(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",l=o?pl(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${a}${l}`}function lT({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&ks({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Av(e,t){return lT({color:e.colors[e.primaryColor][ss(e,t)],theme:e,autoContrast:null})}function fu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const l=ss(e,"light"),u={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:Jo(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:Jo(e.colors[t][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:Jo(e.colors[t][l],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...u}:u}const o=ss(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Jo(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Jo(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Jo(e.colors[t][Math.max(o-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}function sT(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Zo(e,t,n){Jt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const Zx=e=>{const t=ss(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:se(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":Av(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":Av(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};Zo(r.variables,e.breakpoints,"breakpoint"),Zo(r.variables,e.spacing,"spacing"),Zo(r.variables,e.fontSizes,"font-size"),Zo(r.variables,e.lineHeights,"line-height"),Zo(r.variables,e.shadows,"shadow"),Zo(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),Jt(e.colors).forEach(o=>{const a=e.colors[o];if(sT(a)){Object.assign(r.light,fu({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,fu({theme:e,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0}));return}a.forEach((l,u)=>{r.variables[`--mantine-color-${o}-${u}`]=l}),Object.assign(r.light,fu({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,fu({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return Jt(i).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=i[o].fontSize,r.variables[`--mantine-${o}-line-height`]=i[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=i[o].fontWeight||e.headings.fontWeight}),r};function uT({theme:e,generator:t}){const n=Zx(e),r=t==null?void 0:t(e);return r?_m(n,r):n}const pd=Zx(Im);function cT(e){const t={variables:{},light:{},dark:{}};return Jt(e.variables).forEach(n=>{pd.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Jt(e.light).forEach(n=>{pd.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Jt(e.dark).forEach(n=>{pd.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function fT(e){return` ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; } ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; } `}function eb({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Vr(),r=jm(),i=B2(),o=uT({theme:n,generator:i}),a=e===":root"&&t,l=a?cT(o):o,u=aT(l,e);return u?R.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${u}${a?"":fT(e)}`}}):null}eb.displayName="@mantine/CssVariables";function dT(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function ea(e,t){var r;const n=e!=="auto"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";(r=t())==null||r.setAttribute("data-mantine-color-scheme",n)}function pT({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=j.useRef(),[o,a]=j.useState(()=>e.get(t)),l=r||o,u=j.useCallback(p=>{r||(ea(p,n),a(p),e.set(p))},[e.set,l,r]),c=j.useCallback(()=>{a(t),ea(t,n),e.clear()},[e.clear,t]);return j.useEffect(()=>(e.subscribe(u),e.unsubscribe),[e.subscribe,e.unsubscribe]),Tm(()=>{ea(e.get(t),n)},[]),j.useEffect(()=>{var d;if(r)return ea(r,n),()=>{};r===void 0&&ea(o,n),i.current=window.matchMedia("(prefers-color-scheme: dark)");const p=m=>{o==="auto"&&ea(m.matches?"dark":"light",n)};return(d=i.current)==null||d.addEventListener("change",p),()=>{var m;return(m=i.current)==null?void 0:m.removeEventListener("change",p)}},[o,r]),{colorScheme:l,setColorScheme:u,clearColorScheme:c}}function hT({respectReducedMotion:e,getRootElement:t}){Tm(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}dT();function tb({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:o=!0,withCssVariables:a=!0,cssVariablesSelector:l=":root",classNamesPrefix:u="mantine",colorSchemeManager:c=tT(),defaultColorScheme:p="light",getRootElement:d=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:g,stylesTransform:v}){const{colorScheme:k,setColorScheme:_,clearColorScheme:b}=pT({defaultColorScheme:p,forceColorScheme:g,manager:c,getRootElement:d});return hT({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:d}),R.jsx(Xx.Provider,{value:{colorScheme:k,setColorScheme:_,clearColorScheme:b,getRootElement:d,classNamesPrefix:u,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:v},children:R.jsxs(Jx,{theme:e,children:[a&&R.jsx(eb,{cssVariablesSelector:l,deduplicateCssVariables:o}),i&&R.jsx(oT,{}),t]})})}tb.displayName="@mantine/core/MantineProvider";const mT={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function gT({theme:e,options:t,unstyled:n}){return Ji((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||mT[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function yT({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return Rm({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Dv({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return Rm({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function vT({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function wT({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function xT({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function bT({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(o=>{var a,l;return(l=Rm({theme:t,classNames:(a=t.components[o])==null?void 0:a.classNames,props:r,stylesCtx:i}))==null?void 0:l[n]})}function ST({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function kT({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:o,classes:a,unstyled:l,className:u,rootSelector:c,props:p,stylesCtx:d,withStaticClasses:m,headless:g,transformedStyles:v}){return Ji(gT({theme:e,options:t,unstyled:l||g}),bT({theme:e,themeName:n,selector:r,props:p,stylesCtx:d}),ST({options:t,classes:a,selector:r,unstyled:l}),Dv({selector:r,stylesCtx:d,theme:e,classNames:o,props:p}),Dv({selector:r,stylesCtx:d,theme:e,classNames:v,props:p}),yT({selector:r,stylesCtx:d,options:t,props:p,theme:e}),vT({rootSelector:c,selector:r,className:u}),wT({selector:r,classes:a,unstyled:l||g}),m&&!g&&xT({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function ET({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(o=>{var a;return Up({theme:e,styles:(a=e.components[o])==null?void 0:a.styles,props:n,stylesCtx:r})[i]}).reduce((o,a)=>({...o,...a}),{})}function Hp({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Hp({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function CT(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...$a(n[r])}}),t),{})}function _T({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:o,themeName:a,headless:l}){var u;return(u=CT([l?{}:t==null?void 0:t(n,r,i),...a.map(c=>{var p,d,m;return(m=(d=(p=n.components)==null?void 0:p[c])==null?void 0:d.vars)==null?void 0:m.call(d,n,r,i)}),e==null?void 0:e(n,r,i)]))==null?void 0:u[o]}function PT({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:o,rootSelector:a,styles:l,style:u,vars:c,varsResolver:p,headless:d,withStylesTransform:m}){return{...!m&&ET({theme:e,themeName:t,props:i,stylesCtx:o,selector:n}),...!m&&Up({theme:e,styles:l,props:i,stylesCtx:o})[n],...!m&&Up({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:o})[n],..._T({theme:e,props:i,stylesCtx:o,vars:c,varsResolver:p,selector:n,themeName:t,headless:d}),...a===n?Hp({style:u,theme:e}):null,...Hp({style:r==null?void 0:r.style,theme:e})}}function OT({props:e,stylesCtx:t,themeName:n}){var a;const r=Vr(),i=(a=K2())==null?void 0:a();return{getTransformedStyles:l=>i?[...l.map(c=>i(c,{props:e,theme:r,ctx:t})),...n.map(c=>{var p;return i((p=r.components[c])==null?void 0:p.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!i}}function Wt({name:e,classes:t,props:n,stylesCtx:r,className:i,style:o,rootSelector:a="root",unstyled:l,classNames:u,styles:c,vars:p,varsResolver:d}){const m=Vr(),g=U2(),v=V2(),k=H2(),_=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:b,getTransformedStyles:w}=OT({props:n,stylesCtx:r,themeName:_});return(E,O)=>({className:kT({theme:m,options:O,themeName:_,selector:E,classNamesPrefix:g,classNames:u,classes:t,unstyled:l,className:i,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:v,headless:k,transformedStyles:w([O==null?void 0:O.styles,c])}),style:PT({theme:m,themeName:_,selector:E,options:O,props:n,stylesCtx:r,rootSelector:a,styles:c,style:o,vars:p,varsResolver:d,headless:k,withStylesTransform:b})})}function dt(e,t,n){var a;const r=Vr(),i=(a=r.components[e])==null?void 0:a.defaultProps,o=typeof i=="function"?i(r):i;return{...t,...o,...$a(n)}}function hd(e){return Jt(e).reduce((t,n)=>e[n]!==void 0?`${t}${E2(n)}:${e[n]};`:t,"").trim()}function TT({selector:e,styles:t,media:n,container:r}){const i=t?hd(t):"",o=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${hd(l.styles)}}}`):[],a=Array.isArray(r)?r.map(l=>`@container ${l.query}{${e}{${hd(l.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${o.join("")}${a.join("")}`.trim()}function Bc(e){const t=jm();return R.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:TT(e)}})}function Am(e){const{m:t,mx:n,my:r,mt:i,mb:o,ml:a,mr:l,me:u,ms:c,p,px:d,py:m,pt:g,pb:v,pl:k,pr:_,pe:b,ps:w,bd:E,bg:O,c:I,opacity:S,ff:L,fz:U,fw:G,lts:W,ta:Q,lh:ne,fs:oe,tt:fe,td:ge,w:we,miw:Ee,maw:ie,h:ce,mih:P,mah:Oe,bgsz:De,bgp:N,bgr:Fe,bga:Me,pos:Te,top:Ne,left:$e,bottom:ae,right:_e,inset:Je,display:Ie,flex:qe,hiddenFrom:xt,visibleFrom:gt,lightHidden:At,darkHidden:nn,sx:Vn,...cn}=e;return{styleProps:$a({m:t,mx:n,my:r,mt:i,mb:o,ml:a,mr:l,me:u,ms:c,p,px:d,py:m,pt:g,pb:v,pl:k,pr:_,pe:b,ps:w,bd:E,bg:O,c:I,opacity:S,ff:L,fz:U,fw:G,lts:W,ta:Q,lh:ne,fs:oe,tt:fe,td:ge,w:we,miw:Ee,maw:ie,h:ce,mih:P,mah:Oe,bgsz:De,bgp:N,bgr:Fe,bga:Me,pos:Te,top:Ne,left:$e,bottom:ae,right:_e,inset:Je,display:Ie,flex:qe,hiddenFrom:xt,visibleFrom:gt,lightHidden:At,darkHidden:nn,sx:Vn}),rest:cn}}const RT={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function Dm(e,t){const n=ks({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function jT(e,t){const n=ks({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Dm(e,t)}function NT(e,t){if(typeof e=="number")return se(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(a=>a.trim()!=="");let o=`${se(n)}`;return r&&(o+=` ${r}`),i.length>0&&(o+=` ${Dm(i.join(" "),t)}`),o.trim()}return e}const Mv={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function IT(e){return typeof e=="string"&&e in Mv?Mv[e]:e}const LT=["h1","h2","h3","h4","h5","h6"];function AT(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&<.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?se(e):e}function DT(e){return e}const MT=["h1","h2","h3","h4","h5","h6"];function zT(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&MT.includes(e)?`var(--mantine-${e}-line-height)`:e}function $T(e){return typeof e=="number"?se(e):e}function FT(e,t){if(typeof e=="number")return se(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return se(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const md={color:Dm,textColor:jT,fontSize:AT,spacing:FT,identity:DT,size:$T,lineHeight:zT,fontFamily:IT,border:NT};function zv(e){return e.replace("(min-width: ","").replace("em)","")}function BT({media:e,...t}){const r=Object.keys(e).sort((i,o)=>Number(zv(i))-Number(zv(o))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function UT(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function VT(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function HT(e){return typeof e=="object"&&e!==null?Jt(e).filter(t=>t!=="base"):[]}function WT(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function KT({styleProps:e,data:t,theme:n}){return BT(Jt(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const o=t[i],a=Array.isArray(o.property)?o.property:[o.property],l=VT(e[i]);if(!UT(e[i]))return a.forEach(c=>{r.inlineStyles[c]=md[o.type](l,n)}),r;r.hasResponsiveStyles=!0;const u=HT(e[i]);return a.forEach(c=>{l&&(r.styles[c]=md[o.type](l,n)),u.forEach(p=>{const d=`(min-width: ${n.breakpoints[p]})`;r.media[d]={...r.media[d],[c]:md[o.type](WT(e[i],p),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Uc(){return`__m__-${j.useId().replace(/:/g,"")}`}function nb(e){return e.startsWith("data-")?e:`data-${e}`}function qT(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[nb(n)]=e[n]),t},{})}function rb(e){return e?typeof e=="string"?{[nb(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...rb(n)}),{}):qT(e):null}function Wp(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Wp(r,t)}),{}):typeof e=="function"?e(t):e??{}}function YT({theme:e,style:t,vars:n,styleProps:r}){const i=Wp(t,e),o=Wp(n,e);return{...i,...o,...r}}const ib=j.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:o,size:a,hiddenFrom:l,visibleFrom:u,lightHidden:c,darkHidden:p,renderRoot:d,__size:m,...g},v)=>{var U;const k=Vr(),_=e||"div",{styleProps:b,rest:w}=Am(g),E=W2(),O=(U=E==null?void 0:E())==null?void 0:U(b.sx),I=Uc(),S=KT({styleProps:b,theme:k,data:RT}),L={ref:v,style:YT({theme:k,style:t,vars:n,styleProps:S.inlineStyles}),className:Ji(r,O,{[I]:S.hasResponsiveStyles,"mantine-light-hidden":c,"mantine-dark-hidden":p,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${u}`]:u}),"data-variant":i,"data-size":Yx(a)?void 0:a||void 0,size:m,...rb(o),...w};return R.jsxs(R.Fragment,{children:[S.hasResponsiveStyles&&R.jsx(Bc,{selector:`.${I}`,styles:S.styles,media:S.media}),typeof d=="function"?d(L):R.jsx(_,{...L})]})});ib.displayName="@mantine/core/Box";const ft=ib;function ob(e){return e}function un(e){const t=j.forwardRef(e);return t.extend=ob,t.withProps=n=>{const r=j.forwardRef((i,o)=>R.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function Hr(e){const t=j.forwardRef(e);return t.withProps=n=>{const r=j.forwardRef((i,o)=>R.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=ob,t}const QT=j.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function GT(){return j.useContext(QT)}var ab={root:"m_87cf2631"};const XT={__staticSelector:"UnstyledButton"},Eo=Hr((e,t)=>{const n=dt("UnstyledButton",XT,e),{className:r,component:i="button",__staticSelector:o,unstyled:a,classNames:l,styles:u,style:c,...p}=n,d=Wt({name:o,props:n,classes:ab,className:r,style:c,classNames:l,styles:u,unstyled:a});return R.jsx(ft,{...d("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...p})});Eo.classes=ab;Eo.displayName="@mantine/core/UnstyledButton";var lb={root:"m_1b7284a3"};const JT={},ZT=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Fa(t),"--paper-shadow":O2(n)}}),Mm=Hr((e,t)=>{const n=dt("Paper",JT,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,withBorder:u,vars:c,radius:p,shadow:d,variant:m,mod:g,...v}=n,k=Wt({name:"Paper",props:n,classes:lb,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:ZT});return R.jsx(ft,{ref:t,mod:[{"data-with-border":u},g],...k("root"),variant:m,...v})});Mm.classes=lb;Mm.displayName="@mantine/core/Paper";const hl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${se(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),du={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${se(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${se(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${se(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${se(-30)}`},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${se(-20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${se(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${se(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${se(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...hl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...hl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...hl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...hl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...hl("top"),common:{transformOrigin:"top right"}}},$v={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function eR({transition:e,state:t,duration:n,timingFunction:r}){const i={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in du?{transitionProperty:du[e].transitionProperty,...i,...du[e].common,...du[e][$v[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[$v[t]]}}function tR({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:o,onEntered:a,onExited:l,enterDelay:u,exitDelay:c}){const p=Vr(),d=z2(),m=p.respectReducedMotion?d:!1,[g,v]=j.useState(m?0:e),[k,_]=j.useState(r?"entered":"exited"),b=j.useRef(-1),w=j.useRef(-1),E=j.useRef(-1),O=S=>{const L=S?i:o,U=S?a:l;window.clearTimeout(b.current);const G=m?0:S?e:t;v(G),G===0?(typeof L=="function"&&L(),typeof U=="function"&&U(),_(S?"entered":"exited")):E.current=requestAnimationFrame(()=>{Ni.flushSync(()=>{_(S?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),_(S?"entering":"exiting"),b.current=window.setTimeout(()=>{typeof U=="function"&&U(),_(S?"entered":"exited")},G)})})},I=S=>{if(window.clearTimeout(w.current),typeof(S?u:c)!="number"){O(S);return}w.current=window.setTimeout(()=>{O(S)},S?u:c)};return A2(()=>{I(r)},[r]),j.useEffect(()=>()=>{window.clearTimeout(b.current),cancelAnimationFrame(E.current)},[]),{transitionDuration:g,transitionStatus:k,transitionTimingFunction:n||"ease"}}function sb({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:o,timingFunction:a="ease",onExit:l,onEntered:u,onEnter:c,onExited:p,enterDelay:d,exitDelay:m}){const{transitionDuration:g,transitionStatus:v,transitionTimingFunction:k}=tR({mounted:i,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:u,onEnter:c,onExited:p,enterDelay:d,exitDelay:m});return g===0?i?R.jsx(R.Fragment,{children:o({})}):e?o({display:"none"}):null:v==="exited"?e?o({display:"none"}):null:R.jsx(R.Fragment,{children:o(eR({transition:t,duration:g,state:v,timingFunction:k}))})}sb.displayName="@mantine/core/Transition";var Er={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const nR=j.forwardRef(({className:e,...t},n)=>R.jsxs(ft,{component:"span",className:Ji(Er.barsLoader,e),...t,ref:n,children:[R.jsx("span",{className:Er.bar}),R.jsx("span",{className:Er.bar}),R.jsx("span",{className:Er.bar})]})),rR=j.forwardRef(({className:e,...t},n)=>R.jsxs(ft,{component:"span",className:Ji(Er.dotsLoader,e),...t,ref:n,children:[R.jsx("span",{className:Er.dot}),R.jsx("span",{className:Er.dot}),R.jsx("span",{className:Er.dot})]})),iR=j.forwardRef(({className:e,...t},n)=>R.jsx(ft,{component:"span",className:Ji(Er.ovalLoader,e),...t,ref:n})),ub={bars:nR,oval:iR,dots:rR},oR={loaders:ub,type:"oval"},aR=(e,{size:t,color:n})=>({root:{"--loader-size":mr(t,"loader-size"),"--loader-color":n?dc(n,e):void 0}}),Vc=un((e,t)=>{const n=dt("Loader",oR,e),{size:r,color:i,type:o,vars:a,className:l,style:u,classNames:c,styles:p,unstyled:d,loaders:m,variant:g,children:v,...k}=n,_=Wt({name:"Loader",props:n,classes:Er,className:l,style:u,classNames:c,styles:p,unstyled:d,vars:a,varsResolver:aR});return v?R.jsx(ft,{..._("root"),ref:t,...k,children:v}):R.jsx(ft,{..._("root"),ref:t,component:m[o],variant:g,size:r,...k})});Vc.defaultLoaders=ub;Vc.classes=Er;Vc.displayName="@mantine/core/Loader";const cb=j.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>R.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:R.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));cb.displayName="@mantine/core/CloseIcon";var fb={root:"m_86a44da5","root--subtle":"m_220c80f2"};const lR={variant:"subtle"},sR=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":mr(t,"cb-size"),"--cb-radius":n===void 0?void 0:Fa(n),"--cb-icon-size":se(r)}}),zm=Hr((e,t)=>{const n=dt("CloseButton",lR,e),{iconSize:r,children:i,vars:o,radius:a,className:l,classNames:u,style:c,styles:p,unstyled:d,"data-disabled":m,disabled:g,variant:v,icon:k,mod:_,...b}=n,w=Wt({name:"CloseButton",props:n,className:l,style:c,classes:fb,classNames:u,styles:p,unstyled:d,vars:o,varsResolver:sR});return R.jsxs(Eo,{ref:t,...b,unstyled:d,variant:v,disabled:g,mod:[{disabled:g||m},_],...w("root",{variant:v,active:!g&&!m}),children:[k||R.jsx(cb,{}),i]})});zm.classes=fb;zm.displayName="@mantine/core/CloseButton";const[uR,Hc]=_2({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var gr={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const Fv={},cR=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Br(t)} - ${se(2)})`}}),Wc=un((e,t)=>{const n=dt("InputDescription",Fv,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,size:c,__staticSelector:p,__inheritStyles:d=!0,variant:m,...g}=dt("InputDescription",Fv,n),v=Hc(),k=Wt({name:["InputWrapper",p],props:n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:u,varsResolver:cR}),_=d&&(v==null?void 0:v.getStyles)||k;return R.jsx(ft,{component:"p",ref:t,variant:m,size:c,..._("description",v!=null&&v.getStyles?{className:i,style:o}:void 0),...g})});Wc.classes=gr;Wc.displayName="@mantine/core/InputDescription";const fR={},dR=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Br(t)} - ${se(2)})`}}),Kc=un((e,t)=>{const n=dt("InputError",fR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,size:c,__staticSelector:p,__inheritStyles:d=!0,variant:m,...g}=n,v=Wt({name:["InputWrapper",p],props:n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:u,varsResolver:dR}),k=Hc(),_=d&&(k==null?void 0:k.getStyles)||v;return R.jsx(ft,{component:"p",ref:t,variant:m,size:c,..._("error",k!=null&&k.getStyles?{className:i,style:o}:void 0),...g})});Kc.classes=gr;Kc.displayName="@mantine/core/InputError";const Bv={labelElement:"label"},pR=(e,{size:t})=>({label:{"--input-label-size":Br(t),"--input-asterisk-color":void 0}}),qc=un((e,t)=>{const n=dt("InputLabel",Bv,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,labelElement:c,size:p,required:d,htmlFor:m,onMouseDown:g,children:v,__staticSelector:k,variant:_,mod:b,...w}=dt("InputLabel",Bv,n),E=Wt({name:["InputWrapper",k],props:n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:u,varsResolver:pR}),O=Hc(),I=(O==null?void 0:O.getStyles)||E;return R.jsxs(ft,{...I("label",O!=null&&O.getStyles?{className:i,style:o}:void 0),component:c,variant:_,size:p,ref:t,htmlFor:c==="label"?m:void 0,mod:[{required:d},b],onMouseDown:S=>{g==null||g(S),!S.defaultPrevented&&S.detail>1&&S.preventDefault()},...w,children:[v,d&&R.jsx("span",{...I("required"),"aria-hidden":!0,children:" *"})]})});qc.classes=gr;qc.displayName="@mantine/core/InputLabel";const Uv={},$m=un((e,t)=>{const n=dt("InputPlaceholder",Uv,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,__staticSelector:c,variant:p,error:d,mod:m,...g}=dt("InputPlaceholder",Uv,n),v=Wt({name:["InputPlaceholder",c],props:n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,rootSelector:"placeholder"});return R.jsx(ft,{...v("placeholder"),mod:[{error:!!d},m],component:"span",variant:p,ref:t,...g})});$m.classes=gr;$m.displayName="@mantine/core/InputPlaceholder";function hR(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),i=e.slice(0,r),o=e.slice(r+1),a=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:a}}const mR={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},gR=(e,{size:t})=>({label:{"--input-label-size":Br(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Br(t)} - ${se(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Br(t)} - ${se(2)})`}}),Fm=un((e,t)=>{const n=dt("InputWrapper",mR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,size:c,variant:p,__staticSelector:d,inputContainer:m,inputWrapperOrder:g,label:v,error:k,description:_,labelProps:b,descriptionProps:w,errorProps:E,labelElement:O,children:I,withAsterisk:S,id:L,required:U,__stylesApiProps:G,mod:W,...Q}=n,ne=Wt({name:["InputWrapper",d],props:G||n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:gR}),oe={size:c,variant:p,__staticSelector:d},fe=Qx(L),ge=typeof S=="boolean"?S:U,we=(E==null?void 0:E.id)||`${fe}-error`,Ee=(w==null?void 0:w.id)||`${fe}-description`,ie=fe,ce=!!k&&typeof k!="boolean",P=!!_,Oe=`${ce?we:""} ${P?Ee:""}`,De=Oe.trim().length>0?Oe.trim():void 0,N=(b==null?void 0:b.id)||`${fe}-label`,Fe=v&&R.jsx(qc,{labelElement:O,id:N,htmlFor:ie,required:ge,...oe,...b,children:v},"label"),Me=P&&R.jsx(Wc,{...w,...oe,size:(w==null?void 0:w.size)||oe.size,id:(w==null?void 0:w.id)||Ee,children:_},"description"),Te=R.jsx(j.Fragment,{children:m(I)},"input"),Ne=ce&&j.createElement(Kc,{...E,...oe,size:(E==null?void 0:E.size)||oe.size,key:"error",id:(E==null?void 0:E.id)||we},k),$e=g.map(ae=>{switch(ae){case"label":return Fe;case"input":return Te;case"description":return Me;case"error":return Ne;default:return null}});return R.jsx(uR,{value:{getStyles:ne,describedBy:De,inputId:ie,labelId:N,...hR(g,{hasDescription:P,hasError:ce})},children:R.jsx(ft,{ref:t,variant:p,size:c,mod:[{error:!!k},W],...ne("root"),...Q,children:$e})})});Fm.classes=gr;Fm.displayName="@mantine/core/InputWrapper";const yR={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},vR=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":mr(t.size,"input-height"),"--input-fz":Br(t.size),"--input-radius":t.radius===void 0?void 0:Fa(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?se(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?se(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?mr(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Or=Hr((e,t)=>{const n=dt("Input",yR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,required:u,__staticSelector:c,__stylesApiProps:p,size:d,wrapperProps:m,error:g,disabled:v,leftSection:k,leftSectionProps:_,leftSectionWidth:b,rightSection:w,rightSectionProps:E,rightSectionWidth:O,rightSectionPointerEvents:I,leftSectionPointerEvents:S,variant:L,vars:U,pointer:G,multiline:W,radius:Q,id:ne,withAria:oe,withErrorStyles:fe,mod:ge,inputSize:we,...Ee}=n,{styleProps:ie,rest:ce}=Am(Ee),P=Hc(),Oe={offsetBottom:P==null?void 0:P.offsetBottom,offsetTop:P==null?void 0:P.offsetTop},De=Wt({name:["Input",c],props:p||n,classes:gr,className:i,style:o,classNames:r,styles:a,unstyled:l,stylesCtx:Oe,rootSelector:"wrapper",vars:U,varsResolver:vR}),N=oe?{required:u,disabled:v,"aria-invalid":!!g,"aria-describedby":P==null?void 0:P.describedBy,id:(P==null?void 0:P.inputId)||ne}:{};return R.jsxs(ft,{...De("wrapper"),...ie,...m,mod:[{error:!!g&&fe,pointer:G,disabled:v,multiline:W,"data-with-right-section":!!w,"data-with-left-section":!!k},ge],variant:L,size:d,children:[k&&R.jsx("div",{..._,"data-position":"left",...De("section",{className:_==null?void 0:_.className,style:_==null?void 0:_.style}),children:k}),R.jsx(ft,{component:"input",...ce,...N,ref:t,required:u,mod:{disabled:v,error:!!g&&fe},variant:L,__size:we,...De("input")}),w&&R.jsx("div",{...E,"data-position":"right",...De("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:w})]})});Or.classes=gr;Or.Wrapper=Fm;Or.Label=qc;Or.Error=Kc;Or.Description=Wc;Or.Placeholder=$m;Or.displayName="@mantine/core/Input";function wR(e,t,n){const r=dt(e,t,n),{label:i,description:o,error:a,required:l,classNames:u,styles:c,className:p,unstyled:d,__staticSelector:m,__stylesApiProps:g,errorProps:v,labelProps:k,descriptionProps:_,wrapperProps:b,id:w,size:E,style:O,inputContainer:I,inputWrapperOrder:S,withAsterisk:L,variant:U,vars:G,mod:W,...Q}=r,{styleProps:ne,rest:oe}=Am(Q),fe={label:i,description:o,error:a,required:l,classNames:u,className:p,__staticSelector:m,__stylesApiProps:g||r,errorProps:v,labelProps:k,descriptionProps:_,unstyled:d,styles:c,size:E,style:O,inputContainer:I,inputWrapperOrder:S,withAsterisk:L,variant:U,id:w,mod:W,...b};return{...oe,classNames:u,styles:c,unstyled:d,wrapperProps:{...fe,...ne},inputProps:{required:l,classNames:u,styles:c,unstyled:d,size:E,__staticSelector:m,__stylesApiProps:g||r,error:a,variant:U,id:w}}}const xR={__staticSelector:"InputBase",withAria:!0},Yc=Hr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=wR("InputBase",xR,e);return R.jsx(Or.Wrapper,{...r,children:R.jsx(Or,{...n,...i,ref:t})})});Yc.classes={...Or.classes,...Or.Wrapper.classes};Yc.displayName="@mantine/core/InputBase";function Kp({style:e,size:t=16,...n}){return R.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:se(t),height:se(t),display:"block"},...n,children:R.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}Kp.displayName="@mantine/core/AccordionChevron";var db={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const bR={},SR=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Fa(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},pc=un((e,t)=>{const n=dt("Alert",bR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,radius:c,color:p,title:d,children:m,id:g,icon:v,withCloseButton:k,onClose:_,closeButtonLabel:b,variant:w,autoContrast:E,...O}=n,I=Wt({name:"Alert",classes:db,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:SR}),S=Qx(g),L=d&&`${S}-title`||void 0,U=`${S}-body`;return R.jsx(ft,{id:S,...I("root",{variant:w}),variant:w,ref:t,...O,role:"alert","aria-describedby":U,"aria-labelledby":L,children:R.jsxs("div",{...I("wrapper"),children:[v&&R.jsx("div",{...I("icon"),children:v}),R.jsxs("div",{...I("body"),children:[d&&R.jsx("div",{...I("title"),"data-with-close-button":k||void 0,children:R.jsx("span",{id:L,...I("label"),children:d})}),m&&R.jsx("div",{id:U,...I("message"),"data-variant":w,children:m})]}),k&&R.jsx(zm,{...I("closeButton"),onClick:_,variant:"transparent",size:16,iconSize:16,"aria-label":b,unstyled:l})]})})});pc.classes=db;pc.displayName="@mantine/core/Alert";var pb={root:"m_b6d8b162"};function kR(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const ER={inherit:!1},CR=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:o})=>({root:{"--text-fz":Br(i),"--text-lh":P2(i),"--text-gradient":t==="gradient"?Vp(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?dc(o,e):void 0}}),Ui=Hr((e,t)=>{const n=dt("Text",ER,e),{lineClamp:r,truncate:i,inline:o,inherit:a,gradient:l,span:u,__staticSelector:c,vars:p,className:d,style:m,classNames:g,styles:v,unstyled:k,variant:_,mod:b,size:w,...E}=n,O=Wt({name:["Text",c],props:n,classes:pb,className:d,style:m,classNames:g,styles:v,unstyled:k,vars:p,varsResolver:CR});return R.jsx(ft,{...O("root",{focusable:!0}),ref:t,component:u?"span":"p",variant:_,mod:[{"data-truncate":kR(i),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":a},b],size:w,...E})});Ui.classes=pb;Ui.displayName="@mantine/core/Text";var Qc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const Vv={orientation:"horizontal"},_R=(e,{borderWidth:t})=>({group:{"--button-border-width":se(t)}}),Bm=un((e,t)=>{const n=dt("ButtonGroup",Vv,e),{className:r,style:i,classNames:o,styles:a,unstyled:l,orientation:u,vars:c,borderWidth:p,variant:d,mod:m,...g}=dt("ButtonGroup",Vv,e),v=Wt({name:"ButtonGroup",props:n,classes:Qc,className:r,style:i,classNames:o,styles:a,unstyled:l,vars:c,varsResolver:_R,rootSelector:"group"});return R.jsx(ft,{...v("group"),ref:t,variant:d,mod:[{"data-orientation":u},m],role:"group",...g})});Bm.classes=Qc;Bm.displayName="@mantine/core/ButtonGroup";const PR={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${se(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},OR={},TR=(e,{radius:t,color:n,gradient:r,variant:i,size:o,justify:a,autoContrast:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:l});return{root:{"--button-justify":a,"--button-height":mr(o,"button-height"),"--button-padding-x":mr(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?Br(o.replace("compact-","")):Br(o),"--button-radius":t===void 0?void 0:Fa(t),"--button-bg":n||i?u.background:void 0,"--button-hover":n||i?u.hover:void 0,"--button-color":u.color,"--button-bd":n||i?u.border:void 0,"--button-hover-color":n||i?u.hoverColor:void 0}}},Co=Hr((e,t)=>{const n=dt("Button",OR,e),{style:r,vars:i,className:o,color:a,disabled:l,children:u,leftSection:c,rightSection:p,fullWidth:d,variant:m,radius:g,loading:v,loaderProps:k,gradient:_,classNames:b,styles:w,unstyled:E,"data-disabled":O,autoContrast:I,mod:S,...L}=n,U=Wt({name:"Button",props:n,classes:Qc,className:o,style:r,classNames:b,styles:w,unstyled:E,vars:i,varsResolver:TR}),G=!!c,W=!!p;return R.jsxs(Eo,{ref:t,...U("root",{active:!l&&!v&&!O}),unstyled:E,variant:m,disabled:l||v,mod:[{disabled:l||O,loading:v,block:d,"with-left-section":G,"with-right-section":W},S],...L,children:[R.jsx(sb,{mounted:!!v,transition:PR,duration:150,children:Q=>R.jsx(ft,{component:"span",...U("loader",{style:Q}),"aria-hidden":!0,children:R.jsx(Vc,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...k})})}),R.jsxs("span",{...U("inner"),children:[c&&R.jsx(ft,{component:"span",...U("section"),mod:{position:"left"},children:c}),R.jsx(ft,{component:"span",mod:{loading:v},...U("label"),children:u}),p&&R.jsx(ft,{component:"span",...U("section"),mod:{position:"right"},children:p})]})]})});Co.classes=Qc;Co.displayName="@mantine/core/Button";Co.Group=Bm;const[RR,jR]=Pm("Card component was not found in tree");var Um={root:"m_e615b15f",section:"m_599a2148"};const NR={},Gc=Hr((e,t)=>{const n=dt("CardSection",NR,e),{classNames:r,className:i,style:o,styles:a,vars:l,withBorder:u,inheritPadding:c,mod:p,...d}=n,m=jR();return R.jsx(ft,{ref:t,mod:[{"with-border":u,"inherit-padding":c},p],...m.getStyles("section",{className:i,style:o,styles:a,classNames:r}),...d})});Gc.classes=Um;Gc.displayName="@mantine/core/CardSection";const IR={},LR=(e,{padding:t})=>({root:{"--card-padding":ko(t)}}),Es=Hr((e,t)=>{const n=dt("Card",IR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,children:c,padding:p,...d}=n,m=Wt({name:"Card",props:n,classes:Um,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:LR}),g=j.Children.toArray(c),v=g.map((k,_)=>typeof k=="object"&&k&&"type"in k&&k.type===Gc?j.cloneElement(k,{"data-first-section":_===0||void 0,"data-last-section":_===g.length-1||void 0}):k);return R.jsx(RR,{value:{getStyles:m},children:R.jsx(Mm,{ref:t,unstyled:l,...m("root"),...d,children:v})})});Es.classes=Um;Es.displayName="@mantine/core/Card";Es.Section=Gc;var hb={root:"m_4451eb3a"};const AR={},Ar=Hr((e,t)=>{const n=dt("Center",AR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,inline:c,mod:p,...d}=n,m=Wt({name:"Center",props:n,classes:hb,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u});return R.jsx(ft,{ref:t,mod:[{inline:c},p],...m("root"),...d})});Ar.classes=hb;Ar.displayName="@mantine/core/Center";var mb={root:"m_7485cace"};const DR={},MR=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:mr(t,"container-size")}}),Vm=un((e,t)=>{const n=dt("Container",DR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,fluid:c,mod:p,...d}=n,m=Wt({name:"Container",classes:mb,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:MR});return R.jsx(ft,{ref:t,mod:[{fluid:c},p],...m("root"),...d})});Vm.classes=mb;Vm.displayName="@mantine/core/Container";var gb={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const zR={variant:"default"},$R=(e,{radius:t})=>({root:{"--fieldset-radius":t===void 0?void 0:Fa(t)}}),hc=un((e,t)=>{const n=dt("Fieldset",zR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,legend:c,variant:p,children:d,...m}=n,g=Wt({name:"Fieldset",classes:gb,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:$R});return R.jsxs(ft,{component:"fieldset",ref:t,variant:p,...g("root",{variant:p}),...m,children:[c&&R.jsx("legend",{...g("legend",{variant:p}),children:c}),d]})});hc.classes=gb;hc.displayName="@mantine/core/Fieldset";const[FR,yb]=Pm("Grid component was not found in tree"),qp=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Hv=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":qp(e,t),Wv=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Kv=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function BR({span:e,order:t,offset:n,selector:r}){var m;const i=Vr(),o=yb(),l=yo(e)===void 0?12:yo(e),u=$a({"--col-order":(m=yo(t))==null?void 0:m.toString(),"--col-flex-grow":Wv(l,o.grow),"--col-flex-basis":qp(l,o.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":Hv(l,o.columns,o.grow),"--col-offset":Kv(yo(n),o.columns)}),c=Jt(i.breakpoints).reduce((g,v)=>{var k;return g[v]||(g[v]={}),typeof t=="object"&&t[v]!==void 0&&(g[v]["--col-order"]=(k=t[v])==null?void 0:k.toString()),typeof e=="object"&&e[v]!==void 0&&(g[v]["--col-flex-grow"]=Wv(e[v],o.grow),g[v]["--col-flex-basis"]=qp(e[v],o.columns),g[v]["--col-width"]=e[v]==="content"?"auto":void 0,g[v]["--col-max-width"]=Hv(e[v],o.columns,o.grow)),typeof n=="object"&&n[v]!==void 0&&(g[v]["--col-offset"]=Kv(n[v],o.columns)),g},{}),d=Om(Jt(c),i).filter(g=>Jt(c[g.value]).length>0).map(g=>({query:`(min-width: ${i.breakpoints[g.value]})`,styles:c[g.value]}));return R.jsx(Bc,{styles:u,media:d,selector:r})}var Hm={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const UR={span:12},Wm=un((e,t)=>{const n=dt("GridCol",UR,e),{classNames:r,className:i,style:o,styles:a,vars:l,span:u,order:c,offset:p,...d}=n,m=yb(),g=Uc();return R.jsxs(R.Fragment,{children:[R.jsx(BR,{selector:`.${g}`,span:u,order:c,offset:p}),R.jsx(ft,{ref:t,...m.getStyles("col",{className:Ji(i,g),style:o,classNames:r,styles:a}),...d})]})});Wm.classes=Hm;Wm.displayName="@mantine/core/GridCol";function VR({gutter:e,selector:t}){const n=Vr(),r=$a({"--grid-gutter":ko(yo(e))}),i=Jt(n.breakpoints).reduce((l,u)=>(l[u]||(l[u]={}),typeof e=="object"&&e[u]!==void 0&&(l[u]["--grid-gutter"]=ko(e[u])),l),{}),a=Om(Jt(i),n).filter(l=>Jt(i[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:i[l.value]}));return R.jsx(Bc,{styles:r,media:a,selector:t})}const HR={gutter:"md",grow:!1,columns:12},WR=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),ni=un((e,t)=>{const n=dt("Grid",HR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,grow:c,gutter:p,columns:d,align:m,justify:g,children:v,...k}=n,_=Wt({name:"Grid",classes:Hm,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:WR}),b=Uc();return R.jsxs(FR,{value:{getStyles:_,grow:c,columns:d},children:[R.jsx(VR,{selector:`.${b}`,...n}),R.jsx(ft,{ref:t,..._("root",{className:b}),...k,children:R.jsx("div",{..._("inner"),children:v})})]})});ni.classes=Hm;ni.displayName="@mantine/core/Grid";ni.Col=Wm;const KR={},or=un((e,t)=>{const{w:n,h:r,miw:i,mih:o,...a}=dt("Space",KR,e);return R.jsx(ft,{ref:t,...a,w:n,miw:i??n,h:r,mih:o??r})});or.displayName="@mantine/core/Space";const qR={},zl=un((e,t)=>{const n=dt("TextInput",qR,e);return R.jsx(Yc,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});zl.classes=Yc.classes;zl.displayName="@mantine/core/TextInput";const YR=["h1","h2","h3","h4","h5","h6"];function QR(e,t){const n=t!==void 0?t:`h${e}`;return YR.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:se(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var vb={root:"m_8a5d1357"};const GR={order:1},XR=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const o=QR(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Xc=un((e,t)=>{const n=dt("Title",GR,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,order:u,vars:c,size:p,variant:d,lineClamp:m,textWrap:g,mod:v,...k}=n,_=Wt({name:"Title",props:n,classes:vb,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:XR});return[1,2,3,4,5,6].includes(u)?R.jsx(ft,{..._("root"),component:`h${u}`,variant:d,ref:t,mod:[{order:u,"data-line-clamp":typeof m=="number"},v],size:p,...k}):null});Xc.classes=vb;Xc.displayName="@mantine/core/Title";function wb({changeView:e}){const t=()=>{e("login")};return R.jsx("div",{className:"container d-flex justify-content-center align-items-center vh-100",style:{maxWidth:"1000px"},children:R.jsx("div",{className:"box",children:R.jsxs(Es,{shadow:"lg",padding:"lg",radius:"md",withBorder:!0,children:[R.jsxs(ni,{children:[R.jsx(ni.Col,{span:7,children:R.jsxs("div",{children:[R.jsx(Ui,{fw:500,c:"dimmed",children:"Terms of Usage"}),R.jsx(Xc,{order:2,children:"Welcome"}),R.jsx(or,{h:"sm"}),R.jsx(Ui,{size:"sm",children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris in dui elit. Aenean a nisl ultrices, convallis ipsum quis, ornare enim. Sed ac scelerisque turpis, et pellentesque nibh. Donec ligula augue, rutrum non diam ut, euismod fermentum turpis. Donec nunc ante, facilisis faucibus pellentesque sed, dictum vel nunc. Sed nec enim nibh. Proin auctor orci a gravida pulvinar. Sed congue, velit sit amet rutrum ultrices, augue ligula pretium eros, et sagittis nisl nibh in leo. Praesent dui justo, luctus a turpis non, euismod tristique nisl"}),R.jsx("div",{children:R.jsx(Ar,{children:R.jsx(Co,{mt:"md",radius:"md",onClick:t,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},children:"Accept"})})})]})}),R.jsx(ni.Col,{span:5,children:R.jsx(Ar,{children:R.jsx("div",{className:"Splash"})})})]}),R.jsx(Ar,{children:R.jsx(Ui,{size:"xs",c:"dimmed",children:R.jsxs("span",{style:{verticalAlign:"middle"},children:[R.jsx(zc,{})," Stanford Medicine"]})})})]})})})}function JR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ZR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ej=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tj={};function qv(e,t){return(tj.jsx?ej:ZR).test(e)}const nj=/[ \t\n\f\r]/g;function rj(e){return typeof e=="object"?e.type==="text"?Yv(e.value):!1:Yv(e)}function Yv(e){return e.replace(nj,"")===""}class Cs{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Cs.prototype.property={};Cs.prototype.normal={};Cs.prototype.space=null;function xb(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&sj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Gv,dj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Gv.test(o)){let a=o.replace(uj,fj);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Km}return new i(r,t)}function fj(e){return"-"+e.toLowerCase()}function dj(e){return e.charAt(1).toUpperCase()}const pj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hj=xb([kb,Sb,_b,Pb,aj],"html"),qm=xb([kb,Sb,_b,Pb,lj],"svg");function mj(e){return e.join(" ").trim()}var Ob={},Xv=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gj=/\n/g,yj=/^\s*/,vj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wj=/^:\s*/,xj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,bj=/^[;\s]*/,Sj=/^\s+|\s+$/g,kj=` @@ -87,4 +87,4 @@ Error generating stack: `+o.message+` `});++r0&&n.push({type:"text",value:` `}),n}function k0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function E0(e,t){const n=QL(e,t),r=n.one(e,void 0),i=zL(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function eA(e,t){return e&&"run"in e?async function(n,r){const i=E0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return E0(n,{file:r,...t||e})}}function C0(e){if(e)throw e}var Iu=Object.prototype.hasOwnProperty,nS=Object.prototype.toString,_0=Object.defineProperty,P0=Object.getOwnPropertyDescriptor,O0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):nS.call(t)==="[object Array]"},T0=function(t){if(!t||nS.call(t)!=="[object Object]")return!1;var n=Iu.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Iu.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Iu.call(t,i)},R0=function(t,n){_0&&n.name==="__proto__"?_0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},j0=function(t,n){if(n==="__proto__")if(Iu.call(t,n)){if(P0)return P0(t,n).value}else return;return t[n]},tA=function e(){var t,n,r,i,o,a,l=arguments[0],u=1,c=arguments.length,p=!1;for(typeof l=="boolean"&&(p=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ua.length;let u;l&&a.push(i);try{u=e.apply(this,a)}catch(c){const p=c;if(l&&n)throw p;return i(p)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const Ir={basename:iA,dirname:oA,extname:aA,join:lA,sep:"/"};function iA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_s(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function oA(e){if(_s(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function aA(e){_s(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function lA(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uA(e,t){let n="",r=0,i=-1,o=0,a=-1,l,u;for(;++a<=e.length;){if(a2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return n}function _s(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cA={cwd:fA};function fA(){return"/"}function nh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dA(e){if(typeof e=="string")e=new URL(e);else if(!nh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return pA(e)}function pA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...v]=p;const k=r[m][1];th(k)&&th(g)&&(g=xd(!0,k,g)),r[m]=[c,g,...v]}}}}const yA=new og().freeze();function Ed(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _d(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I0(e){if(!th(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mu(e){return vA(e)?e:new rS(e)}function vA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wA(e){return typeof e=="string"||xA(e)}function xA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A0=[],D0={allowDangerousHtml:!0},SA=/^(https?|ircs?|mailto|xmpp)$/i,kA=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EA(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,l=e.rehypePlugins||A0,u=e.remarkPlugins||A0,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...D0}:D0,p=e.skipHtml,d=e.unwrapDisallowed,m=e.urlTransform||CA,g=yA().use(oL).use(u).use(eA,c).use(l),v=new rS;typeof r=="string"&&(v.value=r);for(const w of kA)Object.hasOwn(e,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+bA+w.id,void 0);const k=g.parse(v);let _=g.runSync(k,v);return i&&(_={type:"element",tagName:"div",properties:{className:i},children:_.type==="root"?_.children:[_]}),tS(_,b),Mj(_,{Fragment:R.Fragment,components:o,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function b(w,E,O){if(w.type==="raw"&&O&&typeof E=="number")return p?O.children.splice(E,1):O.children[E]={type:"text",value:w.value},E;if(w.type==="element"){let I;for(I in yd)if(Object.hasOwn(yd,I)&&Object.hasOwn(w.properties,I)){const S=w.properties[I],L=yd[I];(L===null||L.includes(w.tagName))&&(w.properties[I]=m(String(S||""),I,w))}}if(w.type==="element"){let I=t?!t.includes(w.tagName):a?a.includes(w.tagName):!1;if(!I&&n&&typeof E=="number"&&(I=!n(w,E,O)),I&&O&&typeof E=="number")return d&&w.children?O.children.splice(E,1,...w.children):O.children.splice(E,1),E}}}function CA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||SA.test(e.slice(0,t))?e:""}const _A=()=>{const e=j.useContext($o),t=j.useRef(null),n=i=>{e.deleteInteraction(i)},r=()=>t.current?t.current.querySelector(".votes"):null;return e.showRatingPO,Ru.Header,Ru.Body,j.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"start"})},[e.chatContext]),R.jsx("div",{className:"messages",children:e&&e.chatContext&&e.chatContext.length>0?e.chatContext.map((i,o)=>R.jsxs(ot.Fragment,{children:[R.jsxs("dl",{ref:o===e.chatContext.length-1?t:null,children:[R.jsxs("dt",{children:[i.user_content,R.jsx(mm,{className:"delete-icon",onClick:()=>n(o)})]}),i.assistant_content&&R.jsx("dd",{children:R.jsx(EA,{children:i.assistant_content})})]}),o{console.log("home fetchSavedSession useEffet"),e()},[]),R.jsxs(R.Fragment,{children:[R.jsx(Cm,{}),R.jsx("div",{className:"content",children:R.jsx(gs,{className:"body",children:R.jsx(_A,{})})}),R.jsx(Kx,{})]})}function PA(e,t,n,r,i){return r+(i-r)*((e-t)/(n-t))}function ag(e){return typeof e=="number"}function M0(e){return typeof e=="string"}function rh(e){return Object.prototype.toString.call(e)==="[object Object]"}function OA(e){return Array.isArray(e)}function z0(e){return rh(e)||OA(e)}function Bt(e){return Math.abs(e)}function lg(e){return e?e/Bt(e):0}function kl(e,t){return Bt(e-t)}function TA(e,t){if(e===0||t===0||Bt(e)<=Bt(t))return 0;var n=kl(Bt(e),Bt(t));return Bt(n/e)}function RA(e){var t=Math.pow(10,e);return function(n){return Math.round(n*t)/t}}function cs(e){return _o(e).map(Number)}function ri(e){return e[tf(e)]}function tf(e){return Math.max(0,e.length-1)}function _o(e){return Object.keys(e)}function oS(e,t){return[e,t].reduce(function(n,r){return _o(r).forEach(function(i){var o=n[i],a=r[i],l=rh(o)&&rh(a);n[i]=l?oS(o,a):a}),n},{})}function aS(e,t){var n=_o(e),r=_o(t);return n.length!==r.length?!1:n.every(function(i){var o=e[i],a=t[i];return typeof o=="function"?"".concat(o)==="".concat(a):!z0(o)||!z0(a)?o===a:aS(o,a)})}function jA(e,t){var n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(){return t*Number(e)}function l(c){return ag(e)?a():n[e](c)}var u={measure:l};return u}function NA(e){var t=0;function n(a,l){return function(){a===!!t&&l()}}function r(){t=window.requestAnimationFrame(e)}function i(){window.cancelAnimationFrame(t),t=0}var o={proceed:n(!0,r),start:n(!1,r),stop:n(!0,i)};return o}function IA(e,t){var n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=l(),o=u();function a(p){var d=p.width,m=p.height;return n==="x"?d:m}function l(){return n==="y"?"top":t==="rtl"?"right":"left"}function u(){return n==="y"?"bottom":t==="rtl"?"left":"right"}var c={scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:a};return c}function La(e,t){var n=Bt(e-t);function r(c){return ct}function o(c){return r(c)||i(c)}function a(c){return o(c)?r(c)?e:t:c}function l(c){return n?c-n*Math.ceil((c-t)/n):c}var u={length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:l};return u}function lS(e,t,n){var r=La(0,e),i=r.min,o=r.constrain,a=e+1,l=u(t);function u(v){return n?Bt((a+v)%a):o(v)}function c(){return l}function p(v){return l=u(v),g}function d(v){return p(c()+v)}function m(){return lS(e,c(),n)}var g={add:d,clone:m,get:c,set:p,min:i,max:e};return g}function LA(e){var t=e==="rtl"?-1:1;function n(i){return i*t}var r={apply:n};return r}function vc(){var e=[];function t(i,o,a,l){return l===void 0&&(l={passive:!0}),i.addEventListener(o,a,l),e.push(function(){return i.removeEventListener(o,a,l)}),r}function n(){return e=e.filter(function(i){return i()}),r}var r={add:t,removeAll:n};return r}function Vi(e){var t=e;function n(){return t}function r(d){return t=c(d),p}function i(d){return t+=c(d),p}function o(d){return t-=c(d),p}function a(d){return t*=d,p}function l(d){return t/=d,p}function u(){return t!==0&&l(t),p}function c(d){return ag(d)?d:d.get()}var p={add:i,divide:l,get:n,multiply:a,normalize:u,set:r,subtract:o};return p}function AA(e,t,n,r,i,o,a,l,u,c,p,d,m,g,v,k){var _=e.cross,b=["INPUT","SELECT","TEXTAREA"],w={passive:!1},E=Vi(0),O=vc(),I=vc(),S=m.measure(20),L={mouse:300,touch:400},U={mouse:500,touch:600},G=v?5:16,W=1,Q=0,ne=0,oe=!1,fe=!1,ge=!1,we=!1;function Ee(){var _e=n;O.add(_e,"dragstart",function(Je){return Je.preventDefault()},w).add(_e,"touchmove",function(){},w).add(_e,"touchend",function(){}).add(_e,"touchstart",N).add(_e,"mousedown",N).add(_e,"touchcancel",Me).add(_e,"contextmenu",Me).add(_e,"click",Te,!0)}function ie(){var _e=we?document:n;I.add(_e,"touchmove",Fe,w).add(_e,"touchend",Me).add(_e,"mousemove",Fe,w).add(_e,"mouseup",Me)}function ce(){O.removeAll(),I.removeAll()}function P(_e){var Je=_e.nodeName||"";return b.indexOf(Je)>-1}function Oe(){var _e=v?U:L,Je=we?"mouse":"touch";return _e[Je]}function De(_e,Je){var Ie=p.clone().add(lg(_e)*-1),qe=Ie.get()===p.min||Ie.get()===p.max,xt=c.byDistance(_e,!v).distance;return v||Bt(_e)=2,Ie=we||!Je;oe=!0,i.pointerDown(_e),E.set(r),r.set(o),u.useBaseMass().useSpeed(80),ie(),Q=i.readPoint(_e),ne=i.readPoint(_e,_),d.emit("pointerDown"),Ie&&(ge=!1)}}function Fe(_e){if(!fe&&!we){if(!_e.cancelable)return Me(_e);var Je=i.readPoint(_e),Ie=i.readPoint(_e,_),qe=kl(Je,Q),xt=kl(Ie,ne);if(fe=qe>xt,!fe&&!ge)return Me(_e)}var gt=i.pointerMove(_e);!ge&>&&(ge=!0),a.start(),r.add(t.apply(gt)),_e.preventDefault()}function Me(_e){var Je=c.byDistance(0,!1),Ie=Je.index!==p.get(),qe=i.pointerUp(_e)*Oe(),xt=De(t.apply(qe),Ie),gt=TA(qe,xt),At=kl(r.get(),E.get())>=.5,nn=Ie&>>.75,Vn=Bt(qe)t;return r=d,g&&(n=d),m}function c(d){if(!n||!r)return 0;var m=a(r)-a(n),g=o(d)-o(n),v=o(d)-o(r)>t,k=m/g,_=g&&!v&&Bt(k)>.1;return _?k:0}var p={isTouchEvent:i,pointerDown:l,pointerMove:u,pointerUp:c,readPoint:a};return p}function MA(e){function t(r){return e*(r/100)}var n={measure:t};return n}function zA(e,t,n){var r=RA(2),i=Vi(0),o=Vi(0),a=Vi(0),l=0,u=t,c=n;function p(){i.add(o),e.add(i),o.multiply(0)}function d(O){O.divide(c),o.add(O)}function m(O){a.set(O).subtract(e);var I=PA(a.get(),0,100,0,u);return l=lg(a.get()),a.normalize().multiply(I).subtract(i),d(a),E}function g(O){var I=O.get()-e.get(),S=!r(I);return S&&e.set(O),S}function v(){return l}function k(){return b(t)}function _(){return w(n)}function b(O){return u=O,E}function w(O){return c=O,E}var E={direction:v,seek:m,settle:g,update:p,useBaseMass:_,useBaseSpeed:k,useMass:w,useSpeed:b};return E}function $A(e,t,n,r,i){var o=i.measure(10),a=i.measure(50),l=.85,u=!1;function c(){return!(u||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function p(g){if(c()){var v=e.reachedMin(t.get())?"min":"max",k=Bt(e[v]-t.get()),_=n.get()-t.get(),b=Math.min(k/a,l);n.subtract(_*b),!g&&Bt(_)0?L.concat([U]):L},[])}function v(I,S){var L=S==="start",U=L?-r:r,G=a.findSlideBounds([U]);return I.map(function(W){var Q=L?0:-r,ne=L?r:0,oe=G.filter(function(ce){return ce.index===W})[0],fe=oe[L?"end":"start"],ge=Vi(-1),we=Vi(-1),Ee=sS(e,t,u[W]),ie=function(){return ge.set(l.get()>fe?Q:ne)};return{index:W,location:we,translate:Ee,target:ie}})}function k(){var I=o[0]-1,S=g(p,I);return v(S,"end")}function _(){var I=n-o[0]-1,S=g(c,I);return v(S,"start")}function b(){return d.every(function(I){var S=I.index,L=c.filter(function(U){return U!==S});return m(L,n)<=.1})}function w(){d.forEach(function(I){var S=I.target,L=I.translate,U=I.location,G=S();G.get()!==U.get()&&(G.get()===0?L.clear():L.to(G),U.set(G))})}function E(){d.forEach(function(I){return I.translate.clear()})}var O={canLoop:b,clear:E,loop:w,loopPoints:d};return O}function YA(e,t,n,r,i,o,a){var l=i.removeOffset,u=i.constrain,c=.5,p=o?[0,t,-t]:[0],d=g(p,a);function m(_){var b=_||0;return n.map(function(w){var E=La(c,w-c);return E.constrain(w*b)})}function g(_,b){var w=_||p,E=m(b);return w.reduce(function(O,I){var S=r.map(function(L,U){return{start:L-n[U]+E[U]+I,end:L+e-E[U]+I,index:U}});return O.concat(S)},[])}function v(_,b){var w=o?l(_):u(_),E=b||d;return E.reduce(function(O,I){var S=I.index,L=I.start,U=I.end,G=O.indexOf(S)!==-1,W=Lw;return!G&&W?O.concat([S]):O},[])}var k={check:v,findSlideBounds:g};return k}function QA(e,t,n,r,i){var o=e.measureSize,a=e.startEdge,l=e.endEdge,u=n[0]&&i,c=g(),p=v(),d=n.map(o),m=k();function g(){if(!u)return 0;var b=n[0];return Bt(t[a]-b[a])}function v(){if(!u)return 0;var b=window.getComputedStyle(ri(r));return parseFloat(b.getPropertyValue("margin-".concat(l)))}function k(){return n.map(function(b,w,E){var O=!w,I=w===tf(E);return O?d[w]+c:I?d[w]+p:E[w+1][a]-b[a]}).map(Bt)}var _={slideSizes:d,slideSizesWithGaps:m};return _}function GA(e,t,n){var r=ag(n);function i(u,c){return cs(u).filter(function(p){return p%c===0}).map(function(p){return u.slice(p,p+c)})}function o(u){return cs(u).reduce(function(c,p){var d=t.slice(ri(c),p+1),m=d.reduce(function(g,v){return g+v},0);return!p||m>e?c.concat(p):c},[]).map(function(c,p,d){return u.slice(c,d[p+1])})}function a(u){return r?i(u,n):o(u)}var l={groupSlides:a};return l}function XA(e,t,n,r,i){var o=r.align,a=r.axis,l=r.direction,u=r.startIndex,c=r.inViewThreshold,p=r.loop,d=r.speed,m=r.dragFree,g=r.slidesToScroll,v=r.skipSnaps,k=r.containScroll,_=t.getBoundingClientRect(),b=n.map(function(xt){return xt.getBoundingClientRect()}),w=LA(l),E=IA(a,l),O=E.measureSize(_),I=MA(O),S=jA(o,O),L=!p&&k!=="",U=p||k!=="",G=QA(E,_,b,n,U),W=G.slideSizes,Q=G.slideSizesWithGaps,ne=GA(O,Q,g),oe=HA(E,S,_,b,Q,ne,L),fe=oe.snaps,ge=oe.snapsAligned,we=-ri(fe)+ri(Q),Ee=FA(O,we,ge,k).snapsContained,ie=L?Ee:ge,ce=BA(we,ie,p).limit,P=lS(tf(ie),u,p),Oe=P.clone(),De=cs(n),N=function(){p||qe.scrollBounds.constrain(qe.dragHandler.pointerDown()),qe.scrollBody.seek(Ne).update();var xt=qe.scrollBody.settle(Ne);xt&&!qe.dragHandler.pointerDown()&&(qe.animation.stop(),i.emit("settle")),xt||i.emit("scroll"),p&&(qe.scrollLooper.loop(qe.scrollBody.direction()),qe.slideLooper.loop()),qe.translate.to(Te),qe.animation.proceed()},Fe=NA(N),Me=ie[P.get()],Te=Vi(Me),Ne=Vi(Me),$e=zA(Te,d,1),ae=WA(p,ie,we,ce,Ne),_e=KA(Fe,P,Oe,ae,Ne,i),Je=YA(O,we,W,fe,ce,p,c),Ie=AA(E,w,e,Ne,DA(E),Te,Fe,_e,$e,ae,P,i,I,p,m,v),qe={containerRect:_,slideRects:b,animation:Fe,axis:E,direction:w,dragHandler:Ie,eventStore:vc(),percentOfView:I,index:P,indexPrevious:Oe,limit:ce,location:Te,options:r,scrollBody:$e,scrollBounds:$A(ce,Te,Ne,$e,I),scrollLooper:UA(we,ce,Te,[Te,Ne]),scrollProgress:VA(ce),scrollSnaps:ie,scrollTarget:ae,scrollTo:_e,slideLooper:qA(E,w,O,we,Q,ie,Je,Te,n),slidesToScroll:ne,slidesInView:Je,slideIndexes:De,target:Ne,translate:sS(E,w,t)};return qe}function JA(){var e={};function t(a){return e[a]||[]}function n(a){return t(a).forEach(function(l){return l(a)}),o}function r(a,l){return e[a]=t(a).concat([l]),o}function i(a,l){return e[a]=t(a).filter(function(u){return u!==l}),o}var o={emit:n,off:i,on:r};return o}var ZA={align:"center",axis:"x",container:null,slides:null,containScroll:"",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,draggable:!0,inViewThreshold:0,loop:!1,skipSnaps:!1,speed:10,startIndex:0,active:!0};function sg(){function e(i,o){return oS(i,o||{})}function t(i,o){var a=JSON.stringify(_o(i.breakpoints||{})),l=JSON.stringify(_o(o.breakpoints||{}));return a!==l?!1:aS(i,o)}function n(i){var o=i.breakpoints||{},a=_o(o).filter(function(l){return window.matchMedia(l).matches}).map(function(l){return o[l]}).reduce(function(l,u){return e(l,u)},{});return e(i,a)}var r={merge:e,areEqual:t,atMedia:n};return r}function eD(){var e=sg(),t=e.atMedia,n=e.areEqual,r=[],i=[];function o(){return i.some(function(p){return p()})}function a(p){var d=t(p.options);return function(){return!n(d,t(p.options))}}function l(p,d){return i=p.map(a),r=p.filter(function(m){return t(m.options).active}),r.forEach(function(m){return m.init(d)}),p.reduce(function(m,g){var v;return Object.assign(m,(v={},v[g.name]=g,v))},{})}function u(){r=r.filter(function(p){return p.destroy()})}var c={init:l,destroy:u,haveChanged:o};return c}function Po(e,t,n){var r=vc(),i=sg(),o=eD(),a=JA(),l=a.on,u=a.off,c=I,p=!1,d,m=i.merge(ZA,Po.globalOptions),g=i.merge(m),v=[],k,_=0,b,w;function E(){var Ne=g.container,$e=g.slides,ae=M0(Ne)?e.querySelector(Ne):Ne;b=ae||e.children[0];var _e=M0($e)?b.querySelectorAll($e):$e;w=[].slice.call(_e||b.children)}function O(Ne,$e){if(!p){if(m=i.merge(m,Ne),g=i.atMedia(m),E(),d=XA(e,b,w,g,a),_=d.axis.measureSize(e.getBoundingClientRect()),!g.active)return S();if(d.translate.to(d.location),v=$e||v,k=o.init(v,Te),g.loop){if(!d.slideLooper.canLoop()){S(),O({loop:!1},$e),m=i.merge(m,{loop:!0});return}d.slideLooper.loop()}g.draggable&&b.offsetParent&&w.length&&d.dragHandler.addActivationEvents()}}function I(Ne,$e){var ae=ie();S(),O(i.merge({startIndex:ae},Ne),$e),a.emit("reInit")}function S(){d.dragHandler.removeAllEvents(),d.animation.stop(),d.eventStore.removeAll(),d.translate.clear(),d.slideLooper.clear(),o.destroy()}function L(){p||(p=!0,r.removeAll(),S(),a.emit("destroy"))}function U(){var Ne=i.atMedia(m),$e=!i.areEqual(Ne,g),ae=d.axis.measureSize(e.getBoundingClientRect()),_e=_!==ae,Je=o.haveChanged();(_e||$e||Je)&&I(),a.emit("resize")}function G(Ne){var $e=d[Ne?"target":"location"].get(),ae=g.loop?"removeOffset":"constrain";return d.slidesInView.check(d.limit[ae]($e))}function W(Ne){var $e=G(Ne);return d.slideIndexes.filter(function(ae){return $e.indexOf(ae)===-1})}function Q(Ne,$e,ae){!g.active||p||(d.scrollBody.useBaseMass().useSpeed($e?100:g.speed),d.scrollTo.index(Ne,ae||0))}function ne(Ne){var $e=d.index.clone().add(1);Q($e.get(),Ne===!0,-1)}function oe(Ne){var $e=d.index.clone().add(-1);Q($e.get(),Ne===!0,1)}function fe(){var Ne=d.index.clone().add(1);return Ne.get()!==ie()}function ge(){var Ne=d.index.clone().add(-1);return Ne.get()!==ie()}function we(){return d.scrollSnaps.map(d.scrollProgress.get)}function Ee(){return d.scrollProgress.get(d.location.get())}function ie(){return d.index.get()}function ce(){return d.indexPrevious.get()}function P(){return d.dragHandler.clickAllowed()}function Oe(){return k}function De(){return d}function N(){return e}function Fe(){return b}function Me(){return w}var Te={canScrollNext:fe,canScrollPrev:ge,clickAllowed:P,containerNode:Fe,internalEngine:De,destroy:L,off:u,on:l,plugins:Oe,previousScrollSnap:ce,reInit:c,rootNode:N,scrollNext:ne,scrollPrev:oe,scrollProgress:Ee,scrollSnapList:we,scrollTo:Q,selectedScrollSnap:ie,slideNodes:Me,slidesInView:G,slidesNotInView:W};return O(t,n),r.add(window,"resize",U),setTimeout(function(){return a.emit("init")},0),Te}Po.globalOptions=void 0;Po.optionsHandler=sg;function tD(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function $0(e){return e.concat().sort(function(t,n){return t.name>n.name?1:-1}).map(function(t){return t.options})}function nD(e,t){if(e.length!==t.length)return!1;var n=Po.optionsHandler().areEqual,r=$0(e),i=$0(t);return r.every(function(o,a){var l=i[a];return n(o,l)})}function ug(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=j.useRef(Po.optionsHandler()),r=j.useRef(e),i=j.useRef(t),o=j.useState(),a=o[0],l=o[1],u=j.useState(),c=u[0],p=u[1],d=j.useCallback(function(){a&&a.reInit(r.current,i.current)},[a]);return j.useEffect(function(){if(tD()&&c){Po.globalOptions=ug.globalOptions;var m=Po(c,r.current,i.current);return l(m),function(){return m.destroy()}}else l(void 0)},[c,l]),j.useEffect(function(){n.current.areEqual(r.current,e)||(r.current=e,d())},[e,d]),j.useEffect(function(){nD(i.current,t)||(i.current=t,d())},[t,d]),[p,a]}ug.globalOptions=void 0;const[rD,iD]=Pm("Carousel component was not found in tree");var cg={root:"m_17884d0f",viewport:"m_a2dae653",container:"m_fcd81474",controls:"m_39bc3463",control:"m_64f58e10",indicators:"m_71ea3ab1",indicator:"m_eae68602",slide:"m_d98df724"};const oD={},fg=un((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:a,mod:l,...u}=dt("CarouselSlide",oD,e),c=iD();return R.jsx(ft,{ref:t,mod:[{orientation:c.orientation},l],...c.getStyles("slide",{className:r,style:i,classNames:n,styles:o}),...u})});fg.classes=cg;fg.displayName="@mantine/carousel/CarouselSlide";function aD({slideGap:e,slideSize:t,selector:n}){const r=Vr(),i=$a({"--carousel-slide-gap":ko(yo(e)),"--carousel-slide-size":se(yo(t))}),o=Jt(r.breakpoints).reduce((u,c)=>(u[c]||(u[c]={}),typeof e=="object"&&e[c]!==void 0&&(u[c]["--carousel-slide-gap"]=ko(e[c])),typeof t=="object"&&t[c]!==void 0&&(u[c]["--carousel-slide-size"]=ko(t[c])),u),{}),l=Om(Jt(o),r).filter(u=>Jt(o[u.value]).length>0).map(u=>({query:`(min-width: ${r.breakpoints[u.value]})`,styles:o[u.value]}));return R.jsx(Bc,{styles:i,media:l,selector:n})}function F0({dir:e,orientation:t,direction:n}){return n==="previous"?t==="horizontal"?90*(e==="ltr"?1:-1):-180:t==="horizontal"?90*(e==="ltr"?-1:1):0}const lD={controlSize:26,controlsOffset:"sm",slideSize:"100%",slideGap:0,orientation:"horizontal",align:"center",slidesToScroll:1,includeGapInSize:!0,draggable:!0,dragFree:!1,loop:!1,speed:10,initialSlide:0,inViewThreshold:0,withControls:!0,withIndicators:!1,skipSnaps:!1,containScroll:"",withKeyboardEvents:!0},sD=(e,{height:t,controlSize:n,controlsOffset:r})=>({root:{"--carousel-height":se(t),"--carousel-control-size":se(n),"--carousel-controls-offset":ko(r)}}),vo=un((e,t)=>{const n=dt("Carousel",lD,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,children:c,getEmblaApi:p,onNextSlide:d,onPreviousSlide:m,onSlideChange:g,nextControlProps:v,previousControlProps:k,controlSize:_,controlsOffset:b,slideSize:w,slideGap:E,orientation:O,height:I,align:S,slidesToScroll:L,includeGapInSize:U,draggable:G,dragFree:W,loop:Q,speed:ne,initialSlide:oe,inViewThreshold:fe,withControls:ge,withIndicators:we,plugins:Ee,nextControlIcon:ie,previousControlIcon:ce,skipSnaps:P,containScroll:Oe,withKeyboardEvents:De,mod:N,...Fe}=n,Me=Wt({name:"Carousel",classes:cg,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:sD}),Te=Uc(),{dir:Ne}=GT(),[$e,ae]=ug({axis:O==="horizontal"?"x":"y",direction:O==="horizontal"?Ne:void 0,startIndex:oe,loop:Q,align:S,slidesToScroll:L,draggable:G,dragFree:W,speed:ne,inViewThreshold:fe,skipSnaps:P,containScroll:Oe},Ee),[_e,Je]=j.useState(0),[Ie,qe]=j.useState(0),xt=j.useCallback(yt=>ae&&ae.scrollTo(yt),[ae]),gt=j.useCallback(()=>{if(!ae)return;const yt=ae.selectedScrollSnap();Je(yt),yt!==_e&&(g==null||g(yt))},[ae,Je,g,_e]),At=j.useCallback(()=>{ae==null||ae.scrollPrev(),m==null||m()},[ae]),nn=j.useCallback(()=>{ae==null||ae.scrollNext(),d==null||d()},[ae]),Vn=j.useCallback(yt=>{De&&(yt.key==="ArrowRight"&&(yt.preventDefault(),nn()),yt.key==="ArrowLeft"&&(yt.preventDefault(),At()))},[ae]);j.useEffect(()=>{if(ae)return p==null||p(ae),gt(),qe(ae.scrollSnapList().length),ae.on("select",gt),()=>{ae.off("select",gt)}},[ae,L,gt]),j.useEffect(()=>{ae&&(ae.reInit(),qe(ae.scrollSnapList().length),Je(yt=>R2(yt,0,j.Children.toArray(c).length-1)))},[j.Children.toArray(c).length,L]);const cn=(ae==null?void 0:ae.canScrollPrev())||!1,Dt=(ae==null?void 0:ae.canScrollNext())||!1,Ut=Array(Ie).fill(0).map((yt,Mt)=>j.createElement(Eo,{...Me("indicator"),key:Mt,"data-active":Mt===_e||void 0,"aria-hidden":!0,tabIndex:-1,onClick:()=>xt(Mt),"data-orientation":O}));return R.jsxs(rD,{value:{getStyles:Me,orientation:O},children:[R.jsx(aD,{...n,selector:`.${Te}`}),R.jsxs(ft,{ref:t,...Me("root",{className:Te}),...Fe,mod:[{orientation:O,"include-gap-in-size":U},N],onKeyDownCapture:Vn,children:[R.jsx("div",{...Me("viewport"),ref:$e,children:R.jsx("div",{...Me("container"),"data-orientation":O,children:c})}),we&&R.jsx("div",{...Me("indicators"),"data-orientation":O,children:Ut}),ge&&R.jsxs("div",{...Me("controls"),"data-orientation":O,children:[R.jsx(Eo,{...k,...Me("control",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),onClick:yt=>{var Mt;At(),(Mt=k==null?void 0:k.onClick)==null||Mt.call(k,yt)},"data-inactive":!cn||void 0,tabIndex:cn?0:-1,children:typeof ce<"u"?ce:R.jsx(Kp,{style:{transform:`rotate(${F0({dir:Ne,orientation:O,direction:"previous"})}deg)`}})}),R.jsx(Eo,{...Me("control",{className:v==null?void 0:v.className,style:v==null?void 0:v.style}),...v,onClick:yt=>{var Mt;nn(),(Mt=v==null?void 0:v.onClick)==null||Mt.call(v,yt)},"data-inactive":!Dt||void 0,tabIndex:Dt?0:-1,children:typeof ie<"u"?ie:R.jsx(Kp,{style:{transform:`rotate(${F0({dir:Ne,orientation:O,direction:"next"})}deg)`}})})]})]})]})});vo.classes=cg;vo.displayName="@mantine/carousel/Carousel";vo.Slide=fg;function uS(){const[e,t]=j.useState(""),[n,r]=j.useState(""),[i,o]=j.useState(""),[a,l]=j.useState(""),[u,c]=j.useState(!1),[p,d]=j.useState(null),m=km(),{replaceSession:g}=j.useContext($o),{login:v,verifyEmail:k}=Em(),_=()=>p==null?void 0:p.scrollNext(),b=U=>{const{name:G,value:W}=U.target;G==="first"?r(W):G==="email"?l(W):G==="2FA"&&o(W)},w=()=>{c(!0),v(n,a).then(U=>{c(!1),t(""),U==="pass"?m("/home"):_()}).catch(U=>{c(!1),t(U),console.log("user has been rejected ",U)})},E=()=>{c(!0),k(i).then(U=>{if(U.current_session&&U.current_session.length>0){const G={session_id:Date.now().toString(),queries:U.current_session};g(G)}c(!1),m("/home"),console.log("success!")}).catch(U=>{c(!1),t(U),console.error("reject verify")})},O=()=>R.jsxs("div",{children:[R.jsx(Ui,{fw:500,c:"dimmed",children:"Terms of Usage"}),R.jsx(or,{h:"sm"}),R.jsx(Ui,{size:"sm",children:" Before we get started, it's important to let you know that this is a chatbot session. While our chatbot is designed to provide helpful and supportive responses, please remember that there is no human monitoring this data in real-time. If you are experiencing any acute issues or need immediate assistance, we strongly encourage you to reach out to your nearest health center or emergency services. Your experience and opinions are incredibly valuable to us. By participating in this session, you're helping to shape the future of alcohol counseling and improve support systems for others. Your feedback will contribute to enhancing the effectiveness of these tools, making them even more responsive to the needs of individuals seeking help. Thank you for your time and contribution. Let's get started!"}),R.jsx("div",{children:R.jsx(Ar,{children:R.jsx(Co,{test:"1",mt:"md",radius:"md",onClick:_,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},children:"Continue"})})})]}),I=()=>R.jsxs("div",{children:[e&&R.jsx(pc,{variant:"light",color:"red",radius:"md",title:"Error",children:e}),R.jsx(or,{h:"sm"}),R.jsxs(hc,{legend:"Registration information",children:[R.jsx(zl,{name:"first",onChange:b,label:"First name",placeholder:"Your name"}),R.jsx(zl,{name:"email",onChange:b,label:"Email",placeholder:"Email",mt:"md"}),R.jsx(Ar,{children:R.jsx(Co,{test:"1",mt:"md",radius:"md",onClick:w,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},loading:u,children:"Login"})})]}),R.jsx(or,{h:"sm"})]}),S=()=>R.jsxs("div",{children:[e&&R.jsx(pc,{variant:"light",color:"red",radius:"md",title:"Error",children:e}),R.jsx(or,{h:"sm"}),R.jsxs(hc,{legend:"Please enter the 6-digit code sent via email",style:{height:"242px"},children:[R.jsx(or,{h:"lg"}),R.jsx(or,{h:"lg"}),R.jsx(zl,{leftSection:R.jsx(pm,{}),label:"Code",placeholder:"__ __ __ __ __ __ ",onChange:b,name:"2FA"}),R.jsx(or,{h:"lg"}),R.jsx(or,{h:"lg"}),R.jsx(Ar,{children:R.jsx(Co,{loading:u,mt:"md",radius:"md",onClick:E,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},children:"Validate"})})]}),R.jsx(or,{h:"sm"})]}),L=()=>R.jsxs(vo,{loop:!0,withControls:!1,draggable:!1,withKeyboardEvents:!1,getEmblaApi:d,children:[R.jsx(vo.Slide,{children:O()}),R.jsx(vo.Slide,{children:I()}),R.jsx(vo.Slide,{children:S()})]});return R.jsx("div",{style:{justifyContent:"center"},className:"content",children:R.jsx(Vm,{children:R.jsxs(Es,{shadow:"lg",padding:"lg",radius:"md",withBorder:!0,style:{minWidth:"800px"},children:[R.jsx(Xc,{order:3,children:"Welcome to MICA!"}),R.jsx(or,{h:"sm"}),R.jsxs(ni,{children:[R.jsx(ni.Col,{span:7,children:L()}),R.jsx(ni.Col,{span:5,children:R.jsx(Ar,{children:R.jsx("div",{className:"Splash"})})})]}),R.jsx(Ar,{children:R.jsx(Ui,{size:"xs",c:"dimmed",children:R.jsxs("span",{style:{verticalAlign:"middle"},children:[R.jsx(zc,{})," Stanford Medicine"]})})})]})})})}var nf={};Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;var uD=Object.assign||function(e){for(var t=1;t{v2().then(u=>{n(u.sort((c,p)=>p.timestamp-c.timestamp))})},[]);const i=async u=>{await x2(u);const c=t.filter(p=>p.session_id!==u);n(c)},o=async()=>{fD({title:"Confirm deletion",message:"Are you sure you want to delete all chat history?",buttons:[{label:"Yes",onClick:async()=>{await m2(),n([]),r.clearMessages()}},{label:"No",onClick:()=>{}}]})},a=u=>{const c=t.find(p=>p.session_id===u);r.replaceSession(c),e("home")},l=u=>u.map((c,p)=>{const d=c.queries.length>0?c.queries[0].user_content:"";return R.jsxs(Tp,{className:"history session",children:[R.jsx(ao,{xs:{span:4},className:"history_date soft_text",children:SD(c.timestamp)}),R.jsx(ao,{xs:{span:7},className:"history_query soft_text",onClick:()=>{a(c.session_id)},children:kD(d,38)}),R.jsx(ao,{xs:1,className:"soft_text trashit",onClick:()=>{i(c.session_id)},children:R.jsx(lc,{color:"#666",size:20})})]},p)});return R.jsxs(R.Fragment,{children:[R.jsx(Cm,{}),R.jsx("div",{className:"content",children:R.jsx(gs,{className:"body archive",children:R.jsxs("div",{className:"box",children:[R.jsxs(Tp,{className:"history header",children:[R.jsx(ao,{xs:{span:4},className:"history_date soft_text",children:"Date"}),R.jsx(ao,{xs:{span:7},className:"history_query soft_text",children:"Starting Query"}),R.jsx(ao,{xs:1,className:"soft_text trashit",onClick:o,children:R.jsx(lc,{color:"red",size:20})})]}),l(t)]})})})]})}function CD(){const[e,t]=j.useState("splash"),n=i=>{t(i)};let r;switch(e){case"home":r=R.jsx(iS,{changeView:n});break;case"history":r=R.jsx(ED,{changeView:n});break;case"login":r=R.jsx(uS,{changeView:n});break;case"splash":default:r=R.jsx(wb,{changeView:n});break}return e==="login"?R.jsx(R.Fragment,{children:R.jsx("div",{style:{justifyContent:"center"},className:"content",children:r})}):R.jsxs("div",{className:`full-screen-container ${e}`,children:[e!=="splash"&&R.jsxs(R.Fragment,{children:[R.jsx(Cm,{changeView:n}),R.jsx("div",{className:"content",children:r}),R.jsx(Kx,{changeView:n})]}),e==="splash"&&r]})}const _D=({children:e})=>{const{authed:t}=Em();return t?e:(console.log("user is not authenticated ... redirecting"),R.jsx(ZO,{to:"/",replace:!0}))},PD=r2([{path:"/",element:R.jsx(uS,{})},{path:"/splash",element:R.jsx(wb,{})},{path:"/home",element:R.jsx(_D,{children:R.jsx(iS,{})})}]),OD=()=>R.jsx(k2,{children:R.jsx(d2,{router:PD})});Au.createRoot(document.getElementById("chatbot_ui_container")).render(R.jsx(ot.StrictMode,{children:R.jsx(b2,{children:R.jsx(tb,{children:R.jsx(OD,{})})})}));window.REDCap_Chatbot=CD; +`},i),o}function eA(e,t){return e&&"run"in e?async function(n,r){const i=E0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return E0(n,{file:r,...t||e})}}function C0(e){if(e)throw e}var Iu=Object.prototype.hasOwnProperty,nS=Object.prototype.toString,_0=Object.defineProperty,P0=Object.getOwnPropertyDescriptor,O0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):nS.call(t)==="[object Array]"},T0=function(t){if(!t||nS.call(t)!=="[object Object]")return!1;var n=Iu.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Iu.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Iu.call(t,i)},R0=function(t,n){_0&&n.name==="__proto__"?_0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},j0=function(t,n){if(n==="__proto__")if(Iu.call(t,n)){if(P0)return P0(t,n).value}else return;return t[n]},tA=function e(){var t,n,r,i,o,a,l=arguments[0],u=1,c=arguments.length,p=!1;for(typeof l=="boolean"&&(p=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ua.length;let u;l&&a.push(i);try{u=e.apply(this,a)}catch(c){const p=c;if(l&&n)throw p;return i(p)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const Ir={basename:iA,dirname:oA,extname:aA,join:lA,sep:"/"};function iA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_s(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function oA(e){if(_s(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function aA(e){_s(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function lA(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uA(e,t){let n="",r=0,i=-1,o=0,a=-1,l,u;for(;++a<=e.length;){if(a2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return n}function _s(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cA={cwd:fA};function fA(){return"/"}function nh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dA(e){if(typeof e=="string")e=new URL(e);else if(!nh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return pA(e)}function pA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...v]=p;const k=r[m][1];th(k)&&th(g)&&(g=xd(!0,k,g)),r[m]=[c,g,...v]}}}}const yA=new og().freeze();function Ed(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _d(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I0(e){if(!th(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mu(e){return vA(e)?e:new rS(e)}function vA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wA(e){return typeof e=="string"||xA(e)}function xA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A0=[],D0={allowDangerousHtml:!0},SA=/^(https?|ircs?|mailto|xmpp)$/i,kA=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EA(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,l=e.rehypePlugins||A0,u=e.remarkPlugins||A0,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...D0}:D0,p=e.skipHtml,d=e.unwrapDisallowed,m=e.urlTransform||CA,g=yA().use(oL).use(u).use(eA,c).use(l),v=new rS;typeof r=="string"&&(v.value=r);for(const w of kA)Object.hasOwn(e,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+bA+w.id,void 0);const k=g.parse(v);let _=g.runSync(k,v);return i&&(_={type:"element",tagName:"div",properties:{className:i},children:_.type==="root"?_.children:[_]}),tS(_,b),Mj(_,{Fragment:R.Fragment,components:o,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function b(w,E,O){if(w.type==="raw"&&O&&typeof E=="number")return p?O.children.splice(E,1):O.children[E]={type:"text",value:w.value},E;if(w.type==="element"){let I;for(I in yd)if(Object.hasOwn(yd,I)&&Object.hasOwn(w.properties,I)){const S=w.properties[I],L=yd[I];(L===null||L.includes(w.tagName))&&(w.properties[I]=m(String(S||""),I,w))}}if(w.type==="element"){let I=t?!t.includes(w.tagName):a?a.includes(w.tagName):!1;if(!I&&n&&typeof E=="number"&&(I=!n(w,E,O)),I&&O&&typeof E=="number")return d&&w.children?O.children.splice(E,1,...w.children):O.children.splice(E,1),E}}}function CA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||SA.test(e.slice(0,t))?e:""}const _A=()=>{const e=j.useContext($o),t=j.useRef(null),n=i=>{e.deleteInteraction(i)},r=()=>t.current?t.current.querySelector(".votes"):null;return e.showRatingPO,Ru.Header,Ru.Body,j.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"start"})},[e.chatContext]),R.jsx("div",{className:"messages",children:e&&e.chatContext&&e.chatContext.length>0?e.chatContext.map((i,o)=>R.jsxs(ot.Fragment,{children:[R.jsxs("dl",{ref:o===e.chatContext.length-1?t:null,children:[R.jsxs("dt",{children:[i.user_content,R.jsx(mm,{className:"delete-icon",onClick:()=>n(o)})]}),i.assistant_content&&R.jsx("dd",{children:R.jsx(EA,{children:i.assistant_content})})]}),o{e()},[]),R.jsxs(R.Fragment,{children:[R.jsx(Cm,{}),R.jsx("div",{className:"content",children:R.jsx(gs,{className:"body",children:R.jsx(_A,{})})}),R.jsx(Kx,{})]})}function PA(e,t,n,r,i){return r+(i-r)*((e-t)/(n-t))}function ag(e){return typeof e=="number"}function M0(e){return typeof e=="string"}function rh(e){return Object.prototype.toString.call(e)==="[object Object]"}function OA(e){return Array.isArray(e)}function z0(e){return rh(e)||OA(e)}function Bt(e){return Math.abs(e)}function lg(e){return e?e/Bt(e):0}function kl(e,t){return Bt(e-t)}function TA(e,t){if(e===0||t===0||Bt(e)<=Bt(t))return 0;var n=kl(Bt(e),Bt(t));return Bt(n/e)}function RA(e){var t=Math.pow(10,e);return function(n){return Math.round(n*t)/t}}function cs(e){return _o(e).map(Number)}function ri(e){return e[tf(e)]}function tf(e){return Math.max(0,e.length-1)}function _o(e){return Object.keys(e)}function oS(e,t){return[e,t].reduce(function(n,r){return _o(r).forEach(function(i){var o=n[i],a=r[i],l=rh(o)&&rh(a);n[i]=l?oS(o,a):a}),n},{})}function aS(e,t){var n=_o(e),r=_o(t);return n.length!==r.length?!1:n.every(function(i){var o=e[i],a=t[i];return typeof o=="function"?"".concat(o)==="".concat(a):!z0(o)||!z0(a)?o===a:aS(o,a)})}function jA(e,t){var n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(){return t*Number(e)}function l(c){return ag(e)?a():n[e](c)}var u={measure:l};return u}function NA(e){var t=0;function n(a,l){return function(){a===!!t&&l()}}function r(){t=window.requestAnimationFrame(e)}function i(){window.cancelAnimationFrame(t),t=0}var o={proceed:n(!0,r),start:n(!1,r),stop:n(!0,i)};return o}function IA(e,t){var n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=l(),o=u();function a(p){var d=p.width,m=p.height;return n==="x"?d:m}function l(){return n==="y"?"top":t==="rtl"?"right":"left"}function u(){return n==="y"?"bottom":t==="rtl"?"left":"right"}var c={scroll:n,cross:r,startEdge:i,endEdge:o,measureSize:a};return c}function La(e,t){var n=Bt(e-t);function r(c){return ct}function o(c){return r(c)||i(c)}function a(c){return o(c)?r(c)?e:t:c}function l(c){return n?c-n*Math.ceil((c-t)/n):c}var u={length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:l};return u}function lS(e,t,n){var r=La(0,e),i=r.min,o=r.constrain,a=e+1,l=u(t);function u(v){return n?Bt((a+v)%a):o(v)}function c(){return l}function p(v){return l=u(v),g}function d(v){return p(c()+v)}function m(){return lS(e,c(),n)}var g={add:d,clone:m,get:c,set:p,min:i,max:e};return g}function LA(e){var t=e==="rtl"?-1:1;function n(i){return i*t}var r={apply:n};return r}function vc(){var e=[];function t(i,o,a,l){return l===void 0&&(l={passive:!0}),i.addEventListener(o,a,l),e.push(function(){return i.removeEventListener(o,a,l)}),r}function n(){return e=e.filter(function(i){return i()}),r}var r={add:t,removeAll:n};return r}function Vi(e){var t=e;function n(){return t}function r(d){return t=c(d),p}function i(d){return t+=c(d),p}function o(d){return t-=c(d),p}function a(d){return t*=d,p}function l(d){return t/=d,p}function u(){return t!==0&&l(t),p}function c(d){return ag(d)?d:d.get()}var p={add:i,divide:l,get:n,multiply:a,normalize:u,set:r,subtract:o};return p}function AA(e,t,n,r,i,o,a,l,u,c,p,d,m,g,v,k){var _=e.cross,b=["INPUT","SELECT","TEXTAREA"],w={passive:!1},E=Vi(0),O=vc(),I=vc(),S=m.measure(20),L={mouse:300,touch:400},U={mouse:500,touch:600},G=v?5:16,W=1,Q=0,ne=0,oe=!1,fe=!1,ge=!1,we=!1;function Ee(){var _e=n;O.add(_e,"dragstart",function(Je){return Je.preventDefault()},w).add(_e,"touchmove",function(){},w).add(_e,"touchend",function(){}).add(_e,"touchstart",N).add(_e,"mousedown",N).add(_e,"touchcancel",Me).add(_e,"contextmenu",Me).add(_e,"click",Te,!0)}function ie(){var _e=we?document:n;I.add(_e,"touchmove",Fe,w).add(_e,"touchend",Me).add(_e,"mousemove",Fe,w).add(_e,"mouseup",Me)}function ce(){O.removeAll(),I.removeAll()}function P(_e){var Je=_e.nodeName||"";return b.indexOf(Je)>-1}function Oe(){var _e=v?U:L,Je=we?"mouse":"touch";return _e[Je]}function De(_e,Je){var Ie=p.clone().add(lg(_e)*-1),qe=Ie.get()===p.min||Ie.get()===p.max,xt=c.byDistance(_e,!v).distance;return v||Bt(_e)=2,Ie=we||!Je;oe=!0,i.pointerDown(_e),E.set(r),r.set(o),u.useBaseMass().useSpeed(80),ie(),Q=i.readPoint(_e),ne=i.readPoint(_e,_),d.emit("pointerDown"),Ie&&(ge=!1)}}function Fe(_e){if(!fe&&!we){if(!_e.cancelable)return Me(_e);var Je=i.readPoint(_e),Ie=i.readPoint(_e,_),qe=kl(Je,Q),xt=kl(Ie,ne);if(fe=qe>xt,!fe&&!ge)return Me(_e)}var gt=i.pointerMove(_e);!ge&>&&(ge=!0),a.start(),r.add(t.apply(gt)),_e.preventDefault()}function Me(_e){var Je=c.byDistance(0,!1),Ie=Je.index!==p.get(),qe=i.pointerUp(_e)*Oe(),xt=De(t.apply(qe),Ie),gt=TA(qe,xt),At=kl(r.get(),E.get())>=.5,nn=Ie&>>.75,Vn=Bt(qe)t;return r=d,g&&(n=d),m}function c(d){if(!n||!r)return 0;var m=a(r)-a(n),g=o(d)-o(n),v=o(d)-o(r)>t,k=m/g,_=g&&!v&&Bt(k)>.1;return _?k:0}var p={isTouchEvent:i,pointerDown:l,pointerMove:u,pointerUp:c,readPoint:a};return p}function MA(e){function t(r){return e*(r/100)}var n={measure:t};return n}function zA(e,t,n){var r=RA(2),i=Vi(0),o=Vi(0),a=Vi(0),l=0,u=t,c=n;function p(){i.add(o),e.add(i),o.multiply(0)}function d(O){O.divide(c),o.add(O)}function m(O){a.set(O).subtract(e);var I=PA(a.get(),0,100,0,u);return l=lg(a.get()),a.normalize().multiply(I).subtract(i),d(a),E}function g(O){var I=O.get()-e.get(),S=!r(I);return S&&e.set(O),S}function v(){return l}function k(){return b(t)}function _(){return w(n)}function b(O){return u=O,E}function w(O){return c=O,E}var E={direction:v,seek:m,settle:g,update:p,useBaseMass:_,useBaseSpeed:k,useMass:w,useSpeed:b};return E}function $A(e,t,n,r,i){var o=i.measure(10),a=i.measure(50),l=.85,u=!1;function c(){return!(u||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function p(g){if(c()){var v=e.reachedMin(t.get())?"min":"max",k=Bt(e[v]-t.get()),_=n.get()-t.get(),b=Math.min(k/a,l);n.subtract(_*b),!g&&Bt(_)0?L.concat([U]):L},[])}function v(I,S){var L=S==="start",U=L?-r:r,G=a.findSlideBounds([U]);return I.map(function(W){var Q=L?0:-r,ne=L?r:0,oe=G.filter(function(ce){return ce.index===W})[0],fe=oe[L?"end":"start"],ge=Vi(-1),we=Vi(-1),Ee=sS(e,t,u[W]),ie=function(){return ge.set(l.get()>fe?Q:ne)};return{index:W,location:we,translate:Ee,target:ie}})}function k(){var I=o[0]-1,S=g(p,I);return v(S,"end")}function _(){var I=n-o[0]-1,S=g(c,I);return v(S,"start")}function b(){return d.every(function(I){var S=I.index,L=c.filter(function(U){return U!==S});return m(L,n)<=.1})}function w(){d.forEach(function(I){var S=I.target,L=I.translate,U=I.location,G=S();G.get()!==U.get()&&(G.get()===0?L.clear():L.to(G),U.set(G))})}function E(){d.forEach(function(I){return I.translate.clear()})}var O={canLoop:b,clear:E,loop:w,loopPoints:d};return O}function YA(e,t,n,r,i,o,a){var l=i.removeOffset,u=i.constrain,c=.5,p=o?[0,t,-t]:[0],d=g(p,a);function m(_){var b=_||0;return n.map(function(w){var E=La(c,w-c);return E.constrain(w*b)})}function g(_,b){var w=_||p,E=m(b);return w.reduce(function(O,I){var S=r.map(function(L,U){return{start:L-n[U]+E[U]+I,end:L+e-E[U]+I,index:U}});return O.concat(S)},[])}function v(_,b){var w=o?l(_):u(_),E=b||d;return E.reduce(function(O,I){var S=I.index,L=I.start,U=I.end,G=O.indexOf(S)!==-1,W=Lw;return!G&&W?O.concat([S]):O},[])}var k={check:v,findSlideBounds:g};return k}function QA(e,t,n,r,i){var o=e.measureSize,a=e.startEdge,l=e.endEdge,u=n[0]&&i,c=g(),p=v(),d=n.map(o),m=k();function g(){if(!u)return 0;var b=n[0];return Bt(t[a]-b[a])}function v(){if(!u)return 0;var b=window.getComputedStyle(ri(r));return parseFloat(b.getPropertyValue("margin-".concat(l)))}function k(){return n.map(function(b,w,E){var O=!w,I=w===tf(E);return O?d[w]+c:I?d[w]+p:E[w+1][a]-b[a]}).map(Bt)}var _={slideSizes:d,slideSizesWithGaps:m};return _}function GA(e,t,n){var r=ag(n);function i(u,c){return cs(u).filter(function(p){return p%c===0}).map(function(p){return u.slice(p,p+c)})}function o(u){return cs(u).reduce(function(c,p){var d=t.slice(ri(c),p+1),m=d.reduce(function(g,v){return g+v},0);return!p||m>e?c.concat(p):c},[]).map(function(c,p,d){return u.slice(c,d[p+1])})}function a(u){return r?i(u,n):o(u)}var l={groupSlides:a};return l}function XA(e,t,n,r,i){var o=r.align,a=r.axis,l=r.direction,u=r.startIndex,c=r.inViewThreshold,p=r.loop,d=r.speed,m=r.dragFree,g=r.slidesToScroll,v=r.skipSnaps,k=r.containScroll,_=t.getBoundingClientRect(),b=n.map(function(xt){return xt.getBoundingClientRect()}),w=LA(l),E=IA(a,l),O=E.measureSize(_),I=MA(O),S=jA(o,O),L=!p&&k!=="",U=p||k!=="",G=QA(E,_,b,n,U),W=G.slideSizes,Q=G.slideSizesWithGaps,ne=GA(O,Q,g),oe=HA(E,S,_,b,Q,ne,L),fe=oe.snaps,ge=oe.snapsAligned,we=-ri(fe)+ri(Q),Ee=FA(O,we,ge,k).snapsContained,ie=L?Ee:ge,ce=BA(we,ie,p).limit,P=lS(tf(ie),u,p),Oe=P.clone(),De=cs(n),N=function(){p||qe.scrollBounds.constrain(qe.dragHandler.pointerDown()),qe.scrollBody.seek(Ne).update();var xt=qe.scrollBody.settle(Ne);xt&&!qe.dragHandler.pointerDown()&&(qe.animation.stop(),i.emit("settle")),xt||i.emit("scroll"),p&&(qe.scrollLooper.loop(qe.scrollBody.direction()),qe.slideLooper.loop()),qe.translate.to(Te),qe.animation.proceed()},Fe=NA(N),Me=ie[P.get()],Te=Vi(Me),Ne=Vi(Me),$e=zA(Te,d,1),ae=WA(p,ie,we,ce,Ne),_e=KA(Fe,P,Oe,ae,Ne,i),Je=YA(O,we,W,fe,ce,p,c),Ie=AA(E,w,e,Ne,DA(E),Te,Fe,_e,$e,ae,P,i,I,p,m,v),qe={containerRect:_,slideRects:b,animation:Fe,axis:E,direction:w,dragHandler:Ie,eventStore:vc(),percentOfView:I,index:P,indexPrevious:Oe,limit:ce,location:Te,options:r,scrollBody:$e,scrollBounds:$A(ce,Te,Ne,$e,I),scrollLooper:UA(we,ce,Te,[Te,Ne]),scrollProgress:VA(ce),scrollSnaps:ie,scrollTarget:ae,scrollTo:_e,slideLooper:qA(E,w,O,we,Q,ie,Je,Te,n),slidesToScroll:ne,slidesInView:Je,slideIndexes:De,target:Ne,translate:sS(E,w,t)};return qe}function JA(){var e={};function t(a){return e[a]||[]}function n(a){return t(a).forEach(function(l){return l(a)}),o}function r(a,l){return e[a]=t(a).concat([l]),o}function i(a,l){return e[a]=t(a).filter(function(u){return u!==l}),o}var o={emit:n,off:i,on:r};return o}var ZA={align:"center",axis:"x",container:null,slides:null,containScroll:"",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,draggable:!0,inViewThreshold:0,loop:!1,skipSnaps:!1,speed:10,startIndex:0,active:!0};function sg(){function e(i,o){return oS(i,o||{})}function t(i,o){var a=JSON.stringify(_o(i.breakpoints||{})),l=JSON.stringify(_o(o.breakpoints||{}));return a!==l?!1:aS(i,o)}function n(i){var o=i.breakpoints||{},a=_o(o).filter(function(l){return window.matchMedia(l).matches}).map(function(l){return o[l]}).reduce(function(l,u){return e(l,u)},{});return e(i,a)}var r={merge:e,areEqual:t,atMedia:n};return r}function eD(){var e=sg(),t=e.atMedia,n=e.areEqual,r=[],i=[];function o(){return i.some(function(p){return p()})}function a(p){var d=t(p.options);return function(){return!n(d,t(p.options))}}function l(p,d){return i=p.map(a),r=p.filter(function(m){return t(m.options).active}),r.forEach(function(m){return m.init(d)}),p.reduce(function(m,g){var v;return Object.assign(m,(v={},v[g.name]=g,v))},{})}function u(){r=r.filter(function(p){return p.destroy()})}var c={init:l,destroy:u,haveChanged:o};return c}function Po(e,t,n){var r=vc(),i=sg(),o=eD(),a=JA(),l=a.on,u=a.off,c=I,p=!1,d,m=i.merge(ZA,Po.globalOptions),g=i.merge(m),v=[],k,_=0,b,w;function E(){var Ne=g.container,$e=g.slides,ae=M0(Ne)?e.querySelector(Ne):Ne;b=ae||e.children[0];var _e=M0($e)?b.querySelectorAll($e):$e;w=[].slice.call(_e||b.children)}function O(Ne,$e){if(!p){if(m=i.merge(m,Ne),g=i.atMedia(m),E(),d=XA(e,b,w,g,a),_=d.axis.measureSize(e.getBoundingClientRect()),!g.active)return S();if(d.translate.to(d.location),v=$e||v,k=o.init(v,Te),g.loop){if(!d.slideLooper.canLoop()){S(),O({loop:!1},$e),m=i.merge(m,{loop:!0});return}d.slideLooper.loop()}g.draggable&&b.offsetParent&&w.length&&d.dragHandler.addActivationEvents()}}function I(Ne,$e){var ae=ie();S(),O(i.merge({startIndex:ae},Ne),$e),a.emit("reInit")}function S(){d.dragHandler.removeAllEvents(),d.animation.stop(),d.eventStore.removeAll(),d.translate.clear(),d.slideLooper.clear(),o.destroy()}function L(){p||(p=!0,r.removeAll(),S(),a.emit("destroy"))}function U(){var Ne=i.atMedia(m),$e=!i.areEqual(Ne,g),ae=d.axis.measureSize(e.getBoundingClientRect()),_e=_!==ae,Je=o.haveChanged();(_e||$e||Je)&&I(),a.emit("resize")}function G(Ne){var $e=d[Ne?"target":"location"].get(),ae=g.loop?"removeOffset":"constrain";return d.slidesInView.check(d.limit[ae]($e))}function W(Ne){var $e=G(Ne);return d.slideIndexes.filter(function(ae){return $e.indexOf(ae)===-1})}function Q(Ne,$e,ae){!g.active||p||(d.scrollBody.useBaseMass().useSpeed($e?100:g.speed),d.scrollTo.index(Ne,ae||0))}function ne(Ne){var $e=d.index.clone().add(1);Q($e.get(),Ne===!0,-1)}function oe(Ne){var $e=d.index.clone().add(-1);Q($e.get(),Ne===!0,1)}function fe(){var Ne=d.index.clone().add(1);return Ne.get()!==ie()}function ge(){var Ne=d.index.clone().add(-1);return Ne.get()!==ie()}function we(){return d.scrollSnaps.map(d.scrollProgress.get)}function Ee(){return d.scrollProgress.get(d.location.get())}function ie(){return d.index.get()}function ce(){return d.indexPrevious.get()}function P(){return d.dragHandler.clickAllowed()}function Oe(){return k}function De(){return d}function N(){return e}function Fe(){return b}function Me(){return w}var Te={canScrollNext:fe,canScrollPrev:ge,clickAllowed:P,containerNode:Fe,internalEngine:De,destroy:L,off:u,on:l,plugins:Oe,previousScrollSnap:ce,reInit:c,rootNode:N,scrollNext:ne,scrollPrev:oe,scrollProgress:Ee,scrollSnapList:we,scrollTo:Q,selectedScrollSnap:ie,slideNodes:Me,slidesInView:G,slidesNotInView:W};return O(t,n),r.add(window,"resize",U),setTimeout(function(){return a.emit("init")},0),Te}Po.globalOptions=void 0;Po.optionsHandler=sg;function tD(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function $0(e){return e.concat().sort(function(t,n){return t.name>n.name?1:-1}).map(function(t){return t.options})}function nD(e,t){if(e.length!==t.length)return!1;var n=Po.optionsHandler().areEqual,r=$0(e),i=$0(t);return r.every(function(o,a){var l=i[a];return n(o,l)})}function ug(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=j.useRef(Po.optionsHandler()),r=j.useRef(e),i=j.useRef(t),o=j.useState(),a=o[0],l=o[1],u=j.useState(),c=u[0],p=u[1],d=j.useCallback(function(){a&&a.reInit(r.current,i.current)},[a]);return j.useEffect(function(){if(tD()&&c){Po.globalOptions=ug.globalOptions;var m=Po(c,r.current,i.current);return l(m),function(){return m.destroy()}}else l(void 0)},[c,l]),j.useEffect(function(){n.current.areEqual(r.current,e)||(r.current=e,d())},[e,d]),j.useEffect(function(){nD(i.current,t)||(i.current=t,d())},[t,d]),[p,a]}ug.globalOptions=void 0;const[rD,iD]=Pm("Carousel component was not found in tree");var cg={root:"m_17884d0f",viewport:"m_a2dae653",container:"m_fcd81474",controls:"m_39bc3463",control:"m_64f58e10",indicators:"m_71ea3ab1",indicator:"m_eae68602",slide:"m_d98df724"};const oD={},fg=un((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:a,mod:l,...u}=dt("CarouselSlide",oD,e),c=iD();return R.jsx(ft,{ref:t,mod:[{orientation:c.orientation},l],...c.getStyles("slide",{className:r,style:i,classNames:n,styles:o}),...u})});fg.classes=cg;fg.displayName="@mantine/carousel/CarouselSlide";function aD({slideGap:e,slideSize:t,selector:n}){const r=Vr(),i=$a({"--carousel-slide-gap":ko(yo(e)),"--carousel-slide-size":se(yo(t))}),o=Jt(r.breakpoints).reduce((u,c)=>(u[c]||(u[c]={}),typeof e=="object"&&e[c]!==void 0&&(u[c]["--carousel-slide-gap"]=ko(e[c])),typeof t=="object"&&t[c]!==void 0&&(u[c]["--carousel-slide-size"]=ko(t[c])),u),{}),l=Om(Jt(o),r).filter(u=>Jt(o[u.value]).length>0).map(u=>({query:`(min-width: ${r.breakpoints[u.value]})`,styles:o[u.value]}));return R.jsx(Bc,{styles:i,media:l,selector:n})}function F0({dir:e,orientation:t,direction:n}){return n==="previous"?t==="horizontal"?90*(e==="ltr"?1:-1):-180:t==="horizontal"?90*(e==="ltr"?-1:1):0}const lD={controlSize:26,controlsOffset:"sm",slideSize:"100%",slideGap:0,orientation:"horizontal",align:"center",slidesToScroll:1,includeGapInSize:!0,draggable:!0,dragFree:!1,loop:!1,speed:10,initialSlide:0,inViewThreshold:0,withControls:!0,withIndicators:!1,skipSnaps:!1,containScroll:"",withKeyboardEvents:!0},sD=(e,{height:t,controlSize:n,controlsOffset:r})=>({root:{"--carousel-height":se(t),"--carousel-control-size":se(n),"--carousel-controls-offset":ko(r)}}),vo=un((e,t)=>{const n=dt("Carousel",lD,e),{classNames:r,className:i,style:o,styles:a,unstyled:l,vars:u,children:c,getEmblaApi:p,onNextSlide:d,onPreviousSlide:m,onSlideChange:g,nextControlProps:v,previousControlProps:k,controlSize:_,controlsOffset:b,slideSize:w,slideGap:E,orientation:O,height:I,align:S,slidesToScroll:L,includeGapInSize:U,draggable:G,dragFree:W,loop:Q,speed:ne,initialSlide:oe,inViewThreshold:fe,withControls:ge,withIndicators:we,plugins:Ee,nextControlIcon:ie,previousControlIcon:ce,skipSnaps:P,containScroll:Oe,withKeyboardEvents:De,mod:N,...Fe}=n,Me=Wt({name:"Carousel",classes:cg,props:n,className:i,style:o,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:sD}),Te=Uc(),{dir:Ne}=GT(),[$e,ae]=ug({axis:O==="horizontal"?"x":"y",direction:O==="horizontal"?Ne:void 0,startIndex:oe,loop:Q,align:S,slidesToScroll:L,draggable:G,dragFree:W,speed:ne,inViewThreshold:fe,skipSnaps:P,containScroll:Oe},Ee),[_e,Je]=j.useState(0),[Ie,qe]=j.useState(0),xt=j.useCallback(yt=>ae&&ae.scrollTo(yt),[ae]),gt=j.useCallback(()=>{if(!ae)return;const yt=ae.selectedScrollSnap();Je(yt),yt!==_e&&(g==null||g(yt))},[ae,Je,g,_e]),At=j.useCallback(()=>{ae==null||ae.scrollPrev(),m==null||m()},[ae]),nn=j.useCallback(()=>{ae==null||ae.scrollNext(),d==null||d()},[ae]),Vn=j.useCallback(yt=>{De&&(yt.key==="ArrowRight"&&(yt.preventDefault(),nn()),yt.key==="ArrowLeft"&&(yt.preventDefault(),At()))},[ae]);j.useEffect(()=>{if(ae)return p==null||p(ae),gt(),qe(ae.scrollSnapList().length),ae.on("select",gt),()=>{ae.off("select",gt)}},[ae,L,gt]),j.useEffect(()=>{ae&&(ae.reInit(),qe(ae.scrollSnapList().length),Je(yt=>R2(yt,0,j.Children.toArray(c).length-1)))},[j.Children.toArray(c).length,L]);const cn=(ae==null?void 0:ae.canScrollPrev())||!1,Dt=(ae==null?void 0:ae.canScrollNext())||!1,Ut=Array(Ie).fill(0).map((yt,Mt)=>j.createElement(Eo,{...Me("indicator"),key:Mt,"data-active":Mt===_e||void 0,"aria-hidden":!0,tabIndex:-1,onClick:()=>xt(Mt),"data-orientation":O}));return R.jsxs(rD,{value:{getStyles:Me,orientation:O},children:[R.jsx(aD,{...n,selector:`.${Te}`}),R.jsxs(ft,{ref:t,...Me("root",{className:Te}),...Fe,mod:[{orientation:O,"include-gap-in-size":U},N],onKeyDownCapture:Vn,children:[R.jsx("div",{...Me("viewport"),ref:$e,children:R.jsx("div",{...Me("container"),"data-orientation":O,children:c})}),we&&R.jsx("div",{...Me("indicators"),"data-orientation":O,children:Ut}),ge&&R.jsxs("div",{...Me("controls"),"data-orientation":O,children:[R.jsx(Eo,{...k,...Me("control",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),onClick:yt=>{var Mt;At(),(Mt=k==null?void 0:k.onClick)==null||Mt.call(k,yt)},"data-inactive":!cn||void 0,tabIndex:cn?0:-1,children:typeof ce<"u"?ce:R.jsx(Kp,{style:{transform:`rotate(${F0({dir:Ne,orientation:O,direction:"previous"})}deg)`}})}),R.jsx(Eo,{...Me("control",{className:v==null?void 0:v.className,style:v==null?void 0:v.style}),...v,onClick:yt=>{var Mt;nn(),(Mt=v==null?void 0:v.onClick)==null||Mt.call(v,yt)},"data-inactive":!Dt||void 0,tabIndex:Dt?0:-1,children:typeof ie<"u"?ie:R.jsx(Kp,{style:{transform:`rotate(${F0({dir:Ne,orientation:O,direction:"next"})}deg)`}})})]})]})]})});vo.classes=cg;vo.displayName="@mantine/carousel/Carousel";vo.Slide=fg;function uS(){const[e,t]=j.useState(""),[n,r]=j.useState(""),[i,o]=j.useState(""),[a,l]=j.useState(""),[u,c]=j.useState(!1),[p,d]=j.useState(null),m=km(),{replaceSession:g}=j.useContext($o),{login:v,verifyEmail:k}=Em(),_=()=>p==null?void 0:p.scrollNext(),b=U=>{const{name:G,value:W}=U.target;G==="first"?r(W):G==="email"?l(W):G==="2FA"&&o(W)},w=()=>{c(!0),v(n,a).then(U=>{c(!1),t(""),U==="pass"?m("/home"):_()}).catch(U=>{c(!1),t(U),console.log("user has been rejected ",U)})},E=()=>{c(!0),k(i).then(U=>{if(U.current_session&&U.current_session.length>0){const G={session_id:Date.now().toString(),queries:U.current_session};g(G)}c(!1),m("/home"),console.log("success!")}).catch(U=>{c(!1),t(U),console.error("reject verify")})},O=()=>R.jsxs("div",{children:[R.jsx(Ui,{fw:500,c:"dimmed",children:"Terms of Usage"}),R.jsx(or,{h:"sm"}),R.jsx(Ui,{size:"sm",children:" Before we get started, it's important to let you know that this is a chatbot session. While our chatbot is designed to provide helpful and supportive responses, please remember that there is no human monitoring this data in real-time. If you are experiencing any acute issues or need immediate assistance, we strongly encourage you to reach out to your nearest health center or emergency services. Your experience and opinions are incredibly valuable to us. By participating in this session, you're helping to shape the future of alcohol counseling and improve support systems for others. Your feedback will contribute to enhancing the effectiveness of these tools, making them even more responsive to the needs of individuals seeking help. Thank you for your time and contribution. Let's get started!"}),R.jsx("div",{children:R.jsx(Ar,{children:R.jsx(Co,{test:"1",mt:"md",radius:"md",onClick:_,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},children:"Continue"})})})]}),I=()=>R.jsxs("div",{children:[e&&R.jsx(pc,{variant:"light",color:"red",radius:"md",title:"Error",children:e}),R.jsx(or,{h:"sm"}),R.jsxs(hc,{legend:"Registration information",children:[R.jsx(zl,{name:"first",onChange:b,label:"First name",placeholder:"Your name"}),R.jsx(zl,{name:"email",onChange:b,label:"Email",placeholder:"Email",mt:"md"}),R.jsx(Ar,{children:R.jsx(Co,{test:"1",mt:"md",radius:"md",onClick:w,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},loading:u,children:"Login"})})]}),R.jsx(or,{h:"sm"})]}),S=()=>R.jsxs("div",{children:[e&&R.jsx(pc,{variant:"light",color:"red",radius:"md",title:"Error",children:e}),R.jsx(or,{h:"sm"}),R.jsxs(hc,{legend:"Please enter the 6-digit code sent via email",style:{height:"242px"},children:[R.jsx(or,{h:"lg"}),R.jsx(or,{h:"lg"}),R.jsx(zl,{leftSection:R.jsx(pm,{}),label:"Code",placeholder:"__ __ __ __ __ __ ",onChange:b,name:"2FA"}),R.jsx(or,{h:"lg"}),R.jsx(or,{h:"lg"}),R.jsx(Ar,{children:R.jsx(Co,{loading:u,mt:"md",radius:"md",onClick:E,variant:"filled",color:"rgba( 140, 21, 21)",style:{width:"120px"},children:"Validate"})})]}),R.jsx(or,{h:"sm"})]}),L=()=>R.jsxs(vo,{loop:!0,withControls:!1,draggable:!1,withKeyboardEvents:!1,getEmblaApi:d,children:[R.jsx(vo.Slide,{children:O()}),R.jsx(vo.Slide,{children:I()}),R.jsx(vo.Slide,{children:S()})]});return R.jsx("div",{style:{justifyContent:"center"},className:"content",children:R.jsx(Vm,{children:R.jsxs(Es,{shadow:"lg",padding:"lg",radius:"md",withBorder:!0,style:{minWidth:"800px"},children:[R.jsx(Xc,{order:3,children:"Welcome to MICA!"}),R.jsx(or,{h:"sm"}),R.jsxs(ni,{children:[R.jsx(ni.Col,{span:7,children:L()}),R.jsx(ni.Col,{span:5,children:R.jsx(Ar,{children:R.jsx("div",{className:"Splash"})})})]}),R.jsx(Ar,{children:R.jsx(Ui,{size:"xs",c:"dimmed",children:R.jsxs("span",{style:{verticalAlign:"middle"},children:[R.jsx(zc,{})," Stanford Medicine"]})})})]})})})}var nf={};Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;var uD=Object.assign||function(e){for(var t=1;t{v2().then(u=>{n(u.sort((c,p)=>p.timestamp-c.timestamp))})},[]);const i=async u=>{await x2(u);const c=t.filter(p=>p.session_id!==u);n(c)},o=async()=>{fD({title:"Confirm deletion",message:"Are you sure you want to delete all chat history?",buttons:[{label:"Yes",onClick:async()=>{await m2(),n([]),r.clearMessages()}},{label:"No",onClick:()=>{}}]})},a=u=>{const c=t.find(p=>p.session_id===u);r.replaceSession(c),e("home")},l=u=>u.map((c,p)=>{const d=c.queries.length>0?c.queries[0].user_content:"";return R.jsxs(Tp,{className:"history session",children:[R.jsx(ao,{xs:{span:4},className:"history_date soft_text",children:SD(c.timestamp)}),R.jsx(ao,{xs:{span:7},className:"history_query soft_text",onClick:()=>{a(c.session_id)},children:kD(d,38)}),R.jsx(ao,{xs:1,className:"soft_text trashit",onClick:()=>{i(c.session_id)},children:R.jsx(lc,{color:"#666",size:20})})]},p)});return R.jsxs(R.Fragment,{children:[R.jsx(Cm,{}),R.jsx("div",{className:"content",children:R.jsx(gs,{className:"body archive",children:R.jsxs("div",{className:"box",children:[R.jsxs(Tp,{className:"history header",children:[R.jsx(ao,{xs:{span:4},className:"history_date soft_text",children:"Date"}),R.jsx(ao,{xs:{span:7},className:"history_query soft_text",children:"Starting Query"}),R.jsx(ao,{xs:1,className:"soft_text trashit",onClick:o,children:R.jsx(lc,{color:"red",size:20})})]}),l(t)]})})})]})}function CD(){const[e,t]=j.useState("splash"),n=i=>{t(i)};let r;switch(e){case"home":r=R.jsx(iS,{changeView:n});break;case"history":r=R.jsx(ED,{changeView:n});break;case"login":r=R.jsx(uS,{changeView:n});break;case"splash":default:r=R.jsx(wb,{changeView:n});break}return e==="login"?R.jsx(R.Fragment,{children:R.jsx("div",{style:{justifyContent:"center"},className:"content",children:r})}):R.jsxs("div",{className:`full-screen-container ${e}`,children:[e!=="splash"&&R.jsxs(R.Fragment,{children:[R.jsx(Cm,{changeView:n}),R.jsx("div",{className:"content",children:r}),R.jsx(Kx,{changeView:n})]}),e==="splash"&&r]})}const _D=({children:e})=>{const{authed:t}=Em();return t?e:(console.log("user is not authenticated ... redirecting"),R.jsx(ZO,{to:"/",replace:!0}))},PD=r2([{path:"/",element:R.jsx(uS,{})},{path:"/splash",element:R.jsx(wb,{})},{path:"/home",element:R.jsx(_D,{children:R.jsx(iS,{})})}]),OD=()=>R.jsx(k2,{children:R.jsx(d2,{router:PD})});Au.createRoot(document.getElementById("chatbot_ui_container")).render(R.jsx(ot.StrictMode,{children:R.jsx(b2,{children:R.jsx(tb,{children:R.jsx(OD,{})})})}));window.REDCap_Chatbot=CD; diff --git a/mica-chatbot/dist/index.html b/mica-chatbot/dist/index.html index d4d8643..c6713fa 100644 --- a/mica-chatbot/dist/index.html +++ b/mica-chatbot/dist/index.html @@ -5,7 +5,7 @@ Vite + React - +