1import"./CmNX_9oS.js";import{p as ue,E as N,D as i,s as u,w as k,v as I,a,c as B,B as o,x as e,r as L,b as pe,y as D,f as x,z as Ke,t as ae,d as ee,K as We,J as he,b4 as Ye,A as ce,b5 as qe,aL as He,aa as Qe,L as oe}from"./DxG1euIs.js";import{i as xe,s as Ve,b as Xe}from"./CRqQB-5h.js";import{e as Pe}from"./BgzDntYK.js";import{I as le,c as Ze}from"./e9BladZu.js";import{B as ne}from"./zQ6-MJF7.js";import{c as s}from"./jHlYldo3.js";import{c as ze}from"./3Prn0-1V.js";import{L as et,B as tt}from"./ozrRWFYp.js";import{C as at,a as rt,b as st,c as ot,d as lt}from"./4GvsSwI9.js";import{R as nt,P as it,a as dt,C as ct,b as ut,c as pt,d as vt,e as Ie,f as Le,g as ft,h as mt}from"./CFE0eqcX.js";import{C as _t,p as Se,s as Ee,f as $t}from"./D5FBqXL-.js";import{s as Me}from"./DoTHlooe.js";import{e as gt}from"./SkduptFp.js";import{p as ht}from"./B5RaF88z.js";import{g as Be}from"./Cc2krIKZ.js";import{c as Pt,g as xt}from"./DyqmBhkR.js";import{i as yt}from"./cmICzjF3.js";import{u as wt}from"./CRDm6OXU.js";import{A as Ct,a as bt,b as kt,c as jt,d as At,e as Ut,R as Tt}from"./BX8oPh4N.js";import{t as Dt}from"./Cno0xG6h.js";var Rt=x("<!> <!>",1),zt=x('<!> <div class="flex items-center space-x-2 py-4"><!> <!></div> <!>',1),It=x("<!> <!>",1);function Lt(q,d){ue(d,!0);let v=D(!0),p=D(!1);var c=N(),h=i(c);s(h,()=>Tt,(H,J)=>{J(H,{get onOpenChange(){return d.onClose},get open(){return e(v)},set open(y){o(v,y,!0)},children:(y,O)=>{var w=It(),R=i(w);s(R,()=>Ct,(K,C)=>{C(K,{})});var S=u(R,2);s(S,()=>bt,(K,C)=>{C(K,{children:(F,W)=>{var G=zt(),t=i(G);s(t,()=>kt,(r,E)=>{E(r,{children:(_,j)=>{var A=Rt(),U=i(A);s(U,()=>jt,(b,Q)=>{Q(b,{children:(M,f)=>{k();var m=I("Almost Ready to Go!");a(M,m)},$$slots:{default:!0}})});var $=u(U,2);s($,()=>At,(b,Q)=>{Q(b,{class:"text-left",children:(M,f)=>{k();var m=I(`You'll just need to add your footage, adapt the prompt according to your needs, and replace 2 any placeholders marked in the prompt with more information about you and your business.`);a(M,m)},$$slots:{default:!0}})}),a(_,A)},$$slots:{default:!0}})});var l=u(t,2),P=B(l);_t(P,{id:"dont-show-again",get checked(){return e(p)},set checked(r){o(p,r,!0)}});var n=u(P,2);et(n,{for:"dont-show-again",class:"text-muted-foreground text-sm leading-none font-medium",children:(r,E)=>{k();var _=I("Don't show this again");a(r,_)},$$slots:{default:!0}}),L(l);var g=u(l,2);s(g,()=>Ut,(r,E)=>{E(r,{children:(_,j)=>{ne(_,{onclick:()=>{d.onConfirm(e(p))},children:(A,U)=>{k();var $=I("Got it!");a(A,$)},$$slots:{default:!0}})},$$slots:{default:!0}})}),a(F,G)},$$slots:{default:!0}})}),a(y,w)},$$slots:{default:!0}})}),a(q,c),pe()}var St=x("<!> Use Template",1),Et=x('<span class="truncate"> </span> <span class="ml-auto flex size-4 shrink-0 items-center justify-center text-xs"> </span>',1),Mt=x("<!> Create New Project",1),Bt=x("<!> <!> <!> <!>",1),Ot=x("<!> <!>",1),Ft=x("<!> <!>",1),Gt=x("<!> <!>",1);function Nt(q,d){ue(d,!0);const v=()=>he(yt,"$isUnauthenticated",h),p=()=>he(wt,"$user",h),c=()=>he(w,"$skipUseDialog",h),[h,H]=We(),J=Se(Ee.generator,null);let y=D(!1),O=D(null);const w=Se(Ee.skipUseDialog,!1);let R=D(!1),S=D(Ke([]));async function K(){var n;if(v())return Be(Me.routes.app.templates);if(((n=p())==null?void 0:n.counters.projects)===0)return await C();e(S).length===0&&o(S,await xt(),!0),o(R,!0)}async function C(){const n=await Pt().catch(g=>{const r=gt(g);ht.captureException(r),Dt.error(`Failed to create project: ${r.message}`)});n&&n.success&&F(n.projectId)}function F(n){o(O,n,!0),c()?W():o(y,!0)}function W(){J.set({prompt:d.template.prompt,audioId:d.template.audioId}),Be(Me.routes.app.project(e(O))),o(O,null)}var G=Gt(),t=i(G);s(t,()=>nt,(n,g)=>{g(n,{get open(){return e(R)},set open(r){o(R,r,!0)},children:(r,E)=>{var _=Ft(),j=i(_);{const U=($,b)=>{ne($,Ve(()=>b==null?void 0:b().props,{variant:"outline",class:"w-full",onclick:K,children:(M,f)=>{var m=St(),T=i(m);s(T,()=>le.sparkles,(z,Y)=>{Y(z,{})}),k(),a(M,m)},$$slots:{default:!0}}))};s(j,()=>it,($,b)=>{b($,{get id(){return d.template.id},child:U,$$slots:{child:!0}})})}var A=u(j,2);s(A,()=>dt,(U,$)=>{$(U,{class:"w-[200px] p-0",children:(b,Q)=>{var M=N(),f=i(M);s(f,()=>ct,(m,T)=>{T(m,{children:(z,Y)=>{var ye=Ot(),we=i(ye);s(we,()=>ut,(ve,fe)=>{fe(ve,{placeholder:"Search project..."})});var Oe=u(we,2);s(Oe,()=>pt,(ve,fe)=>{fe(ve,{children:(Fe,Qt)=>{var Ce=Bt(),be=i(Ce);s(be,()=>vt,(V,X)=>{X(V,{children:(re,Ae)=>{k();var Z=I("No project found.");a(re,Z)},$$slots:{default:!0}})});var ke=u(be,2);s(ke,()=>Ie,(V,X)=>{X(V,{heading:"Projects",children:(re,Ae)=>{var Z=N(),me=i(Z);Pe(me,17,()=>e(S),se=>se.id,(se,te)=>{var ie=N(),Ue=i(ie);s(Ue,()=>Le,(de,_e)=>{_e(de,{get value(){return e(te).name},onSelect:()=>F(e(te).id),children:($e,Te)=>{var De=Et(),ge=i(De),Ne=B(ge,!0);L(ge);var Re=u(ge,2),Je=B(Re,!0);L(Re),ae(()=>{ee(Ne,e(te).name),ee(Je,e(te).counters.videos)}),a($e,De)},$$slots:{default:!0}})}),a(se,ie)}),a(re,Z)},$$slots:{default:!0}})});var je=u(ke,2);s(je,()=>ft,(V,X)=>{X(V,{})});var Ge=u(je,2);s(Ge,()=>Ie,(V,X)=>{X(V,{children:(re,Ae)=>{var Z=N(),me=i(Z);s(me,()=>Le,(se,te)=>{te(se,{onSelect:C,class:"justify-center text-center text-xs",children:(ie,Ue)=>{var de=Mt(),_e=i(de);s(_e,()=>le.plus,($e,Te)=>{Te($e,{})}),k(),a(ie,de)},$$slots:{default:!0}})}),a(re,Z)},$$slots:{default:!0}})}),a(Fe,Ce)},$$slots:{default:!0}})}),a(z,ye)},$$slots:{default:!0}})}),a(b,M)},$$slots:{default:!0}})}),a(r,_)},$$slots:{default:!0}})});var l=u(t,2);{var P=n=>{Lt(n,{onClose:()=>o(y,!1),onConfirm:g=>{g&&w.set(!0),o(y,!1),W()}})};xe(l,n=>{e(y)&&n(P)})}a(q,G),pe(),H()}var Jt=x('<div class="group card-container"><video preload="auto" loop="" playsinline="" class="card-media"><track kind="captions" src="" label="English"/></video> <!> <button class="card-action"><span class="sr-only"> </span> <span class="card-play"><!></span></button></div>',2),Kt=x("<!> <!>",1),Wt=x("<!> <!> <!>",1);function Yt(q,d){ue(d,!0);let v=D(void 0),p=D(!1),c=D(!0);
2function h(w){w.stopPropagation(),e(v)&&(e(v).paused?(e(v).play(),o(p,!0)):(e(v).pause(),o(p,!1)))}function H(){o(p,!1)}function J(){o(p,!0)}var y=N(),O=i(y);s(O,()=>lt,(w,R)=>{R(w,{class:"gap-4 py-4",children:(S,K)=>{var C=Wt(),F=i(C);s(F,()=>at,(t,l)=>{l(t,{class:"px-4",children:(P,n)=>{var g=Jt(),r=B(g);Xe(r,f=>o(v,f),()=>e(v));var E=u(r,2);tt(E,{variant:"secondary",class:"card-badge-left",children:(f,m)=>{k();var T=I();ae(z=>ee(T,z),[()=>$t(d.template.contentType)]),a(f,T)},$$slots:{default:!0}});var _=u(E,2),j=B(_),A=B(j);L(j);var U=u(j,2),$=B(U);{var b=f=>{var m=N(),T=i(m);s(T,()=>le.loader,(z,Y)=>{Y(z,{class:"animate-spin"})}),a(f,m)},Q=f=>{var m=N(),T=i(m);s(T,()=>le.pause,(z,Y)=>{Y(z,{class:"fill-white text-white"})}),a(f,m)},M=f=>{var m=N(),T=i(m);s(T,()=>le.play,(z,Y)=>{Y(z,{class:"fill-white text-white"})}),a(f,m)};xe($,f=>{e(c)?f(b):e(p)?f(Q,1):f(M,-1)})}L(U),L(_),L(g),ae(()=>{ze(r,"src",d.template.links.video),ze(r,"poster",d.template.links.poster),_.disabled=e(c),ee(A,`${e(p)?"Pause":"Play"} video`)}),ce("canplay",r,()=>o(c,!1)),ce("loadedmetadata",r,()=>o(c,!1)),ce("pause",r,H),ce("play",r,J),qe("click",_,h),a(P,g)},$$slots:{default:!0}})});var W=u(F,2);s(W,()=>rt,(t,l)=>{l(t,{class:"px-4",children:(P,n)=>{var g=Kt(),r=i(g);s(r,()=>st,(_,j)=>{j(_,{class:"truncate",children:(A,U)=>{k();var $=I();ae(()=>ee($,d.template.title)),a(A,$)},$$slots:{default:!0}})});var E=u(r,2);s(E,()=>ot,(_,j)=>{j(_,{class:"line-clamp-3 text-xs",children:(A,U)=>{k();var $=I();ae(()=>ee($,`Prompt: ${d.template.prompt??""}`)),a(A,$)},$$slots:{default:!0}})}),a(P,g)},$$slots:{default:!0}})});var G=u(W,2);s(G,()=>mt,(t,l)=>{l(t,{class:"px-4",children:(P,n)=>{Nt(P,{get template(){return d.template}})},$$slots:{default:!0}})}),a(S,C)},$$slots:{default:!0}})}),a(q,y),pe()}Ye(["click"]);var qt=x('<div class="mt-6 text-center"><!></div>'),Ht=x('<div class="mb-6 flex flex-col items-start gap-4"><div class="flex flex-wrap items-center justify-start gap-2"><!> <!></div></div> <div class="app-grid"></div> <!>',1);function ga(q,d){ue(d,!0);let v=D("all"),p=oe(()=>()=>e(v)==="all"?d.templates:d.templates.filter(t=>t.contentType===e(v))),c=D(2),h=D(0),H=oe(()=>()=>Ze.filter(t=>d.templates.some(l=>l.contentType===t.value)));function J(){const t=typeof window<"u"?window.innerWidth:1024;t>=1280?o(c,6):t>=1024?o(c,5):t>=768?o(c,4):t>=640?o(c,3):o(c,2)}He(()=>{J();const t=()=>{const l=e(c);J(),l!==e(c)&&o(h,Math.min(e(c)*2,e(p)().length),!0)};return window.addEventListener("resize",t),o(h,Math.min(e(c)*2,e(p)().length),!0),()=>window.removeEventListener("resize",t)}),Qe(()=>{const t=e(p)();o(h,Math.min(e(c)*2,t.length),!0)});function y(){o(h,Math.min(e(h)+e(c)*2,e(p)().length),!0)}var O=Ht(),w=i(O),R=B(w),S=B(R);{let t=oe(()=>e(v)==="all"?"default":"outline");ne(S,{get variant(){return e(t)},onclick:()=>o(v,"all"),size:"sm",children:(l,P)=>{k();var n=I("See all");a(l,n)},$$slots:{default:!0}})}var K=u(S,2);Pe(K,17,()=>e(H)(),t=>t.value,(t,l)=>{{let P=oe(()=>e(v)===e(l).value?"default":"outline");ne(t,{get variant(){return e(P)},onclick:()=>o(v,e(l).value,!0),size:"sm",children:(n,g)=>{k();var r=I();ae(()=>ee(r,e(l).label)),a(n,r)},$$slots:{default:!0}})}}),L(R),L(w);var C=u(w,2);Pe(C,21,()=>e(p)().slice(0,e(h)),t=>t.id,(t,l)=>{Yt(t,{get template(){return e(l)}})}),L(C);var F=u(C,2);{var W=t=>{var l=qt(),P=B(l);ne(P,{onclick:y,variant:"outline",children:(n,g)=>{k();var r=I("Show more");a(n,r)},$$slots:{default:!0}}),L(l),a(t,l)},G=oe(()=>e(h)<e(p)().length);xe(F,t=>{e(G)&&t(W)})}a(q,O),pe()}export{ga as T};
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.