@neuctra/authix 1.1.24 → 1.1.26
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.
- package/dist/neuctra-authix.es.js +521 -498
- package/dist/neuctra-authix.umd.js +2 -2
- package/dist/react/SignedIn.d.ts +1 -1
- package/dist/react/SignedIn.d.ts.map +1 -1
- package/dist/react/SignedOut.d.ts +1 -6
- package/dist/react/SignedOut.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
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 s=new this(e);return r.forEach(o=>s.set(o)),s}static accessor(e){const s=(this[Pt]=this[Pt]={accessors:{}}).accessors,o=this.prototype;function a(i){const l=Ce(i);s[l]||(dn(o,i),s[l]=!0)}return p.isArray(e)?e.forEach(a):a(e),this}};ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(ne.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),p.freezeMethods(ne);function Ge(t,e){const r=this||Ee,s=e||r,o=ne.from(s.headers);let a=s.data;return p.forEach(t,function(l){a=l.call(r,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function Ot(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){D.call(this,t??"canceled",D.ERR_CANCELED,e,r),this.name="CanceledError"}p.inherits(be,D,{__CANCEL__:!0});function Rt(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new D("Request failed with status code "+r.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function cn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function un(t,e){t=t||10;const r=new Array(t),s=new Array(t);let o=0,a=0,i;return e=e!==void 0?e:1e3,function(h){const d=Date.now(),u=s[a];i||(i=d),r[o]=h,s[o]=d;let b=a,y=0;for(;b!==o;)y+=r[b++],b=b%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),d-i<e)return;const S=u&&d-u;return S?Math.round(y*1e3/S):void 0}}function pn(t,e){let r=0,s=1e3/e,o,a;const i=(d,u=Date.now())=>{r=u,o=null,a&&(clearTimeout(a),a=null),t(...d)};return[(...d)=>{const u=Date.now(),b=u-r;b>=s?i(d,u):(o=d,a||(a=setTimeout(()=>{a=null,i(o)},s-b)))},()=>o&&i(o)]}const Ue=(t,e,r=3)=>{let s=0;const o=un(50,250);return pn(a=>{const i=a.loaded,l=a.lengthComputable?a.total:void 0,h=i-s,d=o(h),u=i<=l;s=i;const b={loaded:i,total:l,progress:l?i/l:void 0,bytes:h,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(b)},r)},zt=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},_t=t=>(...e)=>p.asap(()=>t(...e)),fn=ee.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,ee.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(ee.origin),ee.navigator&&/(msie|trident)/i.test(ee.navigator.userAgent)):()=>!0,xn=ee.hasStandardBrowserEnv?{write(t,e,r,s,o,a){const i=[t+"="+encodeURIComponent(e)];p.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),p.isString(s)&&i.push("path="+s),p.isString(o)&&i.push("domain="+o),a===!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 hn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function gn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function At(t,e,r){let s=!hn(e);return t&&(s||r==!1)?gn(t,e):e}const $t=t=>t instanceof ne?{...t}:t;function fe(t,e){e=e||{};const r={};function s(d,u,b,y){return p.isPlainObject(d)&&p.isPlainObject(u)?p.merge.call({caseless:y},d,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function o(d,u,b,y){if(p.isUndefined(u)){if(!p.isUndefined(d))return s(void 0,d,b,y)}else return s(d,u,b,y)}function a(d,u){if(!p.isUndefined(u))return s(void 0,u)}function i(d,u){if(p.isUndefined(u)){if(!p.isUndefined(d))return s(void 0,d)}else return s(void 0,u)}function l(d,u,b){if(b in e)return s(d,u);if(b in t)return s(void 0,d)}const h={url:a,method:a,data:a,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:(d,u,b)=>o($t(d),$t(u),b,!0)};return p.forEach(Object.keys({...t,...e}),function(u){const b=h[u]||o,y=b(t[u],e[u],u);p.isUndefined(y)&&b!==l||(r[u]=y)}),r}const Nt=t=>{const e=fe({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:l}=e;if(e.headers=i=ne.from(i),e.url=Et(At(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),p.isFormData(r)){if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(p.isFunction(r.getHeaders)){const h=r.getHeaders(),d=["content-type","content-length"];Object.entries(h).forEach(([u,b])=>{d.includes(u.toLowerCase())&&i.set(u,b)})}}if(ee.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(e)),s||s!==!1&&fn(e.url))){const h=o&&a&&xn.read(a);h&&i.set(o,h)}return e},mn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,s){const o=Nt(t);let a=o.data;const i=ne.from(o.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:d}=o,u,b,y,S,c;function j(){S&&S(),c&&c(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function A(){if(!m)return;const _=ne.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),M={data:!l||l==="text"||l==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:_,config:t,request:m};Rt(function(O){r(O),j()},function(O){s(O),j()},M),m=null}"onloadend"in m?m.onloadend=A:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(A)},m.onabort=function(){m&&(s(new D("Request aborted",D.ECONNABORTED,t,m)),m=null)},m.onerror=function(T){const M=T&&T.message?T.message:"Network Error",g=new D(M,D.ERR_NETWORK,t,m);g.event=T||null,s(g),m=null},m.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const M=o.transitional||Tt;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),s(new D(T,M.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,t,m)),m=null},a===void 0&&i.setContentType(null),"setRequestHeader"in m&&p.forEach(i.toJSON(),function(T,M){m.setRequestHeader(M,T)}),p.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),l&&l!=="json"&&(m.responseType=o.responseType),d&&([y,c]=Ue(d,!0),m.addEventListener("progress",y)),h&&m.upload&&([b,S]=Ue(h),m.upload.addEventListener("progress",b),m.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(u=_=>{m&&(s(!_||_.type?new be(null,t,m):_),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const P=cn(o.url);if(P&&ee.protocols.indexOf(P)===-1){s(new D("Unsupported protocol "+P+":",D.ERR_BAD_REQUEST,t));return}m.send(a||null)})},yn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,o;const a=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;s.abort(u instanceof D?u:new be(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{i=null,a(new D(`timeout ${e} of ms exceeded`,D.ETIMEDOUT))},e);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),t=null)};t.forEach(d=>d.addEventListener("abort",a));const{signal:h}=s;return h.unsubscribe=()=>p.asap(l),h}},bn=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,o;for(;s<r;)o=s+e,yield t.slice(s,o),s=o},wn=async function*(t,e){for await(const r of Sn(t))yield*bn(r,e)},Sn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},Ut=(t,e,r,s)=>{const o=wn(t,e);let a=0,i,l=h=>{i||(i=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:d,value:u}=await o.next();if(d){l(),h.close();return}let b=u.byteLength;if(r){let y=a+=b;r(y)}h.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(h){return l(h),o.return()}},{highWaterMark:2})},Dt=64*1024,{isFunction:De}=p,jn=(({Request:t,Response:e})=>({Request:t,Response:e}))(p.global),{ReadableStream:Lt,TextEncoder:Ft}=p.global,Mt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},vn=t=>{t=p.merge.call({skipUndefined:!0},jn,t);const{fetch:e,Request:r,Response:s}=t,o=e?De(e):typeof fetch=="function",a=De(r),i=De(s);if(!o)return!1;const l=o&&De(Lt),h=o&&(typeof Ft=="function"?(c=>j=>c.encode(j))(new Ft):async c=>new Uint8Array(await new r(c).arrayBuffer())),d=a&&l&&Mt(()=>{let c=!1;const j=new r(ee.origin,{body:new Lt,method:"POST",get duplex(){return c=!0,"half"}}).headers.has("Content-Type");return c&&!j}),u=i&&l&&Mt(()=>p.isReadableStream(new s("").body)),b={stream:u&&(c=>c.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(c=>{!b[c]&&(b[c]=(j,m)=>{let A=j&&j[c];if(A)return A.call(j);throw new D(`Response type '${c}' is not supported`,D.ERR_NOT_SUPPORT,m)})});const y=async c=>{if(c==null)return 0;if(p.isBlob(c))return c.size;if(p.isSpecCompliantForm(c))return(await new r(ee.origin,{method:"POST",body:c}).arrayBuffer()).byteLength;if(p.isArrayBufferView(c)||p.isArrayBuffer(c))return c.byteLength;if(p.isURLSearchParams(c)&&(c=c+""),p.isString(c))return(await h(c)).byteLength},S=async(c,j)=>{const m=p.toFiniteNumber(c.getContentLength());return m??y(j)};return async c=>{let{url:j,method:m,data:A,signal:P,cancelToken:_,timeout:T,onDownloadProgress:M,onUploadProgress:g,responseType:O,headers:v,withCredentials:U="same-origin",fetchOptions:q}=Nt(c),F=e||fetch;O=O?(O+"").toLowerCase():"text";let V=yn([P,_&&_.toAbortSignal()],T),Z=null;const I=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let J;try{if(g&&d&&m!=="get"&&m!=="head"&&(J=await S(v,A))!==0){let f=new r(j,{method:"POST",body:A,duplex:"half"}),k;if(p.isFormData(A)&&(k=f.headers.get("content-type"))&&v.setContentType(k),f.body){const[x,E]=zt(J,Ue(_t(g)));A=Ut(f.body,Dt,x,E)}}p.isString(U)||(U=U?"include":"omit");const z=a&&"credentials"in r.prototype,R={...q,signal:V,method:m.toUpperCase(),headers:v.normalize().toJSON(),body:A,duplex:"half",credentials:z?U:void 0};Z=a&&new r(j,R);let K=await(a?F(Z,q):F(j,R));const te=u&&(O==="stream"||O==="response");if(u&&(M||te&&I)){const f={};["status","statusText","headers"].forEach($=>{f[$]=K[$]});const k=p.toFiniteNumber(K.headers.get("content-length")),[x,E]=M&&zt(k,Ue(_t(M),!0))||[];K=new s(Ut(K.body,Dt,x,()=>{E&&E(),I&&I()}),f)}O=O||"text";let X=await b[p.findKey(b,O)||"text"](K,c);return!te&&I&&I(),await new Promise((f,k)=>{Rt(f,k,{data:X,headers:ne.from(K.headers),status:K.status,statusText:K.statusText,config:c,request:Z})})}catch(z){throw I&&I(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new D("Network Error",D.ERR_NETWORK,c,Z),{cause:z.cause||z}):D.from(z,z&&z.code,c,Z)}}},kn=new Map,Wt=t=>{let e=t?t.env:{};const{fetch:r,Request:s,Response:o}=e,a=[s,o,r];let i=a.length,l=i,h,d,u=kn;for(;l--;)h=a[l],d=u.get(h),d===void 0&&u.set(h,d=l?new Map:vn(e)),u=d;return d};Wt();const Ze={http:Hr,xhr:mn,fetch:{get:Wt}};p.forEach(Ze,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const qt=t=>`- ${t}`,En=t=>p.isFunction(t)||t===null||t===!1,Bt={getAdapter:(t,e)=>{t=p.isArray(t)?t:[t];const{length:r}=t;let s,o;const a={};for(let i=0;i<r;i++){s=t[i];let l;if(o=s,!En(s)&&(o=Ze[(l=String(s)).toLowerCase()],o===void 0))throw new D(`Unknown adapter '${l}'`);if(o&&(p.isFunction(o)||(o=o.get(e))))break;a[l||"#"+i]=o}if(!o){const i=Object.entries(a).map(([h,d])=>`adapter ${h} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since :
|
|
4
4
|
`+i.map(qt).join(`
|
|
5
5
|
`):" "+qt(i[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:Ze};function Qe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function Ht(t){return Qe(t),t.headers=ne.from(t.headers),t.data=Ge.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bt.getAdapter(t.adapter||Ee.adapter,t)(t).then(function(s){return Qe(t),s.data=Ge.call(t,t.transformResponse,s),s.headers=ne.from(s.headers),s},function(s){return Ot(s)||(Qe(t),s&&s.response&&(s.response.data=Ge.call(t,t.transformResponse,s.response),s.response.headers=ne.from(s.response.headers))),Promise.reject(s)})}const Vt="1.12.2",Le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Le[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Yt={};Le.transitional=function(e,r,s){function o(a,i){return"[Axios v"+Vt+"] Transitional option '"+a+"'"+i+(s?". "+s:"")}return(a,i,l)=>{if(e===!1)throw new D(o(i," has been removed"+(r?" in "+r:"")),D.ERR_DEPRECATED);return r&&!Yt[i]&&(Yt[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,i,l):!0}},Le.spelling=function(e){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Cn(t,e,r){if(typeof t!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let o=s.length;for(;o-- >0;){const a=s[o],i=e[a];if(i){const l=t[a],h=l===void 0||i(l,a,t);if(h!==!0)throw new D("option "+a+" must be "+h,D.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new D("Unknown option "+a,D.ERR_BAD_OPTION)}}const Fe={assertOptions:Cn,validators:Le},ae=Fe.validators;let xe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ct,response:new Ct}}async request(e,r){try{return await this._request(e,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
-
`+a):s.stack=a}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=fe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:a}=r;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Fe.assertOptions(o,{encode:ae.function,serialize:ae.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fe.assertOptions(r,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&p.merge(a.common,a[r.method]);a&&p.forEach(["delete","get","head","post","put","patch","common"],c=>{delete a[c]}),r.headers=ne.concat(i,a);const l=[];let h=!0;this.interceptors.request.forEach(function(j){typeof j.runWhen=="function"&&j.runWhen(r)===!1||(h=h&&j.synchronous,l.unshift(j.fulfilled,j.rejected))});const d=[];this.interceptors.response.forEach(function(j){d.push(j.fulfilled,j.rejected)});let u,b=0,y;if(!h){const c=[Ht.bind(this),void 0];for(c.unshift(...l),c.push(...d),y=c.length,u=Promise.resolve(r);b<y;)u=u.then(c[b++],c[b++]);return u}y=l.length;let S=r;for(;b<y;){const c=l[b++],j=l[b++];try{S=c(S)}catch(m){j.call(this,m);break}}try{u=Ht.call(this,S)}catch(c){return Promise.reject(c)}for(b=0,y=d.length;b<y;)u=u.then(d[b++],d[b++]);return u}getUri(e){e=fe(this.defaults,e);const r=At(e.baseURL,e.url,e.allowAbsoluteUrls);return Et(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,s){return this.request(fe(s||{},{method:e,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function r(s){return function(a,i,l){return this.request(fe(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});let Tn=class ir{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const s=this;this.promise.then(o=>{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](o);s._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(l=>{s.subscribe(l),a=l}).then(o);return i.cancel=function(){s.unsubscribe(a)},i},e(function(a,i,l){s.reason||(s.reason=new be(a,i,l),r(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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new ir(function(o){e=o}),cancel:e}}};function In(t){return function(r){return t.apply(null,r)}}function Pn(t){return p.isObject(t)&&t.isAxiosError===!0}const et={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(et).forEach(([t,e])=>{et[e]=t});function Kt(t){const e=new xe(t),r=ct(xe.prototype.request,e);return p.extend(r,xe.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Kt(fe(t,o))},r}const W=Kt(Ee);W.Axios=xe,W.CanceledError=be,W.CancelToken=Tn,W.isCancel=Ot,W.VERSION=Vt,W.toFormData=$e,W.AxiosError=D,W.Cancel=W.CanceledError,W.all=function(e){return Promise.all(e)},W.spread=In,W.isAxiosError=Pn,W.mergeConfig=fe,W.AxiosHeaders=ne,W.formToJSON=t=>It(p.isHTMLForm(t)?new FormData(t):t),W.getAdapter=Bt.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:bs,AxiosError:ws,CanceledError:Ss,isCancel:js,CancelToken:vs,VERSION:ks,all:Es,Cancel:Cs,isAxiosError:Ts,spread:Is,toFormData:Ps,AxiosHeaders:Os,HttpStatusCode:Rs,formToJSON:zs,getAdapter:_s,mergeConfig:As}=W;class On{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(e,r,s,o={}){if(!e)throw new Error("HTTP method is required");if(!r)throw new Error("Request path is required");try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:e,data:a,headers:o})).data}catch(a){if(console.error("❌ [Request Error]:",a),a.isAxiosError){const i=a.response?.status||0,l=a.response?.data?.message||a.message||"Unknown Axios error occurred";throw new Error(`Request failed (${i}): ${l}`)}throw new Error(`Unexpected error: ${a.message||"Unknown failure"}`)}}async signup(e){const{name:r,email:s,password:o}=e;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",e)}async login(e){const{email:r,password:s,appId:o}=e;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...e,appId:s||this.appId})}async changePassword(e){const{userId:r,currentPassword:s,newPassword:o,appId:a}=e;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:a||this.appId})}async deleteUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(e){const{token:r}=e;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(e){const{token:r,appId:s}=e;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(e){const{token:r,otp:s,appId:o}=e;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(e){const{email:r,appId:s}=e;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(e){const{email:r,otp:s,newPassword:o,appId:a}=e;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:a||this.appId})}async searchAllUsersData(e){if(!this.appId)throw new Error("searchAllUsersData: appId missing");const r=new URLSearchParams(e).toString();return this.request("GET",`/users/${this.appId}/data/search?${r}`)}async searchUserData(e){const{userId:r,...s}=e;if(!r)throw new Error("userId required");const o=new URLSearchParams(s).toString();return this.request("GET",`/users/${r}/data/search?${o}`)}async getAllUsersData(){if(!this.appId)throw new Error("getAllUsersData: SDK 'appId' is missing in config");return this.request("GET",`/users/all-data/${this.appId}/data`)}async getUserData(e){const{userId:r}=e;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(e){const{userId:r,data:s}=e;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,s)}async updateUserData(e){const{userId:r,dataId:s,data:o}=e;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Me={exports:{}},Te={};/**
|
|
6
|
+
`+a):s.stack=a}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=fe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:a}=r;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Fe.assertOptions(o,{encode:ae.function,serialize:ae.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fe.assertOptions(r,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&p.merge(a.common,a[r.method]);a&&p.forEach(["delete","get","head","post","put","patch","common"],c=>{delete a[c]}),r.headers=ne.concat(i,a);const l=[];let h=!0;this.interceptors.request.forEach(function(j){typeof j.runWhen=="function"&&j.runWhen(r)===!1||(h=h&&j.synchronous,l.unshift(j.fulfilled,j.rejected))});const d=[];this.interceptors.response.forEach(function(j){d.push(j.fulfilled,j.rejected)});let u,b=0,y;if(!h){const c=[Ht.bind(this),void 0];for(c.unshift(...l),c.push(...d),y=c.length,u=Promise.resolve(r);b<y;)u=u.then(c[b++],c[b++]);return u}y=l.length;let S=r;for(;b<y;){const c=l[b++],j=l[b++];try{S=c(S)}catch(m){j.call(this,m);break}}try{u=Ht.call(this,S)}catch(c){return Promise.reject(c)}for(b=0,y=d.length;b<y;)u=u.then(d[b++],d[b++]);return u}getUri(e){e=fe(this.defaults,e);const r=At(e.baseURL,e.url,e.allowAbsoluteUrls);return Et(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,s){return this.request(fe(s||{},{method:e,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function r(s){return function(a,i,l){return this.request(fe(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});let Tn=class ir{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const s=this;this.promise.then(o=>{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](o);s._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(l=>{s.subscribe(l),a=l}).then(o);return i.cancel=function(){s.unsubscribe(a)},i},e(function(a,i,l){s.reason||(s.reason=new be(a,i,l),r(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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new ir(function(o){e=o}),cancel:e}}};function In(t){return function(r){return t.apply(null,r)}}function Pn(t){return p.isObject(t)&&t.isAxiosError===!0}const et={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(et).forEach(([t,e])=>{et[e]=t});function Kt(t){const e=new xe(t),r=ct(xe.prototype.request,e);return p.extend(r,xe.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Kt(fe(t,o))},r}const W=Kt(Ee);W.Axios=xe,W.CanceledError=be,W.CancelToken=Tn,W.isCancel=Ot,W.VERSION=Vt,W.toFormData=$e,W.AxiosError=D,W.Cancel=W.CanceledError,W.all=function(e){return Promise.all(e)},W.spread=In,W.isAxiosError=Pn,W.mergeConfig=fe,W.AxiosHeaders=ne,W.formToJSON=t=>It(p.isHTMLForm(t)?new FormData(t):t),W.getAdapter=Bt.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:bs,AxiosError:ws,CanceledError:Ss,isCancel:js,CancelToken:vs,VERSION:ks,all:Es,Cancel:Cs,isAxiosError:Ts,spread:Is,toFormData:Ps,AxiosHeaders:Os,HttpStatusCode:Rs,formToJSON:zs,getAdapter:_s,mergeConfig:As}=W;class On{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(e,r,s,o={}){if(!e)throw new Error("HTTP method is required");if(!r)throw new Error("Request path is required");try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:e,data:a,headers:o})).data}catch(a){if(console.error("❌ [Request Error]:",a),a.isAxiosError){const i=a.response?.status||0,l=a.response?.data?.message||a.message||"Unknown Axios error occurred";throw new Error(`Request failed (${i}): ${l}`)}throw new Error(`Unexpected error: ${a.message||"Unknown failure"}`)}}async signup(e){const{name:r,email:s,password:o}=e;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",e)}async login(e){const{email:r,password:s,appId:o}=e;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...e,appId:s||this.appId})}async changePassword(e){const{userId:r,currentPassword:s,newPassword:o,appId:a}=e;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:a||this.appId})}async deleteUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(e){const{token:r}=e;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(e){const{token:r,appId:s}=e;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(e){const{token:r,otp:s,appId:o}=e;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(e){const{email:r,appId:s}=e;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(e){const{email:r,otp:s,newPassword:o,appId:a}=e;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:a||this.appId})}async searchAllUsersData(e){if(!this.appId)throw new Error("searchAllUsersData: appId missing");const r=new URLSearchParams(e).toString();return this.request("GET",`/users/${this.appId}/data/search?${r}`)}async searchUserData(e){const{userId:r,...s}=e;if(!r)throw new Error("userId required");const o=new URLSearchParams(s).toString();return this.request("GET",`/users/${r}/data/search?${o}`)}async getAllUsersData(){if(!this.appId)throw new Error("getAllUsersData: SDK 'appId' is missing in config");return this.request("GET",`/users/all-data/${this.appId}/data`)}async getUserData(e){const{userId:r}=e;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(e){const{userId:r,dataCategory:s,data:o}=e;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!o)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,{dataCategory:s,...o})}async updateUserData(e){const{userId:r,dataId:s,data:o}=e;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Me={exports:{}},Te={};/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
9
9
|
*
|
|
@@ -204,7 +204,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
204
204
|
from { transform: rotate(0deg); }
|
|
205
205
|
to { transform: rotate(360deg); }
|
|
206
206
|
}
|
|
207
|
-
`})]})},es=async(t,e)=>{const{email:r,password:s,appId:o}=t,{baseUrl:a,apiKey:i}=e;if(!i)throw new Error("API key is required for login");try{const l=await W.post(`${a}/users/login`,{email:r,password:s,appId:o},{headers:{"Content-Type":"application/json","x-api-key":i}});return l.data?.user&&localStorage.setItem("userInfo",JSON.stringify(l.data.user)),l.data.user}catch(l){const h=l.response?.data?.message||l.message||"Login failed";throw console.error("Login API Error:",h),{success:!1,message:h,status:l.response?.status||500}}},ts=({logoUrl:t,logoLinkUrl:e,title:r="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",footerText:o="Secure authentication powered by Neuctra Authix",primaryColor:a="#00C214",gradient:i="linear-gradient(135deg, #22c55e, #00C214)",darkMode:l=!0,signupUrl:h,onSuccess:d,onError:u})=>{const{baseUrl:b,apiKey:y,appId:S}=ue(),[c,j]=w.useState("login"),[m,A]=w.useState(1),[P,_]=w.useState(!1),[T,M]=w.useState(!1),[g,O]=w.useState(null),[v,U]=w.useState(""),[q,F]=w.useState(""),[V,Z]=w.useState({email:"",otp:"",newPassword:"",appId:S}),[I,J]=w.useState(!1),z=l?"#ffffff":"#111827",R=l?"#a1a1aa":"#6b7280",K=l?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",te=l?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";w.useEffect(()=>{if(typeof window<"u"){const $=()=>J(window.innerWidth<768);return $(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)}},[]);const X=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await es({email:v,password:q,appId:S},{baseUrl:b,apiKey:y});O({type:"success",text:`Welcome ${N.name}`}),d?.(N)}catch(N){const Y=N.message||"Login failed";O({type:"error",text:Y}),u?.(N)}finally{M(!1)}},f=$=>{Z({...V,[$.target.name]:$.target.value})},k=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/forgot-password`,{email:V.email,appId:S},{headers:{"x-api-key":y}});N.data.success?(A(2),O({type:"success",text:"OTP sent to your email"})):O({type:"error",text:N.data.message||"Failed to send OTP"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},x=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/reset-password`,V,{headers:{"x-api-key":y}});N.data.success?(O({type:"success",text:"Password reset successfully!"}),A(1),Z({email:"",otp:"",newPassword:"",appId:S}),j("login")):O({type:"error",text:N.data.message||"Reset failed"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},E={width:"100%",padding:I?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:K,border:`1px solid ${te}`,borderRadius:"10px",color:z,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsxs("div",{style:{minWidth:I?"320px":"380px",maxWidth:I?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:l?"#000000":"#ffffff",padding:I?"30px 24px":"18px 28px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?n.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:n.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):n.jsx(Se,{size:40,color:a,style:{marginBottom:"10px"}}),n.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:z,margin:0},children:c==="login"?r:m===1?"Forgot Password":"Reset Password"}),n.jsx("p",{style:{fontSize:"14px",color:R},children:c==="login"?s:"Follow the steps to reset your password"})]}),c==="login"&&n.jsxs("form",{onSubmit:X,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:v,onChange:$=>U($.target.value),style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-password",type:P?"text":"password",placeholder:"Enter your password",value:q,onChange:$=>F($.target.value),style:E}),n.jsx("button",{type:"button",onClick:()=>_(!P),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:R,cursor:"pointer"},children:P?n.jsx(nt,{size:20}):n.jsx(st,{size:20})})]})]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[h&&n.jsx("a",{href:h,style:{color:a,textDecoration:"none",fontWeight:500},children:"Create new account"}),n.jsx("button",{type:"button",onClick:()=>j("forgot"),style:{background:"none",border:"none",color:a,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:T?"Signing In...":"Sign In"})]}),c==="forgot"&&n.jsxs("form",{onSubmit:m===1?k:x,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[m===1?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:V.email,onChange:f,style:E})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(tr,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:V.otp,onChange:f,style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"New Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:V.newPassword,onChange:f,style:E})]})]})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:T?"Please wait...":m===1?"Send Reset OTP":"Reset Password"}),n.jsx("button",{type:"button",onClick:()=>{j("login"),A(1)},style:{background:"none",border:"none",fontSize:"14px",color:R,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&n.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${a}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${a}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?a:"#ef4444"},children:[g.type==="success"?n.jsx(de,{size:20}):n.jsx(le,{size:20}),n.jsx("span",{children:g.text})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:R,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",n.jsx("span",{style:{color:a,fontWeight:600},children:"Neuctra Authix"})]})]})})},rs=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(!1);return w.useEffect(()=>{const l=()=>{if(typeof window>"u")return!1;try{const d=localStorage.getItem("userInfo");return!!(d&&d!=="undefined"&&d!=="null")}catch{return!1}},h=()=>i(l());return h(),typeof window<"u"&&window.addEventListener("storage",h),()=>{typeof window<"u"&&window.removeEventListener("storage",h)}},[]),a?n.jsx("span",{className:r,style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:s,height:o},children:t}):n.jsx(n.Fragment,{children:e})},ns=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(!0);return w.useEffect(()=>{const l=()=>{try{const d=localStorage.getItem("userInfo");return!!(d&&d!=="undefined"&&d!=="null")}catch{return!1}},h=()=>i(!l());return h(),window.addEventListener("storage",h),()=>window.removeEventListener("storage",h)},[]),a?n.jsx("span",{className:r,style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:s,height:o},children:t}):n.jsx(n.Fragment,{children:e})},ss=({isOpen:t,onClose:e,onSuccess:r,onError:s,userId:o,token:a,colors:i})=>{const{baseUrl:l,apiKey:h,appId:d}=ue(),[u,b]=w.useState(!1),[y,S]=w.useState(""),[c,j]=w.useState("warning"),[m,A]=w.useState(!1);if(w.useEffect(()=>{if(typeof window>"u")return;const g=()=>{A(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const P=async()=>{b(!0),j("processing");try{const{data:g}=await W.delete(`${l}/users/delete/${o}`,{data:{appId:d},headers:{"x-api-key":h}});g.success?(r(g.message||"Account deleted successfully"),j("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),j("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),j("warning")}finally{b(!1)}},_=y.toLowerCase()==="delete my account",T=g=>{g.target===g.currentTarget&&c!=="processing"&&c!=="success"&&e()},M=()=>{switch(c){case"warning":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[n.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:n.jsx(We,{size:20})}),n.jsx("div",{children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),n.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:i.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=i.border,g.currentTarget.style.color=i.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=i.textTertiary},children:n.jsx(Pe,{size:20})})]}),n.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${i.error}15`,border:`1px solid ${i.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[n.jsx("div",{style:{color:i.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:n.jsx(nr,{size:24})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h4",{style:{color:i.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:n.jsx(Mn,{size:16}),text:"All your data will be permanently deleted"},{icon:n.jsx(Gn,{size:16}),text:"This action cannot be reversed"},{icon:n.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx("div",{style:{color:i.error,flexShrink:0},children:g.icon}),n.jsx("span",{children:g.text})]},O))})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:m?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),n.jsxs("button",{onClick:()=>j("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:m?"none":1,minWidth:m?"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:[n.jsx(We,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(nr,{size:24})}),n.jsx("div",{style:{flex:1},children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsxs("p",{style:{color:i.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",n.jsx("strong",{style:{color:i.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),n.jsx("input",{type:"text",value:y,onChange:g=>S(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${_?i.success:i.error}`,backgroundColor:"transparent",color:i.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${i.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),_&&n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:i.success,fontSize:"14px",fontWeight:500},children:[n.jsx(rt,{size:16}),n.jsx("span",{children:"Confirmation accepted"})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:()=>{j("warning"),S("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),n.jsxs("button",{onClick:P,disabled:!_||u,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!_||u?"not-allowed":"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",opacity:!_||u?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!_||u?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[n.jsx(We,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),n.jsx("div",{style:{marginBottom:"20px"},children:n.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,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${i.accent}10`:"transparent"},children:[n.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?i.accent:i.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${i.accent}20`:"none"}}),n.jsx("span",{style:{fontSize:"14px",color:g.active?i.textPrimary:i.textSecondary,fontWeight:g.active?500:400},children:g.text})]},O))})}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx(rr,{size:18,style:{color:i.accent,flexShrink:0}}),n.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(rt,{size:20})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),n.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${i.success}10`,border:`1px solid ${i.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[n.jsx(rt,{size:48,style:{color:i.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),n.jsx("p",{style:{color:i.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),n.jsx("p",{style:{color:i.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary,justifyContent:"center"},children:[n.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:i.accent}}),n.jsx("span",{children:"Redirecting to login page..."})]})]})}};return n.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:T,children:[n.jsx("div",{style:{backgroundColor:i.surface,border:`1px solid ${i.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:M()}),n.jsx("style",{children:`
|
|
207
|
+
`})]})},es=async(t,e)=>{const{email:r,password:s,appId:o}=t,{baseUrl:a,apiKey:i}=e;if(!i)throw new Error("API key is required for login");try{const l=await W.post(`${a}/users/login`,{email:r,password:s,appId:o},{headers:{"Content-Type":"application/json","x-api-key":i}});return l.data?.user&&localStorage.setItem("userInfo",JSON.stringify(l.data.user)),l.data.user}catch(l){const h=l.response?.data?.message||l.message||"Login failed";throw console.error("Login API Error:",h),{success:!1,message:h,status:l.response?.status||500}}},ts=({logoUrl:t,logoLinkUrl:e,title:r="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",footerText:o="Secure authentication powered by Neuctra Authix",primaryColor:a="#00C214",gradient:i="linear-gradient(135deg, #22c55e, #00C214)",darkMode:l=!0,signupUrl:h,onSuccess:d,onError:u})=>{const{baseUrl:b,apiKey:y,appId:S}=ue(),[c,j]=w.useState("login"),[m,A]=w.useState(1),[P,_]=w.useState(!1),[T,M]=w.useState(!1),[g,O]=w.useState(null),[v,U]=w.useState(""),[q,F]=w.useState(""),[V,Z]=w.useState({email:"",otp:"",newPassword:"",appId:S}),[I,J]=w.useState(!1),z=l?"#ffffff":"#111827",R=l?"#a1a1aa":"#6b7280",K=l?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",te=l?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";w.useEffect(()=>{if(typeof window<"u"){const $=()=>J(window.innerWidth<768);return $(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)}},[]);const X=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await es({email:v,password:q,appId:S},{baseUrl:b,apiKey:y});O({type:"success",text:`Welcome ${N.name}`}),d?.(N)}catch(N){const Y=N.message||"Login failed";O({type:"error",text:Y}),u?.(N)}finally{M(!1)}},f=$=>{Z({...V,[$.target.name]:$.target.value})},k=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/forgot-password`,{email:V.email,appId:S},{headers:{"x-api-key":y}});N.data.success?(A(2),O({type:"success",text:"OTP sent to your email"})):O({type:"error",text:N.data.message||"Failed to send OTP"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},x=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/reset-password`,V,{headers:{"x-api-key":y}});N.data.success?(O({type:"success",text:"Password reset successfully!"}),A(1),Z({email:"",otp:"",newPassword:"",appId:S}),j("login")):O({type:"error",text:N.data.message||"Reset failed"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},E={width:"100%",padding:I?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:K,border:`1px solid ${te}`,borderRadius:"10px",color:z,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsxs("div",{style:{minWidth:I?"320px":"380px",maxWidth:I?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:l?"#000000":"#ffffff",padding:I?"30px 24px":"18px 28px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?n.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:n.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):n.jsx(Se,{size:40,color:a,style:{marginBottom:"10px"}}),n.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:z,margin:0},children:c==="login"?r:m===1?"Forgot Password":"Reset Password"}),n.jsx("p",{style:{fontSize:"14px",color:R},children:c==="login"?s:"Follow the steps to reset your password"})]}),c==="login"&&n.jsxs("form",{onSubmit:X,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:v,onChange:$=>U($.target.value),style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-password",type:P?"text":"password",placeholder:"Enter your password",value:q,onChange:$=>F($.target.value),style:E}),n.jsx("button",{type:"button",onClick:()=>_(!P),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:R,cursor:"pointer"},children:P?n.jsx(nt,{size:20}):n.jsx(st,{size:20})})]})]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[h&&n.jsx("a",{href:h,style:{color:a,textDecoration:"none",fontWeight:500},children:"Create new account"}),n.jsx("button",{type:"button",onClick:()=>j("forgot"),style:{background:"none",border:"none",color:a,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:T?"Signing In...":"Sign In"})]}),c==="forgot"&&n.jsxs("form",{onSubmit:m===1?k:x,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[m===1?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:V.email,onChange:f,style:E})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(tr,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:V.otp,onChange:f,style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"New Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:V.newPassword,onChange:f,style:E})]})]})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:T?"Please wait...":m===1?"Send Reset OTP":"Reset Password"}),n.jsx("button",{type:"button",onClick:()=>{j("login"),A(1)},style:{background:"none",border:"none",fontSize:"14px",color:R,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&n.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${a}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${a}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?a:"#ef4444"},children:[g.type==="success"?n.jsx(de,{size:20}):n.jsx(le,{size:20}),n.jsx("span",{children:g.text})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:R,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",n.jsx("span",{style:{color:a,fontWeight:600},children:"Neuctra Authix"})]})]})})},rs=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(()=>{if(typeof window>"u")return!1;try{const l=localStorage.getItem("userInfo");return!!(l&&l!=="undefined"&&l!=="null")}catch{return!1}});return w.useEffect(()=>{const l=()=>{if(!(typeof window>"u"))try{const h=localStorage.getItem("userInfo");i(!!(h&&h!=="undefined"&&h!=="null"))}catch{i(!1)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[]),a?n.jsx("div",{className:r,style:{display:"flex",alignItems:"center",width:s,height:o},children:t}):typeof e=="function"?e():e},ns=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(()=>{if(typeof window>"u")return!0;try{const l=localStorage.getItem("userInfo");return!l||l==="undefined"||l==="null"}catch{return!0}});return w.useEffect(()=>{const l=()=>{try{const h=localStorage.getItem("userInfo");i(!h||h==="undefined"||h==="null")}catch{i(!0)}};return l(),window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]),a?n.jsx("div",{className:r,style:{display:"flex",alignItems:"center",width:s,height:o},children:t}):typeof e=="function"?e():e},ss=({isOpen:t,onClose:e,onSuccess:r,onError:s,userId:o,token:a,colors:i})=>{const{baseUrl:l,apiKey:h,appId:d}=ue(),[u,b]=w.useState(!1),[y,S]=w.useState(""),[c,j]=w.useState("warning"),[m,A]=w.useState(!1);if(w.useEffect(()=>{if(typeof window>"u")return;const g=()=>{A(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const P=async()=>{b(!0),j("processing");try{const{data:g}=await W.delete(`${l}/users/delete/${o}`,{data:{appId:d},headers:{"x-api-key":h}});g.success?(r(g.message||"Account deleted successfully"),j("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),j("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),j("warning")}finally{b(!1)}},_=y.toLowerCase()==="delete my account",T=g=>{g.target===g.currentTarget&&c!=="processing"&&c!=="success"&&e()},M=()=>{switch(c){case"warning":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[n.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:n.jsx(We,{size:20})}),n.jsx("div",{children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),n.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:i.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=i.border,g.currentTarget.style.color=i.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=i.textTertiary},children:n.jsx(Pe,{size:20})})]}),n.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${i.error}15`,border:`1px solid ${i.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[n.jsx("div",{style:{color:i.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:n.jsx(nr,{size:24})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h4",{style:{color:i.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:n.jsx(Mn,{size:16}),text:"All your data will be permanently deleted"},{icon:n.jsx(Gn,{size:16}),text:"This action cannot be reversed"},{icon:n.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx("div",{style:{color:i.error,flexShrink:0},children:g.icon}),n.jsx("span",{children:g.text})]},O))})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:m?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),n.jsxs("button",{onClick:()=>j("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:m?"none":1,minWidth:m?"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:[n.jsx(We,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(nr,{size:24})}),n.jsx("div",{style:{flex:1},children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsxs("p",{style:{color:i.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",n.jsx("strong",{style:{color:i.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),n.jsx("input",{type:"text",value:y,onChange:g=>S(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${_?i.success:i.error}`,backgroundColor:"transparent",color:i.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${i.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),_&&n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:i.success,fontSize:"14px",fontWeight:500},children:[n.jsx(rt,{size:16}),n.jsx("span",{children:"Confirmation accepted"})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:()=>{j("warning"),S("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),n.jsxs("button",{onClick:P,disabled:!_||u,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!_||u?"not-allowed":"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",opacity:!_||u?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!_||u?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[n.jsx(We,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),n.jsx("div",{style:{marginBottom:"20px"},children:n.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,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${i.accent}10`:"transparent"},children:[n.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?i.accent:i.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${i.accent}20`:"none"}}),n.jsx("span",{style:{fontSize:"14px",color:g.active?i.textPrimary:i.textSecondary,fontWeight:g.active?500:400},children:g.text})]},O))})}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx(rr,{size:18,style:{color:i.accent,flexShrink:0}}),n.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.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:n.jsx(rt,{size:20})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),n.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${i.success}10`,border:`1px solid ${i.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[n.jsx(rt,{size:48,style:{color:i.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),n.jsx("p",{style:{color:i.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),n.jsx("p",{style:{color:i.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary,justifyContent:"center"},children:[n.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:i.accent}}),n.jsx("span",{children:"Redirecting to login page..."})]})]})}};return n.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:T,children:[n.jsx("div",{style:{backgroundColor:i.surface,border:`1px solid ${i.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:M()}),n.jsx("style",{children:`
|
|
208
208
|
@keyframes fadeIn {
|
|
209
209
|
from { opacity: 0; }
|
|
210
210
|
to { opacity: 1; }
|
package/dist/react/SignedIn.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignedIn.d.ts","sourceRoot":"","sources":["../../src/react/SignedIn.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignedIn.d.ts","sourceRoot":"","sources":["../../src/react/SignedIn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsDtD,CAAC"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
interface ReactSignedOutProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
fallback?: ReactNode;
|
|
4
|
+
fallback?: ReactNode | (() => ReactNode);
|
|
5
5
|
className?: string;
|
|
6
6
|
width?: string;
|
|
7
7
|
height?: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* ReactSignedOut
|
|
11
|
-
* Renders children ONLY when user is NOT signed in.
|
|
12
|
-
* Fully SSR-safe and window-safe.
|
|
13
|
-
*/
|
|
14
9
|
export declare const ReactSignedOut: React.FC<ReactSignedOutProps>;
|
|
15
10
|
export {};
|
|
16
11
|
//# sourceMappingURL=SignedOut.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignedOut.d.ts","sourceRoot":"","sources":["../../src/react/SignedOut.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignedOut.d.ts","sourceRoot":"","sources":["../../src/react/SignedOut.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiDxD,CAAC"}
|
package/dist/sdk/index.d.ts
CHANGED
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,mBAAmB;IAC3B,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B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