feat(demo): add story 1 — Sorano: Rock and Time
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{i as h}from"../chunks/BbvEV2h7.js";import{p as c,f as l,t as v,a as u,b as _,c as d,d as s,r as e,s as g}from"../chunks/krC2xWPP.js";import{s as o}from"../chunks/CddAxf8c.js";import{p}from"../chunks/euuZp6ft.js";var x=d("<h1> </h1> <p> </p>",1);function w(m,i){c(i,!1),h();var t=x(),r=l(t),f=s(r,!0);e(r);var a=g(r,2),n=s(a,!0);e(a),v(()=>{o(f,p.status),o(n,p.error?.message)}),u(m,t),_()}export{w as component};
|
||||
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{p as ve,i as g,m as J,u as ue,g as e,a as _,b as me,h as D,j as l,k as pe,o as _e,c as x,s as j,f as ge,t as S,d as n,$ as xe,r as d,n as M,l as he}from"../chunks/krC2xWPP.js";import{d as ye,e as be,a as $e,s as A}from"../chunks/CddAxf8c.js";import{i as L}from"../chunks/DjsWWzyL.js";import{h as je,s as P}from"../chunks/j_DJpx8B.js";import{i as W}from"../chunks/Cu5ilWky.js";import{p as ke}from"../chunks/euuZp6ft.js";import{g as B}from"../chunks/BVTiZ3e2.js";import{b as T}from"../chunks/BSopV7IU.js";import{b as we,g as Ee,c as De}from"../chunks/BXL-vMzI.js";import{c as Be,s as Te,h as Oe,B as ze,v as Ce}from"../chunks/D7PIEGLR.js";import{B as G,t as H}from"../chunks/Lvd_r9sp.js";import{S as Fe}from"../chunks/K87jKp17.js";import{D as Ne}from"../chunks/nlum2O0L.js";import{L as Q}from"../chunks/C_E2vM9U.js";import{S as Se}from"../chunks/CV_JZMCk.js";import{P as Ae}from"../chunks/C1jLV8_5.js";var Le=x('<div class="flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 text-primary"><!></div>'),Pe=x("<!> Create",1),Ie=x('<div><div><div class="flex items-center gap-3"><button type="button" class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"><!></button> <!> <h1> </h1></div> <!></div></div>'),Ke=x('<div class="flex flex-1 items-center justify-center"><!></div>'),Re=x('<div class="flex flex-1 items-center justify-center"><div class="text-center"><p class="text-sm text-destructive"> </p> <!></div></div>'),Xe=x('<div class="flex-1 overflow-y-auto"><div class="space-y-6 px-6 py-6"><!></div></div>'),qe=x('<div class="flex h-full flex-col"><!> <!></div>');function lt(U,V){ve(V,!0);const c=D(()=>ke.params.type??"");let O=g(null),f=g(null),z=g(!0),y=g(!1),k=g(""),u=g(J({})),m=g(J({})),Y=D(()=>!e(f)||!Oe(e(f).fields,e(u)));const I=D(()=>e(u)._post_entries_save??"edit");function C(t){const s={};for(const r of t){if(r.default!==void 0){const a=r.name.includes(".")?r.name.split(".").pop():r.name;s[a]=r.default}r.fields&&Object.assign(s,C(r.fields))}return s}async function Z(){l(z,!0),l(k,"");try{const[t,s]=await Promise.all([we(e(c)),Ee().catch(()=>[])]);l(f,t,!0),l(O,s.find(r=>r.type===e(c))??null,!0),l(u,C(t.fields),!0)}catch{l(k,`Failed to load blueprint for '${e(c)}'.`)}finally{l(z,!1)}}function ee(t,s){const r=t.split("."),a={...e(u)};let i=a;for(let v=0;v<r.length-1;v++){const o=r[v];typeof i[o]!="object"||i[o]===null?i[o]={}:i[o]={...i[o]},i=i[o]}i[r[r.length-1]]=s,l(u,a,!0);const p=e(f)?Ce(e(f).fields,t,a):null;if(p)l(m,{...e(m),[t]:p},!0);else if(e(m)[t]){const{[t]:v,...o}=e(m);l(m,o,!0)}}async function K(){if(l(m,e(f)?Be(e(f).fields,e(u)):{},!0),Object.keys(e(m)).length>0){Te();return}l(y,!0);try{const{_post_entries_save:t,...s}=e(u),r=await De(e(c),s);H.success(W.t("ADMIN_NEXT.FLEX_OBJECTS.NEW.OBJECT_CREATED")),e(I)==="create-new"?l(u,e(f)?C(e(f).fields):{},!0):e(I)==="list"?B(`${T}/flex-objects/${e(c)}`):B(`${T}/flex-objects/${e(c)}/${r.key}`)}catch(t){const s=t&&typeof t=="object"&&"message"in t?t.message:"Failed to create object";H.error(s)}finally{l(y,!1)}}function te(t){(t.metaKey||t.ctrlKey)&&t.key==="s"&&(t.preventDefault(),e(y)||K())}ue(()=>{e(c),Z()});var F=qe();je("fhxi7h",t=>{pe(()=>{xe.title=`New ${e(O)?.title??e(c)??""} — Grav Admin`})}),be("keydown",_e,te);var R=n(F);Fe(R,{children:(s,r)=>{let a=()=>r?.().scrolled;var i=Ie(),p=n(i),v=n(p),o=n(v),w=n(o);Ne(w,{name:"arrow-back",size:16}),d(o);var E=j(o,2);{var oe=b=>{var $=Le(),X=n($);Ae(X,{size:16}),d($),_(b,$)};L(E,b=>{a()||b(oe)})}var N=j(E,2),le=n(N);d(N),d(v);var ne=j(v,2);{let b=D(()=>e(y)||!e(Y));G(ne,{size:"sm",onclick:K,get disabled(){return e(b)},children:($,X)=>{var q=Pe(),de=ge(q);{var ce=h=>{Q(h,{size:14,class:"me-1.5 animate-spin"})},fe=h=>{Se(h,{size:14,class:"me-1.5"})};L(de,h=>{e(y)?h(ce):h(fe,-1)})}M(),_($,q)},$$slots:{default:!0}})}d(p),d(i),S(()=>{P(i,1,`px-6 transition-[padding] duration-200 ${a()?"py-2":"pt-6 pb-3"}`),P(p,1,`flex items-center justify-between gap-4 ${a()?"min-h-6":"min-h-8"}`),P(N,1,`font-semibold text-foreground transition-[font-size] duration-200 ${a()?"text-sm":"text-lg"}`),A(le,`New ${e(O)?.title??e(c)??""}`)}),$e("click",o,()=>B(`${T}/flex-objects/${e(c)}`)),_(s,i)},$$slots:{default:!0}});var re=j(R,2);{var se=t=>{var s=Ke(),r=n(s);Q(r,{size:24,class:"animate-spin text-muted-foreground"}),d(s),_(t,s)},ae=t=>{var s=Re(),r=n(s),a=n(r),i=n(a,!0);d(a);var p=j(a,2);G(p,{variant:"outline",size:"sm",class:"mt-3",onclick:()=>B(`${T}/flex-objects/${e(c)}`),children:(v,o)=>{M();var w=he();S(E=>A(w,E),[()=>W.t("ADMIN_NEXT.FLEX_OBJECTS.NEW.BACK_TO_LIST")]),_(v,w)},$$slots:{default:!0}}),d(r),d(s),S(()=>A(i,e(k))),_(t,s)},ie=t=>{var s=Xe(),r=n(s),a=n(r);ze(a,{get fields(){return e(f).fields},get data(){return e(u)},onchange:ee,get errors(){return e(m)}}),d(r),d(s),_(t,s)};L(re,t=>{e(z)?t(se):e(k)?t(ae,1):e(f)&&t(ie,2)})}d(F),_(U,F),me()}ye(["click"]);export{lt as component};
|
||||
@@ -0,0 +1,2 @@
|
||||
import"../chunks/DsnmJJEf.js";import{p as be,t as _,a as d,b as xe,k as ge,c as u,d as a,$ as Te,r as s,s as o,g as m,i as D,l as V,e as Ne,f as C,j as c}from"../chunks/krC2xWPP.js";import{d as Oe,a as Ee,s as v,e as Ae}from"../chunks/CddAxf8c.js";import{i as T}from"../chunks/DjsWWzyL.js";import{h as De,s as he}from"../chunks/j_DJpx8B.js";import{s as H,r as Ie,B as Re,t as h}from"../chunks/Lvd_r9sp.js";import{b as Me}from"../chunks/ciapVzar.js";import{i}from"../chunks/Cu5ilWky.js";import{b as Se}from"../chunks/BSopV7IU.js";import{f as ye}from"../chunks/CNrnzl73.js";import{D as Ge}from"../chunks/nlum2O0L.js";import{B as Fe,t as W}from"../chunks/BzsopytP.js";import{S as Xe,M as we}from"../chunks/BrVNO555.js";import{M as q}from"../chunks/BwyXqaO5.js";import{L as Le}from"../chunks/C_E2vM9U.js";var ke=u('<p class="text-xs text-red-500"> </p>'),Be=u("<!> ",1),Ce=u("<!> ",1),ze=u('<form class="space-y-4 px-6 py-5" novalidate=""><div class="space-y-1.5"><label for="email" class="text-[0.8125rem] font-medium text-foreground"> </label> <div class="flex rounded-md shadow-sm"><span class="inline-flex items-center rounded-l-md border border-r-0 border-input bg-muted px-3 text-muted-foreground"><!></span> <input id="email" type="email" autocomplete="email"/></div> <!></div> <!></form>'),$e=u('<div class="px-6 py-5 text-center text-[0.8125rem] text-muted-foreground"> </div>'),je=u('<div class="flex min-h-screen items-center justify-center bg-background p-4"><button type="button" class="absolute top-4 right-4 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button> <div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center text-center"><div class="mb-4"><!></div> <h1 class="text-2xl font-semibold tracking-tight text-foreground"> </h1> <p class="mt-1 text-[0.8125rem] text-muted-foreground"><!></p></div> <div class="rounded-lg border border-border bg-card shadow-sm"><!> <div class="border-t border-border px-6 py-3"><a class="flex items-center justify-center gap-1.5 text-[0.75rem] font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </a></div></div></div></div>');function st(J,Q){be(Q,!0);let I=D(""),p=D(!1),R=D(!1),N=D(!1);async function Y(e){e.preventDefault(),c(N,!1);const t=m(I).trim();if(!t||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){c(N,!0);return}c(p,!0);try{const r=await ye(t);c(R,!0),h.success(r.message??"Reset email sent")}catch(r){if(r&&typeof r=="object"&&"status"in r){const n=r;n.status===429?h.error(n.message||"Too many reset requests. Try again later."):h.error(n.message||"Unable to send reset email")}else h.error(i.t("ADMIN_NEXT.FORGOT.UNABLE_TO_CONNECT_TO_SERVER"))}finally{c(p,!1)}}var M=je();De("71rv0w",e=>{ge(t=>{Te.title=t??""},[()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD_GRAV_ADMIN")])});var b=a(M),Z=a(b);{var ee=e=>{Xe(e,{size:16})},te=e=>{we(e,{size:16})};T(Z,e=>{W.isDark?e(ee):e(te,-1)})}s(b);var z=o(b,2),S=a(z),y=a(S),re=a(y);Fe(re,{size:"login"}),s(y);var G=o(y,2),ae=a(G,!0);s(G);var $=o(G,2),se=a($);{var oe=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.CHECK_INBOX")]),d(e,t)},ie=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.SUBTITLE")]),d(e,t)};T(se,e=>{m(R)?e(oe):e(ie,-1)})}s($),s(S);var j=o(S,2),K=a(j);{var ne=e=>{var t=ze(),r=a(t),n=a(r),me=a(n,!0);s(n);var X=o(n,2),w=a(X),ve=a(w);q(ve,{size:13}),s(w);var O=o(w,2);Ie(O),s(X);var _e=o(X,2);{var fe=l=>{var E=ke(),A=a(E,!0);s(E),_(L=>v(A,L),[()=>i.t("ADMIN_NEXT.FORGOT.ENTER_A_VALID_EMAIL_ADDRESS")]),d(l,E)};T(_e,l=>{m(N)&&l(fe)})}s(r);var ce=o(r,2);Re(ce,{type:"submit",class:"w-full",get disabled(){return m(p)},children:(l,E)=>{var A=Ne(),L=C(A);{var ue=f=>{var x=Be(),g=C(x);Le(g,{size:15,class:"animate-spin"});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SENDING")]),d(f,x)},pe=f=>{var x=Ce(),g=C(x);q(g,{size:15});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SEND_RESET_LINK")]),d(f,x)};T(L,f=>{m(p)?f(ue):f(pe,-1)})}d(l,A)},$$slots:{default:!0}}),s(t),_(l=>{v(me,l),he(O,1,`flex h-9 w-full rounded-r-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
|
||||
${m(N)?"border-red-500 ring-1 ring-red-500/30 animate-[shake_0.3s_ease-in-out]":"border-input"}`),O.disabled=m(p)},[()=>i.t("ADMIN_NEXT.FORGOT.EMAIL_ADDRESS")]),Ae("submit",t,Y),Me(O,()=>m(I),l=>c(I,l)),d(e,t)},le=e=>{var t=$e(),r=a(t,!0);s(t),_(n=>v(r,n),[()=>i.t("ADMIN_NEXT.FORGOT.IF_AN_ACCOUNT_EXISTS_FOR_THAT_EMAIL_A")]),d(e,t)};T(K,e=>{m(R)?e(le,-1):e(ne)})}var P=o(K,2),F=a(P),U=a(F);Ge(U,{name:"arrow-back",size:12});var de=o(U);s(F),s(P),s(j),s(z),s(M),_((e,t,r)=>{H(b,"aria-label",e),v(ae,t),H(F,"href",`${Se??""}/login`),v(de,` ${r??""}`)},[()=>i.t("ADMIN_NEXT.TOGGLE_DARK_MODE"),()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD"),()=>i.t("ADMIN_NEXT.FORGOT.BACK_TO_SIGN_IN")]),Ee("click",b,()=>W.toggleColorMode()),d(J,M),xe()}Oe(["click"]);export{st as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{L as l}from"../chunks/B0tTBVCR.js";const e=!1,o=Object.freeze(Object.defineProperty({__proto__:null,ssr:e},Symbol.toStringTag,{value:"Module"}));export{l as component,o as universal};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
import"../chunks/DsnmJJEf.js";import{p as Ne,u as Te,t as p,a as m,b as he,k as Re,c as E,d as s,$ as Ie,r as o,s as d,g as r,h as W,l as De,e as q,f as w,j as v,n as we,i as S}from"../chunks/krC2xWPP.js";import{d as Ae,a as ye,s as _,e as Me}from"../chunks/CddAxf8c.js";import{i as N}from"../chunks/DjsWWzyL.js";import{h as Pe}from"../chunks/DSIsCMt7.js";import{h as Oe,s as ke}from"../chunks/j_DJpx8B.js";import{s as Q,r as Xe,B as Le,t as T}from"../chunks/Lvd_r9sp.js";import{b as Ce}from"../chunks/ciapVzar.js";import{i as n}from"../chunks/Cu5ilWky.js";import{g as Ge}from"../chunks/BVTiZ3e2.js";import{b as Y}from"../chunks/BSopV7IU.js";import{p as J}from"../chunks/euuZp6ft.js";import{r as We}from"../chunks/CNrnzl73.js";import{D as ze}from"../chunks/nlum2O0L.js";import{B as Be,t as Z}from"../chunks/BzsopytP.js";import{p as z,P as Ke,e as $e}from"../chunks/DI46g3k0.js";import{S as je,M as Ue}from"../chunks/BrVNO555.js";import{L as Fe}from"../chunks/C_E2vM9U.js";import{K as He}from"../chunks/B51cP8nR.js";var Ve=E('<div class="px-6 py-5 text-center text-[0.8125rem] text-muted-foreground"> </div>'),qe=E('<p class="text-xs text-red-500"> </p>'),Qe=E("<!> ",1),Ye=E("<!> Reset password",1),Je=E('<form class="space-y-4 px-6 py-5" novalidate=""><!> <div class="space-y-1.5"><label for="confirm" class="text-[0.8125rem] font-medium text-foreground"> </label> <input id="confirm" type="password" autocomplete="new-password"/> <!></div> <!></form>'),Ze=E('<div class="flex min-h-screen items-center justify-center bg-background p-4"><button type="button" class="absolute top-4 right-4 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button> <div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center text-center"><div class="mb-4"><!></div> <h1 class="text-2xl font-semibold tracking-tight text-foreground"> </h1> <p class="mt-1 text-[0.8125rem] text-muted-foreground"><!></p></div> <div class="rounded-lg border border-border bg-card shadow-sm"><!> <div class="border-t border-border px-6 py-3"><a class="flex items-center justify-center gap-1.5 text-[0.75rem] font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </a></div></div></div></div>');function br(ee,re){Ne(re,!0);const A=W(()=>J.url.searchParams.get("user")??""),B=W(()=>J.url.searchParams.get("token")??"");let u=S(""),y=S(""),c=S(!1),M=S(!1),h=S(!1);Te(()=>{z.load().catch(()=>{})});const K=W(()=>!r(A)||!r(B));async function te(e){e.preventDefault(),v(M,!1),v(h,!1);const t=$e(r(u),z.current);if(!r(u)||!t.allRulesMet){v(M,!0);return}if(r(u)!==r(y)){v(h,!0);return}v(c,!0);try{await We(r(A),r(B),r(u)),T.success(n.t("ADMIN_NEXT.RESET.PASSWORD_RESET_SUCCESSFULLY_PLEASE_SIGN")),Ge(`${Y}/login`)}catch(a){if(a&&typeof a=="object"&&"status"in a){const i=a;i.status===429?T.error(i.message||"Too many attempts. Try again later."):i.status===422||i.status===400?T.error(i.message||"Invalid or expired reset link."):T.error(i.message||"Unable to reset password")}else T.error(n.t("ADMIN_NEXT.RESET.UNABLE_TO_CONNECT_TO_SERVER"))}finally{v(c,!1)}}var P=Ze();Oe("1rnsd0w",e=>{Re(t=>{Ie.title=t??""},[()=>n.t("ADMIN_NEXT.RESET.RESET_PASSWORD_GRAV_ADMIN")])});var g=s(P),ae=s(g);{var se=e=>{je(e,{size:16})},oe=e=>{Ue(e,{size:16})};N(ae,e=>{Z.isDark?e(se):e(oe,-1)})}o(g);var $=d(g,2),O=s($),k=s(O),ie=s(k);Be(ie,{size:"login"}),o(k);var X=d(k,2),ne=s(X,!0);o(X);var j=d(X,2),le=s(j);{var de=e=>{var t=De();p(a=>_(t,a),[()=>n.t("ADMIN_NEXT.RESET.INVALID_LINK")]),m(e,t)},me=e=>{var t=q(),a=w(t);Pe(a,()=>n.tHtml("ADMIN_NEXT.RESET.NEW_PASSWORD_FOR",{username:r(A)})),m(e,t)};N(le,e=>{r(K)?e(de):e(me,-1)})}o(j),o(O);var U=d(O,2),F=s(U);{var ve=e=>{var t=Ve(),a=s(t,!0);o(t),p(i=>_(a,i),[()=>n.t("ADMIN_NEXT.RESET.THIS_RESET_LINK_IS_MISSING_REQUIRED")]),m(e,t)},_e=e=>{var t=Je(),a=s(t);Ke(a,{id:"password",label:"New password",get policy(){return z.current},get disabled(){return r(c)},get invalid(){return r(M)},invalidMessage:"Password does not meet the required policy",get value(){return r(u)},set value(l){v(u,l,!0)}});var i=d(a,2),C=s(i),ce=s(C,!0);o(C);var b=d(C,2);Xe(b);var fe=d(b,2);{var pe=l=>{var R=qe(),I=s(R,!0);o(R),p(G=>_(I,G),[()=>n.t("ADMIN_NEXT.RESET.PASSWORDS_DO_NOT_MATCH")]),m(l,R)};N(fe,l=>{r(h)&&l(pe)})}o(i);var Ee=d(i,2);Le(Ee,{type:"submit",class:"w-full",get disabled(){return r(c)},children:(l,R)=>{var I=q(),G=w(I);{var ge=f=>{var x=Qe(),D=w(x);Fe(D,{size:15,class:"animate-spin"});var xe=d(D);p(Se=>_(xe,` ${Se??""}`),[()=>n.t("ADMIN_NEXT.RESET.RESETTING")]),m(f,x)},be=f=>{var x=Ye(),D=w(x);He(D,{size:15}),we(),m(f,x)};N(G,f=>{r(c)?f(ge):f(be,-1)})}m(l,I)},$$slots:{default:!0}}),o(t),p(l=>{_(ce,l),ke(b,1,`flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
|
||||
${r(h)?"border-red-500 ring-1 ring-red-500/30 animate-[shake_0.3s_ease-in-out]":"border-input"}`),b.disabled=r(c)},[()=>n.t("ADMIN_NEXT.RESET.CONFIRM_PASSWORD")]),Me("submit",t,te),Ce(b,()=>r(y),l=>v(y,l)),m(e,t)};N(F,e=>{r(K)?e(ve):e(_e,-1)})}var H=d(F,2),L=s(H),V=s(L);ze(V,{name:"arrow-back",size:12});var ue=d(V);o(L),o(H),o(U),o($),o(P),p((e,t,a)=>{Q(g,"aria-label",e),_(ne,t),Q(L,"href",`${Y??""}/login`),_(ue,` ${a??""}`)},[()=>n.t("ADMIN_NEXT.TOGGLE_DARK_MODE"),()=>n.t("ADMIN_NEXT.RESET.RESET_PASSWORD"),()=>n.t("ADMIN_NEXT.RESET.BACK_TO_SIGN_IN")]),ye("click",g,()=>Z.toggleColorMode()),m(ee,P),he()}Ae(["click"]);export{br as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{p as A,a as p,b as I,k,c as l,s as D,t as c,d as t,$ as Y,r as e}from"../chunks/krC2xWPP.js";import{s as h}from"../chunks/CddAxf8c.js";import{i as y}from"../chunks/DjsWWzyL.js";import{h as O,s as v}from"../chunks/j_DJpx8B.js";import{i as f}from"../chunks/Cu5ilWky.js";import{S as X}from"../chunks/K87jKp17.js";var j=l('<p class="mt-0.5 text-xs text-muted-foreground"> </p>'),G=l("<div><div><div><h1> </h1> <!></div></div></div>"),V=l("<div><!></div>");function F(u,x){A(x,!0);var s=V();O("hj1sc2",N=>{k(d=>{Y.title=d??""},[()=>f.t("ADMIN_NEXT.SYSTEM.SYSTEM_GRAV_ADMIN")])});var S=t(s);X(S,{children:(d,M)=>{let a=()=>M?.().scrolled;var i=G(),n=t(i),_=t(n),o=t(_),$=t(o,!0);e(o);var g=D(o,2);{var E=r=>{var m=j(),T=t(m,!0);e(m),c(b=>h(T,b),[()=>f.t("ADMIN_NEXT.SYSTEM.COMING_SOON")]),p(r,m)};y(g,r=>{a()||r(E)})}e(_),e(n),e(i),c(r=>{v(i,1,`px-6 transition-[padding] duration-200 ${a()?"py-2":"pt-6 pb-3"}`),v(n,1,`flex items-center justify-between ${a()?"min-h-6":"min-h-8"}`),v(o,1,`font-semibold tracking-tight text-foreground transition-[font-size] duration-200 ${a()?"text-sm":"text-xl"}`),h($,r)},[()=>f.t("ADMIN_NEXT.NAV.SYSTEM")]),p(d,i)},$$slots:{default:!0}}),e(s),p(u,s),I()}export{F as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{L as l}from"../chunks/B0tTBVCR.js";const e=!1,o=Object.freeze(Object.defineProperty({__proto__:null,ssr:e},Symbol.toStringTag,{value:"Module"}));export{l as component,o as universal};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{o as _t}from"../chunks/DukJHxi2.js";import{p as pt,i as p,m as H,e as gt,f as J,a as h,b as Nt,k as ht,o as At,$ as xt,g as e,j as r,h as y,d as f,s as I,r as d,c as C,t as w}from"../chunks/krC2xWPP.js";import{e as Ct,s as G}from"../chunks/CddAxf8c.js";import{i as X}from"../chunks/DjsWWzyL.js";import{h as Et,s as $}from"../chunks/j_DJpx8B.js";import{i as g,c as Tt}from"../chunks/Cu5ilWky.js";import"../chunks/BSopV7IU.js";import{g as yt,s as It}from"../chunks/CMqN2HxG.js";import{c as Ot}from"../chunks/Lyt-zgeV.js";import{a as z,c as St,s as Dt,h as bt,B as Ft,v as kt}from"../chunks/D7PIEGLR.js";import{A as W}from"../chunks/CsG_FdPZ.js";import{t as D,B as Mt}from"../chunks/Lvd_r9sp.js";import{S as jt}from"../chunks/K87jKp17.js";import{U as Lt}from"../chunks/Bf-u42YS.js";import{S as Ut}from"../chunks/h5AuRbZl.js";import{L as Q}from"../chunks/C_E2vM9U.js";import{S as wt}from"../chunks/CV_JZMCk.js";var Gt=C("<!> ",1),Xt=C('<div><div><div class="flex items-center gap-2"><!> <h1> </h1></div> <!></div></div>'),$t=C('<div class="flex flex-1 items-center justify-center"><!></div>'),zt=C('<div class="flex-1 overflow-y-auto"><div class="px-6 py-6"><!></div></div>'),Bt=C('<div class="flex flex-1 items-center justify-center text-sm text-muted-foreground"> </div>'),qt=C('<div class="flex h-full flex-col"><!> <!> <!></div>');function ce(Y,Z){pt(Z,!0);const tt=y(()=>Tt.isSuperAdmin);let c=p(null),a=p(H({})),u=p(H({})),b=p("{}"),F=p(""),k=p(!0),E=p(!1),M=p(!1);const B=y(()=>z(e(a))!==e(b));let et=y(()=>!e(c)||!bt(e(c).fields,e(a)));async function rt(){r(k,!0);try{const[t,o]=await Promise.all([yt("accounts"),Ot().catch(()=>null)]);r(a,t.data??{},!0),r(b,z(e(a)),!0),r(F,t.etag,!0),r(c,o,!0)}catch(t){(t&&typeof t=="object"&&"status"in t?t.status:0)===403?r(M,!0):D.error(g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.FAILED_TO_LOAD"))}finally{r(k,!1)}}function st(t,o){const N=t.split("."),A={...e(a)};let i=A;for(let x=0;x<N.length-1;x++){const n=N[x];typeof i[n]!="object"||i[n]===null?i[n]={}:i[n]={...i[n]},i=i[n]}i[N[N.length-1]]=o,r(a,A,!0);const O=e(c)?kt(e(c).fields,t,A):null;if(O)r(u,{...e(u),[t]:O},!0);else if(e(u)[t]){const{[t]:x,...n}=e(u);r(u,n,!0)}}async function q(){if(r(u,e(c)?St(e(c).fields,e(a)):{},!0),Object.keys(e(u)).length>0){Dt();return}r(E,!0);try{const t=await It("accounts",e(a),e(F));r(a,t.data??e(a),!0),r(b,z(e(a)),!0),r(F,t.etag,!0),D.success(g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.SAVED"))}catch(t){(t&&typeof t=="object"&&"status"in t?t.status:0)===409?D.error(g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.MODIFIED_ELSEWHERE")):D.error(g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.FAILED_TO_SAVE"))}finally{r(E,!1)}}function at(t){(t.metaKey||t.ctrlKey)&&t.key==="s"&&(t.preventDefault(),e(B)&&!e(E)&&q())}_t(()=>{rt()});var K=gt();Et("l0fj7g",t=>{ht(o=>{xt.title=o??""},[()=>g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.PAGE_TITLE")])}),Ct("keydown",At,at);var ot=J(K);{var it=t=>{W(t,{})},nt=t=>{W(t,{})},lt=t=>{var o=qt(),N=f(o);jt(N,{noBorder:!0,children:(s,v)=>{let m=()=>v?.().scrolled;var S=Xt(),j=f(S),L=f(j),P=f(L);{let T=y(()=>m()?16:20);Ut(P,{get size(){return e(T)},class:"text-muted-foreground"})}var U=I(P,2),ct=f(U,!0);d(U),d(L);var ft=I(L,2);{let T=y(()=>!e(B)||e(E)||!e(et));Mt(ft,{size:"sm",get disabled(){return e(T)},onclick:q,children:(dt,Kt)=>{var R=Gt(),V=J(R);{var ut=_=>{Q(_,{size:14,class:"animate-spin"})},vt=_=>{wt(_,{size:14})};X(V,_=>{e(E)?_(ut):_(vt,-1)})}var mt=I(V);w(_=>G(mt,` ${_??""}`),[()=>g.t("ADMIN_NEXT.SAVE")]),h(dt,R)},$$slots:{default:!0}})}d(j),d(S),w(T=>{$(S,1,`px-6 transition-[padding] duration-200 ${m()?"py-2":"pt-6 pb-3"}`),$(j,1,`flex items-center justify-between ${m()?"min-h-6":"min-h-8"}`),$(U,1,`font-semibold tracking-tight text-foreground transition-[font-size] duration-200 ${m()?"text-sm":"text-xl"}`),G(ct,T)},[()=>g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.TITLE")]),h(s,S)},$$slots:{default:!0}});var A=I(N,2);Lt(A,{});var i=I(A,2);{var O=l=>{var s=$t(),v=f(s);Q(v,{size:24,class:"animate-spin text-muted-foreground"}),d(s),h(l,s)},x=l=>{var s=zt(),v=f(s),m=f(v);Ft(m,{get fields(){return e(c).fields},get data(){return e(a)},onchange:st,get errors(){return e(u)}}),d(v),d(s),h(l,s)},n=l=>{var s=Bt(),v=f(s,!0);d(s),w(m=>G(v,m),[()=>g.t("ADMIN_NEXT.ACCOUNTS_CONFIG.NO_FIELDS")]),h(l,s)};X(i,l=>{e(k)?l(O):e(c)?l(x,1):l(n,-1)})}d(o),h(t,o)};X(ot,t=>{!e(tt)&&!e(M)?t(it):e(M)?t(nt,1):t(lt,-1)})}h(Y,K),Nt()}export{ce as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{p as fe,t as x,g as t,a as b,b as ve,i as N,k as _e,o as ge,s,j as v,c as h,f as q,d as r,h as w,$ as xe,r as a}from"../chunks/krC2xWPP.js";import{e as be,s as d}from"../chunks/CddAxf8c.js";import{i as Ne}from"../chunks/DjsWWzyL.js";import{h as he,s as J}from"../chunks/j_DJpx8B.js";import{s as Ee,B as Q,t as ee,r as k}from"../chunks/Lvd_r9sp.js";import{b as X}from"../chunks/ciapVzar.js";import{i as o}from"../chunks/Cu5ilWky.js";import{g as te}from"../chunks/BVTiZ3e2.js";import{b as re}from"../chunks/BSopV7IU.js";import{c as Ae}from"../chunks/DRw0n_lJ.js";import{S as Pe}from"../chunks/K87jKp17.js";import{D as Re}from"../chunks/nlum2O0L.js";import{U as Oe}from"../chunks/DwS2ehmU.js";import{L as $e}from"../chunks/C_E2vM9U.js";import{S as Ge}from"../chunks/CV_JZMCk.js";var Ue=h("<!> ",1),De=h("<!> ",1),Se=h('<div><div class="flex items-center gap-2"><!> <h1> </h1></div> <div class="flex items-center gap-2"><!> <!></div></div>'),ye=h('<div class="flex h-full flex-col"><!> <div class="flex-1 overflow-y-auto"><div class="mx-auto max-w-2xl px-6 py-6 space-y-4"><div><label for="groupname-input" class="mb-1 block text-sm font-medium text-foreground"> </label> <input id="groupname-input" type="text" class="h-10 w-full rounded-md border border-input bg-transparent px-3 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"/> <p class="mt-1 text-xs text-muted-foreground"> </p></div> <div><label for="readableName-input" class="mb-1 block text-sm font-medium text-foreground"> </label> <input id="readableName-input" type="text" class="h-10 w-full rounded-md border border-input bg-transparent px-3 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"/></div> <div><label for="description-input" class="mb-1 block text-sm font-medium text-foreground"> </label> <input id="description-input" type="text" class="h-10 w-full rounded-md border border-input bg-transparent px-3 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"/></div></div></div></div>');function Ye(ae,se){fe(se,!0);let u=N(""),E=N(""),A=N(""),p=N(!1);const P=w(()=>/^[a-zA-Z0-9_-]{1,200}$/.test(t(u)));async function z(){if(t(P)){v(p,!0);try{await Ae({groupname:t(u),readableName:t(E),description:t(A)}),ee.success(o.t("ADMIN_NEXT.GROUPS.GROUP_CREATED",{name:t(u)})),te(`${re}/users/groups/${t(u)}`)}catch(e){const n=e&&typeof e=="object"&&"message"in e?e.message:o.t("ADMIN_NEXT.GROUPS.FAILED_TO_CREATE_GROUP");ee.error(n)}finally{v(p,!1)}}}function oe(e){(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),t(P)&&!t(p)&&z())}var R=ye();he("fa2np5",e=>{_e(n=>{xe.title=n??""},[()=>o.t("ADMIN_NEXT.GROUPS.NEW_GROUP_GRAV_ADMIN")])}),be("keydown",ge,oe);var C=r(R);Pe(C,{children:(n,S)=>{let c=()=>S?.().scrolled;var m=Se(),y=r(m),F=r(y);{let l=w(()=>c()?16:20);Oe(F,{get size(){return t(l)},class:"text-muted-foreground"})}var I=s(F,2),ue=r(I,!0);a(I),a(y);var V=s(y,2),Y=r(V);Q(Y,{variant:"outline",size:"sm",onclick:()=>te(`${re}/users/groups`),children:(l,Z)=>{var T=Ue(),f=q(T);Re(f,{name:"chevron-back",size:14});var g=s(f);x(M=>d(g,` ${M??""}`),[()=>o.t("ADMIN_NEXT.GROUPS.BACK_TO_GROUPS")]),b(l,T)},$$slots:{default:!0}});var me=s(Y,2);{let l=w(()=>!t(P)||t(p));Q(me,{size:"sm",get disabled(){return t(l)},onclick:z,children:(Z,T)=>{var f=De(),g=q(f);{var M=i=>{$e(i,{size:14,class:"animate-spin"})},pe=i=>{Ge(i,{size:14})};Ne(g,i=>{t(p)?i(M):i(pe,-1)})}var ce=s(g);x(i=>d(ce,` ${i??""}`),[()=>o.t("ADMIN_NEXT.GROUPS.CREATE")]),b(Z,f)},$$slots:{default:!0}})}a(V),a(m),x(l=>{J(m,1,`flex items-center justify-between px-6 transition-[padding] duration-200 ${c()?"py-2":"pt-6 pb-3"}`),J(I,1,`font-semibold tracking-tight text-foreground transition-[font-size] duration-200 ${c()?"text-sm":"text-xl"}`),d(ue,l)},[()=>o.t("ADMIN_NEXT.GROUPS.NEW_GROUP")]),b(n,m)},$$slots:{default:!0}});var L=s(C,2),K=r(L),O=r(K),$=r(O),ie=r($,!0);a($);var _=s($,2);k(_);var j=s(_,2),ne=r(j,!0);a(j),a(O);var G=s(O,2),U=r(G),le=r(U,!0);a(U);var B=s(U,2);k(B),a(G);var H=s(G,2),D=r(H),de=r(D,!0);a(D);var W=s(D,2);k(W),a(H),a(K),a(L),a(R),x((e,n,S,c,m)=>{d(ie,e),Ee(_,"placeholder",n),d(ne,S),d(le,c),d(de,m)},[()=>o.t("ADMIN_NEXT.GROUPS.GROUP_NAME"),()=>o.t("ADMIN_NEXT.GROUPS.GROUP_NAME_PLACEHOLDER"),()=>o.t("ADMIN_NEXT.GROUPS.GROUP_NAME_HELP"),()=>o.t("ADMIN_NEXT.GROUPS.DISPLAY_NAME"),()=>o.t("ADMIN_NEXT.GROUPS.DESCRIPTION")]),X(_,()=>t(u),e=>v(u,e)),X(B,()=>t(E),e=>v(E,e)),X(W,()=>t(A),e=>v(A,e)),b(ae,R),ve()}export{Ye as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{L as l}from"../chunks/B0tTBVCR.js";const e=!1,o=Object.freeze(Object.defineProperty({__proto__:null,ssr:e},Symbol.toStringTag,{value:"Module"}));export{l as component,o as universal};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"../chunks/DsnmJJEf.js";import{o as s}from"../chunks/DukJHxi2.js";import{p as m,t as p,a as i,b as f,c as n,d as c,r as d}from"../chunks/krC2xWPP.js";import{s as u}from"../chunks/CddAxf8c.js";import{i as v}from"../chunks/Cu5ilWky.js";import{g as x}from"../chunks/BVTiZ3e2.js";import{b as N}from"../chunks/BSopV7IU.js";var _=n('<div class="py-20 text-center text-sm text-muted-foreground"> </div>');function G(o,e){m(e,!0),s(()=>{x(`${N}/config/system`,{replaceState:!0})});var t=_(),r=c(t,!0);d(t),p(a=>u(r,a),[()=>v.t("ADMIN_NEXT.CONFIG.LOADING_CONFIGURATION")]),i(o,t),f()}export{G as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user