@neuctra/authix 1.2.32 → 1.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- (function(ee,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],S):(ee=typeof globalThis<"u"?globalThis:ee||self,S(ee.NeuctraAuthix={},ee.React))})(this,(function(ee,S){"use strict";function ct(t,e){return function(){return t.apply(e,arguments)}}const{toString:sr}=Object.prototype,{getPrototypeOf:We}=Object,{iterator:Oe,toStringTag:dt}=Symbol,Ae=(t=>e=>{const n=sr.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ie=t=>(t=t.toLowerCase(),e=>Ae(e)===t),_e=t=>e=>typeof e===t,{isArray:ye}=Array,be=_e("undefined");function ve(t){return t!==null&&!be(t)&&t.constructor!==null&&!be(t.constructor)&&te(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ut=ie("ArrayBuffer");function ir(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ut(t.buffer),e}const or=_e("string"),te=_e("function"),pt=_e("number"),ke=t=>t!==null&&typeof t=="object",ar=t=>t===!0||t===!1,ze=t=>{if(Ae(t)!=="object")return!1;const e=We(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dt in t)&&!(Oe in t)},lr=t=>{if(!ke(t)||ve(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},cr=ie("Date"),dr=ie("File"),ur=ie("Blob"),pr=ie("FileList"),fr=t=>ke(t)&&te(t.pipe),xr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||te(t.append)&&((e=Ae(t))==="formdata"||e==="object"&&te(t.toString)&&t.toString()==="[object FormData]"))},hr=ie("URLSearchParams"),[mr,gr,yr,br]=["ReadableStream","Request","Response","Headers"].map(ie),wr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ee(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,i;if(typeof t!="object"&&(t=[t]),ye(t))for(s=0,i=t.length;s<i;s++)e.call(null,t[s],s,t);else{if(ve(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),a=o.length;let c;for(s=0;s<a;s++)c=o[s],e.call(null,t[c],c,t)}}function ft(t,e){if(ve(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,i;for(;s-- >0;)if(i=n[s],e===i.toLowerCase())return i;return null}const fe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xt=t=>!be(t)&&t!==fe;function Be(){const{caseless:t,skipUndefined:e}=xt(this)&&this||{},n={},s=(i,o)=>{const a=t&&ft(n,o)||o;ze(n[a])&&ze(i)?n[a]=Be(n[a],i):ze(i)?n[a]=Be({},i):ye(i)?n[a]=i.slice():(!e||!be(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Ee(arguments[i],s);return n}const Sr=(t,e,n,{allOwnKeys:s}={})=>(Ee(e,(i,o)=>{n&&te(i)?t[o]=ct(i,n):t[o]=i},{allOwnKeys:s}),t),jr=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),vr=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},kr=(t,e,n,s)=>{let i,o,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)a=i[o],(!s||s(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&We(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Er=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},Cr=t=>{if(!t)return null;if(ye(t))return t;let e=t.length;if(!pt(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Tr=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&We(Uint8Array)),Pr=(t,e)=>{const s=(t&&t[Oe]).call(t);let i;for(;(i=s.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},Ir=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},Rr=ie("HTMLFormElement"),Or=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,i){return s.toUpperCase()+i}),ht=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Ar=ie("RegExp"),mt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};Ee(n,(i,o)=>{let a;(a=e(i,o,t))!==!1&&(s[o]=a||i)}),Object.defineProperties(t,s)},_r=t=>{mt(t,(e,n)=>{if(te(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(te(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zr=(t,e)=>{const n={},s=i=>{i.forEach(o=>{n[o]=!0})};return ye(t)?s(t):s(String(t).split(e)),n},Ur=()=>{},$r=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Nr(t){return!!(t&&te(t.append)&&t[dt]==="FormData"&&t[Oe])}const Dr=t=>{const e=new Array(10),n=(s,i)=>{if(ke(s)){if(e.indexOf(s)>=0)return;if(ve(s))return s;if(!("toJSON"in s)){e[i]=s;const o=ye(s)?[]:{};return Ee(s,(a,c)=>{const d=n(a,i+1);!be(d)&&(o[c]=d)}),e[i]=void 0,o}}return s};return n(t,0)},Fr=ie("AsyncFunction"),Lr=t=>t&&(ke(t)||te(t))&&te(t.then)&&te(t.catch),gt=((t,e)=>t?setImmediate:e?((n,s)=>(fe.addEventListener("message",({source:i,data:o})=>{i===fe&&o===n&&s.length&&s.shift()()},!1),i=>{s.push(i),fe.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",te(fe.postMessage)),qr=typeof queueMicrotask<"u"?queueMicrotask.bind(fe):typeof process<"u"&&process.nextTick||gt,p={isArray:ye,isArrayBuffer:ut,isBuffer:ve,isFormData:xr,isArrayBufferView:ir,isString:or,isNumber:pt,isBoolean:ar,isObject:ke,isPlainObject:ze,isEmptyObject:lr,isReadableStream:mr,isRequest:gr,isResponse:yr,isHeaders:br,isUndefined:be,isDate:cr,isFile:dr,isBlob:ur,isRegExp:Ar,isFunction:te,isStream:fr,isURLSearchParams:hr,isTypedArray:Tr,isFileList:pr,forEach:Ee,merge:Be,extend:Sr,trim:wr,stripBOM:jr,inherits:vr,toFlatObject:kr,kindOf:Ae,kindOfTest:ie,endsWith:Er,toArray:Cr,forEachEntry:Pr,matchAll:Ir,isHTMLForm:Rr,hasOwnProperty:ht,hasOwnProp:ht,reduceDescriptors:mt,freezeMethods:_r,toObjectSet:zr,toCamelCase:Or,noop:Ur,toFiniteNumber:$r,findKey:ft,global:fe,isContextDefined:xt,isSpecCompliantForm:Nr,toJSONObject:Dr,isAsyncFn:Fr,isThenable:Lr,setImmediate:gt,asap:qr,isIterable:t=>t!=null&&te(t[Oe])};function $(t,e,n,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}p.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.status}}});const yt=$.prototype,bt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{bt[t]={value:t}}),Object.defineProperties($,bt),Object.defineProperty(yt,"isAxiosError",{value:!0}),$.from=(t,e,n,s,i,o)=>{const a=Object.create(yt);p.toFlatObject(t,a,function(x){return x!==Error.prototype},f=>f!=="isAxiosError");const c=t&&t.message?t.message:"Error",d=e==null&&t?t.code:e;return $.call(a,c,d,n,s,i),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",o&&Object.assign(a,o),a};const Mr=null;function He(t){return p.isPlainObject(t)||p.isArray(t)}function wt(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function St(t,e,n){return t?t.concat(e).map(function(i,o){return i=wt(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function Wr(t){return p.isArray(t)&&!t.some(He)}const Br=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function Ue(t,e,n){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,h){return!p.isUndefined(h[w])});const s=n.metaTokens,i=n.visitor||x,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(i))throw new TypeError("visitor must be a function");function f(u){if(u===null)return"";if(p.isDate(u))return u.toISOString();if(p.isBoolean(u))return u.toString();if(!d&&p.isBlob(u))throw new $("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(u)||p.isTypedArray(u)?d&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function x(u,w,h){let R=u;if(u&&!h&&typeof u=="object"){if(p.endsWith(w,"{}"))w=s?w:w.slice(0,-2),u=JSON.stringify(u);else if(p.isArray(u)&&Wr(u)||(p.isFileList(u)||p.endsWith(w,"[]"))&&(R=p.toArray(u)))return w=wt(w),R.forEach(function(g,z){!(p.isUndefined(g)||g===null)&&e.append(a===!0?St([w],z,o):a===null?w:w+"[]",f(g))}),!1}return He(u)?!0:(e.append(St(h,w,o),f(u)),!1)}const y=[],E=Object.assign(Br,{defaultVisitor:x,convertValue:f,isVisitable:He});function C(u,w){if(!p.isUndefined(u)){if(y.indexOf(u)!==-1)throw Error("Circular reference detected in "+w.join("."));y.push(u),p.forEach(u,function(R,T){(!(p.isUndefined(R)||R===null)&&i.call(e,R,p.isString(T)?T.trim():T,w,E))===!0&&C(R,w?w.concat(T):[T])}),y.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return C(t),e}function jt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ve(t,e){this._pairs=[],t&&Ue(t,this,e)}const vt=Ve.prototype;vt.append=function(e,n){this._pairs.push([e,n])},vt.toString=function(e){const n=e?function(s){return e.call(this,s,jt)}:jt;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Hr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function kt(t,e,n){if(!e)return t;const s=n&&n.encode||Hr;p.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(e,n):o=p.isURLSearchParams(e)?e.toString():new Ve(e,n).toString(s),o){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Et{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){p.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ve,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ye=typeof window<"u"&&typeof document<"u",Je=typeof navigator=="object"&&navigator||void 0,Yr=Ye&&(!Je||["ReactNative","NativeScript","NS"].indexOf(Je.product)<0),Jr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Kr=Ye&&window.location.href||"http://localhost",Z={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ye,hasStandardBrowserEnv:Yr,hasStandardBrowserWebWorkerEnv:Jr,navigator:Je,origin:Kr},Symbol.toStringTag,{value:"Module"})),...Vr};function Xr(t,e){return Ue(t,new Z.classes.URLSearchParams,{visitor:function(n,s,i,o){return Z.isNode&&p.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Gr(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Zr(t){const e={},n=Object.keys(t);let s;const i=n.length;let o;for(s=0;s<i;s++)o=n[s],e[o]=t[o];return e}function Tt(t){function e(n,s,i,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&p.isArray(i)?i.length:a,d?(p.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!c):((!i[a]||!p.isObject(i[a]))&&(i[a]=[]),e(n,s,i[a],o)&&p.isArray(i[a])&&(i[a]=Zr(i[a])),!c)}if(p.isFormData(t)&&p.isFunction(t.entries)){const n={};return p.forEachEntry(t,(s,i)=>{e(Gr(s),i,n,0)}),n}return null}function Qr(t,e,n){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const Ce={transitional:Ct,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",i=s.indexOf("application/json")>-1,o=p.isObject(e);if(o&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return i?JSON.stringify(Tt(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Xr(e,this.formSerializer).toString();if((c=p.isFileList(e))||s.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Ue(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Qr(e)):e}],transformResponse:[function(e){const n=this.transitional||Ce.transitional,s=n&&n.forcedJSONParsing,i=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.isString(e)&&(s&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?$.from(c,$.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Z.classes.FormData,Blob:Z.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Ce.headers[t]={}});const en=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tn=t=>{const e={};let n,s,i;return t&&t.split(`
2
- `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!n||e[n]&&en[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},Pt=Symbol("internals");function Te(t){return t&&String(t).trim().toLowerCase()}function $e(t){return t===!1||t==null?t:p.isArray(t)?t.map($e):String(t)}function rn(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const nn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ke(t,e,n,s,i){if(p.isFunction(s))return s.call(this,e,n);if(i&&(e=n),!!p.isString(e)){if(p.isString(s))return e.indexOf(s)!==-1;if(p.isRegExp(s))return s.test(e)}}function sn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function on(t,e){const n=p.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(i,o,a){return this[s].call(this,e,i,o,a)},configurable:!0})})}let re=class{constructor(e){e&&this.set(e)}set(e,n,s){const i=this;function o(c,d,f){const x=Te(d);if(!x)throw new Error("header name must be a non-empty string");const y=p.findKey(i,x);(!y||i[y]===void 0||f===!0||f===void 0&&i[y]!==!1)&&(i[y||d]=$e(c))}const a=(c,d)=>p.forEach(c,(f,x)=>o(f,x,d));if(p.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(p.isString(e)&&(e=e.trim())&&!nn(e))a(tn(e),n);else if(p.isObject(e)&&p.isIterable(e)){let c={},d,f;for(const x of e){if(!p.isArray(x))throw TypeError("Object iterator must return a key-value pair");c[f=x[0]]=(d=c[f])?p.isArray(d)?[...d,x[1]]:[d,x[1]]:x[1]}a(c,n)}else e!=null&&o(n,e,s);return this}get(e,n){if(e=Te(e),e){const s=p.findKey(this,e);if(s){const i=this[s];if(!n)return i;if(n===!0)return rn(i);if(p.isFunction(n))return n.call(this,i,s);if(p.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Te(e),e){const s=p.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Ke(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let i=!1;function o(a){if(a=Te(a),a){const c=p.findKey(s,a);c&&(!n||Ke(s,s[c],c,n))&&(delete s[c],i=!0)}}return p.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let s=n.length,i=!1;for(;s--;){const o=n[s];(!e||Ke(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,s={};return p.forEach(this,(i,o)=>{const a=p.findKey(s,o);if(a){n[a]=$e(i),delete n[o];return}const c=e?sn(o):String(o).trim();c!==o&&delete n[o],n[c]=$e(i),s[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return p.forEach(this,(s,i)=>{s!=null&&s!==!1&&(n[i]=e&&p.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Pt]=this[Pt]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=Te(a);s[c]||(on(i,a),s[c]=!0)}return p.isArray(e)?e.forEach(o):o(e),this}};re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(re.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),p.freezeMethods(re);function Xe(t,e){const n=this||Ce,s=e||n,i=re.from(s.headers);let o=s.data;return p.forEach(t,function(c){o=c.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function It(t){return!!(t&&t.__CANCEL__)}function we(t,e,n){$.call(this,t??"canceled",$.ERR_CANCELED,e,n),this.name="CanceledError"}p.inherits(we,$,{__CANCEL__:!0});function Rt(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new $("Request failed with status code "+n.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function an(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ln(t,e){t=t||10;const n=new Array(t),s=new Array(t);let i=0,o=0,a;return e=e!==void 0?e:1e3,function(d){const f=Date.now(),x=s[o];a||(a=f),n[i]=d,s[i]=f;let y=o,E=0;for(;y!==i;)E+=n[y++],y=y%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),f-a<e)return;const C=x&&f-x;return C?Math.round(E*1e3/C):void 0}}function cn(t,e){let n=0,s=1e3/e,i,o;const a=(f,x=Date.now())=>{n=x,i=null,o&&(clearTimeout(o),o=null),t(...f)};return[(...f)=>{const x=Date.now(),y=x-n;y>=s?a(f,x):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},s-y)))},()=>i&&a(i)]}const Ne=(t,e,n=3)=>{let s=0;const i=ln(50,250);return cn(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-s,f=i(d),x=a<=c;s=a;const y={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&x?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(y)},n)},Ot=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},At=t=>(...e)=>p.asap(()=>t(...e)),dn=Z.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Z.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Z.origin),Z.navigator&&/(msie|trident)/i.test(Z.navigator.userAgent)):()=>!0,un=Z.hasStandardBrowserEnv?{write(t,e,n,s,i,o){const a=[t+"="+encodeURIComponent(e)];p.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),p.isString(s)&&a.push("path="+s),p.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function _t(t,e,n){let s=!pn(e);return t&&(s||n==!1)?fn(t,e):e}const zt=t=>t instanceof re?{...t}:t;function xe(t,e){e=e||{};const n={};function s(f,x,y,E){return p.isPlainObject(f)&&p.isPlainObject(x)?p.merge.call({caseless:E},f,x):p.isPlainObject(x)?p.merge({},x):p.isArray(x)?x.slice():x}function i(f,x,y,E){if(p.isUndefined(x)){if(!p.isUndefined(f))return s(void 0,f,y,E)}else return s(f,x,y,E)}function o(f,x){if(!p.isUndefined(x))return s(void 0,x)}function a(f,x){if(p.isUndefined(x)){if(!p.isUndefined(f))return s(void 0,f)}else return s(void 0,x)}function c(f,x,y){if(y in e)return s(f,x);if(y in t)return s(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,x,y)=>i(zt(f),zt(x),y,!0)};return p.forEach(Object.keys({...t,...e}),function(x){const y=d[x]||i,E=y(t[x],e[x],x);p.isUndefined(E)&&y!==c||(n[x]=E)}),n}const Ut=t=>{const e=xe({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=e;if(e.headers=a=re.from(a),e.url=kt(_t(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),p.isFormData(n)){if(Z.hasStandardBrowserEnv||Z.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(p.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([x,y])=>{f.includes(x.toLowerCase())&&a.set(x,y)})}}if(Z.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(e)),s||s!==!1&&dn(e.url))){const d=i&&o&&un.read(o);d&&a.set(i,d)}return e},xn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const i=Ut(t);let o=i.data;const a=re.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=i,x,y,E,C,u;function w(){C&&C(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(x),i.signal&&i.signal.removeEventListener("abort",x)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function R(){if(!h)return;const g=re.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),D={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:g,config:t,request:h};Rt(function(j){n(j),w()},function(j){s(j),w()},D),h=null}"onloadend"in h?h.onloadend=R:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(R)},h.onabort=function(){h&&(s(new $("Request aborted",$.ECONNABORTED,t,h)),h=null)},h.onerror=function(z){const D=z&&z.message?z.message:"Network Error",b=new $(D,$.ERR_NETWORK,t,h);b.event=z||null,s(b),h=null},h.ontimeout=function(){let z=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||Ct;i.timeoutErrorMessage&&(z=i.timeoutErrorMessage),s(new $(z,D.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,t,h)),h=null},o===void 0&&a.setContentType(null),"setRequestHeader"in h&&p.forEach(a.toJSON(),function(z,D){h.setRequestHeader(D,z)}),p.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),f&&([E,u]=Ne(f,!0),h.addEventListener("progress",E)),d&&h.upload&&([y,C]=Ne(d),h.upload.addEventListener("progress",y),h.upload.addEventListener("loadend",C)),(i.cancelToken||i.signal)&&(x=g=>{h&&(s(!g||g.type?new we(null,t,h):g),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(x),i.signal&&(i.signal.aborted?x():i.signal.addEventListener("abort",x)));const T=an(i.url);if(T&&Z.protocols.indexOf(T)===-1){s(new $("Unsupported protocol "+T+":",$.ERR_BAD_REQUEST,t));return}h.send(o||null)})},hn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,i;const o=function(f){if(!i){i=!0,c();const x=f instanceof Error?f:this.reason;s.abort(x instanceof $?x:new we(x instanceof Error?x.message:x))}};let a=e&&setTimeout(()=>{a=null,o(new $(`timeout ${e} of ms exceeded`,$.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),t=null)};t.forEach(f=>f.addEventListener("abort",o));const{signal:d}=s;return d.unsubscribe=()=>p.asap(c),d}},mn=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,i;for(;s<n;)i=s+e,yield t.slice(s,i),s=i},gn=async function*(t,e){for await(const n of yn(t))yield*mn(n,e)},yn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},$t=(t,e,n,s)=>{const i=gn(t,e);let o=0,a,c=d=>{a||(a=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:f,value:x}=await i.next();if(f){c(),d.close();return}let y=x.byteLength;if(n){let E=o+=y;n(E)}d.enqueue(new Uint8Array(x))}catch(f){throw c(f),f}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},Nt=64*1024,{isFunction:De}=p,bn=(({Request:t,Response:e})=>({Request:t,Response:e}))(p.global),{ReadableStream:Dt,TextEncoder:Ft}=p.global,Lt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},wn=t=>{t=p.merge.call({skipUndefined:!0},bn,t);const{fetch:e,Request:n,Response:s}=t,i=e?De(e):typeof fetch=="function",o=De(n),a=De(s);if(!i)return!1;const c=i&&De(Dt),d=i&&(typeof Ft=="function"?(u=>w=>u.encode(w))(new Ft):async u=>new Uint8Array(await new n(u).arrayBuffer())),f=o&&c&&Lt(()=>{let u=!1;const w=new n(Z.origin,{body:new Dt,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!w}),x=a&&c&&Lt(()=>p.isReadableStream(new s("").body)),y={stream:x&&(u=>u.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!y[u]&&(y[u]=(w,h)=>{let R=w&&w[u];if(R)return R.call(w);throw new $(`Response type '${u}' is not supported`,$.ERR_NOT_SUPPORT,h)})});const E=async u=>{if(u==null)return 0;if(p.isBlob(u))return u.size;if(p.isSpecCompliantForm(u))return(await new n(Z.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(p.isArrayBufferView(u)||p.isArrayBuffer(u))return u.byteLength;if(p.isURLSearchParams(u)&&(u=u+""),p.isString(u))return(await d(u)).byteLength},C=async(u,w)=>{const h=p.toFiniteNumber(u.getContentLength());return h??E(w)};return async u=>{let{url:w,method:h,data:R,signal:T,cancelToken:g,timeout:z,onDownloadProgress:D,onUploadProgress:b,responseType:j,headers:q,withCredentials:O="same-origin",fetchOptions:G}=Ut(u),W=e||fetch;j=j?(j+"").toLowerCase():"text";let I=hn([T,g&&g.toAbortSignal()],z),X=null;const P=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let A;try{if(b&&f&&h!=="get"&&h!=="head"&&(A=await C(q,R))!==0){let l=new n(w,{method:"POST",body:R,duplex:"half"}),m;if(p.isFormData(R)&&(m=l.headers.get("content-type"))&&q.setContentType(m),l.body){const[k,N]=Ot(A,Ne(At(b)));R=$t(l.body,Nt,k,N)}}p.isString(O)||(O=O?"include":"omit");const M=o&&"credentials"in n.prototype,K={...G,signal:I,method:h.toUpperCase(),headers:q.normalize().toJSON(),body:R,duplex:"half",credentials:M?O:void 0};X=o&&new n(w,K);let H=await(o?W(X,G):W(w,K));const F=x&&(j==="stream"||j==="response");if(x&&(D||F&&P)){const l={};["status","statusText","headers"].forEach(ne=>{l[ne]=H[ne]});const m=p.toFiniteNumber(H.headers.get("content-length")),[k,N]=D&&Ot(m,Ne(At(D),!0))||[];H=new s($t(H.body,Nt,k,()=>{N&&N(),P&&P()}),l)}j=j||"text";let J=await y[p.findKey(y,j)||"text"](H,u);return!F&&P&&P(),await new Promise((l,m)=>{Rt(l,m,{data:J,headers:re.from(H.headers),status:H.status,statusText:H.statusText,config:u,request:X})})}catch(M){throw P&&P(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new $("Network Error",$.ERR_NETWORK,u,X),{cause:M.cause||M}):$.from(M,M&&M.code,u,X)}}},Sn=new Map,qt=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:i}=e,o=[s,i,n];let a=o.length,c=a,d,f,x=Sn;for(;c--;)d=o[c],f=x.get(d),f===void 0&&x.set(d,f=c?new Map:wn(e)),x=f;return f};qt();const Ge={http:Mr,xhr:xn,fetch:{get:qt}};p.forEach(Ge,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Mt=t=>`- ${t}`,jn=t=>p.isFunction(t)||t===null||t===!1,Wt={getAdapter:(t,e)=>{t=p.isArray(t)?t:[t];const{length:n}=t;let s,i;const o={};for(let a=0;a<n;a++){s=t[a];let c;if(i=s,!jn(s)&&(i=Ge[(c=String(s)).toLowerCase()],i===void 0))throw new $(`Unknown adapter '${c}'`);if(i&&(p.isFunction(i)||(i=i.get(e))))break;o[c||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
4
- `+a.map(Mt).join(`
5
- `):" "+Mt(a[0]):"as no adapter specified";throw new $("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return i},adapters:Ge};function Ze(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new we(null,t)}function Bt(t){return Ze(t),t.headers=re.from(t.headers),t.data=Xe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Wt.getAdapter(t.adapter||Ce.adapter,t)(t).then(function(s){return Ze(t),s.data=Xe.call(t,t.transformResponse,s),s.headers=re.from(s.headers),s},function(s){return It(s)||(Ze(t),s&&s.response&&(s.response.data=Xe.call(t,t.transformResponse,s.response),s.response.headers=re.from(s.response.headers))),Promise.reject(s)})}const Ht="1.12.2",Fe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Fe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Vt={};Fe.transitional=function(e,n,s){function i(o,a){return"[Axios v"+Ht+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(e===!1)throw new $(i(a," has been removed"+(n?" in "+n:"")),$.ERR_DEPRECATED);return n&&!Vt[a]&&(Vt[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,c):!0}},Fe.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function vn(t,e,n){if(typeof t!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let i=s.length;for(;i-- >0;){const o=s[i],a=e[o];if(a){const c=t[o],d=c===void 0||a(c,o,t);if(d!==!0)throw new $("option "+o+" must be "+d,$.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $("Unknown option "+o,$.ERR_BAD_OPTION)}}const Le={assertOptions:vn,validators:Fe},ae=Le.validators;let he=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Et,response:new Et}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+o):s.stack=o}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=xe(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&Le.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),i!=null&&(p.isFunction(i)?n.paramsSerializer={serialize:i}:Le.assertOptions(i,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Le.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=re.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let x,y=0,E;if(!d){const u=[Bt.bind(this),void 0];for(u.unshift(...c),u.push(...f),E=u.length,x=Promise.resolve(n);y<E;)x=x.then(u[y++],u[y++]);return x}E=c.length;let C=n;for(;y<E;){const u=c[y++],w=c[y++];try{C=u(C)}catch(h){w.call(this,h);break}}try{x=Bt.call(this,C)}catch(u){return Promise.reject(u)}for(y=0,E=f.length;y<E;)x=x.then(f[y++],f[y++]);return x}getUri(e){e=xe(this.defaults,e);const n=_t(e.baseURL,e.url,e.allowAbsoluteUrls);return kt(n,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){he.prototype[e]=function(n,s){return this.request(xe(s||{},{method:e,url:n,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function n(s){return function(o,a,c){return this.request(xe(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}he.prototype[e]=n(),he.prototype[e+"Form"]=n(!0)});let kn=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},e(function(o,a,c){s.reason||(s.reason=new we(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nr(function(i){e=i}),cancel:e}}};function En(t){return function(n){return t.apply(null,n)}}function Cn(t){return p.isObject(t)&&t.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach(([t,e])=>{Qe[e]=t});function Yt(t){const e=new he(t),n=ct(he.prototype.request,e);return p.extend(n,he.prototype,e,{allOwnKeys:!0}),p.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Yt(xe(t,i))},n}const Y=Yt(Ce);Y.Axios=he,Y.CanceledError=we,Y.CancelToken=kn,Y.isCancel=It,Y.VERSION=Ht,Y.toFormData=Ue,Y.AxiosError=$,Y.Cancel=Y.CanceledError,Y.all=function(e){return Promise.all(e)},Y.spread=En,Y.isAxiosError=Cn,Y.mergeConfig=xe,Y.AxiosHeaders=re,Y.formToJSON=t=>Tt(p.isHTMLForm(t)?new FormData(t):t),Y.getAdapter=Wt.getAdapter,Y.HttpStatusCode=Qe,Y.default=Y;const{Axios:xs,AxiosError:hs,CanceledError:ms,isCancel:gs,CancelToken:ys,VERSION:bs,all:ws,Cancel:Ss,isAxiosError:js,spread:vs,toFormData:ks,AxiosHeaders:Es,HttpStatusCode:Cs,formToJSON:Ts,getAdapter:Ps,mergeConfig:Is}=Y;class Tn{appName;baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.appName=e.appName,this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=Y.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,n,s,i={},o=!1){try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:n,method:e,data:a,headers:i,withCredentials:o})).data}catch(a){throw Y.isAxiosError(a)?{message:a.response?.data?.message||a.message||"Request failed",status:a.response?.status??0}:{message:a.message||"Unexpected error occurred"}}}async signupUser(e){const{name:n,email:s,password:i}=e;if(!n||!s||!i)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:n,password:s}=e;if(!n||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:n,password:s},{},!0)}catch(i){throw new Error(i.message||"Login failed due to an unknown error")}}async logoutUser(){try{return(await this.request("POST","/users/logout",{},{},!0))?.success?(typeof window<"u"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax",window.location.protocol==="https:"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure"),window.location.reload()),{success:!0}):{success:!1}}catch(e){throw new Error(e?.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:n,currentPassword:s,newPassword:i}=e;if(!n)throw new Error("changePassword: 'userId' is required");if(!s||!i)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${n}`,{currentPassword:s,newPassword:i},{},!0)}async requestEmailVerificationOTP(e){const{userId:n,email:s}=e;if(!n)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!s)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(n)}`,{email:s},{},!0)}catch(i){throw console.error("requestEmailVerificationOTP Error:",i),{message:i?.message||"Failed to send verification OTP",status:i?.status||500}}}async verifyEmail(e){const{email:n,otp:s}=e;if(!n)throw new Error("verifyEmail: 'email' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:n,otp:s},{},!0)}catch(i){throw{message:i.message||"Failed to verify email",status:i.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};const e=()=>{document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax",window.location.protocol==="https:"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure")};try{const n=await this.request("GET","/users/session",void 0,{},!0);return n?.authenticated||e(),n??{authenticated:!1}}catch{return e(),{authenticated:!1}}}async getUser(e){const n=this.appId;if(!n)throw new Error("getUser: 'appId' is required in SDK config");if(!e?.id&&!e?.username)throw new Error("getUser: either 'id' or 'username' is required");const s=new URLSearchParams;return e.id&&s.append("id",e.id),e.username&&s.append("username",e.username),await this.request("GET",`/users/${encodeURIComponent(n)}/user?${s.toString()}`,void 0,{},!0)}async updateUser(e){const{userId:n}=e;if(!n)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${n}`,{...e},{},!0)}async deleteUser(e){const{userId:n}=e;if(!n)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${n}`,{},{},!0)}async getUserProfile(e){const{userId:n}=e;if(!n)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:n},{},!0)}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:n}=e;if(!n)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:n})}async resetUserPassword(e){const{email:n,otp:s,newPassword:i}=e;if(!n||!s||!i)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:n,otp:s,newPassword:i})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async addUserData(e){const{userId:n,dataCategory:s,data:i}=e;if(!n)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!i)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${n}/data`,{dataCategory:s,...i},{},!1)}async getUserData(e){const{userId:n,limit:s=20,cursor:i,category:o}=e;if(!n)throw new Error("getUserData: 'userId' is required");const a=`/users/${encodeURIComponent(n)}/data`,c=new URLSearchParams;c.set("limit",String(s)),i&&c.set("cursor",i),o&&c.set("category",o);const d=c.toString();return this.request("GET",d?`${a}?${d}`:a,void 0,{},!1)}async getSingleUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${n}/data/${s}`,void 0,{},!1)}async searchInUserData(e){const{userId:n,category:s,q:i,keys:o}=e||{};if(!n)throw new Error("searchUserData: 'userId' is required");return await this.request("POST",`/users/${encodeURIComponent(n)}/data/search`,{category:s,q:i,keys:o&&Object.keys(o).length>0?o:{}},{},!1)}async updateUserData(e){const{userId:n,dataId:s,data:i}=e;if(!n||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!i)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${n}/data/${s}`,i,{},!1)}async deleteUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${n}/data/${s}`,void 0,{},!1)}async addAppData(e){const n=this.appId;if(!n)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:i}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!i||typeof i!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${encodeURIComponent(n)}/data/${encodeURIComponent(s)}`,{item:i},{},!1)}async getAppData(e){const n=this.appId;if(!n)throw new Error("getAppData: 'appId' is required");const s=e?`/app/${encodeURIComponent(n)}/app-data/${encodeURIComponent(e)}`:`/app/${encodeURIComponent(n)}/app-data`;return await this.request("GET",s,void 0,{},!1)}async getSingleAppData(e){const n=this.appId;if(!n)throw new Error("getSingleAppData: 'appId' is required");if(!e?.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${encodeURIComponent(n)}/data/${encodeURIComponent(e.dataId)}`,void 0,{},!1)}async searchInAppData(e){const n=this.appId;if(!n)throw new Error("searchInAppData: 'appId' is required");const{category:s,q:i,keys:o}=e||{};return await this.request("POST",`/app/${encodeURIComponent(n)}/app-data/search`,{category:s,q:i,keys:o&&Object.keys(o).length>0?o:{}},{},!1)}async updateAppData(e){const n=this.appId;if(!n)throw new Error("updateAppData: 'appId' is required");if(!e?.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e?.data||typeof e.data!="object")throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${encodeURIComponent(n)}/data/${encodeURIComponent(e.dataId)}`,e.data,{},!1)}async deleteAppData(e){const n=this.appId;if(!n)throw new Error("deleteAppData: 'appId' is required");if(!e?.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${encodeURIComponent(n)}/data/${encodeURIComponent(e.dataId)}`,void 0,{},!1)}async getAllUsersFromApp(e={}){const n=this.appId;if(!n)throw new Error("getAllUsersFromApp: 'appId' is required");const{cursor:s,limit:i}=e,o={};return s&&(o.cursor=s),i!==void 0&&(o.limit=i),await this.request("POST",`/app/global/${encodeURIComponent(n)}/all-app-users`,o,{},!1)}async searchInAllAppUsers(e={}){const n=this.appId;if(!n)throw new Error("searchInAllAppUsers: 'appId' is required");const{q:s,keys:i={}}=e,o={};return s&&(o.q=s),i&&Object.keys(i).length>0&&(o.keys=i),await this.request("POST",`/app/global/${encodeURIComponent(n)}/all-app-users/search`,o,{},!1)}async getAllUsersDataFromApp(e={}){const n=this.appId;if(!n)throw new Error("getAllUsersDataFromApp: 'appId' is required");const{category:s,cursor:i,limit:o}=e,a={};return s&&(a.category=s),i&&(a.cursor=i),o!==void 0&&(a.limit=o),await this.request("POST",`/app/global/${encodeURIComponent(n)}/all-app-users-data`,a,{},!1)}async searchInAllAppUsersData(e={}){const n=this.appId;if(!n)throw new Error("searchInAllAppUsersData: 'appId' is required");const{category:s,q:i,keys:o={}}=e,a={};return s&&(a.category=s),i&&(a.q=i),o&&Object.keys(o).length>0&&(a.keys=o),await this.request("POST",`/app/global/${encodeURIComponent(n)}/all-app-users-data/search`,a,{},!1)}}var qe={exports:{}},Pe={};/**
1
+ (function(pe,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(pe=typeof globalThis<"u"?globalThis:pe||self,y(pe.NeuctraAuthix={},pe.React))})(this,(function(pe,y){"use strict";function Xt(t,e){return function(){return t.apply(e,arguments)}}const{toString:ss}=Object.prototype,{getPrototypeOf:$t}=Object,{iterator:nt,toStringTag:Gt}=Symbol,at=(t=>e=>{const r=ss.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ge=t=>(t=t.toLowerCase(),e=>at(e)===t),ot=t=>e=>typeof e===t,{isArray:Be}=Array,Me=ot("undefined");function Ke(t){return t!==null&&!Me(t)&&t.constructor!==null&&!Me(t.constructor)&&me(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Zt=ge("ArrayBuffer");function ns(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Zt(t.buffer),e}const as=ot("string"),me=ot("function"),Qt=ot("number"),Xe=t=>t!==null&&typeof t=="object",os=t=>t===!0||t===!1,it=t=>{if(at(t)!=="object")return!1;const e=$t(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Gt in t)&&!(nt in t)},is=t=>{if(!Xe(t)||Ke(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ls=ge("Date"),cs=ge("File"),ds=ge("Blob"),us=ge("FileList"),fs=t=>Xe(t)&&me(t.pipe),ps=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||me(t.append)&&((e=at(t))==="formdata"||e==="object"&&me(t.toString)&&t.toString()==="[object FormData]"))},ms=ge("URLSearchParams"),[xs,hs,ys,gs]=["ReadableStream","Request","Response","Headers"].map(ge),bs=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ge(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,a;if(typeof t!="object"&&(t=[t]),Be(t))for(n=0,a=t.length;n<a;n++)e.call(null,t[n],n,t);else{if(Ke(t))return;const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let l;for(n=0;n<i;n++)l=o[n],e.call(null,t[l],l,t)}}function er(t,e){if(Ke(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,a;for(;n-- >0;)if(a=r[n],e===a.toLowerCase())return a;return null}const Re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tr=t=>!Me(t)&&t!==Re;function St(){const{caseless:t,skipUndefined:e}=tr(this)&&this||{},r={},n=(a,o)=>{const i=t&&er(r,o)||o;it(r[i])&&it(a)?r[i]=St(r[i],a):it(a)?r[i]=St({},a):Be(a)?r[i]=a.slice():(!e||!Me(a))&&(r[i]=a)};for(let a=0,o=arguments.length;a<o;a++)arguments[a]&&Ge(arguments[a],n);return r}const ws=(t,e,r,{allOwnKeys:n}={})=>(Ge(e,(a,o)=>{r&&me(a)?t[o]=Xt(a,r):t[o]=a},{allOwnKeys:n}),t),js=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),vs=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Ns=(t,e,r,n)=>{let a,o,i;const l={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),o=a.length;o-- >0;)i=a[o],(!n||n(i,t,e))&&!l[i]&&(e[i]=t[i],l[i]=!0);t=r!==!1&&$t(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Es=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},$s=t=>{if(!t)return null;if(Be(t))return t;let e=t.length;if(!Qt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Ss=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&$t(Uint8Array)),ks=(t,e)=>{const n=(t&&t[nt]).call(t);let a;for(;(a=n.next())&&!a.done;){const o=a.value;e.call(t,o[0],o[1])}},Ps=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},_s=ge("HTMLFormElement"),Cs=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),rr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ts=ge("RegExp"),sr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Ge(r,(a,o)=>{let i;(i=e(a,o,t))!==!1&&(n[o]=i||a)}),Object.defineProperties(t,n)},As=t=>{sr(t,(e,r)=>{if(me(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(me(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Os=(t,e)=>{const r={},n=a=>{a.forEach(o=>{r[o]=!0})};return Be(t)?n(t):n(String(t).split(e)),r},Us=()=>{},Rs=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function zs(t){return!!(t&&me(t.append)&&t[Gt]==="FormData"&&t[nt])}const Is=t=>{const e=new Array(10),r=(n,a)=>{if(Xe(n)){if(e.indexOf(n)>=0)return;if(Ke(n))return n;if(!("toJSON"in n)){e[a]=n;const o=Be(n)?[]:{};return Ge(n,(i,l)=>{const m=r(i,a+1);!Me(m)&&(o[l]=m)}),e[a]=void 0,o}}return n};return r(t,0)},Ls=ge("AsyncFunction"),Fs=t=>t&&(Xe(t)||me(t))&&me(t.then)&&me(t.catch),nr=((t,e)=>t?setImmediate:e?((r,n)=>(Re.addEventListener("message",({source:a,data:o})=>{a===Re&&o===r&&n.length&&n.shift()()},!1),a=>{n.push(a),Re.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(Re.postMessage)),qs=typeof queueMicrotask<"u"?queueMicrotask.bind(Re):typeof process<"u"&&process.nextTick||nr,c={isArray:Be,isArrayBuffer:Zt,isBuffer:Ke,isFormData:ps,isArrayBufferView:ns,isString:as,isNumber:Qt,isBoolean:os,isObject:Xe,isPlainObject:it,isEmptyObject:is,isReadableStream:xs,isRequest:hs,isResponse:ys,isHeaders:gs,isUndefined:Me,isDate:ls,isFile:cs,isBlob:ds,isRegExp:Ts,isFunction:me,isStream:fs,isURLSearchParams:ms,isTypedArray:Ss,isFileList:us,forEach:Ge,merge:St,extend:ws,trim:bs,stripBOM:js,inherits:vs,toFlatObject:Ns,kindOf:at,kindOfTest:ge,endsWith:Es,toArray:$s,forEachEntry:ks,matchAll:Ps,isHTMLForm:_s,hasOwnProperty:rr,hasOwnProp:rr,reduceDescriptors:sr,freezeMethods:As,toObjectSet:Os,toCamelCase:Cs,noop:Us,toFiniteNumber:Rs,findKey:er,global:Re,isContextDefined:tr,isSpecCompliantForm:zs,toJSONObject:Is,isAsyncFn:Ls,isThenable:Fs,setImmediate:nr,asap:qs,isIterable:t=>t!=null&&me(t[nt])};function I(t,e,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}c.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const ar=I.prototype,or={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{or[t]={value:t}}),Object.defineProperties(I,or),Object.defineProperty(ar,"isAxiosError",{value:!0}),I.from=(t,e,r,n,a,o)=>{const i=Object.create(ar);c.toFlatObject(t,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError");const l=t&&t.message?t.message:"Error",m=e==null&&t?t.code:e;return I.call(i,l,m,r,n,a),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",o&&Object.assign(i,o),i};const Ds=null;function kt(t){return c.isPlainObject(t)||c.isArray(t)}function ir(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function lr(t,e,r){return t?t.concat(e).map(function(a,o){return a=ir(a),!r&&o?"["+a+"]":a}).join(r?".":""):e}function Vs(t){return c.isArray(t)&&!t.some(kt)}const Bs=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function lt(t,e,r){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,g){return!c.isUndefined(g[h])});const n=r.metaTokens,a=r.visitor||f,o=r.dots,i=r.indexes,m=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(a))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(c.isBoolean(p))return p.toString();if(!m&&c.isBlob(p))throw new I("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?m&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,h,g){let _=p;if(p&&!g&&typeof p=="object"){if(c.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&Vs(p)||(c.isFileList(p)||c.endsWith(h,"[]"))&&(_=c.toArray(p)))return h=ir(h),_.forEach(function(k,q){!(c.isUndefined(k)||k===null)&&e.append(i===!0?lr([h],q,o):i===null?h:h+"[]",u(k))}),!1}return kt(p)?!0:(e.append(lr(g,h,o),u(p)),!1)}const b=[],j=Object.assign(Bs,{defaultVisitor:f,convertValue:u,isVisitable:kt});function P(p,h){if(!c.isUndefined(p)){if(b.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));b.push(p),c.forEach(p,function(_,B){(!(c.isUndefined(_)||_===null)&&a.call(e,_,c.isString(B)?B.trim():B,h,j))===!0&&P(_,h?h.concat(B):[B])}),b.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return P(t),e}function cr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Pt(t,e){this._pairs=[],t&&lt(t,this,e)}const dr=Pt.prototype;dr.append=function(e,r){this._pairs.push([e,r])},dr.toString=function(e){const r=e?function(n){return e.call(this,n,cr)}:cr;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function Ms(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ur(t,e,r){if(!e)return t;const n=r&&r.encode||Ms;c.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(a?o=a(e,r):o=c.isURLSearchParams(e)?e.toString():new Pt(e,r).toString(n),o){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class fr{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(n){n!==null&&e(n)})}}const pr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hs={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Pt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},_t=typeof window<"u"&&typeof document<"u",Ct=typeof navigator=="object"&&navigator||void 0,Ws=_t&&(!Ct||["ReactNative","NativeScript","NS"].indexOf(Ct.product)<0),Js=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ys=_t&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_t,hasStandardBrowserEnv:Ws,hasStandardBrowserWebWorkerEnv:Js,navigator:Ct,origin:Ys},Symbol.toStringTag,{value:"Module"})),...Hs};function Ks(t,e){return lt(t,new ue.classes.URLSearchParams,{visitor:function(r,n,a,o){return ue.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Xs(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gs(t){const e={},r=Object.keys(t);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],e[o]=t[o];return e}function mr(t){function e(r,n,a,o){let i=r[o++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),m=o>=r.length;return i=!i&&c.isArray(a)?a.length:i,m?(c.hasOwnProp(a,i)?a[i]=[a[i],n]:a[i]=n,!l):((!a[i]||!c.isObject(a[i]))&&(a[i]=[]),e(r,n,a[i],o)&&c.isArray(a[i])&&(a[i]=Gs(a[i])),!l)}if(c.isFormData(t)&&c.isFunction(t.entries)){const r={};return c.forEachEntry(t,(n,a)=>{e(Xs(n),a,r,0)}),r}return null}function Zs(t,e,r){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Ze={transitional:pr,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,o=c.isObject(e);if(o&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return a?JSON.stringify(mr(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ks(e,this.formSerializer).toString();if((l=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return lt(l?{"files[]":e}:e,m&&new m,this.formSerializer)}}return o||a?(r.setContentType("application/json",!1),Zs(e)):e}],transformResponse:[function(e){const r=this.transitional||Ze.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||a)){const i=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?I.from(l,I.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Ze.headers[t]={}});const Qs=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),en=t=>{const e={};let r,n,a;return t&&t.split(`
2
+ `).forEach(function(i){a=i.indexOf(":"),r=i.substring(0,a).trim().toLowerCase(),n=i.substring(a+1).trim(),!(!r||e[r]&&Qs[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},xr=Symbol("internals");function Qe(t){return t&&String(t).trim().toLowerCase()}function ct(t){return t===!1||t==null?t:c.isArray(t)?t.map(ct):String(t)}function tn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const rn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Tt(t,e,r,n,a){if(c.isFunction(n))return n.call(this,e,r);if(a&&(e=r),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}function sn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function nn(t,e){const r=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(a,o,i){return this[n].call(this,e,a,o,i)},configurable:!0})})}let xe=class{constructor(e){e&&this.set(e)}set(e,r,n){const a=this;function o(l,m,u){const f=Qe(m);if(!f)throw new Error("header name must be a non-empty string");const b=c.findKey(a,f);(!b||a[b]===void 0||u===!0||u===void 0&&a[b]!==!1)&&(a[b||m]=ct(l))}const i=(l,m)=>c.forEach(l,(u,f)=>o(u,f,m));if(c.isPlainObject(e)||e instanceof this.constructor)i(e,r);else if(c.isString(e)&&(e=e.trim())&&!rn(e))i(en(e),r);else if(c.isObject(e)&&c.isIterable(e)){let l={},m,u;for(const f of e){if(!c.isArray(f))throw TypeError("Object iterator must return a key-value pair");l[u=f[0]]=(m=l[u])?c.isArray(m)?[...m,f[1]]:[m,f[1]]:f[1]}i(l,r)}else e!=null&&o(r,e,n);return this}get(e,r){if(e=Qe(e),e){const n=c.findKey(this,e);if(n){const a=this[n];if(!r)return a;if(r===!0)return tn(a);if(c.isFunction(r))return r.call(this,a,n);if(c.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Qe(e),e){const n=c.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Tt(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let a=!1;function o(i){if(i=Qe(i),i){const l=c.findKey(n,i);l&&(!r||Tt(n,n[l],l,r))&&(delete n[l],a=!0)}}return c.isArray(e)?e.forEach(o):o(e),a}clear(e){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const o=r[n];(!e||Tt(this,this[o],o,e,!0))&&(delete this[o],a=!0)}return a}normalize(e){const r=this,n={};return c.forEach(this,(a,o)=>{const i=c.findKey(n,o);if(i){r[i]=ct(a),delete r[o];return}const l=e?sn(o):String(o).trim();l!==o&&delete r[o],r[l]=ct(a),n[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return c.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=e&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(a=>n.set(a)),n}static accessor(e){const n=(this[xr]=this[xr]={accessors:{}}).accessors,a=this.prototype;function o(i){const l=Qe(i);n[l]||(nn(a,i),n[l]=!0)}return c.isArray(e)?e.forEach(o):o(e),this}};xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(xe.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),c.freezeMethods(xe);function At(t,e){const r=this||Ze,n=e||r,a=xe.from(n.headers);let o=n.data;return c.forEach(t,function(l){o=l.call(r,o,a.normalize(),e?e.status:void 0)}),a.normalize(),o}function hr(t){return!!(t&&t.__CANCEL__)}function He(t,e,r){I.call(this,t??"canceled",I.ERR_CANCELED,e,r),this.name="CanceledError"}c.inherits(He,I,{__CANCEL__:!0});function yr(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function an(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function on(t,e){t=t||10;const r=new Array(t),n=new Array(t);let a=0,o=0,i;return e=e!==void 0?e:1e3,function(m){const u=Date.now(),f=n[o];i||(i=u),r[a]=m,n[a]=u;let b=o,j=0;for(;b!==a;)j+=r[b++],b=b%t;if(a=(a+1)%t,a===o&&(o=(o+1)%t),u-i<e)return;const P=f&&u-f;return P?Math.round(j*1e3/P):void 0}}function ln(t,e){let r=0,n=1e3/e,a,o;const i=(u,f=Date.now())=>{r=f,a=null,o&&(clearTimeout(o),o=null),t(...u)};return[(...u)=>{const f=Date.now(),b=f-r;b>=n?i(u,f):(a=u,o||(o=setTimeout(()=>{o=null,i(a)},n-b)))},()=>a&&i(a)]}const dt=(t,e,r=3)=>{let n=0;const a=on(50,250);return ln(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,m=i-n,u=a(m),f=i<=l;n=i;const b={loaded:i,total:l,progress:l?i/l:void 0,bytes:m,rate:u||void 0,estimated:u&&l&&f?(l-i)/u:void 0,event:o,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(b)},r)},gr=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},br=t=>(...e)=>c.asap(()=>t(...e)),cn=ue.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,ue.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,dn=ue.hasStandardBrowserEnv?{write(t,e,r,n,a,o){const i=[t+"="+encodeURIComponent(e)];c.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),c.isString(n)&&i.push("path="+n),c.isString(a)&&i.push("domain="+a),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function un(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wr(t,e,r){let n=!un(e);return t&&(n||r==!1)?fn(t,e):e}const jr=t=>t instanceof xe?{...t}:t;function ze(t,e){e=e||{};const r={};function n(u,f,b,j){return c.isPlainObject(u)&&c.isPlainObject(f)?c.merge.call({caseless:j},u,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function a(u,f,b,j){if(c.isUndefined(f)){if(!c.isUndefined(u))return n(void 0,u,b,j)}else return n(u,f,b,j)}function o(u,f){if(!c.isUndefined(f))return n(void 0,f)}function i(u,f){if(c.isUndefined(f)){if(!c.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function l(u,f,b){if(b in e)return n(u,f);if(b in t)return n(void 0,u)}const m={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,f,b)=>a(jr(u),jr(f),b,!0)};return c.forEach(Object.keys({...t,...e}),function(f){const b=m[f]||a,j=b(t[f],e[f],f);c.isUndefined(j)&&b!==l||(r[f]=j)}),r}const vr=t=>{const e=ze({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:l}=e;if(e.headers=i=xe.from(i),e.url=ur(wr(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),c.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const m=r.getHeaders(),u=["content-type","content-length"];Object.entries(m).forEach(([f,b])=>{u.includes(f.toLowerCase())&&i.set(f,b)})}}if(ue.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&cn(e.url))){const m=a&&o&&dn.read(o);m&&i.set(a,m)}return e},pn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){const a=vr(t);let o=a.data;const i=xe.from(a.headers).normalize();let{responseType:l,onUploadProgress:m,onDownloadProgress:u}=a,f,b,j,P,p;function h(){P&&P(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(f),a.signal&&a.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(a.method.toUpperCase(),a.url,!0),g.timeout=a.timeout;function _(){if(!g)return;const k=xe.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),F={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:k,config:t,request:g};yr(function(R){r(R),h()},function(R){n(R),h()},F),g=null}"onloadend"in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(_)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,t,g)),g=null)},g.onerror=function(q){const F=q&&q.message?q.message:"Network Error",X=new I(F,I.ERR_NETWORK,t,g);X.event=q||null,n(X),g=null},g.ontimeout=function(){let q=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const F=a.transitional||pr;a.timeoutErrorMessage&&(q=a.timeoutErrorMessage),n(new I(q,F.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,t,g)),g=null},o===void 0&&i.setContentType(null),"setRequestHeader"in g&&c.forEach(i.toJSON(),function(q,F){g.setRequestHeader(F,q)}),c.isUndefined(a.withCredentials)||(g.withCredentials=!!a.withCredentials),l&&l!=="json"&&(g.responseType=a.responseType),u&&([j,p]=dt(u,!0),g.addEventListener("progress",j)),m&&g.upload&&([b,P]=dt(m),g.upload.addEventListener("progress",b),g.upload.addEventListener("loadend",P)),(a.cancelToken||a.signal)&&(f=k=>{g&&(n(!k||k.type?new He(null,t,g):k),g.abort(),g=null)},a.cancelToken&&a.cancelToken.subscribe(f),a.signal&&(a.signal.aborted?f():a.signal.addEventListener("abort",f)));const B=an(a.url);if(B&&ue.protocols.indexOf(B)===-1){n(new I("Unsupported protocol "+B+":",I.ERR_BAD_REQUEST,t));return}g.send(o||null)})},mn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,a;const o=function(u){if(!a){a=!0,l();const f=u instanceof Error?u:this.reason;n.abort(f instanceof I?f:new He(f instanceof Error?f.message:f))}};let i=e&&setTimeout(()=>{i=null,o(new I(`timeout ${e} of ms exceeded`,I.ETIMEDOUT))},e);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:m}=n;return m.unsubscribe=()=>c.asap(l),m}},xn=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,a;for(;n<r;)a=n+e,yield t.slice(n,a),n=a},hn=async function*(t,e){for await(const r of yn(t))yield*xn(r,e)},yn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},Nr=(t,e,r,n)=>{const a=hn(t,e);let o=0,i,l=m=>{i||(i=!0,n&&n(m))};return new ReadableStream({async pull(m){try{const{done:u,value:f}=await a.next();if(u){l(),m.close();return}let b=f.byteLength;if(r){let j=o+=b;r(j)}m.enqueue(new Uint8Array(f))}catch(u){throw l(u),u}},cancel(m){return l(m),a.return()}},{highWaterMark:2})},Er=64*1024,{isFunction:ut}=c,gn=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:$r,TextEncoder:Sr}=c.global,kr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},bn=t=>{t=c.merge.call({skipUndefined:!0},gn,t);const{fetch:e,Request:r,Response:n}=t,a=e?ut(e):typeof fetch=="function",o=ut(r),i=ut(n);if(!a)return!1;const l=a&&ut($r),m=a&&(typeof Sr=="function"?(p=>h=>p.encode(h))(new Sr):async p=>new Uint8Array(await new r(p).arrayBuffer())),u=o&&l&&kr(()=>{let p=!1;const h=new r(ue.origin,{body:new $r,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!h}),f=i&&l&&kr(()=>c.isReadableStream(new n("").body)),b={stream:f&&(p=>p.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!b[p]&&(b[p]=(h,g)=>{let _=h&&h[p];if(_)return _.call(h);throw new I(`Response type '${p}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const j=async p=>{if(p==null)return 0;if(c.isBlob(p))return p.size;if(c.isSpecCompliantForm(p))return(await new r(ue.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(c.isArrayBufferView(p)||c.isArrayBuffer(p))return p.byteLength;if(c.isURLSearchParams(p)&&(p=p+""),c.isString(p))return(await m(p)).byteLength},P=async(p,h)=>{const g=c.toFiniteNumber(p.getContentLength());return g??j(h)};return async p=>{let{url:h,method:g,data:_,signal:B,cancelToken:k,timeout:q,onDownloadProgress:F,onUploadProgress:X,responseType:R,headers:M,withCredentials:H="same-origin",fetchOptions:se}=vr(p),Q=e||fetch;R=R?(R+"").toLowerCase():"text";let J=mn([B,k&&k.toAbortSignal()],q),G=null;const W=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let N;try{if(X&&u&&g!=="get"&&g!=="head"&&(N=await P(M,_))!==0){let d=new r(h,{method:"POST",body:_,duplex:"half"}),x;if(c.isFormData(_)&&(x=d.headers.get("content-type"))&&M.setContentType(x),d.body){const[w,E]=gr(N,dt(br(X)));_=Nr(d.body,Er,w,E)}}c.isString(H)||(H=H?"include":"omit");const $=o&&"credentials"in r.prototype,A={...se,signal:J,method:g.toUpperCase(),headers:M.normalize().toJSON(),body:_,duplex:"half",credentials:$?H:void 0};G=o&&new r(h,A);let O=await(o?Q(G,se):Q(h,A));const D=f&&(R==="stream"||R==="response");if(f&&(F||D&&W)){const d={};["status","statusText","headers"].forEach(V=>{d[V]=O[V]});const x=c.toFiniteNumber(O.headers.get("content-length")),[w,E]=F&&gr(x,dt(br(F),!0))||[];O=new n(Nr(O.body,Er,w,()=>{E&&E(),W&&W()}),d)}R=R||"text";let Y=await b[c.findKey(b,R)||"text"](O,p);return!D&&W&&W(),await new Promise((d,x)=>{yr(d,x,{data:Y,headers:xe.from(O.headers),status:O.status,statusText:O.statusText,config:p,request:G})})}catch($){throw W&&W(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,p,G),{cause:$.cause||$}):I.from($,$&&$.code,p,G)}}},wn=new Map,Pr=t=>{let e=t?t.env:{};const{fetch:r,Request:n,Response:a}=e,o=[n,a,r];let i=o.length,l=i,m,u,f=wn;for(;l--;)m=o[l],u=f.get(m),u===void 0&&f.set(m,u=l?new Map:bn(e)),f=u;return u};Pr();const Ot={http:Ds,xhr:pn,fetch:{get:Pr}};c.forEach(Ot,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const _r=t=>`- ${t}`,jn=t=>c.isFunction(t)||t===null||t===!1,Cr={getAdapter:(t,e)=>{t=c.isArray(t)?t:[t];const{length:r}=t;let n,a;const o={};for(let i=0;i<r;i++){n=t[i];let l;if(a=n,!jn(n)&&(a=Ot[(l=String(n)).toLowerCase()],a===void 0))throw new I(`Unknown adapter '${l}'`);if(a&&(c.isFunction(a)||(a=a.get(e))))break;o[l||"#"+i]=a}if(!a){const i=Object.entries(o).map(([m,u])=>`adapter ${m} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since :
4
+ `+i.map(_r).join(`
5
+ `):" "+_r(i[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a},adapters:Ot};function Ut(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new He(null,t)}function Tr(t){return Ut(t),t.headers=xe.from(t.headers),t.data=At.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Cr.getAdapter(t.adapter||Ze.adapter,t)(t).then(function(n){return Ut(t),n.data=At.call(t,t.transformResponse,n),n.headers=xe.from(n.headers),n},function(n){return hr(n)||(Ut(t),n&&n.response&&(n.response.data=At.call(t,t.transformResponse,n.response),n.response.headers=xe.from(n.response.headers))),Promise.reject(n)})}const Ar="1.12.2",ft={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ft[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Or={};ft.transitional=function(e,r,n){function a(o,i){return"[Axios v"+Ar+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,l)=>{if(e===!1)throw new I(a(i," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!Or[i]&&(Or[i]=!0,console.warn(a(i," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,i,l):!0}},ft.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function vn(t,e,r){if(typeof t!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let a=n.length;for(;a-- >0;){const o=n[a],i=e[o];if(i){const l=t[o],m=l===void 0||i(l,o,t);if(m!==!0)throw new I("option "+o+" must be "+m,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+o,I.ERR_BAD_OPTION)}}const pt={assertOptions:vn,validators:ft},ve=pt.validators;let Ie=class{constructor(e){this.defaults=e||{},this.interceptors={request:new fr,response:new fr}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+o):n.stack=o}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ze(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:o}=r;n!==void 0&&pt.assertOptions(n,{silentJSONParsing:ve.transitional(ve.boolean),forcedJSONParsing:ve.transitional(ve.boolean),clarifyTimeoutError:ve.transitional(ve.boolean)},!1),a!=null&&(c.isFunction(a)?r.paramsSerializer={serialize:a}:pt.assertOptions(a,{encode:ve.function,serialize:ve.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),pt.assertOptions(r,{baseUrl:ve.spelling("baseURL"),withXsrfToken:ve.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[r.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),r.headers=xe.concat(i,o);const l=[];let m=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(m=m&&h.synchronous,l.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,b=0,j;if(!m){const p=[Tr.bind(this),void 0];for(p.unshift(...l),p.push(...u),j=p.length,f=Promise.resolve(r);b<j;)f=f.then(p[b++],p[b++]);return f}j=l.length;let P=r;for(;b<j;){const p=l[b++],h=l[b++];try{P=p(P)}catch(g){h.call(this,g);break}}try{f=Tr.call(this,P)}catch(p){return Promise.reject(p)}for(b=0,j=u.length;b<j;)f=f.then(u[b++],u[b++]);return f}getUri(e){e=ze(this.defaults,e);const r=wr(e.baseURL,e.url,e.allowAbsoluteUrls);return ur(r,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){Ie.prototype[e]=function(r,n){return this.request(ze(n||{},{method:e,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(e){function r(n){return function(o,i,l){return this.request(ze(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Ie.prototype[e]=r(),Ie.prototype[e+"Form"]=r(!0)});let Nn=class rs{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(a=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](a);n._listeners=null}),this.promise.then=a=>{let o;const i=new Promise(l=>{n.subscribe(l),o=l}).then(a);return i.cancel=function(){n.unsubscribe(o)},i},e(function(o,i,l){n.reason||(n.reason=new He(o,i,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new rs(function(a){e=a}),cancel:e}}};function En(t){return function(r){return t.apply(null,r)}}function $n(t){return c.isObject(t)&&t.isAxiosError===!0}const Rt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rt).forEach(([t,e])=>{Rt[e]=t});function Ur(t){const e=new Ie(t),r=Xt(Ie.prototype.request,e);return c.extend(r,Ie.prototype,e,{allOwnKeys:!0}),c.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return Ur(ze(t,a))},r}const ae=Ur(Ze);ae.Axios=Ie,ae.CanceledError=He,ae.CancelToken=Nn,ae.isCancel=hr,ae.VERSION=Ar,ae.toFormData=lt,ae.AxiosError=I,ae.Cancel=ae.CanceledError,ae.all=function(e){return Promise.all(e)},ae.spread=En,ae.isAxiosError=$n,ae.mergeConfig=ze,ae.AxiosHeaders=xe,ae.formToJSON=t=>mr(c.isHTMLForm(t)?new FormData(t):t),ae.getAdapter=Cr.getAdapter,ae.HttpStatusCode=Rt,ae.default=ae;const{Axios:Ea,AxiosError:$a,CanceledError:Sa,isCancel:ka,CancelToken:Pa,VERSION:_a,all:Ca,Cancel:Ta,isAxiosError:Aa,spread:Oa,toFormData:Ua,AxiosHeaders:Ra,HttpStatusCode:za,formToJSON:Ia,getAdapter:La,mergeConfig:Fa}=ae;class Sn{appName;baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.appName=e.appName,this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=ae.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,r,n,a={},o=!1){try{const i={...this.appId?{appId:this.appId}:{},...n||{}};return(await this.client.request({url:r,method:e,data:i,headers:a,withCredentials:o})).data}catch(i){throw ae.isAxiosError(i)?{message:i.response?.data?.message||i.message||"Request failed",status:i.response?.status??0}:{message:i.message||"Unexpected error occurred"}}}async signupUser(e){const{name:r,email:n,password:a}=e;if(!r||!n||!a)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:r,password:n}=e;if(!r||!n)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:r,password:n},{},!0)}catch(a){throw new Error(a.message||"Login failed due to an unknown error")}}async logoutUser(){try{return(await this.request("POST","/users/logout",{},{},!0))?.success?(typeof window<"u"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax",window.location.protocol==="https:"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure"),window.location.reload()),{success:!0}):{success:!1}}catch(e){throw new Error(e?.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:r,currentPassword:n,newPassword:a}=e;if(!r)throw new Error("changePassword: 'userId' is required");if(!n||!a)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${r}`,{currentPassword:n,newPassword:a},{},!0)}async requestEmailVerificationOTP(e){const{userId:r,email:n}=e;if(!r)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!n)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(r)}`,{email:n},{},!0)}catch(a){throw console.error("requestEmailVerificationOTP Error:",a),{message:a?.message||"Failed to send verification OTP",status:a?.status||500}}}async verifyEmail(e){const{email:r,otp:n}=e;if(!r)throw new Error("verifyEmail: 'email' is required");if(!n)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:r,otp:n},{},!0)}catch(a){throw{message:a.message||"Failed to verify email",status:a.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};const e=()=>{document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax",window.location.protocol==="https:"&&(document.cookie="a_s_b=; path=/; Max-Age=0; SameSite=Lax; Secure")};try{const r=await this.request("GET","/users/session",void 0,{},!0);return r?.authenticated||e(),r??{authenticated:!1}}catch{return e(),{authenticated:!1}}}async getUser(e){const r=this.appId;if(!r)throw new Error("getUser: 'appId' is required in SDK config");if(!e?.id&&!e?.username)throw new Error("getUser: either 'id' or 'username' is required");const n=new URLSearchParams;return e.id&&n.append("id",e.id),e.username&&n.append("username",e.username),await this.request("GET",`/users/${encodeURIComponent(r)}/user?${n.toString()}`,void 0,{},!0)}async updateUser(e){const{userId:r}=e;if(!r)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${r}`,{...e},{},!0)}async deleteUser(e){const{userId:r}=e;if(!r)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${r}`,{},{},!0)}async getUserProfile(e){const{userId:r}=e;if(!r)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:r},{},!0)}catch(n){throw{message:n.message||"Failed to fetch profile",status:n.status||500}}}async requestResetUserPasswordOTP(e){const{email:r}=e;if(!r)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:r})}async resetUserPassword(e){const{email:r,otp:n,newPassword:a}=e;if(!r||!n||!a)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:r,otp:n,newPassword:a})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async addUserData(e){const{userId:r,dataCategory:n,data:a}=e;if(!r)throw new Error("addUserData: 'userId' is required");if(!n)throw new Error("addUserData: 'dataCategory' is required");if(!a)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${r}/data`,{dataCategory:n,...a},{},!1)}async getUserData(e){const{userId:r,limit:n=20,cursor:a,category:o}=e;if(!r)throw new Error("getUserData: 'userId' is required");const i=`/users/${encodeURIComponent(r)}/data`,l=new URLSearchParams;l.set("limit",String(n)),a&&l.set("cursor",a),o&&l.set("category",o);const m=l.toString();return this.request("GET",m?`${i}?${m}`:i,void 0,{},!1)}async getSingleUserData(e){const{userId:r,dataId:n}=e;if(!r||!n)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${r}/data/${n}`,void 0,{},!1)}async searchInUserData(e){const{userId:r,category:n,q:a,keys:o}=e||{};if(!r)throw new Error("searchUserData: 'userId' is required");return await this.request("POST",`/users/${encodeURIComponent(r)}/data/search`,{category:n,q:a,keys:o&&Object.keys(o).length>0?o:{}},{},!1)}async updateUserData(e){const{userId:r,dataId:n,data:a}=e;if(!r||!n)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!a)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${r}/data/${n}`,a,{},!1)}async deleteUserData(e){const{userId:r,dataId:n}=e;if(!r||!n)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${r}/data/${n}`,void 0,{},!1)}async addAppData(e){const r=this.appId;if(!r)throw new Error("addAppData: 'appId' is required");const{dataCategory:n,data:a}=e;if(!n)throw new Error("addAppData: 'dataCategory' is required");if(!a||typeof a!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${encodeURIComponent(r)}/data/${encodeURIComponent(n)}`,{item:a},{},!1)}async getAppData(e){const r=this.appId;if(!r)throw new Error("getAppData: 'appId' is required");const n=e?`/app/${encodeURIComponent(r)}/app-data/${encodeURIComponent(e)}`:`/app/${encodeURIComponent(r)}/app-data`;return await this.request("GET",n,void 0,{},!1)}async getSingleAppData(e){const r=this.appId;if(!r)throw new Error("getSingleAppData: 'appId' is required");if(!e?.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${encodeURIComponent(r)}/data/${encodeURIComponent(e.dataId)}`,void 0,{},!1)}async searchInAppData(e){const r=this.appId;if(!r)throw new Error("searchInAppData: 'appId' is required");const{category:n,q:a,keys:o}=e||{};return await this.request("POST",`/app/${encodeURIComponent(r)}/app-data/search`,{category:n,q:a,keys:o&&Object.keys(o).length>0?o:{}},{},!1)}async updateAppData(e){const r=this.appId;if(!r)throw new Error("updateAppData: 'appId' is required");if(!e?.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e?.data||typeof e.data!="object")throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${encodeURIComponent(r)}/data/${encodeURIComponent(e.dataId)}`,e.data,{},!1)}async deleteAppData(e){const r=this.appId;if(!r)throw new Error("deleteAppData: 'appId' is required");if(!e?.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${encodeURIComponent(r)}/data/${encodeURIComponent(e.dataId)}`,void 0,{},!1)}async getAllUsersFromApp(e={}){const r=this.appId;if(!r)throw new Error("getAllUsersFromApp: 'appId' is required");const{cursor:n,limit:a}=e,o={};return n&&(o.cursor=n),a!==void 0&&(o.limit=a),await this.request("POST",`/app/global/${encodeURIComponent(r)}/all-app-users`,o,{},!1)}async searchInAllAppUsers(e={}){const r=this.appId;if(!r)throw new Error("searchInAllAppUsers: 'appId' is required");const{q:n,keys:a={}}=e,o={};return n&&(o.q=n),a&&Object.keys(a).length>0&&(o.keys=a),await this.request("POST",`/app/global/${encodeURIComponent(r)}/all-app-users/search`,o,{},!1)}async getAllUsersDataFromApp(e={}){const r=this.appId;if(!r)throw new Error("getAllUsersDataFromApp: 'appId' is required");const{category:n,cursor:a,limit:o}=e,i={};return n&&(i.category=n),a&&(i.cursor=a),o!==void 0&&(i.limit=o),await this.request("POST",`/app/global/${encodeURIComponent(r)}/all-app-users-data`,i,{},!1)}async searchInAllAppUsersData(e={}){const r=this.appId;if(!r)throw new Error("searchInAllAppUsersData: 'appId' is required");const{category:n,q:a,keys:o={}}=e,i={};return n&&(i.category=n),a&&(i.q=a),o&&Object.keys(o).length>0&&(i.keys=o),await this.request("POST",`/app/global/${encodeURIComponent(r)}/all-app-users-data/search`,i,{},!1)}}var mt={exports:{}},et={};/**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
9
9
  *
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
- */var Jt;function Pn(){if(Jt)return Pe;Jt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:a,ref:i!==void 0?i:null,props:o}}return Pe.Fragment=e,Pe.jsx=n,Pe.jsxs=n,Pe}var Ie={};/**
14
+ */var Rr;function kn(){if(Rr)return et;Rr=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:t,type:n,key:i,ref:a!==void 0?a:null,props:o}}return et.Fragment=e,et.jsx=r,et.jsxs=r,et}var tt={};/**
15
15
  * @license React
16
16
  * react-jsx-runtime.development.js
17
17
  *
@@ -19,504 +19,198 @@
19
19
  *
20
20
  * This source code is licensed under the MIT license found in the
21
21
  * LICENSE file in the root directory of this source tree.
22
- */var Kt;function In(){return Kt||(Kt=1,process.env.NODE_ENV!=="production"&&(function(){function t(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===W?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case b:return"Suspense";case j:return"SuspenseList";case G:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case w:return"Portal";case z:return l.displayName||"Context";case g:return(l._context.displayName||"Context")+".Consumer";case D:var m=l.render;return l=l.displayName,l||(l=m.displayName||m.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case q:return m=l.displayName||null,m!==null?m:t(l.type)||"Memo";case O:m=l._payload,l=l._init;try{return t(l(m))}catch{}}return null}function e(l){return""+l}function n(l){try{e(l);var m=!1}catch{m=!0}if(m){m=console;var k=m.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return k.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),e(l)}}function s(l){if(l===h)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===O)return"<...>";try{var m=t(l);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function i(){var l=I.A;return l===null?null:l.getOwner()}function o(){return Error("react-stack-top-frame")}function a(l){if(X.call(l,"key")){var m=Object.getOwnPropertyDescriptor(l,"key").get;if(m&&m.isReactWarning)return!1}return l.key!==void 0}function c(l,m){function k(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}k.isReactWarning=!0,Object.defineProperty(l,"key",{get:k,configurable:!0})}function d(){var l=t(this.type);return K[l]||(K[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,m,k,N,ne,le){var B=k.ref;return l={$$typeof:u,type:l,key:m,props:k,_owner:N},(B!==void 0?B:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:d}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function x(l,m,k,N,ne,le){var B=m.children;if(B!==void 0)if(N)if(P(B)){for(N=0;N<B.length;N++)y(B[N]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(B);if(X.call(m,"key")){B=t(l);var ce=Object.keys(m).filter(function(_){return _!=="key"});N=0<ce.length?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}",J[B+N]||(ce=0<ce.length?"{"+ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
22
+ */var zr;function Pn(){return zr||(zr=1,process.env.NODE_ENV!=="production"&&(function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===Q?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case g:return"Fragment";case B:return"Profiler";case _:return"StrictMode";case X:return"Suspense";case R:return"SuspenseList";case se:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case h:return"Portal";case q:return d.displayName||"Context";case k:return(d._context.displayName||"Context")+".Consumer";case F:var x=d.render;return d=d.displayName,d||(d=x.displayName||x.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case M:return x=d.displayName||null,x!==null?x:t(d.type)||"Memo";case H:x=d._payload,d=d._init;try{return t(d(x))}catch{}}return null}function e(d){return""+d}function r(d){try{e(d);var x=!1}catch{x=!0}if(x){x=console;var w=x.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return w.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(d)}}function n(d){if(d===g)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===H)return"<...>";try{var x=t(d);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function a(){var d=J.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(G.call(d,"key")){var x=Object.getOwnPropertyDescriptor(d,"key").get;if(x&&x.isReactWarning)return!1}return d.key!==void 0}function l(d,x){function w(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}w.isReactWarning=!0,Object.defineProperty(d,"key",{get:w,configurable:!0})}function m(){var d=t(this.type);return A[d]||(A[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function u(d,x,w,E,V,ce){var C=w.ref;return d={$$typeof:p,type:d,key:x,props:w,_owner:E},(C!==void 0?C:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:m}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,x,w,E,V,ce){var C=x.children;if(C!==void 0)if(E)if(W(C)){for(E=0;E<C.length;E++)b(C[E]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(C);if(G.call(x,"key")){C=t(d);var oe=Object.keys(x).filter(function(L){return L!=="key"});E=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",Y[C+E]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,N,B,ce,B),J[B+N]=!0)}if(B=null,k!==void 0&&(n(k),B=""+k),a(m)&&(n(m.key),B=""+m.key),"key"in m){k={};for(var je in m)je!=="key"&&(k[je]=m[je])}else k=m;return B&&c(k,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,B,k,i(),ne,le)}function y(l){E(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===O&&(l._payload.status==="fulfilled"?E(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function E(l){return typeof l=="object"&&l!==null&&l.$$typeof===u}var C=S,u=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),z=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),I=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,P=Array.isArray,A=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(l){return l()}};var M,K={},H=C.react_stack_bottom_frame.bind(C,o)(),F=A(s(o)),J={};Ie.Fragment=h,Ie.jsx=function(l,m,k){var N=1e4>I.recentlyCreatedOwnerStacks++;return x(l,m,k,!1,N?Error("react-stack-top-frame"):H,N?A(s(l)):F)},Ie.jsxs=function(l,m,k){var N=1e4>I.recentlyCreatedOwnerStacks++;return x(l,m,k,!0,N?Error("react-stack-top-frame"):H,N?A(s(l)):F)}})()),Ie}var Xt;function Rn(){return Xt||(Xt=1,process.env.NODE_ENV==="production"?qe.exports=Pn():qe.exports=In()),qe.exports}var r=Rn();/**
27
+ <%s key={someKey} {...props} />`,E,C,oe,C),Y[C+E]=!0)}if(C=null,w!==void 0&&(r(w),C=""+w),i(x)&&(r(x.key),C=""+x.key),"key"in x){w={};for(var ie in x)ie!=="key"&&(w[ie]=x[ie])}else w=x;return C&&l(w,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,C,w,a(),V,ce)}function b(d){j(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===H&&(d._payload.status==="fulfilled"?j(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function j(d){return typeof d=="object"&&d!==null&&d.$$typeof===p}var P=y,p=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),J=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,W=Array.isArray,N=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(d){return d()}};var $,A={},O=P.react_stack_bottom_frame.bind(P,o)(),D=N(n(o)),Y={};tt.Fragment=g,tt.jsx=function(d,x,w){var E=1e4>J.recentlyCreatedOwnerStacks++;return f(d,x,w,!1,E?Error("react-stack-top-frame"):O,E?N(n(d)):D)},tt.jsxs=function(d,x,w){var E=1e4>J.recentlyCreatedOwnerStacks++;return f(d,x,w,!0,E?Error("react-stack-top-frame"):O,E?N(n(d)):D)}})()),tt}var Ir;function _n(){return Ir||(Ir=1,process.env.NODE_ENV==="production"?mt.exports=kn():mt.exports=Pn()),mt.exports}var s=_n();/**
28
28
  * @license lucide-react v0.544.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const On=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),An=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),Gt=t=>{const e=An(t);return e.charAt(0).toUpperCase()+e.slice(1)},Zt=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),_n=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
32
+ */const Cn=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tn=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),Lr=t=>{const e=Tn(t);return e.charAt(0).toUpperCase()+e.slice(1)},Fr=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),An=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
33
33
  * @license lucide-react v0.544.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
- */var zn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
37
+ */var On={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
38
38
  * @license lucide-react v0.544.0 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const Un=S.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:a,...c},d)=>S.createElement("svg",{ref:d,...zn,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:Zt("lucide",i),...!o&&!_n(c)&&{"aria-hidden":"true"},...c},[...a.map(([f,x])=>S.createElement(f,x)),...Array.isArray(o)?o:[o]]));/**
42
+ */const Un=y.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:i,...l},m)=>y.createElement("svg",{ref:m,...On,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:Fr("lucide",a),...!o&&!An(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,f])=>y.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
43
43
  * @license lucide-react v0.544.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
- */const L=(t,e)=>{const n=S.forwardRef(({className:s,...i},o)=>S.createElement(Un,{ref:o,iconNode:e,className:Zt(`lucide-${On(Gt(t))}`,`lucide-${t}`,s),...i}));return n.displayName=Gt(t),n};/**
47
+ */const K=(t,e)=>{const r=y.forwardRef(({className:n,...a},o)=>y.createElement(Un,{ref:o,iconNode:e,className:Fr(`lucide-${Cn(Lr(t))}`,`lucide-${t}`,n),...a}));return r.displayName=Lr(t),r};/**
48
48
  * @license lucide-react v0.544.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const $n=L("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
52
+ */const Rn=K("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
53
53
  * @license lucide-react v0.544.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */const et=L("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
57
+ */const zn=K("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
58
58
  * @license lucide-react v0.544.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const Nn=L("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
62
+ */const zt=K("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
63
63
  * @license lucide-react v0.544.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
- */const oe=L("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
67
+ */const be=K("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
68
68
  * @license lucide-react v0.544.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
- */const de=L("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
72
+ */const Ee=K("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
73
73
  * @license lucide-react v0.544.0 - ISC
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const tt=L("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
77
+ */const It=K("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
78
78
  * @license lucide-react v0.544.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
- */const Dn=L("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
82
+ */const In=K("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
83
83
  * @license lucide-react v0.544.0 - ISC
84
84
  *
85
85
  * This source code is licensed under the ISC license.
86
86
  * See the LICENSE file in the root directory of this source tree.
87
- */const Fn=L("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
87
+ */const Ln=K("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
88
88
  * @license lucide-react v0.544.0 - ISC
89
89
  *
90
90
  * This source code is licensed under the ISC license.
91
91
  * See the LICENSE file in the root directory of this source tree.
92
- */const rt=L("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
92
+ */const Lt=K("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
93
93
  * @license lucide-react v0.544.0 - ISC
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
- */const nt=L("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
97
+ */const Ft=K("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
98
98
  * @license lucide-react v0.544.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
- */const Ln=L("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);/**
102
+ */const Fn=K("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);/**
103
103
  * @license lucide-react v0.544.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
- */const Qt=L("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
107
+ */const qr=K("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
108
108
  * @license lucide-react v0.544.0 - ISC
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const er=L("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
112
+ */const Dr=K("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
113
113
  * @license lucide-react v0.544.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
- */const st=L("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
117
+ */const qt=K("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
118
118
  * @license lucide-react v0.544.0 - ISC
119
119
  *
120
120
  * This source code is licensed under the ISC license.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
- */const qn=L("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
122
+ */const qn=K("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
123
123
  * @license lucide-react v0.544.0 - ISC
124
124
  *
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
- */const se=L("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
127
+ */const ye=K("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
128
128
  * @license lucide-react v0.544.0 - ISC
129
129
  *
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
- */const Mn=L("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
132
+ */const Vr=K("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
133
133
  * @license lucide-react v0.544.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
- */const Se=L("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
137
+ */const We=K("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
138
138
  * @license lucide-react v0.544.0 - ISC
139
139
  *
140
140
  * This source code is licensed under the ISC license.
141
141
  * See the LICENSE file in the root directory of this source tree.
142
- */const it=L("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);/**
142
+ */const Dt=K("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);/**
143
143
  * @license lucide-react v0.544.0 - ISC
144
144
  *
145
145
  * This source code is licensed under the ISC license.
146
146
  * See the LICENSE file in the root directory of this source tree.
147
- */const pe=L("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
147
+ */const Le=K("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
148
148
  * @license lucide-react v0.544.0 - ISC
149
149
  *
150
150
  * This source code is licensed under the ISC license.
151
151
  * See the LICENSE file in the root directory of this source tree.
152
- */const Wn=L("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
152
+ */const Dn=K("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
153
153
  * @license lucide-react v0.544.0 - ISC
154
154
  *
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
- */const Bn=L("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
157
+ */const Vn=K("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
158
158
  * @license lucide-react v0.544.0 - ISC
159
159
  *
160
160
  * This source code is licensed under the ISC license.
161
161
  * See the LICENSE file in the root directory of this source tree.
162
- */const Hn=L("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
162
+ */const Bn=K("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
163
163
  * @license lucide-react v0.544.0 - ISC
164
164
  *
165
165
  * This source code is licensed under the ISC license.
166
166
  * See the LICENSE file in the root directory of this source tree.
167
- */const Vn=L("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
167
+ */const Mn=K("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
168
168
  * @license lucide-react v0.544.0 - ISC
169
169
  *
170
170
  * This source code is licensed under the ISC license.
171
171
  * See the LICENSE file in the root directory of this source tree.
172
- */const ot=L("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
172
+ */const Vt=K("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
173
173
  * @license lucide-react v0.544.0 - ISC
174
174
  *
175
175
  * This source code is licensed under the ISC license.
176
176
  * See the LICENSE file in the root directory of this source tree.
177
- */const Yn=L("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
177
+ */const Bt=K("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
178
178
  * @license lucide-react v0.544.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
- */const at=L("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
182
+ */const xt=K("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
183
183
  * @license lucide-react v0.544.0 - ISC
184
184
  *
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
- */const Me=L("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
187
+ */const Br=K("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
188
188
  * @license lucide-react v0.544.0 - ISC
189
189
  *
190
190
  * This source code is licensed under the ISC license.
191
191
  * See the LICENSE file in the root directory of this source tree.
192
- */const tr=L("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
192
+ */const Hn=K("user-x",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
193
193
  * @license lucide-react v0.544.0 - ISC
194
194
  *
195
195
  * This source code is licensed under the ISC license.
196
196
  * See the LICENSE file in the root directory of this source tree.
197
- */const Jn=L("user-x",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
197
+ */const Je=K("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
198
198
  * @license lucide-react v0.544.0 - ISC
199
199
  *
200
200
  * This source code is licensed under the ISC license.
201
201
  * See the LICENSE file in the root directory of this source tree.
202
- */const me=L("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
203
- * @license lucide-react v0.544.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const Re=L("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rr=S.createContext(null),Kn=({authix:t,children:e})=>r.jsx(rr.Provider,{value:t,children:e}),ge=()=>{const t=S.useContext(rr);if(!t)throw new Error("useAuthix must be used inside <AuthixProvider />");return t},Xn=({logoUrl:t,logoLinkUrl:e,title:n="Create Your Account",subtitle:s="Join our platform today",primaryColor:i="#00C214",gradient:o="linear-gradient(135deg, #22c55e, #00C214)",darkMode:a=!0,showAvatar:c=!1,roles:d=[],showRoleSelector:f=!1,loginUrl:x,onSuccess:y,onError:E})=>{const C=ge(),u={name:"",email:"",password:"",role:d.length?d[0]:"user",...c&&{avatarUrl:""}},[w,h]=S.useState(u),[R,T]=S.useState(!1),[g,z]=S.useState(!1),[D,b]=S.useState(null),[j,q]=S.useState({}),[O,G]=S.useState(!1),W=a?"#ffffff":"#111827",I=a?"#a1a1aa":"#6b7280",X=a?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",P=a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";S.useEffect(()=>{if(typeof window<"u"){const F=()=>G(window.innerWidth<768);return F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)}},[]);const A=F=>{const{name:J,value:l}=F.target;h(m=>({...m,[J]:l})),j[J]&&q(m=>({...m,[J]:void 0}))},M=()=>{const F={};return w.name.trim()||(F.name="Name is required"),w.email.trim()?/\S+@\S+\.\S+/.test(w.email)||(F.email="Invalid email address"):F.email="Email is required",w.password?w.password.length<6&&(F.password="Password must be at least 6 characters"):F.password="Password is required",q(F),Object.keys(F).length===0},K=async F=>{if(F.preventDefault(),!!M()){z(!0),b(null);try{const J={name:w.name,email:w.email,password:w.password,role:w.role,...w.avatarUrl?{avatarUrl:w.avatarUrl}:{}},l=await C.signupUser(J);l.success?(b({type:"success",text:l.message||"Account created successfully!"}),y?.(l.user)):(b({type:"error",text:l.message||"Signup failed"}),E?.(l))}catch(J){b({type:"error",text:J.message||"Signup failed. Please try again."}),E?.(J)}finally{z(!1)}}},H={width:"100%",padding:O?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:X,border:`1px solid ${P}`,borderRadius:"10px",color:W,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"};return r.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[r.jsxs("div",{style:{minWidth:O?"320px":"380px",width:"100%",maxWidth:O?"340px":"390px",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:a?"#000000":"#ffffff",padding:O?"30px 24px":"20px 28px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?r.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:r.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):r.jsx(me,{size:40,color:i,style:{marginBottom:"10px"}}),r.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:W,margin:0},children:n}),r.jsx("p",{style:{fontSize:"14px",color:I},children:s})]}),c&&w.avatarUrl&&r.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16px"},children:r.jsx("img",{src:w.avatarUrl,alt:"Avatar Preview",style:{width:"60px",height:"60px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${i}30`},onError:F=>{const J=F.target;J.style.display="none"}})}),r.jsxs("form",{onSubmit:K,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[f&&d&&d.length===2&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{style:{fontSize:"14px",fontWeight:500,color:W},children:"Select Role"}),r.jsxs("div",{style:{position:"relative",display:"flex",borderRadius:"10px",border:`1px solid ${P}`,backgroundColor:X,overflow:"hidden",cursor:"pointer",height:"42px"},children:[r.jsx("div",{style:{position:"absolute",top:0,left:0,width:"50%",height:"100%",backgroundColor:a?"#000000":"#ffffff",boxShadow:a?"0 1px 3px rgba(255,255,255,0.05)":"0 1px 3px rgba(0,0,0,0.1)",borderRadius:"10px",transition:"transform 0.3s ease, background-color 0.3s ease",transform:w.role===d[1]?"translateX(100%)":"translateX(0)",zIndex:0}}),r.jsx("button",{type:"button",onClick:()=>h(F=>({...F,role:d[0]})),style:{flex:1,zIndex:10,border:"none",background:"transparent",color:w.role===d[0]?i:a?"#9ca3af":"#6b7280",fontWeight:w.role===d[0]?600:500,fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.2s ease"},children:d[0].charAt(0).toUpperCase()+d[0].slice(1)}),r.jsx("button",{type:"button",onClick:()=>h(F=>({...F,role:d[1]})),style:{flex:1,zIndex:10,border:"none",background:"transparent",color:w.role===d[1]?i:a?"#9ca3af":"#6b7280",fontWeight:w.role===d[1]?600:500,fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.2s ease"},children:d[1].charAt(0).toUpperCase()+d[1].slice(1)})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"signup-name",style:{fontSize:"14px",fontWeight:500,color:W},children:"Full Name"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(me,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:I}}),r.jsx("input",{id:"signup-name",type:"text",name:"name",placeholder:"Enter your full name",value:w.name,onChange:A,style:{...H,borderColor:j.name?"#ef4444":P}})]}),j.name&&r.jsx("span",{style:{color:"#ef4444",fontSize:"12px",marginTop:"2px"},children:j.name})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"signup-email",style:{fontSize:"14px",fontWeight:500,color:W},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:I}}),r.jsx("input",{id:"signup-email",type:"email",name:"email",placeholder:"Enter your email address",value:w.email,onChange:A,style:{...H,borderColor:j.email?"#ef4444":P}})]}),j.email&&r.jsx("span",{style:{color:"#ef4444",fontSize:"12px",marginTop:"2px"},children:j.email})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"signup-password",style:{fontSize:"14px",fontWeight:500,color:W},children:"Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Se,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:I}}),r.jsx("input",{id:"signup-password",type:R?"text":"password",name:"password",placeholder:"Create a secure password",value:w.password,onChange:A,style:{...H,borderColor:j.password?"#ef4444":P}}),r.jsx("button",{type:"button",onClick:()=>T(!R),style:{position:"absolute",right:"14px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:I,cursor:"pointer",padding:"4px"},children:R?r.jsx(rt,{size:20}):r.jsx(nt,{size:20})})]}),j.password&&r.jsx("span",{style:{color:"#ef4444",fontSize:"12px",marginTop:"2px"},children:j.password})]}),c&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"signup-avatar",style:{fontSize:"14px",fontWeight:500,color:W},children:"Avatar URL (Optional)"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Qt,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:I}}),r.jsx("input",{id:"signup-avatar",type:"url",name:"avatarUrl",placeholder:"Paste your avatar image URL",value:w.avatarUrl||"",onChange:A,style:H})]})]}),x&&r.jsx("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:r.jsx("a",{href:x,style:{color:i,textDecoration:"none",fontWeight:500},children:"Already have an account?"})}),D&&r.jsxs("div",{style:{padding:"12px",borderRadius:"12px",fontSize:"12px",display:"flex",alignItems:"start",gap:"10px",backgroundColor:D.type==="success"?`${i}15`:"rgba(239,68,68,0.1)",border:D.type==="success"?`1px solid ${i}30`:"1px solid rgba(239,68,68,0.3)",color:D.type==="success"?i:"#ef4444"},children:[D.type==="success"?r.jsx(de,{size:20}):r.jsx(oe,{size:20}),r.jsx("span",{children:D.text})]}),r.jsx("button",{type:"submit",disabled:g,style:{padding:"12px",background:o,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600,cursor:g?"not-allowed":"pointer",opacity:g?.7:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:g?r.jsxs(r.Fragment,{children:[r.jsx(Mn,{size:18,style:{animation:"spin 1s linear infinite"}}),"Creating Account..."]}):"Create Account"})]}),r.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:I,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",r.jsx("span",{style:{color:i,fontWeight:600},children:"Neuctra Authix"})]})]}),r.jsx("style",{children:`
208
- @keyframes spin {
209
- from { transform: rotate(0deg); }
210
- to { transform: rotate(360deg); }
211
- }
212
- `})]})},Gn=({logoUrl:t,logoLinkUrl:e,title:n="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",primaryColor:i="#00C214",gradient:o="linear-gradient(135deg, #22c55e, #00C214)",darkMode:a=!0,signupUrl:c,onSuccess:d,onError:f})=>{const x=ge(),[y,E]=S.useState("login"),[C,u]=S.useState(1),[w,h]=S.useState(!1),[R,T]=S.useState(!1),[g,z]=S.useState(null),[D,b]=S.useState(""),[j,q]=S.useState(""),[O,G]=S.useState({email:"",otp:"",newPassword:""}),[W,I]=S.useState(!1),X=a?"#ffffff":"#111827",P=a?"#a1a1aa":"#6b7280",A=a?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",M=a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";S.useEffect(()=>{if(typeof window<"u"){const m=()=>I(window.innerWidth<768);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)}},[]);const K=async m=>{m.preventDefault(),T(!0),z(null);try{const k=await x.loginUser({email:D,password:j}),{user:N}=k;if(!N)throw new Error(k.message||"Login failed");if(typeof document<"u"){const ne="a_s_b",le="true",B=new Date;B.setTime(B.getTime()+1440*60*1e3),document.cookie=`${ne}=${le}; path=/; expires=${B.toUTCString()}; SameSite=Lax`}z({type:"success",text:`Welcome ${N.name}`}),d?.(N)}catch(k){const N=k.message||"Login failed";z({type:"error",text:N}),f?.(k)}finally{T(!1)}},H=m=>{G({...O,[m.target.name]:m.target.value})},F=async m=>{m.preventDefault(),T(!0),z(null);try{const k=await x.requestResetUserPasswordOTP({email:O.email});k.success?(u(2),z({type:"success",text:k.message||"OTP sent to your email"})):z({type:"error",text:k.message||"Failed to send OTP"})}catch(k){z({type:"error",text:k.message||"Something went wrong"})}finally{T(!1)}},J=async m=>{m.preventDefault(),T(!0),z(null);try{const k=await x.resetUserPassword({email:O.email,otp:O.otp,newPassword:O.newPassword});k.success?(z({type:"success",text:k.message||"Password reset successfully!"}),u(1),G({email:"",otp:"",newPassword:""}),E("login")):z({type:"error",text:k.message||"Reset failed"})}catch(k){z({type:"error",text:k.message||"Something went wrong"})}finally{T(!1)}},l={width:"100%",padding:W?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:A,border:`1px solid ${M}`,borderRadius:"10px",color:X,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return r.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsxs("div",{style:{minWidth:W?"320px":"380px",maxWidth:W?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:a?"#000000":"#ffffff",padding:W?"30px 24px":"18px 28px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?r.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:r.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):r.jsx(me,{size:40,color:i,style:{marginBottom:"10px"}}),r.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:X,margin:0},children:y==="login"?n:C===1?"Forgot Password":"Reset Password"}),r.jsx("p",{style:{fontSize:"14px",color:P},children:y==="login"?s:"Follow the steps to reset your password"})]}),y==="login"&&r.jsxs("form",{onSubmit:K,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:P}}),r.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:D,onChange:m=>b(m.target.value),style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Se,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:P}}),r.jsx("input",{id:"login-password",type:w?"text":"password",placeholder:"Enter your password",value:j,onChange:m=>q(m.target.value),style:l}),r.jsx("button",{type:"button",onClick:()=>h(!w),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:P,cursor:"pointer"},children:w?r.jsx(rt,{size:20}):r.jsx(nt,{size:20})})]})]}),r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[c&&r.jsx("a",{href:c,style:{color:i,textDecoration:"none",fontWeight:500},children:"Create new account"}),r.jsx("button",{type:"button",onClick:()=>E("forgot"),style:{background:"none",border:"none",color:i,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),r.jsx("button",{type:"submit",disabled:R,style:{padding:"12px",background:o,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:R?"Signing In...":"Sign In"})]}),y==="forgot"&&r.jsxs("form",{onSubmit:C===1?F:J,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[C===1?r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[r.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"Email Address"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(pe,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:P}}),r.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:O.email,onChange:H,style:l})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(er,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:P}}),r.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:O.otp,onChange:H,style:l})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[r.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:a?"#ffffff":"#000000"},children:"New Password"}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Se,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:P}}),r.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:O.newPassword,onChange:H,style:l})]})]})]}),r.jsx("button",{type:"submit",disabled:R,style:{padding:"12px",background:o,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:R?"Please wait...":C===1?"Send Reset OTP":"Reset Password"}),r.jsx("button",{type:"button",onClick:()=>{E("login"),u(1)},style:{background:"none",border:"none",fontSize:"14px",color:P,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&r.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${i}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${i}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?i:"#ef4444"},children:[g.type==="success"?r.jsx(de,{size:20}):r.jsx(oe,{size:20}),r.jsx("span",{children:g.text})]}),r.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:P,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",r.jsx("span",{style:{color:i,fontWeight:600},children:"Neuctra Authix"})]})]})})},Zn=({children:t,fallback:e=null})=>{const[n,s]=S.useState("loading");S.useEffect(()=>{if(typeof window>"u")return;const c=window.document.cookie.split(";").map(d=>d.trim()).find(d=>d.startsWith("a_s_b="))?.split("=")[1]==="true";s(c?"authenticated":"unauthenticated")},[]);const i=o=>typeof o=="function"?o():o;return n==="loading"?null:n==="unauthenticated"?r.jsx(r.Fragment,{children:i(e)}):r.jsx(r.Fragment,{children:t})},Qn=({children:t,fallback:e=null})=>{const[n,s]=S.useState("loading");S.useEffect(()=>{if(typeof window>"u")return;const c=window.document.cookie.split(";").map(d=>d.trim()).find(d=>d.startsWith("a_s_b="))?.split("=")[1]==="true";s(c?"authenticated":"unauthenticated")},[]);const i=o=>typeof o=="function"?o():o;return n==="loading"?null:n==="authenticated"?r.jsx(r.Fragment,{children:i(e)}):r.jsx(r.Fragment,{children:t})},es=({isOpen:t,onClose:e,onSuccess:n,onError:s,userId:i,colors:o})=>{const a=ge(),[c,d]=S.useState(!1),[f,x]=S.useState(""),[y,E]=S.useState("warning"),[C,u]=S.useState(!1);if(S.useEffect(()=>{if(typeof window>"u")return;const g=()=>{u(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const w=async()=>{d(!0),E("processing");try{const g=await a.deleteUser({userId:i});g.success?(n(g.message||"Account deleted successfully"),E("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),E("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),E("warning")}finally{d(!1)}},h=f.toLowerCase()==="delete my account",R=g=>{g.target===g.currentTarget&&y!=="processing"&&y!=="success"&&e()},T=()=>{switch(y){case"warning":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(Me,{size:20})}),r.jsx("div",{children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),r.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.color=o.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=o.textTertiary},children:r.jsx(Re,{size:20})})]}),r.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${o.error}15`,border:`1px solid ${o.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[r.jsx("div",{style:{color:o.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:r.jsx(tr,{size:24})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h4",{style:{color:o.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:r.jsx(Dn,{size:16}),text:"All your data will be permanently deleted"},{icon:r.jsx(Jn,{size:16}),text:"This action cannot be reversed"},{icon:r.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx("div",{style:{color:o.error,flexShrink:0},children:g.icon}),r.jsx("span",{children:g.text})]},z))})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:C?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:C?"none":1,minWidth:C?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),r.jsxs("button",{onClick:()=>E("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:C?"none":1,minWidth:C?"100%":"140px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)"},onMouseOut:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)"},children:[r.jsx(Me,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #f59e0b, #d97706)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tr,{size:24})}),r.jsx("div",{style:{flex:1},children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsxs("p",{style:{color:o.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",r.jsx("strong",{style:{color:o.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),r.jsx("input",{type:"text",value:f,onChange:g=>x(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${h?o.success:o.error}`,backgroundColor:"transparent",color:o.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),h&&r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:o.success,fontSize:"14px",fontWeight:500},children:[r.jsx(tt,{size:16}),r.jsx("span",{children:"Confirmation accepted"})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{onClick:()=>{E("warning"),x("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:C?"none":1,minWidth:C?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=o.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),r.jsxs("button",{onClick:w,disabled:!h||c,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!h||c?"not-allowed":"pointer",flex:C?"none":1,minWidth:C?"100%":"140px",opacity:!h||c?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!h||c?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{h&&!c&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[r.jsx(Me,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #6b7280, #4b5563)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(se,{size:20,style:{animation:"spin 1s linear infinite"}})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),r.jsx("div",{style:{marginBottom:"20px"},children:r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((g,z)=>r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${o.accent}10`:"transparent"},children:[r.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?o.accent:o.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${o.accent}20`:"none"}}),r.jsx("span",{style:{fontSize:"14px",color:g.active?o.textPrimary:o.textSecondary,fontWeight:g.active?500:400},children:g.text})]},z))})}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary},children:[r.jsx(at,{size:18,style:{color:o.accent,flexShrink:0}}),r.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:r.jsx(tt,{size:20})}),r.jsxs("div",{style:{flex:1},children:[r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),r.jsx("p",{style:{color:o.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),r.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${o.success}10`,border:`1px solid ${o.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[r.jsx(tt,{size:48,style:{color:o.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),r.jsx("p",{style:{color:o.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),r.jsx("p",{style:{color:o.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${o.accent}10`,borderRadius:"10px",fontSize:"14px",color:o.textSecondary,justifyContent:"center"},children:[r.jsx(se,{size:16,style:{animation:"spin 1s linear infinite",color:o.accent}}),r.jsx("span",{children:"Redirecting to login page..."})]})]})}};return r.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e4,animation:"fadeIn 0.3s ease-out"},onClick:R,children:[r.jsx("div",{style:{backgroundColor:o.surface,border:`1px solid ${o.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"scaleIn 0.3s ease-out"},className:"delete-modal-container",children:T()}),r.jsx("style",{children:`
213
- @keyframes fadeIn {
214
- from { opacity: 0; }
215
- to { opacity: 1; }
216
- }
217
-
218
- @keyframes scaleIn {
219
- from {
220
- opacity: 0;
221
- transform: scale(0.9) translateY(20px);
222
- }
223
- to {
224
- opacity: 1;
225
- transform: scale(1) translateY(0);
226
- }
227
- }
228
-
229
- @keyframes spin {
230
- from { transform: rotate(0deg); }
231
- to { transform: rotate(360deg); }
232
- }
233
-
234
- .delete-modal-container {
235
- animation: scaleIn 0.3s ease-out;
236
- }
237
-
238
- /* Mobile responsiveness */
239
- @media (max-width: 480px) {
240
- .delete-modal-container {
241
- padding: 20px 16px;
242
- margin: 0;
243
- border-radius: 16px 16px 0 0;
244
- max-height: 90vh;
245
- overflow-y: auto;
246
- }
247
- }
248
-
249
- @media (max-width: 360px) {
250
- .delete-modal-container {
251
- padding: 16px 12px;
252
- }
253
- }
254
-
255
- /* Reduced motion support */
256
- @media (prefers-reduced-motion: reduce) {
257
- .delete-modal-container {
258
- animation: none;
259
- }
260
-
261
- * {
262
- transition: none !important;
263
- animation: none !important;
264
- }
265
- }
266
- `})]})},ts=({isOpen:t,onClose:e,onUpdate:n,colors:s})=>{const[i,o]=S.useState(""),[a,c]=S.useState(!1),[d,f]=S.useState(!1),[x,y]=S.useState({isValid:!1,message:"",type:null});if(S.useEffect(()=>{if(typeof window>"u")return;const u=()=>{f(window.innerWidth<640)};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),S.useEffect(()=>{if(!i.trim()){y({isValid:!1,message:"",type:null});return}try{const u=new URL(i),w=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(u.pathname);y(w?{isValid:!0,message:"Valid image URL",type:"success"}:{isValid:!1,message:"URL should point to an image file",type:"warning"})}catch{y({isValid:!1,message:"Please enter a valid URL",type:"error"})}},[i]),!t)return null;const E=async()=>{if(!(!i||!x.isValid)){c(!0);try{await n(i)&&(o(""),e())}finally{c(!1)}}},C=u=>{u.target===u.currentTarget&&e()};return r.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e3},onClick:C,children:[r.jsxs("div",{style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"modalSlideIn 0.3s ease-out"},className:"avatar-modal-container",children:[r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[r.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"12px",background:`linear-gradient(135deg, ${s.accent}20, ${s.accent}40)`,display:"flex",alignItems:"center",justifyContent:"center",color:s.accent,flexShrink:0},children:r.jsx(et,{size:22})}),r.jsx("div",{children:r.jsx("h3",{style:{color:s.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Update Avatar"})})]}),r.jsx("button",{onClick:e,"aria-label":"Close avatar modal",style:{background:"transparent",border:"none",color:s.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:u=>{u.currentTarget.style.backgroundColor=s.border,u.currentTarget.style.color=s.textPrimary},onMouseOut:u=>{u.currentTarget.style.backgroundColor="transparent",u.currentTarget.style.color=s.textTertiary},children:r.jsx(Re,{size:20})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"avatar-url",style:{display:"flex",marginBottom:"8px",color:s.textPrimary,fontSize:"14px",fontWeight:500,alignItems:"center",gap:"6px"},children:[r.jsx(qn,{size:16}),"Avatar URL"]}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx("input",{type:"url",id:"avatar-url",placeholder:"https://example.com/your-avatar.jpg",value:i,onChange:u=>o(u.target.value),style:{width:"100%",padding:"14px 16px",paddingLeft:"44px",borderRadius:"12px",border:`1.5px solid ${x.type==="error"?s.error:x.type==="success"?s.success:s.border}`,backgroundColor:"transparent",color:s.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:u=>{u.target.style.borderColor=s.accent,u.target.style.boxShadow=`0 0 0 3px ${s.accent}20`},onBlur:u=>{u.target.style.borderColor=x.type==="error"?s.error:x.type==="success"?s.success:s.border,u.target.style.boxShadow="none"},disabled:a}),r.jsx("div",{style:{position:"absolute",left:"16px",top:"50%",transform:"translateY(-50%)",color:s.textTertiary},children:r.jsx(Qt,{size:18})})]}),x.message&&r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"8px",fontSize:"13px",color:x.type==="success"?s.success:x.type==="error"?s.error:s.textTertiary},children:[x.type==="success"&&r.jsx(de,{size:14}),x.type==="error"&&r.jsx(oe,{size:14}),x.type==="warning"&&r.jsx(oe,{size:14}),x.message]})]}),i&&x.type==="success"&&r.jsxs("div",{style:{padding:"16px",backgroundColor:`${s.success}10`,border:`1px solid ${s.success}20`,borderRadius:"12px",textAlign:"center"},children:[r.jsx("p",{style:{color:s.textSecondary,fontSize:"13px",fontWeight:500,margin:"0 0 12px 0"},children:"Preview"}),r.jsx("img",{src:i,alt:"Avatar preview",style:{width:"80px",height:"80px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${s.success}40`,margin:"0 auto"},onError:u=>{u.currentTarget.style.display="none"}})]})]}),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:d?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch",marginTop:"24px"},children:[r.jsx("button",{onClick:e,disabled:a,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${s.border}`,background:"transparent",color:s.textPrimary,fontSize:"14px",fontWeight:500,cursor:a?"not-allowed":"pointer",flex:d?"none":1,minWidth:d?"100%":"120px",opacity:a?.6:1,transition:"all 0.2s ease"},onMouseOver:u=>{a||(u.currentTarget.style.backgroundColor=s.border,u.currentTarget.style.transform="translateY(-1px)")},onMouseOut:u=>{a||(u.currentTarget.style.backgroundColor="transparent",u.currentTarget.style.transform="translateY(0)")},children:"Cancel"}),r.jsx("button",{onClick:E,disabled:a||!x.isValid,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:`linear-gradient(135deg, ${s.accent}, ${s.accent}E6)`,color:"#fff",fontSize:"14px",fontWeight:600,cursor:a||!x.isValid?"not-allowed":"pointer",flex:d?"none":1,minWidth:d?"100%":"140px",opacity:a||!x.isValid?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:a||!x.isValid?"none":`0 4px 12px ${s.accent}40`},onMouseOver:u=>{!a&&x.isValid&&(u.currentTarget.style.transform="translateY(-1px)",u.currentTarget.style.boxShadow=`0 6px 20px ${s.accent}60`)},onMouseOut:u=>{!a&&x.isValid&&(u.currentTarget.style.transform="translateY(0)",u.currentTarget.style.boxShadow=`0 4px 12px ${s.accent}40`)},children:a?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:16,style:{animation:"spin 1s linear infinite"}}),"Updating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(et,{size:16}),"Update Avatar"]})})]})]}),r.jsx("style",{children:`
267
- @keyframes modalSlideIn {
268
- from {
269
- opacity: 0;
270
- transform: scale(0.9) translateY(20px);
271
- }
272
- to {
273
- opacity: 1;
274
- transform: scale(1) translateY(0);
275
- }
276
- }
277
-
278
- @keyframes spin {
279
- from { transform: rotate(0deg); }
280
- to { transform: rotate(360deg); }
281
- }
282
-
283
- .avatar-modal-container {
284
- animation: modalSlideIn 0.3s ease-out;
285
- }
286
-
287
- /* Mobile responsiveness */
288
- @media (max-width: 480px) {
289
- .avatar-modal-container {
290
- padding: 20px 16px;
291
- margin: 0;
292
- border-radius: 16px 16px 0 0;
293
- max-height: 90vh;
294
- overflow-y: auto;
295
- }
296
- }
297
-
298
- @media (max-width: 360px) {
299
- .avatar-modal-container {
300
- padding: 16px 12px;
301
- }
302
- }
303
-
304
- /* Reduced motion support */
305
- @media (prefers-reduced-motion: reduce) {
306
- .avatar-modal-container {
307
- animation: none;
308
- }
309
-
310
- * {
311
- transition: none !important;
312
- }
313
- }
314
- `})]})},rs=({isOpen:t,onClose:e,onSuccess:n,onError:s,userId:i,colors:o})=>{const a=ge(),[c,d]=S.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[f,x]=S.useState({}),[y,E]=S.useState(!1),[C,u]=S.useState({currentPassword:!1,newPassword:!1,confirmPassword:!1}),[w,h]=S.useState(!1);if(S.useEffect(()=>{if(typeof window>"u")return;const b=()=>{h(window.innerWidth<640)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),!t)return null;const R=b=>{const{name:j,value:q}=b.target;d(O=>({...O,[j]:q})),f[j]&&x(O=>({...O,[j]:""}))},T=b=>{u(j=>({...j,[b]:!j[b]}))},g=()=>{const b={};return c.currentPassword||(b.currentPassword="Current password is required"),c.newPassword?c.newPassword.length<6&&(b.newPassword="Password must be at least 6 characters"):b.newPassword="New password is required",c.newPassword!==c.confirmPassword&&(b.confirmPassword="Passwords do not match"),x(b),Object.keys(b).length===0},z=async b=>{if(b.preventDefault(),!!g()){E(!0);try{const{data:j}=await a.changePassword({currentPassword:c.currentPassword,newPassword:c.newPassword,userId:i});j.success?(n(j.message||"Password updated successfully"),d({currentPassword:"",newPassword:"",confirmPassword:""}),e()):s(j.message||"Failed to update password")}catch(j){s(j.response?.data?.message||"Something went wrong")}finally{E(!1)}}},D=[{field:"currentPassword",label:"Current Password",icon:r.jsx(st,{size:18})},{field:"newPassword",label:"New Password",icon:r.jsx(Se,{size:18})},{field:"confirmPassword",label:"Confirm Password",icon:r.jsx(Se,{size:18})}];return r.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e3},children:r.jsxs("div",{style:{backgroundColor:o.surface,border:`1px solid ${o.border}`,borderRadius:"16px",maxWidth:"440px",width:"100%",padding:"24px",boxShadow:"0 20px 60px rgba(0,0,0,0.4)",maxHeight:"90vh",overflowY:"auto"},className:"change-password-modal",children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px",gap:"12px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[r.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${o.accent}20, ${o.accent}40)`,display:"flex",alignItems:"center",justifyContent:"center",color:o.accent,flexShrink:0},children:r.jsx(Se,{size:20})}),r.jsx("div",{children:r.jsx("h3",{style:{color:o.textPrimary,margin:0,fontSize:"18px",fontWeight:600,lineHeight:"1.4"},children:"Change Password"})})]}),r.jsx("button",{onClick:e,"aria-label":"Close password change modal",style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",flexShrink:0,width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},onMouseOver:b=>{b.currentTarget.style.backgroundColor=o.border,b.currentTarget.style.color=o.textPrimary},onMouseOut:b=>{b.currentTarget.style.backgroundColor="transparent",b.currentTarget.style.color=o.textTertiary},children:r.jsx(Re,{size:20})})]}),r.jsxs("form",{onSubmit:z,children:[D.map(({field:b,label:j,icon:q})=>r.jsxs("div",{style:{marginBottom:"20px",position:"relative"},children:[r.jsx("label",{htmlFor:b,style:{display:"block",marginBottom:"8px",color:o.textPrimary,fontSize:"14px",fontWeight:500,lineHeight:"1.4"},children:j}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx("div",{style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,zIndex:2},children:q}),r.jsx("input",{type:C[b]?"text":"password",id:b,name:b,placeholder:`Enter ${j.toLowerCase()}`,value:c[b],onChange:R,style:{width:"100%",padding:"14px 48px 14px 44px",borderRadius:"10px",border:`1.5px solid ${f[b]?o.error:o.border}`,backgroundColor:"transparent",color:o.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:O=>{O.target.style.borderColor=o.accent,O.target.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:O=>{O.target.style.borderColor=f[b]?o.error:o.border,O.target.style.boxShadow="none"}}),r.jsx("button",{type:"button",onClick:()=>T(b),style:{position:"absolute",right:"14px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",cursor:"pointer",color:o.textTertiary,padding:"4px",borderRadius:"4px",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},onMouseOver:O=>{O.currentTarget.style.backgroundColor=o.border,O.currentTarget.style.color=o.textPrimary},onMouseOut:O=>{O.currentTarget.style.backgroundColor="transparent",O.currentTarget.style.color=o.textTertiary},children:C[b]?r.jsx(rt,{size:18}):r.jsx(nt,{size:18})})]}),f[b]&&r.jsxs("div",{style:{fontSize:"13px",color:o.error,marginTop:"6px",display:"flex",alignItems:"center",gap:"6px"},children:[r.jsx("span",{style:{fontSize:"16px"},children:"⚠"}),f[b]]})]},b)),r.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:w?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[r.jsx("button",{type:"button",onClick:e,disabled:y,style:{padding:"14px 24px",borderRadius:"10px",border:`1.5px solid ${o.border}`,background:"transparent",color:o.textPrimary,fontSize:"14px",fontWeight:500,cursor:y?"not-allowed":"pointer",flex:w?"none":1,minWidth:w?"100%":"120px",opacity:y?.6:1,transition:"all 0.2s ease"},onMouseOver:b=>{y||(b.currentTarget.style.backgroundColor=o.border,b.currentTarget.style.transform="translateY(-1px)")},onMouseOut:b=>{y||(b.currentTarget.style.backgroundColor="transparent",b.currentTarget.style.transform="translateY(0)")},children:"Cancel"}),r.jsx("button",{type:"submit",disabled:y,style:{padding:"14px 24px",borderRadius:"10px",border:"none",background:`linear-gradient(135deg, ${o.accent}, ${o.accent}E6)`,color:"#fff",fontSize:"14px",fontWeight:600,cursor:y?"not-allowed":"pointer",flex:w?"none":1,minWidth:w?"100%":"140px",opacity:y?.8:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:y?"none":`0 4px 12px ${o.accent}40`},onMouseOver:b=>{y||(b.currentTarget.style.transform="translateY(-1px)",b.currentTarget.style.boxShadow=`0 6px 20px ${o.accent}60`)},onMouseOut:b=>{y||(b.currentTarget.style.transform="translateY(0)",b.currentTarget.style.boxShadow=`0 4px 12px ${o.accent}40`)},children:y?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:16,style:{animation:"spin 1s linear infinite"}}),"Updating..."]}):"Update Password"})]})]}),r.jsx("style",{children:`
315
- @keyframes spin {
316
- from { transform: rotate(0deg); }
317
- to { transform: rotate(360deg); }
318
- }
319
-
320
- .change-password-modal::-webkit-scrollbar {
321
- width: 6px;
322
- }
323
-
324
- .change-password-modal::-webkit-scrollbar-track {
325
- background: transparent;
326
- }
327
-
328
- .change-password-modal::-webkit-scrollbar-thumb {
329
- background: ${o.border};
330
- border-radius: 3px;
331
- }
332
-
333
- .change-password-modal::-webkit-scrollbar-thumb:hover {
334
- background: ${o.textTertiary};
335
- }
336
-
337
- /* Mobile responsiveness */
338
- @media (max-width: 480px) {
339
- .change-password-modal {
340
- padding: 20px 16px;
341
- margin: 0;
342
- border-radius: 12px 12px 0 0;
343
- max-height: 85vh;
344
- }
345
- }
346
-
347
- @media (max-width: 360px) {
348
- .change-password-modal {
349
- padding: 16px 12px;
350
- }
351
- }
352
- `})]})})},ns=({isOpen:t,onClose:e,onVerify:n,onSendOTP:s,verifyFormData:i,setVerifyFormData:o,otpSent:a,verifying:c,user:d,colors:f,darkMode:x})=>{if(!t)return null;const y=()=>{e(),o({email:d?.email||"",otp:""})};return r.jsxs("div",{className:"modal-overlay",style:{backgroundColor:x?"rgba(0, 0, 0, 0.8)":"rgba(0, 0, 0, 0.5)"},children:[r.jsxs("div",{className:"verify-email-modal",style:{backgroundColor:f.surface,border:`1px solid ${f.border}`},children:[r.jsxs("div",{className:"modal-header",children:[r.jsx("h3",{style:{color:f.textPrimary},children:"Verify Your Email"}),r.jsx("button",{onClick:y,className:"close-btn",style:{color:f.textTertiary},"aria-label":"Close verification modal",children:r.jsx(Re,{size:20,"aria-hidden":"true"})})]}),r.jsxs("form",{className:"verify-form",onSubmit:n,children:[r.jsxs("div",{className:"form-group",children:[r.jsx("label",{style:{color:f.textSecondary},children:"Email"}),r.jsxs("div",{className:"input-container",children:[r.jsx(pe,{size:18,style:{color:f.textTertiary},"aria-hidden":"true"}),r.jsx("input",{type:"email",value:i.email,onChange:E=>o(C=>({...C,email:E.target.value})),placeholder:"Enter your email",style:{backgroundColor:f.surfaceLight,color:f.textPrimary,borderColor:f.border},required:!0,"aria-required":"true","aria-label":"Email address"})]})]}),a&&r.jsxs("div",{className:"form-group",children:[r.jsx("label",{style:{color:f.textSecondary},children:"OTP"}),r.jsxs("div",{className:"input-container",children:[r.jsx(er,{size:18,style:{color:f.textTertiary},"aria-hidden":"true"}),r.jsx("input",{type:"text",value:i.otp,onChange:E=>o(C=>({...C,otp:E.target.value})),placeholder:"Enter OTP",style:{backgroundColor:f.surfaceLight,color:f.textPrimary,borderColor:f.border},required:!0,"aria-required":"true","aria-label":"One-time password"})]})]}),r.jsx("div",{className:"modal-actions",children:a?r.jsxs("button",{type:"submit",disabled:c,className:"btn-primary",style:{background:`linear-gradient(to right, ${f.accent}, ${f.accentHover})`,opacity:c?.7:1},"aria-label":c?"Verifying email":"Verify email",children:[c?r.jsx(se,{size:16,className:"spinner","aria-hidden":"true"}):r.jsx(de,{size:16,"aria-hidden":"true"}),c?"Verifying...":"Verify Email"]}):r.jsxs("button",{type:"button",onClick:s,disabled:c,className:"btn-primary",style:{background:`linear-gradient(to right, ${f.accent}, ${f.accentHover})`,opacity:c?.7:1},"aria-label":c?"Sending OTP":"Send OTP",children:[c?r.jsx(se,{size:16,className:"spinner","aria-hidden":"true"}):r.jsx(ot,{size:16,"aria-hidden":"true"}),c?"Sending...":"Send OTP"]})})]})]}),r.jsx("style",{children:`
353
- .modal-overlay {
354
- position: fixed;
355
- top: 0;
356
- left: 0;
357
- right: 0;
358
- bottom: 0;
359
- display: flex;
360
- align-items: center;
361
- justify-content: center;
362
- z-index: 100;
363
- padding: 20px;
364
- }
365
-
366
- .verify-email-modal {
367
- width: 100%;
368
- max-width: 440px;
369
- border-radius: 16px;
370
- padding: 24px;
371
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
372
- backdrop-filter: blur(8px);
373
- }
374
-
375
- .modal-header {
376
- display: flex;
377
- align-items: center;
378
- justify-content: space-between;
379
- margin-bottom: 24px;
380
- }
381
-
382
- .modal-header h3 {
383
- margin: 0;
384
- font-size: 20px;
385
- font-weight: 600;
386
- }
387
-
388
- .close-btn {
389
- background: none;
390
- border: none;
391
- cursor: pointer;
392
- padding: 4px;
393
- border-radius: 4px;
394
- transition: background-color 0.2s ease;
395
- display: flex;
396
- align-items: center;
397
- justify-content: center;
398
- }
399
-
400
- .close-btn:hover {
401
- background-color: ${x?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"};
402
- }
403
-
404
- .verify-form {
405
- display: flex;
406
- flex-direction: column;
407
- gap: 20px;
408
- }
409
-
410
- .form-group {
411
- display: flex;
412
- flex-direction: column;
413
- gap: 8px;
414
- }
415
-
416
- .form-group label {
417
- font-size: 14px;
418
- font-weight: 500;
419
- }
420
-
421
- .input-container {
422
- position: relative;
423
- display: flex;
424
- align-items: center;
425
- }
426
-
427
- .input-container svg {
428
- position: absolute;
429
- left: 12px;
430
- pointer-events: none;
431
- }
432
-
433
- .input-container input {
434
- width: 100%;
435
- padding: 12px 12px 12px 40px;
436
- border-radius: 8px;
437
- border: 1px solid;
438
- font-size: 14px;
439
- outline: none;
440
- transition: border-color 0.2s ease;
441
- background-color: transparent;
442
- }
443
-
444
- .input-container input:focus {
445
- border-color: ${f.accent};
446
- box-shadow: 0 0 0 3px ${f.accent}20;
447
- }
448
-
449
- .modal-actions {
450
- display: flex;
451
- gap: 12px;
452
- }
453
-
454
- .modal-actions .btn-primary {
455
- flex: 1;
456
- padding: 12px 20px;
457
- border: none;
458
- border-radius: 8px;
459
- color: white;
460
- font-weight: 500;
461
- cursor: pointer;
462
- transition: all 0.2s ease;
463
- display: flex;
464
- align-items: center;
465
- justify-content: center;
466
- gap: 8px;
467
- font-size: 14px;
468
- }
469
-
470
- .modal-actions .btn-primary:hover:not(:disabled) {
471
- transform: translateY(-1px);
472
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
473
- }
474
-
475
- .modal-actions .btn-primary:disabled {
476
- opacity: 0.6;
477
- cursor: not-allowed;
478
- transform: none;
479
- }
480
-
481
- .spinner {
482
- animation: spin 1s linear infinite;
483
- }
484
-
485
- @keyframes spin {
486
- from { transform: rotate(0deg); }
487
- to { transform: rotate(360deg); }
488
- }
489
-
490
- @media (prefers-reduced-motion: reduce) {
491
- .close-btn, .modal-actions .btn-primary {
492
- transition: none;
493
- }
494
-
495
- .spinner {
496
- animation: none;
497
- }
498
- }
499
- `})]})},ss=({darkMode:t=!0,homeUrl:e,onLogout:n,onVerify:s,primaryColor:i="#00C212"})=>{const o=ge(),[a,c]=S.useState(null),[d,f]=S.useState(),[x,y]=S.useState(!0),[E,C]=S.useState(!1),[u,w]=S.useState(!1),[h,R]=S.useState(!1),[T,g]=S.useState(!1),[z,D]=S.useState(!1),[b,j]=S.useState(!1),[q,O]=S.useState(!1),[G,W]=S.useState(!1),[I,X]=S.useState(null),[P,A]=S.useState(!1),[M,K]=S.useState({email:"",otp:""}),[H,F]=S.useState(!1),[J,l]=S.useState(!1);S.useEffect(()=>{if(typeof window<"u"){const v=()=>c(window.innerWidth);return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)}},[]);const m=(v,U)=>{X({type:v,message:U}),setTimeout(()=>X(null),3e3)},k=()=>{W(!0);const v=setTimeout(()=>{O(!1),W(!1)},150);return()=>clearTimeout(v)};S.useEffect(()=>{const v=U=>{const V=document.querySelector(".dropdown-container");V&&!V.contains(U.target)&&k()};return q&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[q]);const N=async()=>{if(!M.email||!/\S+@\S+\.\S+/.test(M.email)){m("error","Please enter a valid email");return}if(!d?.id){m("error","User not found. Cannot send OTP.");return}try{l(!0);const v=await o.requestEmailVerificationOTP({userId:d.id,email:M.email}),U=v?.data?.success??v?.success,V=v?.data?.message??v?.message;U?(m("success",V||"OTP sent to email!"),F(!0)):m("error",V||"Failed to send OTP")}catch(v){const U=v?.response?.data?.message||v?.message||"Server error";m("error",U)}finally{l(!1)}},ne=async v=>{if(v.preventDefault(),!M.email||!M.otp){m("error","Please fill in all fields");return}if(!d){m("error","User not found");return}try{l(!0);const U=await o.verifyEmail({email:M.email,otp:M.otp}),V=U?.data?.success??U?.success,Q=U?.data?.message??U?.message;if(V){m("success",Q||"Email verified!");const ue={...d,isVerified:!0};f(ue),typeof s=="function"&&s(ue),K({email:ue.email,otp:""}),F(!1),j?.(!1)}else m("error",Q||"Verification failed")}catch(U){const V=U?.response?.data?.message||U?.message||"Something went wrong";m("error",V)}finally{l(!1)}},le=async v=>{if(!d)return!1;try{const U=await o.updateUser({userId:d.id,avatarUrl:v});if(U?.success){const V={...d,...U.user,avatarUrl:v};return f(V),m("success","Avatar updated successfully!"),!0}return m("error",U?.message||"Failed to update avatar"),!1}catch(U){return console.error("Avatar update error:",U),m("error","Failed to update avatar"),!1}},B=async()=>{if(d){w(!0);try{const v=d.email,U=await o.updateUser({userId:d.id,...d});if(U.success&&U.user){const V=U.user.email!==v,Q={...d,...U.user,isVerified:V?!1:d.isVerified};f(Q),localStorage.setItem("userInfo",JSON.stringify(Q)),m("success",V?"Email updated. Please verify your new email.":"Profile updated successfully"),C(!1)}else m("error",U.message||"Update failed")}catch(v){console.error(v),m("error","Update failed")}finally{w(!1)}}},ce=async v=>{try{const U=await o.checkIfUserExists(v);U?.success===!0&&U?.exists===!1&&(console.warn("❌ User does not exist on server. Clearing session..."),localStorage.removeItem("userInfo"),f(null))}catch(U){console.error("⚠️ User validation request failed:",U)}};S.useEffect(()=>{(async()=>{try{y(!0);const U=await o.checkUserSession();if(U.user?.id){const V=U.user.id,Q=await o.getUserProfile({userId:V});if(Q.user){const ue=Q.user;f(ue),ce(V)}else f(null),localStorage.removeItem("userInfo")}else f(null),localStorage.removeItem("userInfo")}catch(U){console.error("User init failed:",U),f(null),localStorage.removeItem("userInfo")}finally{y(!1)}})()},[]),S.useEffect(()=>{d?.email&&K(v=>({...v,email:d.email}))},[d?.email]);const je=(v,U)=>{let V=parseInt(v.replace("#",""),16),Q=(V>>16)+U,ue=(V>>8&255)+U,lt=(V&255)+U;return Q=Math.min(255,Math.max(0,Q)),ue=Math.min(255,Math.max(0,ue)),lt=Math.min(255,Math.max(0,lt)),`#${(lt|ue<<8|Q<<16).toString(16).padStart(6,"0")}`},_=t?{background:"#000000",surface:"#09090b",surfaceLight:"#27272a",surfaceLighter:"#3f3f46",textPrimary:"#ffffff",textSecondary:"#d4d4d8",textTertiary:"#a1a1aa",accent:i,accentHover:je(i,-15),success:"#10b981",error:"#ef4444",border:"#27272a",warning:"#f59e0b"}:{background:"#ffffff",surface:"#fafafa",surfaceLight:"#f4f4f5",surfaceLighter:"#e4e4e7",textPrimary:"#18181b",textSecondary:"#52525b",textTertiary:"#71717a",accent:i,accentHover:je(i,-15),success:"#10b981",error:"#ef4444",border:"#e4e4e7",warning:"#d97706"};if(x)return r.jsx("div",{style:{width:"100%",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center",color:_.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif"},children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px",textAlign:"center"},children:[r.jsx(se,{size:40,color:_.accent,style:{animation:"spin 1s linear infinite"},"aria-hidden":"true"}),r.jsx("p",{style:{color:_.textTertiary,margin:0},children:"Loading your profile..."})]})});if(!d)return r.jsx("div",{style:{width:"100%",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center",color:_.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif"},children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",textAlign:"center"},children:[r.jsx(oe,{size:40,color:_.error,"aria-hidden":"true"}),r.jsx("p",{style:{color:_.textTertiary,margin:0},children:"No profile found. Please log in again."})]})});const as=[{label:"Username",value:d.username||"Not set",name:"username",type:"text",icon:me,readonly:!0},{label:"Full Name",value:d.name,name:"name",type:"text",icon:me},{label:"Email Address",value:d.email,name:"email",type:"email",icon:pe},{label:"Role",value:d.role||"user",name:"role",type:"text",icon:at,readonly:!0},{label:"Phone Number",value:d.phone||"Not set",name:"phone",type:"tel",icon:Hn},{label:"Address",value:d.address||"Not provided",name:"address",type:"text",icon:Wn}];return r.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:_.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",lineHeight:1.5,minHeight:"80vh"},children:[I&&r.jsxs("div",{style:{position:"fixed",top:"20px",right:"20px",padding:"12px 24px",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",backdropFilter:"blur(8px)",border:"1px solid",zIndex:1e3,display:"flex",alignItems:"center",gap:"8px",fontSize:"12px",fontWeight:500,maxWidth:"400px",animation:"slideIn 0.3s ease-out",...I.type==="success"?{backgroundColor:t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)",borderColor:t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)",color:t?"#34d399":"#059669"}:{backgroundColor:t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)",borderColor:t?"rgba(239, 68, 68, 0.3)":"rgba(239, 68, 68, 0.2)",color:t?"#f87171":"#dc2626"}},role:"alert","aria-live":"polite",children:[I.type==="success"?r.jsx(de,{size:20,"aria-hidden":"true"}):r.jsx(oe,{size:20,"aria-hidden":"true"}),I.message]}),r.jsx("div",{style:{maxWidth:"1200px",margin:"0 auto",width:"100%",boxSizing:"border-box"},children:r.jsxs("div",{style:{display:"grid",gap:"24px",gridTemplateColumns:"1fr",...a&&window.innerWidth>=1024&&{gridTemplateColumns:"1fr 2fr",gap:"10px"},...a&&window.innerWidth>=768&&a&&window.innerWidth<1024&&{gap:"10px"},...a&&window.innerWidth>=600&&a&&window.innerWidth<768&&{gap:"28px"}},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",height:"100%"},children:[r.jsxs("section",{style:{backgroundColor:_.surface,borderRadius:"16px",position:"relative",padding:"24px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flex:1,minHeight:"300px"},children:[e&&r.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",style:{position:"absolute",top:"18px",left:"18px"},children:r.jsx(Ln,{size:20,style:{color:t?"#ffffff":"#000000"}})}),r.jsxs("div",{style:{position:"relative",display:"inline-block",marginBottom:"16px"},children:[r.jsx("img",{src:d.avatarUrl||`https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(d.name)}`,alt:`Profile avatar of ${d.name}`,style:{width:"128px",height:"128px",borderRadius:"50%",objectFit:"cover",boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.3)",border:`3px solid ${_.border}`},width:128,height:128,loading:"eager"}),r.jsx("button",{onClick:()=>R(!0),style:{position:"absolute",bottom:"8px",right:"8px",backgroundColor:_.accent,color:"white",padding:"8px",borderRadius:"50%",border:"none",cursor:"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px"},"aria-label":"Change profile picture",children:r.jsx(et,{size:16,"aria-hidden":"true"})})]}),r.jsx("h2",{style:{fontSize:"24px",fontWeight:600,margin:"0 0 4px 0",color:_.textPrimary},children:d.name}),d.username&&r.jsxs("h2",{style:{fontSize:"18px",fontWeight:600,margin:"0 0 4px 0",color:_.textTertiary},children:["@",d.username||"Not set"]}),r.jsx("p",{style:{color:_.textTertiary,margin:"0 0 8px 0"},children:d.email}),r.jsxs("div",{style:{backgroundColor:d.isVerified?t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)":t?"rgba(245, 158, 11, 0.1)":"rgba(245, 158, 11, 0.05)",color:d.isVerified?_.success:_.warning,border:`1px solid ${d.isVerified?t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)":t?"rgba(245, 158, 11, 0.3)":"rgba(245, 158, 11, 0.2)"}`,padding:"6px 12px",borderRadius:"20px",fontSize:"12px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"6px",marginTop:"8px"},children:[d.isVerified?r.jsx(de,{size:16,"aria-hidden":"true"}):r.jsx(oe,{size:16,"aria-hidden":"true"}),d.isVerified?"Email Verified":"Not Verified"]})]}),r.jsx("nav",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:E?r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>C(!1),style:{backgroundColor:_.surfaceLight,border:`1px solid ${_.border}`,color:_.textPrimary,padding:"10px 20px",borderRadius:"6px",borderStyle:"solid",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",textDecoration:"none",minHeight:"36px",flex:a&&window.innerWidth<1024?"1":"auto"},children:[r.jsx(Re,{size:16,"aria-hidden":"true"}),"Cancel"]}),r.jsxs("button",{onClick:B,disabled:u,style:{background:`linear-gradient(to right, ${_.accent}, ${_.accentHover})`,opacity:u?.7:1,color:"white",padding:"10px 20px",borderRadius:"6px",border:"none",cursor:u?"not-allowed":"pointer",transition:"all 0.2s ease",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",textDecoration:"none",minHeight:"36px",flex:a&&window.innerWidth<1024?"1":"auto"},children:[u?r.jsx(se,{size:16,style:{animation:"spin 1s linear infinite"},"aria-hidden":"true"}):r.jsx(Vn,{size:16,"aria-hidden":"true"}),u?"Saving...":"Save Changes"]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>C(!0),style:{background:`linear-gradient(to right, ${_.accent}, ${_.accentHover})`,color:"white",padding:"10px 20px",borderRadius:"6px",border:"none",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",textDecoration:"none",minHeight:"36px",flex:a&&window.innerWidth<1024?"1":"auto"},children:[r.jsx(Bn,{size:16,"aria-hidden":"true"}),"Edit Profile"]}),!d.isVerified&&r.jsxs("button",{onClick:()=>j(!0),disabled:P,style:{background:"linear-gradient(to right, #fbbf24, #f59e0b)",color:"white",padding:"10px 20px",borderRadius:"6px",border:"none",cursor:P?"not-allowed":"pointer",transition:"all 0.2s ease",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",minHeight:"36px",opacity:P?.7:1,flex:a&&window.innerWidth<1024?"1":"auto"},children:[P?r.jsx(se,{size:14,style:{animation:"spin 1s linear infinite"},"aria-hidden":"true"}):r.jsx(ot,{size:14,"aria-hidden":"true"}),P?"Sending...":"Verify Email"]}),r.jsxs("div",{style:{position:"relative"},children:[r.jsxs("button",{style:{backgroundColor:_.surfaceLight,color:_.textPrimary,padding:"10px 20px",borderRadius:"6px",border:"none",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",textDecoration:"none",minHeight:"36px",width:"100%",boxSizing:"border-box"},onClick:()=>O(!q),children:[r.jsx(Fn,{size:16,"aria-hidden":"true"}),"More Actions"]}),q&&r.jsxs("div",{className:`dropdown-container ${G?"closing":""}`,style:{position:"absolute",bottom:"100%",left:0,right:0,backgroundColor:_.surface,border:`1px solid ${_.border}`,borderRadius:"12px 12px 0 0",boxShadow:"0 -8px 24px rgba(0, 0, 0, 0.25)",zIndex:200,marginBottom:"6px",overflow:"hidden",animation:`${G?"drawerSlideDown":"drawerSlideUp"} 0.25s ease-out forwards`},children:[r.jsxs("button",{onClick:()=>{g(!0),k()},style:{width:"100%",padding:"14px 18px",backgroundColor:"transparent",border:"none",color:_.textPrimary,cursor:"pointer",transition:"all 0.2s ease",fontSize:"13px",fontWeight:500,display:"flex",alignItems:"center",gap:"8px",textAlign:"left"},onMouseEnter:v=>v.currentTarget.style.backgroundColor=_.surfaceLight,onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[r.jsx(st,{size:14,"aria-hidden":"true"}),"Change Password"]}),n&&r.jsxs("button",{onClick:()=>{n(),k()},style:{width:"100%",padding:"14px 18px",backgroundColor:"transparent",border:"none",color:t?"#fca5a5":"#dc2626",cursor:"pointer",transition:"all 0.2s ease",fontSize:"13px",fontWeight:500,display:"flex",alignItems:"center",gap:"8px",textAlign:"left"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)"},onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[r.jsx(it,{size:14,"aria-hidden":"true"}),"Logout"]}),r.jsxs("button",{onClick:()=>{D(!0),k()},style:{width:"100%",padding:"14px 18px",backgroundColor:"transparent",border:"none",color:"#ef4444",cursor:"pointer",transition:"all 0.2s ease",fontSize:"13px",fontWeight:600,display:"flex",alignItems:"center",gap:"8px",textAlign:"left"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)"},onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[r.jsx(Me,{size:14,"aria-hidden":"true"}),"Delete Account"]})]})]})]})})]}),r.jsxs("div",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsxs("section",{style:{backgroundColor:_.surface,borderRadius:"16px",padding:"24px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},children:[r.jsxs("h2",{style:{fontSize:"20px",fontWeight:600,margin:"0 0 24px 0",color:_.textSecondary,display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(me,{size:20,"aria-hidden":"true"}),"Personal Information"]}),r.jsx("div",{style:{display:"grid",gap:"20px",gridTemplateColumns:"1fr",...a&&window.innerWidth>=600&&{gridTemplateColumns:"1fr 1fr",gap:"20px"}},children:as.map(v=>{const U=v.icon;return r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[r.jsxs("label",{style:{color:_.textTertiary,fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(U,{size:16,"aria-hidden":"true"}),v.label]}),E&&!v.readonly?r.jsx("input",{type:v.type,name:v.name,value:d[v.name],onChange:V=>f(Q=>Q&&{...Q,[V.target.name]:V.target.value}),style:{padding:"12px",borderRadius:"8px",border:`1px solid ${i}`,backgroundColor:"transparent",color:_.textPrimary,fontSize:"12px",outline:"none",transition:"border-color 0.2s ease",minHeight:"44px",width:"100%",boxSizing:"border-box",opacity:v.readonly?.7:1},placeholder:`Enter ${v.label.toLowerCase()}`,"aria-label":v.label}):r.jsx("div",{style:{padding:"12px",borderRadius:"8px",border:"1px solid transparent",fontSize:"12px",minHeight:"44px",display:"flex",alignItems:"center",boxSizing:"border-box",color:_.textPrimary,backgroundColor:t?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},children:v.value})]},v.name)})})]}),r.jsxs("section",{style:{backgroundColor:_.surface,borderRadius:"16px",padding:"30px 24px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},children:[r.jsxs("h2",{style:{fontSize:"20px",fontWeight:600,margin:"0 0 24px 0",color:_.textSecondary,display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(at,{size:20,"aria-hidden":"true"}),"Security Status"]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",color:_.textSecondary},children:[r.jsx(pe,{size:16,"aria-hidden":"true"}),r.jsx("span",{children:"Email Verification"})]}),r.jsx("div",{style:{padding:"6px 12px",borderRadius:"8px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px",...d.isVerified?{backgroundColor:t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)",color:_.success,border:`1px solid ${t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)"}`}:{backgroundColor:t?"rgba(245, 158, 11, 0.1)":"rgba(245, 158, 11, 0.05)",color:_.warning,border:`1px solid ${t?"rgba(245, 158, 11, 0.3)":"rgba(245, 158, 11, 0.2)"}`}},children:d.isVerified?r.jsxs(r.Fragment,{children:[r.jsx(de,{size:16,"aria-hidden":"true"}),"Verified"]}):r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:16,"aria-hidden":"true"}),"Not Verified"]})})]}),!d.isVerified&&r.jsx("div",{style:{padding:"12px",borderRadius:"8px",backgroundColor:t?"rgba(100, 100, 100, 0.1)":"rgba(0, 0, 0, 0.05)"},children:r.jsx("p",{style:{color:_.textTertiary,fontSize:"12px",margin:0},children:"Verify your email to unlock all features and enhance your account security."})})]})]})]})]})}),r.jsx(ts,{isOpen:h,onClose:()=>{R(!1)},onUpdate:le,colors:_}),r.jsx(rs,{userId:d.id,isOpen:T,onClose:()=>g(!1),onSuccess:v=>m("success",v),onError:v=>m("error",v),colors:_}),r.jsx(es,{userId:d.id,isOpen:z,onClose:()=>D(!1),onSuccess:v=>m("success",v),onError:v=>m("error",v),colors:_}),r.jsx(ns,{isOpen:b,onClose:()=>{j(!1),F(!1),K({email:d?.email||"",otp:""})},onVerify:ne,onSendOTP:N,verifyFormData:M,setVerifyFormData:K,otpSent:H,verifying:J,user:d,colors:_,darkMode:t}),r.jsx("style",{children:`
500
- @keyframes slideIn {
501
- from {
502
- transform: translateX(100%);
503
- opacity: 0;
504
- }
505
- to {
506
- transform: translateX(0);
507
- opacity: 1;
508
- }
509
- }
510
-
511
- @keyframes spin {
512
- from {
513
- transform: rotate(0deg);
514
- }
515
- to {
516
- transform: rotate(360deg);
517
- }
518
- }
519
-
202
+ */const rt=K("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Mr=y.createContext(null),Wn=({authix:t,children:e})=>s.jsx(Mr.Provider,{value:t,children:e}),Fe=()=>{const t=y.useContext(Mr);if(!t)throw new Error("useAuthix must be used inside <AuthixProvider />");return t},Jn=({logoUrl:t,logoLinkUrl:e,title:r="Create Your Account",subtitle:n="Join our platform today",primaryColor:a="#00C214",gradient:o="linear-gradient(135deg, #22c55e, #00C214)",darkMode:i=!0,showAvatar:l=!1,roles:m=[],showRoleSelector:u=!1,loginUrl:f,onSuccess:b,onError:j})=>{const P=Fe(),p={name:"",email:"",password:"",role:m.length?m[0]:"user",...l&&{avatarUrl:""}},[h,g]=y.useState(p),[_,B]=y.useState(!1),[k,q]=y.useState(!1),[F,X]=y.useState(null),[R,M]=y.useState({}),[H,se]=y.useState(!1),Q=i?"text-white":"text-gray-900",J=i?"text-gray-400":"text-gray-600",G=i?"bg-white/5":"bg-black/[0.02]",W=i?"border-white/10":"border-black/10",N="border-red-500",$=i?"bg-black":"bg-white";y.useEffect(()=>{if(typeof window<"u"){const x=()=>se(window.innerWidth<768);return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)}},[]);const A=x=>{const{name:w,value:E}=x.target;g(V=>({...V,[w]:E})),R[w]&&M(V=>({...V,[w]:void 0}))},O=()=>{const x={};return h.name.trim()||(x.name="Name is required"),h.email.trim()?/\S+@\S+\.\S+/.test(h.email)||(x.email="Invalid email address"):x.email="Email is required",h.password?h.password.length<6&&(x.password="Password must be at least 6 characters"):x.password="Password is required",M(x),Object.keys(x).length===0},D=async x=>{if(x.preventDefault(),!!O()){q(!0),X(null);try{const w={name:h.name,email:h.email,password:h.password,role:h.role,...h.avatarUrl?{avatarUrl:h.avatarUrl}:{}},E=await P.signupUser(w);E.success?(X({type:"success",text:E.message||"Account created successfully!"}),b?.(E.user)):(X({type:"error",text:E.message||"Signup failed"}),j?.(E))}catch(w){X({type:"error",text:w.message||"Signup failed. Please try again."}),j?.(w)}finally{q(!1)}}},Y={width:"100%",padding:H?"10px 14px 10px 44px":"10px 16px 10px 44px",outline:"none",boxSizing:"border-box"},d=i?"text-zinc-300":"text-zinc-700";return s.jsx("div",{className:"flex justify-center items-center",children:s.jsxs("div",{className:`${$} flex flex-col rounded-[10px] ${H?"min-w-[320px] max-w-[340px] p-[30px_24px]":"min-w-[380px] max-w-[390px] p-[30px_28px]"} w-full`,children:[s.jsxs("div",{className:"flex flex-col items-center text-center mb-[10px]",children:[t?s.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:s.jsx("img",{src:t,alt:"Logo",className:"h-[50px] w-[50px] mb-[10px]"})}):s.jsx(Je,{size:40,color:a,className:"mb-[10px]"}),s.jsx("h2",{className:`text-[24px] font-bold ${Q} m-0`,children:r}),s.jsx("p",{className:`text-[14px] ${J}`,children:n})]}),l&&h.avatarUrl&&s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx("img",{src:h.avatarUrl,alt:"Avatar Preview",className:"w-[60px] h-[60px] rounded-full object-cover border-2",style:{borderColor:`${a}30`},onError:x=>{const w=x.target;w.style.display="none"}})}),s.jsxs("form",{onSubmit:D,className:"flex flex-col gap-[14px]",children:[u&&m&&m.length===2&&s.jsxs("div",{className:"flex flex-col gap-[4px]",children:[s.jsx("label",{className:`text-xs ${d}`,children:"Select Role"}),s.jsxs("div",{className:`relative flex rounded-[10px] border ${W} ${G} overflow-hidden cursor-pointer h-[42px]`,children:[s.jsx("div",{className:"absolute top-0 left-0 w-1/2 h-full rounded-[10px] transition-all duration-300 ease-in-out z-0",style:{backgroundColor:i?"#000000":"#ffffff",boxShadow:i?"0 1px 3px rgba(255,255,255,0.05)":"0 1px 3px rgba(0,0,0,0.1)",transform:h.role===m[1]?"translateX(100%)":"translateX(0)"}}),s.jsx("button",{type:"button",onClick:()=>g(x=>({...x,role:m[0]})),className:"flex-1 z-10 border-none bg-transparent flex items-center justify-center transition-colors duration-200 ease-in-out",style:{color:h.role===m[0]?a:i?"#9ca3af":"#6b7280",fontWeight:h.role===m[0]?600:500,fontSize:"12px"},children:m[0].charAt(0).toUpperCase()+m[0].slice(1)}),s.jsx("button",{type:"button",onClick:()=>g(x=>({...x,role:m[1]})),className:"flex-1 z-10 border-none bg-transparent flex items-center justify-center transition-colors duration-200 ease-in-out",style:{color:h.role===m[1]?a:i?"#9ca3af":"#6b7280",fontWeight:h.role===m[1]?600:500,fontSize:"12px"},children:m[1].charAt(0).toUpperCase()+m[1].slice(1)})]})]}),s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("label",{htmlFor:"signup-name",className:`text-xs ${d}`,children:"Full Name"}),s.jsxs("div",{className:"relative",children:[s.jsx(Je,{size:20,className:`absolute left-[14px] top-1/2 -translate-y-1/2 ${J}`,style:{color:i?"#a1a1aa":"#6b7280"}}),s.jsx("input",{id:"signup-name",type:"text",name:"name",placeholder:"Enter your full name",value:h.name,onChange:A,className:`${G} ${Q} ${H?"py-[10px] pl-[44px] pr-[14px]":"py-[10px] pl-[44px] pr-[16px]"} border rounded-[10px] text-[13px] transition-all duration-200 ease-in-out ${R.name?N:W}`,style:Y})]}),R.name&&s.jsx("span",{className:"text-red-500 text-[12px] mt-[2px]",children:R.name})]}),s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("label",{htmlFor:"signup-email",className:`text-xs ${d}`,children:"Email Address"}),s.jsxs("div",{className:"relative",children:[s.jsx(Le,{size:20,className:`absolute left-[14px] top-1/2 -translate-y-1/2 ${J}`,style:{color:i?"#a1a1aa":"#6b7280"}}),s.jsx("input",{id:"signup-email",type:"email",name:"email",placeholder:"Enter your email address",value:h.email,onChange:A,className:`${G} ${Q} ${H?"py-[10px] pl-[44px] pr-[14px]":"py-[10px] pl-[44px] pr-[16px]"} border rounded-[10px] text-[13px] transition-all duration-200 ease-in-out ${R.email?N:W}`,style:Y})]}),R.email&&s.jsx("span",{className:"text-red-500 text-[12px] mt-[2px]",children:R.email})]}),s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("label",{htmlFor:"signup-password",className:`text-xs ${d}`,children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(We,{size:20,className:`absolute left-[14px] top-1/2 -translate-y-1/2 ${J}`,style:{color:i?"#a1a1aa":"#6b7280"}}),s.jsx("input",{id:"signup-password",type:_?"text":"password",name:"password",placeholder:"Create a secure password",value:h.password,onChange:A,className:`${G} ${Q} ${H?"py-[10px] pl-[44px] pr-[14px]":"py-[10px] pl-[44px] pr-[16px]"} border rounded-[10px] text-[13px] transition-all duration-200 ease-in-out ${R.password?N:W}`,style:Y}),s.jsx("button",{type:"button",onClick:()=>B(!_),className:"absolute right-[14px] top-1/2 -translate-y-1/2 bg-transparent border-none cursor-pointer p-1",style:{color:i?"#a1a1aa":"#6b7280"},children:_?s.jsx(Lt,{size:20}):s.jsx(Ft,{size:20})})]}),R.password&&s.jsx("span",{className:"text-red-500 text-[12px] mt-[2px]",children:R.password})]}),l&&s.jsxs("div",{className:"flex flex-col gap-[4px]",children:[s.jsx("label",{htmlFor:"signup-avatar",className:`text-xs ${d}`,children:"Avatar URL (Optional)"}),s.jsxs("div",{className:"relative",children:[s.jsx(qr,{size:20,className:`absolute left-[14px] top-1/2 -translate-y-1/2 ${J}`,style:{color:i?"#a1a1aa":"#6b7280"}}),s.jsx("input",{id:"signup-avatar",type:"url",name:"avatarUrl",placeholder:"Paste your avatar image URL",value:h.avatarUrl||"",onChange:A,className:`${G} ${Q} ${H?"py-[10px] pl-[44px] pr-[14px]":"py-[10px] pl-[44px] pr-[16px]"} border ${W} rounded-[10px] text-[13px] transition-all duration-200 ease-in-out`,style:Y})]})]}),f&&s.jsx("div",{className:"flex justify-between text-[13px]",children:s.jsx("a",{href:f,className:"no-underline font-medium",style:{color:a},children:"Already have an account?"})}),F&&s.jsxs("div",{className:"p-3 rounded-[12px] text-[12px] flex items-start gap-[10px] border",style:{backgroundColor:F.type==="success"?`${a}15`:"rgba(239,68,68,0.1)",borderColor:F.type==="success"?`${a}30`:"rgba(239,68,68,0.3)",color:F.type==="success"?a:"#ef4444"},children:[F.type==="success"?s.jsx(Ee,{size:16}):s.jsx(be,{size:16}),s.jsx("span",{children:F.text})]}),s.jsx("button",{type:"submit",disabled:k,className:`py-2.5 text-white border-none rounded-[10px] text-[14px] font-semibold flex items-center justify-center gap-2 ${k?"opacity-70 cursor-not-allowed":"cursor-pointer"}`,style:{backgroundColor:a},children:k?s.jsxs(s.Fragment,{children:[s.jsx(Vr,{size:18,className:"animate-spin"}),"Creating Account..."]}):"Create Account"})]})]})})},Yn=({logoUrl:t,logoLinkUrl:e,title:r="Sign In to Your Account",subtitle:n="Welcome back! Please enter your details",primaryColor:a="#00C214",darkMode:o=!0,signupUrl:i,onSuccess:l,onError:m})=>{const u=Fe(),[f,b]=y.useState("login"),[j,P]=y.useState(1),[p,h]=y.useState(!1),[g,_]=y.useState(!1),[B,k]=y.useState(null),[q,F]=y.useState(""),[X,R]=y.useState(""),[M,H]=y.useState({email:"",otp:"",newPassword:""}),[se,Q]=y.useState(!1),J=o?"text-white":"text-gray-900",G=o?"text-gray-400":"text-gray-600",W=o?"bg-white/5":"bg-black/[0.02]",N=o?"border-white/10":"border-black/10",$=o?"bg-black":"bg-white",A={"--authix-primary":a};y.useEffect(()=>{if(typeof window<"u"){const x=()=>Q(window.innerWidth<768);return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)}},[]);const O=async x=>{x.preventDefault(),_(!0),k(null);try{const w=await u.loginUser({email:q,password:X}),{user:E}=w;if(!E)throw new Error(w.message||"Login failed");if(typeof document<"u"){const V="a_s_b",ce="true",C=new Date;C.setTime(C.getTime()+1440*60*1e3),document.cookie=`${V}=${ce}; path=/; expires=${C.toUTCString()}; SameSite=Lax`}k({type:"success",text:`Welcome ${E.name}`}),l?.(E)}catch(w){const E=w.message||"Login failed";k({type:"error",text:E}),m?.(w)}finally{_(!1)}},D=x=>{H({...M,[x.target.name]:x.target.value})},Y=async x=>{x.preventDefault(),_(!0),k(null);try{const w=await u.requestResetUserPasswordOTP({email:M.email});w.success?(P(2),k({type:"success",text:w.message||"OTP sent to your email"})):k({type:"error",text:w.message||"Failed to send OTP"})}catch(w){k({type:"error",text:w.message||"Something went wrong"})}finally{_(!1)}},d=async x=>{x.preventDefault(),_(!0),k(null);try{const w=await u.resetUserPassword({email:M.email,otp:M.otp,newPassword:M.newPassword});w.success?(k({type:"success",text:w.message||"Password reset successfully!"}),P(1),H({email:"",otp:"",newPassword:""}),b("login")):k({type:"error",text:w.message||"Reset failed"})}catch(w){k({type:"error",text:w.message||"Something went wrong"})}finally{_(!1)}};return s.jsx("div",{className:"flex justify-center items-center",style:A,children:s.jsxs("div",{className:`${$} flex flex-col rounded-[10px] ${se?"min-w-[320px] max-w-[340px] p-[28px_22px]":"min-w-[380px] max-w-[390px] p-[30px_28px]"} w-full`,children:[s.jsxs("div",{className:"flex flex-col items-center text-center mb-5",children:[t?s.jsx("a",{href:e||"/",children:s.jsx("img",{src:t,className:"h-[46px] w-[46px] mb-2"})}):s.jsx(Je,{size:36,color:a,className:"mb-2"}),s.jsx("h2",{className:`text-[22px] font-bold ${J}`,children:f==="login"?r:j===1?"Forgot Password":"Reset Password"}),s.jsx("p",{className:`text-[13px] ${G}`,children:f==="login"?n:"Follow the steps to reset your password"})]}),B&&s.jsxs("div",{className:`flex items-center gap-2 text-[12px] px-3 py-2 rounded-[8px] mb-3 border
203
+ ${B.type==="success"?"bg-green-500/10 text-green-400 border-green-500/20":"bg-red-500/10 text-red-400 border-red-500/20"}`,children:[B.type==="success"?s.jsx(Ee,{size:14}):s.jsx(be,{size:14}),s.jsx("span",{children:B.text})]}),f==="login"&&s.jsxs("form",{onSubmit:O,className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("label",{className:`text-xs ${o?"text-zinc-400":"text-zinc-700"}`,children:"Email Address"}),s.jsxs("div",{className:"relative",children:[s.jsx(Le,{size:18,className:`absolute left-3 top-1/2 -translate-y-1/2 ${o?"text-zinc-500":"text-zinc-400"}`}),s.jsx("input",{id:"login-email",type:"email",value:q,onChange:x=>F(x.target.value),placeholder:"Enter your email",className:`w-full text-[13px] rounded-[10px] border outline-none transition
204
+ pl-10 pr-3 py-2.5
205
+ ${W} ${J} ${N}
206
+ focus:border-[var(--authix-primary)]
207
+ `})]})]}),s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("label",{className:`text-xs ${o?"text-zinc-400":"text-zinc-700"}`,children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(We,{size:18,className:`absolute left-3 top-1/2 -translate-y-1/2 ${o?"text-zinc-500":"text-zinc-400"}`}),s.jsx("input",{id:"login-password",type:p?"text":"password",value:X,onChange:x=>R(x.target.value),placeholder:"Enter your password",className:`w-full text-[13px] rounded-[10px] border outline-none transition
208
+ pl-10 pr-10 py-2.5
209
+ ${W} ${J} ${N}
210
+ focus:border-[var(--authix-primary)]
211
+ `}),s.jsx("button",{type:"button",onClick:()=>h(!p),className:`absolute right-3 top-1/2 -translate-y-1/2 ${o?"text-zinc-500":"text-zinc-400"}`,children:p?s.jsx(Lt,{size:18}):s.jsx(Ft,{size:18})})]})]}),s.jsxs("div",{className:"flex justify-between text-[12px]",children:[i&&s.jsx("a",{href:i,className:"font-medium",style:{color:a},children:"Create account"}),s.jsx("button",{type:"button",onClick:()=>b("forgot"),className:"font-medium",style:{color:a},children:"Forgot password?"})]}),s.jsx("button",{type:"submit",disabled:g,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-[10px] text-[14px] font-semibold text-white disabled:opacity-60",style:{backgroundColor:a},children:g?s.jsxs(s.Fragment,{children:[s.jsx(Vr,{size:16,className:"animate-spin"}),"Signing In..."]}):"Sign In"})]}),f==="forgot"&&s.jsxs("form",{onSubmit:j===1?Y:d,className:"flex flex-col gap-4",children:[j===1&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{className:"text-xs text-zinc-400",children:"Email Address"}),s.jsxs("div",{className:"relative",children:[s.jsx(Le,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500"}),s.jsx("input",{type:"email",name:"email",value:M.email,onChange:D,placeholder:"Enter your email",className:`w-full text-[13px] rounded-[10px] border pl-10 pr-3 py-2.5
212
+ ${W} ${J} ${N}
213
+ `})]})]}),j===2&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{className:"text-xs text-zinc-400",children:"OTP"}),s.jsxs("div",{className:"relative",children:[s.jsx(Dr,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500"}),s.jsx("input",{type:"text",name:"otp",placeholder:"Enter the otp",value:M.otp,onChange:D,className:"w-full text-[13px] rounded-[10px] border pl-10 pr-3 py-2.5"})]})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{className:"text-xs text-zinc-400",children:"New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(We,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500"}),s.jsx("input",{type:"password",name:"newPassword",placeholder:"Enter new password",value:M.newPassword,onChange:D,className:"w-full text-[13px] rounded-[10px] border pl-10 pr-3 py-2.5"})]})]})]}),j===1&&s.jsxs("button",{type:"button",onClick:()=>b("login"),className:"flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200 transition",children:[s.jsx(Rn,{size:14}),"Back to login"]}),s.jsx("button",{type:"submit",className:"w-full py-2.5 rounded-[10px] text-white text-[14px] font-semibold",style:{backgroundColor:a},children:j===1?"Send OTP":"Reset Password"})]})]})})},Kn=({children:t,fallback:e=null})=>{const[r,n]=y.useState("loading");y.useEffect(()=>{if(typeof window>"u")return;const l=window.document.cookie.split(";").map(m=>m.trim()).find(m=>m.startsWith("a_s_b="))?.split("=")[1]==="true";n(l?"authenticated":"unauthenticated")},[]);const a=o=>typeof o=="function"?o():o;return r==="loading"?null:r==="unauthenticated"?s.jsx(s.Fragment,{children:a(e)}):s.jsx(s.Fragment,{children:t})},Xn=({children:t,fallback:e=null})=>{const[r,n]=y.useState("loading");y.useEffect(()=>{if(typeof window>"u")return;const l=window.document.cookie.split(";").map(m=>m.trim()).find(m=>m.startsWith("a_s_b="))?.split("=")[1]==="true";n(l?"authenticated":"unauthenticated")},[]);const a=o=>typeof o=="function"?o():o;return r==="loading"?null:r==="authenticated"?s.jsx(s.Fragment,{children:a(e)}):s.jsx(s.Fragment,{children:t})},Gn=({isOpen:t,onClose:e,onSuccess:r,onError:n,userId:a,colors:o,overlayClassName:i,overlayStyle:l,modalClassName:m,modalStyle:u,headerClassName:f,headerStyle:b,iconContainerClassName:j,iconContainerStyle:P,titleClassName:p,titleStyle:h,descriptionClassName:g,descriptionStyle:_,closeButtonClassName:B,closeButtonStyle:k,warningContainerClassName:q,warningContainerStyle:F,warningIconClassName:X,warningIconStyle:R,warningContentClassName:M,warningContentStyle:H,warningItemClassName:se,warningItemStyle:Q,confirmationContainerClassName:J,confirmationContainerStyle:G,confirmationInputClassName:W,confirmationInputStyle:N,confirmationSuccessClassName:$,confirmationSuccessStyle:A,processingContainerClassName:O,processingContainerStyle:D,processingStepClassName:Y,processingStepStyle:d,processingInfoClassName:x,processingInfoStyle:w,successContainerClassName:E,successContainerStyle:V,successContentClassName:ce,successContentStyle:C,successIconClassName:oe,successIconStyle:ie,successRedirectClassName:L,successRedirectStyle:ee,actionsClassName:de,actionsStyle:we,cancelButtonClassName:Ne,cancelButtonStyle:ke,dangerButtonClassName:te,dangerButtonStyle:je,confirmButtonClassName:Pe,confirmButtonStyle:qe})=>{const S=Fe(),[ne,_e]=y.useState(!1),[he,ht]=y.useState(""),[st,Ce]=y.useState("warning"),[Te,yt]=y.useState(!1);if(y.useEffect(()=>{if(typeof window>"u")return;const Z=()=>{yt(window.innerWidth<640)};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]),!t)return null;const gt=async()=>{_e(!0),Ce("processing");try{const Z=await S.deleteUser({userId:a});Z.success?(r(Z.message||"Account deleted successfully"),Ce("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(n(Z.message||"Failed to delete account"),Ce("warning"))}catch(Z){n(Z.response?.data?.message||"Something went wrong"),Ce("warning")}finally{_e(!1)}},Ae=he.toLowerCase()==="delete my account",Mt=Z=>{Z.target===Z.currentTarget&&st!=="processing"&&st!=="success"&&e()},Ht=()=>{switch(st){case"warning":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`flex items-center justify-between mb-6 gap-4 ${f||""}`,style:b,children:[s.jsxs("div",{className:`flex items-center gap-3 flex-1 ${j||""}`,style:P,children:[s.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j||""}`,style:{background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",...P},children:s.jsx(xt,{size:20})}),s.jsx("div",{children:s.jsx("h3",{className:`m-0 text-xl font-bold leading-tight ${p||""}`,style:{color:o.textPrimary,...h},children:"Delete Account"})})]}),s.jsx("button",{onClick:e,"aria-label":"Close modal",className:`bg-transparent border-0 cursor-pointer p-2 rounded w-9 h-9 flex items-center justify-center flex-shrink-0 transition-all hover:bg-white/10 ${B||""}`,style:{color:o.textTertiary,...k},children:s.jsx(rt,{size:20})})]}),s.jsxs("div",{className:`flex gap-4 p-5 rounded-xl mb-5 ${q||""}`,style:{backgroundColor:`${o.error}15`,border:`1px solid ${o.error}30`,...F},children:[s.jsx("div",{className:`flex-shrink-0 flex items-start ${X||""}`,style:{color:o.error,...R},children:s.jsx(Br,{size:24})}),s.jsxs("div",{className:`flex-1 ${M||""}`,style:H,children:[s.jsx("h4",{className:`m-0 mb-3 text-base font-semibold ${p||""}`,style:{color:o.textPrimary,...h},children:"Before you proceed..."}),s.jsx("div",{className:`flex flex-col gap-2.5 ${M||""}`,style:H,children:[{icon:s.jsx(In,{size:16}),text:"All your data will be permanently deleted"},{icon:s.jsx(Hn,{size:16}),text:"This action cannot be reversed"},{icon:s.jsx(Dt,{size:16}),text:"You will lose access to all services"}].map((Z,Ye)=>s.jsxs("div",{className:`flex items-center gap-2.5 text-sm ${se||""}`,style:{color:o.textSecondary,...Q},children:[s.jsx("div",{className:`flex-shrink-0 ${X||""}`,style:{color:o.error,...R},children:Z.icon}),s.jsx("span",{children:Z.text})]},Ye))})]})]}),s.jsxs("div",{className:`flex gap-3 ${Te?"flex-col-reverse":"flex-row"} justify-end items-stretch ${de||""}`,style:we,children:[s.jsx("button",{onClick:e,className:`py-2.5 px-6 rounded-xl border bg-transparent text-sm font-medium cursor-pointer transition-all hover:-translate-y-0.5 ${Te?"w-full":"flex-1 min-w-[120px]"} ${Ne||""}`,style:{borderColor:o.border,color:o.textPrimary,...ke},children:"Cancel"}),s.jsxs("button",{onClick:()=>Ce("confirmation"),className:`py-2.5 px-6 rounded-xl border-none text-sm font-semibold flex items-center justify-center gap-2 transition-all hover:-translate-y-0.5 ${Te?"w-full":"flex-1 min-w-[140px]"} ${te||""}`,style:{background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)",...je},children:[s.jsx(xt,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`flex items-center gap-3 mb-6 ${f||""}`,style:b,children:[s.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j||""}`,style:{background:"linear-gradient(135deg, #f59e0b, #d97706)",color:"white",...P},children:s.jsx(Br,{size:24})}),s.jsx("div",{className:`flex-1 ${f||""}`,style:b,children:s.jsx("h3",{className:`m-0 text-xl font-bold leading-tight ${p||""}`,style:{color:o.textPrimary,...h},children:"Confirm Deletion"})})]}),s.jsxs("div",{className:`mb-6 ${J||""}`,style:G,children:[s.jsxs("p",{className:`mb-4 text-sm leading-relaxed ${g||""}`,style:{color:o.textSecondary,..._},children:["Type"," ",s.jsx("strong",{className:`${p||""}`,style:{color:o.textPrimary,...h},children:'"delete my account"'})," ","to confirm:"]}),s.jsx("input",{type:"text",value:he,onChange:Z=>ht(Z.target.value),placeholder:"delete my account",autoFocus:!0,className:`w-full py-3.5 px-4 rounded-xl border text-base outline-none transition-all focus:shadow-[0_0_0_3px_rgba(var(--accent),0.2)] ${W||""}`,style:{borderColor:Ae?o.success:o.error,backgroundColor:"transparent",color:o.textPrimary,...N},onFocus:Z=>{Z.currentTarget.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:Z=>{Z.currentTarget.style.boxShadow="none"}}),Ae&&s.jsxs("div",{className:`flex items-center gap-2 mt-2.5 text-sm font-medium ${$||""}`,style:{color:o.success,...A},children:[s.jsx(It,{size:16}),s.jsx("span",{children:"Confirmation accepted"})]})]}),s.jsxs("div",{className:`flex gap-3 flex-col-reverse justify-end items-stretch ${de||""}`,style:we,children:[s.jsx("button",{onClick:()=>{Ce("warning"),ht("")},className:`py-2.5 px-6 rounded-xl border bg-transparent text-sm font-medium cursor-pointer transition-all hover:-translate-y-0.5 ${Te?"w-full":"flex-1 min-w-[120px]"} ${Ne||""}`,style:{borderColor:o.border,color:o.textPrimary,...ke},children:"Go Back"}),s.jsxs("button",{onClick:gt,disabled:!Ae||ne,className:`py-2.5 px-6 rounded-xl border-none text-sm font-semibold flex items-center justify-center gap-2 transition-all hover:-translate-y-0.5 disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${Te?"w-full":"flex-1 min-w-[140px]"} ${Pe||""}`,style:{background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",opacity:!Ae||ne?.6:1,boxShadow:!Ae||ne?"none":"0 4px 12px rgba(239, 68, 68, 0.4)",...qe},children:[s.jsx(xt,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`flex items-center gap-3 mb-6 ${f||""}`,style:b,children:[s.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j||""}`,style:{background:"linear-gradient(135deg, #6b7280, #4b5563)",color:"white",...P},children:s.jsx(ye,{size:20,className:"animate-spin"})}),s.jsxs("div",{className:`flex-1 ${f||""}`,style:b,children:[s.jsx("h3",{className:`m-0 text-xl font-bold leading-tight ${p||""}`,style:{color:o.textPrimary,...h},children:"Deleting Account"}),s.jsx("p",{className:`mt-1 text-sm leading-normal ${g||""}`,style:{color:o.textTertiary,..._},children:"Please wait while we process your request"})]})]}),s.jsx("div",{className:`mb-5 ${O||""}`,style:D,children:s.jsx("div",{className:`flex flex-col gap-3 ${O||""}`,style:D,children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((Z,Ye)=>s.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg transition-all ${Y||""}`,style:{backgroundColor:Z.active?`${o.accent}10`:"transparent",...d},children:[s.jsx("div",{className:`w-2 h-2 rounded-full transition-all ${Y||""}`,style:{backgroundColor:Z.active?o.accent:o.textTertiary,boxShadow:Z.active?`0 0 0 4px ${o.accent}20`:"none",...d}}),s.jsx("span",{className:`text-sm ${Y||""}`,style:{color:Z.active?o.textPrimary:o.textSecondary,fontWeight:Z.active?500:400,...d},children:Z.text})]},Ye))})}),s.jsxs("div",{className:`flex items-center gap-2.5 p-4 rounded-xl text-sm ${x||""}`,style:{backgroundColor:`${o.accent}10`,color:o.textSecondary,...w},children:[s.jsx(Bt,{size:18,className:"flex-shrink-0",style:{color:o.accent}}),s.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`flex items-center gap-3 mb-6 ${f||""}`,style:b,children:[s.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j||""}`,style:{background:"linear-gradient(135deg, #10b981, #059669)",color:"white",...P},children:s.jsx(It,{size:20})}),s.jsxs("div",{className:`flex-1 ${f||""}`,style:b,children:[s.jsx("h3",{className:`m-0 text-xl font-bold leading-tight ${p||""}`,style:{color:o.textPrimary,...h},children:"Account Deleted"}),s.jsx("p",{className:`mt-1 text-sm leading-normal ${g||""}`,style:{color:o.textTertiary,..._},children:"Your account has been successfully deleted"})]})]}),s.jsxs("div",{className:`text-center p-5 rounded-xl mb-6 ${E||""}`,style:{backgroundColor:`${o.success}10`,border:`1px solid ${o.success}20`,...V},children:[s.jsx(It,{size:48,className:`mx-auto mb-3 block ${oe||""}`,style:{color:o.success,...ie}}),s.jsx("p",{className:`text-base font-semibold mb-2 m-0 ${p||""}`,style:{color:o.textPrimary,...h},children:"Goodbye!"}),s.jsx("p",{className:`text-sm leading-relaxed m-0 ${g||""}`,style:{color:o.textSecondary,..._},children:"Your account and all associated data have been permanently removed from our systems."})]}),s.jsxs("div",{className:`flex items-center justify-center gap-2.5 p-4 rounded-xl text-sm ${L||""}`,style:{backgroundColor:`${o.accent}10`,color:o.textSecondary,...ee},children:[s.jsx(ye,{size:16,className:"animate-spin",style:{color:o.accent}}),s.jsx("span",{children:"Redirecting to login page..."})]})]})}};return s.jsx("div",{className:`fixed inset-0 flex items-center justify-center p-4 z-[10000] animate-in fade-in duration-300 ${i||""}`,style:{backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",...l},onClick:Mt,children:s.jsx("div",{className:`w-full max-w-[480px] p-6 rounded-2xl border shadow-2xl animate-in zoom-in duration-300 ${m||""}`,style:{backgroundColor:o.surface,borderColor:o.border,...u},children:Ht()})})},Zn=({isOpen:t,onClose:e,onUpdate:r,colors:n,overlayClassName:a,overlayStyle:o,modalClassName:i,modalStyle:l,headerClassName:m,headerStyle:u,iconContainerClassName:f,iconContainerStyle:b,titleClassName:j,titleStyle:P,closeButtonClassName:p,closeButtonStyle:h,bodyClassName:g,bodyStyle:_,labelClassName:B,labelStyle:k,inputContainerClassName:q,inputContainerStyle:F,inputClassName:X,inputStyle:R,inputIconClassName:M,inputIconStyle:H,validationClassName:se,validationStyle:Q,successValidationClassName:J,successValidationStyle:G,errorValidationClassName:W,errorValidationStyle:N,warningValidationClassName:$,warningValidationStyle:A,previewClassName:O,previewStyle:D,previewLabelClassName:Y,previewLabelStyle:d,previewImageClassName:x,previewImageStyle:w,actionsClassName:E,actionsStyle:V,cancelButtonClassName:ce,cancelButtonStyle:C,submitButtonClassName:oe,submitButtonStyle:ie})=>{const[L,ee]=y.useState(""),[de,we]=y.useState(!1),[Ne,ke]=y.useState(!1),[te,je]=y.useState({isValid:!1,message:"",type:null});if(y.useEffect(()=>{if(typeof window>"u")return;const S=()=>{ke(window.innerWidth<640)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),y.useEffect(()=>{if(!L.trim()){je({isValid:!1,message:"",type:null});return}try{const S=new URL(L),ne=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(S.pathname);je(ne?{isValid:!0,message:"Valid image URL",type:"success"}:{isValid:!1,message:"URL should point to an image file",type:"warning"})}catch{je({isValid:!1,message:"Please enter a valid URL",type:"error"})}},[L]),!t)return null;const Pe=async()=>{if(!(!L||!te.isValid)){we(!0);try{await r(L)&&(ee(""),e())}finally{we(!1)}}},qe=S=>{S.target===S.currentTarget&&e()};return s.jsx("div",{className:`fixed inset-0 flex items-center justify-center p-4 z-[1000] ${a||""}`,style:{backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",...o},onClick:qe,children:s.jsxs("div",{className:`w-full max-w-[480px] p-6 rounded-2xl border shadow-2xl animate-in fade-in zoom-in duration-300 ${i||""}`,style:{backgroundColor:n.surface,borderColor:n.border,...l},children:[s.jsxs("div",{className:`flex items-start justify-between mb-6 gap-4 ${m||""}`,style:u,children:[s.jsxs("div",{className:`flex items-center gap-3 flex-1 ${f||""}`,style:b,children:[s.jsx("div",{className:`w-11 h-11 rounded-xl flex items-center justify-center flex-shrink-0 ${f||""}`,style:{background:`linear-gradient(135deg, ${n.accent}20, ${n.accent}40)`,color:n.accent,...b},children:s.jsx(zt,{size:22})}),s.jsx("div",{children:s.jsx("h3",{className:`m-0 text-xl font-bold leading-tight ${j||""}`,style:{color:n.textPrimary,...P},children:"Update Avatar"})})]}),s.jsx("button",{onClick:e,"aria-label":"Close avatar modal",className:`bg-transparent border-0 cursor-pointer p-2 rounded w-9 h-9 flex items-center justify-center flex-shrink-0 transition-all hover:bg-white/10 ${p||""}`,style:{color:n.textTertiary,...h},children:s.jsx(rt,{size:20})})]}),s.jsxs("div",{className:`flex flex-col gap-5 ${g||""}`,style:_,children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"avatar-url",className:`flex items-center gap-1.5 mb-2 text-sm font-medium ${B||""}`,style:{color:n.textPrimary,...k},children:[s.jsx(qn,{size:16}),"Avatar URL"]}),s.jsxs("div",{className:`relative ${q||""}`,style:F,children:[s.jsx("input",{type:"url",id:"avatar-url",placeholder:"https://example.com/your-avatar.jpg",value:L,onChange:S=>ee(S.target.value),className:`w-full pl-11 pr-4 py-3.5 rounded-xl border text-base outline-none transition-all focus:shadow-[0_0_0_3px_rgba(var(--accent),0.2)] ${X||""}`,style:{borderColor:te.type==="error"?n.error:te.type==="success"?n.success:n.border,backgroundColor:"transparent",color:n.textPrimary,...R},onFocus:S=>{S.currentTarget.style.borderColor=n.accent,S.currentTarget.style.boxShadow=`0 0 0 3px ${n.accent}20`},onBlur:S=>{S.currentTarget.style.borderColor=te.type==="error"?n.error:te.type==="success"?n.success:n.border,S.currentTarget.style.boxShadow="none"},disabled:de}),s.jsx("div",{className:`absolute left-4 top-1/2 -translate-y-1/2 ${M||""}`,style:{color:n.textTertiary,...H},children:s.jsx(qr,{size:18})})]}),te.message&&s.jsxs("div",{className:`flex items-center gap-1.5 mt-2 text-xs ${te.type==="success"?J||"":te.type==="error"?W||"":$||""} ${se||""}`,style:{color:te.type==="success"?n.success:te.type==="error"?n.error:n.textTertiary,...Q,...te.type==="success"?G:{},...te.type==="error"?N:{},...te.type==="warning"?A:{}},children:[te.type==="success"&&s.jsx(Ee,{size:14}),te.type==="error"&&s.jsx(be,{size:14}),te.type==="warning"&&s.jsx(be,{size:14}),te.message]})]}),L&&te.type==="success"&&s.jsxs("div",{className:`p-4 rounded-xl text-center ${O||""}`,style:{backgroundColor:`${n.success}10`,border:`1px solid ${n.success}20`,...D},children:[s.jsx("p",{className:`text-sm font-medium mb-3 m-0 ${Y||""}`,style:{color:n.textSecondary,...d},children:"Preview"}),s.jsx("img",{src:L,alt:"Avatar preview",className:`w-20 h-20 rounded-full object-cover border-2 mx-auto ${x||""}`,style:{borderColor:`${n.success}40`,...w},onError:S=>{S.currentTarget.style.display="none"}})]})]}),s.jsxs("div",{className:`flex gap-3 ${Ne?"flex-col-reverse":"flex-row"} justify-end items-stretch mt-6 ${E||""}`,style:V,children:[s.jsx("button",{onClick:e,disabled:de,className:`py-2.5 px-6 rounded-xl border bg-transparent text-sm font-medium cursor-pointer transition-all hover:-translate-y-0.5 disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${Ne?"w-full":"flex-1 min-w-[120px]"} ${ce||""}`,style:{borderColor:n.border,color:n.textPrimary,...C},children:"Cancel"}),s.jsx("button",{onClick:Pe,disabled:de||!te.isValid,className:`py-2.5 px-6 rounded-xl border-none text-sm font-semibold flex items-center justify-center gap-2 transition-all hover:-translate-y-0.5 disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${Ne?"w-full":"flex-1 min-w-[140px]"} ${oe||""}`,style:{background:`linear-gradient(135deg, ${n.accent}, ${n.accent}E6)`,color:"#fff",opacity:de||!te.isValid?.6:1,boxShadow:de||!te.isValid?"none":`0 4px 12px ${n.accent}40`,...ie},children:de?s.jsxs(s.Fragment,{children:[s.jsx(ye,{size:16,className:"animate-spin"}),"Updating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(zt,{size:16}),"Update Avatar"]})})]})]})})},Qn=({isOpen:t,onClose:e,onSuccess:r,onError:n,userId:a,colors:o,overlayClassName:i,overlayStyle:l,modalClassName:m,modalStyle:u,headerClassName:f,headerStyle:b,iconContainerClassName:j,iconContainerStyle:P,titleClassName:p,titleStyle:h,closeButtonClassName:g,closeButtonStyle:_,formClassName:B,formStyle:k,formGroupClassName:q,formGroupStyle:F,labelClassName:X,labelStyle:R,inputContainerClassName:M,inputContainerStyle:H,inputClassName:se,inputStyle:Q,inputIconClassName:J,inputIconStyle:G,toggleButtonClassName:W,toggleButtonStyle:N,errorClassName:$,errorStyle:A,actionsClassName:O,actionsStyle:D,cancelButtonClassName:Y,cancelButtonStyle:d,submitButtonClassName:x,submitButtonStyle:w})=>{const E=Fe(),[V,ce]=y.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[C,oe]=y.useState({}),[ie,L]=y.useState(!1),[ee,de]=y.useState({currentPassword:!1,newPassword:!1,confirmPassword:!1}),[we,Ne]=y.useState(!1);if(y.useEffect(()=>{if(typeof window>"u")return;const S=()=>{Ne(window.innerWidth<640)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),!t)return null;const ke=S=>{const{name:ne,value:_e}=S.target;ce(he=>({...he,[ne]:_e})),C[ne]&&oe(he=>({...he,[ne]:""}))},te=S=>{de(ne=>({...ne,[S]:!ne[S]}))},je=()=>{const S={};return V.currentPassword||(S.currentPassword="Current password is required"),V.newPassword?V.newPassword.length<6&&(S.newPassword="Password must be at least 6 characters"):S.newPassword="New password is required",V.newPassword!==V.confirmPassword&&(S.confirmPassword="Passwords do not match"),oe(S),Object.keys(S).length===0},Pe=async S=>{if(S.preventDefault(),!!je()){L(!0);try{const{data:ne}=await E.changePassword({currentPassword:V.currentPassword,newPassword:V.newPassword,userId:a});ne.success?(r(ne.message||"Password updated successfully"),ce({currentPassword:"",newPassword:"",confirmPassword:""}),e()):n(ne.message||"Failed to update password")}catch(ne){n(ne.response?.data?.message||"Something went wrong")}finally{L(!1)}}},qe=[{field:"currentPassword",label:"Current Password",icon:s.jsx(qt,{size:18})},{field:"newPassword",label:"New Password",icon:s.jsx(We,{size:18})},{field:"confirmPassword",label:"Confirm Password",icon:s.jsx(We,{size:18})}];return s.jsx("div",{className:`fixed inset-0 flex items-center justify-center p-4 z-[1000] ${i||""}`,style:{backgroundColor:"rgba(0,0,0,0.7)",backdropFilter:"blur(6px)",...l},children:s.jsxs("div",{className:`w-full max-w-[440px] p-6 rounded-2xl border shadow-2xl max-h-[90vh] overflow-y-auto ${m||""}`,style:{backgroundColor:o.surface,borderColor:o.border,...u},children:[s.jsxs("div",{className:`flex justify-between items-start mb-6 gap-3 ${f||""}`,style:b,children:[s.jsxs("div",{className:`flex items-center gap-3 flex-1 ${j||""}`,style:P,children:[s.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j||""}`,style:{background:`linear-gradient(135deg, ${o.accent}20, ${o.accent}40)`,color:o.accent,...P},children:s.jsx(We,{size:20})}),s.jsx("div",{children:s.jsx("h3",{className:`m-0 text-lg font-semibold leading-normal ${p||""}`,style:{color:o.textPrimary,...h},children:"Change Password"})})]}),s.jsx("button",{onClick:e,"aria-label":"Close password change modal",className:`bg-transparent border-0 cursor-pointer p-2 rounded flex-shrink-0 w-9 h-9 flex items-center justify-center transition-all hover:bg-white/10 ${g||""}`,style:{color:o.textTertiary,..._},children:s.jsx(rt,{size:20})})]}),s.jsxs("form",{className:B||"",style:k,onSubmit:Pe,children:[qe.map(({field:S,label:ne,icon:_e})=>s.jsxs("div",{className:`mb-5 relative ${q||""}`,style:F,children:[s.jsx("label",{htmlFor:S,className:`block mb-2 text-sm font-medium leading-normal ${X||""}`,style:{color:o.textPrimary,...R},children:ne}),s.jsxs("div",{className:`relative ${M||""}`,style:H,children:[s.jsx("div",{className:`absolute left-3.5 top-1/2 -translate-y-1/2 z-[2] ${J||""}`,style:{color:o.textTertiary,...G},children:_e}),s.jsx("input",{type:ee[S]?"text":"password",id:S,name:S,placeholder:`Enter ${ne.toLowerCase()}`,value:V[S],onChange:ke,className:`w-full pl-11 pr-12 py-3.5 rounded-xl border text-base outline-none transition-all focus:shadow-[0_0_0_3px_rgba(var(--accent),0.2)] ${se||""}`,style:{borderColor:C[S]?o.error:o.border,backgroundColor:"transparent",color:o.textPrimary,...Q},onFocus:he=>{he.currentTarget.style.borderColor=o.accent,he.currentTarget.style.boxShadow=`0 0 0 3px ${o.accent}20`},onBlur:he=>{he.currentTarget.style.borderColor=C[S]?o.error:o.border,he.currentTarget.style.boxShadow="none"}}),s.jsx("button",{type:"button",onClick:()=>te(S),className:`absolute right-3.5 top-1/2 -translate-y-1/2 bg-transparent border-0 cursor-pointer p-1 rounded w-8 h-8 flex items-center justify-center transition-all hover:bg-white/10 ${W||""}`,style:{color:o.textTertiary,...N},children:ee[S]?s.jsx(Lt,{size:18}):s.jsx(Ft,{size:18})})]}),C[S]&&s.jsxs("div",{className:`text-xs mt-1.5 flex items-center gap-1.5 ${$||""}`,style:{color:o.error,...A},children:[s.jsx("span",{className:"text-base",children:"⚠"}),C[S]]})]},S)),s.jsxs("div",{className:`flex gap-3 ${we?"flex-col-reverse":"flex-row"} justify-end items-stretch ${O||""}`,style:D,children:[s.jsx("button",{type:"button",onClick:e,disabled:ie,className:`py-3.5 px-6 rounded-xl border bg-transparent text-sm font-medium cursor-pointer transition-all hover:-translate-y-0.5 disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${we?"w-full":"flex-1 min-w-[120px]"} ${Y||""}`,style:{borderColor:o.border,color:o.textPrimary,...d},children:"Cancel"}),s.jsx("button",{type:"submit",disabled:ie,className:`py-3.5 px-6 rounded-xl border-none text-sm font-semibold flex items-center justify-center gap-2 transition-all hover:-translate-y-0.5 disabled:opacity-80 disabled:cursor-not-allowed disabled:translate-y-0 ${we?"w-full":"flex-1 min-w-[140px]"} ${x||""}`,style:{background:`linear-gradient(135deg, ${o.accent}, ${o.accent}E6)`,color:"#fff",boxShadow:ie?"none":`0 4px 12px ${o.accent}40`,...w},children:ie?s.jsxs(s.Fragment,{children:[s.jsx(ye,{size:16,className:"animate-spin"}),"Updating..."]}):"Update Password"})]})]})]})})},ea=({isOpen:t,onClose:e,onVerify:r,onSendOTP:n,verifyFormData:a,setVerifyFormData:o,otpSent:i,verifying:l,user:m,colors:u,darkMode:f,overlayClassName:b,overlayStyle:j,modalClassName:P,modalStyle:p,headerClassName:h,headerStyle:g,titleClassName:_,titleStyle:B,closeButtonClassName:k,closeButtonStyle:q,formClassName:F,formStyle:X,formGroupClassName:R,formGroupStyle:M,labelClassName:H,labelStyle:se,inputContainerClassName:Q,inputContainerStyle:J,inputClassName:G,inputStyle:W,emailInputClassName:N,emailInputStyle:$,otpInputClassName:A,otpInputStyle:O,actionsClassName:D,actionsStyle:Y,buttonClassName:d,buttonStyle:x,sendButtonClassName:w,sendButtonStyle:E,verifyButtonClassName:V,verifyButtonStyle:ce})=>{if(!t)return null;const C=()=>{e(),o({email:m?.email||"",otp:""})};return s.jsx("div",{className:`fixed inset-0 flex items-center justify-center z-[100] p-5 ${b||""}`,style:{backgroundColor:f?"rgba(0, 0, 0, 0.8)":"rgba(0, 0, 0, 0.5)",...j},children:s.jsxs("div",{className:`w-full max-w-[440px] rounded-2xl p-6 shadow-lg backdrop-blur-md border ${P||""}`,style:{backgroundColor:u.surface,borderColor:u.border,...p},children:[s.jsxs("div",{className:`flex items-center justify-between mb-6 ${h||""}`,style:g,children:[s.jsx("h3",{className:`m-0 text-xl font-semibold ${_||""}`,style:{color:u.textPrimary,...B},children:"Verify Your Email"}),s.jsx("button",{onClick:C,className:`bg-transparent border-0 cursor-pointer p-1 rounded flex items-center justify-center transition-colors hover:bg-white/10 ${k||""}`,style:{color:u.textTertiary,...q},"aria-label":"Close verification modal",children:s.jsx(rt,{size:20,"aria-hidden":"true"})})]}),s.jsxs("form",{className:`flex flex-col gap-5 ${F||""}`,style:X,onSubmit:r,children:[s.jsxs("div",{className:`flex flex-col gap-2 ${R||""}`,style:M,children:[s.jsx("label",{className:`text-sm font-medium ${H||""}`,style:{color:u.textSecondary,...se},children:"Email"}),s.jsxs("div",{className:`relative flex items-center ${Q||""}`,style:J,children:[s.jsx(Le,{size:18,className:"absolute left-3 pointer-events-none",style:{color:u.textTertiary},"aria-hidden":"true"}),s.jsx("input",{type:"email",value:a.email,onChange:oe=>o(ie=>({...ie,email:oe.target.value})),placeholder:"Enter your email",className:`w-full pl-10 pr-3 py-3 rounded-lg border text-sm outline-none transition-all focus:shadow-[0_0_0_3px_rgba(var(--accent),0.2)] ${G||""} ${N||""}`,style:{backgroundColor:u.surfaceLight,color:u.textPrimary,borderColor:u.border,...W,...$},required:!0,"aria-required":"true","aria-label":"Email address"})]})]}),i&&s.jsxs("div",{className:`flex flex-col gap-2 ${R||""}`,style:M,children:[s.jsx("label",{className:`text-sm font-medium ${H||""}`,style:{color:u.textSecondary,...se},children:"OTP"}),s.jsxs("div",{className:`relative flex items-center ${Q||""}`,style:J,children:[s.jsx(Dr,{size:18,className:"absolute left-3 pointer-events-none",style:{color:u.textTertiary},"aria-hidden":"true"}),s.jsx("input",{type:"text",value:a.otp,onChange:oe=>o(ie=>({...ie,otp:oe.target.value})),placeholder:"Enter OTP",className:`w-full pl-10 pr-3 py-3 rounded-lg border text-sm outline-none transition-all focus:shadow-[0_0_0_3px_rgba(var(--accent),0.2)] ${G||""} ${A||""}`,style:{backgroundColor:u.surfaceLight,color:u.textPrimary,borderColor:u.border,...W,...O},required:!0,"aria-required":"true","aria-label":"One-time password"})]})]}),s.jsx("div",{className:`flex gap-3 ${D||""}`,style:Y,children:i?s.jsxs("button",{type:"submit",disabled:l,className:`flex-1 flex items-center justify-center gap-2 py-3 px-5 rounded-lg border-none text-white font-medium cursor-pointer transition-all text-sm hover:-translate-y-0.5 hover:shadow-lg disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${d||""} ${V||""}`,style:{background:`linear-gradient(to right, ${u.accent}, ${u.accentHover})`,opacity:l?.7:1,...x,...ce},"aria-label":l?"Verifying email":"Verify email",children:[l?s.jsx(ye,{size:16,className:"animate-spin","aria-hidden":"true"}):s.jsx(Ee,{size:16,"aria-hidden":"true"}),l?"Verifying...":"Verify Email"]}):s.jsxs("button",{type:"button",onClick:n,disabled:l,className:`flex-1 flex items-center justify-center gap-2 py-3 px-5 rounded-lg border-none text-white font-medium cursor-pointer transition-all text-sm hover:-translate-y-0.5 hover:shadow-lg disabled:opacity-60 disabled:cursor-not-allowed disabled:translate-y-0 ${d||""} ${w||""}`,style:{background:`linear-gradient(to right, ${u.accent}, ${u.accentHover})`,opacity:l?.7:1,...x,...E},"aria-label":l?"Sending OTP":"Send OTP",children:[l?s.jsx(ye,{size:16,className:"animate-spin","aria-hidden":"true"}):s.jsx(Vt,{size:16,"aria-hidden":"true"}),l?"Sending...":"Send OTP"]})})]})]})})},ta=({darkMode:t=!0,homeUrl:e,onLogout:r,onVerify:n,primaryColor:a="#00C212",containerClassName:o,containerStyle:i,mainContainerClassName:l,mainContainerStyle:m,notificationClassName:u,notificationStyle:f,successNotificationClassName:b,successNotificationStyle:j,errorNotificationClassName:P,errorNotificationStyle:p,loadingContainerClassName:h,loadingContainerStyle:g,noUserContainerClassName:_,noUserContainerStyle:B,leftColumnClassName:k,leftColumnStyle:q,avatarSectionClassName:F,avatarSectionStyle:X,avatarContainerClassName:R,avatarContainerStyle:M,avatarImageClassName:H,avatarImageStyle:se,avatarButtonClassName:Q,avatarButtonStyle:J,userNameClassName:G,userNameStyle:W,userUsernameClassName:N,userUsernameStyle:$,userEmailClassName:A,userEmailStyle:O,verificationBadgeClassName:D,verificationBadgeStyle:Y,actionsContainerClassName:d,actionsContainerStyle:x,editButtonClassName:w,editButtonStyle:E,verifyButtonClassName:V,verifyButtonStyle:ce,moreButtonClassName:C,moreButtonStyle:oe,dropdownClassName:ie,dropdownStyle:L,dropdownItemClassName:ee,dropdownItemStyle:de,rightColumnClassName:we,rightColumnStyle:Ne,personalInfoSectionClassName:ke,personalInfoSectionStyle:te,sectionTitleClassName:je,sectionTitleStyle:Pe,fieldContainerClassName:qe,fieldContainerStyle:S,fieldLabelClassName:ne,fieldLabelStyle:_e,fieldInputClassName:he,fieldInputStyle:ht,fieldDisplayClassName:st,fieldDisplayStyle:Ce,securitySectionClassName:Te,securitySectionStyle:yt,securityItemClassName:gt,securityItemStyle:Ae,securityBadgeClassName:Mt,securityBadgeStyle:Ht,securityInfoClassName:Z,securityInfoStyle:Ye})=>{const De=Fe(),[Oe,na]=y.useState(null),[U,$e]=y.useState(),[aa,Hr]=y.useState(!0),[Wr,Wt]=y.useState(!1),[bt,Jr]=y.useState(!1),[oa,Yr]=y.useState(!1),[ia,Kr]=y.useState(!1),[la,Xr]=y.useState(!1),[ca,Jt]=y.useState(!1),[wt,Gr]=y.useState(!1),[Zr,Qr]=y.useState(!1),[Ve,es]=y.useState(null),[jt,go]=y.useState(!1),[Ue,vt]=y.useState({email:"",otp:""}),[da,Yt]=y.useState(!1),[ua,Nt]=y.useState(!1);y.useEffect(()=>{if(typeof window<"u"){const v=()=>na(window.innerWidth);return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)}},[]);const le=(v,z)=>{es({type:v,message:z}),setTimeout(()=>es(null),3e3)},Et=()=>{Qr(!0);const v=setTimeout(()=>{Gr(!1),Qr(!1)},150);return()=>clearTimeout(v)};y.useEffect(()=>{const v=z=>{const re=document.querySelector(".dropdown-container");re&&!re.contains(z.target)&&Et()};return wt&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[wt]);const fa=async()=>{if(!Ue.email||!/\S+@\S+\.\S+/.test(Ue.email)){le("error","Please enter a valid email");return}if(!U?.id){le("error","User not found. Cannot send OTP.");return}try{Nt(!0);const v=await De.requestEmailVerificationOTP({userId:U.id,email:Ue.email}),z=v?.data?.success??v?.success,re=v?.data?.message??v?.message;z?(le("success",re||"OTP sent to email!"),Yt(!0)):le("error",re||"Failed to send OTP")}catch(v){const z=v?.response?.data?.message||v?.message||"Server error";le("error",z)}finally{Nt(!1)}},pa=async v=>{if(v.preventDefault(),!Ue.email||!Ue.otp){le("error","Please fill in all fields");return}if(!U){le("error","User not found");return}try{Nt(!0);const z=await De.verifyEmail({email:Ue.email,otp:Ue.otp}),re=z?.data?.success??z?.success,fe=z?.data?.message??z?.message;if(re){le("success",fe||"Email verified!");const Se={...U,isVerified:!0};$e(Se),typeof n=="function"&&n(Se),vt({email:Se.email,otp:""}),Yt(!1),Jt?.(!1)}else le("error",fe||"Verification failed")}catch(z){const re=z?.response?.data?.message||z?.message||"Something went wrong";le("error",re)}finally{Nt(!1)}},ma=async v=>{if(!U)return!1;try{const z=await De.updateUser({userId:U.id,avatarUrl:v});if(z?.success){const re={...U,...z.user,avatarUrl:v};return $e(re),le("success","Avatar updated successfully!"),!0}return le("error",z?.message||"Failed to update avatar"),!1}catch(z){return console.error("Avatar update error:",z),le("error","Failed to update avatar"),!1}},xa=async()=>{if(U){Jr(!0);try{const v=U.email,z=await De.updateUser({userId:U.id,...U});if(z.success&&z.user){const re=z.user.email!==v,fe={...U,...z.user,isVerified:re?!1:U.isVerified};$e(fe),localStorage.setItem("userInfo",JSON.stringify(fe)),le("success",re?"Email updated. Please verify your new email.":"Profile updated successfully"),Wt(!1)}else le("error",z.message||"Update failed")}catch(v){console.error(v),le("error","Update failed")}finally{Jr(!1)}}},ha=async v=>{try{const z=await De.checkIfUserExists(v);z?.success===!0&&z?.exists===!1&&(console.warn("❌ User does not exist on server. Clearing session..."),localStorage.removeItem("userInfo"),$e(null))}catch(z){console.error("⚠️ User validation request failed:",z)}};y.useEffect(()=>{(async()=>{try{Hr(!0);const z=await De.checkUserSession();if(z.user?.id){const re=z.user.id,fe=await De.getUserProfile({userId:re});if(fe.user){const Se=fe.user;$e(Se),ha(re)}else $e(null),localStorage.removeItem("userInfo")}else $e(null),localStorage.removeItem("userInfo")}catch(z){console.error("User init failed:",z),$e(null),localStorage.removeItem("userInfo")}finally{Hr(!1)}})()},[]),y.useEffect(()=>{U?.email&&vt(v=>({...v,email:U.email}))},[U?.email]);const ts=(v,z)=>{let re=parseInt(v.replace("#",""),16),fe=(re>>16)+z,Se=(re>>8&255)+z,Kt=(re&255)+z;return fe=Math.min(255,Math.max(0,fe)),Se=Math.min(255,Math.max(0,Se)),Kt=Math.min(255,Math.max(0,Kt)),`#${(Kt|Se<<8|fe<<16).toString(16).padStart(6,"0")}`},T=t?{background:"#000000",surface:"#09090b",surfaceLight:"#27272a",surfaceLighter:"#3f3f46",textPrimary:"#ffffff",textSecondary:"#d4d4d8",textTertiary:"#a1a1aa",accent:a,accentHover:ts(a,-15),success:"#10b981",error:"#ef4444",border:"#27272a",warning:"#f59e0b"}:{background:"#ffffff",surface:"#fafafa",surfaceLight:"#f4f4f5",surfaceLighter:"#e4e4e7",textPrimary:"#18181b",textSecondary:"#52525b",textTertiary:"#71717a",accent:a,accentHover:ts(a,-15),success:"#10b981",error:"#ef4444",border:"#e4e4e7",warning:"#d97706"};if(aa)return s.jsx("div",{className:`w-full min-h-[400px] flex items-center justify-center ${h||""}`,style:{color:T.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",...g},children:s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[s.jsx(ye,{size:40,className:"animate-spin",color:T.accent,"aria-hidden":"true"}),s.jsx("p",{className:"m-0",style:{color:T.textTertiary},children:"Loading your profile..."})]})});if(!U)return s.jsx("div",{className:`w-full min-h-[400px] flex items-center justify-center ${_||""}`,style:{color:T.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",...B},children:s.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[s.jsx(be,{size:40,color:T.error,"aria-hidden":"true"}),s.jsx("p",{className:"m-0",style:{color:T.textTertiary},children:"No profile found. Please log in again."})]})});const ya=[{label:"Username",value:U.username||"Not set",name:"username",type:"text",icon:Je,readonly:!0},{label:"Full Name",value:U.name,name:"name",type:"text",icon:Je},{label:"Email Address",value:U.email,name:"email",type:"email",icon:Le},{label:"Role",value:U.role||"user",name:"role",type:"text",icon:Bt,readonly:!0},{label:"Phone Number",value:U.phone||"Not set",name:"phone",type:"tel",icon:Bn},{label:"Address",value:U.address||"Not provided",name:"address",type:"text",icon:Dn}];return s.jsxs("div",{className:`w-full flex items-center justify-center ${o||""}`,style:{color:T.textPrimary,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",lineHeight:1.5,minHeight:"80vh",...i},children:[Ve&&s.jsxs("div",{className:`fixed top-5 right-5 px-6 py-3 rounded-xl text-sm font-medium border shadow-lg backdrop-blur-sm z-[1000] animate-in slide-in-from-right duration-300 flex items-center gap-2 max-w-[400px] ${Ve.type==="success"?b||"":P||""} ${u||""}`,style:{...Ve.type==="success"?{backgroundColor:t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)",borderColor:t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)",color:t?"#34d399":"#059669"}:{backgroundColor:t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)",borderColor:t?"rgba(239, 68, 68, 0.3)":"rgba(239, 68, 68, 0.2)",color:t?"#f87171":"#dc2626"},...f,...Ve.type==="success"?j:{},...Ve.type==="error"?p:{}},role:"alert","aria-live":"polite",children:[Ve.type==="success"?s.jsx(Ee,{size:20,"aria-hidden":"true"}):s.jsx(be,{size:20,"aria-hidden":"true"}),Ve.message]}),s.jsx("div",{className:`max-w-[1200px] mx-auto w-full box-border ${l||""}`,style:m,children:s.jsxs("div",{className:`grid gap-6 grid-cols-1 ${Oe&&window.innerWidth>=1024?"grid-cols-[1fr_2fr] gap-[10px]":""} ${Oe&&window.innerWidth>=768&&window.innerWidth<1024?"gap-[10px]":""} ${Oe&&window.innerWidth>=600&&window.innerWidth<768?"gap-[28px]":""}`,children:[s.jsxs("div",{className:`flex flex-col gap-1.5 h-full ${k||""}`,style:q,children:[s.jsxs("section",{className:`p-6 rounded-2xl border shadow-lg text-center flex flex-col justify-center items-center flex-1 min-h-[300px] relative ${F||""}`,style:{backgroundColor:T.surface,borderColor:T.border,...X},children:[e&&s.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",className:"absolute top-[18px] left-[18px]",children:s.jsx(Fn,{size:20,style:{color:t?"#ffffff":"#000000"}})}),s.jsxs("div",{className:`relative inline-block mb-4 ${R||""}`,style:M,children:[s.jsx("img",{src:U.avatarUrl||`https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(U.name)}`,alt:`Profile avatar of ${U.name}`,className:`w-32 h-32 rounded-full object-cover shadow-lg border-3 ${H||""}`,style:{borderColor:T.border,...se},width:128,height:128,loading:"eager"}),s.jsx("button",{onClick:()=>Yr(!0),className:`absolute bottom-2 right-2 bg-transparent border-none cursor-pointer p-2 rounded-full flex items-center justify-center w-8 h-8 transition-all ${Q||""}`,style:{backgroundColor:T.accent,color:"white",...J},"aria-label":"Change profile picture",children:s.jsx(zt,{size:16,"aria-hidden":"true"})})]}),s.jsx("h2",{className:`text-2xl font-semibold mb-1 m-0 ${G||""}`,style:{color:T.textPrimary,...W},children:U.name}),U.username&&s.jsxs("h2",{className:`text-lg font-semibold mb-1 m-0 ${N||""}`,style:{color:T.textTertiary,...$},children:["@",U.username||"Not set"]}),s.jsx("p",{className:`m-0 mb-2 ${A||""}`,style:{color:T.textTertiary,...O},children:U.email}),s.jsxs("div",{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium mt-2 ${D||""}`,style:{backgroundColor:U.isVerified?t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)":t?"rgba(245, 158, 11, 0.1)":"rgba(245, 158, 11, 0.05)",color:U.isVerified?T.success:T.warning,borderColor:U.isVerified?t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)":t?"rgba(245, 158, 11, 0.3)":"rgba(245, 158, 11, 0.2)",borderWidth:"1px",borderStyle:"solid",...Y},children:[U.isVerified?s.jsx(Ee,{size:16,"aria-hidden":"true"}):s.jsx(be,{size:16,"aria-hidden":"true"}),U.isVerified?"Email Verified":"Not Verified"]})]}),s.jsx("nav",{className:`flex flex-col gap-1.5 ${d||""}`,style:x,children:Wr?s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>Wt(!1),className:`bg-transparent border text-sm font-medium cursor-pointer transition-all flex items-center justify-center gap-2 min-h-9 px-5 rounded ${Oe&&window.innerWidth<1024?"flex-1":"auto"} ${w||""}`,style:{backgroundColor:T.surfaceLight,borderColor:T.border,color:T.textPrimary,...E},children:[s.jsx(rt,{size:16,"aria-hidden":"true"}),"Cancel"]}),s.jsxs("button",{onClick:xa,disabled:bt,className:`bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center justify-center gap-2 min-h-9 px-5 rounded disabled:opacity-70 disabled:cursor-not-allowed ${Oe&&window.innerWidth<1024?"flex-1":"auto"} ${w||""}`,style:{background:`linear-gradient(to right, ${T.accent}, ${T.accentHover})`,opacity:bt?.7:1,color:"white",...E},children:[bt?s.jsx(ye,{size:16,className:"animate-spin","aria-hidden":"true"}):s.jsx(Mn,{size:16,"aria-hidden":"true"}),bt?"Saving...":"Save Changes"]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>Wt(!0),className:`bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center justify-center gap-2 min-h-9 px-5 rounded ${Oe&&window.innerWidth<1024?"flex-1":"auto"} ${w||""}`,style:{background:`linear-gradient(to right, ${T.accent}, ${T.accentHover})`,color:"white",...E},children:[s.jsx(Vn,{size:16,"aria-hidden":"true"}),"Edit Profile"]}),!U.isVerified&&s.jsxs("button",{onClick:()=>Jt(!0),disabled:jt,className:`bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center justify-center gap-2 min-h-9 px-5 rounded disabled:opacity-70 disabled:cursor-not-allowed ${Oe&&window.innerWidth<1024?"flex-1":"auto"} ${V||""}`,style:{background:"linear-gradient(to right, #fbbf24, #f59e0b)",color:"white",opacity:jt?.7:1,...ce},children:[jt?s.jsx(ye,{size:14,className:"animate-spin","aria-hidden":"true"}):s.jsx(Vt,{size:14,"aria-hidden":"true"}),jt?"Sending...":"Verify Email"]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>Gr(!wt),className:`bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center justify-center gap-2 min-h-9 px-5 rounded w-full box-border ${C||""}`,style:{backgroundColor:T.surfaceLight,color:T.textPrimary,...oe},children:[s.jsx(Ln,{size:16,"aria-hidden":"true"}),"More Actions"]}),wt&&s.jsxs("div",{className:`dropdown-container ${Zr?"closing":""} ${ie||""}`,style:{position:"absolute",bottom:"100%",left:0,right:0,backgroundColor:T.surface,borderColor:T.border,borderWidth:"1px",borderStyle:"solid",borderRadius:"12px 12px 0 0",boxShadow:"0 -8px 24px rgba(0, 0, 0, 0.25)",zIndex:200,marginBottom:"6px",overflow:"hidden",animation:`${Zr?"drawerSlideDown":"drawerSlideUp"} 0.25s ease-out forwards`,...L},children:[s.jsxs("button",{onClick:()=>{Kr(!0),Et()},className:`w-full py-3.5 px-4.5 bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center gap-2 text-left ${ee||""}`,style:{color:T.textPrimary,...de},onMouseEnter:v=>v.currentTarget.style.backgroundColor=T.surfaceLight,onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[s.jsx(qt,{size:14,"aria-hidden":"true"}),"Change Password"]}),r&&s.jsxs("button",{onClick:()=>{r(),Et()},className:`w-full py-3.5 px-4.5 bg-transparent border-none text-sm font-medium cursor-pointer transition-all flex items-center gap-2 text-left ${ee||""}`,style:{color:t?"#fca5a5":"#dc2626",...de},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)"},onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[s.jsx(Dt,{size:14,"aria-hidden":"true"}),"Logout"]}),s.jsxs("button",{onClick:()=>{Xr(!0),Et()},className:`w-full py-3.5 px-4.5 bg-transparent border-none text-sm font-semibold cursor-pointer transition-all flex items-center gap-2 text-left ${ee||""}`,style:{color:"#ef4444",...de},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=t?"rgba(239, 68, 68, 0.1)":"rgba(239, 68, 68, 0.05)"},onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:[s.jsx(xt,{size:14,"aria-hidden":"true"}),"Delete Account"]})]})]})]})})]}),s.jsxs("div",{className:`min-w-0 flex flex-col gap-3 ${we||""}`,style:Ne,children:[s.jsxs("section",{className:`p-6 rounded-2xl border shadow-lg ${ke||""}`,style:{backgroundColor:T.surface,borderColor:T.border,...te},children:[s.jsxs("h2",{className:`text-xl font-semibold mb-6 m-0 flex items-center gap-2 ${je||""}`,style:{color:T.textSecondary,...Pe},children:[s.jsx(Je,{size:20,"aria-hidden":"true"}),"Personal Information"]}),s.jsx("div",{className:`grid gap-5 grid-cols-1 ${Oe&&window.innerWidth>=600?"grid-cols-2 gap-5":""}`,children:ya.map(v=>{const z=v.icon;return s.jsxs("div",{className:`flex flex-col gap-2 ${qe||""}`,style:S,children:[s.jsxs("label",{className:`text-xs font-medium flex items-center gap-2 ${ne||""}`,style:{color:T.textTertiary,..._e},children:[s.jsx(z,{size:16,"aria-hidden":"true"}),v.label]}),Wr&&!v.readonly?s.jsx("input",{type:v.type,name:v.name,value:U[v.name],onChange:re=>$e(fe=>fe&&{...fe,[re.target.name]:re.target.value}),className:`w-full py-3 px-3 rounded-lg border text-xs outline-none transition-all min-h-11 box-border ${he||""}`,style:{borderColor:a,backgroundColor:"transparent",color:T.textPrimary,opacity:v.readonly?.7:1,...ht},placeholder:`Enter ${v.label.toLowerCase()}`,"aria-label":v.label}):s.jsx("div",{className:`py-3 px-3 rounded-lg border border-transparent text-xs min-h-11 flex items-center box-border ${st||""}`,style:{color:T.textPrimary,backgroundColor:t?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)",...Ce},children:v.value})]},v.name)})})]}),s.jsxs("section",{className:`p-[30px_24px] rounded-2xl border shadow-lg ${Te||""}`,style:{backgroundColor:T.surface,borderColor:T.border,...yt},children:[s.jsxs("h2",{className:`text-xl font-semibold mb-6 m-0 flex items-center gap-2 ${je||""}`,style:{color:T.textSecondary,...Pe},children:[s.jsx(Bt,{size:20,"aria-hidden":"true"}),"Security Status"]}),s.jsxs("div",{className:`flex flex-col gap-4 ${Te||""}`,style:yt,children:[s.jsxs("div",{className:`flex items-center justify-between py-3 ${gt||""}`,style:Ae,children:[s.jsxs("div",{className:`flex items-center gap-3 ${gt||""}`,style:{color:T.textSecondary,...Ae},children:[s.jsx(Le,{size:16,"aria-hidden":"true"}),s.jsx("span",{children:"Email Verification"})]}),s.jsx("div",{className:`px-3 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 ${Mt||""}`,style:{...U.isVerified?{backgroundColor:t?"rgba(16, 185, 129, 0.1)":"rgba(16, 185, 129, 0.05)",color:T.success,borderColor:t?"rgba(16, 185, 129, 0.3)":"rgba(16, 185, 129, 0.2)"}:{backgroundColor:t?"rgba(245, 158, 11, 0.1)":"rgba(245, 158, 11, 0.05)",color:T.warning,borderColor:t?"rgba(245, 158, 11, 0.3)":"rgba(245, 158, 11, 0.2)"},borderWidth:"1px",borderStyle:"solid",...Ht},children:U.isVerified?s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:16,"aria-hidden":"true"}),"Verified"]}):s.jsxs(s.Fragment,{children:[s.jsx(be,{size:16,"aria-hidden":"true"}),"Not Verified"]})})]}),!U.isVerified&&s.jsx("div",{className:`p-3 rounded-lg ${Z||""}`,style:{backgroundColor:t?"rgba(100, 100, 100, 0.1)":"rgba(0, 0, 0, 0.05)",...Ye},children:s.jsx("p",{className:`text-xs m-0 ${Z||""}`,style:{color:T.textTertiary,...Ye},children:"Verify your email to unlock all features and enhance your account security."})})]})]})]})]})}),s.jsx(Zn,{isOpen:oa,onClose:()=>{Yr(!1)},onUpdate:ma,colors:T}),s.jsx(Qn,{userId:U.id,isOpen:ia,onClose:()=>Kr(!1),onSuccess:v=>le("success",v),onError:v=>le("error",v),colors:T}),s.jsx(Gn,{userId:U.id,isOpen:la,onClose:()=>Xr(!1),onSuccess:v=>le("success",v),onError:v=>le("error",v),colors:T}),s.jsx(ea,{isOpen:ca,onClose:()=>{Jt(!1),Yt(!1),vt({email:U?.email||"",otp:""})},onVerify:pa,onSendOTP:fa,verifyFormData:Ue,setVerifyFormData:vt,otpSent:da,verifying:ua,user:U,colors:T,darkMode:t}),s.jsx("style",{children:`
520
214
  @keyframes drawerSlideUp {
521
215
  from {
522
216
  transform: translateY(20px);
@@ -538,54 +232,50 @@ React keys must be passed directly to JSX without using spread:
538
232
  opacity: 0;
539
233
  }
540
234
  }
235
+ `})]})},ra=({darkMode:t=!0,menuItems:e,onLogout:r,propUser:n,className:a="",logoutLabel:o="Sign Out",wrapperClassName:i,avatarClassName:l,dropdownClassName:m,menuItemClassName:u,logoutButtonClassName:f})=>{const b=Fe(),[j,P]=y.useState(!1),[p,h]=y.useState(null),[g,_]=y.useState(!0),[B,k]=y.useState(null),q=y.useRef(null),F=y.useRef(null),[X,R]=y.useState(!1),[M,H]=y.useState(!1),[se,Q]=y.useState({top:0,left:0}),[J,G]=y.useState("bottom");y.useEffect(()=>{if(typeof window>"u")return;const N=()=>{H(window.innerWidth<768)};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]),y.useEffect(()=>{let N=!0;return(async()=>{try{if(_(!0),k(null),n){if(!n.id||!n.name||!n.email)throw new Error("Invalid user data provided");N&&h(n);return}const A=await b.checkUserSession();if(!N)return;if(!A?.authenticated||!A.user){h(null);return}const O={id:A.user.id,email:A.user.email,name:A.user.email.split("@")[0]};h(O)}catch(A){console.error("User initialization failed:",A),N&&(h(null),k(A.message||"Failed to load user"))}finally{N&&_(!1)}})(),()=>{N=!1}},[n,b]),y.useEffect(()=>{if(typeof window>"u")return;const N=()=>{if(!j||!F.current)return;const $=F.current.getBoundingClientRect(),A=window.innerWidth,O=window.innerHeight,D=280,Y=A-$.right,d=$.left;O-$.bottom;const x=Y>=D||Y>d;R(x)};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[j]),y.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const N=O=>{q.current&&!q.current.contains(O.target)&&!F.current?.contains(O.target)&&P(!1)},$=O=>{O.key==="Escape"&&P(!1)},A=()=>{j&&P(!1)};return j&&(document.addEventListener("mousedown",N),document.addEventListener("keydown",$),window.addEventListener("scroll",A)),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",$),window.removeEventListener("scroll",A)}},[j]),y.useLayoutEffect(()=>{if(!j||!F.current)return;const N=()=>{const $=F.current.getBoundingClientRect(),A=280,O=320,D=window.innerHeight-$.bottom,Y=$.top,d=window.innerWidth-$.right,x=D<O&&Y>O,w=x?$.top-O-8:$.bottom+8;let E=$.right-A;d<A&&(E=$.left),E=Math.max(8,Math.min(E,window.innerWidth-A-8)),G(x?"top":"bottom"),Q({top:w,left:E})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[j]);const W=(N,$)=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),$())};return s.jsxs("div",{className:`relative inline-block ${i||""} ${a||""}`,ref:q,role:"menu","aria-label":"User menu",children:[s.jsx("div",{ref:F,onClick:()=>P(N=>!N),onKeyDown:N=>W(N,()=>P($=>!$)),tabIndex:0,role:"button","aria-haspopup":"true","aria-expanded":j,"aria-label":"Toggle user menu",className:`
236
+ inline-flex items-center justify-center rounded-full cursor-pointer
237
+ transition-all duration-300 ease-out
238
+ ${l||""}
239
+ `,children:p?.avatarUrl?s.jsx("img",{src:p.avatarUrl,alt:p?.name||"User avatar",className:`rounded-full object-cover border
240
+ ${M?"w-9 h-9":"w-10 h-10"}
241
+ `}):s.jsx("div",{className:`
242
+ flex items-center justify-center rounded-full border font-semibold uppercase
243
+ ${M?"w-9 h-9 text-sm":"w-10 h-10 text-base"}
244
+ ${t?"bg-neutral-900 text-white border-neutral-700":"bg-gray-100 text-gray-900 border-gray-200"}
245
+ `,children:(p?.name?.charAt(0)||"U").toUpperCase()})}),j&&s.jsx("div",{className:`
246
+ fixed z-[1000]
247
+ w-[260px] max-h-[340px] overflow-y-auto
248
+ rounded-xl border shadow-lg p-2
249
+ transition-all duration-200 ease-out
541
250
 
542
-
543
- @keyframes slideUp {
544
- from {
545
- transform: translateY(10px);
546
- opacity: 0;
547
- }
548
- to {
549
- transform: translateY(0);
550
- opacity: 1;
551
- }
552
- }
553
-
554
- /* Responsive design using container queries as fallback */
555
- @media (max-width: 599px) {
556
- .profile-main-container {
557
- padding: 0 12px;
558
- }
559
- }
560
-
561
- @media (min-width: 600px) and (max-width: 767px) {
562
- .profile-main-container {
563
- padding: 0 20px;
564
- }
565
- }
566
-
567
- @media (min-width: 768px) and (max-width: 1023px) {
568
- .profile-main-container {
569
- padding: 0 24px;
570
- }
571
- }
572
-
573
- @media (min-width: 1024px) {
574
- .profile-main-container {
575
- padding: 0 32px;
576
- }
577
- }
578
-
579
- /* Reduced motion support */
580
- @media (prefers-reduced-motion: reduce) {
581
- * {
582
- animation-duration: 0.01ms !important;
583
- animation-iteration-count: 1 !important;
584
- transition-duration: 0.01ms !important;
585
- }
586
- }
587
- `})]})},is=({darkMode:t=!0,primaryColor:e="#3b82f6",onLogout:n,varient:s="classic",propUser:i,className:o="",profileUrl:a,settingsUrl:c,showProfileMenuItem:d=!0,showSettingsMenuItem:f=!0,showViewProfileMenuItem:x=!0,profileLabel:y="My Profile",settingsLabel:E="Settings",viewProfileLabel:C="View Profile",logoutLabel:u="Sign Out"})=>{const w=ge(),[h,R]=S.useState(!1),[T,g]=S.useState(null),[z,D]=S.useState(!0),[b,j]=S.useState(null),q=S.useRef(null),O=S.useRef(null),[G,W]=S.useState(!1),[I,X]=S.useState(!1);S.useEffect(()=>{if(typeof window>"u")return;const l=()=>{X(window.innerWidth<768)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),S.useEffect(()=>{let l=!0;return(async()=>{try{if(D(!0),j(null),i){if(!i.id||!i.name||!i.email)throw new Error("Invalid user data provided");l&&g(i);return}const k=await w.checkUserSession();if(!l)return;if(!k?.authenticated||!k.user){g(null);return}const N={id:k.user.id,email:k.user.email,name:k.user.email.split("@")[0]};g(N)}catch(k){console.error("User initialization failed:",k),l&&(g(null),j(k.message||"Failed to load user"))}finally{l&&D(!1)}})(),()=>{l=!1}},[i,w]),S.useEffect(()=>{if(typeof window>"u")return;const l=()=>{if(!h||!O.current)return;const m=O.current.getBoundingClientRect(),k=window.innerWidth,N=window.innerHeight,ne=280,le=k-m.right,B=m.left;N-m.bottom;const ce=le>=ne||le>B;W(ce)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[h]),S.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const l=N=>{q.current&&!q.current.contains(N.target)&&!O.current?.contains(N.target)&&R(!1)},m=N=>{N.key==="Escape"&&R(!1)},k=()=>{h&&R(!1)};return h&&(document.addEventListener("mousedown",l),document.addEventListener("keydown",m),window.addEventListener("scroll",k)),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",m),window.removeEventListener("scroll",k)}},[h]);const P=t?{surface:"#000000",surfaceElevated:"#000000",surfaceHover:"#262626",border:"#262626",borderLight:"#404040",textPrimary:"#ffffff",textSecondary:"#a3a3a3",textTertiary:"#737373",accent:e,accentHover:`${e}e6`,error:"#ef4444"}:{surface:"#ffffff",surfaceElevated:"#fafafa",surfaceHover:"#f5f5f5",border:"#e5e5e5",borderLight:"#f0f0f0",textPrimary:"#171717",textSecondary:"#525252",textTertiary:"#a3a3a3",accent:e,accentHover:`${e}e6`,error:"#ef4444"},A={wrapper:{position:"relative",display:"inline-block"},avatarButton:{display:"flex",alignItems:"center",gap:I?"6px":"8px",padding:I?"6px 10px 6px 6px":"8px 12px 8px 8px",borderRadius:"24px",backgroundColor:P.surface,cursor:"pointer",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",minWidth:I?"auto":"140px",maxWidth:I?"200px":"none",outline:"none"},avatarImage:{width:I?"28px":"32px",height:I?"28px":"32px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${P.borderLight}`,flexShrink:0},userInfo:{display:"flex",flexDirection:"column",alignItems:"flex-start",flex:1,minWidth:0,overflow:"hidden"},userName:{fontSize:I?"13px":"14px",fontWeight:600,color:P.textPrimary,lineHeight:"1.2",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:I?"80px":"120px"},userEmail:{fontSize:I?"11px":"12px",color:P.textTertiary,lineHeight:"1.2",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:I?"80px":"120px"},chevron:{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",color:P.textTertiary,flexShrink:0},dropdown:{position:"absolute",top:"100%",marginTop:"8px",[G?"left":"right"]:"0",backgroundColor:P.surfaceElevated,border:`1px solid ${P.border}`,borderRadius:"12px",boxShadow:"0 20px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1)",width:"min(280px, 90vw)",maxWidth:"calc(100vw - 20px)",padding:"6px 6px 16px 6px",zIndex:1e3,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",opacity:h?1:0,pointerEvents:h?"auto":"none",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",transform:h?"translateY(0) scale(1)":"translateY(-8px) scale(0.95)",overflow:"hidden"},dropdownSection:{padding:I?"10px 12px":"0px 16px","&:last-child":{borderBottom:"none"}},userSection:{display:"flex",alignItems:"center",gap:I?"10px":"12px",padding:I?"14px":"16px"},dropdownAvatar:{width:I?"40px":"48px",height:I?"40px":"48px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${P.borderLight}`,flexShrink:0},dropdownUserInfo:{display:"flex",flexDirection:"column",flex:1,minWidth:0},dropdownUserName:{fontSize:I?"15px":"16px",fontWeight:600,color:P.textPrimary,lineHeight:"1.2",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis"},dropdownUserEmail:{fontSize:I?"13px":"14px",color:P.textSecondary,lineHeight:"1.2",overflow:"hidden",textOverflow:"ellipsis"},menuItem:{display:"flex",alignItems:"center",gap:I?"10px":"12px",padding:I?"10px 12px":"12px 16px",borderRadius:"8px",cursor:"pointer",transition:"all 0.15s ease",color:P.textPrimary,textDecoration:"none",border:"none",background:"none",width:"100%",fontSize:I?"13px":"14px",textAlign:"left",outline:"none"},menuItemText:{flex:1},icon:{width:I?"16px":"18px",height:I?"16px":"18px",color:P.textSecondary,flexShrink:0},logoutButton:{display:"flex",alignItems:"center",gap:I?"10px":"12px",padding:I?"10px 12px":"12px 16px",borderRadius:"8px",cursor:"pointer",transition:"all 0.15s ease",background:"none",border:"none",width:"100%",fontSize:I?"13px":"14px",color:P.error,textAlign:"left",outline:"none"},errorState:{padding:I?"16px 12px":"20px 16px",textAlign:"center",color:P.textSecondary,fontSize:I?"13px":"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",flexDirection:"column"},retryButton:{marginTop:"8px",padding:"8px 16px",backgroundColor:P.accent,color:"#ffffff",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:500,transition:"background-color 0.2s ease"},loadingContainer:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px",padding:"16px"},loadingSkeleton:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},skeletonAvatar:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:"#e5e7eb",animation:"pulse 1.5s infinite ease-in-out"},skeletonTextBlock:{flex:1,display:"flex",flexDirection:"column",gap:"6px"},skeletonLineShort:{width:"40%",height:"10px",borderRadius:"6px",backgroundColor:"#e5e7eb",animation:"pulse 1.5s infinite ease-in-out"},skeletonLineLong:{width:"70%",height:"10px",borderRadius:"6px",backgroundColor:"#e5e7eb",animation:"pulse 1.5s infinite ease-in-out"}},M=async()=>{j(null),D(!0);try{if(i){if(!i.id||!i.name||!i.email)throw new Error("Invalid user data provided");g(i);return}const l=await w.checkUserSession();if(!l?.authenticated||!l.user){g(null),j("User is not authenticated");return}const m={id:l.user.id,email:l.user.email,name:l.user.email.split("@")[0]};g(m)}catch(l){console.error("Retry failed:",l),g(null),j(l.message||"Failed to reload user")}finally{D(!1)}},K=(l,m)=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),m())},H=()=>a||T?.profileUrl,F=()=>{const l=H();l&&window.open(l,"_self","noopener,noreferrer")},J=()=>{c&&window.open(c,"_self","noopener,noreferrer")};return r.jsxs("div",{style:A.wrapper,ref:q,className:o,role:"menu","aria-label":"User menu",children:[s==="classic"?r.jsx("div",{ref:O,onClick:()=>R(l=>!l),onKeyDown:l=>K(l,()=>R(m=>!m)),tabIndex:0,role:"button","aria-haspopup":"true","aria-expanded":h,"aria-label":"Toggle user menu",children:T?.avatarUrl?r.jsx("img",{src:T.avatarUrl,alt:`${T?.name||"User"}'s avatar`,style:{width:I?"34px":"36px",height:I?"34px":"36px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${P.borderLight}`,flexShrink:0},loading:"lazy",onError:l=>{const m=l.target;m.onerror=null,m.src=`https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(T?.name||"User")}`}}):r.jsx("img",{src:`https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(T?.name||"User")}`,alt:"Default user avatar",style:{width:I?"34px":"40px",height:I?"34px":"40px",borderRadius:"50%",objectFit:"cover",border:`2px solid ${P.borderLight}`,flexShrink:0},loading:"lazy"})}):r.jsxs("div",{ref:O,style:A.avatarButton,onClick:()=>R(l=>!l),onKeyDown:l=>K(l,()=>R(m=>!m)),tabIndex:0,role:"button","aria-haspopup":"true","aria-expanded":h,"aria-label":"Toggle user menu",onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.surfaceHover,l.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.15)"},onMouseOut:l=>{l.currentTarget.style.backgroundColor=P.surface,l.currentTarget.style.boxShadow="none"},onBlur:l=>{l.currentTarget.style.outline="none"},children:[T?.avatarUrl?r.jsx("img",{src:T.avatarUrl,alt:`${T.name}'s avatar`,style:A.avatarImage,loading:"lazy",onError:l=>{const m=l.target;m.src="https://api.dicebear.com/9.x/glass/svg?seed=Kingston"}}):r.jsx("img",{src:"https://api.dicebear.com/9.x/glass/svg?seed=Kingston",alt:"Default user avatar",style:A.avatarImage,loading:"lazy"}),!I&&r.jsxs("div",{style:A.userInfo,children:[r.jsx("div",{style:A.userName,title:T?.name,children:T?.name||"Guest"}),T?.email&&r.jsx("div",{style:A.userEmail,title:T.email,children:T.email})]}),r.jsx(Nn,{size:I?14:16,style:A.chevron,"aria-hidden":"true"})]}),h&&r.jsx("div",{style:A.dropdown,role:"menu","aria-label":"User options",children:z?r.jsxs("div",{style:A.loadingContainer,role:"status","aria-live":"polite",children:[r.jsx(se,{size:18,className:"animate-spin",style:{color:P.textSecondary},"aria-hidden":"true"}),r.jsxs("div",{style:A.loadingSkeleton,children:[r.jsx("div",{style:A.skeletonAvatar}),r.jsxs("div",{style:A.skeletonTextBlock,children:[r.jsx("div",{style:A.skeletonLineShort}),r.jsx("div",{style:A.skeletonLineLong})]})]})]}):T?r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:A.userSection,children:[T?.avatarUrl?r.jsx("img",{src:T.avatarUrl,alt:`${T.name}'s profile picture`,style:A.dropdownAvatar,loading:"lazy",onError:l=>{const m=l.target;m.src=`https://api.dicebear.com/9.x/initials/svg?seed=${T.name}`}}):r.jsx("img",{src:`https://api.dicebear.com/9.x/initials/svg?seed=${T.name}`,alt:`${T.name}'s default avatar`,style:A.dropdownAvatar,loading:"lazy"}),r.jsxs("div",{style:A.dropdownUserInfo,children:[r.jsx("div",{style:A.dropdownUserName,title:T.name,children:T.name}),r.jsx("div",{style:A.dropdownUserEmail,title:T.email,children:T.email})]})]}),r.jsxs("div",{style:A.dropdownSection,children:[d&&H()&&r.jsxs("button",{style:A.menuItem,onClick:F,onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.surfaceHover},onMouseOut:l=>{l.currentTarget.style.backgroundColor="transparent"},onKeyDown:l=>K(l,F),role:"menuitem",tabIndex:0,children:[r.jsx(me,{style:A.icon,"aria-hidden":"true"}),r.jsx("span",{style:A.menuItemText,children:y})]}),f&&c&&r.jsxs("button",{style:A.menuItem,onClick:J,onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.surfaceHover},onMouseOut:l=>{l.currentTarget.style.backgroundColor="transparent"},onKeyDown:l=>K(l,J),role:"menuitem",tabIndex:0,children:[r.jsx(Yn,{style:A.icon,"aria-hidden":"true"}),r.jsx("span",{style:A.menuItemText,children:E})]}),x&&T.profileUrl&&r.jsxs("a",{href:T.profileUrl,target:"_self",rel:"noopener noreferrer",style:A.menuItem,onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.surfaceHover},onMouseOut:l=>{l.currentTarget.style.backgroundColor="transparent"},role:"menuitem",tabIndex:0,children:[r.jsx(pe,{style:A.icon,"aria-hidden":"true"}),r.jsx("span",{style:A.menuItemText,children:C})]})]}),r.jsx("div",{style:A.dropdownSection,children:r.jsxs("button",{style:A.logoutButton,onClick:n,onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.surfaceHover},onMouseOut:l=>{l.currentTarget.style.backgroundColor="transparent"},onKeyDown:l=>K(l,n),role:"menuitem",tabIndex:0,children:[r.jsx(it,{style:{...A.icon,color:P.error},"aria-hidden":"true"}),r.jsx("span",{style:A.menuItemText,children:u})]})})]}):r.jsxs("div",{style:A.errorState,role:"alert",children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(oe,{size:16,"aria-hidden":"true"}),r.jsx("span",{children:b||"Not signed in"})]}),b&&b!=="Not signed in"&&r.jsx("button",{style:A.retryButton,onClick:M,onMouseOver:l=>{l.currentTarget.style.backgroundColor=P.accentHover},onMouseOut:l=>{l.currentTarget.style.backgroundColor=P.accent},children:"Try Again"})]})}),r.jsx("style",{children:`@keyframes pulse {
588
- 0% { opacity: 1; }
589
- 50% { opacity: 0.5; }
590
- 100% { opacity: 1; }
591
- }`})]})},os=({user:t,darkMode:e=!0,primaryColor:n="#00C212",onVerify:s})=>{const i=ge();if(!t)return r.jsxs("div",{style:{width:"100%",maxWidth:400,padding:24,borderRadius:12,backgroundColor:e?"#000000":"#f4f4f5",color:e?"#fff":"#18181b",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:5},children:[r.jsx(oe,{size:24,style:{marginBottom:8}}),r.jsx("p",{style:{margin:0},children:"User data is required to verify email."})]});const[o,a]=S.useState(!1),[c,d]=S.useState({email:t?.email||"",otp:""}),[f,x]=S.useState(!1),[y,E]=S.useState(!1),[C,u]=S.useState(null);S.useEffect(()=>{if(typeof window<"u"){const b=()=>a(window.innerWidth<768);return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)}},[]);const w=(b,j)=>{let q=parseInt(b.replace("#",""),16),O=(q>>16)+j,G=(q>>8&255)+j,W=(q&255)+j;return O=Math.min(255,Math.max(0,O)),G=Math.min(255,Math.max(0,G)),W=Math.min(255,Math.max(0,W)),`#${(W|G<<8|O<<16).toString(16).padStart(6,"0")}`},h=e?{surface:"#000000",textPrimary:"#ffffff",textSecondary:"#d4d4d8",textTertiary:"#a1a1aa",border:"#27272a",accent:n,accentHover:w(n,-15),success:w(n,0),warning:"#f59e0b"}:{surface:"#fafafa",textPrimary:"#18181b",textSecondary:"#52525b",textTertiary:"#71717a",border:"#e4e4e7",accent:n,accentHover:w(n,-15),success:w(n,0),warning:"#d97706"};S.useEffect(()=>{t?.email&&d(b=>({...b,email:t.email}))},[t?.email]);const R=(b,j)=>{u({type:b,message:j}),setTimeout(()=>u(null),3e3)},T=async()=>{if(!c.email||!/\S+@\S+\.\S+/.test(c.email)){R("error","Please enter a valid email");return}if(!t?.id){R("error","User ID missing");return}try{E(!0);const b=await i.requestEmailVerificationOTP({userId:t.id,email:c.email});if(console.log("Send OTP response:",b),b.success||b.data?.success){const j=b.message||b.data?.message||"OTP sent!";R("success",j),x(!0)}else{const j=b.message||b.data?.message||"Failed to send OTP";R("error",j)}}catch(b){console.error("Send OTP error:",b),R("error",b.message||"Server error")}finally{E(!1)}},g=async b=>{if(b.preventDefault(),!c.email||!c.otp){R("error","Please fill in all fields");return}try{E(!0);const j=await i.verifyEmail({email:c.email,otp:c.otp});if(j.success){const q={...t,isVerified:!0};s?.(q),R("success",j.message||"Email verified!"),x(!1),d({email:t.email,otp:""})}else R("error",j.message||"Verification failed")}catch(j){R("error",j.message||"Server error")}finally{E(!1)}},z={width:"100%",padding:"12px 12px 12px 40px",borderRadius:8,border:`1px solid ${h.border}`,backgroundColor:e?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",color:h.textPrimary,fontSize:14,outline:"none"},D=(b=!1)=>({flex:1,padding:12,borderRadius:8,color:"#fff",fontWeight:500,cursor:b?"not-allowed":"pointer",background:`linear-gradient(to right, ${h.accent}, ${h.accentHover})`,opacity:b?.7:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8,fontSize:14,border:"none"});return r.jsxs("form",{onSubmit:g,style:{width:"100%",maxWidth:o?"340px":"400px",display:"flex",flexDirection:"column",gap:20,backgroundColor:h.surface,padding:24,borderRadius:10,border:`1px solid ${h.border}`,boxShadow:e?"0 6px 24px rgba(0,0,0,0.4)":"0 6px 24px rgba(0,0,0,0.08)"},children:[r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[r.jsx($n,{size:32,color:h.accent}),r.jsx("h2",{style:{margin:0,fontSize:20,fontWeight:600,color:h.textPrimary},children:"Verify Your Email"}),r.jsx("p",{style:{margin:0,fontSize:13,color:h.textSecondary,textAlign:"center"},children:"Enter your email and OTP to confirm your account"})]}),C&&r.jsxs("div",{style:{padding:"12px 20px",borderRadius:12,fontSize:13,fontWeight:500,color:C.type==="success"?h.success:h.warning,border:`1px solid ${C.type==="success"?h.success:h.warning}`,backgroundColor:C.type==="success"?`${h.success}20`:`${h.warning}20`,display:"flex",alignItems:"center",gap:8},children:[C.type==="success"?r.jsx(de,{size:16}):r.jsx(oe,{size:16}),C.message]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[r.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[r.jsx(pe,{size:18,style:{position:"absolute",left:12,color:h.textTertiary,pointerEvents:"none"}}),r.jsx("input",{type:"email",value:c.email,onChange:b=>d(j=>({...j,email:b.target.value})),placeholder:"Enter your email",style:{...z,paddingLeft:40,height:40,borderRadius:8,boxShadow:e?"0 2px 6px rgba(0,0,0,0.3)":"0 2px 6px rgba(0,0,0,0.08)"},required:!0})]}),r.jsx("small",{style:{fontSize:11,color:h.textTertiary,marginTop:2},children:"We'll send a verification code to this email"})]}),f&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[r.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[r.jsx(st,{size:18,style:{position:"absolute",left:12,color:h.textTertiary,pointerEvents:"none"}}),r.jsx("input",{type:"text",value:c.otp,onChange:b=>d(j=>({...j,otp:b.target.value})),placeholder:"Enter OTP",style:{...z,paddingLeft:40,height:40,borderRadius:8,boxShadow:e?"0 2px 6px rgba(0,0,0,0.3)":"0 2px 6px rgba(0,0,0,0.08)"},required:!0})]}),r.jsx("small",{style:{fontSize:11,color:h.textTertiary,marginTop:2},children:"Check your inbox for the 6-digit code"})]}),r.jsx("div",{style:{display:"flex",gap:12},children:f?r.jsxs("button",{type:"submit",disabled:y,style:{...D(y),borderRadius:12,padding:"12px 16px",fontSize:14},children:[y?r.jsx(se,{size:16,className:"spinner"}):r.jsx(de,{size:16}),y?"Verifying...":"Verify Email"]}):r.jsxs("button",{type:"button",onClick:T,disabled:y||!t?.id,style:{...D(y),borderRadius:12,padding:"12px 16px",fontSize:14},children:[y?r.jsx(se,{size:16,className:"spinner"}):r.jsx(ot,{size:16}),y?"Sending...":"Send OTP"]})})]})};ee.AuthixProvider=Kn,ee.NeuctraAuthix=Tn,ee.ReactEmailVerification=os,ee.ReactSignedIn=Zn,ee.ReactSignedOut=Qn,ee.ReactUserButton=is,ee.ReactUserLogin=Gn,ee.ReactUserProfile=ss,ee.ReactUserSignUp=Xn,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}));
251
+ ${t?"bg-neutral-900 border-neutral-800":"bg-white border-gray-200"}
252
+ ${m||""}
253
+ `,style:{top:se.top,left:se.left},role:"menu","aria-label":"User options",children:g?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-3",children:[s.jsx(ye,{size:16,className:`animate-spin ${t?"text-gray-400":"text-gray-500"}`}),s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx("div",{className:`w-8 h-8 rounded-full animate-pulse ${t?"bg-neutral-800":"bg-gray-200"}`}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:`h-2 w-3/4 rounded ${t?"bg-neutral-800":"bg-gray-200"}`}),s.jsx("div",{className:`h-2 w-1/2 rounded ${t?"bg-neutral-800":"bg-gray-200"}`})]})]})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx("img",{src:p.avatarUrl||`https://api.dicebear.com/9.x/initials/svg?seed=${p.name}`,className:"w-7 h-7 rounded-full object-cover border"}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsx("div",{className:`text-xs font-semibold truncate ${t?"text-white":"text-gray-900"}`,children:p.name}),s.jsx("div",{className:`text-[10px] truncate ${t?"text-neutral-400":"text-gray-500"}`,children:p.email})]})]}),s.jsx("div",{className:"px-1 py-1 space-y-1",children:e?.map((N,$)=>{if(N.type==="divider")return s.jsx("div",{className:`h-px my-1 ${t?"bg-neutral-800":"bg-gray-200/40"}`},$);const A=`flex items-center gap-2 w-full px-2 py-2 rounded-lg text-xs transition-all
254
+ ${t?"text-white hover:bg-neutral-800":"text-gray-900 hover:bg-gray-100"}`,O=s.jsxs(s.Fragment,{children:[N.icon&&s.jsx("span",{className:"text-gray-400 text-[11px]",children:N.icon}),s.jsx("span",{className:"flex-1",children:N.label})]});return N.href?s.jsx("a",{href:N.href,className:A,children:O},$):s.jsx("button",{onClick:N.onClick,className:A,children:O},$)})}),s.jsx("div",{className:"px-1 pt-1",children:s.jsxs("button",{onClick:r,className:`
255
+ flex items-center gap-2 w-full px-2 py-2 rounded-lg text-xs
256
+ text-red-500 hover:bg-red-500/10 transition-all
257
+ `,children:[s.jsx(Dt,{size:14}),s.jsx("span",{children:o})]})})]}):s.jsxs("div",{className:"flex items-center justify-center p-3 text-xs text-gray-500",children:[s.jsx(be,{size:14,className:"mr-1"}),B||"Not signed in"]})})]})},sa=({user:t,darkMode:e=!0,primaryColor:r="#00C212",onVerify:n,containerClassName:a,containerStyle:o,buttonClassName:i,buttonStyle:l,sendButtonClassName:m,sendButtonStyle:u,verifyButtonClassName:f,verifyButtonStyle:b,inputClassName:j,inputStyle:P,emailInputClassName:p,emailInputStyle:h,otpInputClassName:g,otpInputStyle:_,notificationClassName:B,notificationStyle:k,successNotificationClassName:q,successNotificationStyle:F,errorNotificationClassName:X,errorNotificationStyle:R,headerClassName:M,headerStyle:H,titleClassName:se,titleStyle:Q,descriptionClassName:J,descriptionStyle:G,warningContainerClassName:W,warningContainerStyle:N})=>{const $=Fe();if(!t)return s.jsxs("div",{className:`w-full max-w-[400px] p-6 rounded-xl flex flex-col items-center gap-1 text-center
258
+ ${e?"bg-black text-white":"bg-zinc-100 text-zinc-900"}
259
+ ${W||""}
260
+ `,style:N,children:[s.jsx(be,{size:24,className:"mb-2"}),s.jsx("p",{className:"m-0",children:"User data is required to verify email."})]});const[A,O]=y.useState(!1),[D,Y]=y.useState({email:t?.email||"",otp:""}),[d,x]=y.useState(!1),[w,E]=y.useState(!1),[V,ce]=y.useState(null);y.useEffect(()=>{if(typeof window<"u"){const L=()=>O(window.innerWidth<768);return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)}},[]),y.useEffect(()=>{t?.email&&Y(L=>({...L,email:t.email}))},[t?.email]);const C=(L,ee)=>{ce({type:L,message:ee}),setTimeout(()=>ce(null),3e3)},oe=async()=>{if(!D.email||!/\S+@\S+\.\S+/.test(D.email)){C("error","Please enter a valid email");return}if(!t?.id){C("error","User ID missing");return}try{E(!0);const L=await $.requestEmailVerificationOTP({userId:t.id,email:D.email});if(console.log("Send OTP response:",L),L.success||L.data?.success){const ee=L.message||L.data?.message||"OTP sent!";C("success",ee),x(!0)}else{const ee=L.message||L.data?.message||"Failed to send OTP";C("error",ee)}}catch(L){console.error("Send OTP error:",L),C("error",L.message||"Server error")}finally{E(!1)}},ie=async L=>{if(L.preventDefault(),!D.email||!D.otp){C("error","Please fill in all fields");return}try{E(!0);const ee=await $.verifyEmail({email:D.email,otp:D.otp});if(ee.success){const de={...t,isVerified:!0};n?.(de),C("success",ee.message||"Email verified!"),x(!1),Y({email:t.email,otp:""})}else C("error",ee.message||"Verification failed")}catch(ee){C("error",ee.message||"Server error")}finally{E(!1)}};return s.jsxs("form",{onSubmit:ie,className:`w-full flex flex-col gap-5 p-6 rounded-xl border shadow-lg backdrop-blur-md
261
+ ${e?"bg-zinc-900/60 border-white/10 text-white":"bg-white border-zinc-200 text-black"}
262
+ ${A?"max-w-[340px]":"max-w-[400px]"}
263
+ ${a||""}
264
+ `,style:o,children:[s.jsxs("div",{className:`flex flex-col items-center text-center gap-2 ${M||""}`,style:H,children:[s.jsx(zn,{className:"text-[#00C212]",size:32}),s.jsx("h2",{className:`text-xl font-semibold ${se||""}`,style:Q,children:"Verify Your Email"}),s.jsx("p",{className:`text-sm text-zinc-400 ${J||""}`,style:G,children:"Enter your email and OTP to confirm your account"})]}),V&&s.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 rounded-lg text-sm border
265
+ ${V.type==="success"?`text-emerald-500 bg-emerald-500/10 border-emerald-500/30 ${q||""}`:`text-red-500 bg-red-500/10 border-red-500/30 ${X||""}`}
266
+ ${B||""}
267
+ `,style:V.type==="success"?{...k,...F}:{...k,...R},children:[V.type==="success"?s.jsx(Ee,{size:16}):s.jsx(be,{size:16}),V.message]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Le,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-400"}),s.jsx("input",{type:"email",value:D.email,onChange:L=>Y(ee=>({...ee,email:L.target.value})),placeholder:"Enter your email",required:!0,className:`w-full h-11 pl-10 pr-3 text-sm rounded-lg border outline-none transition
268
+ ${e?"bg-zinc-800/50 border-white/10 text-white placeholder:text-zinc-500 focus:border-emerald-500":"bg-zinc-50 border-zinc-200 text-black placeholder:text-zinc-400 focus:border-emerald-500"}
269
+ ${j||""} ${p||""}
270
+ `,style:{...P,...h}})]}),s.jsx("small",{className:"text-xs text-zinc-500",children:"We'll send a verification code to this email"})]}),d&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(qt,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-400"}),s.jsx("input",{type:"text",value:D.otp,onChange:L=>Y(ee=>({...ee,otp:L.target.value})),placeholder:"Enter OTP",required:!0,className:`w-full h-11 pl-10 pr-3 text-sm rounded-lg border outline-none transition
271
+ ${e?"bg-zinc-800/50 border-white/10 text-white placeholder:text-zinc-500 focus:border-emerald-500":"bg-zinc-50 border-zinc-200 text-black placeholder:text-zinc-400 focus:border-emerald-500"}
272
+ ${j||""} ${g||""}
273
+ `,style:{...P,..._}})]}),s.jsx("small",{className:"text-xs text-zinc-500",children:"Check your inbox for the 6-digit code"})]}),s.jsx("div",{className:"flex gap-3",children:d?s.jsxs("button",{type:"submit",disabled:w,className:`flex-1 flex items-center justify-center gap-2 h-11 rounded-lg text-sm font-medium
274
+ bg-[#00C212] hover:bg-[#00C212]/90 text-white
275
+ disabled:opacity-60 disabled:cursor-not-allowed transition
276
+ ${i||""} ${f||""}
277
+ `,style:{...l,...b},children:[w?s.jsx(ye,{size:16,className:"animate-spin"}):s.jsx(Ee,{size:16}),w?"Verifying...":"Verify Email"]}):s.jsxs("button",{type:"button",onClick:oe,disabled:w||!t?.id,className:`flex-1 flex items-center justify-center gap-2 h-11 rounded-lg text-sm font-medium
278
+ bg-[#00C212] hover:bg-[#00C212]/90 text-white
279
+ disabled:opacity-60 disabled:cursor-not-allowed transition
280
+ ${i||""} ${m||""}
281
+ `,style:{...l,...u},children:[w?s.jsx(ye,{size:16,className:"animate-spin"}):s.jsx(Vt,{size:16}),w?"Sending...":"Send OTP"]})})]})};pe.AuthixProvider=Wn,pe.NeuctraAuthix=Sn,pe.ReactEmailVerification=sa,pe.ReactSignedIn=Kn,pe.ReactSignedOut=Xn,pe.ReactUserButton=ra,pe.ReactUserLogin=Yn,pe.ReactUserProfile=ta,pe.ReactUserSignUp=Jn,Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"})}));