@deslop/auth 0.1.1246 → 0.1.1249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{n as t,o as n,s as r}from"./react-BUjtWCUj.js";import{$t as i,Dn as a,Dt as o,En as s,Gt as c,Jt as l,On as u,Ot as d,P as f,_t as p,an as m,in as h,k as g,r as _,rn as v,s as y,st as b,u as x,vt as S,x as C}from"./toast-ChLqRem_.js";import{$ as w,At as T,Bt as E,Dt as D,Et as O,Ft as k,It as A,J as j,Lt as M,Mt as N,Nt as P,Ot as F,Pt as I,Rt as ee,Tt as te,Vt as ne,Z as L,jt as R,kt as z,q as B}from"./components-C-jjTr_K.js";function V(e){return l(e.defaultTagName??`div`,e,e)}var H=t(),U=a(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function W(e){let t=(0,H.c)(13),n,r,i,a,o;if(t[0]!==e){let{className:c,variant:l,render:u,...d}=e;n=u,o=l===void 0?`default`:l,a=V,r=`span`,i=h({className:s(U({variant:o}),c)},d),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];let c;t[6]===o?c=t[7]:(c={slot:`badge`,variant:o},t[6]=o,t[7]=c);let l;return t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==c?(l={defaultTagName:r,props:i,render:n,state:c},t[8]=n,t[9]=r,t[10]=i,t[11]=c,t[12]=l):l=t[12],a(l)}var G=e(r(),1),K=G.createContext(void 0);function q(e){let t=G.useContext(K);if(!e&&t===void 0)throw Error(v(27));return t}var J=G.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=q(),c=s.useState(`open`),u=s.useState(`nested`),d=s.useState(`mounted`),f={open:c,transitionStatus:s.useState(`transitionStatus`)};return l(`div`,e,{state:f,ref:[s.context.backdropRef,t],stateAttributesMapping:ne,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!u})}),Y=G.forwardRef(function(e,t){let{render:n,className:r,style:a,disabled:o=!1,nativeButton:s=!0,...c}=e,u=q(),d=u.useState(`open`),{getButtonProps:f,buttonRef:p}=i({disabled:o,native:s}),m={disabled:o};function h(e){d&&u.setOpen(!1,C(y,e.nativeEvent))}return l(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},c,f]})}),X=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=q(),c=w(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),l(`p`,e,{ref:t,props:[{id:c},o]})}),Z=G.createContext(void 0);function re(){let e=G.useContext(Z);if(e===void 0)throw Error(v(26));return e}var ie=`--nested-dialogs`,ae=`data-nested-dialog-open`,oe={...E,...b,nestedDialogOpen(e){return e?{[ae]:``}:null}},Q=n(),se=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=q(),u=c.useState(`descriptionElementId`),d=c.useState(`disablePointerDismissal`),f=c.useState(`floatingRootContext`),p=c.useState(`popupProps`),m=c.useState(`modal`),h=c.useState(`mounted`),_=c.useState(`nested`),v=c.useState(`nestedOpenDialogCount`),y=c.useState(`open`),b=c.useState(`openMethod`),x=c.useState(`titleElementId`),S=c.useState(`transitionStatus`),C=c.useState(`role`),w=f.useState(`floatingId`);re(),g({open:y,ref:c.context.popupRef,onComplete(){y&&c.context.onOpenChangeComplete?.(!0)}});let E=o===void 0?T(c.context.popupRef):o,D=v>0,O=c.useStateSetter(`popupElement`),k=l(`div`,e,{state:{open:y,nested:_,transitionStatus:S,nestedDialogOpen:D},props:[p,{id:w,"aria-labelledby":x,"aria-describedby":u,role:C,...F,hidden:!h,onKeyDown(e){L.has(e.key)&&e.stopPropagation()},style:{[ie]:v}},s],ref:[t,c.context.popupRef,O],stateAttributesMapping:oe});return(0,Q.jsx)(ee,{context:f,openInteractionType:b,disabled:!h,closeOnFocusOut:!d,initialFocus:E,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:k})}),ce=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=q(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(Z.Provider,{value:n,children:(0,Q.jsxs)(_,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(j,{ref:i.context.internalBackdropRef,inert:f(!s)}),e.children]})}):null});function le({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=G.useState(0),[d,f]=G.useState(0),h=l===0,g=M(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=S(t);if(h&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||p(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:h});return B(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),m(()=>{!r&&!i&&(u(0),f(0))},[r,i]),m(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),I(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var ue={...O,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},de=class extends o{constructor(e,t,n){let r=new D,i=fe(e,r,t,n);super(i,pe(r),ue)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(R(this.state,e,t.trigger)))}};function fe(e,t,n,r=!1){return{...te(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function pe(e){return{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function $(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=q(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=k((e,t)=>new de({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let S=b.useState(`open`),w=b.useState(`mounted`),T=b.useState(`payload`);A(b,S),N(b);let{forceUnmount:E}=P(S,b);G.useImperativeHandle(l,()=>({unmount:E,close:()=>b.setOpen(!1,C(x))}),[E,b]);let D=S||w||u!=null;return(0,Q.jsxs)(K.Provider,{value:b,children:[u&&(0,Q.jsx)(z,{handle:u,store:b}),D&&(0,Q.jsx)(le,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:T}):n]})}var me=d(function(e){return $(`dialog`,e)}),he=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=q(),c=w(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),l(`h2`,e,{ref:t,props:[{id:c},o]})});function ge(e){let t=(0,H.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(me,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function _e(e){let t=(0,H.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(ce,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function ve(e){let t=(0,H.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Y,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function ye(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(J,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,H.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(ye,{}),t[5]=l):l=t[5];let d;t[6]===r?d=t[7]:(d=s(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=d);let f;t[8]===o?f=t[9]:(f=o&&(0,Q.jsxs)(Y,{"data-slot":`dialog-close`,render:(0,Q.jsx)(c,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(u,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=f);let p;return t[10]!==n||t[11]!==i||t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(_e,{children:[l,(0,Q.jsxs)(se,{"data-slot":`dialog-content`,className:d,...i,children:[n,f]})]}),t[10]=n,t[11]=i,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function xe(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`flex flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,H.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a!==void 0&&a,l;t[5]===r?l=t[6]:(l=s(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=l);let u;t[7]===o?u=t[8]:(u=o&&(0,Q.jsx)(Y,{render:(0,Q.jsx)(c,{variant:`outline`}),children:`Close`}),t[7]=o,t[8]=u);let d;return t[9]!==n||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:l,...i,children:[n,u]}),t[9]=n,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Ce(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(he,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function we(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(X,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Se as a,W as c,we as i,V as l,ve as n,xe as o,be as r,Ce as s,ge as t};