@tempots/beatui 0.61.2 → 0.61.4
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/{ar-CZ-UB9pc.cjs → ar-CefikVG3.cjs} +1 -1
- package/dist/{ar-TEVFGyor.js → ar-aMLQTGVh.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +4 -4
- package/dist/{de-DAzM31i4.js → de-DBFOC44R.js} +1 -1
- package/dist/{de-IZSle3Nd.cjs → de-ZRnkggf5.cjs} +1 -1
- package/dist/{es-C7Gx9dqG.js → es-C4xOThaT.js} +1 -1
- package/dist/{es-DYe8rpsj.cjs → es-IkNtVSp2.cjs} +1 -1
- package/dist/{fa-CEbnfFly.cjs → fa-B-byOhgU.cjs} +1 -1
- package/dist/{fa-DKX_zJDi.js → fa-B7X_xydY.js} +1 -1
- package/dist/{fr-BRfNV0Yj.js → fr-AmjzbxN_.js} +1 -1
- package/dist/{fr-CrG0l5HN.cjs → fr-F0ZegdR2.cjs} +1 -1
- package/dist/{he-D6hsIiTH.cjs → he-BcEFNuYz.cjs} +1 -1
- package/dist/{he-DRAV97MO.js → he-DY-9yiOC.js} +1 -1
- package/dist/{hi-DyS6BNlk.cjs → hi-CarXvOJD.cjs} +1 -1
- package/dist/{hi-BaZyjzct.js → hi-Clkyp5Fu.js} +1 -1
- package/dist/{index-nqoZcPdT.js → index-CGoK9M1f.js} +3 -3
- package/dist/{index-Bu4A7nbp.js → index-D4U7cDIP.js} +1 -1
- package/dist/{index-BJxozmss.cjs → index-DJ6AuTd_.cjs} +2 -2
- package/dist/{index-Ch-e3nx4.cjs → index-J7CsYy0-.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +10 -10
- package/dist/{it-TCCyUGRc.js → it-BC32WmGF.js} +1 -1
- package/dist/{it-5c_IK4cL.cjs → it-ops3Czzi.cjs} +1 -1
- package/dist/{ja-VrfuPGN3.cjs → ja-2dzONSkh.cjs} +1 -1
- package/dist/{ja-Bpc6MfYs.js → ja-JNSZS_Hv.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +3 -3
- package/dist/{ko-BBN3tai6.js → ko-B8l0TJp0.js} +1 -1
- package/dist/{ko-BKSVpY_x.cjs → ko-uVJEhtyQ.cjs} +1 -1
- package/dist/{modal-DJDeFIxV.js → modal-DQ9LXrC4.js} +2 -2
- package/dist/{modal-DA0OKusk.cjs → modal-mwKwnIZS.cjs} +1 -1
- package/dist/{nl-CwXW1x3G.js → nl-BpYESHP8.js} +1 -1
- package/dist/{nl-Bry6kgvp.cjs → nl-DXnbYulJ.cjs} +1 -1
- package/dist/{notice-Cpso9PgQ.js → notice-BH_pePhd.js} +80 -79
- package/dist/{notice-BIcHmVnn.cjs → notice-D3As5ZhJ.cjs} +2 -2
- package/dist/{pl-CI2JMYK3.cjs → pl-RbiIBA3C.cjs} +1 -1
- package/dist/{pl-utONv5st.js → pl-_sWhGdrs.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-pg3nMUQB.cjs → pt-BAecyAv-.cjs} +1 -1
- package/dist/{pt-BKZlur2O.js → pt-BmiQvHUz.js} +1 -1
- package/dist/{ru-DcagJ4uT.cjs → ru-DZ4gJ6yr.cjs} +1 -1
- package/dist/{ru-B6HTgTqQ.js → ru-DacnqexG.js} +1 -1
- package/dist/{toolbar-_yJ-dm-Z.js → toolbar-Bk5-22ln.js} +1 -1
- package/dist/{toolbar-CC22Z53U.cjs → toolbar-wEm8iNet.cjs} +1 -1
- package/dist/{tr-BabBuwqd.cjs → tr-7jGF_acJ.cjs} +1 -1
- package/dist/{tr-DhELxnEm.js → tr-BSS5b_v6.js} +1 -1
- package/dist/{translations-g3qGTkzw.js → translations-BUTBIDsS.js} +36 -36
- package/dist/{translations-BRRDPpLp.cjs → translations-C7HVMcOQ.cjs} +1 -1
- package/dist/translations-hMQlZmD4.cjs +1 -0
- package/dist/{translations-ConAsIH1.js → translations-zGwuSQWQ.js} +1 -1
- package/dist/types/components/form/control/control.d.ts +3 -1
- package/dist/{ur-CT09S1x5.js → ur-C6Ky6OCl.js} +1 -1
- package/dist/{ur-BVE5ZRyR.cjs → ur-ZT6fZFId.cjs} +1 -1
- package/dist/{utils-B25pniId.cjs → utils-DKHQo6zE.cjs} +1 -1
- package/dist/{utils-BRzdi3Gx.js → utils-DplD1EWi.js} +2 -2
- package/dist/{vi-BsZzI9Fa.js → vi-Bx2gx2S0.js} +1 -1
- package/dist/{vi-DvU7fKay.cjs → vi-tNs62pgs.cjs} +1 -1
- package/dist/{zh-CijYgDFA.cjs → zh-CBnP8_Lf.cjs} +1 -1
- package/dist/{zh-BeCkrv4q.js → zh-eixtg-Ce.js} +1 -1
- package/package.json +1 -1
- package/dist/translations-DM5R5VZ0.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-hMQlZmD4.cjs"),a={loadingExtended:"جاري التحميل، يرجى الانتظار",loadingShort:"جاري التحميل...",locale:"اللغة",iconDescription:"أيقونة",loadingIcon:"أيقونة التحميل",failedToLoadIcon:"فشل في تحميل الأيقونة",editLabel:"تحرير",selectOne:"اختر واحد",selectMany:"اختر عدة",noResults:"لا نتائج",passwordPlaceholderText:"كلمة المرور السرية",togglePasswordVisibility:"إظهار/إخفاء كلمة المرور",toggleMenu:"تبديل القائمة",toggleAside:"تبديل اللوحة الجانبية",mainNavigation:"القائمة الرئيسية",sidebar:"الشريط الجانبي",closeDrawer:"إغلاق الدرج",closeModal:"إغلاق النافذة المنبثقة",confirm:"تأكيد",cancel:"إلغاء",addLabel:"إضافة",removeItem:"إزالة العنصر",currentLocale:"العربية",ar:"العربية",de:"الألمانية",en:"الإنجليزية",es:"الأسبانية",fr:"الفرنسية",hi:"الهندية",it:"الإيطالية",ja:"اليابانية",ko:"الكورية",nl:"الهولندية",pl:"البولندية",pt:"البرتغالية",ru:"الروسية",tr:"التركية",vi:"الفيتنامية",zh:"الصينية",he:"العبرية",fa:"الفارسية",ur:"الأردية",emailPlaceholderText:"بريدك الإلكتروني",incrementValue:"زيادة القيمة",decrementValue:"تقليل القيمة",dropZoneInstructions:e=>e?"انقر للاختيار أو اسحب الملفات هنا، أو اضغط Enter أو Space لفتح محدد الملفات":"اسحب الملفات هنا",fileSizeUnits:["بايت","ك.ب","م.ب","ج.ب","ت.ب"],removeFile:"إزالة الملف",clearAllFiles:"مسح كل الملفات",clearValue:"مسح القيمة",unknownType:"نوع غير معروف",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"انقر للاختيار أو اسحب الملفات هنا":"انقر للاختيار أو اسحب ملف هنا";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`حتى ${e} ملفات`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`حد أقصى ${i} لكل ملف`)}l.length>0&&(n+=` (${l.join("، ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
|
package/dist/auth/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tempots/dom"),u=require("../notice-BIcHmVnn.cjs"),g=require("../modal-DA0OKusk.cjs"),P=require("../translations-BRRDPpLp.cjs"),I=require("../translations-DM5R5VZ0.cjs"),Z=require("@tempots/ui"),C={google:{name:"Google",icon:"logos:google-icon",color:"#4285f4"},github:{name:"GitHub",icon:"logos:github-icon",color:"#333"},apple:{name:"Apple",icon:"logos:apple",color:"#000"},facebook:{name:"Facebook",icon:"logos:facebook",color:"#1877f2"},twitter:{name:"Twitter",icon:"logos:twitter",color:"#1da1f2"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"#00a4ef"},discord:{name:"Discord",icon:"logos:discord-icon",color:"#5865f2"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"#0077b5"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"#e4405f"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"#000"},snapchat:{name:"Snapchat",icon:"logos:snapchat-icon",color:"#fffc00"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"#ff4500"},pinterest:{name:"Pinterest",icon:"logos:pinterest-icon",color:"#bd081c"},twitch:{name:"Twitch",icon:"logos:twitch",color:"#9146ff"},steam:{name:"Steam",icon:"logos:steam-icon",color:"#000"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"#313131"},playstation:{name:"PlayStation",icon:"logos:playstation-icon",color:"#003791"},xbox:{name:"Xbox",icon:"logos:xbox-icon",color:"#107c10"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"#25d366"},wechat:{name:"WeChat",icon:"logos:wechat-icon",color:"#1aad19"},amazon:{name:"Amazon",icon:"logos:amazon-icon",color:"#ff9900"},yahoo:{name:"Yahoo",icon:"logos:yahoo-icon",color:"#720e9e"},paypal:{name:"PayPal",icon:"logos:paypal",color:"#0070ba"},x:{name:"X",icon:"simple-icons:x",color:"#000"}};function M(o){return C[o]?.name||o}function J(o){return C[o]?.icon||"mdi:account"}function K(o){return C[o]?.color||"#666"}function Q(o,e="Continue with {provider}"){return e.replace("{provider}",M(o))}const y={minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!1};function tt(o){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o)}function N(o=32){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let l=0;l<o;l++)i+=e.charAt(Math.floor(Math.random()*e.length));return i}function ot(o,e,i,l=[],c={}){const n={google:"https://accounts.google.com/oauth/authorize",github:"https://github.com/login/oauth/authorize",apple:"https://appleid.apple.com/auth/authorize",facebook:"https://www.facebook.com/v18.0/dialog/oauth",twitter:"https://twitter.com/i/oauth2/authorize",microsoft:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",discord:"https://discord.com/api/oauth2/authorize",linkedin:"https://www.linkedin.com/oauth/v2/authorization",instagram:"https://api.instagram.com/oauth/authorize",tiktok:"https://www.tiktok.com/v2/auth/authorize",snapchat:"https://accounts.snapchat.com/accounts/oauth2/authorize",reddit:"https://www.reddit.com/api/v1/authorize",pinterest:"https://api.pinterest.com/oauth/",twitch:"https://id.twitch.tv/oauth2/authorize",steam:"https://steamcommunity.com/oauth/authorize",epic:"https://auth.epicgames.com/authorize",playstation:"https://auth.api.sonyentertainmentnetwork.com/oauth/authorize",xbox:"https://login.live.com/oauth20_authorize.srf",whatsapp:"https://web.whatsapp.com/oauth/authorize",wechat:"https://open.weixin.qq.com/connect/qrconnect",amazon:"https://www.amazon.com/ap/oa",yahoo:"https://api.login.yahoo.com/oauth2/request_auth",paypal:"https://www.paypal.com/signin/authorize",x:"https://api.twitter.com/oauth2/authorize"},m={google:["openid","email","profile"],github:["user:email"],apple:["email","name"],facebook:["email"],twitter:["users.read"],microsoft:["openid","email","profile"],discord:["identify","email"],linkedin:["r_liteprofile","r_emailaddress"],instagram:["user_profile","user_media"],tiktok:["user.info.basic","user.external.id"],snapchat:["user.info.basic","user.external.id"],reddit:["identity","email"],pinterest:["read_public","read_relationships"],twitch:["openid","email","profile"],steam:["openid","email","profile"],epic:["openid","email","profile"],playstation:["openid","email","profile"],xbox:["openid","email","profile"],whatsapp:["openid","email","profile"],wechat:["openid","email","profile"],amazon:["openid","email","profile"],yahoo:["openid","email","profile"],paypal:["openid","email","profile"],x:["openid","email","profile"]},a=n[o];if(!a)throw new Error(`Unsupported provider: ${o}`);const r=l.length>0?l:m[o],s=N(),h=new URLSearchParams({client_id:e,redirect_uri:i,scope:r.join(" "),state:s,response_type:"code",...c});return`${a}?${h.toString()}`}function et(o,e,i,l){const c=window.open(o,`${e}_login`,"width=500,height=600,scrollbars=yes,resizable=yes");if(!c){l?.(new Error("Failed to open popup window"));return}const n=setInterval(()=>{c.closed&&(clearInterval(n),l?.(new Error("Login cancelled")))},1e3),m=a=>{a.origin===window.location.origin&&(a.data.type==="SOCIAL_LOGIN_SUCCESS"?(clearInterval(n),c.close(),window.removeEventListener("message",m),i?.(a.data.result)):a.data.type==="SOCIAL_LOGIN_ERROR"&&(clearInterval(n),c.close(),window.removeEventListener("message",m),l?.(new Error(a.data.error))))};window.addEventListener("message",m)}function at(o){return o instanceof Error?o.message:typeof o=="string"?o:o&&typeof o=="object"&&"message"in o?String(o.message):"An unexpected error occurred"}function nt(){return typeof window<"u"&&typeof document<"u"}function T({task:o,message:e,onStart:i,onEnd:l}){return async c=>{i?.();const n=await u.taskToValidation({task:o!=null?()=>o(c):async()=>null,errorMessage:e,errorPath:["root"],validation:m=>m!=null?u.a.invalid({message:m}):u.a.valid});return l?.(),n}}function $(o=y){let e=g.string();return o.minLength&&(e=e.min(o.minLength,`Password must be at least ${o.minLength} characters`)),o.requireUppercase&&(e=e.regex(/[A-Z]/,"Password must contain at least one uppercase letter")),o.requireLowercase&&(e=e.regex(/[a-z]/,"Password must contain at least one lowercase letter")),o.requireNumbers&&(e=e.regex(/[0-9]/,"Password must contain at least one number")),o.requireSymbols&&(e=e.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,"Password must contain at least one special character")),o.customValidation&&(e=e.refine(i=>o.customValidation(i))),e}const x=g.string().min(1,"Email is required").email("Please enter a valid email address");function z(o){const e=o?$(o):g.string().refine(i=>i.length>0?null:"Password is required");return g.object({email:x,password:e,rememberMe:g.boolean().default(!1)}).schema()}function E(o=y,e){const i=$(o),l=e?.showNameField!==!1,c=e?.showConfirmPassword!==!1,n=e?.showAcceptTermsAndConditions!==!1,m={name:l?g.string().min(1,"Name is required").optional():g.string().optional(),email:x,password:i,confirmPassword:c?g.string().min(1,"Please confirm your password"):g.string(),acceptTerms:n?g.boolean().refine(r=>r===!0,"You must accept the terms and conditions"):g.boolean().default(!0)},a=g.object(m);return c?a.refine(r=>r.password===r.confirmPassword?null:"Passwords don't match",{path:["confirmPassword"]}).schema():a.schema()}const V=g.object({email:x}).schema(),rt=z(),st=E(),it={signIn:z,signUp:E,resetPassword:()=>V};function ct(o){const e=x.validate(o);return e.success?null:e.errors[0]?.message||"Invalid email"}function lt(o,e=y){const l=$(e).validate(o);return l.success?null:l.errors[0]?.message||"Invalid password"}function O(o,e=y){const i={length:o.length>=(e.minLength||8),uppercase:/[A-Z]/.test(o),lowercase:/[a-z]/.test(o),numbers:/[0-9]/.test(o),symbols:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(o),custom:e.customValidation?e.customValidation(o)===null:o.length>0},l=[!0,e.requireUppercase,e.requireLowercase,e.requireNumbers,e.requireSymbols,!!e.customValidation].filter(Boolean).length,c=[i.length,e.requireUppercase?i.uppercase:null,e.requireLowercase?i.lowercase:null,e.requireNumbers?i.numbers:null,e.requireSymbols?i.symbols:null,e.customValidation?i.custom:null].filter(a=>a===!0).length,n=l>0?Math.round(c/l*100):0;let m;return n<40?m="weak":n<60?m="fair":n<80?m="good":m="strong",{strength:m,score:n,checks:i}}const R=()=>t.localStorageProp({key:"bui_auth_email",defaultValue:null});function D({onSignIn:o,passwordRules:e,labels:i,showRememberMe:l}){const c=t.prop(!1),n=R(),m=z(e),a=u.useForm({schema:m,onSubmit:T({task:o,message:"Reset password failed",onStart:()=>{c.set(!0),a.controller.disable()},onEnd:()=>{c.set(!1),a.controller.enable()}}),initialValue:{email:"",password:""}}),{controller:r,submit:s}=a;c.on(r.setDisabled);const h=r.field("email"),f=r.field("password");return n.on(b=>{b!=null&&h.change(b)}),h.signal.on(b=>{n.value!=null&&(n.value=b)}),t.Use(P.AuthI18n,b=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(s),u.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(r.error,L=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(L))),u.Control(u.EmailInput,{controller:h,label:t.coalesce(i?.emailLabel,b.$.emailLabel)}),u.Control(u.PasswordInput,{controller:f,label:t.coalesce(i?.passwordLabel,b.$.passwordLabel)}),t.When(l??!0,()=>t.html.div(t.attr.class("bc-auth-form__remember-me"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),u.CheckboxInput({value:n.map(L=>L!=null),after:t.html.span(t.coalesce(i?.rememberMeLabel,b.$.rememberMeLabel)),onChange:L=>{L?n.value=h.signal.value??"":n.value=null}}))))),I.Button({type:"submit",variant:"filled",color:"primary",loading:c,disabled:r.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(i?.signInButton,b.$.signInButton))))}function G({password:o,rules:e=y,showLabel:i=!0,className:l}){const c=t.computedOf(o)(s=>!s||s.length===0?{strength:"weak",score:0,checks:{length:!1,uppercase:!1,lowercase:!1,numbers:!1,symbols:!1,custom:!1}}:O(s,e)),n=c.map(s=>s.strength),m=c.map(s=>s.score),a=c.map(s=>s.checks),r=t.computedOf(n,l)((s,h)=>["bc-password-strength",`bc-password-strength--${s}`,h].filter(Boolean).join(" "));return t.html.div(t.attr.class(r),t.html.div(t.attr.class("bc-password-strength__bar"),t.html.div(t.attr.class("bc-password-strength__fill"),t.attr.style(m.map(s=>`width: ${s}%`)))),t.When(i,()=>t.Use(P.AuthI18n,s=>t.html.div(t.attr.class("bc-password-strength__label"),t.computedOf(n,s)((h,f)=>{switch(h){case"weak":return f.passwordStrengthWeak;case"fair":return f.passwordStrengthFair;case"good":return f.passwordStrengthGood;case"strong":return f.passwordStrengthStrong;default:return f.passwordStrengthWeak}})))),t.html.div(t.attr.class("bc-password-strength__requirements"),t.When(e.minLength!==void 0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.length?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.length?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),`At least ${e.minLength} characters`))),t.When(e.requireUppercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.uppercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.uppercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One uppercase letter"))),t.When(e.requireLowercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.lowercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.lowercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One lowercase letter"))),t.When(e.requireNumbers===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.numbers?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.numbers?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One number"))),t.When(e.requireSymbols===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.symbols?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.symbols?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One special character")))))}function mt({password:o,rules:e=y,className:i}){const l=t.computedOf(o)(a=>!a||a.length===0?{strength:"weak",score:0}:O(a,e)),c=l.map(a=>a.strength),n=l.map(a=>a.score),m=t.computedOf(c,i)((a,r)=>["bc-password-strength-bar",`bc-password-strength-bar--${a}`,r].filter(Boolean).join(" "));return t.html.div(t.attr.class(m),t.html.div(t.attr.class("bc-password-strength-bar__fill"),t.attr.style(n.map(a=>`width: ${a}%`))))}function ut({password:o,rules:e=y,className:i}){const l=t.computedOf(o)(n=>!n||n.length===0?"weak":O(n,e).strength),c=t.computedOf(l,i)((n,m)=>["bc-password-strength-text",`bc-password-strength-text--${n}`,m].filter(Boolean).join(" "));return t.Fragment(t.Use(P.AuthI18n,n=>t.html.span(t.attr.class(c),t.computedOf(l,n)((m,a)=>{switch(m){case"weak":return a.passwordStrengthWeak;case"fair":return a.passwordStrengthFair;case"good":return a.passwordStrengthGood;case"strong":return a.passwordStrengthStrong;default:return a.passwordStrengthWeak}}))))}function j({passwordRules:o,labels:e,initialEmail:i,initialName:l,showPasswordStrength:c,onSignUp:n,showNameField:m,showConfirmPassword:a,showAcceptTermsAndConditions:r,termsAndConditions:s}){const h=t.prop(!1),f=o||y,b=E(f,{showNameField:m!==!1,showConfirmPassword:a!==!1,showAcceptTermsAndConditions:r!==!1}),L=u.useForm({schema:b,onSubmit:T({task:n!=null?_=>n({email:_.email,password:_.password,name:_.name,acceptTerms:_.acceptTerms}):void 0,message:"Reset password failed",onStart:()=>{h.set(!0),L.controller.disable()},onEnd:()=>{h.set(!1),L.controller.enable()}}),initialValue:{name:l??"",email:i??"",password:"",confirmPassword:"",acceptTerms:!1}}),{controller:k,submit:B}=L;h.on(k.setDisabled);const v=k.field("name"),q=k.field("email"),A=k.field("password"),U=k.field("confirmPassword"),S=k.field("acceptTerms");return t.Use(P.AuthI18n,_=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(B),u.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(k.error,w=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(w))),t.When(m!==!1,()=>u.Control(I.TextInput,{controller:v.transform(w=>w??"",w=>w===""?void 0:w),label:t.coalesce(e?.nameLabel,_.$.nameLabel)})),u.Control(u.EmailInput,{controller:q,label:t.coalesce(e?.emailLabel,_.$.emailLabel)}),u.Control(u.PasswordInput,{controller:A,label:t.coalesce(e?.passwordLabel,_.$.passwordLabel)}),t.When(c??!1,()=>G({password:A.signal,rules:f,showLabel:!0})),t.When(a??!1,()=>u.Control(u.PasswordInput,{controller:U,label:t.coalesce(e?.confirmPasswordLabel,_.$.confirmPasswordLabel)})),t.When(r??!1,()=>t.html.div(t.attr.class("bc-auth-form__terms"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),u.CheckboxInput({value:S.signal.map(w=>w??!1),onChange:w=>S.change(w)}),t.html.span(s||t.coalesce(e?.acceptTermsLabel,_.$.acceptTermsLabel))),t.When(S.errorVisible,()=>t.html.div(t.attr.class("bc-auth-form__field-error"),S.error.map(w=>w||"")))))),I.Button({type:"submit",variant:"filled",color:"primary",loading:h,disabled:k.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(e?.signUpButton,_.$.signUpButton))))}function H({onResetPassword:o,labels:e={}}){const i=R(),l=t.prop(!1),c=u.useForm({schema:V,onSubmit:T({task:o,message:"Reset password failed",onStart:()=>{l.set(!0),c.controller.disable()},onEnd:()=>{l.set(!1),c.controller.enable()}}),initialValue:{email:""}}),{controller:n,submit:m}=c;l.on(n.setDisabled);const a=n.field("email");return i.on(r=>{r!=null&&a.change(r)}),t.Use(P.AuthI18n,r=>t.html.form(t.attr.class("bc-auth-form__form"),t.Ensure(n.error,s=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(s))),t.html.p(t.attr.class("bc-auth-form__description"),t.coalesce(e?.resetPasswordDescription,r.$.resetPasswordDescription)),t.on.submit(m),u.Stack(t.attr.class("bc-auth-form__fields"),u.Control(u.EmailInput,{controller:a,label:t.coalesce(e?.emailLabel,r.$.emailLabel)})),I.Button({loading:l,type:"submit",variant:"filled",color:"primary",disabled:n.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(e?.resetPasswordButton,r.$.resetPasswordButton))))}function p({provider:o,onClick:e,size:i="md",name:l,icon:c,color:n,flow:m,labels:a}){const r=async()=>{if(e)try{m==="popup"?await e():await e()}catch(s){console.error(`Social login error for ${o} (${m||"redirect"} flow):`,s)}};return I.Button({type:"button",variant:"filled",size:i,color:n,onClick:r,roundedness:"full"},t.attr.class("bc-social-login-button"),t.attr.class(t.computedOf(o)(s=>`bc-social-login-button--${s}`)),t.html.span(t.attr.class("bc-social-login-button__inner"),t.html.span(t.attr.class("bc-social-login-button__icon"),I.Icon({icon:c,size:i},t.attr.class("bc-social-login-button__icon-inner"))),t.Use(P.AuthI18n,s=>t.html.span(t.attr.class("bc-social-login-button__label"),t.bind(t.coalesce(a?.continueWithProvider,s.$.continueWithProvider))(l)))))}function X({providers:o,onProviderClick:e,size:i="md",className:l}){return u.Stack(t.attr.class("bc-social-login-buttons"),t.attr.class(l),t.ForEach(o,c=>p({provider:c.$.provider,flow:c.$.flow,color:c.map(({provider:n})=>d[n].color),name:c.map(({provider:n})=>d[n].name),icon:c.map(({provider:n})=>d[n].icon),onClick:async()=>{e&&await e(c.$.provider.value)},size:i})))}const d={google:{name:"Google",icon:"logos:google-icon",color:"red"},github:{name:"GitHub",icon:"logos:github-icon",color:"black"},apple:{name:"Apple",icon:"logos:apple",color:"stone"},facebook:{name:"Facebook",icon:"logos:facebook",color:"blue"},twitter:{name:"Twitter",icon:"logos:twitter",color:"sky"},x:{name:"X",icon:"logos:x",color:"zinc"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"amber"},discord:{name:"Discord",icon:"logos:discord-icon",color:"indigo"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"cyan"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"fuchsia"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"teal"},snapchat:{name:"Snapchat",icon:"streamline-logos:snapchat-logo-solid",color:"yellow"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"orange"},pinterest:{name:"Pinterest",icon:"logos:pinterest",color:"rose"},twitch:{name:"Twitch",icon:"logos:twitch",color:"purple"},steam:{name:"Steam",icon:"logos:steam",color:"slate"},epic:{name:"Epic Games",icon:"streamline-logos:epic-games-logo-solid",color:"neutral"},playstation:{name:"PlayStation",icon:"streamline-logos:playstation-logo-solid",color:"violet"},xbox:{name:"Xbox",icon:"streamline-logos:xbox-live-logo-solid",color:"green"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"emerald"},wechat:{name:"WeChat",icon:"streamline-logos:wechat-logo",color:"lime"},amazon:{name:"Amazon",icon:"streamline-logos:amazon-logo-solid",color:"red"},yahoo:{name:"Yahoo",icon:"logos:yahoo",color:"rose"},paypal:{name:"PayPal",icon:"logos:paypal",color:"blue"}},dt=o=>p({...o,...d.google,provider:"google"}),pt=o=>p({...o,...d.github,provider:"github"}),ht=o=>p({...o,...d.apple,provider:"apple"}),gt=o=>p({...o,...d.facebook,provider:"facebook"}),ft=o=>p({...o,...d.x,provider:"x"}),bt=o=>p({...o,...d.twitter,provider:"twitter"}),wt=o=>p({...o,...d.microsoft,provider:"microsoft"}),Lt=o=>p({...o,...d.discord,provider:"discord"}),_t=o=>p({...o,...d.linkedin,provider:"linkedin"}),kt=o=>p({...o,...d.instagram,provider:"instagram"}),vt=o=>p({...o,...d.tiktok,provider:"tiktok"}),St=o=>p({...o,...d.snapchat,provider:"snapchat"}),Pt=o=>p({...o,...d.reddit,provider:"reddit"}),yt=o=>p({...o,...d.pinterest,provider:"pinterest"}),Bt=o=>p({...o,...d.twitch,provider:"twitch"}),It=o=>p({...o,...d.steam,provider:"steam"}),xt=o=>p({...o,...d.epic,provider:"epic"}),qt=o=>p({...o,...d.playstation,provider:"playstation"}),At=o=>p({...o,...d.xbox,provider:"xbox"}),Ct=o=>p({...o,...d.whatsapp,provider:"whatsapp"}),Tt=o=>p({...o,...d.wechat,provider:"wechat"}),$t=o=>p({...o,...d.amazon,provider:"amazon"}),zt=o=>p({...o,...d.yahoo,provider:"yahoo"}),Et=o=>p({...o,...d.paypal,provider:"paypal"});function W({providers:o}){return u.Stack(X({providers:o}))}function Y({mode:o,socialProviders:e,initialName:i,initialEmail:l,passwordRules:c,showRememberMe:n,showSocialDivider:m,showPasswordStrength:a,labels:r,onSignIn:s,onSignUp:h,onResetPassword:f,onModeChange:b,showContainer:L},...k){const B=o!=null?t.Value.deriveProp(o):t.prop("signin");return B.on(v=>b?.(v)),t.Use(P.AuthI18n,v=>{function q(){const S=t.coalesce(r?.hasAccountLink,v.$.hasAccountLink);return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("signin")),S)}function A(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("signup")),t.coalesce(r?.noAccountLink,v.$.noAccountLink))}function U(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("reset-password")),t.coalesce(r?.forgotPasswordLink,v.$.forgotPasswordLink))}return t.html.div(Z.classes({"bc-auth-container":!0,"bc-auth-container--styled":t.Value.map(L??!0,S=>S)}),t.attr.class(B.map(S=>`bc-auth-container--${S}`)),t.attr.class("bc-auth-form"),t.OneOfValue(B,{signin:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signInTitle,v.$.signInTitle)),e!=null?t.Fragment(W({providers:e}),t.When(m??!1,F)):null,D({onSignIn:s,showRememberMe:n,passwordRules:c,labels:{emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,rememberMeLabel:r?.rememberMeLabel,signInButton:r?.signInButton,forgotPasswordLink:r?.forgotPasswordLink,noAccountLink:r?.noAccountLink}}),u.Stack(t.attr.class("bc-auth-form__footer"),A(),U())),signup:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signUpTitle,v.$.signUpTitle)),e!=null?t.Fragment(W({providers:e}),t.When(m??!1,F)):null,j({labels:{nameLabel:r?.nameLabel,emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,confirmPasswordLabel:r?.confirmPasswordLabel,acceptTermsLabel:r?.acceptTermsLabel,signUpButton:r?.signUpButton,hasAccountLink:r?.hasAccountLink},initialEmail:l,initialName:i,onSignUp:h,passwordRules:c,showPasswordStrength:a}),u.Stack(t.attr.class("bc-auth-form__footer"),q())),"reset-password":()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.resetPasswordTitle,v.$.resetPasswordTitle)),H({labels:{backToSignInLink:r?.backToSignInLink,emailLabel:r?.emailLabel,resetPasswordButton:r?.resetPasswordButton,resetPasswordDescription:r?.resetPasswordDescription},onResetPassword:f}),u.Stack(t.attr.class("bc-auth-form__footer"),q()))}),...k)})}function Ot(o){return g.Modal({size:"sm",dismissable:!0,showCloseButton:!0},(e,i)=>o(l=>e({body:Y({showContainer:!1,...l}),header:t.Use(P.AuthI18n,c=>t.coalesce(l.modalTitle,c.$.authenticationTitle))})))}function F({labels:o,className:e}={}){return t.html.div(t.attr.class("bc-auth-divider"),t.attr.class(e),t.html.div(t.attr.class("bc-auth-divider__line")),t.Use(P.AuthI18n,i=>t.html.span(t.attr.class("bc-auth-divider__text"),t.coalesce(o?.text,i.$.orDivider))),t.html.div(t.attr.class("bc-auth-divider__line")))}exports.AmazonLoginButton=$t;exports.AppleLoginButton=ht;exports.AuthContainer=Y;exports.AuthDivider=F;exports.AuthModal=Ot;exports.DiscordLoginButton=Lt;exports.EpicLoginButton=xt;exports.FacebookLoginButton=gt;exports.GitHubLoginButton=pt;exports.GoogleLoginButton=dt;exports.InstagramLoginButton=kt;exports.LinkedInLoginButton=_t;exports.MicrosoftLoginButton=wt;exports.PasswordStrengthBar=mt;exports.PasswordStrengthIndicator=G;exports.PasswordStrengthText=ut;exports.PayPalLoginButton=Et;exports.PinterestLoginButton=yt;exports.PlayStationLoginButton=qt;exports.RedditLoginButton=Pt;exports.ResetPasswordForm=H;exports.SignInForm=D;exports.SignUpForm=j;exports.SnapchatLoginButton=St;exports.SocialLoginButton=p;exports.SocialLoginButtons=X;exports.SocialProviders=W;exports.SteamLoginButton=It;exports.TiktokLoginButton=vt;exports.TwitchLoginButton=Bt;exports.TwitterLoginButton=bt;exports.WeChatLoginButton=Tt;exports.WhatsAppLoginButton=Ct;exports.XLoginButtin=ft;exports.XboxLoginButton=At;exports.YahooLoginButton=zt;exports.authSchemas=it;exports.calculatePasswordStrength=O;exports.createPasswordSchema=$;exports.createSignInSchema=z;exports.createSignUpSchema=E;exports.createSocialLoginUrl=ot;exports.defaultPasswordRules=y;exports.defaultSignInSchema=rt;exports.defaultSignUpSchema=st;exports.emailSchema=x;exports.formatAuthError=at;exports.formatProviderName=M;exports.formatSocialLoginText=Q;exports.generateRandomString=N;exports.getProviderColor=K;exports.getProviderIcon=J;exports.isBrowser=nt;exports.isValidEmail=tt;exports.openSocialLoginPopup=et;exports.providerInfo=C;exports.requestToControllerValidation=T;exports.resetPasswordSchema=V;exports.socialProviderInfo=d;exports.useAuthEmailProp=R;exports.validateEmail=ct;exports.validatePassword=lt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tempots/dom"),u=require("../notice-D3As5ZhJ.cjs"),g=require("../modal-mwKwnIZS.cjs"),P=require("../translations-C7HVMcOQ.cjs"),I=require("../translations-hMQlZmD4.cjs"),Z=require("@tempots/ui"),C={google:{name:"Google",icon:"logos:google-icon",color:"#4285f4"},github:{name:"GitHub",icon:"logos:github-icon",color:"#333"},apple:{name:"Apple",icon:"logos:apple",color:"#000"},facebook:{name:"Facebook",icon:"logos:facebook",color:"#1877f2"},twitter:{name:"Twitter",icon:"logos:twitter",color:"#1da1f2"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"#00a4ef"},discord:{name:"Discord",icon:"logos:discord-icon",color:"#5865f2"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"#0077b5"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"#e4405f"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"#000"},snapchat:{name:"Snapchat",icon:"logos:snapchat-icon",color:"#fffc00"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"#ff4500"},pinterest:{name:"Pinterest",icon:"logos:pinterest-icon",color:"#bd081c"},twitch:{name:"Twitch",icon:"logos:twitch",color:"#9146ff"},steam:{name:"Steam",icon:"logos:steam-icon",color:"#000"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"#313131"},playstation:{name:"PlayStation",icon:"logos:playstation-icon",color:"#003791"},xbox:{name:"Xbox",icon:"logos:xbox-icon",color:"#107c10"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"#25d366"},wechat:{name:"WeChat",icon:"logos:wechat-icon",color:"#1aad19"},amazon:{name:"Amazon",icon:"logos:amazon-icon",color:"#ff9900"},yahoo:{name:"Yahoo",icon:"logos:yahoo-icon",color:"#720e9e"},paypal:{name:"PayPal",icon:"logos:paypal",color:"#0070ba"},x:{name:"X",icon:"simple-icons:x",color:"#000"}};function M(o){return C[o]?.name||o}function J(o){return C[o]?.icon||"mdi:account"}function K(o){return C[o]?.color||"#666"}function Q(o,e="Continue with {provider}"){return e.replace("{provider}",M(o))}const y={minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!1};function tt(o){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o)}function N(o=32){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let l=0;l<o;l++)i+=e.charAt(Math.floor(Math.random()*e.length));return i}function ot(o,e,i,l=[],c={}){const n={google:"https://accounts.google.com/oauth/authorize",github:"https://github.com/login/oauth/authorize",apple:"https://appleid.apple.com/auth/authorize",facebook:"https://www.facebook.com/v18.0/dialog/oauth",twitter:"https://twitter.com/i/oauth2/authorize",microsoft:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",discord:"https://discord.com/api/oauth2/authorize",linkedin:"https://www.linkedin.com/oauth/v2/authorization",instagram:"https://api.instagram.com/oauth/authorize",tiktok:"https://www.tiktok.com/v2/auth/authorize",snapchat:"https://accounts.snapchat.com/accounts/oauth2/authorize",reddit:"https://www.reddit.com/api/v1/authorize",pinterest:"https://api.pinterest.com/oauth/",twitch:"https://id.twitch.tv/oauth2/authorize",steam:"https://steamcommunity.com/oauth/authorize",epic:"https://auth.epicgames.com/authorize",playstation:"https://auth.api.sonyentertainmentnetwork.com/oauth/authorize",xbox:"https://login.live.com/oauth20_authorize.srf",whatsapp:"https://web.whatsapp.com/oauth/authorize",wechat:"https://open.weixin.qq.com/connect/qrconnect",amazon:"https://www.amazon.com/ap/oa",yahoo:"https://api.login.yahoo.com/oauth2/request_auth",paypal:"https://www.paypal.com/signin/authorize",x:"https://api.twitter.com/oauth2/authorize"},m={google:["openid","email","profile"],github:["user:email"],apple:["email","name"],facebook:["email"],twitter:["users.read"],microsoft:["openid","email","profile"],discord:["identify","email"],linkedin:["r_liteprofile","r_emailaddress"],instagram:["user_profile","user_media"],tiktok:["user.info.basic","user.external.id"],snapchat:["user.info.basic","user.external.id"],reddit:["identity","email"],pinterest:["read_public","read_relationships"],twitch:["openid","email","profile"],steam:["openid","email","profile"],epic:["openid","email","profile"],playstation:["openid","email","profile"],xbox:["openid","email","profile"],whatsapp:["openid","email","profile"],wechat:["openid","email","profile"],amazon:["openid","email","profile"],yahoo:["openid","email","profile"],paypal:["openid","email","profile"],x:["openid","email","profile"]},a=n[o];if(!a)throw new Error(`Unsupported provider: ${o}`);const r=l.length>0?l:m[o],s=N(),h=new URLSearchParams({client_id:e,redirect_uri:i,scope:r.join(" "),state:s,response_type:"code",...c});return`${a}?${h.toString()}`}function et(o,e,i,l){const c=window.open(o,`${e}_login`,"width=500,height=600,scrollbars=yes,resizable=yes");if(!c){l?.(new Error("Failed to open popup window"));return}const n=setInterval(()=>{c.closed&&(clearInterval(n),l?.(new Error("Login cancelled")))},1e3),m=a=>{a.origin===window.location.origin&&(a.data.type==="SOCIAL_LOGIN_SUCCESS"?(clearInterval(n),c.close(),window.removeEventListener("message",m),i?.(a.data.result)):a.data.type==="SOCIAL_LOGIN_ERROR"&&(clearInterval(n),c.close(),window.removeEventListener("message",m),l?.(new Error(a.data.error))))};window.addEventListener("message",m)}function at(o){return o instanceof Error?o.message:typeof o=="string"?o:o&&typeof o=="object"&&"message"in o?String(o.message):"An unexpected error occurred"}function nt(){return typeof window<"u"&&typeof document<"u"}function T({task:o,message:e,onStart:i,onEnd:l}){return async c=>{i?.();const n=await u.taskToValidation({task:o!=null?()=>o(c):async()=>null,errorMessage:e,errorPath:["root"],validation:m=>m!=null?u.a.invalid({message:m}):u.a.valid});return l?.(),n}}function $(o=y){let e=g.string();return o.minLength&&(e=e.min(o.minLength,`Password must be at least ${o.minLength} characters`)),o.requireUppercase&&(e=e.regex(/[A-Z]/,"Password must contain at least one uppercase letter")),o.requireLowercase&&(e=e.regex(/[a-z]/,"Password must contain at least one lowercase letter")),o.requireNumbers&&(e=e.regex(/[0-9]/,"Password must contain at least one number")),o.requireSymbols&&(e=e.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,"Password must contain at least one special character")),o.customValidation&&(e=e.refine(i=>o.customValidation(i))),e}const x=g.string().min(1,"Email is required").email("Please enter a valid email address");function z(o){const e=o?$(o):g.string().refine(i=>i.length>0?null:"Password is required");return g.object({email:x,password:e,rememberMe:g.boolean().default(!1)}).schema()}function E(o=y,e){const i=$(o),l=e?.showNameField!==!1,c=e?.showConfirmPassword!==!1,n=e?.showAcceptTermsAndConditions!==!1,m={name:l?g.string().min(1,"Name is required").optional():g.string().optional(),email:x,password:i,confirmPassword:c?g.string().min(1,"Please confirm your password"):g.string(),acceptTerms:n?g.boolean().refine(r=>r===!0,"You must accept the terms and conditions"):g.boolean().default(!0)},a=g.object(m);return c?a.refine(r=>r.password===r.confirmPassword?null:"Passwords don't match",{path:["confirmPassword"]}).schema():a.schema()}const V=g.object({email:x}).schema(),rt=z(),st=E(),it={signIn:z,signUp:E,resetPassword:()=>V};function ct(o){const e=x.validate(o);return e.success?null:e.errors[0]?.message||"Invalid email"}function lt(o,e=y){const l=$(e).validate(o);return l.success?null:l.errors[0]?.message||"Invalid password"}function O(o,e=y){const i={length:o.length>=(e.minLength||8),uppercase:/[A-Z]/.test(o),lowercase:/[a-z]/.test(o),numbers:/[0-9]/.test(o),symbols:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(o),custom:e.customValidation?e.customValidation(o)===null:o.length>0},l=[!0,e.requireUppercase,e.requireLowercase,e.requireNumbers,e.requireSymbols,!!e.customValidation].filter(Boolean).length,c=[i.length,e.requireUppercase?i.uppercase:null,e.requireLowercase?i.lowercase:null,e.requireNumbers?i.numbers:null,e.requireSymbols?i.symbols:null,e.customValidation?i.custom:null].filter(a=>a===!0).length,n=l>0?Math.round(c/l*100):0;let m;return n<40?m="weak":n<60?m="fair":n<80?m="good":m="strong",{strength:m,score:n,checks:i}}const R=()=>t.localStorageProp({key:"bui_auth_email",defaultValue:null});function D({onSignIn:o,passwordRules:e,labels:i,showRememberMe:l}){const c=t.prop(!1),n=R(),m=z(e),a=u.useForm({schema:m,onSubmit:T({task:o,message:"Reset password failed",onStart:()=>{c.set(!0),a.controller.disable()},onEnd:()=>{c.set(!1),a.controller.enable()}}),initialValue:{email:"",password:""}}),{controller:r,submit:s}=a;c.on(r.setDisabled);const h=r.field("email"),f=r.field("password");return n.on(b=>{b!=null&&h.change(b)}),h.signal.on(b=>{n.value!=null&&(n.value=b)}),t.Use(P.AuthI18n,b=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(s),u.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(r.error,L=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(L))),u.Control(u.EmailInput,{controller:h,label:t.coalesce(i?.emailLabel,b.$.emailLabel)}),u.Control(u.PasswordInput,{controller:f,label:t.coalesce(i?.passwordLabel,b.$.passwordLabel)}),t.When(l??!0,()=>t.html.div(t.attr.class("bc-auth-form__remember-me"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),u.CheckboxInput({value:n.map(L=>L!=null),after:t.html.span(t.coalesce(i?.rememberMeLabel,b.$.rememberMeLabel)),onChange:L=>{L?n.value=h.signal.value??"":n.value=null}}))))),I.Button({type:"submit",variant:"filled",color:"primary",loading:c,disabled:r.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(i?.signInButton,b.$.signInButton))))}function G({password:o,rules:e=y,showLabel:i=!0,className:l}){const c=t.computedOf(o)(s=>!s||s.length===0?{strength:"weak",score:0,checks:{length:!1,uppercase:!1,lowercase:!1,numbers:!1,symbols:!1,custom:!1}}:O(s,e)),n=c.map(s=>s.strength),m=c.map(s=>s.score),a=c.map(s=>s.checks),r=t.computedOf(n,l)((s,h)=>["bc-password-strength",`bc-password-strength--${s}`,h].filter(Boolean).join(" "));return t.html.div(t.attr.class(r),t.html.div(t.attr.class("bc-password-strength__bar"),t.html.div(t.attr.class("bc-password-strength__fill"),t.attr.style(m.map(s=>`width: ${s}%`)))),t.When(i,()=>t.Use(P.AuthI18n,s=>t.html.div(t.attr.class("bc-password-strength__label"),t.computedOf(n,s)((h,f)=>{switch(h){case"weak":return f.passwordStrengthWeak;case"fair":return f.passwordStrengthFair;case"good":return f.passwordStrengthGood;case"strong":return f.passwordStrengthStrong;default:return f.passwordStrengthWeak}})))),t.html.div(t.attr.class("bc-password-strength__requirements"),t.When(e.minLength!==void 0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.length?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.length?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),`At least ${e.minLength} characters`))),t.When(e.requireUppercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.uppercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.uppercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One uppercase letter"))),t.When(e.requireLowercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.lowercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.lowercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One lowercase letter"))),t.When(e.requireNumbers===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.numbers?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.numbers?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One number"))),t.When(e.requireSymbols===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.symbols?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.symbols?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One special character")))))}function mt({password:o,rules:e=y,className:i}){const l=t.computedOf(o)(a=>!a||a.length===0?{strength:"weak",score:0}:O(a,e)),c=l.map(a=>a.strength),n=l.map(a=>a.score),m=t.computedOf(c,i)((a,r)=>["bc-password-strength-bar",`bc-password-strength-bar--${a}`,r].filter(Boolean).join(" "));return t.html.div(t.attr.class(m),t.html.div(t.attr.class("bc-password-strength-bar__fill"),t.attr.style(n.map(a=>`width: ${a}%`))))}function ut({password:o,rules:e=y,className:i}){const l=t.computedOf(o)(n=>!n||n.length===0?"weak":O(n,e).strength),c=t.computedOf(l,i)((n,m)=>["bc-password-strength-text",`bc-password-strength-text--${n}`,m].filter(Boolean).join(" "));return t.Fragment(t.Use(P.AuthI18n,n=>t.html.span(t.attr.class(c),t.computedOf(l,n)((m,a)=>{switch(m){case"weak":return a.passwordStrengthWeak;case"fair":return a.passwordStrengthFair;case"good":return a.passwordStrengthGood;case"strong":return a.passwordStrengthStrong;default:return a.passwordStrengthWeak}}))))}function j({passwordRules:o,labels:e,initialEmail:i,initialName:l,showPasswordStrength:c,onSignUp:n,showNameField:m,showConfirmPassword:a,showAcceptTermsAndConditions:r,termsAndConditions:s}){const h=t.prop(!1),f=o||y,b=E(f,{showNameField:m!==!1,showConfirmPassword:a!==!1,showAcceptTermsAndConditions:r!==!1}),L=u.useForm({schema:b,onSubmit:T({task:n!=null?_=>n({email:_.email,password:_.password,name:_.name,acceptTerms:_.acceptTerms}):void 0,message:"Reset password failed",onStart:()=>{h.set(!0),L.controller.disable()},onEnd:()=>{h.set(!1),L.controller.enable()}}),initialValue:{name:l??"",email:i??"",password:"",confirmPassword:"",acceptTerms:!1}}),{controller:k,submit:B}=L;h.on(k.setDisabled);const v=k.field("name"),q=k.field("email"),A=k.field("password"),U=k.field("confirmPassword"),S=k.field("acceptTerms");return t.Use(P.AuthI18n,_=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(B),u.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(k.error,w=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(w))),t.When(m!==!1,()=>u.Control(I.TextInput,{controller:v.transform(w=>w??"",w=>w===""?void 0:w),label:t.coalesce(e?.nameLabel,_.$.nameLabel)})),u.Control(u.EmailInput,{controller:q,label:t.coalesce(e?.emailLabel,_.$.emailLabel)}),u.Control(u.PasswordInput,{controller:A,label:t.coalesce(e?.passwordLabel,_.$.passwordLabel)}),t.When(c??!1,()=>G({password:A.signal,rules:f,showLabel:!0})),t.When(a??!1,()=>u.Control(u.PasswordInput,{controller:U,label:t.coalesce(e?.confirmPasswordLabel,_.$.confirmPasswordLabel)})),t.When(r??!1,()=>t.html.div(t.attr.class("bc-auth-form__terms"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),u.CheckboxInput({value:S.signal.map(w=>w??!1),onChange:w=>S.change(w)}),t.html.span(s||t.coalesce(e?.acceptTermsLabel,_.$.acceptTermsLabel))),t.When(S.errorVisible,()=>t.html.div(t.attr.class("bc-auth-form__field-error"),S.error.map(w=>w||"")))))),I.Button({type:"submit",variant:"filled",color:"primary",loading:h,disabled:k.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(e?.signUpButton,_.$.signUpButton))))}function H({onResetPassword:o,labels:e={}}){const i=R(),l=t.prop(!1),c=u.useForm({schema:V,onSubmit:T({task:o,message:"Reset password failed",onStart:()=>{l.set(!0),c.controller.disable()},onEnd:()=>{l.set(!1),c.controller.enable()}}),initialValue:{email:""}}),{controller:n,submit:m}=c;l.on(n.setDisabled);const a=n.field("email");return i.on(r=>{r!=null&&a.change(r)}),t.Use(P.AuthI18n,r=>t.html.form(t.attr.class("bc-auth-form__form"),t.Ensure(n.error,s=>u.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(s))),t.html.p(t.attr.class("bc-auth-form__description"),t.coalesce(e?.resetPasswordDescription,r.$.resetPasswordDescription)),t.on.submit(m),u.Stack(t.attr.class("bc-auth-form__fields"),u.Control(u.EmailInput,{controller:a,label:t.coalesce(e?.emailLabel,r.$.emailLabel)})),I.Button({loading:l,type:"submit",variant:"filled",color:"primary",disabled:n.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(e?.resetPasswordButton,r.$.resetPasswordButton))))}function p({provider:o,onClick:e,size:i="md",name:l,icon:c,color:n,flow:m,labels:a}){const r=async()=>{if(e)try{m==="popup"?await e():await e()}catch(s){console.error(`Social login error for ${o} (${m||"redirect"} flow):`,s)}};return I.Button({type:"button",variant:"filled",size:i,color:n,onClick:r,roundedness:"full"},t.attr.class("bc-social-login-button"),t.attr.class(t.computedOf(o)(s=>`bc-social-login-button--${s}`)),t.html.span(t.attr.class("bc-social-login-button__inner"),t.html.span(t.attr.class("bc-social-login-button__icon"),I.Icon({icon:c,size:i},t.attr.class("bc-social-login-button__icon-inner"))),t.Use(P.AuthI18n,s=>t.html.span(t.attr.class("bc-social-login-button__label"),t.bind(t.coalesce(a?.continueWithProvider,s.$.continueWithProvider))(l)))))}function X({providers:o,onProviderClick:e,size:i="md",className:l}){return u.Stack(t.attr.class("bc-social-login-buttons"),t.attr.class(l),t.ForEach(o,c=>p({provider:c.$.provider,flow:c.$.flow,color:c.map(({provider:n})=>d[n].color),name:c.map(({provider:n})=>d[n].name),icon:c.map(({provider:n})=>d[n].icon),onClick:async()=>{e&&await e(c.$.provider.value)},size:i})))}const d={google:{name:"Google",icon:"logos:google-icon",color:"red"},github:{name:"GitHub",icon:"logos:github-icon",color:"black"},apple:{name:"Apple",icon:"logos:apple",color:"stone"},facebook:{name:"Facebook",icon:"logos:facebook",color:"blue"},twitter:{name:"Twitter",icon:"logos:twitter",color:"sky"},x:{name:"X",icon:"logos:x",color:"zinc"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"amber"},discord:{name:"Discord",icon:"logos:discord-icon",color:"indigo"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"cyan"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"fuchsia"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"teal"},snapchat:{name:"Snapchat",icon:"streamline-logos:snapchat-logo-solid",color:"yellow"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"orange"},pinterest:{name:"Pinterest",icon:"logos:pinterest",color:"rose"},twitch:{name:"Twitch",icon:"logos:twitch",color:"purple"},steam:{name:"Steam",icon:"logos:steam",color:"slate"},epic:{name:"Epic Games",icon:"streamline-logos:epic-games-logo-solid",color:"neutral"},playstation:{name:"PlayStation",icon:"streamline-logos:playstation-logo-solid",color:"violet"},xbox:{name:"Xbox",icon:"streamline-logos:xbox-live-logo-solid",color:"green"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"emerald"},wechat:{name:"WeChat",icon:"streamline-logos:wechat-logo",color:"lime"},amazon:{name:"Amazon",icon:"streamline-logos:amazon-logo-solid",color:"red"},yahoo:{name:"Yahoo",icon:"logos:yahoo",color:"rose"},paypal:{name:"PayPal",icon:"logos:paypal",color:"blue"}},dt=o=>p({...o,...d.google,provider:"google"}),pt=o=>p({...o,...d.github,provider:"github"}),ht=o=>p({...o,...d.apple,provider:"apple"}),gt=o=>p({...o,...d.facebook,provider:"facebook"}),ft=o=>p({...o,...d.x,provider:"x"}),bt=o=>p({...o,...d.twitter,provider:"twitter"}),wt=o=>p({...o,...d.microsoft,provider:"microsoft"}),Lt=o=>p({...o,...d.discord,provider:"discord"}),_t=o=>p({...o,...d.linkedin,provider:"linkedin"}),kt=o=>p({...o,...d.instagram,provider:"instagram"}),vt=o=>p({...o,...d.tiktok,provider:"tiktok"}),St=o=>p({...o,...d.snapchat,provider:"snapchat"}),Pt=o=>p({...o,...d.reddit,provider:"reddit"}),yt=o=>p({...o,...d.pinterest,provider:"pinterest"}),Bt=o=>p({...o,...d.twitch,provider:"twitch"}),It=o=>p({...o,...d.steam,provider:"steam"}),xt=o=>p({...o,...d.epic,provider:"epic"}),qt=o=>p({...o,...d.playstation,provider:"playstation"}),At=o=>p({...o,...d.xbox,provider:"xbox"}),Ct=o=>p({...o,...d.whatsapp,provider:"whatsapp"}),Tt=o=>p({...o,...d.wechat,provider:"wechat"}),$t=o=>p({...o,...d.amazon,provider:"amazon"}),zt=o=>p({...o,...d.yahoo,provider:"yahoo"}),Et=o=>p({...o,...d.paypal,provider:"paypal"});function W({providers:o}){return u.Stack(X({providers:o}))}function Y({mode:o,socialProviders:e,initialName:i,initialEmail:l,passwordRules:c,showRememberMe:n,showSocialDivider:m,showPasswordStrength:a,labels:r,onSignIn:s,onSignUp:h,onResetPassword:f,onModeChange:b,showContainer:L},...k){const B=o!=null?t.Value.deriveProp(o):t.prop("signin");return B.on(v=>b?.(v)),t.Use(P.AuthI18n,v=>{function q(){const S=t.coalesce(r?.hasAccountLink,v.$.hasAccountLink);return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("signin")),S)}function A(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("signup")),t.coalesce(r?.noAccountLink,v.$.noAccountLink))}function U(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>B.set("reset-password")),t.coalesce(r?.forgotPasswordLink,v.$.forgotPasswordLink))}return t.html.div(Z.classes({"bc-auth-container":!0,"bc-auth-container--styled":t.Value.map(L??!0,S=>S)}),t.attr.class(B.map(S=>`bc-auth-container--${S}`)),t.attr.class("bc-auth-form"),t.OneOfValue(B,{signin:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signInTitle,v.$.signInTitle)),e!=null?t.Fragment(W({providers:e}),t.When(m??!1,F)):null,D({onSignIn:s,showRememberMe:n,passwordRules:c,labels:{emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,rememberMeLabel:r?.rememberMeLabel,signInButton:r?.signInButton,forgotPasswordLink:r?.forgotPasswordLink,noAccountLink:r?.noAccountLink}}),u.Stack(t.attr.class("bc-auth-form__footer"),A(),U())),signup:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signUpTitle,v.$.signUpTitle)),e!=null?t.Fragment(W({providers:e}),t.When(m??!1,F)):null,j({labels:{nameLabel:r?.nameLabel,emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,confirmPasswordLabel:r?.confirmPasswordLabel,acceptTermsLabel:r?.acceptTermsLabel,signUpButton:r?.signUpButton,hasAccountLink:r?.hasAccountLink},initialEmail:l,initialName:i,onSignUp:h,passwordRules:c,showPasswordStrength:a}),u.Stack(t.attr.class("bc-auth-form__footer"),q())),"reset-password":()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.resetPasswordTitle,v.$.resetPasswordTitle)),H({labels:{backToSignInLink:r?.backToSignInLink,emailLabel:r?.emailLabel,resetPasswordButton:r?.resetPasswordButton,resetPasswordDescription:r?.resetPasswordDescription},onResetPassword:f}),u.Stack(t.attr.class("bc-auth-form__footer"),q()))}),...k)})}function Ot(o){return g.Modal({size:"sm",dismissable:!0,showCloseButton:!0},(e,i)=>o(l=>e({body:Y({showContainer:!1,...l}),header:t.Use(P.AuthI18n,c=>t.coalesce(l.modalTitle,c.$.authenticationTitle))})))}function F({labels:o,className:e}={}){return t.html.div(t.attr.class("bc-auth-divider"),t.attr.class(e),t.html.div(t.attr.class("bc-auth-divider__line")),t.Use(P.AuthI18n,i=>t.html.span(t.attr.class("bc-auth-divider__text"),t.coalesce(o?.text,i.$.orDivider))),t.html.div(t.attr.class("bc-auth-divider__line")))}exports.AmazonLoginButton=$t;exports.AppleLoginButton=ht;exports.AuthContainer=Y;exports.AuthDivider=F;exports.AuthModal=Ot;exports.DiscordLoginButton=Lt;exports.EpicLoginButton=xt;exports.FacebookLoginButton=gt;exports.GitHubLoginButton=pt;exports.GoogleLoginButton=dt;exports.InstagramLoginButton=kt;exports.LinkedInLoginButton=_t;exports.MicrosoftLoginButton=wt;exports.PasswordStrengthBar=mt;exports.PasswordStrengthIndicator=G;exports.PasswordStrengthText=ut;exports.PayPalLoginButton=Et;exports.PinterestLoginButton=yt;exports.PlayStationLoginButton=qt;exports.RedditLoginButton=Pt;exports.ResetPasswordForm=H;exports.SignInForm=D;exports.SignUpForm=j;exports.SnapchatLoginButton=St;exports.SocialLoginButton=p;exports.SocialLoginButtons=X;exports.SocialProviders=W;exports.SteamLoginButton=It;exports.TiktokLoginButton=vt;exports.TwitchLoginButton=Bt;exports.TwitterLoginButton=bt;exports.WeChatLoginButton=Tt;exports.WhatsAppLoginButton=Ct;exports.XLoginButtin=ft;exports.XboxLoginButton=At;exports.YahooLoginButton=zt;exports.authSchemas=it;exports.calculatePasswordStrength=O;exports.createPasswordSchema=$;exports.createSignInSchema=z;exports.createSignUpSchema=E;exports.createSocialLoginUrl=ot;exports.defaultPasswordRules=y;exports.defaultSignInSchema=rt;exports.defaultSignUpSchema=st;exports.emailSchema=x;exports.formatAuthError=at;exports.formatProviderName=M;exports.formatSocialLoginText=Q;exports.generateRandomString=N;exports.getProviderColor=K;exports.getProviderIcon=J;exports.isBrowser=nt;exports.isValidEmail=tt;exports.openSocialLoginPopup=et;exports.providerInfo=C;exports.requestToControllerValidation=T;exports.resetPasswordSchema=V;exports.socialProviderInfo=d;exports.useAuthEmailProp=R;exports.validateEmail=ct;exports.validatePassword=lt;
|
package/dist/auth/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { localStorageProp as ie, prop as V, Use as x, html as i, attr as t, on as z, When as b, coalesce as h, Ensure as D, computedOf as g, Fragment as C, bind as ce, ForEach as le, Value as ee, OneOfValue as me } from "@tempots/dom";
|
|
2
|
-
import { t as ue, a as oe, u as W, S as $, b as se, c as T, P as N, E as G, N as H } from "../notice-
|
|
3
|
-
import { s as A, o as j, b as R, M as de } from "../modal-
|
|
4
|
-
import { AuthI18n as q } from "../translations-
|
|
5
|
-
import { B as F, T as pe, I as he } from "../translations-
|
|
2
|
+
import { t as ue, a as oe, u as W, S as $, b as se, c as T, P as N, E as G, N as H } from "../notice-BH_pePhd.js";
|
|
3
|
+
import { s as A, o as j, b as R, M as de } from "../modal-DQ9LXrC4.js";
|
|
4
|
+
import { AuthI18n as q } from "../translations-zGwuSQWQ.js";
|
|
5
|
+
import { B as F, T as pe, I as he } from "../translations-BUTBIDsS.js";
|
|
6
6
|
import { classes as ge } from "@tempots/ui";
|
|
7
7
|
const X = {
|
|
8
8
|
google: { name: "Google", icon: "logos:google-icon", color: "#4285f4" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-hMQlZmD4.cjs"),s={loadingExtended:"Lädt, bitte warten",loadingShort:"Lädt...",iconDescription:"Symbol",loadingIcon:"Ladesymbol",locale:"Landesvariante",failedToLoadIcon:"Symbol konnte nicht geladen werden",editLabel:"Bearbeiten",selectOne:"Eines auswählen",selectMany:"Mehrere auswählen",noResults:"Keine Ergebnisse",passwordPlaceholderText:"Geheimes Passwort",togglePasswordVisibility:"Passwort-Sichtbarkeit umschalten",toggleMenu:"Menü umschalten",toggleAside:"Seitenleiste umschalten",mainNavigation:"Hauptnavigation",sidebar:"Seitenleiste",closeDrawer:"Schublade schließen",closeModal:"Modal schließen",confirm:"Bestätigen",cancel:"Abbrechen",addLabel:"Hinzufügen",removeItem:"Element entfernen",currentLocale:"Deutsch",ar:"Arabisch",de:"Deutsch",en:"Englisch",es:"Spanisch",fr:"Französisch",hi:"Hindi",it:"Italienisch",ja:"Japanisch",ko:"Koreanisch",nl:"Niederländisch",pl:"Polnisch",pt:"Portugiesisch",ru:"Russisch",tr:"Türkisch",vi:"Vietnamesisch",zh:"Chinesisch",he:"Hebräisch",fa:"Persisch",ur:"Urdu",emailPlaceholderText:"E-Mail eingeben",incrementValue:"Wert erhöhen",decrementValue:"Wert verringern",dropZoneInstructions:e=>e?"Klicken zum Auswählen oder Dateien hierher ziehen, oder Enter oder Leertaste drücken, um Dateiauswahl zu öffnen":"Dateien hierher ziehen",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Datei entfernen",clearAllFiles:"Alle Dateien löschen",clearValue:"Wert löschen",unknownType:"Unbekannter Typ",filesInputInstructions:(e,n,t)=>{let r=e==null||e>1?"Klicken zum Auswählen oder Dateien hierher ziehen":"Klicken zum Auswählen oder Datei hierher ziehen";if(e||n){const i=[];if(e!=null&&e>1&&i.push(`bis zu ${e} Dateien`),n&&t){const l=a.formatFileSize(n,{units:t});i.push(`max ${l} je Datei`)}i.length>0&&(r+=` (${i.join(", ")})`)}return r},prosemirror:{bold:"Fett",italic:"Kursiv",code:"Inline-Code",link:"Link einfügen",removeLink:"Link entfernen",heading:e=>`Überschrift ${e}`,bulletList:"Aufzählung",orderedList:"Nummerierte Liste",blockquote:"Zitat",codeBlock:"Code-Block",horizontalRule:"Horizontale Linie",linkUrlPlaceholder:"https://beispiel.com"},pdfPageViewer:{loading:"PDF wird geladen...",loadFailed:"PDF konnte nicht geladen werden",invalidPdf:"Ungültige PDF-Datei",pageOutOfRange:(e,n)=>`Seite ${e} liegt außerhalb des Bereichs (1-${n})`,renderFailed:"PDF-Seite konnte nicht gerendert werden"}};exports.default=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./translations-hMQlZmD4.cjs"),t={loadingExtended:"Cargando, por favor espere",loadingShort:"Cargando...",locale:"Idioma",iconDescription:"Icono",loadingIcon:"Icono de carga",failedToLoadIcon:"Error al cargar el icono",editLabel:"Editar",selectOne:"Seleccionar uno",selectMany:"Seleccionar varios",noResults:"Sin resultados",passwordPlaceholderText:"Contraseña Secreta",togglePasswordVisibility:"Alternar visibilidad de contraseña",toggleMenu:"Alternar menú",toggleAside:"Alternar panel lateral",mainNavigation:"Navegación principal",sidebar:"Barra lateral",closeDrawer:"Cerrar cajón",closeModal:"Cerrar modal",confirm:"Confirmar",cancel:"Cancelar",addLabel:"Agregar",removeItem:"Eliminar elemento",currentLocale:"Español",ar:"Árabe",de:"Alemán",en:"Inglés",es:"Español",fr:"Francés",hi:"Hindi",it:"Italiano",ja:"Japonés",ko:"Coreano",nl:"Neerlandés",pl:"Polaco",pt:"Portugués",ru:"Ruso",tr:"Turco",vi:"Vietnamita",zh:"Chino",he:"Hebreo",fa:"Persa",ur:"Urdu",emailPlaceholderText:"Correo electrónico",incrementValue:"Incrementar valor",decrementValue:"Decrementar valor",dropZoneInstructions:a=>a?"Haz clic para elegir o arrastra archivos aquí, o presiona Enter o Espacio para abrir el selector de archivos":"Arrastra archivos aquí",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Eliminar archivo",clearAllFiles:"Borrar todos los archivos",clearValue:"Borrar valor",unknownType:"Tipo desconocido",filesInputInstructions:(a,r,o)=>{let n=a==null||a>1?"Haz clic para elegir o arrastra archivos aquí":"Haz clic para elegir o arrastra un archivo aquí";if(a||r){const e=[];if(a!=null&&a>1&&e.push(`hasta ${a} archivos`),r&&o){const i=l.formatFileSize(r,{units:o});e.push(`máx ${i} cada uno`)}e.length>0&&(n+=` (${e.join(", ")})`)}return n},prosemirror:{bold:"Negrita",italic:"Cursiva",code:"Código en línea",link:"Insertar enlace",removeLink:"Eliminar enlace",heading:a=>`Encabezado ${a}`,bulletList:"Lista con viñetas",orderedList:"Lista numerada",blockquote:"Cita",codeBlock:"Bloque de código",horizontalRule:"Línea horizontal",linkUrlPlaceholder:"https://ejemplo.com"},pdfPageViewer:{loading:"Cargando PDF...",loadFailed:"Error al cargar el PDF",invalidPdf:"Archivo PDF inválido",pageOutOfRange:(a,r)=>`La página ${a} está fuera de rango (1-${r})`,renderFailed:"Error al renderizar la página del PDF"}};exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-hMQlZmD4.cjs"),a={loadingExtended:"در حال بارگذاری، لطفاً صبر کنید",loadingShort:"در حال بارگذاری...",locale:"زبان",iconDescription:"نماد",loadingIcon:"نماد بارگذاری",failedToLoadIcon:"بارگذاری نماد ناموفق بود",editLabel:"ویرایش",selectOne:"یکی را انتخاب کنید",selectMany:"چند مورد را انتخاب کنید",noResults:"بدون نتیجه",passwordPlaceholderText:"رمز عبور محرمانه",togglePasswordVisibility:"نمایش/مخفی کردن رمز عبور",toggleMenu:"نمایش/مخفی کردن منو",toggleAside:"نمایش/مخفی کردن پانل کناری",mainNavigation:"ناوبری اصلی",sidebar:"نوار کناری",closeDrawer:"بستن کشو",closeModal:"بستن پنجره",confirm:"تأیید",cancel:"لغو",addLabel:"افزودن",removeItem:"حذف مورد",currentLocale:"فارسی",ar:"عربی",de:"آلمانی",en:"انگلیسی",es:"اسپانیایی",fr:"فرانسوی",he:"عبری",hi:"هندی",it:"ایتالیایی",ja:"ژاپنی",ko:"کرهای",nl:"هلندی",pl:"لهستانی",pt:"پرتغالی",ru:"روسی",tr:"ترکی",vi:"ویتنامی",zh:"چینی",fa:"فارسی",ur:"اردو",emailPlaceholderText:"ایمیل خود را وارد کنید",incrementValue:"افزایش مقدار",decrementValue:"کاهش مقدار",dropZoneInstructions:e=>e?"برای انتخاب کلیک کنید یا فایلها را بکشید، یا Enter یا Space را فشار دهید تا انتخابگر فایل باز شود":"فایلها را بکشید",fileSizeUnits:["بایت","کیلوبایت","مگابایت","گیگابایت","ترابایت"],removeFile:"حذف فایل",clearAllFiles:"حذف همه فایلها",clearValue:"حذف مقدار",unknownType:"نوع ناشناخته",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"برای انتخاب کلیک کنید یا فایلها را بکشید":"برای انتخاب کلیک کنید یا فایل را بکشید";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`تا ${e} فایل`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`حداکثر ${i} هر کدام`)}l.length>0&&(n+=` (${l.join("، ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-hMQlZmD4.cjs"),t={loadingExtended:"Chargement, veuillez patienter",loadingShort:"Chargement...",locale:"Langue",iconDescription:"Icône",loadingIcon:"Icône de chargement",failedToLoadIcon:"Échec du chargement de l'icône",editLabel:"Modifier",selectOne:"Sélectionner un",selectMany:"Sélectionner plusieurs",noResults:"Aucun résultat",passwordPlaceholderText:"Mot de passe secret",togglePasswordVisibility:"Basculer la visibilité du mot de passe",toggleMenu:"Basculer le menu",toggleAside:"Basculer le panneau latéral",mainNavigation:"Navigation principale",sidebar:"Barre latérale",closeDrawer:"Fermer le tiroir",closeModal:"Fermer la modale",confirm:"Confirmer",cancel:"Annuler",addLabel:"Ajouter",removeItem:"Supprimer l’élément",currentLocale:"Français",ar:"Arabe",de:"Allemand",en:"Anglais",es:"Espagnol",fr:"Français",hi:"Hindi",it:"Italien",ja:"Japonais",ko:"Coréen",nl:"Néerlandais",pl:"Polonais",pt:"Portuguais",ru:"Russe",tr:"Turc",vi:"Vietnamien",zh:"Chinois",he:"Hébreu",fa:"Persan",ur:"Ourdou",emailPlaceholderText:"Entrez votre e-mail",incrementValue:"Incrémenter la valeur",decrementValue:"Décrémenter la valeur",dropZoneInstructions:e=>e?"Cliquez pour choisir ou glissez des fichiers ici, ou appuyez sur Entrée ou Espace pour ouvrir le sélecteur de fichiers":"Glissez des fichiers ici",fileSizeUnits:["Octets","Ko","Mo","Go","To"],removeFile:"Supprimer le fichier",clearAllFiles:"Effacer tous les fichiers",clearValue:"Réinitialiser",unknownType:"Type inconnu",filesInputInstructions:(e,i,n)=>{let l=e==null||e>1?"Cliquez pour choisir ou glissez des fichiers ici":"Cliquez pour choisir ou glissez un fichier ici";if(e||i){const r=[];if(e!=null&&e>1&&r.push(`jusqu'à ${e} fichiers`),i&&n){const o=a.formatFileSize(i,{units:n});r.push(`max ${o} chacun`)}r.length>0&&(l+=` (${r.join(", ")})`)}return l},prosemirror:{bold:"Gras",italic:"Italique",code:"Code en ligne",link:"Insérer un lien",removeLink:"Supprimer le lien",heading:e=>`Titre ${e}`,bulletList:"Liste à puces",orderedList:"Liste numérotée",blockquote:"Citation",codeBlock:"Bloc de code",horizontalRule:"Ligne horizontale",linkUrlPlaceholder:"https://exemple.com"},pdfPageViewer:{loading:"Chargement du PDF...",loadFailed:"Échec du chargement du PDF",invalidPdf:"Fichier PDF invalide",pageOutOfRange:(e,i)=>`La page ${e} est hors limites (1-${i})`,renderFailed:"Échec du rendu de la page PDF"}};exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-hMQlZmD4.cjs"),a={loadingExtended:"טוען, אנא המתן",loadingShort:"טוען...",locale:"שפה",iconDescription:"סמל",loadingIcon:"סמל טעינה",failedToLoadIcon:"נכשל בטעינת הסמל",editLabel:"עריכה",selectOne:"בחר אחד",selectMany:"בחר מספר",noResults:"אין תוצאות",passwordPlaceholderText:"סיסמה סודית",togglePasswordVisibility:"הצג/הסתר סיסמה",toggleMenu:"הצג/הסתר תפריט",toggleAside:"הצג/הסתר פאנל צדדי",mainNavigation:"ניווט ראשי",sidebar:"סרגל צדדי",closeDrawer:"סגור מגירה",closeModal:"סגור חלון קופץ",confirm:"אישור",cancel:"ביטול",addLabel:"הוסף",removeItem:"הסר פריט",currentLocale:"עברית",ar:"ערבית",de:"גרמנית",en:"אנגלית",es:"ספרדית",fr:"צרפתית",he:"עברית",hi:"הינדי",it:"איטלקית",ja:"יפנית",ko:"קוריאנית",nl:"הולנדית",pl:"פולנית",pt:"פורטוגזית",ru:"רוסית",tr:"טורקית",vi:"וייטנאמית",zh:"סינית",fa:"פרסית",ur:"אורדו",emailPlaceholderText:'הכנס את כתובת הדוא"ל',incrementValue:"הגדלת ערך",decrementValue:"הקטנת ערך",dropZoneInstructions:e=>e?"לחץ לבחירה או גרור קבצים כאן, או לחץ Enter או רווח לפתיחת בורר הקבצים":"גרור קבצים כאן",fileSizeUnits:["בתים","ק״ב","מ״ב","ג״ב","ט״ב"],removeFile:"הסר קובץ",clearAllFiles:"נקה את כל הקבצים",clearValue:"נקה ערך",unknownType:"סוג לא ידוע",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"לחץ לבחירה או גרור קבצים כאן":"לחץ לבחירה או גרור קובץ כאן";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`עד ${e} קבצים`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`מקסימום ${i} כל אחד`)}l.length>0&&(n+=` (${l.join(", ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-hMQlZmD4.cjs"),a={loadingExtended:"लोड हो रहा है, कृपया प्रतीक्षा करें",loadingShort:"लोड हो रहा है...",locale:"स्थानीय",iconDescription:"आइकन",loadingIcon:"लोडिंग आइकन",failedToLoadIcon:"आइकन लोड करने में विफल",editLabel:"संपादित करें",selectOne:"एक चुनें",selectMany:"बहुत चुनें",noResults:"कोई परिणाम नहीं",passwordPlaceholderText:"गुप्त पासवर्ड",togglePasswordVisibility:"पासवर्ड दृश्यता टॉगल करें",toggleMenu:"मेनू टॉगल करें",toggleAside:"साइड पैनल टॉगल करें",mainNavigation:"मुख्य नेवीगेशन",sidebar:"साइडबार",closeDrawer:"ड्रॉअर बंद करें",closeModal:"मॉडल बंद करें",confirm:"पुष्टि करें",cancel:"रद्द करें",addLabel:"जोड़ें",removeItem:"आइटम हटाएं",currentLocale:"हिंदी",ar:"अरबी",de:"जर्मन",en:"अंग्रेज़ी",es:"स्पेनिश",fr:"फ्रेंच",hi:"हिन्दी",it:"इतालवी",ja:"जापानी",ko:"कोरियाई",nl:"डच",pl:"पोलिश",pt:"पोर्तुगीज",ru:"रूसी",tr:"तुर्की",vi:"वियतनामी",zh:"चीनी",he:"हिब्रू",fa:"फारसी",ur:"उर्दू",emailPlaceholderText:"अपना ईमेल दर्ज करें",incrementValue:"वृद्धि मान",decrementValue:"घटाना मान",dropZoneInstructions:e=>e?"चुनने के लिए क्लिक करें या फ़ाइलें यहाँ खींचें, या फाइल चयनकर्ता खोलने के लिए Enter या Space दबाएं":"फ़ाइलें यहाँ खींचें",fileSizeUnits:["बाइट्स","KB","MB","GB","TB"],removeFile:"फ़ाइल हटाएं",clearAllFiles:"सभी फ़ाइलें हटाएं",clearValue:"वृद्धि मान",unknownType:"अज्ञात प्रकार",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"चुनने के लिए क्लिक करें या फ़ाइलें यहाँ खींचें":"चुनने के लिए क्लिक करें या फ़ाइल यहाँ खींचें";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`अधिकतम ${e} फ़ाइलें`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`प्रत्येक अधिकतम ${i}`)}l.length>0&&(n+=` (${l.join(", ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { When as It, attr as Je, prop as Ri, Fragment as Bi, OnDispose as mr, Ensure as gr, signal as br, computedOf as vi, Use as zi, Repeat as Lo, Value as j, html as lu, Task as qo, WithElement as Vo } from "@tempots/dom";
|
|
2
|
-
import { a as Pi, b as Li, T as $o } from "./toolbar-
|
|
3
|
-
import { I as Wo, T as Ho, a as Jo } from "./translations-
|
|
2
|
+
import { a as Pi, b as Li, T as $o } from "./toolbar-Bk5-22ln.js";
|
|
3
|
+
import { I as Wo, T as Ho, a as Jo } from "./translations-BUTBIDsS.js";
|
|
4
4
|
import { L as jo } from "./link-portal-Cr2l9f3k.js";
|
|
5
5
|
import { ticker as Uo } from "@tempots/ui";
|
|
6
6
|
import { T as Ko } from "./theme-B5pmbvQ_.js";
|
|
@@ -5810,7 +5810,7 @@ function Da(t, e) {
|
|
|
5810
5810
|
n != null && (Dr(n, { level: e })(t.state, t.dispatch), t.focus());
|
|
5811
5811
|
}
|
|
5812
5812
|
async function Tu(t, e) {
|
|
5813
|
-
const { wrapInList: n, liftListItem: r } = await import("./index-
|
|
5813
|
+
const { wrapInList: n, liftListItem: r } = await import("./index-D4U7cDIP.js"), u = t.state.schema.nodes[e], i = t.state.schema.nodes.list_item;
|
|
5814
5814
|
if (u == null || i == null) return;
|
|
5815
5815
|
const { state: s } = t, { $from: o } = s.selection;
|
|
5816
5816
|
let l = null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as I, f as S, R as $, S as x, F as u, l as w, c as R, a as L } from "./index-
|
|
1
|
+
import { N as I, f as S, R as $, S as x, F as u, l as w, c as R, a as L } from "./index-CGoK9M1f.js";
|
|
2
2
|
function b(d, t = null) {
|
|
3
3
|
return function(e, n) {
|
|
4
4
|
let { $from: o, $to: l } = e.selection, f = o.blockRange(l);
|