umwd-components 0.1.666 → 0.1.668
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/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/components/e-commerce/enduser/EnduserProfileDisplay.js +1 -1
- package/dist/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
- package/dist/src/components/logistics/dispatcher/DispatcherProfileDisplay.js +1 -1
- package/dist/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +1 -1
- package/dist/src/context/auth/SessionContext.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/enduser/EnduserProfileDisplay.tsx +2 -8
- package/src/components/e-commerce/enduser/EnduserProfileEditForm.tsx +30 -14
- package/src/components/logistics/dispatcher/DispatcherProfileDisplay.tsx +0 -6
- package/src/components/logistics/dispatcher/DispatcherProfileEditForm.tsx +30 -14
- package/src/context/auth/SessionContext.tsx +7 -1
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__exports as r}from"../../_virtual/
|
|
6
|
+
import{__exports as r}from"../../_virtual/index7.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__exports as a}from"../../_virtual/
|
|
6
|
+
import{__exports as a}from"../../_virtual/index8.js";
|
|
7
7
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var t;function o(){return t||(t=1,a.read=function(a,t,o,r,h){var M,e,i=8*h-r-1,p=(1<<i)-1,f=p>>1,n=-7,w=o?h-1:0,s=o?-1:1,u=a[t+w];for(w+=s,M=u&(1<<-n)-1,u>>=-n,n+=i;n>0;M=256*M+a[t+w],w+=s,n-=8);for(e=M&(1<<-n)-1,M>>=-n,n+=r;n>0;e=256*e+a[t+w],w+=s,n-=8);if(0===M)M=1-f;else{if(M===p)return e?NaN:1/0*(u?-1:1);e+=Math.pow(2,r),M-=f}return(u?-1:1)*e*Math.pow(2,M-r)},a.write=function(a,t,o,r,h,M){var e,i,p,f=8*M-h-1,n=(1<<f)-1,w=n>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:M-1,N=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,e=n):(e=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-e))<1&&(e--,p*=2),(t+=e+w>=1?s/p:s*Math.pow(2,1-w))*p>=2&&(e++,p/=2),e+w>=n?(i=0,e=n):e+w>=1?(i=(t*p-1)*Math.pow(2,h),e+=w):(i=t*Math.pow(2,w-1)*Math.pow(2,h),e=0));h>=8;a[o+u]=255&i,u+=N,i/=256,h-=8);for(e=e<<h|i,f+=h;f>0;a[o+u]=255&e,u+=N,e/=256,f-=8);a[o+u-N]|=128*_}),a}export{o as __require};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Divider";import l from"@mui/material/Grid";import o from"@mui/material/Alert";import
|
|
7
|
+
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Divider";import l from"@mui/material/Grid";import o from"@mui/material/Alert";import c from"@mui/icons-material/Person";import s from"@mui/icons-material/Email";import d from"@mui/icons-material/Phone";import u from"../../common/Address.js";import f from"../customer/BusinessCredentials.js";import{StyledLink as p}from"../../StyledLink.js";import{usePathname as E}from"next/navigation";function v(v){var g=v.data,h=g.first_name,y=g.last_name,x=g.email,b=g.phone,_=g.company_address,j=g.business_credentials,w=g.editProfileUrl,B=void 0===w?"/dashboard/admin/user/profile/edit":w,C=g.completeEnough,P=void 0!==C&&C,A=E().includes("admin/user/");return t.createElement(r,{sx:{p:2}},t.createElement(a,{spacing:2},A&&t.createElement(t.Fragment,null,Boolean(P)?t.createElement(a,{direction:"row",justifyContent:"flex-end"},t.createElement(p,{href:B,target:"_self"},t.createElement(m,{variant:"contained"},"edit profile"))):t.createElement(o,{severity:"warning",action:t.createElement(p,{href:B,target:"_self"},t.createElement(m,{variant:"contained"},"complete profile"))},"After completion of your profile you can enjoy all the benefits of your services.")),t.createElement(i,null),t.createElement(l,{container:!0,spacing:2,sx:{width:"100%"}},t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Personal Information"),t.createElement(a,{spacing:1,sx:{mt:2}},t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(c,null),t.createElement(n,null,"".concat(h," ").concat(y))),t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(s,null),t.createElement(n,null,x)),t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(d,null),t.createElement(n,null,b)))),t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Business Credentials"),j?t.createElement(f,{data:j}):t.createElement(n,null,"Business credentials not available")),t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Company Address"),_?t.createElement(u,{data:e({},_)}):t.createElement(n,null,"Company address not available")))))}export{v as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import a from"@mui/material/Paper";import
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import a from"@mui/material/Paper";import n from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Grid";import o from"@mui/material/TextField";import s from"@mui/material/Typography";import l from"@mui/material/Button";import{AddressFields as c}from"../../common/Address.js";import{SubmitButton as d}from"../../SubmitButton.js";import{useFormState as p}from"react-dom";import{updateEnduserProfileAction as u}from"../../../data/actions/e-commerce/enduser/profile-actions.js";import{BusinessCredentialsFields as E}from"../customer/BusinessCredentials.js";import{useSession as f}from"../../../context/auth/SessionContext.js";import{useSnackbar as g}from"../../../context/common/SnackbarContext.js";import v,{useEffect as x}from"react";import y from"@mui/icons-material/Email";import h from"@mui/icons-material/Phone";import b from"@mui/icons-material/Person";var C={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function j(j){var B=j.data,S=j.sx,_=j.revalidateCallback,I=j.handleClose,P=B.id,w=B.first_name,A=B.last_name,k=B.email,T=B.phone,N=B.company_address,R=B.business_credentials,V=u.bind(null,parseInt(P)),z=e(p(V,C),2),D=z[0],F=z[1],G=g().handleAddMessage,M=f().refreshSession;return x((function(){(null==D?void 0:D.message)&&(G({message:D.message,severity:D.severity||"error"}),"success"===D.severity&&(M(),_&&_(),I&&I()))}),[null==D?void 0:D.message]),x((function(){(null==D?void 0:D.strapiErrors)&&G({message:D.strapiErrors.message||"Error performing action",severity:"error"})}),[null==D?void 0:D.strapiErrors]),v.createElement(n,{sx:t([],e(Array.isArray(S)?S:[S]),!1)},v.createElement("form",{action:F},v.createElement(i,{container:!0,spacing:2},v.createElement(i,{item:!0,xs:12},v.createElement(m,{spacing:2},v.createElement(s,{variant:"h3",component:"h1"},"Edit Profile"),v.createElement(s,{variant:"body1"},"Update your profile information"))),v.createElement(i,{item:!0,xs:12},v.createElement(m,{spacing:2},v.createElement(s,{variant:"h6"},"Personal Information"),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(b,null),v.createElement(s,null,"".concat(w," ").concat(A))),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(y,null),v.createElement(o,{id:"email",name:"email",label:"Email",type:"email",defaultValue:k})),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(h,null),v.createElement(o,{id:"phone",name:"phone",label:"Phone",type:"tel",defaultValue:T})))),v.createElement(i,{item:!0,xs:12},v.createElement(a,{sx:{p:2}},v.createElement(s,{variant:"h6",gutterBottom:!0},"Company Address"),v.createElement(r,{sx:{mb:2}}),v.createElement(c,{componentName:"company_address",componentReference:"common.address",data:N}))),v.createElement(i,{item:!0,xs:12},v.createElement(a,{sx:{p:2}},v.createElement(s,{variant:"h6",gutterBottom:!0},"Business Credentials"),v.createElement(r,{sx:{mb:2}}),v.createElement(E,{componentName:"business_credentials",componentReference:"business.credentials",data:R}))),v.createElement(i,{item:!0,xs:12},v.createElement(m,{direction:"row",justifyContent:"space-between",spacing:2,alignItems:"center",sx:{mt:2}},I&&v.createElement(l,{onClick:I,variant:"outlined"},"Cancel"),v.createElement(d,{text:"Save Changes",loadingText:"Saving...",variant:"contained"}))))))}export{j as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Divider";import l from"@mui/material/Grid";import o from"@mui/material/Alert";import c from"@mui/icons-material/Person";import s from"@mui/icons-material/Email";import d from"@mui/icons-material/Phone";import u from"../../common/Address.js";import p from"../../e-commerce/customer/BusinessCredentials.js";import{StyledLink as f}from"../../StyledLink.js";import{usePathname as E}from"next/navigation";function
|
|
7
|
+
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Divider";import l from"@mui/material/Grid";import o from"@mui/material/Alert";import c from"@mui/icons-material/Person";import s from"@mui/icons-material/Email";import d from"@mui/icons-material/Phone";import u from"../../common/Address.js";import p from"../../e-commerce/customer/BusinessCredentials.js";import{StyledLink as f}from"../../StyledLink.js";import{usePathname as E}from"next/navigation";function h(h){var v=h.data,g=v.first_name,y=v.last_name,x=v.email,b=v.phone,_=v.company_address,j=v.business_credentials,w=v.editProfileUrl,B=void 0===w?"/dashboard/dispatcher/user/profile/edit":w,C=v.completeEnough,P=void 0!==C&&C,A=E().includes("dispatcher/user/");return t.createElement(r,{sx:{p:2}},t.createElement(a,{spacing:2},A&&t.createElement(t.Fragment,null,Boolean(P)?t.createElement(a,{direction:"row",justifyContent:"flex-end"},t.createElement(f,{href:B,target:"_self"},t.createElement(m,{variant:"contained"},"edit profile"))):t.createElement(o,{severity:"warning",action:t.createElement(f,{href:B,target:"_self"},t.createElement(m,{variant:"contained"},"complete profile"))},"After completion of your profile you can enjoy all the benefits of your services.")),t.createElement(i,null),t.createElement(l,{container:!0,spacing:2,sx:{width:"100%"}},t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Personal Information"),t.createElement(a,{spacing:1,sx:{mt:2}},t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(c,null),t.createElement(n,null,"".concat(g," ").concat(y))),t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(s,null),t.createElement(n,null,x)),t.createElement(a,{direction:"row",alignItems:"center"},t.createElement(d,null),t.createElement(n,null,b)))),t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Business Credentials"),j?t.createElement(p,{data:j}):t.createElement(n,null,"Business credentials not available")),t.createElement(l,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Company Address"),_?t.createElement(u,{data:e({},_)}):t.createElement(n,null,"Company address not available")))))}export{h as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import a from"@mui/material/Paper";import
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import a from"@mui/material/Paper";import n from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Grid";import o from"@mui/material/TextField";import s from"@mui/material/Typography";import l from"@mui/material/Button";import{AddressFields as c}from"../../common/Address.js";import{SubmitButton as d}from"../../SubmitButton.js";import{useFormState as p}from"react-dom";import{updateDispatcherProfileAction as u}from"../../../data/actions/logistics/dispatcher/profile-actions.js";import{BusinessCredentialsFields as E}from"../../e-commerce/customer/BusinessCredentials.js";import{useSession as f}from"../../../context/auth/SessionContext.js";import{useSnackbar as g}from"../../../context/common/SnackbarContext.js";import v,{useEffect as x}from"react";import h from"@mui/icons-material/Email";import y from"@mui/icons-material/Phone";import b from"@mui/icons-material/Person";var C={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function j(j){var B=j.data,S=j.sx,_=j.revalidateCallback,I=j.handleClose,P=B.id,w=B.first_name,A=B.last_name,k=B.email,T=B.phone,N=B.company_address,R=B.business_credentials,V=u.bind(null,parseInt(P)),z=e(p(V,C),2),D=z[0],F=z[1],G=g().handleAddMessage,M=f().refreshSession;return x((function(){(null==D?void 0:D.message)&&(G({message:D.message,severity:D.severity||"error"}),"success"===D.severity&&(M(),_&&_(),I&&I()))}),[null==D?void 0:D.message]),x((function(){(null==D?void 0:D.strapiErrors)&&G({message:D.strapiErrors.message||"Error performing action",severity:"error"})}),[null==D?void 0:D.strapiErrors]),v.createElement(n,{sx:t([],e(Array.isArray(S)?S:[S]),!1)},v.createElement("form",{action:F},v.createElement(i,{container:!0,spacing:2},v.createElement(i,{item:!0,xs:12},v.createElement(m,{spacing:2},v.createElement(s,{variant:"h3",component:"h1"},"Edit Profile"),v.createElement(s,{variant:"body1"},"Update your profile information"))),v.createElement(i,{item:!0,xs:12},v.createElement(m,{spacing:2},v.createElement(s,{variant:"h6"},"Personal Information"),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(b,null),v.createElement(s,null,"".concat(w," ").concat(A))),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(h,null),v.createElement(o,{id:"email",name:"email",label:"Email",type:"email",defaultValue:k})),v.createElement(m,{direction:"row",alignItems:"center"},v.createElement(y,null),v.createElement(o,{id:"phone",name:"phone",label:"Phone",type:"tel",defaultValue:T})))),v.createElement(i,{item:!0,xs:12},v.createElement(a,{sx:{p:2}},v.createElement(s,{variant:"h6",gutterBottom:!0},"Company Address"),v.createElement(r,{sx:{mb:2}}),v.createElement(c,{componentName:"company_address",componentReference:"common.address",data:N}))),v.createElement(i,{item:!0,xs:12},v.createElement(a,{sx:{p:2}},v.createElement(s,{variant:"h6",gutterBottom:!0},"Business Credentials"),v.createElement(r,{sx:{mb:2}}),v.createElement(E,{componentName:"business_credentials",componentReference:"business.credentials",data:R}))),v.createElement(i,{item:!0,xs:12},v.createElement(m,{direction:"row",justifyContent:"space-between",spacing:2,alignItems:"center",sx:{mt:2}},I&&v.createElement(l,{onClick:I,variant:"outlined"},"Cancel"),v.createElement(d,{text:"Save Changes",loadingText:"Saving...",variant:"contained"}))))))}export{j as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as
|
|
7
|
+
import{__read as r,__awaiter as e,__generator as n}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as o,useEffect as s,useContext as i,createContext as u}from"react";import{getAuthToken as c}from"../../data/services/get-token.js";import{getUserMeLoader as a}from"../../data/services/get-user-me-loader.js";import{loginUserService as l}from"../../data/services/auth-service.js";import{logoutAction as d}from"../../data/actions/auth-actions.js";import{useSearchParams as v}from"next/navigation";import{useCookieConsent as f}from"../../components/common/cookie-consent/CookieConsentContext.js";var h=u(void 0),m=function(i){var u,m=i.children,g=r(o(null),2),p=g[0],w=g[1],b=r(o(!0),2),j=b[0],y=b[1],k=r(o(null),2),x=k[0],A=k[1],C=v(),E=!0;try{var S=f();E=null===(u=null==S?void 0:S.consentGiven)||void 0===u||u}catch(r){E=!0}var F=function(){return e(void 0,void 0,void 0,(function(){var r,e;return n(this,(function(n){switch(n.label){case 0:y(!0),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,c()];case 2:return(r=n.sent())?[4,a(r)]:(y(!1),[2]);case 3:return(e=n.sent())?w(e):A("Failed to fetch user details"),[3,6];case 4:return n.sent(),A("An error occurred while fetching user details"),[3,6];case 5:return y(!1),[7];case 6:return[2]}}))}))};s((function(){F()}),[]),s((function(){var r=setInterval((function(){return e(void 0,void 0,void 0,(function(){var r,e;return n(this,(function(n){switch(n.label){case 0:return[4,c()];case 1:return(r=n.sent())?[4,a(r)]:(w(null),[2]);case 2:return(e=n.sent())!==p&&w(e),[2]}}))}))}),3e3);return function(){return clearInterval(r)}}),[]),s((function(){C&&"success"===C.get("login")&&P()}),[C]);var I=function(){return e(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,d()];case 1:return r.sent(),w(null),[3,3];case 2:return r.sent(),A("An error occurred during logout"),[3,3];case 3:return[2]}}))}))},P=function(){return e(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,F()];case 1:return r.sent(),[3,3];case 2:return r.sent(),A("An error occurred while refreshing session"),[3,3];case 3:return[2]}}))}))};return s((function(){!1===E&&I()}),[E]),t.createElement(h.Provider,{value:{user:p,loading:j,error:x,login:function(r,t){return e(void 0,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:y(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,l({identifier:r,password:t})];case 2:return(e=n.sent())&&e.jwt?(document.cookie="jwt=".concat(e.jwt,";path=/;max-age=604800;secure"),w(e.user)):A("Failed to login"),[3,5];case 3:return n.sent(),A("An error occurred during login"),[3,5];case 4:return y(!1),[7];case 5:return[2]}}))}))},logout:I,refreshSession:P,clearError:function(){A(null)}}},m)},g=function(){var r=i(h);if(!r)throw new Error("useSession must be used within a SessionProvider");return r};export{m as SessionProvider,g as useSession};
|