@everymatrix/flash-register-wc 1.0.24 → 1.0.25
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/build-register-wc.js +1 -1
- package/dist/meta.json +3 -3
- package/package.json +1 -1
|
@@ -253,7 +253,7 @@ https://www.w3ctech.com/topic/2226`));let s=r(...i);return s.postcssPlugin=t,s.p
|
|
|
253
253
|
[:-moz-autofill]:[-moz-text-fill-color:var(--color-text-primary)]!
|
|
254
254
|
focus:[-moz-autofill]:[box-shadow:0_0_0_50px_var(--color-action-primary-bg)_inset]
|
|
255
255
|
focus:[-moz-autofill]:[-moz-text-fill-color:var(--color-text-primary)]! caret-[var(--color-text-primary)]
|
|
256
|
-
autofill:![caret-color:var(--color-text-primary)] [:-moz-autofill]:![caret-color:var(--color-text-primary)]`,{"pl-10":!!u,"pr-10":!!m,"opacity-40 cursor-not-allowed":o},t),suffixIcon:Rn(z2,{type:"button",onClick:()=>x(y=>!y),className:"password-field__toggle pointer-events-auto",size:"small",variant:"ghost",icon:h?Rn(Np,{size:16}):Rn(Mp,{size:16}),"aria-label":h?"Show password":"Hide password"}),...p}),Rn("p",{id:v,className:"form-input__error-message text-sm text-error min-h-5",children:n})]})},fA=wQe});var npe=l(()=>{});var ipe=l(()=>{ape();npe()});import{Fragment as CQe,jsx as spe,jsxs as IQe}from"react/jsx-runtime";var SQe,W2,lpe=l(()=>{Zi();ipe();bn();$r();SQe=e=>{let{field:t,control:r,register:a,getValues:o}=e,n=t.name,i=t.displayName,s=t.placeholder??i,c=!!t.validate?.mandatory,u=!!t.readOnly||!!t.autofill,m=Ep(t),p=`${n}${od}`,h=m?.displayName??We.confirmWithLabel({label:i}),x=m?.errorMessage??We.mustMatch({label:h}),v=m?[n,p]:n,{errors:y}=kp({control:r,name:v}),A=y?.[n]?.message??"",w=y?.[p]?.message??"",C=Fy(t),I=a(n,C),S={id:`${Do}${n}`,label:i,placeholder:s,required:c,disabled:u,errorMessage:A,...I},_=m?{required:We.isRequired({label:h}),validate:k=>k===o(n)||x}:void 0,T=m&&_?{id:p,label:h,placeholder:h,required:!0,disabled:u,errorMessage:w,...a(p,_)}:null;return IQe(CQe,{children:[spe(fA,{...S,tooltip:t.tooltip??void 0,autoComplete:"new-password"}),m&&T?spe(fA,{...T,tooltip:t.tooltip??void 0}):null]})},W2=SQe});var cpe=l(()=>{lpe()});import{jsx as Ac}from"react/jsx-runtime";var _Qe,H2,upe=l(()=>{is();bn();zre();Hre();Cfe();Dme();$me();tpe();cpe();Dt();_Qe=e=>{let{field:t,control:r,register:a,getValues:o,setValue:n,phoneCodesOptions:i}=e,s=t.action,c=mX(t.inputType),u=lX(t),m=()=>!s||!nX(s)?null:iX(s),p=m(),{data:h}=ja({queryKey:["register","field-options",p],enabled:!!m,queryFn:async()=>{let v=await Ht(p,fX,"RegisterFieldOptions");return dX(v)}}),x=h?.length?h:u;return c==="tel"?Ac(M2,{field:t,control:r,options:x,fallbackPhoneCodesOptions:i}):c==="dropdown"?Ac(P2,{field:t,control:r,options:x}):c==="datetime"?Ac(x2,{field:t,control:r}):["checkbox","togglecheckbox"].includes(c)?Ac(nT,{field:t,control:r}):c==="checkboxgroup"?Ac(sT,{field:t,control:r,setValue:n}):c==="text"?Ac(U2,{field:t,control:r,register:a,getValues:o}):c==="password"?Ac(W2,{field:t,control:r,register:a,getValues:o}):null},H2=_Qe});var dpe=l(()=>{upe()});import{useCallback as mA,useEffect as q2,useRef as Ud,useState as pA}from"react";var gA,kQe,LQe,EQe,fpe,mpe=l(()=>{ze();gA=null,kQe=()=>typeof window>"u"?Promise.reject(new Error("SSR")):window.turnstile?Promise.resolve():(gA||(gA=new Promise((e,t)=>{let r=document.createElement("script"),a=qt()?.turnstileScriptSrc;r.src=a,r.async=!0,r.defer=!0,r.onload=()=>e(),r.onerror=()=>{gA=null,t(new Error("Turnstile script failed to load"))},document.head.appendChild(r)})),gA),LQe=3e3,EQe=3e3,fpe=({siteKey:e,action:t,theme:r="auto",autoStartOnMount:a=!0,isEnabled:o=qt().isTurnstileEnabled})=>{let[n,i]=pA(!1),[s,c]=pA(!1),[u,m]=pA(!1),[p,h]=pA(null),x=Ud(null),v=Ud(void 0),y=Ud(null),A=Ud(null),w=Ud(!1),C=Ud(0),I=mA(()=>{let k=y.current;!k||!v.current||!window.turnstile||(k.retryTimerId=setTimeout(()=>{if(!y.current||!v.current||!window.turnstile)return;let D=Date.now();if(w.current&&D-C.current>=EQe)try{window.turnstile.reset(v.current),C.current=D}catch(O){console.warn("[Turnstile] reset error",O)}finally{w.current=!1}try{window.turnstile.execute(v.current)}catch(O){console.warn("[Turnstile] execute threw -> reschedule",O),I()}},LQe))},[]);q2(()=>{if(!o){i(!1);return}let k=!1;return kQe().then(()=>{k||i(!0)}).catch(D=>{console.error("[Turnstile] script load error",D)}),()=>{k=!0}},[o]),q2(()=>{if(o&&!(!n||!x.current||v.current||!window.turnstile))return w.current=!1,v.current=window.turnstile.render(x.current,{sitekey:e,theme:r,action:t,size:"invisible",execution:"execute",callback:k=>{let D=y.current;D&&(D.retryTimerId&&clearTimeout(D.retryTimerId),D.resolve(k),y.current=null),h(k),c(!1),w.current=!1},"error-callback":()=>{w.current=!0,y.current&&I()},"expired-callback":()=>{h(null),w.current=!0},"timeout-callback":()=>{y.current&&(w.current=!0,I())}}),()=>{try{v.current&&window.turnstile&&window.turnstile.remove(v.current)}catch{}if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile destroyed")),y.current=null}v.current=void 0,w.current=!1,c(!1),m(!1),h(null),A.current=null}},[n,e,r,t,I,o]);let S=mA(async()=>{if(!o)return;if(!window.turnstile||!v.current)throw new Error("Turnstile not ready");if(A.current)return A.current;c(!0);let k=new Promise((D,O)=>{let V={resolve:D,reject:O,retryTimerId:null};y.current=V;try{window.turnstile.execute(v.current)}catch(K){console.error(K),I()}}).finally(()=>{A.current===k&&(A.current=null)});return A.current=k,k},[I,o]),_=mA(async()=>{if(o)return p||(m(!0),S().finally(()=>m(!1)))},[p,S,o]),T=mA(()=>{if(!o){if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile reset by caller")),y.current=null}w.current=!1,A.current=null,c(!1),m(!1),h(null);return}if(v.current)try{window.turnstile.reset(v.current),C.current=Date.now()}catch{}if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile reset by caller")),y.current=null}w.current=!1,A.current=null,c(!1),m(!1),h(null)},[o]);return q2(()=>{o&&(!a||!n||!v.current||!window.turnstile||S().catch(()=>{}))},[a,n,S,o]),{hostRef:x,ready:n,isGettingToken:s,isEnsuringToken:u,token:p,getToken:S,ensureToken:_,reset:T}}});var ppe=l(()=>{mpe()});import{useEffect as DQe}from"react";var RQe,gpe,hpe=l(()=>{bn();RQe=e=>{let{activeCfg:t,fields:r,phoneCodesOptions:a,btag:o,cardId:n,getValues:i,setValue:s}=e;DQe(()=>{if(t){for(let c of r)if(c.name){if(My(c.name)){i("Btag")||s("Btag",o,{shouldDirty:!1});continue}if(c.name.toLowerCase()==="cardid"&&n){i("CardId")||s("CardId",n,{shouldDirty:!1});continue}if(c.name.toLowerCase()===Lp){!i(ni.OUTGOING_MOBILE_PREFIX_NAME)&&a?.[0]?.value&&s(ni.OUTGOING_MOBILE_PREFIX_NAME,a[0].value,{shouldDirty:!1}),i(ni.INCOMING_MOBILE_NAME)||s(ni.INCOMING_MOBILE_NAME,"",{shouldDirty:!1});continue}!i(c.name)&&c.defaultValue&&s(c.name,c.defaultValue,{shouldDirty:!1})}}},[t,r,a,o,i,s])},gpe=RQe});import{useMemo as xpe,useState as G2,useCallback as TQe}from"react";import{jsx as wc,jsxs as bpe}from"react/jsx-runtime";var PQe,ype,vpe=l(()=>{is();Zi();xs();Yi();kx();Zu();yp();$r();dl();_x();dpe();bn();ppe();ze();hpe();Ve();PQe=e=>{let{token:t,cardId:r,channel:a,method:o,onSuccess:n,onClickInsideForm:i}=e,s=fl(),c=Bs(),u=FZ(),{phoneCodesOptions:m}=_Z(),[p,h]=G2(null);KZ({...Pa(c.registerConfig(void 0,t,a,o)),refetchOnMount:"always",staleTime:0},{onSuccess:He=>{v([He]),A(0)}});let[x,v]=G2([]),[y,A]=G2(0),w=x[y],C=w?.content,I=C?.fields??[],S=C?.actions??[],_=C?.step??"",T=C?.registrationID??"",k=sX(S),D=y===0,O=xpe(()=>{if(Xr())return"";let He=new URLSearchParams(window.location.search);return c6("btag")||He.get("btag")||""},[]),V=eX({mode:"all",defaultValues:{}}),{register:K,control:B,trigger:E,getValues:N,setValue:z}=V,$=xpe(()=>I.filter(He=>!My(He.name)),[I]);gpe({activeCfg:w,fields:I,phoneCodesOptions:m,btag:O,cardId:r,getValues:N,setValue:z});let{hostRef:j,ensureToken:U}=fpe({siteKey:jP(),action:"register",autoStartOnMount:!0}),ie=u.step(),be=u.register(),{isError:he,error:qe,mutateAsync:ge,isPending:Ne}=Ng(ie.asOptions({})),{isError:De,error:ft,mutateAsync:oe,isPending:Ae}=Ng(be.asOptions({onSuccess:He=>{n?.(He),m6(We.success(),{description:We.accountCreatedMessage()})}})),Ge=TQe(async He=>s.fetchQuery({...Pa(c.registerConfig(He,t,a,o)),staleTime:0}),[c,s]),Te=()=>{y>0&&A(He=>He-1)},Fe=async()=>{if(!w||Ne||Ae)return;let He=cX($);if(!await E(He,{shouldFocus:!0})){requestAnimationFrame(()=>{pX(He,V.formState.errors)});return}let Le=uX(I,N());h(null);let At=await ge({registrationId:T,registerUserDto:_==="Step1"?{...Le,token:t,method:o,channel:a
|
|
256
|
+
autofill:![caret-color:var(--color-text-primary)] [:-moz-autofill]:![caret-color:var(--color-text-primary)]`,{"pl-10":!!u,"pr-10":!!m,"opacity-40 cursor-not-allowed":o},t),suffixIcon:Rn(z2,{type:"button",onClick:()=>x(y=>!y),className:"password-field__toggle pointer-events-auto",size:"small",variant:"ghost",icon:h?Rn(Np,{size:16}):Rn(Mp,{size:16}),"aria-label":h?"Show password":"Hide password"}),...p}),Rn("p",{id:v,className:"form-input__error-message text-sm text-error min-h-5",children:n})]})},fA=wQe});var npe=l(()=>{});var ipe=l(()=>{ape();npe()});import{Fragment as CQe,jsx as spe,jsxs as IQe}from"react/jsx-runtime";var SQe,W2,lpe=l(()=>{Zi();ipe();bn();$r();SQe=e=>{let{field:t,control:r,register:a,getValues:o}=e,n=t.name,i=t.displayName,s=t.placeholder??i,c=!!t.validate?.mandatory,u=!!t.readOnly||!!t.autofill,m=Ep(t),p=`${n}${od}`,h=m?.displayName??We.confirmWithLabel({label:i}),x=m?.errorMessage??We.mustMatch({label:h}),v=m?[n,p]:n,{errors:y}=kp({control:r,name:v}),A=y?.[n]?.message??"",w=y?.[p]?.message??"",C=Fy(t),I=a(n,C),S={id:`${Do}${n}`,label:i,placeholder:s,required:c,disabled:u,errorMessage:A,...I},_=m?{required:We.isRequired({label:h}),validate:k=>k===o(n)||x}:void 0,T=m&&_?{id:p,label:h,placeholder:h,required:!0,disabled:u,errorMessage:w,...a(p,_)}:null;return IQe(CQe,{children:[spe(fA,{...S,tooltip:t.tooltip??void 0,autoComplete:"new-password"}),m&&T?spe(fA,{...T,tooltip:t.tooltip??void 0}):null]})},W2=SQe});var cpe=l(()=>{lpe()});import{jsx as Ac}from"react/jsx-runtime";var _Qe,H2,upe=l(()=>{is();bn();zre();Hre();Cfe();Dme();$me();tpe();cpe();Dt();_Qe=e=>{let{field:t,control:r,register:a,getValues:o,setValue:n,phoneCodesOptions:i}=e,s=t.action,c=mX(t.inputType),u=lX(t),m=()=>!s||!nX(s)?null:iX(s),p=m(),{data:h}=ja({queryKey:["register","field-options",p],enabled:!!m,queryFn:async()=>{let v=await Ht(p,fX,"RegisterFieldOptions");return dX(v)}}),x=h?.length?h:u;return c==="tel"?Ac(M2,{field:t,control:r,options:x,fallbackPhoneCodesOptions:i}):c==="dropdown"?Ac(P2,{field:t,control:r,options:x}):c==="datetime"?Ac(x2,{field:t,control:r}):["checkbox","togglecheckbox"].includes(c)?Ac(nT,{field:t,control:r}):c==="checkboxgroup"?Ac(sT,{field:t,control:r,setValue:n}):c==="text"?Ac(U2,{field:t,control:r,register:a,getValues:o}):c==="password"?Ac(W2,{field:t,control:r,register:a,getValues:o}):null},H2=_Qe});var dpe=l(()=>{upe()});import{useCallback as mA,useEffect as q2,useRef as Ud,useState as pA}from"react";var gA,kQe,LQe,EQe,fpe,mpe=l(()=>{ze();gA=null,kQe=()=>typeof window>"u"?Promise.reject(new Error("SSR")):window.turnstile?Promise.resolve():(gA||(gA=new Promise((e,t)=>{let r=document.createElement("script"),a=qt()?.turnstileScriptSrc;r.src=a,r.async=!0,r.defer=!0,r.onload=()=>e(),r.onerror=()=>{gA=null,t(new Error("Turnstile script failed to load"))},document.head.appendChild(r)})),gA),LQe=3e3,EQe=3e3,fpe=({siteKey:e,action:t,theme:r="auto",autoStartOnMount:a=!0,isEnabled:o=qt().isTurnstileEnabled})=>{let[n,i]=pA(!1),[s,c]=pA(!1),[u,m]=pA(!1),[p,h]=pA(null),x=Ud(null),v=Ud(void 0),y=Ud(null),A=Ud(null),w=Ud(!1),C=Ud(0),I=mA(()=>{let k=y.current;!k||!v.current||!window.turnstile||(k.retryTimerId=setTimeout(()=>{if(!y.current||!v.current||!window.turnstile)return;let D=Date.now();if(w.current&&D-C.current>=EQe)try{window.turnstile.reset(v.current),C.current=D}catch(O){console.warn("[Turnstile] reset error",O)}finally{w.current=!1}try{window.turnstile.execute(v.current)}catch(O){console.warn("[Turnstile] execute threw -> reschedule",O),I()}},LQe))},[]);q2(()=>{if(!o){i(!1);return}let k=!1;return kQe().then(()=>{k||i(!0)}).catch(D=>{console.error("[Turnstile] script load error",D)}),()=>{k=!0}},[o]),q2(()=>{if(o&&!(!n||!x.current||v.current||!window.turnstile))return w.current=!1,v.current=window.turnstile.render(x.current,{sitekey:e,theme:r,action:t,size:"invisible",execution:"execute",callback:k=>{let D=y.current;D&&(D.retryTimerId&&clearTimeout(D.retryTimerId),D.resolve(k),y.current=null),h(k),c(!1),w.current=!1},"error-callback":()=>{w.current=!0,y.current&&I()},"expired-callback":()=>{h(null),w.current=!0},"timeout-callback":()=>{y.current&&(w.current=!0,I())}}),()=>{try{v.current&&window.turnstile&&window.turnstile.remove(v.current)}catch{}if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile destroyed")),y.current=null}v.current=void 0,w.current=!1,c(!1),m(!1),h(null),A.current=null}},[n,e,r,t,I,o]);let S=mA(async()=>{if(!o)return;if(!window.turnstile||!v.current)throw new Error("Turnstile not ready");if(A.current)return A.current;c(!0);let k=new Promise((D,O)=>{let V={resolve:D,reject:O,retryTimerId:null};y.current=V;try{window.turnstile.execute(v.current)}catch(K){console.error(K),I()}}).finally(()=>{A.current===k&&(A.current=null)});return A.current=k,k},[I,o]),_=mA(async()=>{if(o)return p||(m(!0),S().finally(()=>m(!1)))},[p,S,o]),T=mA(()=>{if(!o){if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile reset by caller")),y.current=null}w.current=!1,A.current=null,c(!1),m(!1),h(null);return}if(v.current)try{window.turnstile.reset(v.current),C.current=Date.now()}catch{}if(y.current){let k=y.current;k.retryTimerId&&clearTimeout(k.retryTimerId),k.reject(new Error("Turnstile reset by caller")),y.current=null}w.current=!1,A.current=null,c(!1),m(!1),h(null)},[o]);return q2(()=>{o&&(!a||!n||!v.current||!window.turnstile||S().catch(()=>{}))},[a,n,S,o]),{hostRef:x,ready:n,isGettingToken:s,isEnsuringToken:u,token:p,getToken:S,ensureToken:_,reset:T}}});var ppe=l(()=>{mpe()});import{useEffect as DQe}from"react";var RQe,gpe,hpe=l(()=>{bn();RQe=e=>{let{activeCfg:t,fields:r,phoneCodesOptions:a,btag:o,cardId:n,getValues:i,setValue:s}=e;DQe(()=>{if(t){for(let c of r)if(c.name){if(My(c.name)){i("Btag")||s("Btag",o,{shouldDirty:!1});continue}if(c.name.toLowerCase()==="cardid"&&n){i("CardId")||s("CardId",n,{shouldDirty:!1});continue}if(c.name.toLowerCase()===Lp){!i(ni.OUTGOING_MOBILE_PREFIX_NAME)&&a?.[0]?.value&&s(ni.OUTGOING_MOBILE_PREFIX_NAME,a[0].value,{shouldDirty:!1}),i(ni.INCOMING_MOBILE_NAME)||s(ni.INCOMING_MOBILE_NAME,"",{shouldDirty:!1});continue}!i(c.name)&&c.defaultValue&&s(c.name,c.defaultValue,{shouldDirty:!1})}}},[t,r,a,o,i,s])},gpe=RQe});import{useMemo as xpe,useState as G2,useCallback as TQe}from"react";import{jsx as wc,jsxs as bpe}from"react/jsx-runtime";var PQe,ype,vpe=l(()=>{is();Zi();xs();Yi();kx();Zu();yp();$r();dl();_x();dpe();bn();ppe();ze();hpe();Ve();PQe=e=>{let{token:t,cardId:r,channel:a,method:o,onSuccess:n,onClickInsideForm:i}=e,s=fl(),c=Bs(),u=FZ(),{phoneCodesOptions:m}=_Z(),[p,h]=G2(null);KZ({...Pa(c.registerConfig(void 0,t,a,o)),refetchOnMount:"always",staleTime:0},{onSuccess:He=>{v([He]),A(0)}});let[x,v]=G2([]),[y,A]=G2(0),w=x[y],C=w?.content,I=C?.fields??[],S=C?.actions??[],_=C?.step??"",T=C?.registrationID??"",k=sX(S),D=y===0,O=xpe(()=>{if(Xr())return"";let He=new URLSearchParams(window.location.search);return c6("btag")||He.get("btag")||""},[]),V=eX({mode:"all",defaultValues:{}}),{register:K,control:B,trigger:E,getValues:N,setValue:z}=V,$=xpe(()=>I.filter(He=>!My(He.name)),[I]);gpe({activeCfg:w,fields:I,phoneCodesOptions:m,btag:O,cardId:r,getValues:N,setValue:z});let{hostRef:j,ensureToken:U}=fpe({siteKey:jP(),action:"register",autoStartOnMount:!0}),ie=u.step(),be=u.register(),{isError:he,error:qe,mutateAsync:ge,isPending:Ne}=Ng(ie.asOptions({})),{isError:De,error:ft,mutateAsync:oe,isPending:Ae}=Ng(be.asOptions({onSuccess:He=>{n?.(He),m6(We.success(),{description:We.accountCreatedMessage()})}})),Ge=TQe(async He=>s.fetchQuery({...Pa(c.registerConfig(He,t,a,o)),staleTime:0}),[c,s]),Te=()=>{y>0&&A(He=>He-1)},Fe=async()=>{if(!w||Ne||Ae)return;let He=cX($);if(!await E(He,{shouldFocus:!0})){requestAnimationFrame(()=>{pX(He,V.formState.errors)});return}let Le=uX(I,N());h(null);let At=await ge({registrationId:T,registerUserDto:_==="Step1"?{...Le,token:t,method:o,channel:a}:Le,step:_});if(k){let nt=await U();await oe({registrationId:T,captchaResponse:nt});return}if(x[y+1]){A(y+1);return}let zt=String(At?.registrationId??T);try{let nt=await Ge(zt);v(yt=>[...yt,nt]),A(yt=>yt+1)}catch(nt){h(nt.message)}},Xe=He=>{He.preventDefault(),Fe()};return w?bpe("form",{id:"register-form",className:"register-form flex flex-col flex-1 min-h-0 gap-3",onSubmit:Xe,onClick:i,children:[wc("div",{className:"flex flex-col flex-1",children:wc("div",{className:`register-form__fields flex flex-col lg:grid lg:grid-cols-2 min-h-0 overflow-y-auto pr-1 gap-y-1
|
|
257
257
|
gap-x-2`,children:$.map(He=>wc(H2,{field:He,control:B,setValue:z,register:K,getValues:N,phoneCodesOptions:m},He.name))})}),wc("div",{ref:j}),bpe("div",{className:"register-form__actions mt-2 flex-none flex justify-between gap-2",children:[wc(ga,{type:"button",variant:"secondary",text:We.backButton(),disabled:D||Ne||Ae,className:"register-form__button register-form__button--back w-1/3",onClick:Te}),wc(ga,{form:"register-form",type:"submit",variant:"primary",text:k?We.registerFormSubmitButton():We.nextButton(),isLoading:Ne||Ae,className:"register-form__button register-form__button--submit w-1/3"})]}),(he||De||p)&&wc("p",{className:"register-form__error text-sm text-error mt-0.5",children:qe?.message||ft?.message||p})]}):null},ype=PQe});var Tn,Ape=l(()=>{Tn={REGISTER:"REGISTER",REGISTER_METHODS:"REGISTER_METHODS",OIDC_ERROR:"OIDC_ERROR",SSBT_CARD_SCAN:"SSBT_CARD_SCAN"}});import{useState as OQe,useReducer as NQe}from"react";import{jsx as hA,jsxs as BQe}from"react/jsx-runtime";var MQe,FQe,wpe,Spe=l(()=>{GD();Zu();yp();is();Ii();Yi();$r();qD();GD();xs();RJ();vpe();xs();Ape();MQe=(e,t)=>{switch(t.type){case"SET_VIEW":return{...e,view:t.view};case"SET_ERROR":return{...e,errors:{...e.errors,[t.key]:t.message}};case"CLEAR_ERRORS":{if(!t.keys?.length)return{...e,errors:{}};let r={...e.errors};return t.keys.forEach(a=>delete r[a]),{...e,errors:r}}case"RESET":return aJ(Tn.REGISTER_METHODS);default:return e}},FQe=e=>{let{token:t,status:r,channel:a,cardId:o,onClickInsideForm:n,onSuccess:i}=e,s=Bs(),{data:c}=ja(Pa(s.registerMethods(a))),{redirectingProvider:u,isRedirectUrlFetching:m,redirectHandler:p}=Iy(Ka.REGISTER),[h,x]=OQe(c[0].method??null),v=()=>c&&c?.length===1&&c[0].method===Ja.DEFAULT?(x(Ja.DEFAULT),{view:Tn.REGISTER,errors:{}}):t&&r===Mf.SUCCESS?{view:Tn.REGISTER,errors:{}}:r&&r===Mf.FAILED?{view:Tn.OIDC_ERROR,errors:{}}:{view:Tn.REGISTER_METHODS,errors:{}},[y,A]=NQe(MQe,v()),w=S=>A({type:"SET_VIEW",view:S}),C=async S=>{switch(x(S.method),S.method){case Ja.CREDENTIALS:w(Tn.REGISTER);return;case Ja.OIDC:p(S.name)}};return(()=>{switch(y.view){case Tn.REGISTER_METHODS:return hA(XD,{methods:c,onMethodSelect:C,redirectingProvider:u,isDisabled:m});case Tn.REGISTER:return hA(ype,{onClickInsideForm:n,onSuccess:i,token:t,cardId:o,channel:a,method:h});case Tn.OIDC_ERROR:return BQe("div",{className:"flex flex-col gap-3 bg-bg-secondary rounded-md justify-center items-center p-5",children:[hA("p",{children:We.oidcAuthorizationFailed()}),hA(ga,{text:We.tryAgain(),variant:"secondary",onClick:()=>w(Tn.REGISTER_METHODS)})]});default:return null}})()},wpe=FQe});import*as jt from"react";import{Fragment as Cpe,jsx as hr,jsxs as Ipe}from"react/jsx-runtime";function Y2(e){return e?"open":"closed"}var bA,_pe,MPr,UQe,Pn,kpe,Lpe,Epe,V2,$Qe,Dpe,Rpe,xA,Tpe,zQe,WQe,Sc,Ppe,HQe,qQe,Ope,j2,Npe,Mpe,Fpe,Bpe,Upe,$pe,FPr,zpe,GQe,VQe,jQe,yA,vA,AA,wA,SA,CA,IA,_A,bi=l(()=>{"use client";ad();Oa();Yl();Qy();Rp();jy();Ky();pv();Hy();vn();Yy();Iv();xv();nd();bA="Dialog",[_pe,MPr]=Ma(bA),[UQe,Pn]=_pe(bA),kpe=e=>{let{__scopeDialog:t,children:r,open:a,defaultOpen:o,onOpenChange:n,modal:i=!0}=e,s=jt.useRef(null),c=jt.useRef(null),[u,m]=Ji({prop:a,defaultProp:o??!1,onChange:n,caller:bA});return hr(UQe,{scope:t,triggerRef:s,contentRef:c,contentId:li(),titleId:li(),descriptionId:li(),open:u,onOpenChange:m,onOpenToggle:jt.useCallback(()=>m(p=>!p),[m]),modal:i,children:r})};kpe.displayName=bA;Lpe="DialogTrigger",Epe=jt.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=Pn(Lpe,r),n=vt(t,o.triggerRef);return hr(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Y2(o.open),...a,ref:n,onClick:gt(e.onClick,o.onOpenToggle)})});Epe.displayName=Lpe;V2="DialogPortal",[$Qe,Dpe]=_pe(V2,{forceMount:void 0}),Rpe=e=>{let{__scopeDialog:t,forceMount:r,children:a,container:o}=e,n=Pn(V2,t);return hr($Qe,{scope:t,forceMount:r,children:jt.Children.map(a,i=>hr(ii,{present:r||n.open,children:hr(ic,{asChild:!0,container:o,children:i})}))})};Rpe.displayName=V2;xA="DialogOverlay",Tpe=jt.forwardRef((e,t)=>{let r=Dpe(xA,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,n=Pn(xA,e.__scopeDialog);return n.modal?hr(ii,{present:a||n.open,children:hr(WQe,{...o,ref:t})}):null});Tpe.displayName=xA;zQe=yn("DialogOverlay.RemoveScroll"),WQe=jt.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=Pn(xA,r);return hr(uc,{as:zQe,allowPinchZoom:!0,shards:[o.contentRef],children:hr(rt.div,{"data-state":Y2(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Sc="DialogContent",Ppe=jt.forwardRef((e,t)=>{let r=Dpe(Sc,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,n=Pn(Sc,e.__scopeDialog);return hr(ii,{present:a||n.open,children:n.modal?hr(HQe,{...o,ref:t}):hr(qQe,{...o,ref:t})})});Ppe.displayName=Sc;HQe=jt.forwardRef((e,t)=>{let r=Pn(Sc,e.__scopeDialog),a=jt.useRef(null),o=vt(t,r.contentRef,a);return jt.useEffect(()=>{let n=a.current;if(n)return pd(n)},[]),hr(Ope,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(e.onCloseAutoFocus,n=>{n.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:gt(e.onPointerDownOutside,n=>{let i=n.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&n.preventDefault()}),onFocusOutside:gt(e.onFocusOutside,n=>n.preventDefault())})}),qQe=jt.forwardRef((e,t)=>{let r=Pn(Sc,e.__scopeDialog),a=jt.useRef(!1),o=jt.useRef(!1);return hr(Ope,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(a.current||r.triggerRef.current?.focus(),n.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let i=n.target;r.triggerRef.current?.contains(i)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&o.current&&n.preventDefault()}})}),Ope=jt.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:n,...i}=e,s=Pn(Sc,r),c=jt.useRef(null),u=vt(t,c);return ld(),Ipe(Cpe,{children:[hr(Jl,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:n,children:hr(Zl,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Y2(s.open),...i,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),Ipe(Cpe,{children:[hr(GQe,{titleId:s.titleId}),hr(jQe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),j2="DialogTitle",Npe=jt.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=Pn(j2,r);return hr(rt.h2,{id:o.titleId,...a,ref:t})});Npe.displayName=j2;Mpe="DialogDescription",Fpe=jt.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=Pn(Mpe,r);return hr(rt.p,{id:o.descriptionId,...a,ref:t})});Fpe.displayName=Mpe;Bpe="DialogClose",Upe=jt.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=Pn(Bpe,r);return hr(rt.button,{type:"button",...a,ref:t,onClick:gt(e.onClick,()=>o.onOpenChange(!1))})});Upe.displayName=Bpe;$pe="DialogTitleWarning",[FPr,zpe]=vX($pe,{contentName:Sc,titleName:j2,docsSlug:"dialog"}),GQe=({titleId:e})=>{let t=zpe($pe),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
258
258
|
|
|
259
259
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
package/dist/meta.json
CHANGED
|
@@ -72566,7 +72566,7 @@
|
|
|
72566
72566
|
"format": "esm"
|
|
72567
72567
|
},
|
|
72568
72568
|
"libs/frameworks/src/react/features/auth/components/register/dynamic-register-form/dynamic-register-form.tsx": {
|
|
72569
|
-
"bytes":
|
|
72569
|
+
"bytes": 7434,
|
|
72570
72570
|
"imports": [
|
|
72571
72571
|
{
|
|
72572
72572
|
"path": "react",
|
|
@@ -80002,7 +80002,7 @@
|
|
|
80002
80002
|
"bytesInOutput": 682
|
|
80003
80003
|
},
|
|
80004
80004
|
"libs/frameworks/src/react/features/auth/components/register/dynamic-register-form/dynamic-register-form.tsx": {
|
|
80005
|
-
"bytesInOutput":
|
|
80005
|
+
"bytesInOutput": 3003
|
|
80006
80006
|
},
|
|
80007
80007
|
"libs/frameworks/src/react/features/auth/components/gm2-register/register.types.ts": {
|
|
80008
80008
|
"bytesInOutput": 137
|
|
@@ -80122,7 +80122,7 @@
|
|
|
80122
80122
|
"bytesInOutput": 96
|
|
80123
80123
|
}
|
|
80124
80124
|
},
|
|
80125
|
-
"bytes":
|
|
80125
|
+
"bytes": 1359902
|
|
80126
80126
|
},
|
|
80127
80127
|
"libs/register-wc/dist/build-register-wc.css": {
|
|
80128
80128
|
"imports": [],
|