@donotdev/ui 0.0.15 → 0.0.16
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/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.js +2 -2
- package/dist/crud/components/CrudCardLink.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +8 -22
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +7 -43
- package/dist/dndev.css +86 -63
- package/dist/index.js +4 -4
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +2 -9
- package/dist/internal/layout/components/FontPreloadLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/FontPreloadLinks.js +1 -0
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/routing/GoToInput.d.ts.map +1 -1
- package/dist/routing/GoToInput.js +2 -1
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/useRouteDiscovery.d.ts.map +1 -1
- package/dist/styles/index.css +86 -63
- package/dist/utils/sanitizeSvg.d.ts.map +1 -1
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +1 -1
- package/package.json +1 -1
- package/dist/routing/hooks/useFormNavigationBlocker.d.ts +0 -14
- package/dist/routing/hooks/useFormNavigationBlocker.d.ts.map +0 -1
- package/dist/routing/hooks/useFormNavigationBlocker.js +0 -42
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";var Vo=Object.defineProperty;var Ur=(e,t,o)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Le=(e,t)=>()=>(e&&(t=e(e=0)),t);var Uo=(e,t)=>{for(var o in t)Vo(e,o,{get:t[o],enumerable:!0})};var nt=(e,t,o)=>Ur(e,typeof t!="symbol"?t+"":t,o);import*as rt from"lucide-react";import{isValidElement as _r}from"react";import{cn as Ot}from"@donotdev/components";import{jsx as Ue}from"react/jsx-runtime";function Gr(e){if(!e)return rt.Palette;let t=e.replace(/['"]/g,"");return rt[t]||rt.Palette}var V,Hr,le=Le(()=>{"use strict";V=({icon:e,fallback:t,className:o,ariaHidden:n=!1})=>{let r=e||t;if(!r)return null;let a="dndev-size-md";if(typeof r=="function"||typeof r=="object"&&r!==null&&"render"in r)return Ue(r,{className:Ot(a,o),style:{flexShrink:0},"aria-hidden":n});if(typeof r=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(r))return Ue("span",{className:Ot(a,o),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r});let d=Gr(r);return Ue(d,{className:Ot(a,o),style:{flexShrink:0},"aria-hidden":n})}return _r(r)?Ue("span",{className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r}):Ue("span",{className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r})},Hr=V});import*as Jr from"@donotdev/auth";import{DEGRADED_AUTH_API as Qr}from"@donotdev/core";function Xr(e){return Qr[e]}function L(e){return zt?zt(e):Xr(e)}var zt,pm,ye=Le(()=>{"use strict";zt=Jr?.useAuth;pm=typeof zt=="function"});var _t={};Uo(_t,{default:()=>ma});import{Cookie as Vt,Settings as ea,Shield as ta,BarChart3 as oa,Target as na}from"lucide-react";import{useState as Ut,useEffect as it,useRef as ra}from"react";import{Accordion as aa,Button as _e,BUTTON_VARIANT as st,Card as $o,Switch as ia,Text as Ge,cn as sa,Stack as ce}from"@donotdev/components";import{handleError as la,useConsent as Pe,getCookieExamples as lt,hasOptionalCookies as ca}from"@donotdev/core";import{CONSENT_CATEGORY as be}from"@donotdev/core";import{useTranslation as da}from"@donotdev/core";import{isClient as pa}from"@donotdev/core";import{Fragment as ga,jsx as O,jsxs as de}from"react/jsx-runtime";function ua({position:e="bottom",showBranding:t=!0,brandingText:o="Powered by DoNotDev Framework",className:n=""}){let r=Pe("hasConsented"),a=Pe("categories"),i=Pe("acceptAll"),l=Pe("declineAll"),d=Pe("updateCategory"),c=Pe("showBanner"),{t:s}=da("cookies"),[p,g]=Ut(!1),[u,m]=Ut(!r||c),[b,f]=Ut(a),v=ra(null);it(()=>{c&&m(!0)},[c]);let h=Object.keys(a),T=[{id:be.NECESSARY,icon:ta,title:s("essentialCookies"),description:s("essentialDescription"),examples:lt("necessary")||s("essentialExamples"),locked:!0},{id:be.FUNCTIONAL,icon:Vt,title:s("functionalCookies"),description:s("functionalDescription"),examples:lt("functional")||s("functionalExamples"),legalNotice:s("functionalLegalNotice"),locked:!1},{id:be.ANALYTICS,icon:oa,title:s("analyticsCookies"),description:s("analyticsDescription"),examples:lt("analytics")||s("analyticsExamples"),locked:!1},{id:be.MARKETING,icon:na,title:s("marketingCookies"),description:s("marketingDescription"),examples:lt("marketing")||s("marketingExamples"),locked:!1}].filter(y=>h.includes(y.id)),C=ca();if(it(()=>{!r&&!C&&i()},[r,C,i]),it(()=>{let y={...a};if(p){let S=y;Object.keys(S).forEach(x=>{x!==be.NECESSARY&&S[x]===!1&&(S[x]=!0)})}f(y)},[a,p]),it(()=>{if(!pa()||r||!u)return;let y=x=>{v.current&&!v.current.contains(x.target)&&m(!1)},S=setTimeout(()=>{document.addEventListener("mousedown",y)},100);return()=>{clearTimeout(S),document.removeEventListener("mousedown",y)}},[r,u]),r&&!c)return null;let I=()=>{try{Object.entries(b).forEach(([y,S])=>{if(y!==be.NECESSARY&&S!==void 0){let x=y;Object.values(be).includes(x)&&d(x,!!S)}}),g(!1),m(!1)}catch(y){la(y,{userMessage:"Error saving preferences",context:{operation:"save_preferences"},severity:"warning",log:!0,reportToSentry:!1,showNotification:!1})}},P=()=>{i(),m(!1)},w=()=>{l(),m(!1)},D=de(ce,{children:[O(Ge,{as:"p",variant:"muted",level:"small",children:s("cookieBannerDescription")}),C&&O(aa,{type:"single",collapsible:!0,value:p?"preferences":"",onValueChange:y=>g(y==="preferences"),items:[{value:"preferences",trigger:de(ce,{direction:"row",align:"center",gap:"tight",children:[O(ea,{className:"dndev-size-md"}),s("customize")]}),content:O(ce,{children:T.map(y=>{let S=y.icon,x=b[y.id]??!1;return O($o,{content:de(ce,{direction:"row",align:"center",justify:"between",children:[de(ce,{direction:"row",align:"start",gap:"tight",style:{flex:1},children:[O(S,{className:"dndev-size-md",style:{color:"var(--primary)",marginTop:"0.125rem"}}),de(ce,{gap:"tight",children:[O(Ge,{as:"span",level:"body",style:{fontWeight:600},children:y.title}),O(Ge,{as:"span",variant:"muted",level:"small",children:y.description}),y.examples&&O(Ge,{as:"span",variant:"muted",level:"small",style:{fontStyle:"italic"},children:y.examples})]})]}),y.locked?O(Ge,{as:"span",variant:"muted",level:"small",children:s("alwaysOn")}):O(ia,{checked:x,onCheckedChange:A=>f(E=>({...E,[y.id]:A}))})]})},y.id)})})}]})]}),k=p?de(ce,{direction:"row",gap:"tight",style:{width:"100%"},children:[O(_e,{onClick:I,variant:st.DEFAULT,style:{flex:1},children:s("savePreferences","Save Preferences")}),O(_e,{onClick:()=>g(!1),variant:st.OUTLINE,style:{flex:1},children:s("form.cancel","Cancel")})]}):de(ce,{direction:"row",gap:"tight",style:{width:"100%"},children:[O(_e,{onClick:P,variant:st.DEFAULT,style:{flex:1},children:s("acceptAll")}),C&&O(_e,{onClick:w,variant:st.OUTLINE,style:{flex:1},children:s("declineOptional")})]});return de(ga,{children:[u&&O($o,{ref:v,className:sa("dndev-fixed dndev-z-modal",n),icon:Vt,title:s("cookiePreferences"),content:D,footer:k,style:{[e==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)",insetInlineEnd:"var(--gap-md)",maxWidth:"100%",width:"calc(100% - var(--gap-md) * 2)"}}),!u&&!r&&O(_e,{onClick:()=>m(!0),className:"dndev-fixed dndev-z-toast",style:{bottom:"var(--gap-md)",insetInlineStart:"var(--gap-md)"},icon:Vt,title:s("cookiePreferences")})]})}var ma,Gt=Le(()=>{"use strict";ma=ua});import{useMemo as Xo}from"react";import{useNavigationStore as ci}from"@donotdev/core";import{USER_ROLES as di}from"@donotdev/core";import{useLocation as pi}from"@donotdev/ui/routing/hooks";function K(){let e=pi(),t=L("user"),o=!!t,n=t?.role||di.GUEST,r=ci(a=>!a||typeof a.getFilteredRoutes!="function"?[]:a.getFilteredRoutes({authenticated:o,role:n}));return Xo(()=>Array.isArray(r)?r.map(a=>({...a,isActive:ui(a.path,e.pathname),hasChildren:!1,children:void 0})).sort((a,i)=>a.label.localeCompare(i.label,void 0,{sensitivity:"base"})):[],[r,e.pathname])}function en(e){let t=K();return Xo(()=>t.find(o=>o.path===e),[t,e])}function ui(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}var Ce=Le(()=>{"use strict";ye()});import{useCallback as mt,useMemo as tn}from"react";import{useNavigationStore as We}from"@donotdev/core";import{useNavigate as mi}from"@donotdev/ui/routing/hooks";var on,Kt=Le(()=>{"use strict";Ce();on=()=>{let e=mi(),t=K()??[],o=We(u=>u.favorites),n=We(u=>u.recent),r=We(u=>u.toggleFavorite),a=We(u=>u.isFavorite),i=We(u=>u.addRecent),l=tn(()=>t.length?t.filter(u=>o.includes(u.path)):[],[o,t]),d=tn(()=>t.length?t.filter(m=>n.includes(m.path)).slice(0,5):[],[n,t]),c=mt(u=>{r(u)},[r]),s=mt(u=>a(u),[a]),p=mt(u=>{i(u)},[i]),g=mt(u=>{p(u),e(u)},[e,p]);return{navigationItems:t,favoriteItems:l,recentItems:d,toggleFavorite:c,isFavorite:s,navigateToItem:g}}});var rn={};Uo(rn,{default:()=>Ti});import{Link as gi,Star as fi}from"lucide-react";import{useCallback as nn,useEffect as vi,useRef as hi}from"react";import{Badge as yi,Command as bi,CommandDialog as Si}from"@donotdev/components";import{useOverlayStore as Yt,useTranslation as Ci}from"@donotdev/core";import{jsx as G,jsxs as Fe}from"react/jsx-runtime";var xi,ki,Ti,an=Le(()=>{"use strict";Kt();le();xi=()=>{let{t:e}=Ci("dndev"),t=hi(null),o=Yt(m=>m.isCommandDialogOpen),n=Yt(m=>m.closeCommandDialog),{navigationItems:r,favoriteItems:a,recentItems:i,toggleFavorite:l,isFavorite:d,navigateToItem:c}=on();vi(()=>{o&&requestAnimationFrame(()=>{t.current?.focus()})},[o]);let s=nn(m=>{c(m),n()},[c,n]),p=nn((m,b=!0)=>m.map(f=>({label:f.label,value:f.path,description:f.path!==f.label?f.path:void 0,icon:G(V,{icon:f.icon,fallback:gi}),badge:f.badge?G(yi,{children:f.badge}):void 0,onSelect:()=>s(f.path),rightSlot:b?G("button",{type:"button",onClick:v=>{v.stopPropagation(),l(f.path)},className:"dndev-command-favorite-button","data-favorited":d(f.path),"aria-label":d(f.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:G(V,{icon:fi,className:"dndev-size-sm"})}):void 0})),[s,l,d,e]),g=[];if(a.length>0&&g.push({heading:e("globalGoTo.favorites","Favorites"),items:p(a,!1)}),i.length>0){let m=i.flatMap(b=>p([b],!0));m.length>0&&g.push({heading:e("globalGoTo.recent","Recent"),separator:a.length>0,items:m})}g.push({heading:e("globalGoTo.allPages","All Pages"),separator:a.length>0||i.length>0,items:p(r)});let u=r.length>0;return Fe(Si,{open:o,onOpenChange:m=>m?null:n(),children:[G(bi,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:u?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:g}),G("div",{className:"dndev-command-footer",children:Fe("div",{className:"dndev-command-footer-shortcuts",children:[Fe("div",{className:"dndev-command-footer-shortcut",children:[G("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),G("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),Fe("div",{className:"dndev-command-footer-shortcut",children:[G("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),G("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),G("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),Fe("div",{className:"dndev-command-footer-shortcut",children:[G("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),G("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),Fe("div",{className:"dndev-command-footer-shortcut",children:[G("kbd",{className:"dndev-command-footer-key",children:"Esc"}),G("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},ki=()=>Yt(t=>t.isCommandDialogOpen)?G(xi,{}):null,Ti=ki});import{User as Ws}from"lucide-react";import{Suspense as ro,lazy as kn,useState as Ks}from"react";import{Button as Ys,BUTTON_VARIANT as qs,DropdownMenu as Zs,Dialog as js,DISPLAY as Js}from"@donotdev/components";import{useTranslation as Qs}from"@donotdev/core";import{useAuthConfig as Xs}from"@donotdev/core";import{getEnabledAuthPartners as el}from"@donotdev/core";import{User as ks,LogOut as Ts,Settings as Ye,UserCheck as ws,Trash2 as Ns}from"lucide-react";import*as Is from"lucide-react";import yt,{useMemo as Ls,lazy as bn,Suspense as yn}from"react";import{Avatar as As,Button as Es,BUTTON_VARIANT as Ps,DropdownMenu as Rs,Text as Ds,DISPLAY as Fs}from"@donotdev/components";import{useTranslation as Bs}from"@donotdev/core";import{getEnabledAuthPartners as Ms,useAuthConfig as Os,isClient as zs}from"@donotdev/core";import{useBreakpoint as Vs}from"@donotdev/core";import{useNavigate as Us}from"@donotdev/ui/routing/hooks";le();import{Link as _o}from"lucide-react";import"react";import"@donotdev/components";import{useConsent as $r}from"@donotdev/core";import{useNavigate as Wr}from"@donotdev/ui/routing/hooks";import{Fragment as Kr,jsx as Ae,jsxs as Go}from"react/jsx-runtime";var N=({path:e,replace:t,prefetch:o=!0,children:n,icon:r,label:a,onClick:i,className:l,"aria-label":d,"aria-describedby":c,target:s,rel:p,...g})=>{let u=Wr(),m=$r("showCookieBanner");if(e==="#cookie-settings")return Go("a",{href:"#cookie-settings",onClick:C=>{C.preventDefault(),C.stopPropagation();try{m()}catch{}i&&i(C)},className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0,...g.style},"aria-label":d||a||"Cookie Settings","aria-describedby":c,...g,children:[r&&Ae(V,{icon:r,fallback:_o}),a&&Ae("span",{children:a}),n]});let b=e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("tel:"),f=T=>{if(b){i&&i(T);return}T.preventDefault(),i&&i(T);let C=e.startsWith("/")?e:`/${e}`;u(C,{replace:t})},v={"aria-label":d||a,"aria-describedby":c},h=Go(Kr,{children:[r&&Ae(V,{icon:r,fallback:_o}),a&&Ae("span",{children:a}),n]});return b?Ae("a",{href:e,onClick:f,target:s||"_blank",rel:p||"noopener noreferrer",className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0},...v,...g,children:h}):Ae("a",{href:e,onClick:f,className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0},...v,...g,children:h})};import{useEffect as Wo,useState as fa,lazy as va,Suspense as ha}from"react";import{Stack as Ko}from"@donotdev/components";import{FEATURE_STATUS as Ht,USER_ROLES as ct,SUBSCRIPTION_TIERS as $t}from"@donotdev/core";import{useRedirectGuard as ya,useNavigate as ba}from"@donotdev/ui/routing/hooks";import{RefreshCw as Ho}from"lucide-react";import"react";import{cn as Yr}from"@donotdev/components";import{jsx as Ee}from"react/jsx-runtime";var qr=({variant:e="fullPage",className:t})=>e==="inline"?Ee("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Ee(Ho,{className:"dndev-size-md",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}})}):Ee("div",{className:Yr("dndev-loading-overlay",t),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--background)",backdropFilter:"blur(4px)",zIndex:50},role:"status","aria-busy":"true","aria-label":"Loading",children:Ee(Ho,{className:"dndev-size-touch",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}})}),Zr=({variant:e="fullPage",className:t,isLoading:o})=>o===!1?null:Ee(qr,{variant:e,className:t}),jr=e=>Ee(Zr,{...e}),at=jr;ye();import{Fragment as Yo,jsx as U,jsxs as qo}from"react/jsx-runtime";var Sa=va(()=>Promise.resolve().then(()=>(Gt(),_t)));function Ca({auth:e,children:t,fallback:o=at}){let n=ba(),r=L("user"),a=L("can"),i=L("status"),[l,d]=fa(!1),{shouldRedirect:c,redirectTo:s,isChecking:p}=ya({auth:e});return Wo(()=>{let g=setTimeout(()=>{i===Ht.INITIALIZING&&d(!0)},5e3);return()=>clearTimeout(g)},[i]),Wo(()=>{c&&s&&n(s,{replace:!0})},[c,s,n]),e===!1?U(Yo,{children:t}):c||p?U(at,{}):i===Ht.INITIALIZING&&l?U(Ko,{align:"center",justify:"center",style:{padding:"var(--gap-md)",minHeight:"100vh"},children:qo("div",{className:"dndev-w-full",style:{maxWidth:"28rem",textAlign:"center"},children:[U("h2",{style:{marginBottom:"var(--gap-md)"},children:"Loading is taking longer than usual"}),U("p",{style:{marginBottom:"var(--gap-md)",color:"var(--muted-foreground)"},children:"This might be due to a slow connection. Please wait or try refreshing the page."}),U("button",{onClick:()=>window.location.reload(),style:{padding:"var(--gap-sm) var(--gap-md)",backgroundColor:"var(--primary)",color:"var(--primary-foreground)",border:"none",borderRadius:"var(--radius)",cursor:"pointer"},children:"Refresh Page"})]})}):i===Ht.INITIALIZING?U(o,{}):e&&typeof e=="object"&&e.required&&!r&&a&&!a.navigate(e)?U(Ko,{align:"center",justify:"center",style:{padding:"var(--gap-md)",minHeight:"100vh"},children:qo("div",{className:"dndev-w-full",style:{maxWidth:"28rem"},children:[U("h2",{style:{marginBottom:"var(--gap-md)"},children:"Authentication Required"}),U("p",{style:{marginBottom:"var(--gap-md)"},children:"This page requires authentication. Please accept functional cookies to continue."}),U(ha,{fallback:U("div",{children:"Loading consent..."}),children:U(Sa,{})})]})}):U(Yo,{children:t})}function xa(e){return L("can")?.navigate(e)??!1}var Lm=xa;function Am(){return L("user")?.role||ct.GUEST}function Em(e){return L("user")?.role===e}function Pm(){let e=L("user"),t=L("userSubscription"),o=L("loading");return{authenticated:!!e,role:e?.role,tier:t?.tier||"free",loading:o,userId:e?.id}}function Rm(e,t){return n=>U(Ca,{auth:t,children:U(e,{...n})})}var Dm={public:()=>!1,required:()=>({required:!0}),user:()=>({required:!0,role:ct.USER}),admin:()=>({required:!0,role:ct.ADMIN}),tier:e=>({required:!0,tier:e}),pro:()=>({required:!0,tier:$t.PRO}),premium:()=>({required:!0,tier:$t.PREMIUM}),adminPro:()=>({required:!0,role:ct.ADMIN,tier:$t.PRO}),custom:e=>({required:!0,validate:e})};import{ArrowLeft as Ga,Lock as Ha}from"lucide-react";import{Suspense as $a,lazy as Wa}from"react";import{Card as Ka,Button as Ya,Separator as qa,Stack as De,cn as Za}from"@donotdev/components";import{useTranslation as ja}from"@donotdev/core";import"@donotdev/core";import{useLocation as Ja,useBack as Qa}from"@donotdev/ui/routing/hooks";import{Suspense as Ua}from"react";import{cn as _a}from"@donotdev/components";import{Component as ka}from"react";import{handleError as Ta}from"@donotdev/core";var Wt=class extends ka{constructor(o){super(o);nt(this,"resetError",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,n){Ta(o,{userMessage:`A ${this.props.level||"component"} error occurred`,context:{errorInfo:n,component:"DnDevErrorBoundary",level:this.props.level||"component"},showNotification:!1})}render(){return this.state.hasError?this.props.fallback({error:this.state.error,resetError:this.resetError,componentStack:null,eventId:null}):this.props.children}},Zo=Wt;import{AlertTriangle as wa,Home as Na,ArrowLeft as Ia,RotateCw as La,Copy as Aa,Check as Ea}from"lucide-react";import{useEffect as Pa,useState as Ra}from"react";import{Button as dt,BUTTON_VARIANT as pt,Card as jo,CARD_VARIANT as Jo,Alert as Da,ALERT_VARIANT as Fa,Stack as Re}from"@donotdev/components";import{handleError as Ba,useTranslation as Ma}from"@donotdev/core";import{useLocation as Oa,useBack as za}from"@donotdev/ui/routing/hooks";import{jsx as _,jsxs as Se}from"react/jsx-runtime";var Va=({error:e,resetError:t,componentStack:o,eventId:n})=>{let{t:r}=Ma("dndev"),[a,i]=Ra(!1),l=za(),c=Oa()?.pathname||(typeof window<"u"?window.location.pathname:"/"),s=e instanceof Error?e.message:"Unknown error",p=e instanceof Error?e.stack:void 0,g=!1;Pa(()=>{try{Ba(e,{userMessage:"Page encountered an error",context:{component:"RouteErrorFallback",location:c}})}catch{}},[e,c]);let u=async()=>{if(!p)return;let f=[`Error: ${s}`,`Timestamp: ${new Date().toISOString()}`,`User Agent: ${navigator.userAgent}`,n?`Event ID: ${n}`:null,`Path: ${c}`,"","Stack Trace:",p,o?`
|
|
1
|
+
"use client";var Vo=Object.defineProperty;var zr=(e,t,o)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var we=(e,t)=>()=>(e&&(t=e(e=0)),t);var Uo=(e,t)=>{for(var o in t)Vo(e,o,{get:t[o],enumerable:!0})};var tt=(e,t,o)=>zr(e,typeof t!="symbol"?t+"":t,o);import*as ot from"lucide-react";import{isValidElement as Vr}from"react";import{cn as Mt}from"@donotdev/components";import{jsx as Oe}from"react/jsx-runtime";function Ur(e){if(!e)return ot.Palette;let t=e.replace(/['"]/g,"");return ot[t]||ot.Palette}var z,_r,ie=we(()=>{"use strict";z=({icon:e,fallback:t,className:o,ariaHidden:n=!1})=>{let r=e||t;if(!r)return null;let a="dndev-size-md";if(typeof r=="function"||typeof r=="object"&&r!==null&&"render"in r)return Oe(r,{className:Mt(a,o),style:{flexShrink:0},"aria-hidden":n});if(typeof r=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(r))return Oe("span",{className:Mt(a,o),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r});let d=Ur(r);return Oe(d,{className:Mt(a,o),style:{flexShrink:0},"aria-hidden":n})}return Vr(r)?Oe("span",{className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r}):Oe("span",{className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":n,children:r})},_r=z});import*as Zr from"@donotdev/auth";import{DEGRADED_AUTH_API as jr}from"@donotdev/core";function Jr(e){return jr[e]}function L(e){return Ot?Ot(e):Jr(e)}var Ot,lm,fe=we(()=>{"use strict";Ot=Zr?.useAuth;lm=typeof Ot=="function"});var Ut={};Uo(Ut,{default:()=>pa});import{Cookie as zt,Settings as Qr,Shield as Xr,BarChart3 as ea,Target as ta}from"lucide-react";import{useState as Vt,useEffect as rt,useRef as oa}from"react";import{Accordion as na,Button as ze,BUTTON_VARIANT as at,Card as $o,Switch as ra,Text as Ve,cn as aa,Stack as se}from"@donotdev/components";import{handleError as ia,useConsent as Ae,getCookieExamples as it,hasOptionalCookies as sa}from"@donotdev/core";import{CONSENT_CATEGORY as ve}from"@donotdev/core";import{useTranslation as la}from"@donotdev/core";import{isClient as ca}from"@donotdev/core";import{Fragment as ua,jsx as M,jsxs as le}from"react/jsx-runtime";function da({position:e="bottom",showBranding:t=!0,brandingText:o="Powered by DoNotDev Framework",className:n=""}){let r=Ae("hasConsented"),a=Ae("categories"),i=Ae("acceptAll"),l=Ae("declineAll"),d=Ae("updateCategory"),c=Ae("showBanner"),{t:s}=la("cookies"),[p,g]=Vt(!1),[m,u]=Vt(!r||c),[y,f]=Vt(a),h=oa(null);rt(()=>{c&&u(!0)},[c]);let S=Object.keys(a),C=[{id:ve.NECESSARY,icon:Xr,title:s("essentialCookies"),description:s("essentialDescription"),examples:it("necessary")||s("essentialExamples"),locked:!0},{id:ve.FUNCTIONAL,icon:zt,title:s("functionalCookies"),description:s("functionalDescription"),examples:it("functional")||s("functionalExamples"),legalNotice:s("functionalLegalNotice"),locked:!1},{id:ve.ANALYTICS,icon:ea,title:s("analyticsCookies"),description:s("analyticsDescription"),examples:it("analytics")||s("analyticsExamples"),locked:!1},{id:ve.MARKETING,icon:ta,title:s("marketingCookies"),description:s("marketingDescription"),examples:it("marketing")||s("marketingExamples"),locked:!1}].filter(v=>S.includes(v.id)),T=sa();if(rt(()=>{!r&&!T&&i()},[r,T,i]),rt(()=>{let v={...a};if(p){let k=v;Object.keys(k).forEach(w=>{w!==ve.NECESSARY&&k[w]===!1&&(k[w]=!0)})}f(v)},[a,p]),rt(()=>{if(!ca()||r||!m)return;let v=w=>{h.current&&!h.current.contains(w.target)&&u(!1)},k=setTimeout(()=>{document.addEventListener("mousedown",v)},100);return()=>{clearTimeout(k),document.removeEventListener("mousedown",v)}},[r,m]),r&&!c)return null;let N=()=>{try{Object.entries(y).forEach(([v,k])=>{if(v!==ve.NECESSARY&&k!==void 0){let w=v;Object.values(ve).includes(w)&&d(w,!!k)}}),g(!1),u(!1)}catch(v){ia(v,{userMessage:"Error saving preferences",context:{operation:"save_preferences"},severity:"warning",log:!0,reportToSentry:!1,showNotification:!1})}},x=()=>{i(),u(!1)},A=()=>{l(),u(!1)},E=le(se,{children:[M(Ve,{as:"p",variant:"muted",level:"small",children:s("cookieBannerDescription")}),T&&M(na,{type:"single",collapsible:!0,value:p?"preferences":"",onValueChange:v=>g(v==="preferences"),items:[{value:"preferences",trigger:le(se,{direction:"row",align:"center",gap:"tight",children:[M(Qr,{className:"dndev-size-md"}),s("customize")]}),content:M(se,{children:C.map(v=>{let k=v.icon,w=y[v.id]??!1;return M($o,{content:le(se,{direction:"row",align:"center",justify:"between",children:[le(se,{direction:"row",align:"start",gap:"tight",style:{flex:1},children:[M(k,{className:"dndev-size-md",style:{color:"var(--primary)",marginTop:"0.125rem"}}),le(se,{gap:"tight",children:[M(Ve,{as:"span",level:"body",style:{fontWeight:600},children:v.title}),M(Ve,{as:"span",variant:"muted",level:"small",children:v.description}),v.examples&&M(Ve,{as:"span",variant:"muted",level:"small",style:{fontStyle:"italic"},children:v.examples})]})]}),v.locked?M(Ve,{as:"span",variant:"muted",level:"small",children:s("alwaysOn")}):M(ra,{checked:w,onCheckedChange:D=>f(R=>({...R,[v.id]:D}))})]})},v.id)})})}]})]}),b=p?le(se,{direction:"row",gap:"tight",style:{width:"100%"},children:[M(ze,{onClick:N,variant:at.DEFAULT,style:{flex:1},children:s("savePreferences","Save Preferences")}),M(ze,{onClick:()=>g(!1),variant:at.OUTLINE,style:{flex:1},children:s("form.cancel","Cancel")})]}):le(se,{direction:"row",gap:"tight",style:{width:"100%"},children:[M(ze,{onClick:x,variant:at.DEFAULT,style:{flex:1},children:s("acceptAll")}),T&&M(ze,{onClick:A,variant:at.OUTLINE,style:{flex:1},children:s("declineOptional")})]});return le(ua,{children:[m&&M($o,{ref:h,className:aa("dndev-fixed dndev-z-modal",n),icon:zt,title:s("cookiePreferences"),content:E,footer:b,style:{[e==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)",insetInlineEnd:"var(--gap-md)",maxWidth:"100%",width:"calc(100% - var(--gap-md) * 2)"}}),!m&&!r&&M(ze,{onClick:()=>u(!0),className:"dndev-fixed dndev-z-toast",style:{bottom:"var(--gap-md)",insetInlineStart:"var(--gap-md)"},icon:zt,title:s("cookiePreferences")})]})}var pa,_t=we(()=>{"use strict";pa=da});import{useMemo as Xo}from"react";import{useNavigationStore as si}from"@donotdev/core";import{USER_ROLES as li}from"@donotdev/core";import{useLocation as ci}from"@donotdev/ui/routing/hooks";function $(){let e=ci(),t=L("user"),o=!!t,n=t?.role||li.GUEST,r=si(a=>!a||typeof a.getFilteredRoutes!="function"?[]:a.getFilteredRoutes({authenticated:o,role:n}));return Xo(()=>Array.isArray(r)?r.map(a=>({...a,isActive:di(a.path,e.pathname),hasChildren:!1,children:void 0})).sort((a,i)=>a.label.localeCompare(i.label,void 0,{sensitivity:"base"})):[],[r,e.pathname])}function en(e){let t=$();return Xo(()=>t.find(o=>o.path===e),[t,e])}function di(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}var ye=we(()=>{"use strict";fe()});import{useCallback as pt,useMemo as tn}from"react";import{useNavigationStore as Ge}from"@donotdev/core";import{useNavigate as pi}from"@donotdev/ui/routing/hooks";var on,Wt=we(()=>{"use strict";ye();on=()=>{let e=pi(),t=$()??[],o=Ge(m=>m.favorites),n=Ge(m=>m.recent),r=Ge(m=>m.toggleFavorite),a=Ge(m=>m.isFavorite),i=Ge(m=>m.addRecent),l=tn(()=>t.length?t.filter(m=>o.includes(m.path)):[],[o,t]),d=tn(()=>t.length?t.filter(u=>n.includes(u.path)).slice(0,5):[],[n,t]),c=pt(m=>{r(m)},[r]),s=pt(m=>a(m),[a]),p=pt(m=>{i(m)},[i]),g=pt(m=>{p(m),e(m)},[e,p]);return{navigationItems:t,favoriteItems:l,recentItems:d,toggleFavorite:c,isFavorite:s,navigateToItem:g}}});var rn={};Uo(rn,{default:()=>xi});import{Link as ui,Star as mi}from"lucide-react";import{useCallback as nn,useEffect as gi,useRef as fi}from"react";import{Badge as vi,Command as hi,CommandDialog as yi}from"@donotdev/components";import{useOverlayStore as Kt,useTranslation as bi}from"@donotdev/core";import{jsx as _,jsxs as Ee}from"react/jsx-runtime";var Si,Ci,xi,an=we(()=>{"use strict";Wt();ie();Si=()=>{let{t:e}=bi("dndev"),t=fi(null),o=Kt(u=>u.isCommandDialogOpen),n=Kt(u=>u.closeCommandDialog),{navigationItems:r,favoriteItems:a,recentItems:i,toggleFavorite:l,isFavorite:d,navigateToItem:c}=on();gi(()=>{o&&requestAnimationFrame(()=>{t.current?.focus()})},[o]);let s=nn(u=>{c(u),n()},[c,n]),p=nn((u,y=!0)=>u.map(f=>({label:f.label,value:f.path,description:f.path!==f.label?f.path:void 0,icon:_(z,{icon:f.icon,fallback:ui}),badge:f.badge?_(vi,{children:f.badge}):void 0,onSelect:()=>s(f.path),rightSlot:y?_("button",{type:"button",onClick:h=>{h.stopPropagation(),l(f.path)},className:"dndev-command-favorite-button","data-favorited":d(f.path),"aria-label":d(f.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:_(z,{icon:mi,className:"dndev-size-sm"})}):void 0})),[s,l,d,e]),g=[];if(a.length>0&&g.push({heading:e("globalGoTo.favorites","Favorites"),items:p(a,!1)}),i.length>0){let u=i.flatMap(y=>p([y],!0));u.length>0&&g.push({heading:e("globalGoTo.recent","Recent"),separator:a.length>0,items:u})}g.push({heading:e("globalGoTo.allPages","All Pages"),separator:a.length>0||i.length>0,items:p(r)});let m=r.length>0;return Ee(yi,{open:o,onOpenChange:u=>u?null:n(),children:[_(hi,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:m?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:g}),_("div",{className:"dndev-command-footer",children:Ee("div",{className:"dndev-command-footer-shortcuts",children:[Ee("div",{className:"dndev-command-footer-shortcut",children:[_("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),_("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),Ee("div",{className:"dndev-command-footer-shortcut",children:[_("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),_("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),_("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),Ee("div",{className:"dndev-command-footer-shortcut",children:[_("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),_("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),Ee("div",{className:"dndev-command-footer-shortcut",children:[_("kbd",{className:"dndev-command-footer-key",children:"Esc"}),_("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},Ci=()=>Kt(t=>t.isCommandDialogOpen)?_(Si,{}):null,xi=Ci});import{User as Hs}from"lucide-react";import{Suspense as no,lazy as kn,useState as $s}from"react";import{Button as Ws,BUTTON_VARIANT as Ks,DropdownMenu as Ys,Dialog as qs,DISPLAY as Zs}from"@donotdev/components";import{useTranslation as js}from"@donotdev/core";import{useAuthConfig as Js}from"@donotdev/core";import{getEnabledAuthPartners as Qs}from"@donotdev/core";import{User as Cs,LogOut as xs,Settings as $e,UserCheck as ks,Trash2 as Ts}from"lucide-react";import*as ws from"lucide-react";import vt,{useMemo as Ns,lazy as bn,Suspense as yn}from"react";import{Avatar as Is,Button as As,BUTTON_VARIANT as Ls,DropdownMenu as Ps,Text as Es,DISPLAY as Rs}from"@donotdev/components";import{useTranslation as Ds}from"@donotdev/core";import{getEnabledAuthPartners as Fs,useAuthConfig as Bs,isClient as Ms}from"@donotdev/core";import{useBreakpoint as Os}from"@donotdev/core";import{useNavigate as zs}from"@donotdev/ui/routing/hooks";ie();import{Link as _o}from"lucide-react";import"react";import"@donotdev/components";import{useConsent as Gr}from"@donotdev/core";import{useNavigate as Hr}from"@donotdev/ui/routing/hooks";import{Fragment as $r,jsx as Ne,jsxs as Go}from"react/jsx-runtime";var I=({path:e,replace:t,prefetch:o=!0,children:n,icon:r,label:a,onClick:i,className:l,"aria-label":d,"aria-describedby":c,target:s,rel:p,...g})=>{let m=Hr(),u=Gr("showCookieBanner");if(e==="#cookie-settings")return Go("a",{href:"#cookie-settings",onClick:T=>{T.preventDefault(),T.stopPropagation();try{u()}catch{}i&&i(T)},className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0,...g.style},"aria-label":d||a||"Cookie Settings","aria-describedby":c,...g,children:[r&&Ne(z,{icon:r,fallback:_o}),a&&Ne("span",{children:a}),n]});let y=e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("tel:"),f=C=>{if(y){i&&i(C);return}C.preventDefault(),i&&i(C);let T=e.startsWith("/")?e:`/${e}`;m(T,{replace:t})},h={"aria-label":d||a,"aria-describedby":c},S=Go($r,{children:[r&&Ne(z,{icon:r,fallback:_o}),a&&Ne("span",{children:a}),n]});return y?Ne("a",{href:e,onClick:f,target:s||"_blank",rel:p||"noopener noreferrer",className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0},...h,...g,children:S}):Ne("a",{href:e,onClick:f,className:l,style:{display:r&&a?"flex":void 0,alignItems:r&&a?"center":void 0,gap:r&&a?"var(--gap-sm)":void 0},...h,...g,children:S})};import{useEffect as Wo,useState as ma,lazy as ga,Suspense as fa}from"react";import{Stack as Ko}from"@donotdev/components";import{FEATURE_STATUS as Gt,USER_ROLES as st,SUBSCRIPTION_TIERS as Ht}from"@donotdev/core";import{useRedirectGuard as va,useNavigate as ha}from"@donotdev/ui/routing/hooks";import{RefreshCw as Ho}from"lucide-react";import"react";import{cn as Wr}from"@donotdev/components";import{jsx as Ie}from"react/jsx-runtime";var Kr=({variant:e="fullPage",className:t})=>e==="inline"?Ie("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Ie(Ho,{className:"dndev-size-md",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}})}):Ie("div",{className:Wr("dndev-loading-overlay",t),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--background)",backdropFilter:"blur(4px)",zIndex:50},role:"status","aria-busy":"true","aria-label":"Loading",children:Ie(Ho,{className:"dndev-size-touch",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}})}),Yr=({variant:e="fullPage",className:t,isLoading:o})=>o===!1?null:Ie(Kr,{variant:e,className:t}),qr=e=>Ie(Yr,{...e}),nt=qr;fe();import{Fragment as Yo,jsx as V,jsxs as qo}from"react/jsx-runtime";var ya=ga(()=>Promise.resolve().then(()=>(_t(),Ut)));function ba({auth:e,children:t,fallback:o=nt}){let n=ha(),r=L("user"),a=L("can"),i=L("status"),[l,d]=ma(!1),{shouldRedirect:c,redirectTo:s,isChecking:p}=va({auth:e});return Wo(()=>{let g=setTimeout(()=>{i===Gt.INITIALIZING&&d(!0)},5e3);return()=>clearTimeout(g)},[i]),Wo(()=>{c&&s&&n(s,{replace:!0})},[c,s,n]),e===!1?V(Yo,{children:t}):c||p?V(nt,{}):i===Gt.INITIALIZING&&l?V(Ko,{align:"center",justify:"center",style:{padding:"var(--gap-md)",minHeight:"100vh"},children:qo("div",{className:"dndev-w-full",style:{maxWidth:"28rem",textAlign:"center"},children:[V("h2",{style:{marginBottom:"var(--gap-md)"},children:"Loading is taking longer than usual"}),V("p",{style:{marginBottom:"var(--gap-md)",color:"var(--muted-foreground)"},children:"This might be due to a slow connection. Please wait or try refreshing the page."}),V("button",{onClick:()=>window.location.reload(),style:{padding:"var(--gap-sm) var(--gap-md)",backgroundColor:"var(--primary)",color:"var(--primary-foreground)",border:"none",borderRadius:"var(--radius)",cursor:"pointer"},children:"Refresh Page"})]})}):i===Gt.INITIALIZING?V(o,{}):e&&typeof e=="object"&&e.required&&!r&&a&&!a.navigate(e)?V(Ko,{align:"center",justify:"center",style:{padding:"var(--gap-md)",minHeight:"100vh"},children:qo("div",{className:"dndev-w-full",style:{maxWidth:"28rem"},children:[V("h2",{style:{marginBottom:"var(--gap-md)"},children:"Authentication Required"}),V("p",{style:{marginBottom:"var(--gap-md)"},children:"This page requires authentication. Please accept functional cookies to continue."}),V(fa,{fallback:V("div",{children:"Loading consent..."}),children:V(ya,{})})]})}):V(Yo,{children:t})}function Sa(e){return L("can")?.navigate(e)??!1}var wm=Sa;function Nm(){return L("user")?.role||st.GUEST}function Im(e){return L("user")?.role===e}function Am(){let e=L("user"),t=L("userSubscription"),o=L("loading");return{authenticated:!!e,role:e?.role,tier:t?.tier||"free",loading:o,userId:e?.id}}function Lm(e,t){return n=>V(ba,{auth:t,children:V(e,{...n})})}var Pm={public:()=>!1,required:()=>({required:!0}),user:()=>({required:!0,role:st.USER}),admin:()=>({required:!0,role:st.ADMIN}),tier:e=>({required:!0,tier:e}),pro:()=>({required:!0,tier:Ht.PRO}),premium:()=>({required:!0,tier:Ht.PREMIUM}),adminPro:()=>({required:!0,role:st.ADMIN,tier:Ht.PRO}),custom:e=>({required:!0,validate:e})};import{ArrowLeft as Ua,Lock as _a}from"lucide-react";import{Suspense as Ga,lazy as Ha}from"react";import{Card as $a,Button as Wa,Separator as Ka,Stack as Pe,cn as Ya}from"@donotdev/components";import{useTranslation as qa}from"@donotdev/core";import"@donotdev/core";import{useLocation as Za,useBack as ja}from"@donotdev/ui/routing/hooks";import{Suspense as za}from"react";import{cn as Va}from"@donotdev/components";import{Component as Ca}from"react";import{handleError as xa}from"@donotdev/core";var $t=class extends Ca{constructor(o){super(o);tt(this,"resetError",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,n){xa(o,{userMessage:`A ${this.props.level||"component"} error occurred`,context:{errorInfo:n,component:"DnDevErrorBoundary",level:this.props.level||"component"},showNotification:!1})}render(){return this.state.hasError?this.props.fallback({error:this.state.error,resetError:this.resetError,componentStack:null,eventId:null}):this.props.children}},Zo=$t;import{AlertTriangle as ka,Home as Ta,ArrowLeft as wa,RotateCw as Na,Copy as Ia,Check as Aa}from"lucide-react";import{useEffect as La,useState as Pa}from"react";import{Button as lt,BUTTON_VARIANT as ct,Card as jo,CARD_VARIANT as Jo,Alert as Ea,ALERT_VARIANT as Ra,Stack as Le}from"@donotdev/components";import{handleError as Da,useTranslation as Fa}from"@donotdev/core";import{useLocation as Ba,useBack as Ma}from"@donotdev/ui/routing/hooks";import{jsx as U,jsxs as he}from"react/jsx-runtime";var Oa=({error:e,resetError:t,componentStack:o,eventId:n})=>{let{t:r}=Fa("dndev"),[a,i]=Pa(!1),l=Ma(),c=Ba()?.pathname||(typeof window<"u"?window.location.pathname:"/"),s=e instanceof Error?e.message:"Unknown error",p=e instanceof Error?e.stack:void 0,g=!1;La(()=>{try{Da(e,{userMessage:"Page encountered an error",context:{component:"RouteErrorFallback",location:c}})}catch{}},[e,c]);let m=async()=>{if(!p)return;let f=[`Error: ${s}`,`Timestamp: ${new Date().toISOString()}`,`User Agent: ${navigator.userAgent}`,n?`Event ID: ${n}`:null,`Path: ${c}`,"","Stack Trace:",p,o?`
|
|
2
2
|
Component Stack:`:null,o||null].filter(Boolean).join(`
|
|
3
|
-
`);try{await navigator.clipboard.writeText(f),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},m=()=>{try{t()}catch{typeof window<"u"&&window.location.reload()}},b=()=>{try{l()}catch{typeof window<"u"&&window.history.back()}};return _("div",{className:"dndev-container","data-variant":"standard","data-centered":"true",children:_(jo,{variant:Jo.DEFAULT,elevated:!0,className:"dndev-w-full",style:{maxWidth:"65ch",margin:"0 auto"},children:Se(Re,{gap:"large",align:"center",className:"dndev-text-center",children:[_(Re,{align:"center",justify:"center",style:{width:"5rem",height:"5rem",backgroundColor:"rgba(220, 38, 38, 0.1)",borderRadius:"50%",border:"1px solid var(--destructive)"},children:_(wa,{style:{width:"2.5rem",height:"2.5rem",color:"var(--destructive)"},"aria-hidden":"true"})}),Se(Re,{children:[_("h1",{className:"dndev-text-base","data-level":"h1",style:{fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-bold)",margin:0},children:r("routeError.title","Something went wrong")}),_("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",margin:0},children:r("routeError.description","We encountered an error while loading this page.")}),_(Da,{variant:Fa.SUCCESS,hideIcon:!0,children:_("div",{style:{fontSize:"var(--font-size-sm)",textAlign:"center"},children:r("routeError.dataSafe","Don't worry, your data is safe.")})})]}),n&&Se("code",{style:{padding:"var(--gap-sm) var(--gap-md)",background:"var(--muted)",borderRadius:"var(--radius-full)",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",color:"var(--foreground)"},children:[r("routeError.errorId","Error ID"),": ",n]}),g&&s&&Se(jo,{variant:Jo.MUTED,className:"dndev-w-full",children:[Se(Re,{direction:"row",align:"center",justify:"between",children:[_("span",{className:"dndev-text-base",style:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-semibold)",color:"var(--destructive)"},children:"Error Message:"}),_(dt,{variant:pt.GHOST,icon:a?Ea:Aa,onClick:u,disabled:a,children:a?r("routeError.copied","Copied"):r("routeError.copyDetails","Copy Details")})]}),_("pre",{style:{fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",wordBreak:"break-word",whiteSpace:"pre-wrap",color:"var(--foreground)",margin:0,marginTop:"var(--gap-sm)"},children:s})]}),Se(Re,{className:"dndev-w-full",children:[_(dt,{variant:pt.DESTRUCTIVE,icon:La,onClick:m,fullWidth:!0,children:r("routeError.tryAgain","Try Again")}),Se(Re,{direction:"row",justify:"center",children:[_(N,{path:"/",children:_(dt,{variant:pt.DEFAULT,icon:Na,fullWidth:!0,children:r("routeError.goHome","Go Home")})}),_(dt,{variant:pt.OUTLINE,icon:Ia,onClick:b,fullWidth:!0,children:r("routeError.goBack","Go Back")})]})]}),_("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",margin:0},children:r("routeError.contactSupport","If the problem persists, please contact support.")})]})})})},Qo=Va;import{jsx as He}from"react/jsx-runtime";var ut=({variant:e="standard",density:t,className:o,children:n,centered:r=!0,gapFirst:a=!1})=>He(Zo,{level:"route",fallback:i=>He(Ua,{fallback:He("div",{children:"Loading error fallback..."}),children:He(Qo,{...i})}),children:He("div",{className:_a("dndev-container",o),"data-variant":e,"data-density":t,"data-centered":r?"true":"false","data-gap-first":a?"true":void 0,children:n})});import{Fragment as ei,jsx as B,jsxs as $e}from"react/jsx-runtime";var Xa=Wa(()=>import("@donotdev/auth").then(e=>({default:e.MultipleAuthProviders})));function p1({title:e,description:t,showBackButton:o=!0,onBack:n,className:r=""}){let{t:a}=ja(["auth","common"]),i=Ja(),l=Qa(),d=()=>{n?n():l()};return B(ut,{variant:"docs",children:B(De,{align:"center",justify:"center",className:Za("dndev-min-h-60",r),style:{paddingTop:"var(--gap-lg)",paddingBottom:"var(--gap-lg)"},children:B(Ka,{className:"dndev-w-full",style:{maxWidth:"28rem",border:"none",boxShadow:"var(--shadow-xl)"},title:$e(De,{children:[B(De,{justify:"center",children:B("div",{style:{borderRadius:"9999px",backgroundColor:"color-mix(in oklab, var(--primary) 10%, transparent)",padding:"var(--gap-md)"},children:B(Ha,{className:"dndev-size-touch",style:{color:"var(--primary)"}})})}),B("div",{style:{fontSize:"var(--font-size-2xl)",fontWeight:700},children:a("auth.fallback.title","Authentication Required")}),B("p",{style:{color:"var(--muted-foreground)"},children:a("auth.fallback.description","Please sign in to access this page")})]}),children:$e(De,{children:[$e(De,{gap:"large",children:[B("div",{children:B("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:a("auth.fallback.chooseProvider")})}),B($a,{fallback:B("div",{children:"Loading providers..."}),children:B(Xa,{layout:"vertical",spacing:"tight",fullWidth:!0,ariaLabel:a("auth.fallback.authOptions")})})]}),o&&$e(ei,{children:[B(qa,{}),B("div",{children:B(Ya,{onClick:d,className:"dndev-gap-sm",icon:Ga,children:a("common.back")})})]}),$e(De,{gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:[B("p",{children:a("auth.fallback.secure")}),B("p",{children:a("auth.fallback.terms")})]})]})})})})}import{Search as ti}from"lucide-react";import{Button as oi,BUTTON_VARIANT as ni,DISPLAY as ri}from"@donotdev/components";import{useOverlayStore as ai,useTranslation as ii}from"@donotdev/core";import{jsx as si,jsxs as li}from"react/jsx-runtime";var h1=({display:e=ri.AUTO,className:t,onOpen:o})=>{let{t:n}=ii("dndev"),r=ai(d=>d.openCommandDialog),i=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgentData?.platform??navigator.platform)?"\u2318K":"Ctrl+K",l=()=>{r(),o?.()};return li(oi,{variant:ni.OUTLINE,display:e,icon:ti,onClick:l,className:t,"aria-label":n("goTo.ariaLabel","Go to page"),children:[n("goTo.label","Go to"),si("kbd",{style:{marginInlineStart:"var(--gap-sm)",padding:"0.125rem 0.375rem",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",opacity:.5},children:i})]})};import{Suspense as wi,lazy as Ni}from"react";import{useEventListener as Ii,useOverlayStore as Li}from"@donotdev/core";import{jsx as sn}from"react/jsx-runtime";var Ai=Ni(()=>Promise.resolve().then(()=>(an(),rn))),Ei=()=>{let e=Li(t=>t.openCommandDialog);return Ii("keydown",t=>{(t.metaKey||t.ctrlKey)&&t.key==="k"&&(t.preventDefault(),e())},{target:document,options:{passive:!1,capture:!1}}),sn(wi,{fallback:null,children:sn(Ai,{})})},Pi=Ei;import{Search as Ri}from"lucide-react";import{useCallback as ln,useEffect as Di,useState as Fi,useRef as Bi}from"react";import{Stack as Mi}from"@donotdev/components";import{useOverlayStore as qt}from"@donotdev/core";import{useTranslation as Oi}from"@donotdev/core";import{jsx as gt,jsxs as _i}from"react/jsx-runtime";var zi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),Vi=()=>{let{t:e}=Oi("dndev"),[t,o]=Fi(""),n=Bi(null),r=qt(l=>l.isCommandDialogOpen);Di(()=>{r||o("")},[r]);let a=ln(()=>{qt.getState().openCommandDialog(t)},[t]),i=ln(l=>{l.key==="Enter"&&(l.preventDefault(),qt.getState().openCommandDialog(t))},[t]);return _i(Mi,{direction:"row",align:"center",className:"dndev-relative dndev-w-full dndev-max-w-sm",role:"search",children:[gt(Ri,{className:"dndev-absolute dndev-size-md",style:{insetInlineStart:"0.75rem",opacity:.5},"aria-hidden":"true"}),gt("input",{ref:n,type:"text",value:t,onChange:l=>o(l.target.value),onFocus:a,onKeyDown:i,placeholder:e("globalGoTo.searchPlaceholder","Search pages..."),className:"dndev-input dndev-w-full",style:{paddingInlineStart:"2.5rem",paddingInlineEnd:"5rem"},"aria-label":e("globalGoTo.ariaLabel","Search navigation")}),gt("div",{className:"dndev-absolute dndev-flex dndev-items-center dndev-text-sm",style:{insetInlineEnd:"0.75rem",gap:"0.25rem",opacity:.5},"aria-hidden":"true",children:gt("kbd",{style:{padding:"0.25rem 0.5rem",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",borderRadius:"var(--radius-sm)"},children:zi?"\u2318K":"Ctrl+K"})})]})},Ui=Vi;import{MoreHorizontal as Gi,Link as cn}from"lucide-react";import{useState as Hi,useEffect as dn,useRef as $i,useMemo as Wi}from"react";import{NavigationMenu as pn,NavigationMenuListPrimitive as Ki,NavigationMenuItemPrimitive as un,Button as Yi,DropdownMenu as qi,cn as ft,DISPLAY as Zi}from"@donotdev/components";import{useTranslation as ji}from"@donotdev/core";Ce();le();import{jsx as J,jsxs as Zt}from"react/jsx-runtime";var mn=({routes:e,vertical:t=!1,display:o=Zi.AUTO,overflowDetection:n=!1,showIcons:r=!0,className:a,style:i})=>{let{t:l}=ji("dndev"),d=K(),c=e??d,s=$i(null),[p,g]=Hi(c.length),u=Wi(()=>c.map(m=>({label:m.label,path:m.path,icon:J(V,{icon:m.icon,fallback:cn}),children:m.children?m.children.map(b=>({label:b.label,path:b.path,icon:J(V,{icon:b.icon,fallback:cn})})):void 0})),[c]);if(dn(()=>{if(!n||c.length===0||t)return;let m=()=>{let f=s.current;if(!f)return;let v=f.getBoundingClientRect(),h=f.querySelectorAll("[data-nav-item]"),T=f.querySelector("[data-more-button]"),C=0,I=T?.offsetWidth||0;for(let P=0;P<h.length;P++){let w=h[P];if(!w)break;if(w.getBoundingClientRect().right-v.left+(P===h.length-1&&T?I:0)<=v.width)C=P+1;else break}g(Math.max(0,C))},b=new ResizeObserver(m);return s.current&&b.observe(s.current),setTimeout(m,0),()=>b.disconnect()},[n,c.length,t]),dn(()=>{n&&!t&&g(c.length)},[c.length,n,t]),c.length===0)return null;if(n&&!t){let m=u.slice(0,p),b=u.slice(p);return J(pn,{className:ft(a),style:i||{flex:1},children:Zt(Ki,{ref:s,"data-vertical":"false",style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)",flexWrap:"nowrap",overflow:"hidden"},children:[m.filter(f=>f.path).map((f,v)=>J(un,{"data-nav-item":!0,children:Zt(N,{path:f.path,className:ft("dndev-interactive"),"data-role":"nav-trigger",children:[r&&f.icon,J("span",{className:"dndev-interactive-label",children:f.label})]})},f.path||v)),b.length>0&&J(un,{"data-more-button":!0,children:J(qi,{trigger:J(Yi,{className:"dndev-size-touch",style:{flexShrink:0},"aria-label":l("navigation.more","More"),children:J(Gi,{className:"dndev-size-md"})}),items:b.filter(f=>f.path).map(f=>({label:f.label,children:Zt(N,{path:f.path,className:ft("dndev-interactive"),"data-role":"menu-item",children:[r&&f.icon,J("span",{className:"dndev-interactive-label",children:f.label})]}),asChild:!0})),contentWidth:"14rem",contentAlign:"end"})})]})})}return J(pn,{items:u,vertical:t,display:o,className:ft(a,t&&"dndev-sidebar-nav-menu"),LinkComponent:N})};import{Home as Ji,ArrowLeft as Qi,Link as Xi}from"lucide-react";import{useMemo as es}from"react";import{Button as jt,BUTTON_VARIANT as Jt,Stack as Ke,Text as Qt}from"@donotdev/components";import{useTranslation as ts}from"@donotdev/core";import{useLocation as os,useNavigate as ns}from"@donotdev/ui/routing/hooks";Ce();le();import{jsx as Y,jsxs as vt}from"react/jsx-runtime";function gn(){let{t:e}=ts("dndev"),t=os(),o=ns(),n=K(),r=es(()=>n.filter(i=>!i.path.includes(":")&&i.path!=="/").slice(0,4),[n]),a=()=>{o("back")};return Y(ut,{variant:"docs",centered:!0,children:vt(Ke,{gap:"large",align:"center",justify:"center",children:[vt(Ke,{align:"center",children:[Y(Qt,{level:"h1",style:{fontSize:"clamp(4rem, 12vw, 8rem)",fontWeight:"var(--font-weight-bold)",lineHeight:1,letterSpacing:"-0.02em",background:"linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",margin:0},children:"404"}),Y(Qt,{level:"h2",style:{fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)",margin:0},children:e("errors.notFound.title","Page Not Found")}),Y(Qt,{style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",textAlign:"center",margin:0},children:e("errors.notFound.description","The page you're looking for doesn't exist or has been moved.")}),t.pathname&&Y("code",{style:{padding:"var(--gap-sm) var(--gap-md)",background:"var(--muted)",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-sm)",fontFamily:"var(--font-mono)",color:"var(--foreground)",wordBreak:"break-all",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",border:"1px solid var(--border-hairline)"},children:t.pathname})]}),r.length>0&&vt(Ke,{align:"center",children:[Y("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-semibold)",margin:0,color:"var(--muted-foreground)"},children:e("errors.notFound.suggestions","You might be looking for:")}),Y(Ke,{direction:"row",wrap:"wrap",justify:"center",gap:"tight",children:r.map(i=>Y(N,{path:i.path,replace:!0,children:Y(jt,{variant:Jt.OUTLINE,icon:Y(V,{icon:i.icon,fallback:Xi}),"aria-label":e("errors.notFound.navigateTo",`Navigate to ${i.label}`,{label:i.label}),children:i.label})},i.path))})]}),vt(Ke,{direction:"row",wrap:"wrap",justify:"center",children:[Y(N,{path:"/",replace:!0,children:Y(jt,{variant:Jt.DEFAULT,icon:Ji,"aria-label":e("errors.notFound.goHome","Go to home page"),children:e("errors.notFound.goHome","Go Home")})}),Y(jt,{variant:Jt.OUTLINE,icon:Qi,onClick:a,"aria-label":e("errors.notFound.goBack","Go back to previous page"),children:e("errors.notFound.goBack","Go Back")})]})]})})}Ce();Kt();import{useNavigate as Be,useBack as wg,useRefresh as Ng,usePrefetch as Ig,useLocation as Lg,useParams as Ag,useRouteParam as Eg,useSearchParams as Pg,useMatch as Rg,useQueryParams as Dg,useRedirectGuard as Fg}from"@donotdev/ui/routing/hooks";import{getDndevConfig as Xt,isClient as xe,isDev as fn}from"@donotdev/core";var $=class{static getBrowserSupport(){if(!xe())return{svg:!0,webp:!1,avif:!1};let t=this.cache.get("browser-support");if(t)return t;let o={svg:!0,webp:!1,avif:!1};try{let n=document.createElement("canvas");n.width=1,n.height=1,o.webp=n.toDataURL("image/webp").indexOf("data:image/webp")===0}catch{o.webp=!1}try{let n=document.createElement("canvas");n.width=1,n.height=1,o.avif=n.toDataURL("image/avif").indexOf("data:image/avif")===0}catch{o.avif=!1}return this.cache.set("browser-support",o),o}static extractStringValues(t){let o=[];if(t==null)return o;if(typeof t=="string")o.push(t);else if(Array.isArray(t))for(let n of t)o.push(...this.extractStringValues(n));else if(typeof t=="object")for(let n of Object.values(t))o.push(...this.extractStringValues(n));return o}static assetExists(t){if(!xe())return!1;let o=this.getAssetManifest();return o?this.extractStringValues(o).includes(t):!1}static getAssetManifest(){return xe()&&Xt()?.assets?.mapping||null}static getLogoSvgContent(){return Xt()?.assets?.logoSvgContent||null}static resolveLogo(t){if(t)return t;let o="logo";if(this.cache.has(o))return this.cache.get(o);let r=this.getAssetManifest()?.logo?.optimal||"/logo.svg";return this.cache.set(o,r),r}static directAssetCheck(t){if(!xe())return!1;try{let o=new Image;return o.src=t,!0}catch{return!1}}static resolveFaviconSet(){let t="favicon-set";if(this.cache.has(t))return this.cache.get(t);let o=this.getAssetManifest();if(o?.favicon?.set){let a=o.favicon.set,i=this.assetExists("/icon-512x512.png")?"/icon-512x512.png":this.assetExists("/icon-192x192.png")?"/icon-192x192.png":"/logo.svg",l={svg:a.svg||"/favicon.svg",ico:a.ico||"/favicon.ico",png16:a.png16||i,png32:a.png32||i,apple180:a.apple180||i,android192:a.android192||i,android512:a.android512||i};return this.cache.set(t,l),l}let n=this.assetExists("/icon-512x512.png")?"/icon-512x512.png":this.assetExists("/icon-192x192.png")?"/icon-192x192.png":"/logo.svg",r={svg:this.assetExists("/favicon.svg")?"/favicon.svg":"/logo.svg",ico:this.assetExists("/favicon.ico")?"/favicon.ico":"/favicon.svg",png16:this.assetExists("/favicon-16x16.png")?"/favicon-16x16.png":n,png32:this.assetExists("/favicon-32x32.png")?"/favicon-32x32.png":n,apple180:this.assetExists("/apple-touch-icon.png")?"/apple-touch-icon.png":n,android192:this.assetExists("/icon-192x192.png")?"/icon-192x192.png":n,android512:this.assetExists("/icon-512x512.png")?"/icon-512x512.png":n};return this.cache.set(t,r),r}static resolveFavicon(){let t=this.getAssetManifest();if(t?.favicon?.optimal)return t.favicon.optimal;let o=["/favicon.svg","/favicon.ico","/favicon.png","/logo.svg"];for(let n of o)if(this.assetExists(n))return n;return"/favicon.svg"}static clearCache(){this.cache.clear(),fn()&&xe()}static getDebugInfo(){return{browserSupport:this.getBrowserSupport(),detectedAssets:xe()?Xt()?.assets?.mapping:null,assetManifest:this.getAssetManifest(),cache:Object.fromEntries(this.cache)}}};nt($,"cache",new Map);function zg(e){return $.resolveLogo(e)}function Vg(){return $.resolveFaviconSet()}fn()&&($.clearCache(),xe()&&window.addEventListener("DOMContentLoaded",()=>{$.clearCache()}));import*as rs from"@donotdev/crud";var vn={forms:{},startSubmit:()=>{},setUploading:()=>{},setValidating:()=>{},setSubmitting:()=>{},setSuccess:()=>{},setError:()=>{},reset:()=>{},cleanup:()=>{},setIsDirty:(e,t)=>{},hasDirtyForms:()=>!1,getDirtyFormIds:()=>[],getStatus:()=>"idle",isLoading:()=>!1,getUploadProgress:()=>0,getError:()=>null,getIsDirty:()=>!1},Me=rs?.useFormStore,Gg=typeof Me=="function";function as(e){return Me?Me(e):e(vn)}as.getState=()=>Me&&typeof Me.getState=="function"?Me.getState():vn;ye();import{useMemo as is}from"react";function ht(){let e=L("status"),t=L("isAvailable"),o=L("user");return is(()=>({shouldHide:e!=="ready"||!t,isLoading:e==="initializing",isReady:e==="ready"&&t,isAuthenticated:!!o}),[e,t,o])}import*as ss from"@donotdev/billing";import{DEGRADED_BILLING_API as ls}from"@donotdev/core";var eo=ss?.useStripeBilling;function cs(e){return ls[e]}function to(e,t){return eo?eo(e,t):cs(e)}var qg=typeof eo=="function";ye();function Qg(){let e=L("user"),t=L("status"),o={user:e,status:t},n=to("status",o),r=to("isAvailable",o);return{shouldHide:!r,isLoading:n==="initializing",isReady:r&&n==="ready"}}import{DEGRADED_OAUTH_API as ds}from"@donotdev/core";import*as ps from"@donotdev/oauth";var oo=ps?.useOAuth;function us(e){return ds[e]}function tf(e){return oo?oo(e):us(e)}var of=typeof oo=="function";import{CheckCircle as ms}from"lucide-react";import{List as gs}from"@donotdev/components";import{translateArray as fs}from"@donotdev/core";import{jsx as hn}from"react/jsx-runtime";var vs=ms,hs=16;function lf(e,t,o,n=vs,r=hs){let a=n;return hn(gs,{icon:a?hn(a,{size:r}):void 0,items:fs(e,t,o),style:{listStyle:"none",paddingInlineStart:0}})}var ys=/<script[\s\S]*?<\/script>/gi,bs=/<foreignObject[\s\S]*?<\/foreignObject>/gi,Ss=/\s+on\w+\s*=\s*["'][^"']*["']/gi,Cs=/\s+(?:xlink:)?href\s*=\s*["']\s*javascript:[^"']*["']/gi,xs=/\s+(?:xlink:)?href\s*=\s*["']\s*data:(?!image\/(?:png|jpe?g|gif|webp|svg\+xml))[^"']*["']/gi;function Oe(e){return e.replace(ys,"").replace(bs,"").replace(Ss,"").replace(Cs,"").replace(xs,"")}import{Fragment as Hs,jsx as pe,jsxs as $s}from"react/jsx-runtime";var Sn=()=>null,_s=bn(async()=>{try{return{default:(await import("@donotdev/auth")).ReauthDialog}}catch{return{default:Sn}}}),Gs=bn(async()=>{try{return{default:(await import("@donotdev/auth")).ConfirmDeleteDialog}}catch{return{default:Sn}}}),Cn=()=>{let[e]=yt.useState(!1),[t]=yt.useState(!1),[o]=yt.useState(!1),[n]=yt.useState(null);return{showConfirmDialog:e,showPasswordDialog:t,isDeleting:o,error:n,startDeleteFlow:()=>{},confirmDelete:async()=>{},cancel:()=>{}}};zs()&&import("@donotdev/auth").then(e=>{Cn=e.useDeleteAccount}).catch(e=>{});var bt=e=>{if(!e)return Ye;if(typeof e=="function")return e;let t=e.replace(/['"]/g,"");return Is[t]||Ye},no=({loginPath:e,display:t=Fs.AUTO,"no-tooltip":o=!1,customItems:n=[],className:r,style:a})=>{let{t:i}=Bs("dndev"),{shouldHide:l,isReady:d,isAuthenticated:c}=ht(),s=Os(),p=L("user"),g=L("signOut"),u=Vs("isLaptop"),m=K(),b=Us(),f=s.profilePath,v=s.authMenuItems||[],h=Cn(),T=()=>p&&(p.displayName||p.email?.split("@")[0])||"User",C=()=>T().split(" ").map(y=>y.charAt(0)).slice(0,2).join("").toUpperCase(),I=()=>{if(!p)return i("auth.userMenu",{defaultValue:"User menu"});let k=[T()];return p.email&&k.push(p.email),D&&D!=="guest"&&k.push(`Role: ${D}`),k.join(`
|
|
4
|
-
`)},
|
|
5
|
-
${p.email}`:""}`}),disabled:!0}),f&&k.push({label:i("auth.profile",{defaultValue:"Profile"}),icon:ks,onClick:()=>b(f)}),v.forEach(y=>{let S=m.find(E=>E.path===y.path),x=y.label||S?.label||y.path.split("/").pop()||"Menu",A=y.icon?bt(y.icon):S?.icon&&(typeof S.icon=="string"||typeof S.icon=="function")?bt(S.icon):Ye;k.push({label:x,icon:A,onClick:()=>b(y.path)})}),n.forEach(y=>{if(y.path){let S=m.find(E=>E.path===y.path),x=y.label||S?.label||y.path.split("/").pop()||"Menu",A=y.icon?bt(y.icon):Ye;k.push({label:x,icon:A,onClick:()=>b(y.path),disabled:y.disabled,style:y.style})}else if(y.onClick){let S=y.icon?bt(y.icon):Ye;k.push({label:y.label,icon:S,onClick:y.onClick,disabled:y.disabled,style:y.style})}}),k.push({label:i("auth.deleteAccount.label",{defaultValue:"Delete Account"}),icon:Ns,onClick:h.startDeleteFlow,variant:"destructive"}),k.push({label:i("auth.signOut",{defaultValue:"Sign Out"}),icon:Ts,onClick:()=>g(),variant:"destructive"}),k},[f,v,n,g,h,i,m,u,p,T,b]);if(Ms().length===0||l||!d)return null;let D=p?.role;return c?$s(Hs,{children:[pe(yn,{fallback:null,children:pe(_s,{open:h.showPasswordDialog,isLoading:h.isDeleting,error:h.error,onReauth:k=>h.confirmDelete(k),onCancel:h.cancel})}),pe(yn,{fallback:null,children:pe(Gs,{open:h.showConfirmDialog,isLoading:h.isDeleting,error:h.error,onConfirm:()=>h.confirmDelete(),onCancel:h.cancel})}),pe(Rs,{trigger:pe(Es,{variant:Ps.OUTLINE,icon:p?pe(As,{src:p.photoURL??void 0,fallback:C(),alt:T(),style:{margin:"-4px 0"}}):ws,display:t,"aria-label":i("auth.userMenu",{defaultValue:"User menu"}),tooltip:!o&&u&&p?I():o?void 0:i("auth.userMenu",{defaultValue:"User menu"}),className:r,style:a,children:T()}),items:P,contentAlign:"end"})]}):null};import{jsx as z}from"react/jsx-runtime";var Tn=()=>null,tl=kn(async()=>{try{return{default:(await import("@donotdev/auth")).AuthPartnerButton}}catch{return{default:Tn}}}),xn=kn(async()=>{try{return{default:(await import("@donotdev/auth")).MultipleAuthProviders}}catch{return{default:Tn}}}),ao=({display:e=Js.AUTO,className:t,style:o})=>{let{t:n}=Qs("dndev"),{shouldHide:r,isLoading:a,isReady:i,isAuthenticated:l}=ht(),d=Xs(),c=el(),[s,p]=Ks(!1),g=d.loginPath,u=n("auth.signIn",{defaultValue:"Sign In"}),m=n("auth.loading",{defaultValue:"Loading..."}),b=c.includes("password")||c.includes("emailLink");if(r||!i)return null;let f=({children:v,...h})=>z(Ys,{variant:qs.OUTLINE,icon:Ws,display:e,tooltip:u,className:t,style:o,...h,children:v??u});if(!l){if(g!==void 0)return z(N,{path:g,prefetch:!0,children:z(f,{})});let v=c[0];return b?z(js,{trigger:z(f,{}),title:u,open:s,onOpenChange:p,"data-content-size":"form",children:z(ro,{fallback:z("div",{style:{padding:"var(--gap-md)",fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:m}),children:z(xn,{spacing:"medium",onSuccess:()=>p(!1)})})}):c.length>1?z(Zs,{trigger:z(f,{}),children:z(ro,{fallback:z("div",{style:{padding:"var(--gap-md)",fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:m}),children:z(xn,{spacing:"tight"})})}):z(ro,{fallback:z(f,{disabled:a,tooltip:a?m:u,children:a?m:u}),children:z(tl,{partnerId:v,display:e,className:t,style:o})})}return z(no,{display:e,loginPath:g,className:t,style:o})};import{RefreshCw as ol}from"lucide-react";import{cn as nl}from"@donotdev/components";import{jsx as wn,jsxs as il}from"react/jsx-runtime";var rl=({className:e})=>il("div",{className:nl("dndev-loading-overlay",e),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--background)",opacity:"var(--opacity-muted)",backdropFilter:"blur(4px)",zIndex:50},role:"status","aria-busy":"true","aria-label":"Loading",children:[wn(ol,{className:"dndev-size-touch",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}}),wn("span",{className:"dndev-sr-only",children:"Loading..."})]}),al=rl;import{AlertCircle as sl,RefreshCw as ll,Mail as cl,Cookie as dl}from"lucide-react";import{Card as pl,Button as io,BUTTON_VARIANT as so,Stack as Nn}from"@donotdev/components";import{useTranslation as ul}from"@donotdev/core";import{jsx as qe,jsxs as St}from"react/jsx-runtime";function ml({featureName:e,title:t,description:o,showReviewCookies:n=!1,showContactSupport:r=!0,showRetry:a=!1,supportEmail:i="support@example.com",onRetry:l,onReviewCookies:d,customActions:c,className:s=""}){let{t:p}=ul("ui"),g=o||p("featureDisabled.description","{featureName} is not available. This may be due to missing configuration or disabled features.",{featureName:e}),u=()=>{if(d)d();else{let b=new CustomEvent("openCookieConsent");window.dispatchEvent(b)}},m=()=>{window.location.href=`mailto:${i}?subject=${encodeURIComponent(`Feature Unavailable: ${e}`)}&body=${encodeURIComponent(`I'm experiencing an issue with ${e} not being available.`)}`};return St(pl,{className:s,title:St(Nn,{direction:"row",align:"center",gap:"tight",children:[qe(sl,{className:"dndev-size-md",style:{color:"var(--destructive)"}}),t||e]}),subtitle:g,children:[" ",St("div",{style:{display:"grid",gap:"var(--gap-md)"},children:[(n||r||a||c)&&St(Nn,{direction:"row",wrap:"wrap",gap:"tight",children:[n&&qe(io,{variant:so.OUTLINE,onClick:u,icon:dl,children:p("featureDisabled.reviewCookies","Review Cookies")}),r&&qe(io,{variant:so.OUTLINE,onClick:m,icon:cl,children:p("featureDisabled.contactSupport","Contact Support")}),a&&qe(io,{variant:so.OUTLINE,onClick:l,icon:ll,children:p("featureDisabled.retry","Retry")}),c]}),qe("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:p("featureDisabled.helpText","If you believe this is an error, please contact support or try refreshing the page.")})]})]})}var gl=ml;le();import{cn as fl}from"@donotdev/components";import{jsx as Q,jsxs as Tl}from"react/jsx-runtime";var ne=({state:e="loading",message:t,show:o=!0,className:n,showSpinner:r=!1,spinnerSize:a="md"})=>{if(!o)return null;let l=t||(c=>({initial:"Preparing...",loading:"Loading...",processing:"Processing your request...","almost-done":"Almost there...",complete:"Complete!"})[c]||"Loading...")(e),d={sm:{width:"0.75rem",height:"0.75rem"},md:{width:"1rem",height:"1rem"},lg:{width:"1.5rem",height:"1.5rem"}};return Tl("div",{className:fl(n),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--gap-sm)",color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)",transition:"opacity var(--dur-fast) ease-out"},role:"status","aria-live":"polite","aria-label":l,children:[r&&Q("div",{style:{...d[a],animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid currentColor",borderTopColor:"transparent"},role:"status","aria-hidden":"true"}),Q("span",{style:{fontWeight:500},children:l})]})},vl=({message:e="Loading...",...t})=>Q(ne,{state:"loading",message:e,...t}),hl=({message:e="Processing your request...",...t})=>Q(ne,{state:"processing",message:e,...t}),yl=({message:e="Almost there...",...t})=>Q(ne,{state:"almost-done",message:e,...t}),bl=({message:e="Complete!",...t})=>Q(ne,{state:"complete",message:e,...t}),Sl=({showSpinner:e=!0,...t})=>Q(ne,{state:"processing",message:"Saving your changes...",showSpinner:e,...t}),Cl=({showSpinner:e=!0,fileName:t,...o})=>Q(ne,{state:"processing",message:t?`Uploading ${t}...`:"Uploading file...",showSpinner:e,...o}),xl=({showSpinner:e=!0,query:t,...o})=>Q(ne,{state:"processing",message:t?`Searching for "${t}"...`:"Searching...",showSpinner:e,...o}),kl=({showSpinner:e=!0,...t})=>Q(ne,{state:"loading",message:"Connecting to server...",showSpinner:e,...t}),Ct=ne;import{cn as wl}from"@donotdev/components";import{Fragment as In,jsx as ue,jsxs as Ln}from"react/jsx-runtime";var Nl=({show:e=!1,backdrop:t=!0,backdropBlur:o=!0,className:n,children:r,message:a,showSpinner:i=!0,spinnerSize:l="lg",preventClicks:d=!0,zIndex:c="var(--z-modal)"})=>{if(!e)return null;let s=c==="var(--z-modal)"||!c?"dndev-z-modal":c==="var(--z-toast)"?"dndev-z-toast":c==="var(--z-tooltip)"?"dndev-z-tooltip":c==="var(--z-overlay)"?"dndev-z-overlay":null;return ue("div",{className:wl("dndev-loading-overlay",s,n),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity var(--dur-fast) ease-out",backgroundColor:t?"var(--background)":"transparent",opacity:t?"var(--opacity-muted)":1,backdropFilter:o?"blur(4px)":"none",pointerEvents:d?"auto":"none",...s?{}:{zIndex:c}},role:"dialog","aria-modal":"true","aria-busy":"true","aria-label":"Loading overlay",children:ue("div",{className:"dndev-surface",style:{display:"grid",placeItems:"center",gap:"var(--gap-md)",borderRadius:"var(--radius-lg)",padding:"var(--gap-lg)",backgroundColor:"var(--background)",opacity:"var(--opacity-strong)",border:"1px solid var(--border)",boxShadow:"var(--shadow-xl)",maxWidth:"var(--content-text)",width:"100%",margin:"0 var(--gap-md)"},children:r||Ln(In,{children:[i&&ue("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--primary)",borderTopColor:"transparent",width:l==="sm"?"2rem":l==="md"?"3rem":"4rem",height:l==="sm"?"2rem":l==="md"?"3rem":"4rem"},role:"status","aria-hidden":"true"}),a&&ue(Ct,{...a})]})})})};var Il=({show:e=!1,backdrop:t=!1,backdropBlur:o=!1,className:n,...r})=>ue("div",{className:n,style:{position:"absolute",inset:0,display:e?"flex":"none",alignItems:"center",justifyContent:"center",transition:"opacity var(--dur-fast) ease-out",backgroundColor:t?"var(--background)":"transparent",opacity:t?"var(--opacity-muted)":1,backdropFilter:o?"blur(4px)":"none"},role:"status","aria-busy":"true","aria-label":"Loading content",children:ue("div",{style:{display:"grid",placeItems:"center",gap:"var(--gap-sm)"},children:r.children||Ln(In,{children:[ue("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--primary)",borderTopColor:"transparent",width:"1.5rem",height:"1.5rem"},role:"status","aria-hidden":"true"}),r.message&&ue(Ct,{...r.message})]})})}),Ll=Nl;import{cn as Al}from"@donotdev/components";import{jsx as An}from"react/jsx-runtime";var El=({variant:e="fullPage",className:t,isLoading:o})=>o===!1?null:An("div",{className:Al(t),style:{display:"flex",alignItems:"center",justifyContent:"center",...e==="fullPage"&&{position:"fixed",inset:0,backgroundColor:"var(--background)",backdropFilter:"blur(4px)",zIndex:50}},role:"status","aria-busy":"true","aria-label":"Loading",children:An("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--muted)",borderTopColor:"var(--primary)",...e==="fullPage"?{width:"5rem",height:"5rem"}:{width:"var(--icon-md)",height:"var(--icon-md)"}},role:"status","aria-busy":"true","aria-label":"Loading"})}),Pl=El;import{Lock as xt,Shield as En}from"lucide-react";import{useEffect as lo,useRef as Pn,useCallback as Rl}from"react";import{Portal as Dl,Spinner as Fl,Stack as Bl,Text as Ze,Button as Ml}from"@donotdev/components";import{useTranslation as Ol,useOverlay as re}from"@donotdev/core";import{jsx as X,jsxs as Dn}from"react/jsx-runtime";var Rn={connecting:0,preparing:2e3,redirecting:5e3},zl=1e4;function Vl(e,t){return t==="none"?null:t==="shield"?En:t==="lock"?xt:e?e.startsWith("stripe-")||e.includes("payment")||e.includes("checkout")?xt:e.startsWith("oauth-")||e.startsWith("auth-")?En:xt:xt}function Ul(e){return e||"default"}function _l(){let{t:e}=Ol("dndev"),t=re("isRedirectOverlayOpen"),o=re("redirectOperation"),n=re("redirectPhase"),r=re("showCancelButton"),a=re("redirectConfig"),i=re("redirectStartTime"),l=re("setRedirectPhase"),d=re("setShowCancelButton"),c=re("hideRedirectOverlay"),s=Pn([]),p=Pn(null),g=Rl(()=>{c()},[c]);if(lo(()=>{if(!t||!i)return;let C=a?.cancelTimeout??zl,I=Date.now()-i;s.current.forEach(clearTimeout),s.current=[],p.current&&(clearTimeout(p.current),p.current=null);let P=(D,k)=>{let y=Math.max(0,k-I);if(y>0){let S=setTimeout(()=>{l(D)},y);s.current.push(S)}else l(D)};P("preparing",Rn.preparing),P("redirecting",Rn.redirecting);let w=Math.max(0,C-I);return p.current=setTimeout(()=>{d(!0),l("timeout")},w),()=>{s.current.forEach(clearTimeout),s.current=[],p.current&&(clearTimeout(p.current),p.current=null)}},[t,i,a?.cancelTimeout,l,d]),lo(()=>{if(!t)return;let C=()=>{c()};return window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[t,c]),lo(()=>{if(!t)return;let C=()=>{};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[t]),!t)return null;let u=Ul(o),m=a?.title??e(`redirectOverlay.${u}.title`,{defaultValue:e("redirectOverlay.default.title")}),b=a?.message??e(`redirectOverlay.${u}.message`,{defaultValue:e("redirectOverlay.default.message")}),f=a?.subtitle??e(`redirectOverlay.${u}.subtitle`,{defaultValue:e("redirectOverlay.default.subtitle")}),v=e(`redirectOverlay.${u}.ariaLabel`,{defaultValue:e("redirectOverlay.default.ariaLabel")}),h=e(`redirectOverlay.phases.${n}`),T=Vl(o,a?.icon);return X(Dl,{children:X("div",{className:"dndev-spinner-overlay",role:"status","aria-busy":"true","aria-label":v,style:{zIndex:"var(--z-overlay, 9999)"},children:Dn("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--gap-md)",textAlign:"center",maxWidth:"400px",padding:"var(--gap-lg)"},children:[Dn(Bl,{direction:"row",align:"center",children:[T&&X(T,{style:{width:"1.5rem",height:"1.5rem",color:"var(--primary)"},"aria-hidden":"true"}),X(Fl,{variant:"primary"})]}),X(Ze,{as:"h3",style:{color:"var(--foreground)",margin:0},children:m}),X(Ze,{variant:"muted",style:{color:"var(--foreground)",minHeight:"1.5em"},children:h}),X(Ze,{variant:"muted",level:"small",style:{opacity:.8},children:b}),X(Ze,{variant:"muted",level:"small",style:{opacity:.6},children:f}),X(Ze,{variant:"muted",level:"small",style:{opacity:.5,marginTop:"var(--gap-sm)"},children:e("redirectOverlay.doNotRefresh")}),r&&X(Ml,{variant:"ghost",onClick:g,style:{marginTop:"var(--gap-md)"},children:e("redirectOverlay.cancel")})]})})})}import{useEffect as co,useState as Fn}from"react";import{cn as Gl}from"@donotdev/components";import{jsx as Bn}from"react/jsx-runtime";var Hl=({isActive:e=!1,progress:t,useFakeProgress:o=!0,duration:n=2e3,className:r,show:a=!0})=>{let[i,l]=Fn(0),[d,c]=Fn(!1);co(()=>{if(!e||!o||t!==void 0)return;c(!0),l(0);let p=Date.now(),g=setInterval(()=>{let u=Date.now()-p,m=Math.min(u/n*90,90);l(m)},16);return()=>{clearInterval(g)}},[e,o,t,n]),co(()=>{t!==void 0&&c(t>0&&t<100)},[t]),co(()=>{if(!e){let p=setTimeout(()=>{c(!1),l(0)},300);return()=>clearTimeout(p)}},[e]);let s=t??i;return!a||!d?null:Bn("div",{className:Gl(r),style:{position:"fixed",insetInlineStart:0,insetInlineEnd:0,zIndex:9999,height:"4px",backgroundColor:"transparent",top:"var(--header-height, 0px)"},role:"progressbar","aria-valuenow":Math.round(s),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Page loading progress",children:Bn("div",{style:{height:"100%",width:`${s}%`,background:"linear-gradient(to right, var(--primary), color-mix(in srgb, var(--primary) 80%, transparent), color-mix(in srgb, var(--primary) 60%, transparent))",transition:e?"width 0.3s ease-out":"width 0.2s ease-in",boxShadow:"var(--shadow-sm)"}})})},$l=Hl;import{cn as kt,Stack as Wl}from"@donotdev/components";import{jsx as je,jsxs as v2}from"react/jsx-runtime";var Kl=({variant:e="text",width:t,height:o,lines:n=1,show:r=!0,className:a,animation:i="pulse",style:l})=>{if(!r)return null;let d={backgroundColor:"var(--muted)",opacity:"var(--opacity-muted)",borderRadius:"var(--radius)",animation:i==="pulse"||i==="wave"?"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite":"none",...i==="wave"&&{background:"linear-gradient(to right, color-mix(in srgb, var(--muted) 50%, transparent), color-mix(in srgb, var(--muted) 30%, transparent), color-mix(in srgb, var(--muted) 50%, transparent))"}},c=()=>{let s={};return t&&(s.width=typeof t=="number"?`${t}px`:t),o&&(s.height=typeof o=="number"?`${o}px`:o),s};return e==="text"?je(Wl,{gap:"tight",children:Array.from({length:n}).map((s,p)=>je("div",{className:kt("dndev-skeleton",a),style:{...d,height:"var(--gap-md)",width:p===n-1?"75%":"100%",...c(),...l}},p))}):e==="circular"?je("div",{className:kt("dndev-skeleton",a),style:{...d,borderRadius:"var(--radius-full)",width:t||o||"40px",height:o||t||"40px",...c(),...l}}):e==="rectangular"?je("div",{className:kt("dndev-skeleton",a),style:{...d,width:t||"100%",height:o||"200px",...c(),...l}}):je("div",{className:kt("dndev-skeleton",a),style:{...d,borderRadius:"var(--radius-lg)",width:t||"100%",height:o||"20px",...c(),...l}})};var Yl=Kl;import{Card as ql,IconBox as Zl,Stack as jl,Text as po,renderCardContent as Jl}from"@donotdev/components";import{jsx as ee,jsxs as Mn}from"react/jsx-runtime";var Ql=({icon:e,title:t,subtitle:o,content:n,href:r,variant:a,elevated:i,onClick:l,className:d,footer:c,style:s,clickable:p,...g})=>{let u=Jl(n),f=`calc(var(--font-size-lg) * var(--line-height) * 2 + var(--gap-md)) calc(var(--font-size-base) * var(--line-height) * 2 + var(--gap-md)) 1fr${c?" auto":""}`,v={display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",lineHeight:"var(--line-height)"},h={...v,fontSize:"var(--font-size-lg)",fontWeight:600,color:"inherit",margin:0,textAlign:"start",flex:1,minWidth:0},T={...v,fontSize:"var(--font-size-base)",fontWeight:600,color:"var(--muted-foreground)",margin:0},C=e?Mn(jl,{direction:"row",align:"center",style:{width:"100%"},children:[ee(Zl,{icon:e}),ee(po,{as:"div",level:"h3",style:h,children:t})]}):ee(po,{as:"div",level:"h3",style:h,children:t}),I=ee(ql,{variant:a,elevated:i,onClick:l,className:d,"data-clickable":r||l||p?"true":void 0,style:{paddingInlineStart:"var(--gap-md)",paddingInlineEnd:"var(--gap-md)",gap:"var(--gap-md)",height:"100%",textAlign:"start",...s},...g,children:Mn("div",{style:{display:"grid",gridTemplateRows:f,gap:"var(--gap-md)",width:"100%"},children:[ee("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:C}),ee("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start"},children:ee(po,{as:"div",level:"body",style:T,children:o})}),ee("div",{children:u}),c&&ee("div",{children:c})]})});return r&&!l?ee(N,{path:r,style:{display:"block",textDecoration:"none",height:"100%"},"aria-label":t?`Learn more about ${t}`:void 0,children:I}):I},Xl=Ql;import{useState as dc}from"react";import{Bento as pc,Card as uc,Section as mc,Stack as gc,Text as fc,TONE as vc,cn as hc}from"@donotdev/components";var ec='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#3178C6" d="M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"/></svg>',tc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#61DAFB" d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"/></svg>',oc='<svg role="img" viewBox="0 0 410 404" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="vite-a" x1="6" y1="33" x2="235" y2="344" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="vite-b" x1="195" y1="9" x2="236" y2="293" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset=".08" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs><path fill="url(#vite-a)" d="M399.641 59.525 215.643 388.545c-3.799 6.793-13.559 6.833-17.415.073L10.582 59.556c-4.201-7.366 2.098-16.29 10.446-14.797l184.195 32.923c1.175.21 2.378.208 3.553-.006l180.343-32.87c8.32-1.517 14.649 7.337 10.522 14.72z"/><path fill="url(#vite-b)" d="M292.965 1.574 156.801 28.255c-2.238.439-3.895 2.335-4.03 4.611l-8.376 141.465c-.197 3.332 2.863 5.918 6.115 5.168l37.91-8.749c3.547-.818 6.752 2.306 6.023 5.873l-11.263 55.153c-.758 3.712 2.727 6.886 6.352 5.785l23.415-7.114c3.63-1.102 7.118 2.081 6.35 5.796l-17.899 86.633c-1.12 5.42 6.088 8.374 9.094 3.728l2.008-3.103 110.954-221.428c1.858-3.707-1.346-7.935-5.418-7.15l-39.022 7.532c-3.667.707-6.787-2.708-5.752-6.296l25.469-88.291c1.036-3.594-2.095-6.612-5.764-5.891z"/></svg>',nc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M18.665 21.978C16.758 23.255 14.465 24 12 24 5.377 24 0 18.623 0 12S5.377 0 12 0s12 5.377 12 12c0 3.583-1.574 6.801-4.067 9.001L9.219 7.2H7.2v9.596h1.615V9.251l9.85 12.727Zm-3.332-8.533 1.6 2.061V7.2h-1.6v6.245Z"/></svg>',rc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#339933" d="M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"/></svg>',ac='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#DD2C00" d="M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"/></svg>',ic='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="m12 1.608 12 20.784H0Z"/></svg>',sc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#635BFF" d="M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"/></svg>',lc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><linearGradient id="vb-a" x1="0.414" y1="0.255" x2="0" y2="0.932" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#eab308"/><stop offset="1" stop-color="#ca8a04"/></linearGradient><linearGradient id="vb-b" x1="0.338" y1="0.02" x2="0.664" y2="0.966" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#fde68a"/><stop offset="1" stop-color="#fbbf24"/></linearGradient><linearGradient id="vb-c" y1="0.5" x2="1" y2="0.5" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#7dd3fc"/><stop offset="1" stop-color="#0ea5e9"/></linearGradient></defs><g transform="translate(-2056 -1899)"><path d="M742.271,987.024c-66.706,0-119.121,54.673-121.874,126.408l-2.551,95.471c-3.967,78.653,71.961,105.52,126.936,105.52Z" transform="translate(1463.458 1004.277)" fill="url(#vb-a)"/><path d="M92.616.01H319.894c54.53-.8,95.624,40.1,98.381,93.335l6.144,135.76c.732,67.368-48.116,94.95-104.525,95.335L92.616,327.374C34.061,327.8-1.063,283.663.022,229.105l3.8-135.76C7.41,33.54,33.3,1.093,92.616.01Z" transform="translate(2118.42 1991.302)" fill="url(#vb-b)"/><path d="M86.844.009H299.958c51.132-.746,89.665,37.307,92.25,86.824l5.761,126.29c.686,62.669-45.117,88.326-98.011,88.685L86.844,304.537C31.938,304.933-1,263.875.02,213.123L3.58,86.834C6.948,31.2,31.222,1.016,86.844.009Z" transform="translate(2136.977 2001.737)" fill="#111827"/><circle cx="27.626" cy="27.626" r="27.626" transform="translate(2421.148 2104.357)" fill="url(#vb-c)"/><circle cx="27.626" cy="27.626" r="27.626" transform="translate(2208.034 2104.357)" fill="url(#vb-c)"/></g></svg>',cc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#FBF0DF" d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083a5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"/></svg>',uo={bun:{svg:`data:image/svg+xml,${encodeURIComponent(cc)}`,color:"#FBF0DF",name:"Bun"},typescript:{svg:`data:image/svg+xml,${encodeURIComponent(ec)}`,color:"#3178C6",name:"TypeScript"},react:{svg:`data:image/svg+xml,${encodeURIComponent(tc)}`,color:"#61DAFB",name:"React"},vite:{svg:`data:image/svg+xml,${encodeURIComponent(oc)}`,color:"#BD34FE",name:"Vite"},nextjs:{svg:`data:image/svg+xml,${encodeURIComponent(nc)}`,color:"var(--foreground, #000000)",name:"Next.js"},nodejs:{svg:`data:image/svg+xml,${encodeURIComponent(rc)}`,color:"#339933",name:"Node.js"},firebase:{svg:`data:image/svg+xml,${encodeURIComponent(ac)}`,color:"#DD2C00",name:"Firebase"},vercel:{svg:`data:image/svg+xml,${encodeURIComponent(ic)}`,color:"var(--foreground, #000000)",name:"Vercel"},stripe:{svg:`data:image/svg+xml,${encodeURIComponent(sc)}`,color:"#635BFF",name:"Stripe"},valibot:{svg:`data:image/svg+xml,${encodeURIComponent(lc)}`,color:"#FBBF24",name:"Valibot"}};import{jsx as ke,jsxs as Cc}from"react/jsx-runtime";function yc({techKey:e,variant:t}){let o=uo[e],[n,r]=dc(!1);if(!o)return null;let a=decodeURIComponent(o.svg.replace("data:image/svg+xml,","")),i=Oe(a);return ke(uc,{variant:t,className:"dndev-tech-card",style:{"--tech-color":o.color},"data-hover":n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:Cc(gc,{direction:"column",align:"center",gap:"tight",children:[ke("div",{className:"dndev-tech-card-logo","data-tech":e,dangerouslySetInnerHTML:{__html:i}}),ke(fc,{as:"span",level:"small",children:o.name})]})})}function bc({title:e,techs:t,cols:o=3,columns:n,gap:r="medium",separator:a=!1,tone:i=vc.GHOST,align:l,collapsible:d,open:c,onOpenChange:s,defaultOpen:p,className:g}){let u=n||(typeof o=="number"?{mobile:o,tablet:o,desktop:o,wide:o}:{mobile:o[0],tablet:o[1],desktop:o[2],wide:o[3]}),m=v=>{if(v==="long")return{cols:2,rows:1};if(v==="high")return{cols:1,rows:2};if(v==="huge")return{cols:2,rows:2}},b=t.filter(v=>uo[v.name]).map(v=>({id:v.name,content:ke(yc,{techKey:v.name,variant:v.variant}),span:m(v.size)})),f=ke(pc,{items:b,columns:u,gap:r,ariaLabel:"Technology stack"});return ke(mc,{title:e,separator:a,tone:i,align:l,collapsible:d,open:c,onOpenChange:s,defaultOpen:p,className:hc("dndev-tech-bento",g),children:ke("div",{className:"dndev-tech-bento-grid",children:f})})}var Sc=bc;import{Suspense as xc,lazy as kc}from"react";import{useConsent as On}from"@donotdev/core";import{jsx as zn}from"react/jsx-runtime";var Tc=kc(()=>Promise.resolve().then(()=>(Gt(),_t)));function $2(){let e=On("hasConsented"),t=On("showBanner");return e&&!t?null:zn(xc,{fallback:null,children:zn(Tc,{})})}import{Button as Vn,ScrollArea as wc}from"@donotdev/components";import{cn as Un}from"@donotdev/components";import{jsx as ae,jsxs as Nc}from"react/jsx-runtime";function Z2({content:e,cta:t,align:o="center",justify:n="center",disableScrollArea:r=!1,contentVariant:a="narrow",contentClassName:i,ctaClassName:l}){let c=a==="narrow"?a==="narrow"&&ae("div",{className:"dndev-game-container__content-narrow",children:e}):e,s=r?ae("div",{style:{overflow:"auto",overscrollBehavior:"contain",height:"100%"},children:c}):ae(wc,{className:"dndev-game-container__scroll",children:c});return Nc("div",{className:"dndev-game-container",children:[ae("div",{className:Un("dndev-game-container__content",i),"data-align":o,"data-justify":n,"data-content-variant":a,children:ae("div",{className:"dndev-game-container__scroll-wrapper",children:s})}),t&&ae("div",{className:Un("dndev-game-container__cta",l),children:Array.isArray(t)?ae("div",{className:"dndev-game-container__cta-buttons",children:t.map((p,g)=>ae(Vn,{onClick:p.onClick,disabled:p.disabled??!1,variant:p.variant??"default",className:"dndev-game-container__cta-button",fullWidth:!0,children:p.label},g))}):ae(Vn,{onClick:t.onClick,disabled:t.disabled??!1,variant:t.variant??"default",className:"dndev-game-container__cta-button",children:t.label})})]})}import{useEffect as Ic,Suspense as Lc,lazy as Ac}from"react";import{jsx as mo}from"react/jsx-runtime";var _n=new Set,Gn=new Map;function Ec(e,t){let o=Gn.get(e);if(o)return o;let n=t[e];if(!n)return null;let r=Ac(n);return Gn.set(e,r),r}function X2({screenRegistry:e,currentScreen:t,nextScreen:o,fallback:n=null}){Ic(()=>{if(o&&!_n.has(o)){_n.add(o);let a=e[o];a&&a().catch(()=>{})}},[o,e]);let r=t?Ec(t,e):null;return!t||!r?null:mo("div",{style:{height:"100%"},children:mo(Lc,{fallback:n,children:mo(r,{})})})}import{cn as Pc,DISPLAY as go}from"@donotdev/components";import{useAppConfig as Hn}from"@donotdev/core";import{jsx as Tt,jsxs as Fc}from"react/jsx-runtime";var Rc=({display:e=go.AUTO,linkToHome:t=!0,className:o})=>{let n=Hn("name"),a=Hn("shortName")||n||"App",i=$.getLogoSvgContent(),l=$.resolveLogo(),d=e===go.FULL||e===go.AUTO,c=i?Tt("div",{className:"app-branding-logo",role:"img","aria-label":a,dangerouslySetInnerHTML:{__html:Oe(i)}}):$.assetExists(l)?Tt("img",{src:l,alt:a,className:"app-branding-logo"}):null,s=d&&Tt("span",{className:"app-branding-title","data-display":e,children:a}),p=Fc("div",{className:Pc("app-branding",o),"data-display":e,children:[c,s]});return t?Tt(N,{path:"/",className:"app-branding-link",children:p}):p},Dc=Rc;import{cn as $n}from"@donotdev/components";import{useAppConfig as Wn}from"@donotdev/core";import{jsx as Yn}from"react/jsx-runtime";var Kn={sm:{width:"var(--icon-md)",height:"var(--icon-md)"},md:{width:"var(--icon-touch)",height:"var(--icon-touch)"},lg:{width:"var(--icon-touch)",height:"var(--icon-touch)"},xl:{width:"var(--touch-target)",height:"var(--touch-target)"},header:{height:"var(--icon-touch)",width:"auto"}},Bc=({alt:e,size:t="header",className:o})=>{let n=Wn("name"),r=Wn("shortName"),a=e||n||r||"App",i=$.getLogoSvgContent(),l=$.resolveLogo(),d=typeof t=="string"&&t in Kn?Kn[t]:typeof t=="string"?{}:{width:t,height:t};return i?Yn("div",{className:$n("app-icon-header",o),style:{display:"inline-flex",...d},role:"img","aria-label":a,dangerouslySetInnerHTML:{__html:Oe(i)}}):Yn("img",{src:l,alt:a,className:$n(o),style:{objectFit:"contain",...d}})},Mc=Bc;import{cn as qn}from"@donotdev/components";import{useAppConfig as Zn,useBreakpoint as Oc}from"@donotdev/core";import{jsx as jn}from"react/jsx-runtime";var zc=({title:e,className:t,linkToHome:o=!0})=>{let n=Oc("isMobileOrTablet"),r=Zn("name"),a=Zn("shortName"),i=e||n&&a||r||"App",l=jn("div",{className:qn("dndev-text-base",t),style:{fontSize:"var(--font-size-xl)",fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:i});return o?jn(N,{path:"/",className:qn("dndev-inline-block",t),children:l}):l},Vc=zc;import{ChevronRight as Wc}from"lucide-react";import{useMemo as Kc}from"react";import{cn as Yc}from"@donotdev/components";import{useTranslation as qc}from"@donotdev/core";import{useLocation as Zc}from"@donotdev/ui/routing/hooks";import{useMemo as Jn}from"react";import{useNavigationStore as x0,getRoutes as Uc,getRouteManifest as k0}from"@donotdev/core";function _c(){return Jn(()=>{try{let e=Uc();return!e||e.length===0?[]:Gc(e)}catch{return[]}},[])}function Qn(){let e=_c();return Jn(()=>e.flatMap(t=>t.routes),[e])}function Gc(e){let t=new Map;return e.forEach(o=>{let n=typeof o.path=="string"?o.path:String(o.path);if(!n||n==="undefined"||n==="null")return;let r=o.meta?.entity||Hc(n)||"other",a={path:n,label:o.meta?.title||$c(n),icon:o.meta?.icon,component:o.component,importPath:o.importPath,exportName:o.exportName,auth:o.auth,meta:o.meta};t.has(r)||t.set(r,{label:r.charAt(0).toUpperCase()+r.slice(1),routes:[]}),t.get(r)?.routes.push(a)}),Array.from(t.values())}function Hc(e){return e.split("/").filter(Boolean)[0]||null}function $c(e){let t=e.split("/").filter(Boolean),o=t[t.length-1];return o?o.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"Home"}import{jsx as Je,jsxs as Qc}from"react/jsx-runtime";var jc=({items:e,separator:t=Wc,showHome:o=!0,homeHref:n="/",variant:r="default",className:a})=>{let{t:i}=qc("dndev"),l=Zc(),d=Qn(),c=Kc(()=>new Set(d.map(g=>g.path)),[d]),s=e||(()=>{let g=l.pathname.split("/").filter(Boolean),u=[],m="";return g.forEach(b=>{m+=`/${b}`;let f=b.split("-").map(h=>h.charAt(0).toUpperCase()+h.slice(1)).join(" "),v=c.has(m)?m:void 0;u.push({label:f,href:v})}),u})(),p=o?[{label:i("navigation.home","Home"),href:n},...s]:s;return r==="smart"&&l.pathname.split("/").filter(Boolean).length<2?null:Je("nav",{role:"navigation","aria-label":"Breadcrumb navigation",className:Yc("breadcrumbs",a),children:p.map((g,u)=>{let b=u===p.length-1||!g.href;return Qc("span",{className:"breadcrumb-item",children:[u>0&&Je(t,{className:"dndev-size-md separator"}),g.icon&&Je(g.icon,{className:"dndev-size-md icon"}),g.href&&!b?Je(N,{path:g.href,className:"breadcrumb-link",children:g.label}):Je("span",{className:"breadcrumb-label",children:g.label})]},u)})})},Jc=jc;import{useTranslation as Xc,maybeTranslate as Xn,useLayout as fo,useAppConfig as ed}from"@donotdev/core";import{jsx as ze,jsxs as od}from"react/jsx-runtime";var td=({asLink:e=!1,className:t})=>{let o=ed("app"),n=fo("gameTitle"),r=fo("gameSubtitle"),a=fo("gameNamespace"),{t:i}=Xc(a||"dndev"),l=Xn(i,n??void 0),d=Xn(i,r??void 0),c=o?.name||"Game";if(l)return ze("div",{className:t,children:od("div",{style:{textAlign:"center"},children:[ze("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}),d&&ze("p",{style:{color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d})]})});let s=ze("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c});return e?ze(N,{path:"/",className:t,style:{fontSize:"var(--font-size-2xl)",fontWeight:700,transition:"color var(--dur-fast) ease-out"},onMouseEnter:p=>p.currentTarget.style.color="var(--primary)",onMouseLeave:p=>p.currentTarget.style.color="var(--foreground)",children:c}):ze("div",{className:t,children:s})};import{Trash2 as nd}from"lucide-react";import{useState as er}from"react";import{Button as rd,BUTTON_VARIANT as ad,Checkbox as id,Stack as vo,useToast as sd}from"@donotdev/components";import{useTranslation as ld}from"@donotdev/core";import{useRefresh as cd}from"@donotdev/ui/routing/hooks";import{jsx as wt,jsxs as tr}from"react/jsx-runtime";function dd(){let{t:e}=ld("dndev"),{toast:t}=sd(),[o,n]=er(!1),r=cd(),[a,i]=er({localStorage:!0,sessionStorage:!0,applicationCache:!0,serviceWorker:!0,cookies:!0,indexedDB:!0,webSQL:!0,memoryCache:!0}),l=async()=>{try{n(!0);let d=[];if(a.localStorage&&typeof window<"u")try{localStorage.clear(),d.push("localStorage")}catch{}if(a.sessionStorage&&typeof window<"u")try{sessionStorage.clear(),d.push("sessionStorage")}catch{}if(a.indexedDB&&typeof window<"u"&&"indexedDB"in window)try{if("databases"in indexedDB){let s=await indexedDB.databases();await Promise.all(s.map(async p=>{if(p.name){let g=indexedDB.deleteDatabase(p.name);await new Promise((u,m)=>{g.onsuccess=()=>u(void 0),g.onerror=()=>m(g.error)})}}))}d.push("IndexedDB")}catch{}if(a.webSQL&&"openDatabase"in window)try{let s=globalThis.openDatabase("","","","");s&&s.transaction&&s.transaction(p=>{p.executeSql('SELECT name FROM sqlite_master WHERE type="table"',[],(g,u)=>{for(let m=0;m<u.rows.length;m++){let b=u.rows.item(m).name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(b)&&g.executeSql(`DROP TABLE IF EXISTS ${b}`)}})}),d.push("WebSQL")}catch{}if(a.applicationCache&&"caches"in window)try{let s=await caches.keys();await Promise.all(s.map(async p=>{try{await caches.delete(p)}catch{}})),d.push("Application Cache")}catch{}if(a.serviceWorker&&"serviceWorker"in navigator)try{let s=await navigator.serviceWorker.getRegistrations();await Promise.all(s.map(async p=>{try{await p.unregister()}catch{}})),d.push("Service Workers")}catch{}if(a.cookies)try{document.cookie.split(";").forEach(s=>{let p=s.indexOf("="),g=p>-1?s.substr(0,p):s;document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${window.location.hostname}`,document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=.${window.location.hostname}`}),d.push("Cookies")}catch{}if(a.memoryCache)try{"gc"in window&&typeof globalThis.gc=="function"&&globalThis.gc(),d.push("Memory Cache")}catch{}let c=d.length>0?e("settings.clearCache.success","Cache cleared successfully: {{items}}",{items:d.join(", ")}):e("settings.clearCache.noItemsCleared","No cache items were cleared");t("success",c),d.length>0&&setTimeout(()=>{typeof globalThis<"u"&&globalThis._DNDEV_STORES_&&(globalThis._DNDEV_STORES_={}),typeof window<"u"?window.location.href=window.location.href:r()},1e3)}catch{t("error",e("settings.clearCache.error","Error clearing cache"))}finally{n(!1)}};return tr(vo,{children:[wt(vo,{children:Object.entries(a).map(([d,c])=>tr(vo,{direction:"row",align:"center",gap:"tight",children:[wt(id,{id:d,checked:c,onCheckedChange:s=>i(p=>({...p,[d]:!!s}))}),wt("label",{htmlFor:d,style:{fontSize:"var(--font-size-sm)",fontWeight:500,lineHeight:1,cursor:"pointer"},children:e(`settings.clearCache.${d}`,d.charAt(0).toUpperCase()+d.slice(1))})]},d))}),wt(rd,{variant:ad.DESTRUCTIVE,style:{margin:"0 auto"},disabled:o||!Object.values(a).some(Boolean),onClick:l,icon:nd,children:o?e("settings.clearCache.clearing","Clearing..."):e("settings.clearCache.button","Clear Cache")})]})}var ho=dd;import{DropdownMenu as gd,Button as yo,Stack as fd}from"@donotdev/components";import{Link as pd}from"lucide-react";import{navigationMenuTriggerStylePrimitive as ud}from"@donotdev/components";le();Ce();import{jsx as or,jsxs as md}from"react/jsx-runtime";var Nt=({path:e,route:t,showIcons:o=!0})=>{let n=K(),r=t??n.find(l=>l.path===e);if(!r)return null;let a=o&&!!r.icon,i=!!r.label;return md(N,{path:r.path,className:ud(),...a&&!i&&{"data-display":"compact"},children:[o&&or(V,{icon:r.icon,fallback:pd}),or("span",{children:r.label})]})};import{jsx as Te}from"react/jsx-runtime";var vd=({navigation:e,className:t})=>Te(fd,{role:"navigation",direction:"row",align:"center",className:t,style:{gap:"var(--gap-sm)"},children:e.map((o,n)=>o.routes&&o.routes.length>0?Te(gd,{trigger:Te(yo,{icon:o.icon,children:o.label}),items:o.routes.map(r=>({label:r.label,children:Te(Nt,{route:r}),asChild:!!r.path})),contentAlign:"start"},o.label+n):o.path?Te(yo,{icon:o.icon,"aria-label":o.label,render:({children:r,...a})=>Te(N,{path:o.path,...a,children:r}),children:o.label},o.label+n):Te(yo,{icon:o.icon,disabled:!0,"aria-label":o.label,children:o.label},o.label+n))}),hd=vd;import{Card as yd,cn as bd}from"@donotdev/components";import{jsx as bo}from"react/jsx-runtime";var Sd=({languages:e,currentLanguage:t,onLanguageChange:o,className:n})=>bo(yd,{className:bd("dndev-z-modal",n),style:{position:"fixed",bottom:"var(--gap-md)",insetInlineEnd:"var(--gap-md)",display:"flex",alignItems:"center",gap:"var(--gap-sm)",transition:"var(--dur-fast) ease-out"},role:"region","aria-label":"Language selector","data-role":"floating",children:bo("select",{style:{backgroundColor:"transparent",outline:"none",fontSize:"var(--font-size-base)",cursor:"pointer"},value:t,onChange:r=>o?.(r.target.value),"aria-label":"Select language",children:e.map(r=>bo("option",{value:r,children:r},r))})}),Cd=Sd;import{MoreHorizontal as xd}from"lucide-react";import{Button as kd,BUTTON_VARIANT as Td,DropdownMenu as wd}from"@donotdev/components";import{jsx as nr}from"react/jsx-runtime";var Nd=({children:e,className:t})=>nr(wd,{trigger:nr(kd,{variant:Td.GHOST,icon:xd,"aria-label":"Menu",className:t}),contentAlign:"end",children:e}),Id=Nd;import{MoreHorizontal as Ld}from"lucide-react";import{Link as Ad}from"lucide-react";import{DISPLAY as Qe,DropdownMenu as Ed,Button as rr}from"@donotdev/components";import{cn as Pd}from"@donotdev/components";import{useBreakpoint as ar,useTranslation as Rd}from"@donotdev/core";le();Ce();import{jsx as we}from"react/jsx-runtime";var Dd=({className:e="",showIcons:t=!0,display:o=Qe.AUTO,path:n})=>{let{t:r}=Rd("dndev"),a=ar("isMobile"),i=ar("isTablet"),l=K(),d=en(n??"");return n?d?we(rr,{variant:"ghost",display:o,icon:t?we(V,{icon:d.icon,fallback:Ad}):void 0,className:e,render:({children:s,...p})=>we(N,{path:d.path,...p,children:s}),children:d.label}):null:(o===Qe.AUTO?a||i?Qe.COMPACT:Qe.FULL:o)===Qe.COMPACT?we(Ed,{trigger:we(rr,{variant:"ghost",icon:Ld,"aria-label":r("navigation.menu","Navigation"),className:e}),contentAlign:"end",items:l.map(s=>({label:s.label,children:we(Nt,{route:s,showIcons:t}),asChild:!0}))}):we(mn,{overflowDetection:!0,showIcons:t,className:Pd(e),style:{flex:1}})},Fd=Dd;import{Bell as Bd}from"lucide-react";import{useMemo as Md,useEffect as Od,useRef as zd}from"react";import{Button as Vd,cn as Ud,toast as _d,Stack as Gd}from"@donotdev/components";import{jsx as So}from"react/jsx-runtime";var Hd={sm:{button:{width:"var(--icon-md)",height:"var(--icon-md)"},icon:{width:"var(--icon-md)",height:"var(--icon-md)"},badge:{width:"var(--icon-md)",height:"var(--icon-md)",fontSize:"var(--font-size-xs)"}},md:{button:{width:"var(--touch-target)",height:"var(--touch-target)"},icon:{width:"var(--icon-md)",height:"var(--icon-md)"},badge:{width:"var(--icon-md)",height:"var(--icon-md)",fontSize:"var(--font-size-xs)"}},lg:{button:{width:"var(--touch-target)",height:"var(--touch-target)"},icon:{width:"var(--icon-touch)",height:"var(--icon-touch)"},badge:{width:"var(--icon-touch)",height:"var(--icon-touch)",fontSize:"var(--font-size-sm)"}}},$d=({notifications:e=[],count:t=0,loading:o=!1,onNotificationClick:n,onDropdownOpen:r,className:a,maxVisible:i=10,alwaysShow:l=!1,size:d="md",disabled:c=!1})=>{let s=Hd[d],p=zd(new Set),g=Md(()=>t===0?null:t>99?"99+":t.toString(),[t]),u=t>0||l;return Od(()=>{e.forEach(m=>{if(!p.current.has(m.id)){p.current.add(m.id);let b=m.type==="error"?"error":m.type==="warning"?"warning":m.type==="success"?"success":"info";_d({title:m.title,description:m.message,toastType:b,duration:0,onDismiss:()=>{p.current.delete(m.id),n&&n(m)}})}})},[e,n]),u?So("div",{className:Ud(a),style:{position:"relative"},children:So(Vd,{disabled:c,style:{...s.button,position:"relative"},onClick:()=>{r?.()},onFocus:m=>{m.currentTarget.style.outline="2px solid var(--ring)",m.currentTarget.style.outlineOffset="2px"},onBlur:m=>{m.currentTarget.style.outline="none"},"aria-label":`${t} notification${t!==1?"s":""}`,icon:Bd,children:g&&So(Gd,{align:"center",justify:"center",style:{position:"absolute",top:"-0.25rem",insetInlineEnd:"-0.25rem",backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)",borderRadius:"var(--radius-full)",fontWeight:600,lineHeight:1,minWidth:0,...s.badge},"aria-hidden":"true",children:g})})}):null},Wd=$d;import{Settings as Kd,Check as Yd}from"lucide-react";import*as It from"lucide-react";import{Button as qd,BUTTON_VARIANT as Zd,DropdownMenu as jd,Stack as Jd,DISPLAY as Qd}from"@donotdev/components";import{useTranslation as Xd}from"@donotdev/core";import{useLanguageSelector as ep,useTheme as Co,Flag as tp}from"@donotdev/core";import{jsx as me,jsxs as rp}from"react/jsx-runtime";function op({variant:e=Zd.OUTLINE}={}){let{t}=Xd("dndev"),{languages:o,currentLanguage:n,changeLanguage:r,isLoading:a}=ep(),i=Co("availableThemes"),l=Co("currentTheme"),d=Co("setTheme"),c=u=>{if(!u)return It.Palette;let m=u.replace(/['"]/g,"");return It[m]||It.Palette},s=i.map(u=>{let m=c(u.meta?.icon),b=u.name===l;return{label:u.displayName||u.name,icon:m,onClick:()=>d(u.name),checked:b}}),p=o.map(u=>{let m=u.id===n;return{label:u.name,onClick:()=>r(u.id),disabled:a,checked:m,className:m?"bg-accent":void 0,iconEnd:m&&!a?Yd:void 0,children:rp(Jd,{direction:"row",align:"center",gap:"tight",children:[me(tp,{code:u.flagCode||u.id,title:`${u.name} flag`}),me("span",{children:u.name}),a&&m&&me("div",{style:{marginInlineStart:"auto"},children:me("div",{style:{width:"0.5rem",height:"0.5rem",borderRadius:"50%",backgroundColor:"var(--primary)"}})})]})}}),g=[{label:t("auth.title","Authentication"),subContent:me(ao,{display:Qd.COMPACT})},{label:t("settings.theme","Theme"),subItems:s},{label:t("settings.language","Language"),subItems:p},{label:t("settings.clearCache.title","Clear Cache"),subContent:me(ho,{})}];return me(jd,{trigger:me(qd,{variant:e,"aria-label":t("settings.title","Settings"),icon:Kd}),items:g,contentWidth:"14rem",contentAlign:"end"})}var np=op;import*as Lt from"lucide-react";import{Button as ir,BUTTON_VARIANT as ap,DropdownMenu as ip,DISPLAY as sp}from"@donotdev/components";import{useTranslation as lp}from"@donotdev/core";import{useTheme as xo}from"@donotdev/core";import{jsx as To}from"react/jsx-runtime";var ko=e=>{if(!e)return Lt.Palette;let t=e.replace(/['"]/g,"");return Lt[t]||Lt.Palette},cp=({display:e=sp.AUTO,"no-tooltip":t=!1})=>{let{t:o}=lp("dndev"),n=xo("availableThemes"),r=xo("currentTheme"),a=xo("setTheme");if(n.length<=1)return null;let i=n.find(v=>v.name===r)||n[0],l=n.length===2?n.find(v=>v.name!==i?.name)||n[0]:null,d=i?ko(i.meta?.icon):null,c=l?ko(l.meta?.icon):null,s=i?.displayName||i?.name||"Theme",p=l?.displayName||l?.name||"Theme",g=n.length===2&&l&&c,u=g?c:d,m=g?t?void 0:o("common.themeSelector.tooltipWithNext","Change Theme: Switch to {{next}}",{next:l?.displayName||l?.name}):t?void 0:o("common.themeSelector.changeTheme","Change Theme"),b={variant:ap.OUTLINE,"aria-label":o("common.themeSelector.changeTheme","Change Theme"),tooltip:m,icon:u,display:e};if(g&&l)return To(ir,{...b,onClick:()=>a(l.name),children:p});if(!i||!d)return null;let f=n.map(v=>{let h=ko(v.meta?.icon),T=v.name===r;return{label:v.displayName||v.name,icon:h,onClick:()=>a(v.name),checked:T}});return To(ip,{trigger:To(ir,{...b,children:s}),items:f,contentWidth:"10rem"})},dp=cp;import{ExternalLink as pp}from"lucide-react";import{getPlatformEnvVar as up}from"@donotdev/core";import{jsx as mp,jsxs as gp}from"react/jsx-runtime";var wo=({className:e})=>{let o=up("APP_URL")==="https://donotdev.com";return gp("a",{href:o?"https://www.ambroise-park.com":"https://donotdev.com",target:"_blank",rel:"noopener noreferrer",className:e,style:{display:"inline-flex",alignItems:"center",gap:"var(--gap-sm)",fontSize:"var(--font-size-xs)"},children:[o?"AMBROISE-PARK":"DoNotDev",mp(pp,{style:{width:"12px",height:"12px"},"aria-hidden":"true"})]})};import{cn as fp}from"@donotdev/components";import{useTranslation as vp,useAppConfig as hp}from"@donotdev/core";import{jsxs as bp}from"react/jsx-runtime";var yp=({appName:e,year:t=new Date().getFullYear(),className:o})=>{let{t:n}=vp("dndev"),r=hp("app"),a=e||r?.name||"App";return bp("span",{className:fp(o),style:{flexShrink:0,color:"var(--muted-foreground)",fontSize:"var(--font-size-xs)"},children:["\xA9 ",t," ",a,". ",n("footer.legal.allRightsReserved")]})};import{Stack as xp}from"@donotdev/components";import{useTranslation as kp,maybeTranslate as Tp,useAppConfig as wp}from"@donotdev/core";var Sp=[{path:"#cookie-settings",label:"footer.legal.cookieSettings"},{label:"footer.legal.privacyPolicy",path:"/privacy"},{label:"footer.legal.termsOfService",path:"/terms"}],Cp=e=>e?.legalLinks===null?[]:e?.legalLinks??Sp,sr=Cp;import{jsx as lr,jsxs as Ip}from"react/jsx-runtime";var Np=({app:e,direction:t="column",gap:o="tight"})=>{let{t:n}=kp("dndev"),r=wp("app"),i=sr((e||r||{}).footer),l={transition:"color var(--dur-fast) ease-out",textDecoration:"underline",textUnderlineOffset:"2px",color:"var(--muted-foreground)",fontSize:"var(--font-size-xs)"};return i.length===0?null:Ip(xp,{direction:t,gap:o,align:"stretch",children:[i.map(d=>lr(N,{path:d.path,style:l,onMouseEnter:c=>c.currentTarget.style.color="var(--primary)",onMouseLeave:c=>c.currentTarget.style.color="var(--muted-foreground)",children:Tp(n,d.label)},d.path)),lr(wo,{})]})};import{useEffect as Ap}from"react";import{checkLicense as Ep}from"@donotdev/core";var Lp='<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512"><title>logo</title><style>.s0{opacity:.98;fill:#f23d29}.s1{opacity:.99;fill:#03bec4}.s2{opacity:.97;fill:#27494a}</style><g id="Background"><path id="Path 0" fill-rule="evenodd" class="s0" d="m254 41.1c5.8-0.1 15.2 0.4 21 0.9 5.8 0.6 16 2.2 22.8 3.5 6.7 1.4 17.5 4.2 23.9 6.4 6.5 2.1 16.7 6.1 22.8 8.8 6.1 2.7 15.5 7.6 21 10.8 5.5 3.3 14.3 9.2 19.5 13 5.2 3.9 13.8 11.2 19 16.2 5.2 5 12.2 12.3 15.5 16.2 3.3 4 8.8 11.1 12.2 15.9 3.4 4.8 8.7 13.2 11.7 18.7 3 5.5 6.9 13.4 8.7 17.5 1.7 4.1 4.7 12 6.6 17.5 1.9 5.5 4.5 14.5 5.8 20 1.3 5.5 3.1 15.3 3.9 21.8 0.9 6.6 1.6 19 1.6 28.7 0 9.4-0.7 22.1-1.5 28.3-0.8 6.1-3 17.3-4.8 24.7-1.9 7.4-5.5 18.9-8.2 25.5-2.6 6.6-7 16.3-9.8 21.5-2.8 5.2-8 13.8-11.5 19-3.6 5.2-9.3 12.9-12.7 17-3.5 4.1-10.7 11.8-16.2 17-5.4 5.3-12.7 11.9-16.3 14.7-3.6 2.8-11.4 8.3-17.5 12.2-6.1 4-16.4 9.8-23 13.1-6.6 3.2-17.4 7.6-24 9.8-6.6 2.3-17.2 5.2-23.5 6.6-6.3 1.4-16.2 3-22 3.7-6.4 0.7-17.5 1-28.5 0.6-11.9-0.3-21.7-1.2-29-2.6-6.1-1.1-15.9-3.4-22-5.1-6.1-1.7-15.9-5.2-22-7.6-6.1-2.5-15.5-6.9-21-9.8-5.5-2.9-14.1-8-19-11.3-4.9-3.3-12.4-8.7-16.5-12-4.1-3.4-12.5-11.2-18.6-17.4-6.1-6.3-13.9-15.2-17.3-19.9-3.5-4.7-8.8-12.6-11.9-17.5-3-4.9-7.9-13.9-10.8-20-2.9-6.1-7.1-16.4-9.3-23-2.2-6.6-5.1-17.6-6.5-24.5-1.4-6.9-3-17.4-3.7-23.5-0.7-6.7-0.9-17.2-0.6-27 0.4-8.8 1.3-20.5 2.2-26 0.8-5.5 2.7-14.5 4.1-20 1.4-5.5 3.9-14.1 5.5-19 1.7-4.9 6.3-15.8 10.4-24 4-8.3 10-19.1 13.3-24 3.3-4.9 9-12.6 12.5-17 3.6-4.4 11.4-12.8 17.3-18.6 6-5.8 15.4-13.9 20.9-18 5.5-4.1 14.5-10 20-13.2 5.5-3.1 14.5-7.6 20-10.1 5.5-2.4 15.1-6 21.3-8 6.1-2 16.7-4.7 23.5-6.1 6.7-1.3 16.3-2.8 21.2-3.3 4.9-0.5 13.7-1 19.5-1.1zm-21 38c-4.7 0.5-12.1 1.9-16.5 3-4.4 1.1-11.6 3.1-16 4.5-4.4 1.5-13.8 5.4-21 8.9-7.2 3.5-16.1 8.5-20 11.1-3.8 2.6-10 7.2-13.8 10.3-3.7 3.1-6.7 5.9-6.7 6.3 0 0.5 9.3 10.3 20.8 21.9l20.7 21c5.5-10.5 9-16.5 11.5-20.1 2.4-3.6 7.2-9.6 10.5-13.5 3.3-3.8 9.4-9.6 13.5-12.9 4.1-3.2 10.7-7.4 14.5-9.2 3.9-1.8 9.7-4 13-4.9 3.3-0.8 9.6-1.5 14-1.5 4.4 0 10.7 0.7 14 1.6 3.3 0.9 9.1 3.2 13 5.1 3.9 2 9.3 5.2 12 7.3 2.8 2 8.5 7.5 12.9 12.1 4.3 4.6 10.2 11.8 13.1 15.9 2.9 4.1 7.8 12.2 10.8 18 3 5.8 7.1 14.8 9 20 2 5.2 4.2 13 5.1 17.3 0.9 4.2 1.6 11.4 1.6 15.9 0 5.6-0.6 10.6-2.1 15.3-1.1 3.8-3.8 9.9-5.9 13.5-2.1 3.6-5.8 8.9-8.4 11.7-2.5 2.9-4.6 5.6-4.6 6 0 0.5 1.4 1.2 3.2 1.6 1.8 0.4 6.4 2.4 10.3 4.4 3.9 1.9 9 4.9 11.5 6.6 2.5 1.8 7.1 5.9 10.4 9.2 4.2 4.3 7.1 8.6 10.1 15 2.4 4.9 5 11.9 5.9 15.5 0.9 3.6 2.3 11.9 3.2 18.5 1.1 8 1.4 15.9 1.1 23.5l-0.5 11.5 6.3 6.4c6.3-8.1 10.4-13.8 13.1-17.9 2.8-4.1 6.4-10 8.1-13 1.7-3 5.1-10.2 7.6-16 2.5-5.8 5.8-15.2 7.5-21 1.7-5.8 3.7-13.9 4.6-18 0.8-4.1 2-11.9 2.5-17.3 0.6-5.3 1.1-13.5 1.1-18.2 0-4.7-0.5-12.9-1.1-18.3-0.6-5.3-1.9-13.5-2.9-18.2-1-4.7-3.1-12.3-4.5-17-1.5-4.7-5.1-13.4-7.9-19.5-2.9-6.1-7.6-14.8-10.6-19.5-2.9-4.7-7.2-11-9.5-14-2.3-3-7.8-9.3-12.1-13.9-4.3-4.6-12-11.6-16.9-15.6-4.9-4.1-13.1-9.9-18-13-4.9-3.1-13.3-7.7-18.5-10.2-5.2-2.5-13.6-6.1-18.5-7.8-4.9-1.8-14.2-4.5-20.5-5.9-6.3-1.4-17.1-3-24-3.6-6.9-0.5-13.4-0.9-14.5-0.8-1.1 0.1-4.5 0.3-7.5 0.5-3 0.2-9.3 0.8-14 1.4zm-125.4 79.6c-4.3 6.5-9.8 15.9-12.1 20.8-2.4 4.9-5.9 13.7-7.9 19.5-1.9 5.8-4.4 15-5.5 20.5-1.1 5.5-2.5 15.8-3.1 23-0.6 7.2-0.8 16.8-0.5 21.5 0.4 4.7 1.5 13.9 2.5 20.5 1.1 6.6 3.5 17.3 5.4 23.8 2 6.4 5.5 16.1 7.9 21.5 2.3 5.3 6.7 13.8 9.7 18.7 3 4.9 8.1 12.4 11.4 16.5 3.3 4.1 9.8 11.5 14.5 16.3 4.7 4.9 11.8 11.2 15.6 14.2 3.9 2.9 11.1 7.9 16 11 4.9 3.1 13.1 7.6 18 10 4.9 2.4 13.7 5.9 19.5 7.9 5.8 1.9 14.6 4.4 19.5 5.5 4.9 1.1 13.7 2.5 19.5 3.2 6.6 0.7 16.1 0.9 25.5 0.6 9.8-0.4 19.1-1.5 27-3.1 6.6-1.4 16.7-4.1 22.5-6.1 5.8-2 15-5.8 20.5-8.5 5.5-2.7 13.8-7.4 18.5-10.5 4.7-3.2 9.3-6.5 10.3-7.4 1.6-1.5 1.6-1.7-0.5-3.9-1.3-1.2-2.6-2.2-3-2.2-0.5 0-3.4 2-6.5 4.4-3.2 2.4-9.4 6.4-13.8 8.9-4.4 2.6-12.7 6.4-18.5 8.6-5.8 2.2-15.2 5.1-21 6.5-5.8 1.4-14.6 3-19.5 3.7-4.9 0.6-15.7 1.1-24 1.1-8.2 0-19.5-0.7-25-1.6-5.5-0.8-14.7-2.7-20.5-4.1-5.8-1.5-15-4.5-20.5-6.6-5.5-2.2-12.9-5.6-16.5-7.5-3.6-2-10.3-6.1-15-9.2-4.7-3.1-12.7-9.7-17.8-14.7-7.5-7.2-9.5-9.8-10.2-13-0.5-2.2-1-9.9-1-17 0-7.1 0.7-17.3 1.5-22.5 0.8-5.2 2.3-12.8 3.5-16.8 1.1-3.9 3.3-9.8 4.9-12.9 1.6-3.2 4.5-7.8 6.5-10.3 1.9-2.5 6.1-6.6 9.3-9.3 3.2-2.6 9.2-6.5 13.3-8.6 4.1-2.1 9.3-4.4 11.5-5.1 2.2-0.7 4.3-1.5 4.7-1.9 0.4-0.3-1.3-3.1-3.8-6.1-2.5-3-6.1-8.4-8.2-12-2-3.6-4.7-9.9-6-14-1.8-5.6-2.5-10-2.6-17 0-5.2 0.2-11.7 0.5-14.5l0.6-5-49.2-48.5zm117.6 8.2c-4 1.1-9.8 3.1-13 4.3-3.2 1.3-8.4 4.1-11.6 6.3l-5.8 3.9 6.7 6.5c7.5-3.7 9.9-4 24.2-4 13.2 0 17 0.4 20.4 1.8 2.3 0.9 4.5 2.5 5 3.5 0.6 1.2 2 1.7 4.9 1.7 2.8 0 4.2-0.5 4.8-1.7 0.5-1 2.5-2.6 4.5-3.5 3.1-1.5 6.6-1.8 21.7-1.8 9.9 0 19.1 0.5 20.5 1 1.3 0.6 3.1 2 4 3.3 1.1 1.6 1.5 4.8 1.5 11.7 0 7.9-0.4 10.3-2.3 14-1.2 2.4-3.4 5.3-4.7 6.3-1.4 1-4.3 2.2-6.5 2.7-2.2 0.6-7.9 1-12.5 1-4.7 0-10.3-0.4-12.5-1-2.2-0.5-5.2-1.8-6.5-2.8-1.4-1-3.6-3.6-4.8-5.8-1.2-2.1-2.6-6-3-8.6-0.7-4.6-0.9-4.8-4-4.8-3.2 0-3.3 0.2-4.4 5.8-0.6 3.1-1.7 6.9-2.4 8.2-0.7 1.4-2.5 3.7-4.1 5.2-1.6 1.4-4 2.9-5.3 3.3-2.4 0.7-1 2.2 20.5 23.6 12.6 12.6 23.3 22.9 23.7 22.9 0.4 0 4.4-3.5 8.9-7.7 4.5-4.3 10-10.5 12.2-13.8 2.2-3.3 5.5-9.1 7.3-13 1.8-3.8 4.5-11 5.9-16 1.5-4.9 2.9-12.8 3.2-17.5 0.5-6.5 0.2-9.5-1-13-1-2.6-3.5-6.2-5.9-8.5-2.4-2.3-7.7-5.8-11.8-7.8-4.2-2-10.9-4.5-15-5.5-4.2-1.1-11.6-2.5-16.5-3.1-5-0.6-12.6-1-17-0.9-4.4 0-11.2 0.5-15 1-3.9 0.5-10.3 1.8-14.3 2.8zm-13.7 29.2c-0.5 0.9 2 4.1 8.1 10.1 7.5 7.4 9.4 8.7 12.1 8.7 1.8 0 4.2-0.4 5.3-1 1.1-0.5 2.8-2.9 3.9-5.2 1.1-2.4 2-5.8 2-7.8 0.1-1.9-0.6-4.4-1.3-5.5-1.3-1.8-2.8-2-13.3-2.2-6.5-0.1-12.8 0.2-13.9 0.7-1.2 0.5-2.5 1.5-2.9 2.2zm58.5 1.1c-0.8 2.3-0.8 4.4-0.1 7.5 0.6 2.3 2.1 5.3 3.3 6.6 1.6 1.7 3.9 2.6 8.3 3.1 3.3 0.4 8.2 0.5 11 0.1 2.7-0.4 5.7-1.1 6.7-1.7 1-0.5 2.4-2.4 3.3-4.4 0.8-1.9 1.5-5.2 1.5-7.2 0-2.1-0.7-4.8-1.5-6-1.5-2.2-2.1-2.3-15.3-2.2-7.6 0.1-14.3 0.3-14.9 0.6-0.7 0.2-1.7 1.9-2.3 3.6zm-71.9 38c1.7 3.4 5 8.9 7.4 12.2 2.3 3.3 6.9 8.5 10.1 11.6 3.2 3.1 7.9 6.8 10.4 8.2 2.4 1.4 6.5 3.3 9 4.2 2.4 0.8 4.5 1.4 4.7 1.3 0.1-0.2-9.9-10.4-22.3-22.8-12.3-12.3-22.5-22.1-22.5-21.7 0.1 0.4 1.5 3.5 3.2 7z"/><path id="Path 1" class="s1" d="m243 105.6c-3 0.8-8.7 2.9-12.5 4.8-3.8 1.8-10.4 6-14.5 9.2-4.1 3.3-10.2 9.1-13.5 12.9-3.4 3.9-8.4 10.4-11.1 14.5-2.8 4.1-6.5 10.2-8.2 13.5l-3.1 6 14.8 15c9-6.2 15.4-9.4 20.1-11.1 4.7-1.8 12-3.9 16.2-4.8 4.3-0.9 12.4-1.9 18-2.2 6.2-0.4 14.5-0.2 20.8 0.6 5.8 0.6 13.9 2.1 18 3.1 4.1 1.1 10.9 3.6 15 5.6 4.1 2 9.4 5.5 11.8 7.7 2.5 2.4 5 6 5.9 8.6 1.3 3.4 1.5 6.5 1.1 13-0.4 4.7-1.8 12.6-3.2 17.5-1.5 4.9-4.2 12.2-6 16-1.8 3.9-5 9.7-7.3 13-2.2 3.3-8 9.7-12.9 14.3l-8.9 8.3c76.3 76.3 98.8 98 99.2 97.6 0.4-0.5 1-5.7 1.2-11.5 0.2-6.2-0.4-15.7-1.3-22.7-0.9-6.6-2.3-14.9-3.2-18.5-0.9-3.6-3.5-10.6-5.9-15.5-3-6.4-5.9-10.7-10.1-15-3.3-3.3-7.9-7.4-10.4-9.2-2.5-1.7-7.6-4.7-11.5-6.6-3.9-2-8.5-4-10.3-4.4-1.8-0.4-3.2-1.1-3.2-1.5 0-0.5 2.1-3.2 4.6-6 2.6-2.9 6.3-8.2 8.4-11.8 2.1-3.6 4.8-9.6 5.9-13.5 1.5-4.7 2.1-9.7 2.1-15.2 0-4.6-0.7-11.8-1.6-16-0.9-4.3-3.1-12.1-5.1-17.3-1.9-5.2-6-14.2-9-20-3-5.8-7.9-13.9-10.8-18-2.9-4.1-8.8-11.3-13.1-15.9-4.4-4.6-10.2-10.1-12.9-12.1-2.8-2.1-8.1-5.3-12-7.3-3.9-1.9-9.7-4.2-13-5.1-3.3-0.9-9.8-1.5-14.5-1.5-4.7 0-11 0.7-14 1.5zm-78.7 93.9c-0.4 2.2-0.8 8.7-0.7 14.5 0.1 8.3 0.6 12.1 2.5 18 1.4 4.1 4.1 10.4 6.1 14 2.1 3.6 5.7 9 8.2 12 2.5 3 4.2 5.8 3.8 6.1-0.4 0.4-2.5 1.2-4.7 1.9-2.2 0.7-7.4 3-11.5 5.1-4.1 2.1-10.1 6-13.3 8.6-3.2 2.7-7.4 6.8-9.3 9.3-2 2.5-4.9 7.1-6.5 10.3-1.6 3.1-3.8 9-4.9 13-1.2 3.9-2.7 11.5-3.5 16.7-0.8 5.2-1.5 15.4-1.5 22.5 0 7.1 0.5 14.8 1 17 0.7 3.2 2.7 5.8 10.2 13 5.1 5 13.1 11.6 17.8 14.7 4.7 3.1 11.4 7.2 15 9.2 3.6 1.9 11 5.3 16.5 7.5 5.5 2.1 14.7 5.1 20.5 6.6 5.8 1.4 15 3.3 20.5 4.1 5.5 0.9 16.8 1.6 25 1.6 8.3 0 19.1-0.5 24-1.1 4.9-0.7 13.7-2.3 19.5-3.7 5.8-1.4 15.2-4.3 21-6.5 5.8-2.2 14.1-6 18.5-8.6 4.4-2.5 10.8-6.7 14.2-9.2 3.5-2.5 6.3-4.9 6.3-5.3 0-0.5-26.5-27-58.8-59-54.3-53.8-59.2-58.4-63.8-59.8-2.7-0.8-7.4-3-10.4-4.8-3-1.8-7.9-5.7-10.8-8.5-3-2.9-7.3-7.9-9.7-11.2-2.4-3.3-6.4-10.3-8.9-15.5-4.2-8.7-5.6-10.6-18-23l-13.5-13.5z"/><path id="Path 2" fill-rule="evenodd" class="s2" d="m225.8 184c13.2 0 17 0.3 20.3 1.8 2.3 0.9 4.6 2.5 5 3.5 0.6 1.2 2.1 1.7 4.9 1.7 2.8 0 4.3-0.5 4.9-1.8 0.4-0.9 2.5-2.5 4.5-3.5 3-1.4 6.5-1.7 21.6-1.7 9.9 0 19.1 0.4 20.5 1 1.4 0.6 3.2 2 4 3.3 1.2 1.6 1.6 4.8 1.6 11.7-0.1 7.9-0.4 10.3-2.3 13.9-1.3 2.5-3.4 5.3-4.8 6.3-1.4 1-4.3 2.3-6.5 2.8-2.2 0.5-7.8 1-12.5 1-4.7 0-10.3-0.5-12.5-1-2.2-0.5-5.1-1.8-6.5-2.8-1.4-1-3.5-3.6-4.7-5.8-1.3-2.1-2.6-6-3-8.7-0.8-4.5-0.9-4.7-4.1-4.7-3.1 0-3.2 0.2-4.3 5.8-0.6 3.1-1.7 6.8-2.4 8.2-0.7 1.4-2.6 3.7-4.2 5.2-1.5 1.5-3.9 3-5.3 3.3-2 0.6-3.3 0-6.8-3.1-2.4-2.2-4.3-4.2-4.2-4.6 0-0.5 1.3-0.8 3-0.8 1.6 0 3.9-0.4 5-1 1.1-0.6 2.9-2.9 4-5.2 1.1-2.4 2-5.9 2-7.8 0-1.9-0.6-4.4-1.4-5.5-1.3-1.8-2.6-2-14.4-2-11.6 0-13.2 0.2-17.1 4l-4-4.5c-2.1-2.5-3.7-4.8-3.5-5.2 0.2-0.5 1.9-1.5 3.6-2.3 2.5-1 7.5-1.4 19.5-1.5zm44.3 13.3c-0.8 2.3-0.8 4.4-0.1 7.5 0.6 2.3 2.1 5.3 3.3 6.6 1.7 1.7 3.9 2.5 8.3 3.1 3.3 0.4 8.2 0.4 11 0 2.7-0.3 5.8-1.1 6.7-1.6 1-0.5 2.5-2.5 3.3-4.4 0.8-1.9 1.5-5.2 1.5-7.2 0-2.1-0.7-4.8-1.5-6-1.4-2.2-2.1-2.3-15.3-2.2-7.5 0-14.2 0.3-14.9 0.5-0.6 0.3-1.7 2-2.3 3.7zm-40 126.7c0.3-0.1 2.2 2 8 9l-23.5 22.7 22.4 23.8-7.8 8-16.1-15.5c-8.8-8.5-16.2-15.8-16.3-16.2-0.1-0.3 7.3-7.6 16.3-16.2 9.1-8.6 16.7-15.6 17-15.6zm33.5 0l4 0.1c2.2 0.1 5 0.4 6.1 0.7 2.1 0.7 1.8 1.7-19.4 62.7l-5.3-0.3c-3-0.2-5.6-0.5-5.9-0.7-0.3-0.2 4.2-14.4 10-31.4zm20.7 3.9l2.7 1.9c1.4 1.1 8.2 7.3 27.6 26l-15.5 15.6c-8.5 8.6-16 15.6-16.7 15.6-0.7 0-2.9-2-8.3-8.5l23.2-22-6.8-6.7c-3.8-3.7-8.1-7.6-9.6-8.8-1.5-1.1-2.8-2.5-2.9-3.1 0-0.6 1.4-3.1 3.1-5.5z"/></g></svg>',cr=`data:image/svg+xml,${encodeURIComponent(Lp)}`;import{jsx as No,jsxs as dr}from"react/jsx-runtime";function wh(){let e=Ep();return Ap(()=>{e.isValid},[e.isValid]),e.isValid?null:dr("a",{href:"https://donotdev.com/pricing",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",insetInlineEnd:"20px",top:"50%",transform:"translateY(-50%)",zIndex:9999,display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",backgroundColor:"rgba(255, 255, 255, 0.95)",border:"2px solid rgba(242, 61, 41, 0.3)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",textDecoration:"none",transition:"all 0.2s ease",cursor:"pointer",opacity:.9},onMouseEnter:t=>{t.currentTarget.style.opacity="1",t.currentTarget.style.transform="translateY(-50%) scale(1.05)"},onMouseLeave:t=>{t.currentTarget.style.opacity="0.9",t.currentTarget.style.transform="translateY(-50%) scale(1)"},children:[No("img",{src:cr,alt:"DoNotDev Logo",style:{width:"48px",height:"48px",flexShrink:0}}),dr("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[No("div",{style:{fontFamily:"system-ui, sans-serif",fontSize:"13px",fontWeight:"600",color:"#27494a",lineHeight:"1.2"},children:"DoNotDev"}),No("div",{style:{fontFamily:"system-ui, sans-serif",fontSize:"11px",fontWeight:"500",color:"#f23d29",lineHeight:"1.2"},children:"Get License"})]})]})}ye();import{useEffect as Pp,useState as Io,useMemo as Rp}from"react";import{Stack as Lo,Spinner as Dp}from"@donotdev/components";import{useTranslation as pr,isFieldVisible as Fp}from"@donotdev/core";import{useCrud as Bp,DisplayFieldRenderer as Mp}from"@donotdev/crud";import{jsx as Ne,jsxs as zp}from"react/jsx-runtime";function Op({entity:e,id:t,t:o,className:n="",loadingMessage:r,notFoundMessage:a,viewerRole:i,excludeFields:l}){let d=L("userRole"),c=i??d,{get:s,loading:p,data:g,error:u,isAvailable:m}=Bp(e),[b,f]=Io(!1),[v,h]=Io(null),[T,C]=Io(null),{t:I}=pr([e.namespace,"crud"]),{t:P}=pr("crud"),w=o||I;Pp(()=>{if(!t){C(null),h(null),f(!1);return}if(!m||!s)return;let x=!1;return f(!0),h(null),s(t).then(A=>{x||(f(!1),A?(C(A),h(null)):(C(null),h(new Error("Entity not found"))))}).catch(A=>{x||(f(!1),h(A instanceof Error?A:new Error(String(A))),C(null))}),()=>{x=!0}},[t,s,m]);let D=g||T,k=u||v,y=p||b||!t,S=Rp(()=>D?Object.entries(e.fields).filter(([x,A])=>{if(l?.includes(x)||!Fp(A.visibility,c)||A.visibility==="hidden")return!1;let E=D[x];return!(E==null||typeof E=="string"&&E.trim()===""||Array.isArray(E)&&E.length===0||typeof E=="object"&&!Array.isArray(E)&&E!==null&&Object.keys(E).length===0)}):[],[e.fields,c,D,l]);return y?Ne("div",{style:{position:"relative",width:"100%",gridColumn:"1 / -1",display:"contents"},className:n,children:Ne(Dp,{overlay:!0,"aria-label":r||P("form.loading",{defaultValue:"Loading..."})})}):k||!D?Ne(Lo,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},className:n,children:zp(Lo,{direction:"column",gap:"tight",children:[Ne("h3",{style:{color:"var(--muted-foreground)"},children:a||P("errors.notFound",{defaultValue:`${e.name} not found`})}),k&&Ne("p",{style:{color:"var(--destructive)",fontSize:"var(--font-size-sm)"},children:k instanceof Error?k.message:String(k)})]})}):Ne(Lo,{direction:"column",className:n,children:S.map(([x,A])=>Ne(Mp,{name:x,config:A,value:D[x],t:w},x))})}import{RefreshCw as Vp,Plus as Up,Trash2 as _p,Edit as Gp,Search as Hp}from"lucide-react";import{useMemo as ur,useCallback as Xe,useState as Ao}from"react";import{DataTable as $p,Button as Eo,Stack as Po,ActionButton as Wp,Section as mr,Input as Kp}from"@donotdev/components";import{useTranslation as gr}from"@donotdev/core";import{translateFieldLabel as Yp,useCrud as qp,useCrudList as Zp,EntityFilters as jp,matchesFilter as Jp,formatValue as Qp,useCrudFilters as Xp}from"@donotdev/crud";import{Fragment as tu,jsx as ie,jsxs as At}from"react/jsx-runtime";function eu({entity:e,basePath:t,onClick:o,hideFilters:n=!1,pagination:r="client",pageSize:a,queryOptions:i,exportable:l=!0}){let d=Be(),c=t??`/${e.collection}`,[s,p]=Ao(1),[g,u]=Ao(a),{data:m,loading:b,mutate:f}=Zp(e,{pagination:r,...i&&{queryOptions:i},...r==="server"&&{page:s,pageSize:g}}),{delete:v}=qp(e),{t:h}=gr("crud"),T=m?.items||[],{t:C}=gr([e.namespace,"crud"]),{filters:I}=Xp({collection:e.collection}),[P,w]=Ao(""),D=Xe(async()=>{await f()},[f]),k=Xe(F=>{d(`${c}/${F}`)},[c,d]),y=Xe(F=>{o?o(F):d(`${c}/${F}`)},[c,d,o]),S=Xe(()=>{d(`${c}/new`)},[c,d]),x=Xe(async F=>{await v(F)},[v]),A=ur(()=>{let F=T;if(P){let te=P.toLowerCase();F=F.filter(H=>Object.values(H).some(M=>M==null?!1:String(M).toLowerCase().includes(te)))}return Object.keys(I).length>0&&(F=F.filter(te=>Object.entries(I).every(([H,M])=>{let ve=te[H],et=e.fields[H]?.type||"text";return Jp(ve,M,et)}))),F},[T,P,I,e.fields]),E=ur(()=>{let te=(e.listFields||Object.keys(e.fields)).map(H=>{let M=e.fields[H];if(!M)return null;let ve=Yp(H,M,C),he=M.type||"text";return{key:H,title:ve,dataIndex:H,sortable:!0,filterable:!0,align:he==="number"||he==="range"?"end":"start",render:(Bt,tt)=>Qp(Bt,M,C,{compact:!0})}}).filter(Boolean);return te.unshift({key:"_actions",title:h("actions.label",{defaultValue:"Actions"}),dataIndex:void 0,sortable:!1,width:120,align:"center",render:(H,M)=>At(Po,{direction:"row",gap:"tight",align:"center",justify:"center",children:[ie(Eo,{variant:"outline",icon:Gp,onClick:ve=>{ve.stopPropagation(),k(M.id)},"aria-label":h("edit",{defaultValue:"Edit"})}),ie(Wp,{action:async()=>{await x(M.id)},confirmText:h("delete.confirm",{defaultValue:"Are you sure you want to delete this item?"}),confirmTitle:h("delete.title",{defaultValue:"Delete Item"}),loadingText:h("delete.loading",{defaultValue:"Deleting..."}),variant:"destructive",icon:_p,"aria-label":h("delete",{defaultValue:"Delete"}),children:h("delete",{defaultValue:"Delete"})})]})}),te},[e,C,h,k,x]),fe=C("name",{defaultValue:e.name}),Z=A.length;return At(tu,{children:[ie(mr,{title:h("filters.title",{entity:fe,defaultValue:`Browse ${fe} - Filters`}),collapsible:!0,defaultOpen:!0,children:At(Po,{children:[At(Po,{direction:"row",gap:"tight",align:"center",className:"dndev-w-full",style:{display:"grid",gridTemplateColumns:"1fr auto auto"},children:[ie(Kp,{placeholder:h("search.placeholder",{defaultValue:"Search..."}),value:P,onChange:F=>w(F.target.value),icon:Hp,className:"dndev-w-full"}),ie(Eo,{icon:Vp,variant:"outline",onClick:D,disabled:b,display:"compact","aria-label":h("refresh",{defaultValue:"Refresh"})}),ie(Eo,{icon:Up,onClick:S,display:"compact",children:h("addNew",{defaultValue:"Add New"})})]}),!n&&ie(jp,{entity:e,data:T,fieldsToFilter:e.listFields})]})}),ie(mr,{title:b?h("results.title.fetching",{defaultValue:"Fetching..."}):h("results.title.count",{count:Z,defaultValue:Z===1?"Found 1 occurrence":`Found ${Z} occurrences`}),collapsible:!0,defaultOpen:!0,children:ie($p,{data:A,columns:E,sortable:!0,searchable:!1,pagination:!0,loading:b,onRowClick:F=>y(F.id),showingLabel:h("pagination.showing",{defaultValue:"Showing {{from}} to {{to}} of {{total}} entries"}),paginationPreviousLabel:h("pagination.previous",{defaultValue:"Previous"}),paginationNextLabel:h("pagination.next",{defaultValue:"Next"}),paginationItemsPerPagePlaceholder:h("pagination.itemsPerPagePlaceholder",{defaultValue:"Items per page"}),...a&&{pageSize:a},...r==="server"&&{currentPage:s,pageSize:g,total:m?.total,onPageChange:p,onPageSizeChange:u},exportable:l,exportFilename:`${e.collection}-export`,exportLabel:h("export",{defaultValue:"Export"})})})]})}import{useMemo as vr,useCallback as hr}from"react";import{Heart as yr}from"lucide-react";import{Card as nu,Grid as ru,Stack as Ro,Text as br,Spinner as au,Section as Sr,Button as iu}from"@donotdev/components";import{useTranslation as Cr,getListCardFieldNames as su}from"@donotdev/core";import{useCrudCardList as lu,EntityFilters as cu,useEntityFavorites as du,matchesFilter as pu,useCrudFilters as uu}from"@donotdev/crud";import{CrudCard as ou}from"@donotdev/crud";import{jsx as fr}from"react/jsx-runtime";function Et({detailHref:e,onClick:t,...o}){let n=fr(ou,{...o,onClick:e?void 0:t});return e?fr(N,{path:e,"aria-label":o.item?.id?`View ${o.item.id}`:void 0,children:n}):n}import{Fragment as gu,jsx as q,jsxs as Do}from"react/jsx-runtime";function mu({entity:e,basePath:t,onClick:o,cols:n=[1,2,3,4],staleTime:r=1e3*60*30,filter:a,hideFilters:i=!1,resultLabel:l,tone:d}){let c=Be(),s=t??`/${e.collection}`,{data:p,loading:g}=lu(e,{staleTime:r}),u=p?.items||[],{isFavorite:m,toggleFavorite:b,favoritesFilter:f}=du({collection:e.collection}),{showFavoritesOnly:v,setShowFavoritesOnly:h,filters:T}=uu({collection:e.collection}),C=hr(S=>Object.keys(T).length===0?!0:Object.entries(T).every(([x,A])=>{let E=S[x],Z=e.fields[x]?.type||"text";return pu(E,A,Z)}),[T,e.fields]),I=vr(()=>{let S=u;return S=S.filter(C),v&&(S=S.filter(f)),a&&(S=S.filter(a)),S},[u,C,v,f,a]),{t:P}=Cr([e.namespace,"crud"]),{t:w}=Cr("crud"),D=hr(S=>{o?o(S):c(`${s}/${S}`)},[s,c,o]),k=vr(()=>su(e),[e]),y=P("name",{defaultValue:e.name});return Do(gu,{children:[!i&&q(Sr,{title:w("filters.title",{entity:y,defaultValue:`Browse ${y} - Filters`}),collapsible:!0,defaultOpen:!0,tone:d,children:q(nu,{children:Do(Ro,{direction:"column",children:[q(iu,{variant:v?"primary":"outline",icon:q(yr,{size:18}),onClick:()=>h(!v),children:v?w("favorites.showAll",{defaultValue:"Show All"}):w("favorites.showFavorites",{defaultValue:"Show Favorites"})}),q(cu,{entity:e,data:u,fieldsToFilter:k})]})})}),q(Sr,{title:g?w("results.title.fetching",{defaultValue:"Fetching..."}):l?l(I.length):w("results.title.count",{count:I.length,defaultValue:I.length===1?"Found 1 occurrence":`Found ${I.length} occurrences`}),collapsible:!0,defaultOpen:!0,tone:d,children:g?q(Ro,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)"},children:q(au,{})}):I.length===0?Do(Ro,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},children:[q(br,{level:"h3",style:{color:"var(--muted-foreground)"},children:w("emptyState.title",{defaultValue:`No ${e.name.toLowerCase()} found`})}),q(br,{style:{color:"var(--muted-foreground)"},children:w("emptyState.description",{defaultValue:`No ${e.name.toLowerCase()} available at this time.`})})]}):q(ru,{cols:n,children:I.map(S=>{let x=m(S.id),A=o?void 0:`${s}/${S.id}`;return q(Et,{item:S,entity:e,detailHref:A,onClick:o?()=>D(S.id):void 0,renderActions:q(yr,{fill:x?"#ef4444":"#ffffff",stroke:x?"#ef4444":"var(--muted-foreground)",onClick:E=>{E.preventDefault(),E.stopPropagation(),b(S.id)},style:{cursor:"pointer",width:"var(--icon-md)",height:"var(--icon-md)",transition:"fill 0.2s, stroke 0.2s"},"aria-label":x?w("favorites.remove",{defaultValue:"Remove from favorites"}):w("favorites.add",{defaultValue:"Add to favorites"})})},S.id)})})})]})}import{useEffect as xr,useId as fu,useMemo as Pt,useState as vu}from"react";import{FormProvider as hu}from"react-hook-form";import{Badge as yu,Button as Rt,DropdownMenu as bu,Grid as Su,Stack as Cu,Spinner as xu}from"@donotdev/components";import{hasRoleAccess as ku,useTranslation as kr}from"@donotdev/core";ye();import{DisplayFieldRenderer as Tu,FormFieldRenderer as wu,UploadProvider as Nu,useEntityForm as Iu,useUnsavedChangesWarning as Lu,useFormStore as Au}from"@donotdev/crud";import{jsx as j,jsxs as Dt}from"react/jsx-runtime";function Eu({entity:e,onSubmit:t,t:o,className:n="",submitText:r,loading:a=!1,defaultValues:i,submitVariant:l="primary",secondaryButtonText:d,secondaryButtonVariant:c="outline",onSecondarySubmit:s,viewerRole:p,operation:g=i?"edit":"create",formId:u,cancelText:m,cancelPath:b,successPath:f,onCancel:v,warnOnUnsavedChanges:h=!0,unsavedChangesMessage:T,hideVisibilityInfo:C=!1}){let I=Be(),P=L("userRole"),w=p??P,D=fu(),k=u??`entity-form-${e.name}-${D}`,{t:y}=kr([e.namespace,"crud"]),{t:S}=kr("crud"),x=o||y,E=!C&&(w==="admin"||w==="super"),fe=w==="user"||w==="admin"||w==="super",[Z,F]=vu(w==="admin"||w==="super"||w==="user"?w:"guest"),te={guest:"muted",user:"secondary",admin:"warning",super:"destructive",technical:"accent",owner:"secondary"},H=["guest","user","admin","super"],M={guest:"Guest",user:"User",admin:"Admin",super:"Super",technical:"System"},ve=Pt(()=>H.filter(R=>ku(w,R)).map(R=>({label:M[R],checked:Z===R,onClick:()=>F(R)})),[Z,w]),he=Iu(e,{formId:k,operation:g,defaultValues:i,viewerRole:w,t:x}),{control:et,handleSubmit:Fo,formState:{errors:Bt},fields:tt,formStatus:ot,uploadProgress:Ve,cleanup:Bo,isDirty:Ar,hasUserInteracted:Er,resetForm:Pr}=he,Mt=Ar&&Er,Rr=Pt(()=>{if(!fe)return tt;let R=H.indexOf(Z);return tt.filter(({config:W})=>{let oe=W.visibility;return oe==="hidden"?!1:oe==="technical"?!0:H.indexOf(oe)<=R})},[tt,fe,Z]);xr(()=>{k&&Au.getState().setIsDirty(k,Mt)},[k,Mt]),xr(()=>Bo,[Bo]);let Dr=Pt(()=>T||S("messages.unsavedChangesLeave",{defaultValue:"You have unsaved changes. Are you sure you want to leave?"}),[T,S]);Lu({isDirty:Mt,enabled:h,message:Dr});let Fr=()=>{Pr(),v?v():I(b||"back")},Br=async R=>{try{await t(R),I(f||"back")}catch{}},Mr=m!==null,Mo=m??S("form.cancel",{defaultValue:"Cancel"}),Oo={gridColumn:"1 / -1",position:"sticky",bottom:0,backgroundColor:"var(--background)",borderTop:"1px solid var(--border)",paddingTop:"var(--gap-md)",paddingBottom:"var(--gap-md)",zIndex:10,marginTop:"var(--gap-lg)"},Or=a||g==="edit"&&!i,se=Pt(()=>ot==="uploading"?{loading:!0,loadingText:Ve<100?S("form.uploading",{progress:Math.round(Ve),defaultValue:`Uploading ${Math.round(Ve)}%...`}):S("form.processing",{defaultValue:"Processing..."}),progress:Ve}:ot==="validating"?{loading:!0,loadingText:S("form.validating",{defaultValue:"Validating..."})}:ot==="submitting"?{loading:!0,loadingText:S("form.saving",{defaultValue:"Saving..."})}:{loading:!1},[ot,Ve,S]);return j(hu,{...he,children:j(Nu,{formId:k,children:Dt("div",{style:{position:"relative",width:"100%",gridColumn:"1 / -1",display:"contents"},children:[Or&&j(xu,{overlay:!0}),Dt("form",{onSubmit:Fo(Br),noValidate:!0,className:n,style:{width:"100%",gridColumn:"1 / -1",display:"contents"},children:[Rr.map(({name:R,config:W,editable:oe})=>{let Ie=E&&W.visibility!=="guest",zr=W.visibility!=="hidden"?te[W.visibility]:void 0,Vr=M[W.visibility]??W.visibility,zo=oe?j(wu,{name:R,config:W,control:et,errors:Bt,t:x},R):j(Tu,{name:R,config:W,value:i?.[R],t:x},R);return Ie?Dt("div",{style:{position:"relative"},children:[j(yu,{as:"span",variant:zr,style:{position:"absolute",top:0,insetInlineEnd:0,fontSize:"var(--font-size-xs)",zIndex:1},children:Vr}),zo]},R):zo}),(()=>{let R=[];if(Mr&&Mo&&R.push(j(Rt,{type:"button",onClick:Fr,disabled:se.loading,variant:"outline",className:"dndev-w-full",children:Mo},"cancel")),fe){let Ie=te[Z]||"muted";R.push(j(bu,{trigger:Dt(Rt,{type:"button",variant:Ie,disabled:se.loading,className:"dndev-w-full",children:[S("visibility.preview",{defaultValue:"Preview"}),": ",M[Z]]}),items:ve},"preview"))}d&&R.push(j(Rt,{type:"button",onClick:()=>{if(s){let Ie=he.getValues();s(Ie)}},loading:se.loading,loadingText:se.loadingText,progress:se.progress,variant:c,className:"dndev-w-full",children:d},"secondary")),R.push(j(Rt,{type:"submit",loading:se.loading,loadingText:se.loadingText,progress:se.progress,variant:l,className:"dndev-w-full",children:r||S("form.submit",{defaultValue:"Submit"})},"submit"));let W=R.length;if(W===1)return j(Cu,{direction:"column",gap:"tight",style:Oo,children:R[0]});let oe=W===2?"1fr 2fr":W===3?"1fr 1fr 2fr":"1fr 1fr 1fr 2fr";return j(Su,{cols:["1fr",oe,oe,oe],gap:"tight",style:Oo,children:R})})()]})]})})})}import{Section as Pu}from"@donotdev/components";import{useCrudCardList as Ru}from"@donotdev/crud";import{jsx as Tr}from"react/jsx-runtime";function Du({entity:e,queryOptions:t,title:o,basePath:n,cols:r=3,className:a}){let{items:i,loading:l}=Ru(e,{queryOptions:t});if(!l&&i.length===0)return null;let d=n??`/${e.collection}`;return Tr(Pu,{title:o,gridCols:r,className:a,children:i.map(c=>Tr(Et,{item:c,entity:e,detailHref:`${d}/${c.id}`},c.id))})}import{createContext as Nr,useId as Fu,use as wr}from"react";import{Controller as Bu,FormProvider as Mu,useFormContext as Ou}from"react-hook-form";import{Label as zu,Slot as Vu,cn as Uu,Stack as _u}from"@donotdev/components";import{jsx as ge}from"react/jsx-runtime";var b3=Mu,Ir=Nr({}),S3=({...e})=>ge(Ir.Provider,{value:{name:e.name},children:ge(Bu,{...e})}),Lr=Nr({}),C3=({className:e,...t})=>{let o=Fu();return ge(Lr.Provider,{value:{id:o},children:ge(_u,{className:e,...t})})},Ft=()=>{let e=wr(Ir);if(!e||!e.name)return null;let t=wr(Lr);if(!t)return null;let{getFieldState:o,formState:n}=Ou(),r=o(e.name,n),{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},x3=({className:e,...t})=>{let o=Ft();if(!o)return null;let{error:n,formItemId:r}=o;return ge(zu,{className:Uu(n&&"text-destructive",e),htmlFor:r,...t})},k3=({...e})=>{let t=Ft();if(!t)return null;let{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=t;return ge(Vu,{id:n,"aria-describedby":o?`${r} ${a}`:`${r}`,"aria-invalid":!!o,...e})},T3=({className:e,...t})=>{let o=Ft();if(!o)return null;let{formDescriptionId:n}=o;return ge("p",{id:n,className:e,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},...t})},w3=({className:e,children:t,...o})=>{let n=Ft();if(!n)return null;let{error:r,formMessageId:a}=n,i=r?String(r?.message):t;return i?ge("p",{id:a,className:e,style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:"var(--destructive)"},...o,children:i}):null};var Gu={layoutContainer:"dndev-layout",sidebar:"sidebar",sidebarTop:"sidebar-top",sidebarContent:"sidebar-content",sidebarBottom:"sidebar-bottom",sidebarResizeHandle:"dndev-sidebar-resize-handle",header:"header",main:"main",footer:"footer",container:"dndev-container",pageContainer:"dndev-container",breadcrumbsContainer:"breadcrumbs-container"},Hu={zHeader:"dndev-z-header",zSidebar:"dndev-z-sidebar",zOverlay:"dndev-z-overlay",zModal:"dndev-z-modal",zTooltip:"dndev-z-tooltip",zToast:"dndev-z-toast"},B3={...Gu,...Hu},M3={headerHeight:"--header-height",headerPadding:"--header-padding",headerIconSize:"--header-icon-size",headerLogoMaxHeight:"--header-logo-max-height",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",mainPadding:"--main-padding",mainMaxWidth:"--main-max-width",contentWidth:"--content-width",contentPadding:"--content-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zOverlay:"--z-overlay",zModal:"--z-modal",zTooltip:"--z-tooltip",zToast:"--z-toast"},O3={headerHeight:"--header-height",headerPadding:"--header-padding",logoSize:"--logo-size",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",layoutGap:"--layout-gap",sectionGap:"--gap-lg",contentGap:"--content-gap",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zModal:"--z-modal",zTooltip:"--z-tooltip"};export{Dc as AppBranding,Mc as AppIcon,al as AppLoading,Vc as AppTitle,$ as AssetResolver,Ca as AuthGuard,p1 as AuthGuardFallback,ao as AuthHeader,no as AuthMenu,Jc as Breadcrumbs,ho as CacheSettings,$2 as ConsentBanner,mn as DnDevNavigationMenu,hd as DropdownNavigation,mu as EntityCardList,Op as EntityDisplayRenderer,Eu as EntityFormRenderer,eu as EntityList,Du as EntityRecommendations,Xl as FeatureCard,gl as FeatureDisabled,Cd as FloatingLanguageSwitcher,wo as FooterBranding,yp as FooterCopyright,Np as FooterLegalLinks,b3 as Form,k3 as FormControl,T3 as FormDescription,S3 as FormField,C3 as FormItem,x3 as FormLabel,w3 as FormMessage,Z2 as GameContainer,X2 as GameFlow,td as GameTitle,h1 as GoTo,Ui as GoToInput,Pi as GoToWrapper,Id as HeaderMenu,Fd as HeaderNavigation,Hr as Icon,wh as LicenseWatermark,N as Link,at as Loader,Il as LoadingContainerOverlay,Ct as LoadingMessage,yl as LoadingMessageAlmostDone,bl as LoadingMessageComplete,kl as LoadingMessageConnecting,hl as LoadingMessageProcessing,Sl as LoadingMessageSaving,xl as LoadingMessageSearching,vl as LoadingMessageSimple,Cl as LoadingMessageUploading,Ll as LoadingOverlay,Pl as LoadingScreen,gn as NotFoundPage,Wd as Notifications,ut as PageContainer,$l as ProgressBar,_l as RedirectOverlay,np as SettingsMenu,Yl as Skeleton,Sc as TechBento,dp as ThemeToggle,B3 as allLayoutClasses,Dm as createAuthConfig,O3 as cssVariables,pm as isAuthAvailable,qg as isBillingAvailable,Gg as isFormStoreAvailable,of as isOAuthAvailable,Gu as layoutClasses,Hu as layoutUtilities,M3 as layoutVariables,Vg as resolveFaviconSet,zg as resolveLogo,Oe as sanitizeSvg,lf as tList,uo as techLogos,L as useAuthSafe,Pm as useAuthState,ht as useAuthVisibility,wg as useBack,Qg as useBillingVisibility,Lm as useCanAccess,xa as useCanNavigate,Ft as useFormField,as as useFormStoreSafe,on as useGoTo,Em as useHasRole,Lg as useLocation,Rg as useMatch,Be as useNavigate,K as useNavigationItems,en as useNavigationRoute,tf as useOAuthSafe,Ag as useParams,Ig as usePrefetch,Dg as useQueryParams,Fg as useRedirectGuard,Ng as useRefresh,Eg as useRouteParam,Pg as useSearchParams,to as useStripeBillingSafe,Am as useUserRole,Rm as withAuth};
|
|
3
|
+
`);try{await navigator.clipboard.writeText(f),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},u=()=>{try{t()}catch{typeof window<"u"&&window.location.reload()}},y=()=>{try{l()}catch{typeof window<"u"&&window.history.back()}};return U("div",{className:"dndev-container","data-variant":"standard","data-centered":"true",children:U(jo,{variant:Jo.DEFAULT,elevated:!0,className:"dndev-w-full",style:{maxWidth:"65ch",margin:"0 auto"},children:he(Le,{gap:"large",align:"center",className:"dndev-text-center",children:[U(Le,{align:"center",justify:"center",style:{width:"5rem",height:"5rem",backgroundColor:"rgba(220, 38, 38, 0.1)",borderRadius:"50%",border:"1px solid var(--destructive)"},children:U(ka,{style:{width:"2.5rem",height:"2.5rem",color:"var(--destructive)"},"aria-hidden":"true"})}),he(Le,{children:[U("h1",{className:"dndev-text-base","data-level":"h1",style:{fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-bold)",margin:0},children:r("routeError.title","Something went wrong")}),U("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",margin:0},children:r("routeError.description","We encountered an error while loading this page.")}),U(Ea,{variant:Ra.SUCCESS,hideIcon:!0,children:U("div",{style:{fontSize:"var(--font-size-sm)",textAlign:"center"},children:r("routeError.dataSafe","Don't worry, your data is safe.")})})]}),n&&he("code",{style:{padding:"var(--gap-sm) var(--gap-md)",background:"var(--muted)",borderRadius:"var(--radius-full)",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",color:"var(--foreground)"},children:[r("routeError.errorId","Error ID"),": ",n]}),g&&s&&he(jo,{variant:Jo.MUTED,className:"dndev-w-full",children:[he(Le,{direction:"row",align:"center",justify:"between",children:[U("span",{className:"dndev-text-base",style:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-semibold)",color:"var(--destructive)"},children:"Error Message:"}),U(lt,{variant:ct.GHOST,icon:a?Aa:Ia,onClick:m,disabled:a,children:a?r("routeError.copied","Copied"):r("routeError.copyDetails","Copy Details")})]}),U("pre",{style:{fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",wordBreak:"break-word",whiteSpace:"pre-wrap",color:"var(--foreground)",margin:0,marginTop:"var(--gap-sm)"},children:s})]}),he(Le,{className:"dndev-w-full",children:[U(lt,{variant:ct.DESTRUCTIVE,icon:Na,onClick:u,fullWidth:!0,children:r("routeError.tryAgain","Try Again")}),he(Le,{direction:"row",justify:"center",children:[U(I,{path:"/",children:U(lt,{variant:ct.DEFAULT,icon:Ta,fullWidth:!0,children:r("routeError.goHome","Go Home")})}),U(lt,{variant:ct.OUTLINE,icon:wa,onClick:y,fullWidth:!0,children:r("routeError.goBack","Go Back")})]})]}),U("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",margin:0},children:r("routeError.contactSupport","If the problem persists, please contact support.")})]})})})},Qo=Oa;import{jsx as Ue}from"react/jsx-runtime";var dt=({variant:e="standard",density:t,className:o,children:n,centered:r=!0,gapFirst:a=!1})=>Ue(Zo,{level:"route",fallback:i=>Ue(za,{fallback:Ue("div",{children:"Loading error fallback..."}),children:Ue(Qo,{...i})}),children:Ue("div",{className:Va("dndev-container",o),"data-variant":e,"data-density":t,"data-centered":r?"true":"false","data-gap-first":a?"true":void 0,children:n})});import{Fragment as Qa,jsx as B,jsxs as _e}from"react/jsx-runtime";var Ja=Ha(()=>import("@donotdev/auth").then(e=>({default:e.MultipleAuthProviders})));function l1({title:e,description:t,showBackButton:o=!0,onBack:n,className:r=""}){let{t:a}=qa(["auth","common"]),i=Za(),l=ja(),d=()=>{n?n():l()};return B(dt,{variant:"docs",children:B(Pe,{align:"center",justify:"center",className:Ya("dndev-min-h-60",r),style:{paddingTop:"var(--gap-lg)",paddingBottom:"var(--gap-lg)"},children:B($a,{className:"dndev-w-full",style:{maxWidth:"28rem",border:"none",boxShadow:"var(--shadow-xl)"},title:_e(Pe,{children:[B(Pe,{justify:"center",children:B("div",{style:{borderRadius:"9999px",backgroundColor:"color-mix(in oklab, var(--primary) 10%, transparent)",padding:"var(--gap-md)"},children:B(_a,{className:"dndev-size-touch",style:{color:"var(--primary)"}})})}),B("div",{style:{fontSize:"var(--font-size-2xl)",fontWeight:700},children:a("auth.fallback.title","Authentication Required")}),B("p",{style:{color:"var(--muted-foreground)"},children:a("auth.fallback.description","Please sign in to access this page")})]}),children:_e(Pe,{children:[_e(Pe,{gap:"large",children:[B("div",{children:B("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:a("auth.fallback.chooseProvider")})}),B(Ga,{fallback:B("div",{children:"Loading providers..."}),children:B(Ja,{layout:"vertical",spacing:"tight",fullWidth:!0,ariaLabel:a("auth.fallback.authOptions")})})]}),o&&_e(Qa,{children:[B(Ka,{}),B("div",{children:B(Wa,{onClick:d,className:"dndev-gap-sm",icon:Ua,children:a("common.back")})})]}),_e(Pe,{gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:[B("p",{children:a("auth.fallback.secure")}),B("p",{children:a("auth.fallback.terms")})]})]})})})})}import{Search as Xa}from"lucide-react";import{Button as ei,BUTTON_VARIANT as ti,DISPLAY as oi}from"@donotdev/components";import{useOverlayStore as ni,useTranslation as ri}from"@donotdev/core";import{jsx as ai,jsxs as ii}from"react/jsx-runtime";var g1=({display:e=oi.AUTO,className:t,onOpen:o})=>{let{t:n}=ri("dndev"),r=ni(d=>d.openCommandDialog),i=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgentData?.platform??navigator.platform)?"\u2318K":"Ctrl+K",l=()=>{r(),o?.()};return ii(ei,{variant:ti.OUTLINE,display:e,icon:Xa,onClick:l,className:t,"aria-label":n("goTo.ariaLabel","Go to page"),children:[n("goTo.label","Go to"),ai("kbd",{style:{marginInlineStart:"var(--gap-sm)",padding:"0.125rem 0.375rem",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",opacity:.5},children:i})]})};import{Suspense as ki,lazy as Ti}from"react";import{useEventListener as wi,useOverlayStore as Ni}from"@donotdev/core";import{jsx as sn}from"react/jsx-runtime";var Ii=Ti(()=>Promise.resolve().then(()=>(an(),rn))),Ai=()=>{let e=Ni(t=>t.openCommandDialog);return wi("keydown",t=>{(t.metaKey||t.ctrlKey)&&t.key==="k"&&(t.preventDefault(),e())},{target:document,options:{passive:!1,capture:!1}}),sn(ki,{fallback:null,children:sn(Ii,{})})},Li=Ai;import{Search as Pi}from"lucide-react";import{useCallback as ln,useEffect as Ei,useState as Ri,useRef as Di}from"react";import{Stack as Fi}from"@donotdev/components";import{useOverlayStore as Yt}from"@donotdev/core";import{useTranslation as Bi}from"@donotdev/core";import{jsx as ut,jsxs as Vi}from"react/jsx-runtime";var Mi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),Oi=()=>{let{t:e}=Bi("dndev"),[t,o]=Ri(""),n=Di(null),r=Yt(l=>l.isCommandDialogOpen);Ei(()=>{r||o("")},[r]);let a=ln(()=>{Yt.getState().openCommandDialog(t)},[t]),i=ln(l=>{l.key==="Enter"&&(l.preventDefault(),Yt.getState().openCommandDialog(t))},[t]);return Vi(Fi,{direction:"row",align:"center",className:"dndev-relative dndev-w-full dndev-max-w-sm",role:"search",children:[ut(Pi,{className:"dndev-absolute dndev-size-md",style:{insetInlineStart:"0.75rem",opacity:.5},"aria-hidden":"true"}),ut("input",{ref:n,type:"text",value:t,onChange:l=>o(l.target.value),onFocus:a,onKeyDown:i,placeholder:e("globalGoTo.searchPlaceholder","Search pages..."),className:"dndev-input dndev-w-full",style:{paddingInlineStart:"2.5rem",paddingInlineEnd:"5rem"},"aria-label":e("globalGoTo.ariaLabel","Search navigation")}),ut("div",{className:"dndev-absolute dndev-flex dndev-items-center dndev-text-sm",style:{insetInlineEnd:"0.75rem",gap:"0.25rem",opacity:.5},"aria-hidden":"true",children:ut("kbd",{style:{padding:"0.25rem 0.5rem",fontSize:"var(--font-size-xs)",fontFamily:"var(--font-mono)",borderRadius:"var(--radius-sm)"},children:Mi?"\u2318K":"Ctrl+K"})})]})},zi=Oi;import{MoreHorizontal as Ui,Link as cn}from"lucide-react";import{useState as _i,useEffect as dn,useRef as Gi,useMemo as Hi}from"react";import{NavigationMenu as pn,NavigationMenuListPrimitive as $i,NavigationMenuItemPrimitive as un,Button as Wi,DropdownMenu as Ki,cn as mt,DISPLAY as Yi}from"@donotdev/components";import{useTranslation as qi}from"@donotdev/core";ye();ie();import{jsx as Z,jsxs as qt}from"react/jsx-runtime";var mn=({routes:e,vertical:t=!1,display:o=Yi.AUTO,overflowDetection:n=!1,showIcons:r=!0,className:a,style:i})=>{let{t:l}=qi("dndev"),d=$(),c=e??d,s=Gi(null),[p,g]=_i(c.length),m=Hi(()=>c.map(u=>({label:u.label,path:u.path,icon:Z(z,{icon:u.icon,fallback:cn}),children:u.children?u.children.map(y=>({label:y.label,path:y.path,icon:Z(z,{icon:y.icon,fallback:cn})})):void 0})),[c]);if(dn(()=>{if(!n||c.length===0||t)return;let u=()=>{let f=s.current;if(!f)return;let h=f.getBoundingClientRect(),S=f.querySelectorAll("[data-nav-item]"),C=f.querySelector("[data-more-button]"),T=0,N=C?.offsetWidth||0;for(let x=0;x<S.length;x++){let A=S[x];if(!A)break;if(A.getBoundingClientRect().right-h.left+(x===S.length-1&&C?N:0)<=h.width)T=x+1;else break}g(Math.max(0,T))},y=new ResizeObserver(u);return s.current&&y.observe(s.current),setTimeout(u,0),()=>y.disconnect()},[n,c.length,t]),dn(()=>{n&&!t&&g(c.length)},[c.length,n,t]),c.length===0)return null;if(n&&!t){let u=m.slice(0,p),y=m.slice(p);return Z(pn,{className:mt(a),style:i||{flex:1},children:qt($i,{ref:s,"data-vertical":"false",style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)",flexWrap:"nowrap",overflow:"hidden"},children:[u.filter(f=>f.path).map((f,h)=>Z(un,{"data-nav-item":!0,children:qt(I,{path:f.path,className:mt("dndev-interactive"),"data-role":"nav-trigger",children:[r&&f.icon,Z("span",{className:"dndev-interactive-label",children:f.label})]})},f.path||h)),y.length>0&&Z(un,{"data-more-button":!0,children:Z(Ki,{trigger:Z(Wi,{className:"dndev-size-touch",style:{flexShrink:0},"aria-label":l("navigation.more","More"),children:Z(Ui,{className:"dndev-size-md"})}),items:y.filter(f=>f.path).map(f=>({label:f.label,children:qt(I,{path:f.path,className:mt("dndev-interactive"),"data-role":"menu-item",children:[r&&f.icon,Z("span",{className:"dndev-interactive-label",children:f.label})]}),asChild:!0})),contentWidth:"14rem",contentAlign:"end"})})]})})}return Z(pn,{items:m,vertical:t,display:o,className:mt(a,t&&"dndev-sidebar-nav-menu"),LinkComponent:I})};import{Home as Zi,ArrowLeft as ji,Link as Ji}from"lucide-react";import{useMemo as Qi}from"react";import{Button as Zt,BUTTON_VARIANT as jt,Stack as He,Text as Jt}from"@donotdev/components";import{useTranslation as Xi}from"@donotdev/core";import{useLocation as es,useNavigate as ts}from"@donotdev/ui/routing/hooks";ye();ie();import{jsx as W,jsxs as gt}from"react/jsx-runtime";function gn(){let{t:e}=Xi("dndev"),t=es(),o=ts(),n=$(),r=Qi(()=>n.filter(i=>!i.path.includes(":")&&i.path!=="/").slice(0,4),[n]),a=()=>{o("back")};return W(dt,{variant:"docs",centered:!0,children:gt(He,{gap:"large",align:"center",justify:"center",children:[gt(He,{align:"center",children:[W(Jt,{level:"h1",style:{fontSize:"clamp(4rem, 12vw, 8rem)",fontWeight:"var(--font-weight-bold)",lineHeight:1,letterSpacing:"-0.02em",background:"linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",margin:0},children:"404"}),W(Jt,{level:"h2",style:{fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)",margin:0},children:e("errors.notFound.title","Page Not Found")}),W(Jt,{style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",textAlign:"center",margin:0},children:e("errors.notFound.description","The page you're looking for doesn't exist or has been moved.")}),t.pathname&&W("code",{style:{padding:"var(--gap-sm) var(--gap-md)",background:"var(--muted)",borderRadius:"var(--radius-md)",fontSize:"var(--font-size-sm)",fontFamily:"var(--font-mono)",color:"var(--foreground)",wordBreak:"break-all",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",border:"1px solid var(--border-hairline)"},children:t.pathname})]}),r.length>0&>(He,{align:"center",children:[W("p",{className:"dndev-text-base",style:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-semibold)",margin:0,color:"var(--muted-foreground)"},children:e("errors.notFound.suggestions","You might be looking for:")}),W(He,{direction:"row",wrap:"wrap",justify:"center",gap:"tight",children:r.map(i=>W(I,{path:i.path,replace:!0,children:W(Zt,{variant:jt.OUTLINE,icon:W(z,{icon:i.icon,fallback:Ji}),"aria-label":e("errors.notFound.navigateTo",`Navigate to ${i.label}`,{label:i.label}),children:i.label})},i.path))})]}),gt(He,{direction:"row",wrap:"wrap",justify:"center",children:[W(I,{path:"/",replace:!0,children:W(Zt,{variant:jt.DEFAULT,icon:Zi,"aria-label":e("errors.notFound.goHome","Go to home page"),children:e("errors.notFound.goHome","Go Home")})}),W(Zt,{variant:jt.OUTLINE,icon:ji,onClick:a,"aria-label":e("errors.notFound.goBack","Go back to previous page"),children:e("errors.notFound.goBack","Go Back")})]})]})})}ye();Wt();import{useNavigate as Re,useBack as xg,useRefresh as kg,usePrefetch as Tg,useLocation as wg,useParams as Ng,useRouteParam as Ig,useSearchParams as Ag,useMatch as Lg,useQueryParams as Pg,useRedirectGuard as Eg}from"@donotdev/ui/routing/hooks";import{getDndevConfig as Qt,isClient as be,isDev as fn}from"@donotdev/core";var G=class{static getBrowserSupport(){if(!be())return{svg:!0,webp:!1,avif:!1};let t=this.cache.get("browser-support");if(t)return t;let o={svg:!0,webp:!1,avif:!1};try{let n=document.createElement("canvas");n.width=1,n.height=1,o.webp=n.toDataURL("image/webp").indexOf("data:image/webp")===0}catch{o.webp=!1}try{let n=document.createElement("canvas");n.width=1,n.height=1,o.avif=n.toDataURL("image/avif").indexOf("data:image/avif")===0}catch{o.avif=!1}return this.cache.set("browser-support",o),o}static extractStringValues(t){let o=[];if(t==null)return o;if(typeof t=="string")o.push(t);else if(Array.isArray(t))for(let n of t)o.push(...this.extractStringValues(n));else if(typeof t=="object")for(let n of Object.values(t))o.push(...this.extractStringValues(n));return o}static assetExists(t){if(!be())return!1;let o=this.getAssetManifest();return o?this.extractStringValues(o).includes(t):!1}static getAssetManifest(){return be()&&Qt()?.assets?.mapping||null}static getLogoSvgContent(){return Qt()?.assets?.logoSvgContent||null}static resolveLogo(t){if(t)return t;let o="logo";if(this.cache.has(o))return this.cache.get(o);let r=this.getAssetManifest()?.logo?.optimal||"/logo.svg";return this.cache.set(o,r),r}static directAssetCheck(t){if(!be())return!1;try{let o=new Image;return o.src=t,!0}catch{return!1}}static resolveFaviconSet(){let t="favicon-set";if(this.cache.has(t))return this.cache.get(t);let o=this.getAssetManifest();if(o?.favicon?.set){let a=o.favicon.set,i=this.assetExists("/icon-512x512.png")?"/icon-512x512.png":this.assetExists("/icon-192x192.png")?"/icon-192x192.png":"/logo.svg",l={svg:a.svg||"/favicon.svg",ico:a.ico||"/favicon.ico",png16:a.png16||i,png32:a.png32||i,apple180:a.apple180||i,android192:a.android192||i,android512:a.android512||i};return this.cache.set(t,l),l}let n=this.assetExists("/icon-512x512.png")?"/icon-512x512.png":this.assetExists("/icon-192x192.png")?"/icon-192x192.png":"/logo.svg",r={svg:this.assetExists("/favicon.svg")?"/favicon.svg":"/logo.svg",ico:this.assetExists("/favicon.ico")?"/favicon.ico":"/favicon.svg",png16:this.assetExists("/favicon-16x16.png")?"/favicon-16x16.png":n,png32:this.assetExists("/favicon-32x32.png")?"/favicon-32x32.png":n,apple180:this.assetExists("/apple-touch-icon.png")?"/apple-touch-icon.png":n,android192:this.assetExists("/icon-192x192.png")?"/icon-192x192.png":n,android512:this.assetExists("/icon-512x512.png")?"/icon-512x512.png":n};return this.cache.set(t,r),r}static resolveFavicon(){let t=this.getAssetManifest();if(t?.favicon?.optimal)return t.favicon.optimal;let o=["/favicon.svg","/favicon.ico","/favicon.png","/logo.svg"];for(let n of o)if(this.assetExists(n))return n;return"/favicon.svg"}static clearCache(){this.cache.clear(),fn()&&be()}static getDebugInfo(){return{browserSupport:this.getBrowserSupport(),detectedAssets:be()?Qt()?.assets?.mapping:null,assetManifest:this.getAssetManifest(),cache:Object.fromEntries(this.cache)}}};tt(G,"cache",new Map);function Bg(e){return G.resolveLogo(e)}function Mg(){return G.resolveFaviconSet()}fn()&&(G.clearCache(),be()&&window.addEventListener("DOMContentLoaded",()=>{G.clearCache()}));import*as os from"@donotdev/crud";var vn={forms:{},startSubmit:()=>{},setUploading:()=>{},setValidating:()=>{},setSubmitting:()=>{},setSuccess:()=>{},setError:()=>{},reset:()=>{},cleanup:()=>{},setIsDirty:(e,t)=>{},hasDirtyForms:()=>!1,getDirtyFormIds:()=>[],getStatus:()=>"idle",isLoading:()=>!1,getUploadProgress:()=>0,getError:()=>null,getIsDirty:()=>!1},De=os?.useFormStore,Vg=typeof De=="function";function ns(e){return De?De(e):e(vn)}ns.getState=()=>De&&typeof De.getState=="function"?De.getState():vn;fe();import{useMemo as rs}from"react";function ft(){let e=L("status"),t=L("isAvailable"),o=L("user");return rs(()=>({shouldHide:e!=="ready"||!t,isLoading:e==="initializing",isReady:e==="ready"&&t,isAuthenticated:!!o}),[e,t,o])}import*as as from"@donotdev/billing";import{DEGRADED_BILLING_API as is}from"@donotdev/core";var Xt=as?.useStripeBilling;function ss(e){return is[e]}function eo(e,t){return Xt?Xt(e,t):ss(e)}var Wg=typeof Xt=="function";fe();function Zg(){let e=L("user"),t=L("status"),o={user:e,status:t},n=eo("status",o),r=eo("isAvailable",o);return{shouldHide:!r,isLoading:n==="initializing",isReady:r&&n==="ready"}}import{DEGRADED_OAUTH_API as ls}from"@donotdev/core";import*as cs from"@donotdev/oauth";var to=cs?.useOAuth;function ds(e){return ls[e]}function Qg(e){return to?to(e):ds(e)}var Xg=typeof to=="function";import{CheckCircle as ps}from"lucide-react";import{List as us}from"@donotdev/components";import{translateArray as ms}from"@donotdev/core";import{jsx as hn}from"react/jsx-runtime";var gs=ps,fs=16;function rf(e,t,o,n=gs,r=fs){let a=n;return hn(us,{icon:a?hn(a,{size:r}):void 0,items:ms(e,t,o),style:{listStyle:"none",paddingInlineStart:0}})}var vs=/<script[\s\S]*?<\/script>/gi,hs=/<foreignObject[\s\S]*?<\/foreignObject>/gi,ys=/\s+on\w+\s*=\s*["'][^"']*["']/gi,bs=/\s+(?:xlink:)?href\s*=\s*["']\s*javascript:[^"']*["']/gi,Ss=/\s+(?:xlink:)?href\s*=\s*["']\s*data:(?!image\/(?:png|jpe?g|gif|webp|svg\+xml))[^"']*["']/gi;function Fe(e){return e.replace(vs,"").replace(hs,"").replace(ys,"").replace(bs,"").replace(Ss,"")}import{Fragment as _s,jsx as ce,jsxs as Gs}from"react/jsx-runtime";var Sn=()=>null,Vs=bn(async()=>{try{return{default:(await import("@donotdev/auth")).ReauthDialog}}catch{return{default:Sn}}}),Us=bn(async()=>{try{return{default:(await import("@donotdev/auth")).ConfirmDeleteDialog}}catch{return{default:Sn}}}),Cn=()=>{let[e]=vt.useState(!1),[t]=vt.useState(!1),[o]=vt.useState(!1),[n]=vt.useState(null);return{showConfirmDialog:e,showPasswordDialog:t,isDeleting:o,error:n,startDeleteFlow:()=>{},confirmDelete:async()=>{},cancel:()=>{}}};Ms()&&import("@donotdev/auth").then(e=>{Cn=e.useDeleteAccount}).catch(e=>{});var ht=e=>{if(!e)return $e;if(typeof e=="function")return e;let t=e.replace(/['"]/g,"");return ws[t]||$e},oo=({loginPath:e,display:t=Rs.AUTO,"no-tooltip":o=!1,customItems:n=[],className:r,style:a})=>{let{t:i}=Ds("dndev"),{shouldHide:l,isReady:d,isAuthenticated:c}=ft(),s=Bs(),p=L("user"),g=L("signOut"),m=Os("isLaptop"),u=$(),y=zs(),f=s.profilePath,h=s.authMenuItems||[],S=Cn(),C=()=>p&&(p.displayName||p.email?.split("@")[0])||"User",T=()=>C().split(" ").map(v=>v.charAt(0)).slice(0,2).join("").toUpperCase(),N=()=>{if(!p)return i("auth.userMenu",{defaultValue:"User menu"});let b=[C()];return p.email&&b.push(p.email),E&&E!=="guest"&&b.push(`Role: ${E}`),b.join(`
|
|
4
|
+
`)},x=Ns(()=>{let b=[];return!m&&p&&b.push({children:ce(Es,{variant:"muted",as:"span",children:`${C()}${p.email?`
|
|
5
|
+
${p.email}`:""}`}),disabled:!0}),f&&b.push({label:i("auth.profile",{defaultValue:"Profile"}),icon:Cs,onClick:()=>y(f)}),h.forEach(v=>{let k=u.find(R=>R.path===v.path),w=v.label||k?.label||v.path.split("/").pop()||"Menu",D=v.icon?ht(v.icon):k?.icon&&(typeof k.icon=="string"||typeof k.icon=="function")?ht(k.icon):$e;b.push({label:w,icon:D,onClick:()=>y(v.path)})}),n.forEach(v=>{if(v.path){let k=u.find(R=>R.path===v.path),w=v.label||k?.label||v.path.split("/").pop()||"Menu",D=v.icon?ht(v.icon):$e;b.push({label:w,icon:D,onClick:()=>y(v.path),disabled:v.disabled,style:v.style})}else if(v.onClick){let k=v.icon?ht(v.icon):$e;b.push({label:v.label,icon:k,onClick:v.onClick,disabled:v.disabled,style:v.style})}}),b.push({label:i("auth.deleteAccount.label",{defaultValue:"Delete Account"}),icon:Ts,onClick:S.startDeleteFlow,variant:"destructive"}),b.push({label:i("auth.signOut",{defaultValue:"Sign Out"}),icon:xs,onClick:()=>g(),variant:"destructive"}),b},[f,h,n,g,S,i,u,m,p,C,y]);if(Fs().length===0||l||!d)return null;let E=p?.role;return c?Gs(_s,{children:[ce(yn,{fallback:null,children:ce(Vs,{open:S.showPasswordDialog,isLoading:S.isDeleting,error:S.error,onReauth:b=>S.confirmDelete(b),onCancel:S.cancel})}),ce(yn,{fallback:null,children:ce(Us,{open:S.showConfirmDialog,isLoading:S.isDeleting,error:S.error,onConfirm:()=>S.confirmDelete(),onCancel:S.cancel})}),ce(Ps,{trigger:ce(As,{variant:Ls.OUTLINE,icon:p?ce(Is,{src:p.photoURL??void 0,fallback:T(),alt:C(),style:{margin:"-4px 0"}}):ks,display:t,"aria-label":i("auth.userMenu",{defaultValue:"User menu"}),tooltip:!o&&m&&p?N():o?void 0:i("auth.userMenu",{defaultValue:"User menu"}),className:r,style:a,children:C()}),items:x,contentAlign:"end"})]}):null};import{jsx as O}from"react/jsx-runtime";var Tn=()=>null,Xs=kn(async()=>{try{return{default:(await import("@donotdev/auth")).AuthPartnerButton}}catch{return{default:Tn}}}),xn=kn(async()=>{try{return{default:(await import("@donotdev/auth")).MultipleAuthProviders}}catch{return{default:Tn}}}),ro=({display:e=Zs.AUTO,className:t,style:o})=>{let{t:n}=js("dndev"),{shouldHide:r,isLoading:a,isReady:i,isAuthenticated:l}=ft(),d=Js(),c=Qs(),[s,p]=$s(!1),g=d.loginPath,m=n("auth.signIn",{defaultValue:"Sign In"}),u=n("auth.loading",{defaultValue:"Loading..."}),y=c.includes("password")||c.includes("emailLink");if(r||!i)return null;let f=({children:h,...S})=>O(Ws,{variant:Ks.OUTLINE,icon:Hs,display:e,tooltip:m,className:t,style:o,...S,children:h??m});if(!l){if(g!==void 0)return O(I,{path:g,prefetch:!0,children:O(f,{})});let h=c[0];return y?O(qs,{trigger:O(f,{}),title:m,open:s,onOpenChange:p,"data-content-size":"form",children:O(no,{fallback:O("div",{style:{padding:"var(--gap-md)",fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:u}),children:O(xn,{spacing:"medium",onSuccess:()=>p(!1)})})}):c.length>1?O(Ys,{trigger:O(f,{}),children:O(no,{fallback:O("div",{style:{padding:"var(--gap-md)",fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:u}),children:O(xn,{spacing:"tight"})})}):O(no,{fallback:O(f,{disabled:a,tooltip:a?u:m,children:a?u:m}),children:O(Xs,{partnerId:h,display:e,className:t,style:o})})}return O(oo,{display:e,loginPath:g,className:t,style:o})};import{RefreshCw as el}from"lucide-react";import{cn as tl}from"@donotdev/components";import{jsx as wn,jsxs as rl}from"react/jsx-runtime";var ol=({className:e})=>rl("div",{className:tl("dndev-loading-overlay",e),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--background)",opacity:"var(--opacity-muted)",backdropFilter:"blur(4px)",zIndex:50},role:"status","aria-busy":"true","aria-label":"Loading",children:[wn(el,{className:"dndev-size-touch",style:{color:"var(--primary)",animation:"spin 1s linear infinite"}}),wn("span",{className:"dndev-sr-only",children:"Loading..."})]}),nl=ol;import{AlertCircle as al,RefreshCw as il,Mail as sl,Cookie as ll}from"lucide-react";import{Card as cl,Button as ao,BUTTON_VARIANT as io,Stack as Nn}from"@donotdev/components";import{useTranslation as dl}from"@donotdev/core";import{jsx as We,jsxs as yt}from"react/jsx-runtime";function pl({featureName:e,title:t,description:o,showReviewCookies:n=!1,showContactSupport:r=!0,showRetry:a=!1,supportEmail:i="support@example.com",onRetry:l,onReviewCookies:d,customActions:c,className:s=""}){let{t:p}=dl("ui"),g=o||p("featureDisabled.description","{featureName} is not available. This may be due to missing configuration or disabled features.",{featureName:e}),m=()=>{if(d)d();else{let y=new CustomEvent("openCookieConsent");window.dispatchEvent(y)}},u=()=>{window.location.href=`mailto:${i}?subject=${encodeURIComponent(`Feature Unavailable: ${e}`)}&body=${encodeURIComponent(`I'm experiencing an issue with ${e} not being available.`)}`};return yt(cl,{className:s,title:yt(Nn,{direction:"row",align:"center",gap:"tight",children:[We(al,{className:"dndev-size-md",style:{color:"var(--destructive)"}}),t||e]}),subtitle:g,children:[" ",yt("div",{style:{display:"grid",gap:"var(--gap-md)"},children:[(n||r||a||c)&&yt(Nn,{direction:"row",wrap:"wrap",gap:"tight",children:[n&&We(ao,{variant:io.OUTLINE,onClick:m,icon:ll,children:p("featureDisabled.reviewCookies","Review Cookies")}),r&&We(ao,{variant:io.OUTLINE,onClick:u,icon:sl,children:p("featureDisabled.contactSupport","Contact Support")}),a&&We(ao,{variant:io.OUTLINE,onClick:l,icon:il,children:p("featureDisabled.retry","Retry")}),c]}),We("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:p("featureDisabled.helpText","If you believe this is an error, please contact support or try refreshing the page.")})]})]})}var ul=pl;ie();import{cn as ml}from"@donotdev/components";import{jsx as j,jsxs as xl}from"react/jsx-runtime";var ee=({state:e="loading",message:t,show:o=!0,className:n,showSpinner:r=!1,spinnerSize:a="md"})=>{if(!o)return null;let l=t||(c=>({initial:"Preparing...",loading:"Loading...",processing:"Processing your request...","almost-done":"Almost there...",complete:"Complete!"})[c]||"Loading...")(e),d={sm:{width:"0.75rem",height:"0.75rem"},md:{width:"1rem",height:"1rem"},lg:{width:"1.5rem",height:"1.5rem"}};return xl("div",{className:ml(n),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--gap-sm)",color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)",transition:"opacity var(--dur-fast) ease-out"},role:"status","aria-live":"polite","aria-label":l,children:[r&&j("div",{style:{...d[a],animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid currentColor",borderTopColor:"transparent"},role:"status","aria-hidden":"true"}),j("span",{style:{fontWeight:500},children:l})]})},gl=({message:e="Loading...",...t})=>j(ee,{state:"loading",message:e,...t}),fl=({message:e="Processing your request...",...t})=>j(ee,{state:"processing",message:e,...t}),vl=({message:e="Almost there...",...t})=>j(ee,{state:"almost-done",message:e,...t}),hl=({message:e="Complete!",...t})=>j(ee,{state:"complete",message:e,...t}),yl=({showSpinner:e=!0,...t})=>j(ee,{state:"processing",message:"Saving your changes...",showSpinner:e,...t}),bl=({showSpinner:e=!0,fileName:t,...o})=>j(ee,{state:"processing",message:t?`Uploading ${t}...`:"Uploading file...",showSpinner:e,...o}),Sl=({showSpinner:e=!0,query:t,...o})=>j(ee,{state:"processing",message:t?`Searching for "${t}"...`:"Searching...",showSpinner:e,...o}),Cl=({showSpinner:e=!0,...t})=>j(ee,{state:"loading",message:"Connecting to server...",showSpinner:e,...t}),bt=ee;import{cn as kl}from"@donotdev/components";import{Fragment as In,jsx as de,jsxs as An}from"react/jsx-runtime";var Tl=({show:e=!1,backdrop:t=!0,backdropBlur:o=!0,className:n,children:r,message:a,showSpinner:i=!0,spinnerSize:l="lg",preventClicks:d=!0,zIndex:c="var(--z-modal)"})=>{if(!e)return null;let s=c==="var(--z-modal)"||!c?"dndev-z-modal":c==="var(--z-toast)"?"dndev-z-toast":c==="var(--z-tooltip)"?"dndev-z-tooltip":c==="var(--z-overlay)"?"dndev-z-overlay":null;return de("div",{className:kl("dndev-loading-overlay",s,n),style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity var(--dur-fast) ease-out",backgroundColor:t?"var(--background)":"transparent",opacity:t?"var(--opacity-muted)":1,backdropFilter:o?"blur(4px)":"none",pointerEvents:d?"auto":"none",...s?{}:{zIndex:c}},role:"dialog","aria-modal":"true","aria-busy":"true","aria-label":"Loading overlay",children:de("div",{className:"dndev-surface",style:{display:"grid",placeItems:"center",gap:"var(--gap-md)",borderRadius:"var(--radius-lg)",padding:"var(--gap-lg)",backgroundColor:"var(--background)",opacity:"var(--opacity-strong)",border:"1px solid var(--border)",boxShadow:"var(--shadow-xl)",maxWidth:"var(--content-text)",width:"100%",margin:"0 var(--gap-md)"},children:r||An(In,{children:[i&&de("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--primary)",borderTopColor:"transparent",width:l==="sm"?"2rem":l==="md"?"3rem":"4rem",height:l==="sm"?"2rem":l==="md"?"3rem":"4rem"},role:"status","aria-hidden":"true"}),a&&de(bt,{...a})]})})})};var wl=({show:e=!1,backdrop:t=!1,backdropBlur:o=!1,className:n,...r})=>de("div",{className:n,style:{position:"absolute",inset:0,display:e?"flex":"none",alignItems:"center",justifyContent:"center",transition:"opacity var(--dur-fast) ease-out",backgroundColor:t?"var(--background)":"transparent",opacity:t?"var(--opacity-muted)":1,backdropFilter:o?"blur(4px)":"none"},role:"status","aria-busy":"true","aria-label":"Loading content",children:de("div",{style:{display:"grid",placeItems:"center",gap:"var(--gap-sm)"},children:r.children||An(In,{children:[de("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--primary)",borderTopColor:"transparent",width:"1.5rem",height:"1.5rem"},role:"status","aria-hidden":"true"}),r.message&&de(bt,{...r.message})]})})}),Nl=Tl;import{cn as Il}from"@donotdev/components";import{jsx as Ln}from"react/jsx-runtime";var Al=({variant:e="fullPage",className:t,isLoading:o})=>o===!1?null:Ln("div",{className:Il(t),style:{display:"flex",alignItems:"center",justifyContent:"center",...e==="fullPage"&&{position:"fixed",inset:0,backgroundColor:"var(--background)",backdropFilter:"blur(4px)",zIndex:50}},role:"status","aria-busy":"true","aria-label":"Loading",children:Ln("div",{style:{animation:"spin 1s linear infinite",borderRadius:"var(--radius-full)",border:"2px solid var(--muted)",borderTopColor:"var(--primary)",...e==="fullPage"?{width:"5rem",height:"5rem"}:{width:"var(--icon-md)",height:"var(--icon-md)"}},role:"status","aria-busy":"true","aria-label":"Loading"})}),Ll=Al;import{Lock as St,Shield as Pn}from"lucide-react";import{useEffect as so,useRef as En,useCallback as Pl}from"react";import{Portal as El,Spinner as Rl,Stack as Dl,Text as Ke,Button as Fl}from"@donotdev/components";import{useTranslation as Bl,useOverlay as te}from"@donotdev/core";import{jsx as J,jsxs as Dn}from"react/jsx-runtime";var Rn={connecting:0,preparing:2e3,redirecting:5e3},Ml=1e4;function Ol(e,t){return t==="none"?null:t==="shield"?Pn:t==="lock"?St:e?e.startsWith("stripe-")||e.includes("payment")||e.includes("checkout")?St:e.startsWith("oauth-")||e.startsWith("auth-")?Pn:St:St}function zl(e){return e||"default"}function Vl(){let{t:e}=Bl("dndev"),t=te("isRedirectOverlayOpen"),o=te("redirectOperation"),n=te("redirectPhase"),r=te("showCancelButton"),a=te("redirectConfig"),i=te("redirectStartTime"),l=te("setRedirectPhase"),d=te("setShowCancelButton"),c=te("hideRedirectOverlay"),s=En([]),p=En(null),g=Pl(()=>{c()},[c]);if(so(()=>{if(!t||!i)return;let T=a?.cancelTimeout??Ml,N=Date.now()-i;s.current.forEach(clearTimeout),s.current=[],p.current&&(clearTimeout(p.current),p.current=null);let x=(E,b)=>{let v=Math.max(0,b-N);if(v>0){let k=setTimeout(()=>{l(E)},v);s.current.push(k)}else l(E)};x("preparing",Rn.preparing),x("redirecting",Rn.redirecting);let A=Math.max(0,T-N);return p.current=setTimeout(()=>{d(!0),l("timeout")},A),()=>{s.current.forEach(clearTimeout),s.current=[],p.current&&(clearTimeout(p.current),p.current=null)}},[t,i,a?.cancelTimeout,l,d]),so(()=>{if(!t)return;let T=()=>{c()};return window.addEventListener("popstate",T),()=>window.removeEventListener("popstate",T)},[t,c]),so(()=>{if(!t)return;let T=()=>{};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[t]),!t)return null;let m=zl(o),u=a?.title??e(`redirectOverlay.${m}.title`,{defaultValue:e("redirectOverlay.default.title")}),y=a?.message??e(`redirectOverlay.${m}.message`,{defaultValue:e("redirectOverlay.default.message")}),f=a?.subtitle??e(`redirectOverlay.${m}.subtitle`,{defaultValue:e("redirectOverlay.default.subtitle")}),h=e(`redirectOverlay.${m}.ariaLabel`,{defaultValue:e("redirectOverlay.default.ariaLabel")}),S=e(`redirectOverlay.phases.${n}`),C=Ol(o,a?.icon);return J(El,{children:J("div",{className:"dndev-spinner-overlay",role:"status","aria-busy":"true","aria-label":h,style:{zIndex:"var(--z-overlay, 9999)"},children:Dn("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--gap-md)",textAlign:"center",maxWidth:"400px",padding:"var(--gap-lg)"},children:[Dn(Dl,{direction:"row",align:"center",children:[C&&J(C,{style:{width:"1.5rem",height:"1.5rem",color:"var(--primary)"},"aria-hidden":"true"}),J(Rl,{variant:"primary"})]}),J(Ke,{as:"h3",style:{color:"var(--foreground)",margin:0},children:u}),J(Ke,{variant:"muted",style:{color:"var(--foreground)",minHeight:"1.5em"},children:S}),J(Ke,{variant:"muted",level:"small",style:{opacity:.8},children:y}),J(Ke,{variant:"muted",level:"small",style:{opacity:.6},children:f}),J(Ke,{variant:"muted",level:"small",style:{opacity:.5,marginTop:"var(--gap-sm)"},children:e("redirectOverlay.doNotRefresh")}),r&&J(Fl,{variant:"ghost",onClick:g,style:{marginTop:"var(--gap-md)"},children:e("redirectOverlay.cancel")})]})})})}import{useEffect as lo,useState as Fn}from"react";import{cn as Ul}from"@donotdev/components";import{jsx as Bn}from"react/jsx-runtime";var _l=({isActive:e=!1,progress:t,useFakeProgress:o=!0,duration:n=2e3,className:r,show:a=!0})=>{let[i,l]=Fn(0),[d,c]=Fn(!1);lo(()=>{if(!e||!o||t!==void 0)return;c(!0),l(0);let p=Date.now(),g=setInterval(()=>{let m=Date.now()-p,u=Math.min(m/n*90,90);l(u)},16);return()=>{clearInterval(g)}},[e,o,t,n]),lo(()=>{t!==void 0&&c(t>0&&t<100)},[t]),lo(()=>{if(!e){let p=setTimeout(()=>{c(!1),l(0)},300);return()=>clearTimeout(p)}},[e]);let s=t??i;return!a||!d?null:Bn("div",{className:Ul(r),style:{position:"fixed",insetInlineStart:0,insetInlineEnd:0,zIndex:9999,height:"4px",backgroundColor:"transparent",top:"var(--header-height, 0px)"},role:"progressbar","aria-valuenow":Math.round(s),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Page loading progress",children:Bn("div",{style:{height:"100%",width:`${s}%`,background:"linear-gradient(to right, var(--primary), color-mix(in srgb, var(--primary) 80%, transparent), color-mix(in srgb, var(--primary) 60%, transparent))",transition:e?"width 0.3s ease-out":"width 0.2s ease-in",boxShadow:"var(--shadow-sm)"}})})},Gl=_l;import{cn as Ct,Stack as Hl}from"@donotdev/components";import{jsx as Ye,jsxs as m2}from"react/jsx-runtime";var $l=({variant:e="text",width:t,height:o,lines:n=1,show:r=!0,className:a,animation:i="pulse",style:l})=>{if(!r)return null;let d={backgroundColor:"var(--muted)",opacity:"var(--opacity-muted)",borderRadius:"var(--radius)",animation:i==="pulse"||i==="wave"?"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite":"none",...i==="wave"&&{background:"linear-gradient(to right, color-mix(in srgb, var(--muted) 50%, transparent), color-mix(in srgb, var(--muted) 30%, transparent), color-mix(in srgb, var(--muted) 50%, transparent))"}},c=()=>{let s={};return t&&(s.width=typeof t=="number"?`${t}px`:t),o&&(s.height=typeof o=="number"?`${o}px`:o),s};return e==="text"?Ye(Hl,{gap:"tight",children:Array.from({length:n}).map((s,p)=>Ye("div",{className:Ct("dndev-skeleton",a),style:{...d,height:"var(--gap-md)",width:p===n-1?"75%":"100%",...c(),...l}},p))}):e==="circular"?Ye("div",{className:Ct("dndev-skeleton",a),style:{...d,borderRadius:"var(--radius-full)",width:t||o||"40px",height:o||t||"40px",...c(),...l}}):e==="rectangular"?Ye("div",{className:Ct("dndev-skeleton",a),style:{...d,width:t||"100%",height:o||"200px",...c(),...l}}):Ye("div",{className:Ct("dndev-skeleton",a),style:{...d,borderRadius:"var(--radius-lg)",width:t||"100%",height:o||"20px",...c(),...l}})};var Wl=$l;import{Card as Kl,IconBox as Yl,Stack as ql,Text as co,renderCardContent as Zl}from"@donotdev/components";import{jsx as Q,jsxs as Mn}from"react/jsx-runtime";var jl=({icon:e,title:t,subtitle:o,content:n,href:r,variant:a,elevated:i,onClick:l,className:d,footer:c,style:s,clickable:p,...g})=>{let m=Zl(n),f=`calc(var(--font-size-lg) * var(--line-height) * 2 + var(--gap-md)) calc(var(--font-size-base) * var(--line-height) * 2 + var(--gap-md)) 1fr${c?" auto":""}`,h={display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",lineHeight:"var(--line-height)"},S={...h,fontSize:"var(--font-size-lg)",fontWeight:600,color:"inherit",margin:0,textAlign:"start",flex:1,minWidth:0},C={...h,fontSize:"var(--font-size-base)",fontWeight:600,color:"var(--muted-foreground)",margin:0},T=e?Mn(ql,{direction:"row",align:"center",style:{width:"100%"},children:[Q(Yl,{icon:e}),Q(co,{as:"div",level:"h3",style:S,children:t})]}):Q(co,{as:"div",level:"h3",style:S,children:t}),N=Q(Kl,{variant:a,elevated:i,onClick:l,className:d,"data-clickable":r||l||p?"true":void 0,style:{paddingInlineStart:"var(--gap-md)",paddingInlineEnd:"var(--gap-md)",gap:"var(--gap-md)",height:"100%",textAlign:"start",...s},...g,children:Mn("div",{style:{display:"grid",gridTemplateRows:f,gap:"var(--gap-md)",width:"100%"},children:[Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:T}),Q("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start"},children:Q(co,{as:"div",level:"body",style:C,children:o})}),Q("div",{children:m}),c&&Q("div",{children:c})]})});return r&&!l?Q(I,{path:r,style:{display:"block",textDecoration:"none",height:"100%"},"aria-label":t?`Learn more about ${t}`:void 0,children:N}):N},Jl=jl;import{useState as lc}from"react";import{Bento as cc,Card as dc,Section as pc,Stack as uc,Text as mc,TONE as gc,cn as fc}from"@donotdev/components";var Ql='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#3178C6" d="M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"/></svg>',Xl='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#61DAFB" d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"/></svg>',ec='<svg role="img" viewBox="0 0 410 404" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="vite-a" x1="6" y1="33" x2="235" y2="344" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="vite-b" x1="195" y1="9" x2="236" y2="293" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset=".08" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs><path fill="url(#vite-a)" d="M399.641 59.525 215.643 388.545c-3.799 6.793-13.559 6.833-17.415.073L10.582 59.556c-4.201-7.366 2.098-16.29 10.446-14.797l184.195 32.923c1.175.21 2.378.208 3.553-.006l180.343-32.87c8.32-1.517 14.649 7.337 10.522 14.72z"/><path fill="url(#vite-b)" d="M292.965 1.574 156.801 28.255c-2.238.439-3.895 2.335-4.03 4.611l-8.376 141.465c-.197 3.332 2.863 5.918 6.115 5.168l37.91-8.749c3.547-.818 6.752 2.306 6.023 5.873l-11.263 55.153c-.758 3.712 2.727 6.886 6.352 5.785l23.415-7.114c3.63-1.102 7.118 2.081 6.35 5.796l-17.899 86.633c-1.12 5.42 6.088 8.374 9.094 3.728l2.008-3.103 110.954-221.428c1.858-3.707-1.346-7.935-5.418-7.15l-39.022 7.532c-3.667.707-6.787-2.708-5.752-6.296l25.469-88.291c1.036-3.594-2.095-6.612-5.764-5.891z"/></svg>',tc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M18.665 21.978C16.758 23.255 14.465 24 12 24 5.377 24 0 18.623 0 12S5.377 0 12 0s12 5.377 12 12c0 3.583-1.574 6.801-4.067 9.001L9.219 7.2H7.2v9.596h1.615V9.251l9.85 12.727Zm-3.332-8.533 1.6 2.061V7.2h-1.6v6.245Z"/></svg>',oc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#339933" d="M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"/></svg>',nc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#DD2C00" d="M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"/></svg>',rc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="m12 1.608 12 20.784H0Z"/></svg>',ac='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#635BFF" d="M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"/></svg>',ic='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><linearGradient id="vb-a" x1="0.414" y1="0.255" x2="0" y2="0.932" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#eab308"/><stop offset="1" stop-color="#ca8a04"/></linearGradient><linearGradient id="vb-b" x1="0.338" y1="0.02" x2="0.664" y2="0.966" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#fde68a"/><stop offset="1" stop-color="#fbbf24"/></linearGradient><linearGradient id="vb-c" y1="0.5" x2="1" y2="0.5" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#7dd3fc"/><stop offset="1" stop-color="#0ea5e9"/></linearGradient></defs><g transform="translate(-2056 -1899)"><path d="M742.271,987.024c-66.706,0-119.121,54.673-121.874,126.408l-2.551,95.471c-3.967,78.653,71.961,105.52,126.936,105.52Z" transform="translate(1463.458 1004.277)" fill="url(#vb-a)"/><path d="M92.616.01H319.894c54.53-.8,95.624,40.1,98.381,93.335l6.144,135.76c.732,67.368-48.116,94.95-104.525,95.335L92.616,327.374C34.061,327.8-1.063,283.663.022,229.105l3.8-135.76C7.41,33.54,33.3,1.093,92.616.01Z" transform="translate(2118.42 1991.302)" fill="url(#vb-b)"/><path d="M86.844.009H299.958c51.132-.746,89.665,37.307,92.25,86.824l5.761,126.29c.686,62.669-45.117,88.326-98.011,88.685L86.844,304.537C31.938,304.933-1,263.875.02,213.123L3.58,86.834C6.948,31.2,31.222,1.016,86.844.009Z" transform="translate(2136.977 2001.737)" fill="#111827"/><circle cx="27.626" cy="27.626" r="27.626" transform="translate(2421.148 2104.357)" fill="url(#vb-c)"/><circle cx="27.626" cy="27.626" r="27.626" transform="translate(2208.034 2104.357)" fill="url(#vb-c)"/></g></svg>',sc='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#FBF0DF" d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083a5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"/></svg>',po={bun:{svg:`data:image/svg+xml,${encodeURIComponent(sc)}`,color:"#FBF0DF",name:"Bun"},typescript:{svg:`data:image/svg+xml,${encodeURIComponent(Ql)}`,color:"#3178C6",name:"TypeScript"},react:{svg:`data:image/svg+xml,${encodeURIComponent(Xl)}`,color:"#61DAFB",name:"React"},vite:{svg:`data:image/svg+xml,${encodeURIComponent(ec)}`,color:"#BD34FE",name:"Vite"},nextjs:{svg:`data:image/svg+xml,${encodeURIComponent(tc)}`,color:"var(--foreground, #000000)",name:"Next.js"},nodejs:{svg:`data:image/svg+xml,${encodeURIComponent(oc)}`,color:"#339933",name:"Node.js"},firebase:{svg:`data:image/svg+xml,${encodeURIComponent(nc)}`,color:"#DD2C00",name:"Firebase"},vercel:{svg:`data:image/svg+xml,${encodeURIComponent(rc)}`,color:"var(--foreground, #000000)",name:"Vercel"},stripe:{svg:`data:image/svg+xml,${encodeURIComponent(ac)}`,color:"#635BFF",name:"Stripe"},valibot:{svg:`data:image/svg+xml,${encodeURIComponent(ic)}`,color:"#FBBF24",name:"Valibot"}};import{jsx as Se,jsxs as bc}from"react/jsx-runtime";function vc({techKey:e,variant:t}){let o=po[e],[n,r]=lc(!1);if(!o)return null;let a=decodeURIComponent(o.svg.replace("data:image/svg+xml,","")),i=Fe(a);return Se(dc,{variant:t,className:"dndev-tech-card",style:{"--tech-color":o.color},"data-hover":n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:bc(uc,{direction:"column",align:"center",gap:"tight",children:[Se("div",{className:"dndev-tech-card-logo","data-tech":e,dangerouslySetInnerHTML:{__html:i}}),Se(mc,{as:"span",level:"small",children:o.name})]})})}function hc({title:e,techs:t,cols:o=3,columns:n,gap:r="medium",separator:a=!1,tone:i=gc.GHOST,align:l,collapsible:d,open:c,onOpenChange:s,defaultOpen:p,className:g}){let m=n||(typeof o=="number"?{mobile:o,tablet:o,desktop:o,wide:o}:{mobile:o[0],tablet:o[1],desktop:o[2],wide:o[3]}),u=h=>{if(h==="long")return{cols:2,rows:1};if(h==="high")return{cols:1,rows:2};if(h==="huge")return{cols:2,rows:2}},y=t.filter(h=>po[h.name]).map(h=>({id:h.name,content:Se(vc,{techKey:h.name,variant:h.variant}),span:u(h.size)})),f=Se(cc,{items:y,columns:m,gap:r,ariaLabel:"Technology stack"});return Se(pc,{title:e,separator:a,tone:i,align:l,collapsible:d,open:c,onOpenChange:s,defaultOpen:p,className:fc("dndev-tech-bento",g),children:Se("div",{className:"dndev-tech-bento-grid",children:f})})}var yc=hc;import{Suspense as Sc,lazy as Cc}from"react";import{useConsent as On}from"@donotdev/core";import{jsx as zn}from"react/jsx-runtime";var xc=Cc(()=>Promise.resolve().then(()=>(_t(),Ut)));function _2(){let e=On("hasConsented"),t=On("showBanner");return e&&!t?null:zn(Sc,{fallback:null,children:zn(xc,{})})}import{Button as Vn,ScrollArea as kc}from"@donotdev/components";import{cn as Un}from"@donotdev/components";import{jsx as oe,jsxs as Tc}from"react/jsx-runtime";function K2({content:e,cta:t,align:o="center",justify:n="center",disableScrollArea:r=!1,contentVariant:a="narrow",contentClassName:i,ctaClassName:l}){let c=a==="narrow"?a==="narrow"&&oe("div",{className:"dndev-game-container__content-narrow",children:e}):e,s=r?oe("div",{style:{overflow:"auto",overscrollBehavior:"contain",height:"100%"},children:c}):oe(kc,{className:"dndev-game-container__scroll",children:c});return Tc("div",{className:"dndev-game-container",children:[oe("div",{className:Un("dndev-game-container__content",i),"data-align":o,"data-justify":n,"data-content-variant":a,children:oe("div",{className:"dndev-game-container__scroll-wrapper",children:s})}),t&&oe("div",{className:Un("dndev-game-container__cta",l),children:Array.isArray(t)?oe("div",{className:"dndev-game-container__cta-buttons",children:t.map((p,g)=>oe(Vn,{onClick:p.onClick,disabled:p.disabled??!1,variant:p.variant??"default",className:"dndev-game-container__cta-button",fullWidth:!0,children:p.label},g))}):oe(Vn,{onClick:t.onClick,disabled:t.disabled??!1,variant:t.variant??"default",className:"dndev-game-container__cta-button",children:t.label})})]})}import{useEffect as wc,Suspense as Nc,lazy as Ic}from"react";import{jsx as uo}from"react/jsx-runtime";var _n=new Set,Gn=new Map;function Ac(e,t){let o=Gn.get(e);if(o)return o;let n=t[e];if(!n)return null;let r=Ic(n);return Gn.set(e,r),r}function j2({screenRegistry:e,currentScreen:t,nextScreen:o,fallback:n=null}){wc(()=>{if(o&&!_n.has(o)){_n.add(o);let a=e[o];a&&a().catch(()=>{})}},[o,e]);let r=t?Ac(t,e):null;return!t||!r?null:uo("div",{style:{height:"100%"},children:uo(Nc,{fallback:n,children:uo(r,{})})})}import{cn as Lc,DISPLAY as mo}from"@donotdev/components";import{useAppConfig as Hn}from"@donotdev/core";import{jsx as xt,jsxs as Rc}from"react/jsx-runtime";var Pc=({display:e=mo.AUTO,linkToHome:t=!0,className:o})=>{let n=Hn("name"),a=Hn("shortName")||n||"App",i=G.getLogoSvgContent(),l=G.resolveLogo(),d=e===mo.FULL||e===mo.AUTO,c=i?xt("div",{className:"app-branding-logo",role:"img","aria-label":a,dangerouslySetInnerHTML:{__html:Fe(i)}}):G.assetExists(l)?xt("img",{src:l,alt:a,className:"app-branding-logo"}):null,s=d&&xt("span",{className:"app-branding-title","data-display":e,children:a}),p=Rc("div",{className:Lc("app-branding",o),"data-display":e,children:[c,s]});return t?xt(I,{path:"/",className:"app-branding-link",children:p}):p},Ec=Pc;import{cn as $n}from"@donotdev/components";import{useAppConfig as Wn}from"@donotdev/core";import{jsx as Yn}from"react/jsx-runtime";var Kn={sm:{width:"var(--icon-md)",height:"var(--icon-md)"},md:{width:"var(--icon-touch)",height:"var(--icon-touch)"},lg:{width:"var(--icon-touch)",height:"var(--icon-touch)"},xl:{width:"var(--touch-target)",height:"var(--touch-target)"},header:{height:"var(--icon-touch)",width:"auto"}},Dc=({alt:e,size:t="header",className:o})=>{let n=Wn("name"),r=Wn("shortName"),a=e||n||r||"App",i=G.getLogoSvgContent(),l=G.resolveLogo(),d=typeof t=="string"&&t in Kn?Kn[t]:typeof t=="string"?{}:{width:t,height:t};return i?Yn("div",{className:$n("app-icon-header",o),style:{display:"inline-flex",...d},role:"img","aria-label":a,dangerouslySetInnerHTML:{__html:Fe(i)}}):Yn("img",{src:l,alt:a,className:$n(o),style:{objectFit:"contain",...d}})},Fc=Dc;import{cn as qn}from"@donotdev/components";import{useAppConfig as Zn,useBreakpoint as Bc}from"@donotdev/core";import{jsx as jn}from"react/jsx-runtime";var Mc=({title:e,className:t,linkToHome:o=!0})=>{let n=Bc("isMobileOrTablet"),r=Zn("name"),a=Zn("shortName"),i=e||n&&a||r||"App",l=jn("div",{className:qn("dndev-text-base",t),style:{fontSize:"var(--font-size-xl)",fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:i});return o?jn(I,{path:"/",className:qn("dndev-inline-block",t),children:l}):l},Oc=Mc;import{ChevronRight as Hc}from"lucide-react";import{useMemo as $c}from"react";import{cn as Wc}from"@donotdev/components";import{useTranslation as Kc}from"@donotdev/core";import{useLocation as Yc}from"@donotdev/ui/routing/hooks";import{useMemo as Jn}from"react";import{useNavigationStore as b0,getRoutes as zc,getRouteManifest as S0}from"@donotdev/core";function Vc(){return Jn(()=>{try{let e=zc();return!e||e.length===0?[]:Uc(e)}catch{return[]}},[])}function Qn(){let e=Vc();return Jn(()=>e.flatMap(t=>t.routes),[e])}function Uc(e){let t=new Map;return e.forEach(o=>{let n=typeof o.path=="string"?o.path:String(o.path);if(!n||n==="undefined"||n==="null")return;let r=o.meta?.entity||_c(n)||"other",a={path:n,label:o.meta?.title||Gc(n),icon:o.meta?.icon,component:o.component,importPath:o.importPath,exportName:o.exportName,auth:o.auth,meta:o.meta};t.has(r)||t.set(r,{label:r.charAt(0).toUpperCase()+r.slice(1),routes:[]}),t.get(r)?.routes.push(a)}),Array.from(t.values())}function _c(e){return e.split("/").filter(Boolean)[0]||null}function Gc(e){let t=e.split("/").filter(Boolean),o=t[t.length-1];return o?o.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"Home"}import{jsx as qe,jsxs as jc}from"react/jsx-runtime";var qc=({items:e,separator:t=Hc,showHome:o=!0,homeHref:n="/",variant:r="default",className:a})=>{let{t:i}=Kc("dndev"),l=Yc(),d=Qn(),c=$c(()=>new Set(d.map(g=>g.path)),[d]),s=e||(()=>{let g=l.pathname.split("/").filter(Boolean),m=[],u="";return g.forEach(y=>{u+=`/${y}`;let f=y.split("-").map(S=>S.charAt(0).toUpperCase()+S.slice(1)).join(" "),h=c.has(u)?u:void 0;m.push({label:f,href:h})}),m})(),p=o?[{label:i("navigation.home","Home"),href:n},...s]:s;return r==="smart"&&l.pathname.split("/").filter(Boolean).length<2?null:qe("nav",{role:"navigation","aria-label":"Breadcrumb navigation",className:Wc("breadcrumbs",a),children:p.map((g,m)=>{let y=m===p.length-1||!g.href;return jc("span",{className:"breadcrumb-item",children:[m>0&&qe(t,{className:"dndev-size-md separator"}),g.icon&&qe(g.icon,{className:"dndev-size-md icon"}),g.href&&!y?qe(I,{path:g.href,className:"breadcrumb-link",children:g.label}):qe("span",{className:"breadcrumb-label",children:g.label})]},m)})})},Zc=qc;import{useTranslation as Jc,maybeTranslate as Xn,useLayout as go,useAppConfig as Qc}from"@donotdev/core";import{jsx as Be,jsxs as ed}from"react/jsx-runtime";var Xc=({asLink:e=!1,className:t})=>{let o=Qc("app"),n=go("gameTitle"),r=go("gameSubtitle"),a=go("gameNamespace"),{t:i}=Jc(a||"dndev"),l=Xn(i,n??void 0),d=Xn(i,r??void 0),c=o?.name||"Game";if(l)return Be("div",{className:t,children:ed("div",{style:{textAlign:"center"},children:[Be("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}),d&&Be("p",{style:{color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d})]})});let s=Be("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c});return e?Be(I,{path:"/",className:t,style:{fontSize:"var(--font-size-2xl)",fontWeight:700,transition:"color var(--dur-fast) ease-out"},onMouseEnter:p=>p.currentTarget.style.color="var(--primary)",onMouseLeave:p=>p.currentTarget.style.color="var(--foreground)",children:c}):Be("div",{className:t,children:s})};import{Trash2 as td}from"lucide-react";import{useState as er}from"react";import{Button as od,BUTTON_VARIANT as nd,Checkbox as rd,Stack as fo,useToast as ad}from"@donotdev/components";import{useTranslation as id}from"@donotdev/core";import{useRefresh as sd}from"@donotdev/ui/routing/hooks";import{jsx as kt,jsxs as tr}from"react/jsx-runtime";function ld(){let{t:e}=id("dndev"),{toast:t}=ad(),[o,n]=er(!1),r=sd(),[a,i]=er({localStorage:!0,sessionStorage:!0,applicationCache:!0,serviceWorker:!0,cookies:!0,indexedDB:!0,webSQL:!0,memoryCache:!0}),l=async()=>{try{n(!0);let d=[];if(a.localStorage&&typeof window<"u")try{localStorage.clear(),d.push("localStorage")}catch{}if(a.sessionStorage&&typeof window<"u")try{sessionStorage.clear(),d.push("sessionStorage")}catch{}if(a.indexedDB&&typeof window<"u"&&"indexedDB"in window)try{if("databases"in indexedDB){let s=await indexedDB.databases();await Promise.all(s.map(async p=>{if(p.name){let g=indexedDB.deleteDatabase(p.name);await new Promise((m,u)=>{g.onsuccess=()=>m(void 0),g.onerror=()=>u(g.error)})}}))}d.push("IndexedDB")}catch{}if(a.webSQL&&"openDatabase"in window)try{let s=globalThis.openDatabase("","","","");s&&s.transaction&&s.transaction(p=>{p.executeSql('SELECT name FROM sqlite_master WHERE type="table"',[],(g,m)=>{for(let u=0;u<m.rows.length;u++){let y=m.rows.item(u).name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(y)&&g.executeSql(`DROP TABLE IF EXISTS ${y}`)}})}),d.push("WebSQL")}catch{}if(a.applicationCache&&"caches"in window)try{let s=await caches.keys();await Promise.all(s.map(async p=>{try{await caches.delete(p)}catch{}})),d.push("Application Cache")}catch{}if(a.serviceWorker&&"serviceWorker"in navigator)try{let s=await navigator.serviceWorker.getRegistrations();await Promise.all(s.map(async p=>{try{await p.unregister()}catch{}})),d.push("Service Workers")}catch{}if(a.cookies)try{document.cookie.split(";").forEach(s=>{let p=s.indexOf("="),g=p>-1?s.substr(0,p):s;document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${window.location.hostname}`,document.cookie=`${g.trim()}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=.${window.location.hostname}`}),d.push("Cookies")}catch{}if(a.memoryCache)try{"gc"in window&&typeof globalThis.gc=="function"&&globalThis.gc(),d.push("Memory Cache")}catch{}let c=d.length>0?e("settings.clearCache.success","Cache cleared successfully: {{items}}",{items:d.join(", ")}):e("settings.clearCache.noItemsCleared","No cache items were cleared");t("success",c),d.length>0&&setTimeout(()=>{typeof globalThis<"u"&&globalThis._DNDEV_STORES_&&(globalThis._DNDEV_STORES_={}),typeof window<"u"?window.location.href=window.location.href:r()},1e3)}catch{t("error",e("settings.clearCache.error","Error clearing cache"))}finally{n(!1)}};return tr(fo,{children:[kt(fo,{children:Object.entries(a).map(([d,c])=>tr(fo,{direction:"row",align:"center",gap:"tight",children:[kt(rd,{id:d,checked:c,onCheckedChange:s=>i(p=>({...p,[d]:!!s}))}),kt("label",{htmlFor:d,style:{fontSize:"var(--font-size-sm)",fontWeight:500,lineHeight:1,cursor:"pointer"},children:e(`settings.clearCache.${d}`,d.charAt(0).toUpperCase()+d.slice(1))})]},d))}),kt(od,{variant:nd.DESTRUCTIVE,style:{margin:"0 auto"},disabled:o||!Object.values(a).some(Boolean),onClick:l,icon:td,children:o?e("settings.clearCache.clearing","Clearing..."):e("settings.clearCache.button","Clear Cache")})]})}var vo=ld;import{DropdownMenu as ud,Button as ho,Stack as md}from"@donotdev/components";import{Link as cd}from"lucide-react";import{navigationMenuTriggerStylePrimitive as dd}from"@donotdev/components";ie();ye();import{jsx as or,jsxs as pd}from"react/jsx-runtime";var Tt=({path:e,route:t,showIcons:o=!0})=>{let n=$(),r=t??n.find(l=>l.path===e);if(!r)return null;let a=o&&!!r.icon,i=!!r.label;return pd(I,{path:r.path,className:dd(),...a&&!i&&{"data-display":"compact"},children:[o&&or(z,{icon:r.icon,fallback:cd}),or("span",{children:r.label})]})};import{jsx as Ce}from"react/jsx-runtime";var gd=({navigation:e,className:t})=>Ce(md,{role:"navigation",direction:"row",align:"center",className:t,style:{gap:"var(--gap-sm)"},children:e.map((o,n)=>o.routes&&o.routes.length>0?Ce(ud,{trigger:Ce(ho,{icon:o.icon,children:o.label}),items:o.routes.map(r=>({label:r.label,children:Ce(Tt,{route:r}),asChild:!!r.path})),contentAlign:"start"},o.label+n):o.path?Ce(ho,{icon:o.icon,"aria-label":o.label,render:({children:r,...a})=>Ce(I,{path:o.path,...a,children:r}),children:o.label},o.label+n):Ce(ho,{icon:o.icon,disabled:!0,"aria-label":o.label,children:o.label},o.label+n))}),fd=gd;import{Card as vd,cn as hd}from"@donotdev/components";import{jsx as yo}from"react/jsx-runtime";var yd=({languages:e,currentLanguage:t,onLanguageChange:o,className:n})=>yo(vd,{className:hd("dndev-z-modal",n),style:{position:"fixed",bottom:"var(--gap-md)",insetInlineEnd:"var(--gap-md)",display:"flex",alignItems:"center",gap:"var(--gap-sm)",transition:"var(--dur-fast) ease-out"},role:"region","aria-label":"Language selector","data-role":"floating",children:yo("select",{style:{backgroundColor:"transparent",outline:"none",fontSize:"var(--font-size-base)",cursor:"pointer"},value:t,onChange:r=>o?.(r.target.value),"aria-label":"Select language",children:e.map(r=>yo("option",{value:r,children:r},r))})}),bd=yd;import{MoreHorizontal as Sd}from"lucide-react";import{Button as Cd,BUTTON_VARIANT as xd,DropdownMenu as kd}from"@donotdev/components";import{jsx as nr}from"react/jsx-runtime";var Td=({children:e,className:t})=>nr(kd,{trigger:nr(Cd,{variant:xd.GHOST,icon:Sd,"aria-label":"Menu",className:t}),contentAlign:"end",children:e}),wd=Td;import{MoreHorizontal as Nd}from"lucide-react";import{Link as Id}from"lucide-react";import{DISPLAY as Ze,DropdownMenu as Ad,Button as rr}from"@donotdev/components";import{cn as Ld}from"@donotdev/components";import{useBreakpoint as ar,useTranslation as Pd}from"@donotdev/core";ie();ye();import{jsx as xe}from"react/jsx-runtime";var Ed=({className:e="",showIcons:t=!0,display:o=Ze.AUTO,path:n})=>{let{t:r}=Pd("dndev"),a=ar("isMobile"),i=ar("isTablet"),l=$(),d=en(n??"");return n?d?xe(rr,{variant:"ghost",display:o,icon:t?xe(z,{icon:d.icon,fallback:Id}):void 0,className:e,render:({children:s,...p})=>xe(I,{path:d.path,...p,children:s}),children:d.label}):null:(o===Ze.AUTO?a||i?Ze.COMPACT:Ze.FULL:o)===Ze.COMPACT?xe(Ad,{trigger:xe(rr,{variant:"ghost",icon:Nd,"aria-label":r("navigation.menu","Navigation"),className:e}),contentAlign:"end",items:l.map(s=>({label:s.label,children:xe(Tt,{route:s,showIcons:t}),asChild:!0}))}):xe(mn,{overflowDetection:!0,showIcons:t,className:Ld(e),style:{flex:1}})},Rd=Ed;import{Bell as Dd}from"lucide-react";import{useMemo as Fd,useEffect as Bd,useRef as Md}from"react";import{Button as Od,cn as zd,toast as Vd,Stack as Ud}from"@donotdev/components";import{jsx as bo}from"react/jsx-runtime";var _d={sm:{button:{width:"var(--icon-md)",height:"var(--icon-md)"},icon:{width:"var(--icon-md)",height:"var(--icon-md)"},badge:{width:"var(--icon-md)",height:"var(--icon-md)",fontSize:"var(--font-size-xs)"}},md:{button:{width:"var(--touch-target)",height:"var(--touch-target)"},icon:{width:"var(--icon-md)",height:"var(--icon-md)"},badge:{width:"var(--icon-md)",height:"var(--icon-md)",fontSize:"var(--font-size-xs)"}},lg:{button:{width:"var(--touch-target)",height:"var(--touch-target)"},icon:{width:"var(--icon-touch)",height:"var(--icon-touch)"},badge:{width:"var(--icon-touch)",height:"var(--icon-touch)",fontSize:"var(--font-size-sm)"}}},Gd=({notifications:e=[],count:t=0,loading:o=!1,onNotificationClick:n,onDropdownOpen:r,className:a,maxVisible:i=10,alwaysShow:l=!1,size:d="md",disabled:c=!1})=>{let s=_d[d],p=Md(new Set),g=Fd(()=>t===0?null:t>99?"99+":t.toString(),[t]),m=t>0||l;return Bd(()=>{e.forEach(u=>{if(!p.current.has(u.id)){p.current.add(u.id);let y=u.type==="error"?"error":u.type==="warning"?"warning":u.type==="success"?"success":"info";Vd({title:u.title,description:u.message,toastType:y,duration:0,onDismiss:()=>{p.current.delete(u.id),n&&n(u)}})}})},[e,n]),m?bo("div",{className:zd(a),style:{position:"relative"},children:bo(Od,{disabled:c,style:{...s.button,position:"relative"},onClick:()=>{r?.()},onFocus:u=>{u.currentTarget.style.outline="2px solid var(--ring)",u.currentTarget.style.outlineOffset="2px"},onBlur:u=>{u.currentTarget.style.outline="none"},"aria-label":`${t} notification${t!==1?"s":""}`,icon:Dd,children:g&&bo(Ud,{align:"center",justify:"center",style:{position:"absolute",top:"-0.25rem",insetInlineEnd:"-0.25rem",backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)",borderRadius:"var(--radius-full)",fontWeight:600,lineHeight:1,minWidth:0,...s.badge},"aria-hidden":"true",children:g})})}):null},Hd=Gd;import{Settings as $d,Check as Wd}from"lucide-react";import*as wt from"lucide-react";import{Button as Kd,BUTTON_VARIANT as Yd,DropdownMenu as qd,Stack as Zd,DISPLAY as jd}from"@donotdev/components";import{useTranslation as Jd}from"@donotdev/core";import{useLanguageSelector as Qd,useTheme as So,Flag as Xd}from"@donotdev/core";import{jsx as pe,jsxs as op}from"react/jsx-runtime";function ep({variant:e=Yd.OUTLINE}={}){let{t}=Jd("dndev"),{languages:o,currentLanguage:n,changeLanguage:r,isLoading:a}=Qd(),i=So("availableThemes"),l=So("currentTheme"),d=So("setTheme"),c=m=>{if(!m)return wt.Palette;let u=m.replace(/['"]/g,"");return wt[u]||wt.Palette},s=i.map(m=>{let u=c(m.meta?.icon),y=m.name===l;return{label:m.displayName||m.name,icon:u,onClick:()=>d(m.name),checked:y}}),p=o.map(m=>{let u=m.id===n;return{label:m.name,onClick:()=>r(m.id),disabled:a,checked:u,className:u?"bg-accent":void 0,iconEnd:u&&!a?Wd:void 0,children:op(Zd,{direction:"row",align:"center",gap:"tight",children:[pe(Xd,{code:m.flagCode||m.id,title:`${m.name} flag`}),pe("span",{children:m.name}),a&&u&&pe("div",{style:{marginInlineStart:"auto"},children:pe("div",{style:{width:"0.5rem",height:"0.5rem",borderRadius:"50%",backgroundColor:"var(--primary)"}})})]})}}),g=[{label:t("auth.title","Authentication"),subContent:pe(ro,{display:jd.COMPACT})},{label:t("settings.theme","Theme"),subItems:s},{label:t("settings.language","Language"),subItems:p},{label:t("settings.clearCache.title","Clear Cache"),subContent:pe(vo,{})}];return pe(qd,{trigger:pe(Kd,{variant:e,"aria-label":t("settings.title","Settings"),icon:$d}),items:g,contentWidth:"14rem",contentAlign:"end"})}var tp=ep;import*as Nt from"lucide-react";import{Button as ir,BUTTON_VARIANT as np,DropdownMenu as rp,DISPLAY as ap}from"@donotdev/components";import{useTranslation as ip}from"@donotdev/core";import{useTheme as Co}from"@donotdev/core";import{jsx as ko}from"react/jsx-runtime";var xo=e=>{if(!e)return Nt.Palette;let t=e.replace(/['"]/g,"");return Nt[t]||Nt.Palette},sp=({display:e=ap.AUTO,"no-tooltip":t=!1})=>{let{t:o}=ip("dndev"),n=Co("availableThemes"),r=Co("currentTheme"),a=Co("setTheme");if(n.length<=1)return null;let i=n.find(h=>h.name===r)||n[0],l=n.length===2?n.find(h=>h.name!==i?.name)||n[0]:null,d=i?xo(i.meta?.icon):null,c=l?xo(l.meta?.icon):null,s=i?.displayName||i?.name||"Theme",p=l?.displayName||l?.name||"Theme",g=n.length===2&&l&&c,m=g?c:d,u=g?t?void 0:o("common.themeSelector.tooltipWithNext","Change Theme: Switch to {{next}}",{next:l?.displayName||l?.name}):t?void 0:o("common.themeSelector.changeTheme","Change Theme"),y={variant:np.OUTLINE,"aria-label":o("common.themeSelector.changeTheme","Change Theme"),tooltip:u,icon:m,display:e};if(g&&l)return ko(ir,{...y,onClick:()=>a(l.name),children:p});if(!i||!d)return null;let f=n.map(h=>{let S=xo(h.meta?.icon),C=h.name===r;return{label:h.displayName||h.name,icon:S,onClick:()=>a(h.name),checked:C}});return ko(rp,{trigger:ko(ir,{...y,children:s}),items:f,contentWidth:"10rem"})},lp=sp;import{ExternalLink as cp}from"lucide-react";import{getPlatformEnvVar as dp}from"@donotdev/core";import{jsx as pp,jsxs as up}from"react/jsx-runtime";var To=({className:e})=>{let o=dp("APP_URL")==="https://donotdev.com";return up("a",{href:o?"https://www.ambroise-park.com":"https://donotdev.com",target:"_blank",rel:"noopener noreferrer",className:e,style:{display:"inline-flex",alignItems:"center",gap:"var(--gap-sm)",fontSize:"var(--font-size-xs)"},children:[o?"AMBROISE-PARK":"DoNotDev",pp(cp,{style:{width:"12px",height:"12px"},"aria-hidden":"true"})]})};import{cn as mp}from"@donotdev/components";import{useTranslation as gp,useAppConfig as fp}from"@donotdev/core";import{jsxs as hp}from"react/jsx-runtime";var vp=({appName:e,year:t=new Date().getFullYear(),className:o})=>{let{t:n}=gp("dndev"),r=fp("app"),a=e||r?.name||"App";return hp("span",{className:mp(o),style:{flexShrink:0,color:"var(--muted-foreground)",fontSize:"var(--font-size-xs)"},children:["\xA9 ",t," ",a,". ",n("footer.legal.allRightsReserved")]})};import{Stack as Sp}from"@donotdev/components";import{useTranslation as Cp,maybeTranslate as xp,useAppConfig as kp}from"@donotdev/core";var yp=[{path:"#cookie-settings",label:"footer.legal.cookieSettings"},{label:"footer.legal.privacyPolicy",path:"/privacy"},{label:"footer.legal.termsOfService",path:"/terms"}],bp=e=>e?.legalLinks===null?[]:e?.legalLinks??yp,sr=bp;import{jsx as lr,jsxs as wp}from"react/jsx-runtime";var Tp=({app:e,direction:t="column",gap:o="tight"})=>{let{t:n}=Cp("dndev"),r=kp("app"),i=sr((e||r||{}).footer),l={transition:"color var(--dur-fast) ease-out",textDecoration:"underline",textUnderlineOffset:"2px",color:"var(--muted-foreground)",fontSize:"var(--font-size-xs)"};return i.length===0?null:wp(Sp,{direction:t,gap:o,align:"stretch",children:[i.map(d=>lr(I,{path:d.path,style:l,onMouseEnter:c=>c.currentTarget.style.color="var(--primary)",onMouseLeave:c=>c.currentTarget.style.color="var(--muted-foreground)",children:xp(n,d.label)},d.path)),lr(To,{})]})};import{useEffect as Ip}from"react";import{checkLicense as Ap}from"@donotdev/core";var Np='<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512"><title>logo</title><style>.s0{opacity:.98;fill:#f23d29}.s1{opacity:.99;fill:#03bec4}.s2{opacity:.97;fill:#27494a}</style><g id="Background"><path id="Path 0" fill-rule="evenodd" class="s0" d="m254 41.1c5.8-0.1 15.2 0.4 21 0.9 5.8 0.6 16 2.2 22.8 3.5 6.7 1.4 17.5 4.2 23.9 6.4 6.5 2.1 16.7 6.1 22.8 8.8 6.1 2.7 15.5 7.6 21 10.8 5.5 3.3 14.3 9.2 19.5 13 5.2 3.9 13.8 11.2 19 16.2 5.2 5 12.2 12.3 15.5 16.2 3.3 4 8.8 11.1 12.2 15.9 3.4 4.8 8.7 13.2 11.7 18.7 3 5.5 6.9 13.4 8.7 17.5 1.7 4.1 4.7 12 6.6 17.5 1.9 5.5 4.5 14.5 5.8 20 1.3 5.5 3.1 15.3 3.9 21.8 0.9 6.6 1.6 19 1.6 28.7 0 9.4-0.7 22.1-1.5 28.3-0.8 6.1-3 17.3-4.8 24.7-1.9 7.4-5.5 18.9-8.2 25.5-2.6 6.6-7 16.3-9.8 21.5-2.8 5.2-8 13.8-11.5 19-3.6 5.2-9.3 12.9-12.7 17-3.5 4.1-10.7 11.8-16.2 17-5.4 5.3-12.7 11.9-16.3 14.7-3.6 2.8-11.4 8.3-17.5 12.2-6.1 4-16.4 9.8-23 13.1-6.6 3.2-17.4 7.6-24 9.8-6.6 2.3-17.2 5.2-23.5 6.6-6.3 1.4-16.2 3-22 3.7-6.4 0.7-17.5 1-28.5 0.6-11.9-0.3-21.7-1.2-29-2.6-6.1-1.1-15.9-3.4-22-5.1-6.1-1.7-15.9-5.2-22-7.6-6.1-2.5-15.5-6.9-21-9.8-5.5-2.9-14.1-8-19-11.3-4.9-3.3-12.4-8.7-16.5-12-4.1-3.4-12.5-11.2-18.6-17.4-6.1-6.3-13.9-15.2-17.3-19.9-3.5-4.7-8.8-12.6-11.9-17.5-3-4.9-7.9-13.9-10.8-20-2.9-6.1-7.1-16.4-9.3-23-2.2-6.6-5.1-17.6-6.5-24.5-1.4-6.9-3-17.4-3.7-23.5-0.7-6.7-0.9-17.2-0.6-27 0.4-8.8 1.3-20.5 2.2-26 0.8-5.5 2.7-14.5 4.1-20 1.4-5.5 3.9-14.1 5.5-19 1.7-4.9 6.3-15.8 10.4-24 4-8.3 10-19.1 13.3-24 3.3-4.9 9-12.6 12.5-17 3.6-4.4 11.4-12.8 17.3-18.6 6-5.8 15.4-13.9 20.9-18 5.5-4.1 14.5-10 20-13.2 5.5-3.1 14.5-7.6 20-10.1 5.5-2.4 15.1-6 21.3-8 6.1-2 16.7-4.7 23.5-6.1 6.7-1.3 16.3-2.8 21.2-3.3 4.9-0.5 13.7-1 19.5-1.1zm-21 38c-4.7 0.5-12.1 1.9-16.5 3-4.4 1.1-11.6 3.1-16 4.5-4.4 1.5-13.8 5.4-21 8.9-7.2 3.5-16.1 8.5-20 11.1-3.8 2.6-10 7.2-13.8 10.3-3.7 3.1-6.7 5.9-6.7 6.3 0 0.5 9.3 10.3 20.8 21.9l20.7 21c5.5-10.5 9-16.5 11.5-20.1 2.4-3.6 7.2-9.6 10.5-13.5 3.3-3.8 9.4-9.6 13.5-12.9 4.1-3.2 10.7-7.4 14.5-9.2 3.9-1.8 9.7-4 13-4.9 3.3-0.8 9.6-1.5 14-1.5 4.4 0 10.7 0.7 14 1.6 3.3 0.9 9.1 3.2 13 5.1 3.9 2 9.3 5.2 12 7.3 2.8 2 8.5 7.5 12.9 12.1 4.3 4.6 10.2 11.8 13.1 15.9 2.9 4.1 7.8 12.2 10.8 18 3 5.8 7.1 14.8 9 20 2 5.2 4.2 13 5.1 17.3 0.9 4.2 1.6 11.4 1.6 15.9 0 5.6-0.6 10.6-2.1 15.3-1.1 3.8-3.8 9.9-5.9 13.5-2.1 3.6-5.8 8.9-8.4 11.7-2.5 2.9-4.6 5.6-4.6 6 0 0.5 1.4 1.2 3.2 1.6 1.8 0.4 6.4 2.4 10.3 4.4 3.9 1.9 9 4.9 11.5 6.6 2.5 1.8 7.1 5.9 10.4 9.2 4.2 4.3 7.1 8.6 10.1 15 2.4 4.9 5 11.9 5.9 15.5 0.9 3.6 2.3 11.9 3.2 18.5 1.1 8 1.4 15.9 1.1 23.5l-0.5 11.5 6.3 6.4c6.3-8.1 10.4-13.8 13.1-17.9 2.8-4.1 6.4-10 8.1-13 1.7-3 5.1-10.2 7.6-16 2.5-5.8 5.8-15.2 7.5-21 1.7-5.8 3.7-13.9 4.6-18 0.8-4.1 2-11.9 2.5-17.3 0.6-5.3 1.1-13.5 1.1-18.2 0-4.7-0.5-12.9-1.1-18.3-0.6-5.3-1.9-13.5-2.9-18.2-1-4.7-3.1-12.3-4.5-17-1.5-4.7-5.1-13.4-7.9-19.5-2.9-6.1-7.6-14.8-10.6-19.5-2.9-4.7-7.2-11-9.5-14-2.3-3-7.8-9.3-12.1-13.9-4.3-4.6-12-11.6-16.9-15.6-4.9-4.1-13.1-9.9-18-13-4.9-3.1-13.3-7.7-18.5-10.2-5.2-2.5-13.6-6.1-18.5-7.8-4.9-1.8-14.2-4.5-20.5-5.9-6.3-1.4-17.1-3-24-3.6-6.9-0.5-13.4-0.9-14.5-0.8-1.1 0.1-4.5 0.3-7.5 0.5-3 0.2-9.3 0.8-14 1.4zm-125.4 79.6c-4.3 6.5-9.8 15.9-12.1 20.8-2.4 4.9-5.9 13.7-7.9 19.5-1.9 5.8-4.4 15-5.5 20.5-1.1 5.5-2.5 15.8-3.1 23-0.6 7.2-0.8 16.8-0.5 21.5 0.4 4.7 1.5 13.9 2.5 20.5 1.1 6.6 3.5 17.3 5.4 23.8 2 6.4 5.5 16.1 7.9 21.5 2.3 5.3 6.7 13.8 9.7 18.7 3 4.9 8.1 12.4 11.4 16.5 3.3 4.1 9.8 11.5 14.5 16.3 4.7 4.9 11.8 11.2 15.6 14.2 3.9 2.9 11.1 7.9 16 11 4.9 3.1 13.1 7.6 18 10 4.9 2.4 13.7 5.9 19.5 7.9 5.8 1.9 14.6 4.4 19.5 5.5 4.9 1.1 13.7 2.5 19.5 3.2 6.6 0.7 16.1 0.9 25.5 0.6 9.8-0.4 19.1-1.5 27-3.1 6.6-1.4 16.7-4.1 22.5-6.1 5.8-2 15-5.8 20.5-8.5 5.5-2.7 13.8-7.4 18.5-10.5 4.7-3.2 9.3-6.5 10.3-7.4 1.6-1.5 1.6-1.7-0.5-3.9-1.3-1.2-2.6-2.2-3-2.2-0.5 0-3.4 2-6.5 4.4-3.2 2.4-9.4 6.4-13.8 8.9-4.4 2.6-12.7 6.4-18.5 8.6-5.8 2.2-15.2 5.1-21 6.5-5.8 1.4-14.6 3-19.5 3.7-4.9 0.6-15.7 1.1-24 1.1-8.2 0-19.5-0.7-25-1.6-5.5-0.8-14.7-2.7-20.5-4.1-5.8-1.5-15-4.5-20.5-6.6-5.5-2.2-12.9-5.6-16.5-7.5-3.6-2-10.3-6.1-15-9.2-4.7-3.1-12.7-9.7-17.8-14.7-7.5-7.2-9.5-9.8-10.2-13-0.5-2.2-1-9.9-1-17 0-7.1 0.7-17.3 1.5-22.5 0.8-5.2 2.3-12.8 3.5-16.8 1.1-3.9 3.3-9.8 4.9-12.9 1.6-3.2 4.5-7.8 6.5-10.3 1.9-2.5 6.1-6.6 9.3-9.3 3.2-2.6 9.2-6.5 13.3-8.6 4.1-2.1 9.3-4.4 11.5-5.1 2.2-0.7 4.3-1.5 4.7-1.9 0.4-0.3-1.3-3.1-3.8-6.1-2.5-3-6.1-8.4-8.2-12-2-3.6-4.7-9.9-6-14-1.8-5.6-2.5-10-2.6-17 0-5.2 0.2-11.7 0.5-14.5l0.6-5-49.2-48.5zm117.6 8.2c-4 1.1-9.8 3.1-13 4.3-3.2 1.3-8.4 4.1-11.6 6.3l-5.8 3.9 6.7 6.5c7.5-3.7 9.9-4 24.2-4 13.2 0 17 0.4 20.4 1.8 2.3 0.9 4.5 2.5 5 3.5 0.6 1.2 2 1.7 4.9 1.7 2.8 0 4.2-0.5 4.8-1.7 0.5-1 2.5-2.6 4.5-3.5 3.1-1.5 6.6-1.8 21.7-1.8 9.9 0 19.1 0.5 20.5 1 1.3 0.6 3.1 2 4 3.3 1.1 1.6 1.5 4.8 1.5 11.7 0 7.9-0.4 10.3-2.3 14-1.2 2.4-3.4 5.3-4.7 6.3-1.4 1-4.3 2.2-6.5 2.7-2.2 0.6-7.9 1-12.5 1-4.7 0-10.3-0.4-12.5-1-2.2-0.5-5.2-1.8-6.5-2.8-1.4-1-3.6-3.6-4.8-5.8-1.2-2.1-2.6-6-3-8.6-0.7-4.6-0.9-4.8-4-4.8-3.2 0-3.3 0.2-4.4 5.8-0.6 3.1-1.7 6.9-2.4 8.2-0.7 1.4-2.5 3.7-4.1 5.2-1.6 1.4-4 2.9-5.3 3.3-2.4 0.7-1 2.2 20.5 23.6 12.6 12.6 23.3 22.9 23.7 22.9 0.4 0 4.4-3.5 8.9-7.7 4.5-4.3 10-10.5 12.2-13.8 2.2-3.3 5.5-9.1 7.3-13 1.8-3.8 4.5-11 5.9-16 1.5-4.9 2.9-12.8 3.2-17.5 0.5-6.5 0.2-9.5-1-13-1-2.6-3.5-6.2-5.9-8.5-2.4-2.3-7.7-5.8-11.8-7.8-4.2-2-10.9-4.5-15-5.5-4.2-1.1-11.6-2.5-16.5-3.1-5-0.6-12.6-1-17-0.9-4.4 0-11.2 0.5-15 1-3.9 0.5-10.3 1.8-14.3 2.8zm-13.7 29.2c-0.5 0.9 2 4.1 8.1 10.1 7.5 7.4 9.4 8.7 12.1 8.7 1.8 0 4.2-0.4 5.3-1 1.1-0.5 2.8-2.9 3.9-5.2 1.1-2.4 2-5.8 2-7.8 0.1-1.9-0.6-4.4-1.3-5.5-1.3-1.8-2.8-2-13.3-2.2-6.5-0.1-12.8 0.2-13.9 0.7-1.2 0.5-2.5 1.5-2.9 2.2zm58.5 1.1c-0.8 2.3-0.8 4.4-0.1 7.5 0.6 2.3 2.1 5.3 3.3 6.6 1.6 1.7 3.9 2.6 8.3 3.1 3.3 0.4 8.2 0.5 11 0.1 2.7-0.4 5.7-1.1 6.7-1.7 1-0.5 2.4-2.4 3.3-4.4 0.8-1.9 1.5-5.2 1.5-7.2 0-2.1-0.7-4.8-1.5-6-1.5-2.2-2.1-2.3-15.3-2.2-7.6 0.1-14.3 0.3-14.9 0.6-0.7 0.2-1.7 1.9-2.3 3.6zm-71.9 38c1.7 3.4 5 8.9 7.4 12.2 2.3 3.3 6.9 8.5 10.1 11.6 3.2 3.1 7.9 6.8 10.4 8.2 2.4 1.4 6.5 3.3 9 4.2 2.4 0.8 4.5 1.4 4.7 1.3 0.1-0.2-9.9-10.4-22.3-22.8-12.3-12.3-22.5-22.1-22.5-21.7 0.1 0.4 1.5 3.5 3.2 7z"/><path id="Path 1" class="s1" d="m243 105.6c-3 0.8-8.7 2.9-12.5 4.8-3.8 1.8-10.4 6-14.5 9.2-4.1 3.3-10.2 9.1-13.5 12.9-3.4 3.9-8.4 10.4-11.1 14.5-2.8 4.1-6.5 10.2-8.2 13.5l-3.1 6 14.8 15c9-6.2 15.4-9.4 20.1-11.1 4.7-1.8 12-3.9 16.2-4.8 4.3-0.9 12.4-1.9 18-2.2 6.2-0.4 14.5-0.2 20.8 0.6 5.8 0.6 13.9 2.1 18 3.1 4.1 1.1 10.9 3.6 15 5.6 4.1 2 9.4 5.5 11.8 7.7 2.5 2.4 5 6 5.9 8.6 1.3 3.4 1.5 6.5 1.1 13-0.4 4.7-1.8 12.6-3.2 17.5-1.5 4.9-4.2 12.2-6 16-1.8 3.9-5 9.7-7.3 13-2.2 3.3-8 9.7-12.9 14.3l-8.9 8.3c76.3 76.3 98.8 98 99.2 97.6 0.4-0.5 1-5.7 1.2-11.5 0.2-6.2-0.4-15.7-1.3-22.7-0.9-6.6-2.3-14.9-3.2-18.5-0.9-3.6-3.5-10.6-5.9-15.5-3-6.4-5.9-10.7-10.1-15-3.3-3.3-7.9-7.4-10.4-9.2-2.5-1.7-7.6-4.7-11.5-6.6-3.9-2-8.5-4-10.3-4.4-1.8-0.4-3.2-1.1-3.2-1.5 0-0.5 2.1-3.2 4.6-6 2.6-2.9 6.3-8.2 8.4-11.8 2.1-3.6 4.8-9.6 5.9-13.5 1.5-4.7 2.1-9.7 2.1-15.2 0-4.6-0.7-11.8-1.6-16-0.9-4.3-3.1-12.1-5.1-17.3-1.9-5.2-6-14.2-9-20-3-5.8-7.9-13.9-10.8-18-2.9-4.1-8.8-11.3-13.1-15.9-4.4-4.6-10.2-10.1-12.9-12.1-2.8-2.1-8.1-5.3-12-7.3-3.9-1.9-9.7-4.2-13-5.1-3.3-0.9-9.8-1.5-14.5-1.5-4.7 0-11 0.7-14 1.5zm-78.7 93.9c-0.4 2.2-0.8 8.7-0.7 14.5 0.1 8.3 0.6 12.1 2.5 18 1.4 4.1 4.1 10.4 6.1 14 2.1 3.6 5.7 9 8.2 12 2.5 3 4.2 5.8 3.8 6.1-0.4 0.4-2.5 1.2-4.7 1.9-2.2 0.7-7.4 3-11.5 5.1-4.1 2.1-10.1 6-13.3 8.6-3.2 2.7-7.4 6.8-9.3 9.3-2 2.5-4.9 7.1-6.5 10.3-1.6 3.1-3.8 9-4.9 13-1.2 3.9-2.7 11.5-3.5 16.7-0.8 5.2-1.5 15.4-1.5 22.5 0 7.1 0.5 14.8 1 17 0.7 3.2 2.7 5.8 10.2 13 5.1 5 13.1 11.6 17.8 14.7 4.7 3.1 11.4 7.2 15 9.2 3.6 1.9 11 5.3 16.5 7.5 5.5 2.1 14.7 5.1 20.5 6.6 5.8 1.4 15 3.3 20.5 4.1 5.5 0.9 16.8 1.6 25 1.6 8.3 0 19.1-0.5 24-1.1 4.9-0.7 13.7-2.3 19.5-3.7 5.8-1.4 15.2-4.3 21-6.5 5.8-2.2 14.1-6 18.5-8.6 4.4-2.5 10.8-6.7 14.2-9.2 3.5-2.5 6.3-4.9 6.3-5.3 0-0.5-26.5-27-58.8-59-54.3-53.8-59.2-58.4-63.8-59.8-2.7-0.8-7.4-3-10.4-4.8-3-1.8-7.9-5.7-10.8-8.5-3-2.9-7.3-7.9-9.7-11.2-2.4-3.3-6.4-10.3-8.9-15.5-4.2-8.7-5.6-10.6-18-23l-13.5-13.5z"/><path id="Path 2" fill-rule="evenodd" class="s2" d="m225.8 184c13.2 0 17 0.3 20.3 1.8 2.3 0.9 4.6 2.5 5 3.5 0.6 1.2 2.1 1.7 4.9 1.7 2.8 0 4.3-0.5 4.9-1.8 0.4-0.9 2.5-2.5 4.5-3.5 3-1.4 6.5-1.7 21.6-1.7 9.9 0 19.1 0.4 20.5 1 1.4 0.6 3.2 2 4 3.3 1.2 1.6 1.6 4.8 1.6 11.7-0.1 7.9-0.4 10.3-2.3 13.9-1.3 2.5-3.4 5.3-4.8 6.3-1.4 1-4.3 2.3-6.5 2.8-2.2 0.5-7.8 1-12.5 1-4.7 0-10.3-0.5-12.5-1-2.2-0.5-5.1-1.8-6.5-2.8-1.4-1-3.5-3.6-4.7-5.8-1.3-2.1-2.6-6-3-8.7-0.8-4.5-0.9-4.7-4.1-4.7-3.1 0-3.2 0.2-4.3 5.8-0.6 3.1-1.7 6.8-2.4 8.2-0.7 1.4-2.6 3.7-4.2 5.2-1.5 1.5-3.9 3-5.3 3.3-2 0.6-3.3 0-6.8-3.1-2.4-2.2-4.3-4.2-4.2-4.6 0-0.5 1.3-0.8 3-0.8 1.6 0 3.9-0.4 5-1 1.1-0.6 2.9-2.9 4-5.2 1.1-2.4 2-5.9 2-7.8 0-1.9-0.6-4.4-1.4-5.5-1.3-1.8-2.6-2-14.4-2-11.6 0-13.2 0.2-17.1 4l-4-4.5c-2.1-2.5-3.7-4.8-3.5-5.2 0.2-0.5 1.9-1.5 3.6-2.3 2.5-1 7.5-1.4 19.5-1.5zm44.3 13.3c-0.8 2.3-0.8 4.4-0.1 7.5 0.6 2.3 2.1 5.3 3.3 6.6 1.7 1.7 3.9 2.5 8.3 3.1 3.3 0.4 8.2 0.4 11 0 2.7-0.3 5.8-1.1 6.7-1.6 1-0.5 2.5-2.5 3.3-4.4 0.8-1.9 1.5-5.2 1.5-7.2 0-2.1-0.7-4.8-1.5-6-1.4-2.2-2.1-2.3-15.3-2.2-7.5 0-14.2 0.3-14.9 0.5-0.6 0.3-1.7 2-2.3 3.7zm-40 126.7c0.3-0.1 2.2 2 8 9l-23.5 22.7 22.4 23.8-7.8 8-16.1-15.5c-8.8-8.5-16.2-15.8-16.3-16.2-0.1-0.3 7.3-7.6 16.3-16.2 9.1-8.6 16.7-15.6 17-15.6zm33.5 0l4 0.1c2.2 0.1 5 0.4 6.1 0.7 2.1 0.7 1.8 1.7-19.4 62.7l-5.3-0.3c-3-0.2-5.6-0.5-5.9-0.7-0.3-0.2 4.2-14.4 10-31.4zm20.7 3.9l2.7 1.9c1.4 1.1 8.2 7.3 27.6 26l-15.5 15.6c-8.5 8.6-16 15.6-16.7 15.6-0.7 0-2.9-2-8.3-8.5l23.2-22-6.8-6.7c-3.8-3.7-8.1-7.6-9.6-8.8-1.5-1.1-2.8-2.5-2.9-3.1 0-0.6 1.4-3.1 3.1-5.5z"/></g></svg>',cr=`data:image/svg+xml,${encodeURIComponent(Np)}`;import{jsx as wo,jsxs as dr}from"react/jsx-runtime";function xh(){let e=Ap();return Ip(()=>{e.isValid},[e.isValid]),e.isValid?null:dr("a",{href:"https://donotdev.com/pricing",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",insetInlineEnd:"20px",top:"50%",transform:"translateY(-50%)",zIndex:9999,display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",backgroundColor:"rgba(255, 255, 255, 0.95)",border:"2px solid rgba(242, 61, 41, 0.3)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",textDecoration:"none",transition:"all 0.2s ease",cursor:"pointer",opacity:.9},onMouseEnter:t=>{t.currentTarget.style.opacity="1",t.currentTarget.style.transform="translateY(-50%) scale(1.05)"},onMouseLeave:t=>{t.currentTarget.style.opacity="0.9",t.currentTarget.style.transform="translateY(-50%) scale(1)"},children:[wo("img",{src:cr,alt:"DoNotDev Logo",style:{width:"48px",height:"48px",flexShrink:0}}),dr("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[wo("div",{style:{fontFamily:"system-ui, sans-serif",fontSize:"13px",fontWeight:"600",color:"#27494a",lineHeight:"1.2"},children:"DoNotDev"}),wo("div",{style:{fontFamily:"system-ui, sans-serif",fontSize:"11px",fontWeight:"500",color:"#f23d29",lineHeight:"1.2"},children:"Get License"})]})]})}fe();import{useEffect as Lp,useState as No,useMemo as Pp}from"react";import{Stack as Io,Spinner as Ep}from"@donotdev/components";import{useTranslation as pr,isFieldVisible as Rp}from"@donotdev/core";import{useCrud as Dp,DisplayFieldRenderer as Fp}from"@donotdev/crud";import{jsx as ke,jsxs as Mp}from"react/jsx-runtime";function Bp({entity:e,id:t,t:o,className:n="",loadingMessage:r,notFoundMessage:a,viewerRole:i,excludeFields:l}){let d=L("userRole"),c=i??d,{get:s,loading:p,data:g,error:m,isAvailable:u}=Dp(e),[y,f]=No(!1),[h,S]=No(null),[C,T]=No(null),{t:N}=pr([e.namespace,"crud"]),{t:x}=pr("crud"),A=o||N;Lp(()=>{if(!t){T(null),S(null),f(!1);return}if(!u||!s)return;let w=!1;return f(!0),S(null),s(t).then(D=>{w||(f(!1),D?(T(D),S(null)):(T(null),S(new Error("Entity not found"))))}).catch(D=>{w||(f(!1),S(D instanceof Error?D:new Error(String(D))),T(null))}),()=>{w=!0}},[t,s,u]);let E=g||C,b=m||h,v=p||y||!t,k=Pp(()=>E?Object.entries(e.fields).filter(([w,D])=>{if(l?.includes(w)||!Rp(D.visibility,c)||D.visibility==="hidden")return!1;let R=E[w];return!(R==null||typeof R=="string"&&R.trim()===""||Array.isArray(R)&&R.length===0||typeof R=="object"&&!Array.isArray(R)&&R!==null&&Object.keys(R).length===0)}):[],[e.fields,c,E,l]);return v?ke("div",{style:{position:"relative",width:"100%",gridColumn:"1 / -1",display:"contents"},className:n,children:ke(Ep,{overlay:!0,"aria-label":r||x("form.loading",{defaultValue:"Loading..."})})}):b||!E?ke(Io,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},className:n,children:Mp(Io,{direction:"column",gap:"tight",children:[ke("h3",{style:{color:"var(--muted-foreground)"},children:a||x("errors.notFound",{defaultValue:`${e.name} not found`})}),b&&ke("p",{style:{color:"var(--destructive)",fontSize:"var(--font-size-sm)"},children:b instanceof Error?b.message:String(b)})]})}):ke(Io,{direction:"column",className:n,children:k.map(([w,D])=>ke(Fp,{name:w,config:D,value:E[w],t:A},w))})}import{RefreshCw as Op,Plus as zp,Trash2 as Vp,Edit as Up,Search as _p}from"lucide-react";import{useMemo as Gp,useCallback as je,useState as Ao}from"react";import{DataTable as Hp,Button as Lo,Stack as Po,ActionButton as $p,Section as ur,Input as Wp}from"@donotdev/components";import{useTranslation as mr}from"@donotdev/core";import{translateFieldLabel as Kp,useCrud as Yp,useCrudList as qp,EntityFilters as Zp,formatValue as jp}from"@donotdev/crud";import{Fragment as Qp,jsx as ne,jsxs as It}from"react/jsx-runtime";function Jp({entity:e,basePath:t,onClick:o,hideFilters:n=!1,pagination:r="client",pageSize:a,queryOptions:i,exportable:l=!0}){let d=Re(),c=t??`/${e.collection}`,[s,p]=Ao(1),[g,m]=Ao(a),[u,y]=Ao(""),{data:f,items:h,processed:S,loading:C,mutate:T}=qp(e,{pagination:r,searchQuery:u,...i&&{queryOptions:i},...r==="server"&&{page:s,pageSize:g}}),{delete:N}=Yp(e),{t:x}=mr("crud"),{t:A}=mr([e.namespace,"crud"]),E=je(async()=>{await T()},[T]),b=je(F=>{d(`${c}/${F}`)},[c,d]),v=je(F=>{o?o(F):d(`${c}/${F}`)},[c,d,o]),k=je(()=>{d(`${c}/new`)},[c,d]),w=je(async F=>{await N(F)},[N]),D=Gp(()=>{let Je=(e.listFields||Object.keys(e.fields)).map(re=>{let q=e.fields[re];if(!q)return null;let ge=Kp(re,q,A),Qe=q.type||"text";return{key:re,title:ge,dataIndex:re,sortable:!0,filterable:!0,align:Qe==="number"||Qe==="range"?"end":"start",render:(Dt,Fo)=>jp(Dt,q,A,{compact:!0})}}).filter(Boolean);return Je.unshift({key:"_actions",title:x("actions.label",{defaultValue:"Actions"}),dataIndex:void 0,sortable:!1,width:120,align:"center",render:(re,q)=>It(Po,{direction:"row",gap:"tight",align:"center",justify:"center",children:[ne(Lo,{variant:"outline",icon:Up,onClick:ge=>{ge.stopPropagation(),b(q.id)},"aria-label":x("edit",{defaultValue:"Edit"})}),ne($p,{action:async()=>{await w(q.id)},confirmText:x("delete.confirm",{defaultValue:"Are you sure you want to delete this item?"}),confirmTitle:x("delete.title",{defaultValue:"Delete Item"}),loadingText:x("delete.loading",{defaultValue:"Deleting..."}),variant:"destructive",icon:Vp,"aria-label":x("delete",{defaultValue:"Delete"}),children:x("delete",{defaultValue:"Delete"})})]})}),Je},[e,A,x,b,w]),R=A("name",{defaultValue:e.name}),me=S.length;return It(Qp,{children:[ne(ur,{title:x("filters.title",{entity:R,defaultValue:`Browse ${R} - Filters`}),collapsible:!0,defaultOpen:!0,children:It(Po,{children:[It(Po,{direction:"row",gap:"tight",align:"center",className:"dndev-w-full",style:{display:"grid",gridTemplateColumns:"1fr auto auto"},children:[ne(Wp,{placeholder:x("search.placeholder",{defaultValue:"Search..."}),value:u,onChange:F=>y(F.target.value),icon:_p,className:"dndev-w-full"}),ne(Lo,{icon:Op,variant:"outline",onClick:E,disabled:C,display:"compact","aria-label":x("refresh",{defaultValue:"Refresh"})}),ne(Lo,{icon:zp,onClick:k,display:"compact",children:x("addNew",{defaultValue:"Add New"})})]}),!n&&ne(Zp,{entity:e,data:h,fieldsToFilter:e.listFields})]})}),ne(ur,{title:C?x("results.title.fetching",{defaultValue:"Fetching..."}):x("results.title.count",{count:me,defaultValue:me===1?"Found 1 occurrence":`Found ${me} occurrences`}),collapsible:!0,defaultOpen:!0,children:ne(Hp,{data:S,columns:D,sortable:!0,searchable:!1,pagination:!0,loading:C,onRowClick:F=>v(F.id),showingLabel:x("pagination.showing",{defaultValue:"Showing {{from}} to {{to}} of {{total}} entries"}),paginationPreviousLabel:x("pagination.previous",{defaultValue:"Previous"}),paginationNextLabel:x("pagination.next",{defaultValue:"Next"}),paginationItemsPerPagePlaceholder:x("pagination.itemsPerPagePlaceholder",{defaultValue:"Items per page"}),...a&&{pageSize:a},...r==="server"&&{currentPage:s,pageSize:g,total:f?.total,onPageChange:p,onPageSizeChange:m},exportable:l,exportFilename:`${e.collection}-export`,exportLabel:x("export",{defaultValue:"Export"})})})]})}import{useMemo as fr,useCallback as eu}from"react";import{Heart as vr}from"lucide-react";import{Card as tu,Grid as ou,Stack as Eo,Text as hr,Spinner as nu,Section as yr,Button as ru}from"@donotdev/components";import{useTranslation as br,getListCardFieldNames as au}from"@donotdev/core";import{useCrudCardList as iu,EntityFilters as su,useEntityFavorites as lu,useCrudFilters as cu}from"@donotdev/crud";import{CrudCard as Xp}from"@donotdev/crud";import{jsx as gr}from"react/jsx-runtime";function At({detailHref:e,onClick:t,...o}){let n=gr(Xp,{...o,onClick:e?void 0:t});return e?gr(I,{path:e,"aria-label":o.item?.id?`View ${o.item.id}`:void 0,children:n}):n}import{Fragment as pu,jsx as K,jsxs as Ro}from"react/jsx-runtime";function du({entity:e,basePath:t,onClick:o,cols:n=[1,2,3,4],staleTime:r=1e3*60*30,filter:a,hideFilters:i=!1,resultLabel:l,tone:d}){let c=Re(),s=t??`/${e.collection}`,{items:p,processed:g,loading:m}=iu(e,{staleTime:r}),{isFavorite:u,toggleFavorite:y,favoritesFilter:f}=lu({collection:e.collection}),{showFavoritesOnly:h,setShowFavoritesOnly:S}=cu({collection:e.collection}),C=fr(()=>{let b=g;return h&&(b=b.filter(f)),a&&(b=b.filter(a)),b},[g,h,f,a]),{t:T}=br([e.namespace,"crud"]),{t:N}=br("crud"),x=eu(b=>{o?o(b):c(`${s}/${b}`)},[s,c,o]),A=fr(()=>au(e),[e]),E=T("name",{defaultValue:e.name});return Ro(pu,{children:[!i&&K(yr,{title:N("filters.title",{entity:E,defaultValue:`Browse ${E} - Filters`}),collapsible:!0,defaultOpen:!0,tone:d,children:K(tu,{children:Ro(Eo,{direction:"column",children:[K(ru,{variant:h?"primary":"outline",icon:K(vr,{size:18}),onClick:()=>S(!h),children:h?N("favorites.showAll",{defaultValue:"Show All"}):N("favorites.showFavorites",{defaultValue:"Show Favorites"})}),K(su,{entity:e,data:p,fieldsToFilter:A})]})})}),K(yr,{title:m?N("results.title.fetching",{defaultValue:"Fetching..."}):l?l(C.length):N("results.title.count",{count:C.length,defaultValue:C.length===1?"Found 1 occurrence":`Found ${C.length} occurrences`}),collapsible:!0,defaultOpen:!0,tone:d,children:m?K(Eo,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)"},children:K(nu,{})}):C.length===0?Ro(Eo,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},children:[K(hr,{level:"h3",style:{color:"var(--muted-foreground)"},children:N("emptyState.title",{defaultValue:`No ${e.name.toLowerCase()} found`})}),K(hr,{style:{color:"var(--muted-foreground)"},children:N("emptyState.description",{defaultValue:`No ${e.name.toLowerCase()} available at this time.`})})]}):K(ou,{cols:n,children:C.map(b=>{let v=u(b.id),k=o?void 0:`${s}/${b.id}`;return K(At,{item:b,entity:e,detailHref:k,onClick:o?()=>x(b.id):void 0,renderActions:K(vr,{fill:v?"#ef4444":"#ffffff",stroke:v?"#ef4444":"var(--muted-foreground)",onClick:w=>{w.preventDefault(),w.stopPropagation(),y(b.id)},style:{cursor:"pointer",width:"var(--icon-md)",height:"var(--icon-md)",transition:"fill 0.2s, stroke 0.2s"},"aria-label":v?N("favorites.remove",{defaultValue:"Remove from favorites"}):N("favorites.add",{defaultValue:"Add to favorites"})})},b.id)})})})]})}import{useEffect as Sr,useId as uu,useMemo as Lt,useState as mu}from"react";import{FormProvider as gu}from"react-hook-form";import{Badge as fu,Button as Pt,DropdownMenu as vu,Grid as hu,Stack as yu,Spinner as bu}from"@donotdev/components";import{hasRoleAccess as Su,useTranslation as Cr}from"@donotdev/core";fe();import{DisplayFieldRenderer as Cu,FormFieldRenderer as xu,UploadProvider as ku,useEntityForm as Tu,useUnsavedChangesWarning as wu,useFormStore as Nu}from"@donotdev/crud";import{jsx as Y,jsxs as Et}from"react/jsx-runtime";function Iu({entity:e,onSubmit:t,t:o,className:n="",submitText:r,loading:a=!1,defaultValues:i,submitVariant:l="primary",secondaryButtonText:d,secondaryButtonVariant:c="outline",onSecondarySubmit:s,viewerRole:p,operation:g=i?"edit":"create",formId:m,cancelText:u,cancelPath:y,successPath:f,onCancel:h,warnOnUnsavedChanges:S=!0,unsavedChangesMessage:C,hideVisibilityInfo:T=!1}){let N=Re(),x=L("userRole"),A=p??x,E=uu(),b=m??`entity-form-${e.name}-${E}`,{t:v}=Cr([e.namespace,"crud"]),{t:k}=Cr("crud"),w=o||v,R=!T&&(A==="admin"||A==="super"),me=A==="user"||A==="admin"||A==="super",[F,Je]=mu(A==="admin"||A==="super"||A==="user"?A:"guest"),re={guest:"muted",user:"secondary",admin:"warning",super:"destructive",technical:"accent",owner:"secondary"},q=["guest","user","admin","super"],ge={guest:"Guest",user:"User",admin:"Admin",super:"Super",technical:"System"},Qe=Lt(()=>q.filter(P=>Su(A,P)).map(P=>({label:ge[P],checked:F===P,onClick:()=>Je(P)})),[F,A]),Xe=Tu(e,{formId:b,operation:g,defaultValues:i,viewerRole:A,t:w}),{control:Do,handleSubmit:Dt,formState:{errors:Fo},fields:Ft,formStatus:et,uploadProgress:Me,cleanup:Bo,isDirty:Ir,hasUserInteracted:Ar,resetForm:Lr}=Xe,Bt=Ir&&Ar,Pr=Lt(()=>{if(!me)return Ft;let P=q.indexOf(F);return Ft.filter(({config:H})=>{let X=H.visibility;return X==="hidden"?!1:X==="technical"?!0:q.indexOf(X)<=P})},[Ft,me,F]);Sr(()=>{b&&Nu.getState().setIsDirty(b,Bt)},[b,Bt]),Sr(()=>Bo,[Bo]);let Er=Lt(()=>C||k("messages.unsavedChangesLeave",{defaultValue:"You have unsaved changes. Are you sure you want to leave?"}),[C,k]);wu({isDirty:Bt,enabled:S,message:Er});let Rr=()=>{Lr(),h?h():N(y||"back")},Dr=async P=>{try{await t(P),N(f||"back")}catch{}},Fr=u!==null,Mo=u??k("form.cancel",{defaultValue:"Cancel"}),Oo={gridColumn:"1 / -1",position:"sticky",bottom:0,backgroundColor:"var(--background)",borderTop:"1px solid var(--border)",paddingTop:"var(--gap-md)",paddingBottom:"var(--gap-md)",zIndex:10,marginTop:"var(--gap-lg)"},Br=a||g==="edit"&&!i,ae=Lt(()=>et==="uploading"?{loading:!0,loadingText:Me<100?k("form.uploading",{progress:Math.round(Me),defaultValue:`Uploading ${Math.round(Me)}%...`}):k("form.processing",{defaultValue:"Processing..."}),progress:Me}:et==="validating"?{loading:!0,loadingText:k("form.validating",{defaultValue:"Validating..."})}:et==="submitting"?{loading:!0,loadingText:k("form.saving",{defaultValue:"Saving..."})}:{loading:!1},[et,Me,k]);return Y(gu,{...Xe,children:Y(ku,{formId:b,children:Et("div",{style:{position:"relative",width:"100%",gridColumn:"1 / -1",display:"contents"},children:[Br&&Y(bu,{overlay:!0}),Et("form",{onSubmit:Dt(Dr),noValidate:!0,className:n,style:{width:"100%",gridColumn:"1 / -1",display:"contents"},children:[Pr.map(({name:P,config:H,editable:X})=>{let Te=R&&H.visibility!=="guest",Mr=H.visibility!=="hidden"?re[H.visibility]:void 0,Or=ge[H.visibility]??H.visibility,zo=X?Y(xu,{name:P,config:H,control:Do,errors:Fo,t:w},P):Y(Cu,{name:P,config:H,value:i?.[P],t:w},P);return Te?Et("div",{style:{position:"relative"},children:[Y(fu,{as:"span",variant:Mr,style:{position:"absolute",top:0,insetInlineEnd:0,fontSize:"var(--font-size-xs)",zIndex:1},children:Or}),zo]},P):zo}),(()=>{let P=[];if(Fr&&Mo&&P.push(Y(Pt,{type:"button",onClick:Rr,disabled:ae.loading,variant:"outline",className:"dndev-w-full",children:Mo},"cancel")),me){let Te=re[F]||"muted";P.push(Y(vu,{trigger:Et(Pt,{type:"button",variant:Te,disabled:ae.loading,className:"dndev-w-full",children:[k("visibility.preview",{defaultValue:"Preview"}),": ",ge[F]]}),items:Qe},"preview"))}d&&P.push(Y(Pt,{type:"button",onClick:()=>{if(s){let Te=Xe.getValues();s(Te)}},loading:ae.loading,loadingText:ae.loadingText,progress:ae.progress,variant:c,className:"dndev-w-full",children:d},"secondary")),P.push(Y(Pt,{type:"submit",loading:ae.loading,loadingText:ae.loadingText,progress:ae.progress,variant:l,className:"dndev-w-full",children:r||k("form.submit",{defaultValue:"Submit"})},"submit"));let H=P.length;if(H===1)return Y(yu,{direction:"column",gap:"tight",style:Oo,children:P[0]});let X=H===2?"1fr 2fr":H===3?"1fr 1fr 2fr":"1fr 1fr 1fr 2fr";return Y(hu,{cols:["1fr",X,X,X],gap:"tight",style:Oo,children:P})})()]})]})})})}import{Section as Au}from"@donotdev/components";import{useCrudCardList as Lu}from"@donotdev/crud";import{jsx as xr}from"react/jsx-runtime";function Pu({entity:e,queryOptions:t,title:o,basePath:n,cols:r=3,className:a}){let{items:i,loading:l}=Lu(e,{queryOptions:t});if(!l&&i.length===0)return null;let d=n??`/${e.collection}`;return xr(Au,{title:o,gridCols:r,className:a,children:i.map(c=>xr(At,{item:c,entity:e,detailHref:`${d}/${c.id}`},c.id))})}import{createContext as Tr,useId as Eu,use as kr}from"react";import{Controller as Ru,FormProvider as Du,useFormContext as Fu}from"react-hook-form";import{Label as Bu,Slot as Mu,cn as Ou,Stack as zu}from"@donotdev/components";import{jsx as ue}from"react/jsx-runtime";var v3=Du,wr=Tr({}),h3=({...e})=>ue(wr.Provider,{value:{name:e.name},children:ue(Ru,{...e})}),Nr=Tr({}),y3=({className:e,...t})=>{let o=Eu();return ue(Nr.Provider,{value:{id:o},children:ue(zu,{className:e,...t})})},Rt=()=>{let e=kr(wr);if(!e||!e.name)return null;let t=kr(Nr);if(!t)return null;let{getFieldState:o,formState:n}=Fu(),r=o(e.name,n),{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},b3=({className:e,...t})=>{let o=Rt();if(!o)return null;let{error:n,formItemId:r}=o;return ue(Bu,{className:Ou(n&&"text-destructive",e),htmlFor:r,...t})},S3=({...e})=>{let t=Rt();if(!t)return null;let{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=t;return ue(Mu,{id:n,"aria-describedby":o?`${r} ${a}`:`${r}`,"aria-invalid":!!o,...e})},C3=({className:e,...t})=>{let o=Rt();if(!o)return null;let{formDescriptionId:n}=o;return ue("p",{id:n,className:e,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},...t})},x3=({className:e,children:t,...o})=>{let n=Rt();if(!n)return null;let{error:r,formMessageId:a}=n,i=r?String(r?.message):t;return i?ue("p",{id:a,className:e,style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:"var(--destructive)"},...o,children:i}):null};var Vu={layoutContainer:"dndev-layout",sidebar:"sidebar",sidebarTop:"sidebar-top",sidebarContent:"sidebar-content",sidebarBottom:"sidebar-bottom",sidebarResizeHandle:"dndev-sidebar-resize-handle",header:"header",main:"main",footer:"footer",container:"dndev-container",pageContainer:"dndev-container",breadcrumbsContainer:"breadcrumbs-container"},Uu={zHeader:"dndev-z-header",zSidebar:"dndev-z-sidebar",zOverlay:"dndev-z-overlay",zModal:"dndev-z-modal",zTooltip:"dndev-z-tooltip",zToast:"dndev-z-toast"},R3={...Vu,...Uu},D3={headerHeight:"--header-height",headerPadding:"--header-padding",headerIconSize:"--header-icon-size",headerLogoMaxHeight:"--header-logo-max-height",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",mainPadding:"--main-padding",mainMaxWidth:"--main-max-width",contentWidth:"--content-width",contentPadding:"--content-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zOverlay:"--z-overlay",zModal:"--z-modal",zTooltip:"--z-tooltip",zToast:"--z-toast"},F3={headerHeight:"--header-height",headerPadding:"--header-padding",logoSize:"--logo-size",sidebarWidth:"--sidebar-width",sidebarPadding:"--sidebar-padding",footerHeight:"--footer-height",footerPadding:"--footer-padding",layoutGap:"--layout-gap",sectionGap:"--gap-lg",contentGap:"--content-gap",zHeader:"--z-header",zSidebar:"--z-sidebar",zFooter:"--z-footer",zModal:"--z-modal",zTooltip:"--z-tooltip"};export{Ec as AppBranding,Fc as AppIcon,nl as AppLoading,Oc as AppTitle,G as AssetResolver,ba as AuthGuard,l1 as AuthGuardFallback,ro as AuthHeader,oo as AuthMenu,Zc as Breadcrumbs,vo as CacheSettings,_2 as ConsentBanner,mn as DnDevNavigationMenu,fd as DropdownNavigation,du as EntityCardList,Bp as EntityDisplayRenderer,Iu as EntityFormRenderer,Jp as EntityList,Pu as EntityRecommendations,Jl as FeatureCard,ul as FeatureDisabled,bd as FloatingLanguageSwitcher,To as FooterBranding,vp as FooterCopyright,Tp as FooterLegalLinks,v3 as Form,S3 as FormControl,C3 as FormDescription,h3 as FormField,y3 as FormItem,b3 as FormLabel,x3 as FormMessage,K2 as GameContainer,j2 as GameFlow,Xc as GameTitle,g1 as GoTo,zi as GoToInput,Li as GoToWrapper,wd as HeaderMenu,Rd as HeaderNavigation,_r as Icon,xh as LicenseWatermark,I as Link,nt as Loader,wl as LoadingContainerOverlay,bt as LoadingMessage,vl as LoadingMessageAlmostDone,hl as LoadingMessageComplete,Cl as LoadingMessageConnecting,fl as LoadingMessageProcessing,yl as LoadingMessageSaving,Sl as LoadingMessageSearching,gl as LoadingMessageSimple,bl as LoadingMessageUploading,Nl as LoadingOverlay,Ll as LoadingScreen,gn as NotFoundPage,Hd as Notifications,dt as PageContainer,Gl as ProgressBar,Vl as RedirectOverlay,tp as SettingsMenu,Wl as Skeleton,yc as TechBento,lp as ThemeToggle,R3 as allLayoutClasses,Pm as createAuthConfig,F3 as cssVariables,lm as isAuthAvailable,Wg as isBillingAvailable,Vg as isFormStoreAvailable,Xg as isOAuthAvailable,Vu as layoutClasses,Uu as layoutUtilities,D3 as layoutVariables,Mg as resolveFaviconSet,Bg as resolveLogo,Fe as sanitizeSvg,rf as tList,po as techLogos,L as useAuthSafe,Am as useAuthState,ft as useAuthVisibility,xg as useBack,Zg as useBillingVisibility,wm as useCanAccess,Sa as useCanNavigate,Rt as useFormField,ns as useFormStoreSafe,on as useGoTo,Im as useHasRole,wg as useLocation,Lg as useMatch,Re as useNavigate,$ as useNavigationItems,en as useNavigationRoute,Qg as useOAuthSafe,Ng as useParams,Tg as usePrefetch,Pg as useQueryParams,Eg as useRedirectGuard,kg as useRefresh,Ig as useRouteParam,Ag as useSearchParams,eo as useStripeBillingSafe,Nm as useUserRole,Lm as withAuth};
|