1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PromptDetailing-IZWcMa0M.js","assets/index-CI6avYI6.js","assets/index-DeQpBK1w.css","assets/label-BQlKK_f_.js","assets/slider-7gOe2CXO.js","assets/index-BdQq_4o_.js","assets/index-B_KX8jQJ.js","assets/input-c2KtIZde.js","assets/switch-D6zflKri.js","assets/textarea-IX93-vF_.js","assets/sheet-DX3EzlTs.js","assets/EnhancePromptButton-DdVNcnp-.js","assets/tabs-BGQ9QXuD.js","assets/index-BcJPsVME.js","assets/usePromptLibrary-C5CEaCAA.js","assets/useQuery-D5L_x_gu.js","assets/search-Bhk1X3Qs.js","assets/clock-3-BhY1nMpj.js","assets/bookmark-8KyNiB-W.js","assets/trash-2-D5KzDcyR.js","assets/SavePromptTemplateDialog-C9Gh4u37.js","assets/edgeFunctionError-tJ6Y4zvS.js","assets/file-text-CFZKRJ-8.js","assets/upload-Dk6Qf-Wu.js","assets/info-DXcYVG5D.js","assets/coins-H2WIqHPe.js","assets/copy-Drq--ImP.js","assets/ImageStudioPanel-sL33kkR_.js","assets/validateFileSize-C7ikwWBe.js","assets/downloadMedia-Dg5VgXG3.js","assets/useGenerationHistory-BdajsE2r.js","assets/jszip.min-CUN1uuLl.js","assets/carouselExport-QNjCDl6c.js","assets/scissors-CzNmxX7_.js","assets/plus-BBFzmmnQ.js","assets/clock-D3F-Mnix.js","assets/triangle-alert-BWa2d4ok.js","assets/chevrons-left-right-BL1orcUd.js","assets/urlToFile-DJQYh0S3.js","assets/appBusy-CkJDjNRs.js","assets/image-off-C5HKoMag.js","assets/sliders-horizontal-Co0fz36n.js","assets/eye-off-C3zH4o_Z.js","assets/lock-DUISuNvr.js","assets/crop-Gpmqi6Lu.js","assets/square-CvJMjA1Q.js","assets/pen-line--HpgG474.js","assets/eraser-DR9Vt5YQ.js","assets/undo-2-CMZdwaPr.js","assets/redo-2-Csz8nU3U.js","assets/rotate-ccw-DaRVmOC9.js","assets/save-BkC7D8kW.js","assets/type-Df6gUumf.js","assets/settings-2-BMGIEJ1z.js","assets/civitaiResolver-DL-GunhL.js","assets/maximize-2-CP5SPdBE.js","assets/useUpscaleQueue-DhzA5aXP.js","assets/queueDedup-BugJWIrQ.js","assets/RhAccountPicker-DKXqZr90.js","assets/select-i2WPjJAf.js","assets/chevron-up-wPm2ohBk.js","assets/BeforeAfterComparator-BwJH9Td5.js","assets/imageSize-BQ1LJwL9.js","assets/zoom-in-BCq5W7J2.js","assets/globe-DkHoVhqA.js","assets/chevron-left-JMBTzHrp.js","assets/PlaygroundNav-C2z4n-PJ.js","assets/logo-Dd8UVa9P.js","assets/LanguageSwitcher-Cr5a2Gri.js","assets/dropdown-menu-Bjjy4zf9.js","assets/UserMenu-BxMPUou1.js","assets/socialStore-Bxm2RAqo.js","assets/shield-DwxFSf8w.js","assets/spendableCredits-CX4QOaJk.js","assets/credit-card-BqY6ud1w.js","assets/shopping-cart-CEwcEKk2.js","assets/wallet-zjUNLzfN.js","assets/SocialClubLogo-DLChgcn1.js","assets/music-OmZErj2x.js","assets/graduation-cap-DnTgXwF6.js","assets/frame-CZ3Jjrzo.js","assets/scaling-D7VPqXOC.js","assets/workflow-2urjC8gC.js","assets/grip-vertical-JCAMTWvw.js","assets/CooldownBanner-CpZKs13W.js","assets/ThumbnailImage-CtSRHMQz.js","assets/privateMedia-CtsDdz0F.js","assets/use-mobile-BN24EY3X.js","assets/FaceSwapPanel-C7wz9JIW.js","assets/ModelIcon-DZ7sxSJt.js","assets/GrokBrandIcon-BwdE94Pb.js","assets/Gpt25ModeSelector-BbkY0pg4.js","assets/gpt-image-models-B9mJr-5C.js","assets/googleCreditMode-bNxNPhoz.js","assets/swapTemplates-BDz9nWhr.js","assets/card-i29gSW3Q.js","assets/PresetSelector-DNZwdfrT.js","assets/package-D4myghke.js","assets/useSwapQueue-DMpV2vUH.js","assets/popover-DB1-wPER.js","assets/tag-C1AxP3a0.js","assets/edgeRouter-BVYNcvQs.js","assets/seedreamPricing-_VPL6COl.js","assets/qwen3Pricing-Cz2SNhkX.js","assets/useUserGoogleKeys-DYA_LwoN.js","assets/GoogleAuthPicker-DNYaDylq.js","assets/lightbulb-DWq3TERE.js","assets/smile-BBAxtjaw.js","assets/hand-Dxlz2aic.js","assets/ban-CFCXiXwL.js","assets/circle-check-big-DN2Mt9BK.js","assets/PhotoShootPanel-Dk743G8V.js","assets/edgeStream-CX4ABRpE.js","assets/SocialPostPanel-Ld47OI33.js","assets/generationErrorMessage-BKLLzFr6.js","assets/smartphone-Co88a6Al.js","assets/sun-D0lR58RN.js","assets/UgcCreatorPanel-DFiVjQ2_.js","assets/mountain-CGxNcyUB.js","assets/DatasetCreatorPanel-BLCFOygJ.js","assets/AvatarEnginePanel-Dji3SrEw.js","assets/pencil-BWcptimW.js","assets/CharacterSheetPanel-HOTRTk_9.js","assets/sceneBuilderPrompts-CJLJMVeG.js","assets/CharacterTrainerPanel-C4mr4Rq_.js","assets/progress-CYLAW0UX.js","assets/settings-QR8NFPa2.js","assets/terminal-B4rofaRA.js","assets/StoryboardPanel-CuKbKPg3.js","assets/ProvadorPanel-D0ifiG5K.js","assets/AssetPickerDialog-CKiYNqc6.js","assets/CloakifyPanel-CRPElOw-.js","assets/preset
1s-4JwVuIOF.js","assets/obfuscate-video-BiyY4aZt.js","assets/history-db-CxqX7m3v.js","assets/shield-alert-C5-HcLXp.js","assets/SocialProofPanel-CcZOvWTT.js","assets/index-nRTU4C0Q.js","assets/volume-x-B2SpRrfK.js","assets/check-check-BmbafQTy.js","assets/paperclip-BPFg0BL9.js","assets/mic-Byu7jJ-C.js","assets/send-BrwBoPfv.js","assets/languages-C_SUt6M9.js","assets/instagram-BhwS_HJ0.js","assets/music-2-DFuRUYTg.js","assets/volume-2-B2ydUZNX.js","assets/CarouselPanel-CkZpyNgX.js","assets/minus-DFCv2y7o.js","assets/ContentMachinePanel-EdSt9i_4.js","assets/AdsMixerPanel-DJ1or4L5.js","assets/videoTrim-Dw1ZFPG3.js","assets/gauge-DvJZIXTw.js","assets/circle-alert-hlsKdNHB.js","assets/DepthMapPanel-GjLAemqw.js","assets/depthMapClient-DCVuO4l4.js"])))=>i.map(i=>d[i]); 2import{cP as T,cH as B,c9 as n,b6 as K,aR as Y,w as Q,an as X,a5 as Z,ar as ee,aT as ae,aV as $,b5 as te,ap as se,N as re,C as oe,v as ie,b4 as ne,ai as le,a1 as ce,F as de,aU as me,ah as W,cp as L,bT as e,u as M,c4 as G,M as pe,z as ue,cv as U,cw as J,P as xe,R as he,U as ge,V as fe,aS as be,S as ye,T as je,x as ve,aD as Ne,b8 as we,aa as _e,p as ke,Y as Pe,ba as He,cG as Oe,cI as Ee,s as Ce,am as Ie,bc as h}from"./index-CI6avYI6.js";import{P as Se}from"./PlaygroundNav-C2z4n-PJ.js";import{S as De}from"./scaling-D7VPqXOC.js";import{W as Ae}from"./workflow-2urjC8gC.js";import{G as F}from"./grip-vertical-JCAMTWvw.js";import{S as Te}from"./save-BkC7D8kW.js";import{L as R}from"./lock-DUISuNvr.js";import{C as Le}from"./chevron-up-wPm2ohBk.js";import{C as ze}from"./CooldownBanner-CpZKs13W.js";import{d as Ge}from"./useGenerationHistory-BdajsE2r.js";import{d as Re}from"./downloadMedia-Dg5VgXG3.js";import{T as Ve}from"./ThumbnailImage-CtSRHMQz.js";import{u as $e}from"./privateMedia-CtsDdz0F.js";import{C as V}from"./clock-D3F-Mnix.js";import{T as z}from"./triangle-alert-BWa2d4ok.js";import{u as Me}from"./use-mobile-BN24EY3X.js";const I=[{id:"faceswap",icon:K,gradient:"from-pink-500/80 to-rose-600/80",premiumOnly:!0},{id:"detail",icon:Y,gradient:"from-violet-500/80 to-indigo-600/80",premiumOnly:!0},{id:"editor",icon:Q,gradient:"from-emerald-500/80 to-teal-600/80",premiumOnly:!1},{id:"upscale",icon:De,gradient:"from-blue-500/80 to-cyan-600/80",premiumOnly:!1},{id:"socialpost",icon:X,gradient:"from-rose-500/80 to-pink-600/80",premiumOnly:!0},{id:"carousel",icon:Z,gradient:"from-sky-500/80 to-cyan-600/80",premiumOnly:!0,beta:!0},{id:"contentmachine",icon:ee,gradient:"from-orange-500/80 to-rose-600/80",premiumOnly:!0,beta:!0},{id:"tryon",icon:ae,gradient:"from-indigo-500/80 to-violet-600/80",premiumOnly:!0},{id:"avatar",icon:$,gradient:"from-violet-500/80 to-fuchsia-600/80",premiumOnly:!0},{id:"ugc",icon:te,gradient:"from-orange-500/80 to-amber-600/80",premiumOnly:!0},{id:"socialproof",icon:se,gradient:"from-sky-500/80 to-indigo-600/80",premiumOnly:!0},{id:"dataset",icon:re,gradient:"from-teal-500/80 to-cyan-600/80",premiumOnly:!0},{id:"photoshoot",icon:oe,gradient:"from-fuchsia-500/80 to-purple-700/80",premiumOnly:!0},{id:"traincharacter",icon:ie,gradient:"from-amber-500/80 to-rose-600/80",premiumOnly:!1},{id:"charactersheet",icon:ne,gradient:"from-amber-500/80 to-orange-600/80",premiumOnly:!0},{id:"storyboard",icon:le,gradient:"from-rose-500/80 to-fuchsia-600/80",premiumOnly:!0},{id:"cloakify",icon:ce,gradient:"from-slate-500/80 to-zinc-700/80",premiumOnly:!0,beta:!0},{id:"videoclone",icon:de,gradient:"from-fuchsia-500/80 to-indigo-600/80",premiumOnly:!0,beta:!0},{id:"adsmixer",icon:me,gradient:"from-red-500/80 to-orange-600/80",premiumOnly:!0,beta:!0},{id:"depthmap",icon:W,gradient:"from-cyan-500/80 to-indigo-600/80",premiumOnly:!0,beta:!0},{id:"labs",icon:Ae,gradient:"from-emerald-500/80 to-cyan-600/80",premiumOnly:!0}],Ue={faceswap:"col-span-2 row-span-2",socialpost:"col-span-2",ugc:"col-span-2",socialproof:"col-span-2",carousel:"col-span-2",contentmachine:"col-span-2",videoclone:"col-span-2 row-span-2",adsmixer:"col-span-2"};function Fe({onSelectApp:r,hasPlan:g,isAdmin:u}){const{t:a}=T(),j=B(),[b,o]=n.useState(null),[p,x]=n.useState(!1),[i,v]=n.useState(!1),[c,m]=n.useState(null),O=I.map(s=>({...s,label:a(`appsHub.apps.${s.id}.label`),description:a(`appsHub.apps.${s.id}.description`)})),t=b?(()=>{const s=b.map(f=>O.find(y=>
2y.id===f)).filter(Boolean),l=O.filter(f=>!b.includes(f.id));return[...s,...l]})():null;n.useEffect(()=>{L.from("admin_settings").select("value").eq("key","apps_order").maybeSingle().then(({data:s})=>{if(s!=null&&s.value)try{const l=JSON.parse(s.value);o(l);return}catch{}o(I.map(l=>l.id))})},[]);const E=n.useCallback((s,l)=>{const f=s+l;!t||f<0||f>=t.length||o(y=>{const _=[...y??I.map(P=>P.id)];return[_[s],_[f]]=[_[f],_[s]],_})},[t==null?void 0:t.length]),N=async()=>{if(!t)return;v(!0);const s=t.map(f=>f.id),{error:l}=await L.from("admin_settings").upsert({key:"apps_order",value:JSON.stringify(s)},{onConflict:"key"});v(!1),l?U.error(a("appsHub.errorSaveOrder")):(U.success(a("appsHub.savedOrder")),x(!1))},k=s=>{m(s)},D=(s,l)=>{s.preventDefault(),!(c===null||c===l)&&(o(f=>{const w=[...f??I.map(P=>P.id)],[_]=w.splice(c,1);return w.splice(l,0,_),w}),m(l))},d=()=>{m(null)};if(!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-6 h-6 border-2 border-primary/30 border-t-primary rounded-full animate-spin"})});const C=u?t:t.filter(s=>!s.adminOnly||u);return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 -z-0 h-[480px] overflow-hidden",children:[e.jsx("div",{className:"absolute -top-32 left-1/2 -translate-x-1/2 h-[420px] w-[760px] rounded-full bg-primary/10 blur-[140px]"}),e.jsx("div",{className:"absolute top-10 right-[12%] h-[260px] w-[260px] rounded-full bg-fuchsia-500/[0.07] blur-[120px]"})]}),e.jsxs("div",{className:"relative max-w-[1700px] mx-auto px-4 sm:px-6 lg:px-10 py-8 lg:py-12",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-5 mb-7 lg:mb-10",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-[11px] uppercase tracking-[0.3em] text-primary font-semibold mb-3",children:[e.jsx($,{className:"w-3.5 h-3.5"}),a("appsHub.title")]}),e.jsx("h2",{className:"font-display text-3xl lg:text-5xl font-bold tracking-[-0.03em] leading-[0.95] max-w-2xl",children:a("appsHub.subtitle")})]}),u&&e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[!p&&e.jsxs("button",{onClick:()=>x(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-medium text-primary hover:text-primary/80 bg-primary/10 hover:bg-primary/20 border border-primary/20 transition-all",children:[e.jsx(F,{className:"w-3.5 h-3.5"}),a("appsHub.reorder")]}),p&&e.jsxs("button",{onClick:N,disabled:i,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-medium text-emerald-400 hover:text-emerald-300 bg-emerald-500/10 hover:bg-emerald-500/20 border border-emerald-500/20 transition-all disabled:opacity-50",children:[e.jsx(Te,{className:"w-3.5 h-3.5"}),a(i?"appsHub.saving":"appsHub.saveOrder")]}),p&&e.jsx("button",{onClick:()=>{x(!1),L.from("admin_settings").select("value").eq("key","apps_order").maybeSingle().then(({data:s})=>{if(s!=null&&s.value)try{o(JSON.parse(s.value))}catch{o(I.map(l=>l.id))}else o(I.map(l=>l.id))})},className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-medium text-muted-foreground hover:text-foreground bg-secondary/60 hover:bg-secondary border border-border/40 transition-all",children:a("appsHub.cancel")})]})]}),e.jsxs("button",{onClick:()=>j("/playground/3d"),className:"mb-5 inline-flex min-h-11 items-center gap-2 rounded-lg border border-primary/25 bg-primary/5 px-4 text-sm font-medium text-primary hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(W,{className:"h-4 w-4"}),a("threeD.appsLink"),e.jsx(M,{className:"h-4 w-4"})]}),e.jsx("div",{className:"grid grid-flow-dense grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-3 lg:gap-4 auto-rows-[8.5rem] sm:auto-rows-[9.5rem] lg:auto-rows-[10.5rem] xl:auto-rows-[11.5rem]",children:C.map((s,l)=>{const f=s.icon,y=s.premiumOnly&&!g,w=s.adminOnly&&!u,_=Ue[s.id]??"",P=_.includes("row-span-2");return e.jsxs(G.div,{initial:{opacity:0,y:16}
2,animate:{opacity:1,y:0},transition:{delay:Math.min(l*.04,.5),duration:.4,ease:[.21,.5,.3,1]},draggable:p,onDragStart:()=>k(l),onDragOver:S=>D(S,l),onDragEnd:d,className:`relative ${_} ${p?"cursor-grab active:cursor-grabbing":""} ${c===l?"opacity-50":""}`,children:[e.jsxs("button",{onClick:()=>{!p&&!y&&!w&&r(s.id)},className:`group relative w-full h-full overflow-hidden rounded-2xl lg:rounded-[1.4rem] border border-white/10 bg-card text-left transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary 3 ${p?"ring-2 ring-primary/40 ring-dashed":""} 4 ${w?"cursor-not-allowed":"hover:border-primary/30 hover:-translate-y-0.5 hover:shadow-2xl hover:shadow-primary/10"}`,children:[e.jsx("img",{src:`/apps-covers/${s.id}.webp`,alt:"",loading:"lazy",draggable:!1,className:`absolute inset-0 w-full h-full object-cover transition-transform duration-1000 ease-out group-hover:scale-[1.07] ${y?"opacity-55 saturate-[0.8]":"opacity-90"}`}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black via-black/45 to-black/5"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-primary/20 via-transparent to-transparent opacity-60 group-hover:opacity-100 transition-opacity duration-500 mix-blend-screen"}),e.jsxs("div",{className:"absolute top-0 inset-x-0 p-2.5 lg:p-3 flex items-start justify-between gap-2",children:[p?e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5 rounded-lg bg-black/60 backdrop-blur-sm ring-1 ring-white/15 px-2 py-1",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-white/70"}),e.jsxs("span",{className:"text-[10px] text-white/90 font-mono",children:["#",l+1]})]}):e.jsx("span",{className:`shrink-0 rounded-xl bg-gradient-to-br ${s.gradient} ring-1 ring-white/20 shadow-lg flex items-center justify-center ${P?"w-11 h-11":"w-9 h-9"}`,children:e.jsx(f,{className:`text-white drop-shadow ${P?"w-5 h-5":"w-[18px] h-[18px]"}`})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[s.beta&&!p&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-black/50 backdrop-blur-sm ring-1 ring-white/15 text-[9px] font-bold uppercase tracking-[0.15em] text-white",children:"Beta"}),y&&e.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-black/50 backdrop-blur-sm ring-1 ring-white/15",children:[e.jsx(pe,{className:"w-3 h-3 text-amber-300"}),e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-white/90",children:a("appsHub.premiumBadge")})]})]})]}),e.jsxs("div",{className:"absolute bottom-0 inset-x-0 p-3 lg:p-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h3",{className:`font-display font-bold tracking-tight text-white ${P?"text-lg lg:text-2xl":"text-[15px] lg:text-base"}`,children:s.label}),!y&&!w&&!p&&e.jsx(M,{className:"w-4 h-4 text-primary opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300"})]}),e.jsx("p",{className:`text-white/65 leading-snug mt-1 ${P?"text-xs lg:text-sm line-clamp-3 max-w-[92%]":"text-[11px] lg:text-xs line-clamp-2"}`,children:s.description})]}),e.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl lg:rounded-[1.4rem] ring-1 ring-inset ring-transparent group-hover:ring-primary/30 transition-all duration-300"}),y&&!w&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-black/70 backdrop-blur-md ring-1 ring-white/15",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-white/80"}),e.jsx("span",{className:"text-xs font-medium text-white/90",children:a("appsHub.premiumExclusive")})]})}),w&&e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-black/70 ring-1 ring-white/15",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-white/80"}),e.jsx("span",{className:"text-xs font-medium text-white/90",children:a("appsHub.testing")})]})})]}),p&&e.jsxs("div",{className:"absolute -right-1 top-1/2 -translate-y-1/2 flex flex-col gap-0.5 z-10",children:[e.jsx("button",{onClick:S=>{S.stopPropagation(),E(l,-1)},disabled:l===0,className:"p-1 rounded-md bg-secondary/90 border border-border/60 hover:bg-secondary disabled:opacity-30 transition-all",children:e.jsx(Le,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:S=>{S.stopPropagation(),E(l,1)},disabled:l===C.length-1,className:"p-1 rounded-md bg-secondary/90 border border-border/60 hover:bg-secondary disabled:opacity-30 transition-all",children:e.jsx(ue,{className:"w-3.5 h-3.5"})})]})]},s.id)})})]})]})}const q=r=>`aic_face_consent_v1:${r||"anon"}`;function H({children:r}){const{t:g}=T(),{user:u}=J(),[a,j]=n.useState(!1),[b,o]=n.useState(!1);n.useEffect(()=>{if(u)try{localStorage.getItem(q(u.id))!=="1"&&j(!0)}catch{}},[u]);const p=()=>{try{u&&localStorage.setItem(q(u.id),"1")}catch{}j(!1)};return e.jsxs(e.Fragment,{children:[r,e.jsx(xe,{open:a,onOpenChange:()=>{},children:e.jsxs(he,{className:"max-w-md [&>button]:hidden",onInteractOutside:x=>x.preventDefault(),onEscapeKeyDown:x=>x.preventDefault(),children:[e.jsxs(ge,{children:[e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(be,{className:"w-4 h-4 text-primary"}),g("faceConsent.title")]}),e.jsx(ye,{children:g("faceConsent.body")})]}),e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:b,onChange:x=>o(x.target.checked),className:"mt-0.5 accent-primary"}
4),e.jsx("span",{className:"text-xs text-foreground/80 leading-snug",children:g("faceConsent.checkbox")})]}),e.jsx(je,{children:e.jsx(ve,{disabled:!b,onClick:p,children:g("faceConsent.accept")})})]})})]})}const qe=({records:r,loading:g})=>{var p,x,i,v,c,m,O,t,E,N,k,D;const{t:u}=T(),[a,j]=n.useState(null),b=$e(a==null?void 0:a.media_url);if(g&&r.length===0)return e.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm",children:u("common.loading")});if(r.length===0)return null;const o=d=>{Re(d.media_url,{type:d.media_type==="video"?"video":"image",id:d.id})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"w-full max-w-2xl space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(V,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"font-medium",children:u("gallery.history")}),e.jsxs("span",{className:"text-xs opacity-60",children:["(",r.length,")"]})]}),e.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 gap-2",children:r.map(d=>{var s,l,f,y;const C=((s=d.metadata)==null?void 0:s.error)===!0||((l=d.media_url)==null?void 0:l.startsWith("error://"))||((f=d.metadata)==null?void 0:f.status)==="error";return e.jsxs("button",{onClick:()=>j(d),className:`relative aspect-square rounded-xl overflow-hidden border bg-secondary/30 transition-colors group ${C?"border-destructive/60 hover:border-destructive":"border-border/40 hover:border-primary/40"}`,style:{contain:"content"},children:[C?e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-destructive/10 gap-1 p-2",children:[e.jsx(z,{className:"w-5 h-5 text-destructive"}),e.jsx("span",{className:"text-[9px] text-destructive font-medium text-center line-clamp-2",children:((y=d.metadata)==null?void 0:y.appName)||"Erro"})]}):d.media_type==="video"?e.jsxs(e.Fragment,{children:[d.thumbnail_url?e.jsx("img",{src:`${d.thumbnail_url}?width=300&quality=75&format=webp`,alt:"",className:"w-full h-full object-cover",loading:"lazy"}):e.jsx("video",{className:"w-full h-full object-cover",muted:!0,preload:"metadata",poster:d.thumbnail_url||void 0,children:e.jsx("source",{src:d.media_url})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/20",children:e.jsx(Ne,{className:"w-4 h-4 text-foreground drop-shadow-md"})})]}):e.jsx(Ve,{src:d.thumbnail_url||d.media_url,alt:d.prompt||"",className:"w-full h-full",thumbSize:200,channel:"history",useProxy:!1}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-background/80 to-transparent p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsxs("div",{className:"flex items-center gap-1",children:[C?e.jsx(z,{className:"w-2.5 h-2.5 text-destructive"}):d.media_type==="video"?e.jsx(we,{className:"w-2.5 h-2.5 text-muted-foreground"}):e.jsx(_e,{className:"w-2.5 h-2.5 text-muted-foreground"}),d.aspect_ratio&&e.jsx("span",{className:"text-[9px] text-muted-foreground",children:d.aspect_ratio})]})})]},d.id)})})]}),e.jsx(ke,{children:a&&e.jsx(G.div,{initial:{opacity:0}
4,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-background/90 backdrop-blur-md flex items-center justify-center p-6",onClick:()=>j(null),children:e.jsxs(G.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"relative max-w-3xl max-h-[85vh] w-auto",onClick:d=>d.stopPropagation(),children:[(p=a.metadata)!=null&&p.error||(x=a.media_url)!=null&&x.startsWith("error://")||((i=a.metadata)==null?void 0:i.status)==="error"?e.jsxs("div",{className:"bg-destructive/10 border border-destructive/30 rounded-2xl p-8 max-w-md",children:[e.jsx(z,{className:"w-10 h-10 text-destructive mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-bold text-destructive text-center mb-2",children:"Erro na Geração"}),((v=a.metadata)==null?void 0:v.appName)&&e.jsxs("p",{className:"text-sm text-muted-foreground text-center mb-2",children:["App: ",a.metadata.appName]}),e.jsx("p",{className:"text-sm text-destructive/80 text-center mb-4",children:((c=a.metadata)==null?void 0:c.errorMessage)||((m=a.metadata)==null?void 0:m.error)||"Erro desconhecido"}),a.prompt&&e.jsxs("p",{className:"text-xs text-muted-foreground text-center line-clamp-3",children:["Prompt: ",a.prompt]})]}):a.media_type==="video"?e.jsx("video",{src:b||void 0,controls:!0,autoPlay:!0,className:"max-h-[75vh] max-w-full rounded-2xl"}):e.jsx("img",{src:b||void 0,alt:a.prompt||"",className:"max-h-[75vh] max-w-full rounded-2xl"}),!((O=a.metadata)!=null&&O.error||(t=a.media_url)!=null&&t.startsWith("error://")||((E=a.metadata)==null?void 0:E.status)==="error")&&a.prompt&&e.jsx("p",{className:"mt-3 text-sm text-muted-foreground text-center max-w-md mx-auto line-clamp-2",children:a.prompt}),!((N=a.metadata)!=null&&N.error||(k=a.media_url)!=null&&k.startsWith("error://")||((D=a.metadata)==null?void 0:D.status)==="error")&&e.jsx("div",{className:"mt-3 flex items-center justify-center gap-3",children:e.jsxs("button",{onClick:()=>o(a),className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity",children:[e.jsx(Pe,{className:"w-3.5 h-3.5"}),u("common.download")]})}),e.jsx("button",{onClick:()=>j(null),className:"absolute -top-2 -right-2 w-8 h-8 rounded-full bg-secondary border border-border flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(He,{className:"w-4 h-4"})})]})})})]})};function Be({children:r,records:g,loading:u,hideHistory:a=!1}){const j=Me(),[b,o]=n.useState("create");return!j||a?e.jsx(e.Fragment,{children:r}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"shrink-0 px-3 pt-2 pb-2 border-b border-border/30 bg-background/80 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{className:"flex gap-1 p-1 rounded-xl bg-secondary/40 border border-border/40",children:[e.jsxs("button",{type:"button",onClick:()=>o("create"),className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition-all ${b==="create"?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx($,{className:"w-3.5 h-3.5"}),"Criar"]}),e.jsxs("button",{type:"button",onClick:()=>o("history"),className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition-all ${b==="history"?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(V,{className:"w-3.5 h-3.5"}),"Histórico",g.length>0&&e.jsx("span",{className:"ml-0.5 px-1.5 py-0.5 rounded-full bg-primary/20 text-primary text-[10px] leading-none",children:g.length})]})]})}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:b==="create"?e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col",children:r}):e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-3 py-4",children:g.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center text-center text-muted-foreground py-16 gap-2",children:[e.jsx(V,{className:"w-8 h-8 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Nenhuma geração ainda"}),e.jsx("p",{className:"text-xs opacity-70",children:"Suas criações aparecerão aqui assim que forem geradas."})]}):e.jsx("div",{className:"flex justify-center",children:e.jsx(qe,{records:g,loading:u})})})})]})}const We=n.lazy(()=>h(()=>import("./PromptDetailing-IZWcMa0M.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))),A=n.lazy(()=>h(()=>import("./ImageStudioPanel-sL33kkR_.js"),__vite__mapDeps([27,1,2,28,29,30,31,32,33,34,25,35,36,19,23,37,4,5,6,38,39,40,41,42,43,44,45,46,47,48,49,50,51,7,52,53,54,55,24,56,57,58,59,60,61,62,63,64,65,17,66,67,68,69,13,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]))),Je=n.lazy(()=>h(()=>import("./FaceSwapPanel-C7wz9JIW.js"),__vite__mapDeps([88,1,2,89,90,91,92,93,29,28,94,8,6,9,3,59,5,60,95,96,97,98,14,15,99,20,7,100,18,50,39,30,101,57,102,103,104,105,23,106,25,41,107,108,33,47,109,36,51,19,35,110]))),Ke=n.lazy(()=>h(()=>import("./PhotoShootPanel-Dk743G8V.js"),__vite__mapDeps([111,1,2,93,3,9,7,95,104,15,105,112,30,96,59,5,6,60,97,8,28,43,23,34,46,51,19,25,36]))),Ye=n.lazy(()=>h(()=>import("./SocialPostPanel-Ld47OI33.js"),__vite__mapDeps([113,1,2,114,91,92,8,6,7,9,3,59,5,60,11,104,15,105,112,101,28,30,45,115,116,106,23,51,36,22]))),Qe=n.lazy(()=>h(()=>import("./UgcCreatorPanel-DFiVjQ2_.js"),__vite__mapDeps([117,1,2,93,9,3,59,5,6,60,8,11,104,15,105,112,28,30,107,23,115,116,118,25,45]))),Xe=n.lazy(()=>h(()=>import("./DatasetCreatorPanel-BLCFOygJ.js"),__vite__mapDeps([119,1,2,93,8,6,3,59,5,60,104,15,105,112,30,96,97,28,102,43,23,25,63]))),Ze=n.lazy(()=>h(()=>import("./AvatarEnginePanel-Dji3SrEw.js"),__vite__mapDeps([120,1,2,7,3,9,59,5,6,60,34,121,19,23,25,26,51]))),ea=n.lazy(()=>h(()=>import("./CharacterSheetPanel-HOTRTk_9.js"),__vite__mapDeps([122,1,2,7,3,9,8,6,29,28,30,96,59,5,60,97,34,19,123,102,50,18,23,24,26,25,51]))),aa=n.lazy(()=>h(()=>import("./CharacterTrainerPanel-C4mr4Rq_.js"),__vite__mapDeps([124,1,2,7,9,59,5,6,60,8,125,31,28,126,23,25,127,19,121,24]))),ta=n.lazy(()=>h(()=>import("./StoryboardPanel-CuKbKPg3.js"),__vite__mapDeps([128,1,2,9,29,28,30,96,59,5,6,60,97,123,102,23,25,24]))),sa=n.lazy(()=>h(()=>import("./ProvadorPanel-D0ifiG5K.js"),__vite__mapDeps([129,1,2,9,8,6,29,28,112,30,104,15,96,59,5,60,97,105,130,16,25,24,19,23,36,35]))),ra=n.lazy(()=>h(()=>import("./CloakifyPanel-CRPElOw-.js"),__vite__mapDeps([131,1,2,31,4,5,6,8,125,132,133,134,52,47,24,34,35,19,135,26,23,97,37]))),oa=n.lazy(()=>h(()=>import("./SocialProofPanel-CcZOvWTT.js"),__vite__mapDeps([136,1,2,137,30,130,16,11,138,139,107,140,141,100,34,142,18,24,143,51,26,144,72,145,146,19,116]))),ia=n.lazy(()=>h(()=>import("./CarouselPanel-CkZpyNgX.js"),__vite__mapDeps([147,1,2,3,9,7,95,8,6,28,30,32,31,36,65,55,64,23,148,34,25]))),na=n.lazy(()=>h(()=>import("./ContentMachinePanel-EdSt9i_4.js"),__vite__mapDeps([149,1,2,22,106,26]))),la=n.lazy(()=>h(()=>import("./AdsMixerPanel-DJ1or4L5.js"),__vite__mapDeps([150,1,2,31,7,8,6,125,39,151,133,134,32,23,19,44,152,153,109,97,35,34]))),ca=n.lazy(()=>h(()=>import("./DepthMapPanel-GjLAemqw.js"),__vite__mapDeps([154,1,2,30,39,133,155,29,8,6,36,26,79,23,50]))),da=["detail","editor","faceswap","upscale","photoshoot","socialpost","ugc","dataset","traincharacter","avatar","bgremover","skinenhance","charactersheet","storyboard","cloakify","tryon","
4socialproof","videoclone","carousel","contentmachine","adsmixer","depthmap"],ma=()=>{const{t:r}=T(),g=B(),u=Oe(),{appId:a}=Ee(),{isAdmin:j,hasActivePlan:b}=J(),o=b,[p,x]=n.useState(null),i=Ge("image"),v=a&&da.includes(a)?a:null;n.useEffect(()=>{const t=u.state;t!=null&&t.appId&&(t.imageUrl&&x(t.imageUrl),g(`/apps/${t.appId}`,{replace:!0}))},[u.state]);const c={detail:r("appsHub.apps.detail.label"),editor:r("appsHub.apps.editor.label"),faceswap:r("appsHub.apps.faceswap.label"),upscale:r("appsHub.apps.upscale.label"),photoshoot:r("appsHub.apps.photoshoot.label"),socialpost:r("appsHub.apps.socialpost.label"),ugc:r("appsHub.apps.ugc.label"),dataset:r("appsHub.apps.dataset.label"),traincharacter:r("appsHub.apps.traincharacter.label"),avatar:r("appsHub.apps.avatar.label"),bgremover:r("appsHub.apps.bgremover.label"),skinenhance:r("appsHub.apps.skinenhance.label"),charactersheet:r("appsHub.apps.charactersheet.label"),storyboard:r("appsHub.apps.storyboard.label"),cloakify:r("appsHub.apps.cloakify.label"),tryon:r("appsHub.apps.tryon.label"),socialproof:r("appsHub.apps.socialproof.label"),videoclone:r("appsHub.apps.videoclone.label"),carousel:r("appsHub.apps.carousel.label"),contentmachine:r("appsHub.apps.contentmachine.label"),adsmixer:r("appsHub.apps.adsmixer.label"),depthmap:r("appsHub.apps.depthmap.label"),labs:r("appsHub.apps.labs.label")},m=({name:t})=>e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 py-20 px-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center",children:e.jsx(R,{className:"w-8 h-8 text-primary/60"})}),e.jsx("h2",{className:"font-display text-xl font-bold",children:r("premiumGate.title")}),e.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-sm",children:r("premiumGate.exclusiveTo",{name:t})})]}),O=()=>{if(!v)return e.jsx(Fe,{onSelectApp:N=>g(N==="labs"?"/labs":N==="videoclone"?"/apps/motionclone":`/apps/${N}`),hasPlan:!!o,isAdmin:!!j});const t=(N,k)=>e.jsx(Be,{records:i.records,loading:i.loading,hideHistory:k==null?void 0:k.hideHistory,children:N});return{detail:o?t(e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(We,{})}),{hideHistory:!0}):e.jsx(m,{name:c.detail}),editor:t(e.jsx(A,{onGenerated:()=>i.refetch(),initialImageUrl:p,onInitialImageConsumed:()=>x(null),historyRecords:i.records,historyLoading:i.loading}),{hideHistory:!0}),faceswap:o?t(e.jsx(H,{children:e.jsx(Je,{onGenerated:()=>i.refetch()})})):e.jsx(m,{name:c.faceswap}),upscale:t(e.jsx(A,{initialTool:"upscale",onGenerated:()=>i.refetch(),initialImageUrl:p,onInitialImageConsumed:()=>x(null),historyRecords:i.records,historyLoading:i.loading}),{hideHistory:!0}),photoshoot:o?t(e.jsx(H,{children:e.jsx(Ke,{onGenerated:()=>i.refetch()})})):e.jsx(m,{name:c.photoshoot}),socialpost:o?t(e.jsx(Ye,{onGenerated:()=>i.refetch()})):e.jsx(m,{name:c.socialpost}),ugc:o?t(e.jsx(H,{children:e.jsx(Qe,{onGenerated:()=>i.refetch()})})):e.jsx(m,{name:c.ugc}),dataset:o?t(e.jsx(Xe,{onGenerated:()=>i.refetch()})):e.jsx(m,{name:c.dataset}),traincharacter:t(e.jsx(H,{children:e.jsx(aa,{})}),{hideHistory:!0}),avatar:o?t(e.jsx(H,{children:e.jsx(Ze,{onGenerated:()=>i.refetch()})}),{hideHistory:!0}):e.jsx(m,{name:c.avatar}),bgremover:t(e.jsx(A,{initialTool:"background",onGenerated:()=>i.refetch(),initialImageUrl:p,onInitialImageConsumed:()=>x(null),historyRecords:i.records,historyLoading:i.loading}),{hideHistory:!0}),skinenhance:t(e.jsx(A,{initialTool:"skin",onGenerated:()=>i.refetch(),initialImageUrl:p,onInitialImageConsumed:()=>x(null),historyRecords:i.records,historyLoading:i.loading}),{hideHistory:!0}),charactersheet:o?t(e.jsx(H,{children:e.jsx(ea,{onGenerated:()=>i.refetch()})}),{hideHistory:!0}):e.jsx(m,{name:c.charactersheet}),storyboard:o?t(e.jsx(ta,{onGenerated:()=>i.refetch()}),{hideHistory:!0}):e.jsx(m,{name:c.storyboard}),cloakify:o?t(e.jsx(ra,{onGenerated:()=>i.refetch()}),{hideHistory:!0}):e.jsx(m,{name:c.cloakify}),tryon:o?t(e.jsx(H,{children:e.jsx(sa,{onGenerated:()=>i.refetch()})}),{hideHistory:!0}):e.jsx(m,{name:c.tryon}),socialproof:o?t(e.jsx(H,{children:e.jsx(oa,{onGenerated:()=>i.refetch()})}),{hideHistory:!0}):e.jsx(m,{name:c.socialproof}),videoclone:null,labs:null,carousel:o?t(e.jsx(ia,{onGenerated:()=>i.refetch()}),{hideHistory:!0}):e.jsx(m,{name:c.carousel}),contentmachine:o?t(e.jsx(na,{}),{hideHistory:!0}):e.jsx(m,{name:c.contentmachine}),adsmixer:o?t(e.jsx(la,{}),{hideHistory:!0}):e.jsx(m,{name:c.adsmixer}),depthmap:o?t(e.jsx(ca,{}),{hideHistory:!0}):e.jsx(m,{name:c.depthmap})}[v]||null};return e.jsxs("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[e.jsx(Se,{active:"apps"}),v!==null&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30 bg-secondary/20 shrink-0",children:[e.jsxs("button",{onClick:()=>g("/apps"),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-secondary/60 transition-all",children:[e.jsx(Ce,{className:"w-3.5 h-3.5"}),r("common.back")]}
4),e.jsx("span",{className:"text-xs text-muted-foreground/60",children:"|"}),e.jsx("span",{className:"text-xs font-medium text-foreground",children:c[v]})]}),e.jsx(ze,{}),e.jsx("main",{className:"relative z-10 flex-1 flex flex-col min-h-0",children:e.jsx(n.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Ie,{className:"w-8 h-8 animate-spin text-primary"})}),children:O()})})]})},Oa=Object.freeze(Object.defineProperty({__proto__:null,default:ma},Symbol.toStringTag,{value:"Module"}));export{Oa as A,H as F,qe as G};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.