PageSourceSearch

https://app.purrplan.ai/vendor/mixpost/assets/Index-kyswt9rd.js

js purrplan.ai collected 2026-10-05 12:28:22 UTC 41,277 bytes, 1 lines download raw bytes

1import{t as We,i as Je,r as v,aI as oe,C as xt,x as F,z as Qe,c as g,a as d,b as t,D as n,_ as y,I as o,h as s,G as x,H as f,a2 as N,F as z,e as U,f as Z,n as E,K as le,d as D,V as be,af as et,a3 as pt,de as _t,q as L,aE as S,a0 as tt,Z as ft,Y as yt,E as vt,w as he,L as bt,A as ke,k as Ke,ae as kt,cU as Le,aY as wt}from"./app-DTnXQure.js";import{_ as Ct}from"./PageHeader-B295HocA.js";import{_ as we}from"./Panel-CSjB26W-.js";import{_ as O}from"./Label-CeHQOfF_.js";import{_ as $t}from"./Textarea-RBQQ3Kpd.js";import{_ as Te}from"./Select-D2rlo2Cm.js";import{_ as st}from"./Input-DbBSehN-.js";import{_ as Ae}from"./Switch-Z916Ja3o.js";import{_ as Xe}from"./ProviderIcon-KzgGOKas.js";import{S as Ye}from"./Sparkles-Bc-X42CF.js";import"./Flex-dury8FRp.js";import"./Linkedin-w2rbN3XG.js";const St={class:"space-y-lg"},zt={class:"flex items-center justify-between mb-md"},It={class:"flex items-center gap-2"},Vt={class:"text-base font-semibold text-gray-900 dark:text-white"},jt={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400"},Ut={key:1,class:"rounded-2xl border border-dashed border-orange-100 dark:border-gray-700 bg-orange-50/40 dark:bg-orange-900/10 p-6 text-center text-sm text-gray-500 dark:text-gray-400"},Dt={key:2,class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},Lt={class:"aspect-square bg-gray-100 dark:bg-gray-700 flex items-center justify-center overflow-hidden"},Tt=["src","alt"],At={class:"flex items-center justify-between gap-2 px-3 py-2"},Pt=["title"],Ot=["aria-label","onClick"],Nt={class:"flex items-center justify-between mb-md"},Et={class:"flex items-center gap-2"},Rt={class:"text-base font-semibold text-gray-900 dark:text-white"},Bt={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400"},Ft={key:1,class:"rounded-2xl border border-dashed border-orange-100 dark:border-gray-700 bg-orange-50/40 dark:bg-orange-900/10 p-6 text-center text-sm text-gray-500 dark:text-gray-400"},Mt={key:2,class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},qt={class:"aspect-square bg-gray-100 dark:bg-gray-700 flex items-center justify-center overflow-hidden"},Ht=["src","alt"],Gt={class:"flex items-center justify-between gap-2 px-3 py-2"},Zt=["title"],Kt=["aria-label","onClick"],Xt={class:"flex items-center justify-between gap-2 px-3 pb-2 -mt-1"},Yt=["disabled","title","onClick"],Wt={class:"font-semibold text-gray-900 dark:text-white"},Jt={class:"text-sm text-gray-500 dark:text-gray-400 mb-md"},Qt={class:"mb-md"},es=["src","alt"],ts={class:"grid grid-cols-3 gap-2 w-full"},ss=["src"],as=["onClick"],rs={class:"text-[10px]"},ls={class:"mt-2 text-[11px] text-gray-400"},os={class:"text-sm text-center text-gray-700 dark:text-gray-200"},is={key:0,class:"mt-1 text-[11px] text-center text-gray-400"},ns=["multiple"],ds={key:0,class:"mt-md flex items-center gap-2 rounded-xl bg-orange-50 dark:bg-orange-900/20 px-4 py-3 text-sm text-orange-700 dark:text-orange-300"},cs={class:"font-semibold text-gray-900 dark:text-white"},us={class:"text-sm text-gray-600 dark:text-gray-300"},gs=6,ms={__name:"StyleManager",emits:["changed"],setup(ee,{expose:r,emit:T}){const{t:h}=We(),{notify:I}=tt(),w=Je("workspaceCtx"),A=T,K=v([]),R=v([]),q=oe({styles:!1,characters:!1}),ie=async()=>{q.styles=!0;try{const{data:a}=await L.get(S("mixpost.slideshow.styles.index",{workspace:w.id}));K.value=(a==null?void 0:a.styles)??[]}catch{I("error",h("slideshow.style.error_load"))}finally{q.styles=!1}},te=async()=>{q.characters=!0;try{const{data:a}=await L.get(S("mixpost.slideshow.characters.index",{workspace:w.id}));R.value=(a==null?void 0:a.characters)??[]}catch{I("error",h("slideshow.character.error_load"))}finally{q.characters=!1}},P=v(null),X=a=>{var m;return(((m=a==null?void 0:a.reference_media_ids)==null?void 0:m.length)||0)>=5},M=a=>(a==null?void 0:a.soul_status)==="ready"?"Soul ID prêt":(a==null?void 0:a.soul_status)==="training"?"Entraînement…":(a==null?void 0:a.soul_status)==="failed"?"Soul ID échoué":X(a)?"Soul ID non entraîné":"≥ 5 photos pour Soul ID",Ce=a=>(a==null?void 0:a.soul_status)==="ready"?"CheckCircle2":(a==null?void 0:a.soul_status)==="training"?"Loader":(a==null?void 0:a.soul_status)==="failed"?"AlertCircle":"Sparkles",$e=a=>(a==null?void 0:a.soul_status)==="ready"?"text-green-600 dark:text-green-400":(a==null?void 0:a.soul_status)==="training"?"text-orange-500 dark:text-orange-400":(a==null?void 0:a.soul_status)==="failed"?"text-red-500 dark:text-red-400":"text-gray-400 dark:text-gray-500",se=async a=>{var m,i;if(!(!X(a)||a.soul_status==="training"))try{await L.post(S("mixpost.slideshow.characters.train-soul",{workspace:w.id,character:a.id})),a.soul_status="training",I("success","Entraînement Soul ID lancé — ça prend quelques minutes."),ae()}catch(p){const j=((i=(m=p==null?void 0:p.response)==null?void 0:m.data)==null?void 0:i.message)||"Échec du lancement de l'entraînement Soul ID.";I("error",j)}},ae=()=>{P.value||(P.value=setInterval(async()=>{await te(),R.value.some(m=>m.soul_status==="training")||(clearInterval(P.value),P.value=null)},2e4))};xt(()=>{P.value&&clearInterval(P.value)});const u=oe({show:!1,kind:"style",name:"",file:null,files:[],previewUrl:"",step:"idle",dragOver:!1}),B=v(null),xe=a=>{u.kind=a,u.name="",u.file=null,u.files=[],u.previewUrl="",u.step="idle",u.dragOver=!1,u.show=!0},Se=()=>{u.step==="idle"&&(u.show=!1)},Y=a=>!!a&&typeof a.type=="string"&&a.type.startsWith("image/"),ne=a=>{const m=Array.from(a||[]).filter(Y);if(m.length===0){I("error",h("slideshow.style.error_not_image"));return}u.kind==="character"?u.files=[...u.files,...m].slice(0,gs):u.files=[m[0]],u.file=u.files[0];const i=new FileReader;i.onload=p=>{var j;u.previewUrl=((j=p.target)==null?void 0:j.result)??""},i.readAsDataURL(u.files[0])},V=a=>{u.files.splice(a,1),u.file=u.files[0]??null,u.file||(u.previewUrl="")},de=F(()=>u.files.map(a=>URL.createObjectURL(a))),W=a=>{var m;(m=a.target.files)!=null&&m.length&&ne(a.target.files),B.value&&(B.value.value="")},ze=a=>{var m,i;u.dragOver=!1,u.step==="idle"&&(i=(m=a.dataTransfer)==null?void 0:m.files)!=null&&i.length&&ne(a.dataTransfer.files)},re=()=>u.name.trim().length>0&&u.files.length>0&&u.step==="idle",ce=async()=>{const a=[];for(const m of u.files){const i=new FormData;i.append("file",m),i.append("type","uploads");const{data:p}=await L.post(S("mixpost.media.upload",{workspace:w.id}),i),j=(p==null?void 0:p.data)??p;j!=null&&j.id&&a.push(j.id)}return a},ue=async()=>{var a,m;if(re())try{u.step="uploading";const i=await ce();if(!i.length){I("error",h("slideshow.style.error_upload")),u.step="idle";return}u.step="analyzing";const p=u.kind==="style",j=p?"mixpost.slideshow.styles.store":"mixpost.slideshow.characters.store";await L.post(S(j,{workspace:w.id}),{name:u.name.trim(),reference_media_id:i[0],...p?{}:{reference_media_ids:i}}),I("success",h(p?"slideshow.style.created":"slideshow.character.created")),u.step="idle",u.show=!1,p?await ie():await te(),A("changed")}catch(i){const p=((m=(a=i==null?void 0:i.response)==null?void 0:a.data)==null?void 0:m.message)||(u.kind==="style"?h("slideshow.style.error_create"):h("slideshow.character.error_create"));I("error",p),u.step="idle"}},b=oe({show:!1,kind:"style",item:null,deleting:!1}),H=(a,m)=>{b.kind=a,b.item=m,b.deleting=!1,b.show=!0},pe=()=>{b.deleting||(b.show=!1,b.item=null)},_e=async()=>
1{if(!b.item)return;const a=b.kind==="style";b.deleting=!0;try{const m=a?"mixpost.slideshow.styles.destroy":"mixpost.slideshow.characters.destroy",i={workspace:w.id};i[a?"style":"character"]=b.item.id,await L.delete(S(m,i)),I("success",h(a?"slideshow.style.deleted":"slideshow.character.deleted")),a?K.value=K.value.filter(p=>p.id!==b.item.id):R.value=R.value.filter(p=>p.id!==b.item.id),A("changed"),b.show=!1,b.item=null}catch{I("error",h(a?"slideshow.style.error_delete":"slideshow.character.error_delete"))}finally{b.deleting=!1}},J=a=>{var m,i;return((m=a==null?void 0:a.reference_media)==null?void 0:m.thumb_url)||((i=a==null?void 0:a.reference_media)==null?void 0:i.url)||(a==null?void 0:a.reference_media_url)||""};return Qe(async()=>{ie(),await te(),R.value.some(a=>a.soul_status==="training")&&ae()}),r({fetchStyles:ie,fetchCharacters:te}),(a,m)=>(d(),g("div",St,[t("section",null,[t("div",zt,[t("div",It,[n(y,{icon:"Palette",size:18,class:"text-orange-600 dark:text-orange-400"}),t("h3",Vt,o(s(h)("slideshow.style.section_title")),1)]),n(N,{size:"sm",onClick:m[0]||(m[0]=i=>xe("style"))},{icon:x(()=>[n(y,{icon:"Plus",size:16})]),default:x(()=>[f(" "+o(s(h)("slideshow.style.new")),1)]),_:1})]),q.styles?(d(),g("div",jt,[n(y,{icon:"LoaderCircle",size:16,class:"animate-spin"}),f(" "+o(s(h)("slideshow.style.loading")),1)])):K.value.length?(d(),g("div",Dt,[(d(!0),g(z,null,U(K.value,i=>(d(),g("div",{key:i.id,class:"group relative rounded-2xl border border-orange-100 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-800"},[t("div",Lt,[J(i)?(d(),g("img",{key:0,src:J(i),alt:i.name,class:"w-full h-full object-cover"},null,8,Tt)):(d(),Z(y,{key:1,icon:"Palette",size:28,class:"text-gray-300 dark:text-gray-500"}))]),t("div",At,[t("span",{class:"text-sm font-medium text-gray-900 dark:text-white truncate",title:i.name},o(i.name),9,Pt),t("button",{type:"button",class:"shrink-0 rounded-md p-1 text-gray-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 transition","aria-label":s(h)("slideshow.style.delete_aria",{name:i.name}),onClick:p=>H("style",i)},[n(y,{icon:"Trash2",size:16})],8,Ot)])]))),128))])):(d(),g("div",Ut,o(s(h)("slideshow.style.empty")),1))]),t("section",null,[t("div",Nt,[t("div",Et,[n(y,{icon:"Users",size:18,class:"text-orange-600 dark:text-orange-400"}),t("h3",Rt,o(s(h)("slideshow.character.section_title")),1)]),n(N,{size:"sm",onClick:m[1]||(m[1]=i=>xe("character"))},{icon:x(()=>[n(y,{icon:"Plus",size:16})]),default:x(()=>[f(" "+o(s(h)("slideshow.character.new")),1)]),_:1})]),q.characters?(d(),g("div",Bt,[n(y,{icon:"LoaderCircle",size:16,class:"animate-spin"}),f(" "+o(s(h)("slideshow.character.loading")),1)])):R.value.length?(d(),g("div",Mt,[(d(!0),g(z,null,U(R.value,i=>(d(),g("div",{key:i.id,class:"group relative rounded-2xl border border-orange-100 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-800"},[t("div",qt,[J(i)?(d(),g("img",{key:0,src:J(i),alt:i.name,class:"w-full h-full object-cover"},null,8,Ht)):(d(),Z(y,{key:1,icon:"User",size:28,class:"text-gray-300 dark:text-gray-500"}))]),t("div",Gt,[t("span",{class:"text-sm font-medium text-gray-900 dark:text-white truncate",title:i.name},o(i.name),9,Zt),t("button",{type:"button",class:"shrink-0 rounded-md p-1 text-gray-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 transition","aria-label":s(h)("slideshow.character.delete_aria",{name:i.name}),onClick:p=>H("character",i)},[n(y,{icon:"Trash2",size:16})],8,Kt)]),t("div",Xt,[t("span",{class:E(["inline-flex items-center gap-1 text-[11px] font-medium",$e(i)])},[n(y,{icon:Ce(i),size:12},null,8,["icon"]),f(" "+o(M(i)),1)],2),t("button",{type:"button",class:"shrink-0 rounded-md px-2 py-0.5 text-[11px] font-medium border border-orange-200 text-orange-600 hover:bg-orange-50 disabled:opacity-40 disabled:cursor-not-allowed dark:border-orange-800 dark:text-orange-300",disabled:!X(i)||i.soul_status==="training",title:X(i)?"Entraîner un personnage Soul ID (visage identique sur tous les slides)":"Il faut au moins 5 photos pour entraîner un Soul ID",onClick:p=>se(i)},o(i.soul_status==="ready"?"Ré-entraîner Soul":i.soul_status==="training"?"Entraînement…":"Entraîner Soul ID"),9,Yt)])]))),128))])):(d(),g("div",Ft,o(s(h)("slideshow.character.empty")),1))]),n(et,{show:u.show,"max-width":"lg",closeable:u.step==="idle",onClose:Se},{header:x(()=>[t("span",Wt,o(u.kind==="style"?s(h)("slideshow.style.create_title"):s(h)("slideshow.character.create_title")),1)]),body:x(()=>[t("p",Jt,o(u.kind==="style"?s(h)("slideshow.style.create_hint"):s(h)("slideshow.character.create_hint")),1),t("div",Qt,[n(O,{value:s(h)("slideshow.style.name_label"),for:"sm-create-name"},null,8,["value"]),n(st,{id:"sm-create-name",modelValue:u.name,"onUpdate:modelValue":m[2]||(m[2]=i=>
1u.name=i),type:"text",class:"mt-xs w-full",placeholder:u.kind==="style"?s(h)("slideshow.style.name_placeholder"):s(h)("slideshow.character.name_placeholder")},null,8,["modelValue","placeholder"])]),t("div",null,[n(O,{value:s(h)("slideshow.style.reference_label")},null,8,["value"]),t("div",{class:E(["mt-xs relative flex flex-col items-center justify-center rounded-2xl border-2 border-dashed p-6 transition-colors",u.dragOver?"border-orange-500 bg-orange-50 dark:bg-orange-900/20":"border-orange-100 dark:border-gray-600 bg-white dark:bg-gray-800"]),onDragenter:m[6]||(m[6]=be(i=>u.dragOver=u.step==="idle",["prevent"])),onDragover:m[7]||(m[7]=be(()=>{},["prevent"])),onDragleave:m[8]||(m[8]=be(i=>u.dragOver=!1,["prevent"])),onDrop:be(ze,["prevent"])},[u.kind==="style"&&u.previewUrl?(d(),g(z,{key:0},[t("img",{src:u.previewUrl,alt:s(h)("slideshow.style.reference_preview_alt"),class:"max-h-48 rounded-xl object-contain"},null,8,es),u.step==="idle"?(d(),g("button",{key:0,type:"button",class:"mt-md text-sm text-orange-600 hover:text-orange-700 dark:text-orange-400",onClick:m[3]||(m[3]=i=>{var p;return(p=B.value)==null?void 0:p.click()})},o(s(h)("slideshow.style.change_image")),1)):D("",!0)],64)):u.kind==="character"&&u.files.length?(d(),g(z,{key:1},[t("div",ts,[(d(!0),g(z,null,U(de.value,(i,p)=>(d(),g("div",{key:p,class:"relative aspect-square"},[t("img",{src:i,alt:"",class:"h-full w-full rounded-lg object-cover"},null,8,ss),u.step==="idle"?(d(),g("button",{key:0,type:"button",class:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-white shadow",onClick:j=>V(p)},[n(y,{icon:"X",size:11})],8,as)):D("",!0)]))),128)),u.step==="idle"&&u.files.length<6?(d(),g("button",{key:0,type:"button",class:"flex aspect-square flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed border-orange-200 text-orange-500 hover:bg-orange-50 dark:hover:bg-orange-900/20",onClick:m[4]||(m[4]=i=>{var p;return(p=B.value)==null?void 0:p.click()})},[n(y,{icon:"Plus",size:18}),t("span",rs,o(s(h)("general.browse")),1)])):D("",!0)]),t("p",ls,o(u.files.length)+"/6 — "+o(s(h)("slideshow.character.multi_hint")),1)],64)):(d(),g(z,{key:2},[n(y,{icon:"ImagePlus",size:32,class:"text-orange-400 mb-xs"}),t("p",os,[f(o(s(h)("slideshow.style.drop_hint"))+" ",1),t("button",{type:"button",class:"text-orange-600 hover:text-orange-700 dark:text-orange-400 font-medium",onClick:m[5]||(m[5]=i=>{var p;return(p=B.value)==null?void 0:p.click()})},o(s(h)("general.browse")),1)]),u.kind==="character"?(d(),g("p",is,o(s(h)("slideshow.character.multi_hint")),1)):D("",!0)],64)),t("input",{ref_key:"fileInput",ref:B,type:"file",accept:"image/*",multiple:u.kind==="character",class:"hidden",onChange:W},null,40,ns)],34)]),u.step!=="idle"?(d(),g("div",ds,[n(y,{icon:"LoaderCircle",size:18,class:"animate-spin"}),t("span",null,o(u.step==="uploading"?s(h)("slideshow.style.uploading"):s(h)("slideshow.style.analyzing")),1)])):D("",!0)]),footer:x(()=>[n(N,{disabled:u.step!=="idle",onClick:Se},{default:x(()=>[f(o(s(h)("slideshow.style.cancel")),1)]),_:1},8,["disabled"]),n(le,{class:"ml-xs",disabled:!re(),isLoading:u.step!=="idle",onClick:ue},{default:x(()=>[f(o(s(h)("slideshow.style.create_submit")),1)]),_:1},8,["disabled","isLoading"])]),_:1},8,["show","closeable"]),n(_t,{show:b.show,variant:"danger","z-index-class":"z-[2000]",onClose:pe},{header:x(()=>[t("span",cs,o(b.kind==="style"?s(h)("slideshow.style.delete_title"):s(h)("slideshow.character.delete_title")),1)]),body:x(()=>[t("p",us,o(b.kind==="style"?s(h)("slideshow.style.delete_confirm"):s(h)("slideshow.character.delete_confirm")),1)]),footer:x(()=>[n(N,{disabled:b.deleting,onClick:pe},{default:x(()=>[f(o(s(h)("slideshow.style.cancel")),1)]),_:1},8,["disabled"]),n(pt,{class:"ml-xs",isLoading:b.deleting,onClick:_e},{default:x(()=>[f(o(s(h)("slideshow.style.delete_submit")),1)]),_:1},8,["isLoading"])]),_:1},8,["show"])]))}};function hs(ee){const r=v([]),T=v(!1);return{formats:r,loading:T,load:async()=>{T.value=!0;try{const I=await fetch(S("mixpost.studio.formats",{workspace:ee}));r.value=(await I.json()).formats||[]}finally{T.value=!1}}}}const xs={class:"row-py"},ps={class:"row-px mb-lg"},_s=["aria-label"],fs=["aria-selected"],ys=["aria-selected"],vs={class:"row-px mb-lg"},bs={class:"inline-flex items-center gap-2 rounded-full border border-orange-100 dar
1k:border-gray-700 bg-orange-50/60 dark:bg-orange-900/10 px-3 py-1.5 text-sm"},ks={key:0,class:"text-gray-500 dark:text-gray-400"},ws={key:1,class:"text-gray-700 dark:text-gray-200"},Cs={key:0,class:"mt-md flex flex-col gap-3 rounded-2xl border border-amber-200 dark:border-amber-900/50 bg-amber-50 dark:bg-amber-900/20 p-4 sm:flex-row sm:items-center sm:justify-between"},$s={class:"flex items-center gap-2 text-amber-800 dark:text-amber-200"},Ss={class:"text-sm font-medium"},zs={class:"flex flex-wrap items-center gap-2"},Is={key:0,class:"row-px"},Vs={class:"mb-lg flex items-center justify-between rounded-2xl border border-orange-100 dark:border-gray-700 bg-orange-50/60 dark:bg-orange-900/10 p-4"},js={class:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-200"},Us={class:"mt-lg"},Ds={class:"mt-xs flex items-center gap-3"},Ls={class:"w-10 text-center text-sm font-semibold text-gray-900 dark:text-white tabular-nums"},Ts={class:"mt-xs text-xs text-gray-500 dark:text-gray-400"},As={class:"mt-lg grid grid-cols-1 sm:grid-cols-2 gap-md"},Ps={value:null},Os=["value"],Ns={value:null},Es=["value"],Rs={class:"mt-xs"},Bs={class:"mt-lg"},Fs={class:"flex items-center justify-between mb-md"},Ms={class:"text-sm font-semibold text-gray-700 dark:text-gray-200"},qs={key:0,class:"py-6 text-center text-sm text-gray-400"},Hs={key:1,class:"py-6 text-center text-sm text-gray-400"},Gs={key:2,class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-md"},Zs=["href"],Ks=["src"],Xs={key:1,class:"absolute inset-0 flex items-center justify-center text-gray-300 dark:text-gray-600"},Ys={class:"absolute right-1.5 top-1.5 rounded-full bg-black/50 px-1.5 py-0.5 text-[10px] text-white"},Ws={class:"flex items-center justify-between gap-1 p-2"},Js=["href"],Qs={class:"truncate text-xs text-gray-600 dark:text-gray-300"},ea=["onClick","disabled"],ta={class:"row-px"},sa={class:"border-l-4 border-orange-400 p-lg dark:border-orange-500"},aa={for:"studio-idea",class:"block text-xs font-semibold uppercase tracking-wider text-orange-700 dark:text-orange-400"},ra=["placeholder"],la={class:"border-t border-gray-100 bg-gray-50/70 p-lg dark:border-gray-700 dark:bg-gray-800/40"},oa={class:"grid grid-cols-1 gap-lg lg:grid-cols-2"},ia={key:0,class:"mt-xs flex items-center text-sm text-gray-500 dark:text-gray-400"},na={key:1,class:"mt-xs flex flex-wrap gap-1.5"},da=["onClick"],ca={class:"mt-xs flex flex-wrap gap-1.5"},ua=["onClick"],ga={key:0,class:"mt-xs text-sm text-gray-500 dark:text-gray-400"},ma={key:1,class:"mt-xs text-xs text-gray-500 dark:text-gray-400"},ha={class:"mt-lg flex flex-wrap items-end gap-lg"},xa={class:"min-w-[10rem]"},pa=["value"],_a={class:"mt-xs inline-flex items-center rounded-lg bg-gray-100 p-1 dark:bg-gray-700"},fa=["onClick"],ya={class:"mt-xs inline-flex items-center rounded-lg bg-gray-100 p-1 dark:bg-gray-700"},va=["onClick"],ba={key:0,class:"mt-lg border-t border-gray-200 pt-lg dark:border-gray-700"},ka={class:"flex flex-wrap items-center gap-lg"},wa={class:"ml-xs text-sm text-gray-700 dark:text-gray-300"},Ca={class:"ml-xs text-sm text-gray-700 dark:text-gray-300"},$a={class:"ml-xs text-sm text-gray-700 dark:text-gray-300"},Sa={class:"mt-md max-w-md"},za={class:"flex flex-wrap items-center justify-between gap-md border-t border-gray-100 p-lg dark:border-gray-700"},Ia={class:"text-sm text-gray-500 dark:text-gray-400"},Va={class:"mt-lg"},ja={class:"mb-md text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400"},Ua={key:0,class:"rounded-2xl border border-dashed border-gray-300 p-lg text-center text-gray-500 dark:border-gray-700 dark:text-gray-400"},Da={key:1,class:"grid grid-cols-1 gap-md xl:grid-cols-2"},La={class:"flex items-center justify-between"},Ta={class:"flex items-center gap-2"},Aa={class:"font-medium text-gray-900 dark:text-white"},Pa={key:0,class:"mt-md text-sm text-gray-400 dark:text-gray-500"},Oa={key:1,class:"mt-md"},Na={class:"flex items-center text-gray-500 dark:text-gray-400 text-sm"},Ea={key:2,class:"mt-md"},Ra={class:"text-sm text-red-600 dark:text-red-400"},Ba={key:0,class:"mt-xs flex flex-wrap gap-2"},Fa={key:3,class:"mt-md"},Ma={key:0,class:"mb-xs flex gap-1.5"},qa=["onClick"],Ha=["value","onInput"],Ga={class:"mt-md flex flex-wrap gap-2"},Za={class:"font-semibold text-gray-900 dark:text-white"},or={__name:"Index",props:{accounts:{type:Array,default:()=>[]},seedIdea:{type:String,default:""},seedNetwork:{type:String,default:""},seedHashtags:{type:String,default:""},seedSoundId:{type:String,default:""}},setup(ee){const{t:r}=We(),{notify:T}=tt(),{getTextCredits:h,refreshUserMenuCredits:I}=wt(),w=Je("workspaceCtx"),A=ee,K={twitter:280,instagram:2200,instagram_direct:2200,threads:500,bluesky:300,mastodon:500,linkedin:3e3,linkedin_page:3e3,facebook_page:5e3,facebook_group:5e3,youtube:5e3,pinterest:500,tiktok:2200},R=c=>K[c]??1e3,{formats:q,loading:ie,load:te}=hs(w.id),P=v(null),X=A.seedNetwork?A.accounts.filter(c=>c.provider===A.seedNetwork):[],M=v((X.length?X:A.accounts).map(c=>c.id)),Ce=c=>{const l=M.value.indexOf(c);l===-1?M.value.push(c):M.value.splice(l,1)},$e=c=>M.value.includes(c),se=F(()=>A.accounts.filter(c=>M.value.includes(c.id))),ae=v("neutral"),u=F(()=>[{value:"neutral",label:r("studio.tone_neutral")},{value:"friendly",label:r("studio.tone_friendly")},{value:"formal",label:r("studio.tone_formal")},{value:"edgy",label:r("studio.tone_edgy")},{value:"engaging",label:r("studio.tone_engaging")}]),B=v("medium"),xe=F(()=>[{value:"short",label:r("studio.length_short")},{value:"medium",label:r("studio.length_medium")},{value:"long",label:r("studio.length_long")}]),Y=v((()=>{let c=A.seedIdea||"";const l=(A.seedHashtags||"").trim();return l&&!c.includes(l)&&(c=c?`${c} ${l}`:l),c})()),ne=v(A.seedSoundId||""),V=oe({hashtags:!0,emojis:!0,cta:!1,link:""}),de=v(1),W=v(null),ze=v(""),re=v(!0),ce=async()=>{re.value=!0;try{const{credits:c,planName:l}=await h(w.id);W.value=Number.isFinite(c)?c:0,ze.value=l||""}catch{W.value=0}finally{re.value=!1}},ue=F(()=>W.value!==null&&W.value<=0),b=F(()=>Y.value.trim().length>0&&M.value.length>0&&!!P.value&&!ue.value),H=v(!1),pe=F(()=>ue.value?"":Y.value.trim().length?P.value?M.value.length?"":r("studio.missing_network"):r("studio.missing_format"):r("studio.missing_idea")),_e=()=>{window.location.href="/abonnement"},J=()=>{ke.visit(S("purrai.credits.index",{workspace:w.id}))},a=ft(),m=F(()=>!!a.props.creditPacksAvailable),i=oe({}),p=c=>(i[c]||(i[c]={status:"idle",error:null,insufficientCredits:!1,variants:[],activeVariant:0,controller:null}),i[c]),j=F(()=>Object.values(i).some(c=>c.status==="loading")),at=c=>({idea:Y.value,format_key:P.value,networks:[c],tone:ae.value,language:"fr",...ne.value?{sound_id:ne.value}:{},options:{hashtags:V.hashtags,emojis:V.emojis,cta:V.cta,link:V.link,length:B.value},variations:de.value}),Ie=async c=>{var e,$,Q,Ue,He,Ge,Ze;const l=p(c.id);l.controller&&l.controller.abort();const _=new AbortController;l.controller=_,l.status="loading",l.error=null;try{const{data:k}=await L.post(S("mixpost.studio.generate",{workspace:w.id}),at(c.provider),{signal:_.signal}),me=(k.results||[]).find(De=>De.provider===c.provider)||(k.results||[])[0],ve=((me==null?void 0:me.variants)||[]).map(De=>({text:De.text??""}));if(!ve.length){l.status="error",l.error=r("studio.error_no_result");return}l.variants=ve,l.activeVariant=0,l.status="filled",ce(),I()}catch(k){if(L.isCancel(k)||(k==null?void 0:k.name)==="AbortError"||(k==null?void 0:k.code)==="ERR_CANCELED")return;l.status="error";
1const me=(e=k==null?void 0:k.response)==null?void 0:e.status,ve=((Q=($=k==null?void 0:k.response)==null?void 0:$.data)==null?void 0:Q.error)||((He=(Ue=k==null?void 0:k.response)==null?void 0:Ue.data)==null?void 0:He.code);me===402||ve==="insufficient_credits"?(l.error=r("studio.error_insufficient_credits"),l.insufficientCredits=!0,ce()):(l.error=((Ze=(Ge=k==null?void 0:k.response)==null?void 0:Ge.data)==null?void 0:Ze.message)||r("studio.error_generic"),l.insufficientCredits=!1)}finally{l.controller===_&&(l.controller=null)}},rt=()=>{if(!b.value)return;const c=se.value;c.forEach(l=>{const _=p(l.id);_.status="loading",_.error=null}),Promise.all(c.map(l=>Ie(l)))},Pe=(c=null)=>{let l=0;Object.entries(i).forEach(([_,e])=>{c!==null&&String(_)!==String(c)||e.status==="loading"&&(e.controller&&(e.controller.abort(),e.controller=null),e.status=e.variants.length?"filled":"idle",l+=1)}),l&&T("warning",r("studio.generation_stopped"))},Ve=c=>{var _;const l=i[c];return!l||!l.variants.length?"":((_=l.variants[l.activeVariant])==null?void 0:_.text)??""},lt=(c,l)=>{const _=i[c];_&&_.variants[_.activeVariant]&&(_.variants[_.activeVariant].text=l)},ot=(c,l)=>{const _=i[c];_&&(_.activeVariant=l)},Oe=c=>Ve(c).length,it=(c,l)=>Oe(c)>R(l),nt=c=>{ke.visit(S("mixpost.posts.create",{workspace:w.id,body:Ve(c)}))},G=v("text"),C=oe({seed:A.seedIdea||"",slideCount:6,creating:!1,styleId:null,characterId:null}),Ne=v([]),Ee=v([]),Re=v(!1),Be=async(c=!1)=>{var l,_;if(!(Re.value&&!c))try{const[e,$]=await Promise.all([L.get(S("mixpost.slideshow.styles.index",{workspace:w.id})),L.get(S("mixpost.slideshow.characters.index",{workspace:w.id}))]);Ne.value=((l=e.data)==null?void 0:l.styles)??[],Ee.value=((_=$.data)==null?void 0:_.characters)??[],Re.value=!0}catch{T("error",r("slideshow.style.error_load"))}},fe=v(!1),dt=()=>{fe.value=!0},ct=()=>{Be(!0)},ge=v([]),je=v(!1),ye=v(null),Fe=async()=>{je.value=!0;try{const{data:c}=await L.get(S("mixpost.slideshow.list",{workspace:w.id}));ge.value=(c==null?void 0:c.slideshows)??[]}catch{}finally{je.value=!1}},Me=c=>S("mixpost.slideshow.editor",{workspace:w.id,slideshow:c}),ut=async c=>{var l,_;if(!ye.value){ye.value=c.id;try{await L.post(S("mixpost.slideshow.discard",{workspace:w.id,slideshow:c.id})),ge.value=ge.value.filter(e=>e.id!==c.id),T("success",r("slideshow.draft_deleted"))}catch(e){T("error",((_=(l=e==null?void 0:e.response)==null?void 0:l.data)==null?void 0:_.message)||r("slideshow.error_delete"))}finally{ye.value=null}}},gt=c=>({draft:"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300",generating:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300",partial:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",ready:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",scheduled:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"})[c]||"bg-gray-100 text-gray-600",mt=()=>{G.value="slideshow",Be(),Fe()},qe=F(()=>C.seed.trim().length>0&&!C.creating),ht=async()=>{var c,l,_;if(qe.value){C.creating=!0;try{const{data:e}=await L.post(S("mixpost.slideshow.store",{workspace:w.id}),{seed:C.seed,slide_count:C.slideCount,style_id:C.styleId,character_id:C.characterId}),$=(c=e==null?void 0:e.slideshow)==null?void 0:c.id;if(!$){T("error",r("slideshow.error_create")),C.creating=!1;return}ke.visit(S("mixpost.slideshow.editor",{workspace:w.id,slideshow:$}))}catch(e){T("error",((_=(l=e==null?void 0:e.response)==null?void 0:l.data)==null?void 0:_.message)||r("slideshow.error_create")),C.creating=!1}}};return Qe(()=>{te(),ce()}),(c,l)=>{const _=yt("tooltip");return d(),g(z,null,[n(s(vt),{title:s(r)("studio.title")},null,8,["title"]),t("div",xs,[n(Ct,{title:s(r)("studio.title")},{description:x(()=>[f(o(s(r)("studio.subtitle"))+" ",1),n(s(bt),{href:s(S)("mixpost.posts.create",{workspace:s(w).id}),class:"ml-1 font-medium text-orange-600 underline underline-offset-2 dark:text-orange-400"},{default:x(()=>[f(o(s(r)("studio.to_editor")),1)]),_:1},8,["href"])]),_:1},8,["title"]),t("div",ps,[t("div",{class:"inline-flex items-center bg-gray-100 dark:bg-gray-700 rounded-lg p-1",role:"tablist","aria-label":s(r)("studio.mode_label")},[t("button",{type:"button",role:"tab","aria-selected":G.value==="text",onClick:l[0]||(l[0]=e=>G.value="text"),class:E(["px-4 py-1.5 rounded-md text-sm font-medium transition-all",G.value==="text"?"bg-orange-600 text-white shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"])},o(s(r)("studio.mode_text")),11,fs),t("button",{type:"button",role:"tab","aria-selected":G.value==="slideshow",onClick:mt,class:E(["inline-flex items-center gap-1.5 px-4 py-1.5 rounded-md text-sm font-medium transition-all",G.value==="slideshow"?"bg-orange-600 text-white shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"])},[n(y,{icon:"Images",size:16}),f(" "+o(s(r)("studio.mode_slideshow")),1)],10,ys)],8,_s)]),t("div",vs,[t("div",bs,[n(y,{icon:"Sparkles",size:15,class:"text-orange-600 dar
1k:text-orange-400"}),re.value?(d(),g("span",ks,o(s(r)("studio.credits_loading")),1)):(d(),g("span",ws,o(s(r)("studio.credits_text_balance",{count:W.value})),1))]),ue.value?(d(),g("div",Cs,[t("div",$s,[n(y,{icon:"TriangleAlert",size:20}),t("span",Ss,o(s(r)("studio.credits_empty_banner")),1)]),t("div",zs,[m.value?(d(),Z(le,{key:0,size:"sm",onClick:J},{icon:x(()=>[n(y,{icon:"ShoppingBag",size:16})]),default:x(()=>[f(" "+o(s(r)("studio.credits_buy_pack_cta")),1)]),_:1})):D("",!0),n(N,{size:"sm",onClick:_e},{icon:x(()=>[n(y,{icon:"Rocket",size:16})]),default:x(()=>[f(" "+o(s(r)("studio.credits_upgrade_cta")),1)]),_:1})])])):D("",!0)]),G.value==="slideshow"?(d(),g("div",Is,[n(we,{class:"max-w-2xl"},{default:x(()=>[t("div",Vs,[t("div",js,[n(y,{icon:"Zap",size:18,class:"text-orange-600 dark:text-orange-400"}),t("span",null,o(s(r)("slideshow.blitz.studio_cta_text")),1)]),n(N,{size:"sm",onClick:l[1]||(l[1]=e=>s(ke).visit(s(S)("mixpost.slideshow.blitz-page",{workspace:s(w).id})))},{icon:x(()=>[n(y,{icon:"Zap",size:16})]),default:x(()=>[f(" "+o(s(r)("slideshow.blitz.studio_cta_button")),1)]),_:1})]),t("div",null,[n(O,{value:s(r)("slideshow.seed_label"),for:"slideshow-seed"},null,8,["value"]),n($t,{id:"slideshow-seed",modelValue:C.seed,"onUpdate:modelValue":l[2]||(l[2]=e=>C.seed=e),rows:"4",placeholder:s(r)("slideshow.seed_placeholder"),class:"mt-xs"},null,8,["modelValue","placeholder"])]),t("div",Us,[n(O,{value:s(r)("slideshow.count_label"),for:"slideshow-count"},null,8,["value"]),t("div",Ds,[he(t("input",{id:"slideshow-count",type:"range",min:"1",max:"12",step:"1","onUpdate:modelValue":l[3]||(l[3]=e=>C.slideCount=e),class:"flex-1 accent-orange-600"},null,512),[[Ke,C.slideCount,void 0,{number:!0}]]),t("span",Ls,o(C.slideCount),1)]),t("p",Ts,o(s(r)("slideshow.count_hint")),1)]),t("div",As,[t("div",null,[n(O,{value:s(r)("slideshow.style.selector_label"),for:"slideshow-style"},null,8,["value"]),n(Te,{id:"slideshow-style",modelValue:C.styleId,"onUpdate:modelValue":l[4]||(l[4]=e=>C.styleId=e),class:"mt-xs"},{default:x(()=>[t("option",Ps,o(s(r)("slideshow.style.none")),1),(d(!0),g(z,null,U(Ne.value,e=>(d(),g("option",{key:e.id,value:e.id},o(e.name),9,Os))),128))]),_:1},8,["modelValue"])]),t("div",null,[n(O,{value:s(r)("slideshow.character.selector_label"),for:"slideshow-character"},null,8,["value"]),n(Te,{id:"slideshow-character",modelValue:C.characterId,"onUpdate:modelValue":l[5]||(l[5]=e=>C.characterId=e),class:"mt-xs"},{default:x(()=>[t("option",Ns,o(s(r)("slideshow.character.none")),1),(d(!0),g(z,null,U(Ee.value,e=>(d(),g("option",{key:e.id,value:e.id},o(e.name),9,Es))),128))]),_:1},8,["modelValue"])])]),t("div",Rs,[t("button",{type:"button",class:"inline-flex items-center gap-1.5 text-sm text-orange-600 hover:text-orange-700 dark:text-orange-400 transition",onClick:dt},[n(y,{icon:"Settings2",size:15}),f(" "+o(s(r)("slideshow.style.manage_link")),1)])]),t("div",Bs,[n(le,{size:"md",disabled:!qe.value,isLoading:C.creating,onClick:ht,class:"w-full justify-center"},{icon:x(()=>[n(Ye,{class:"w-5 h-5"})]),default:x(()=>[f(" "+o(s(r)("slideshow.generate")),1)]),_:1},8,["disabled","isLoading"])])]),_:1}),n(we,{class:"mt-lg"},{default:x(()=>[t("div",Fs,[t("h3",Ms,o(s(r)("slideshow.my_slideshows")),1),t("button",{type:"button",class:"text-xs text-orange-600 hover:text-orange-700 dark:text-orange-400 inline-flex items-center gap-1",onClick:Fe},[n(y,{icon:"RefreshCw",size:13}),f(" "+o(s(r)("general.refresh")),1)])]),je.value?(d(),g("div",qs,"…")):ge.value.length?(d(),g("div",Gs,[(d(!0),g(z,null,U(ge.value,e=>(d(),g("div",{key:e.id,class:"group relative flex flex-col rounded-xl border border-gray-100 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-800"},[t("a",{href:Me(e.id),class:"block relative bg-gray-100 dark:bg-gray-900",style:{"aspect-ratio":"9 / 16"}},[e.thumb_url?(d(),g("img",{key:0,src:e.thumb_url,alt:"",class:"absolute inset-0 h-full w-full object-cover"},null,8,Ks)):(d(),g("div",Xs,[n(y,{icon:"Image",size:28})])),t("span",{class:E(["absolute left-1.5 top-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium",gt(e.status)])},o(s(r)("slideshow.status_"+e.status,e.status)),3),t("span",Ys,o(e.slides_count),1)],8,Zs),t("div",Ws,[t("a",{href:Me(e.id),class:"flex-1 min-w-0"},[t("p",Qs,o(e.seed||s(r)("slideshow.untitled")),1)],8,Js),he((d(),g("button",{type:"button",onClick:$=>ut(e),disabled:ye.value===e.id,class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-gray-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-gray-700 disabled:opacity-40"},[n(y,{icon:"Trash2",size:14})],8,ea)),[[_,s(r)("slideshow.delete")]])])]))),128))])):(d(),g("div",Hs,o(s(r)("slideshow.no_draft")),1))]),_:1})])):D("",!0),he(t("div",ta,[n(we,{withPadding:!1,class:"overflow-hidden"},{default:x(()=>[t("div",sa,[t("label",aa,o(s(r)("studio.brief_title")),1),he(t("textarea",{id:"studio-idea","onUpdate:modelValue":l[6]||(l[6]=e=>Y.value=e),rows:"3",placeholder:s(r)("studio.idea_placeholder"),class:"mt-sm w-full resize-none border-0 bg-transparent p-0 text-lg leading-relaxed text-gray-900 outline-none placeholder:text-gray-400 focus:ring-0 dark:text-white dark:placeholder-gray-500"},null,8,ra),[[Ke,Y.value]])]),t("div",la,[t("div",oa,[t("div",null,[n(O,{value:s(r)("studio.format_label")},null,8,["value"]),s(ie)?(d(),g("div",ia,[n(Le,{class:"animate-spin w-4 h-4 mr-xs"}),f(" "+o(s(r)("studio.loading")),1)])):(d(),g("div",na,[(d(!0),g(z,null,U(s(q),e=>he((d(),g("button",{key:e.key,type:"button",onClick:$=>P.value=e.key,class:E(["rounded-full border px-3 py-1 text-sm font-medium transition",P.value===e.key?"border-orange-600 bg-orange-600 text-white":"border-gray-300 bg-white text-gray-700 hover:border-orange-400 hover:text-orange-600 dar
1k:border-gray-600 dark:bg-gray-800 dark:text-gray-300"])},[f(o(e.name),1)],10,da)),[[_,e.skeleton]])),128))]))]),t("div",null,[n(O,{value:s(r)("studio.networks_label")},null,8,["value"]),t("div",ca,[(d(!0),g(z,null,U(ee.accounts,e=>(d(),g("button",{key:e.id,type:"button",onClick:$=>Ce(e.id),class:E(["inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm font-medium transition",$e(e.id)?"border-orange-500 bg-orange-100 text-orange-700 dark:bg-orange-900/20 dark:text-orange-300":"border-gray-300 bg-white text-gray-700 hover:border-orange-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300"])},[n(Xe,{provider:e.provider,class:"w-4 h-4"},null,8,["provider"]),t("span",null,o(e.name),1)],10,ua))),128))]),ee.accounts.length?se.value.length>1?(d(),g("p",ma,o(s(r)("studio.networks_hint")),1)):D("",!0):(d(),g("p",ga,o(s(r)("studio.no_accounts")),1))])]),t("div",ha,[t("div",xa,[n(O,{value:s(r)("studio.tone_label"),for:"studio-tone"},null,8,["value"]),n(Te,{id:"studio-tone",modelValue:ae.value,"onUpdate:modelValue":l[7]||(l[7]=e=>ae.value=e),class:"mt-xs"},{default:x(()=>[(d(!0),g(z,null,U(u.value,e=>(d(),g("option",{key:e.value,value:e.value},o(e.label),9,pa))),128))]),_:1},8,["modelValue"])]),t("div",null,[n(O,{value:s(r)("studio.length_label")},null,8,["value"]),t("div",_a,[(d(!0),g(z,null,U(xe.value,e=>(d(),g("button",{key:e.value,type:"button",onClick:$=>B.value=e.value,class:E(["rounded-md px-3 py-1.5 text-sm font-medium transition-all",B.value===e.value?"bg-orange-600 text-white shadow-sm":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"])},o(e.label),11,fa))),128))])]),t("div",null,[n(O,{value:s(r)("studio.variations_label")},null,8,["value"]),t("div",ya,[(d(),g(z,null,U([1,3],e=>t("button",{key:e,type:"button",onClick:$=>de.value=e,class:E(["rounded-md px-4 py-1.5 text-sm font-medium transition-all",de.value===e?"bg-orange-600 text-white shadow-sm":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"])},o(e),11,va)),64))])]),t("button",{type:"button",class:"inline-flex items-center gap-1.5 pb-1.5 text-sm font-medium text-orange-600 transition hover:text-orange-700 dark:text-orange-400",onClick:l[8]||(l[8]=e=>H.value=!H.value)},[n(y,{icon:H.value?"ChevronUp":"SlidersHorizontal",size:15},null,8,["icon"]),f(" "+o(H.value?s(r)("studio.advanced_hide"):s(r)("studio.advanced_show")),1)])]),H.value?(d(),g("div",ba,[t("div",ka,[n(Ae,{modelValue:V.hashtags,"onUpdate:modelValue":l[9]||(l[9]=e=>V.hashtags=e)},{default:x(()=>[t("span",wa,o(s(r)("studio.opt_hashtags")),1)]),_:1},8,["modelValue"]),n(Ae,{modelValue:V.emojis,"onUpdate:modelValue":l[10]||(l[10]=e=>V.emojis=e)},{default:x(()=>[t("span",Ca,o(s(r)("studio.opt_emojis")),1)]),_:1},8,["modelValue"]),n(Ae,{modelValue:V.cta,"onUpdate:modelValue":l[11]||(l[11]=e=>V.cta=e)},{default:x(()=>[t("span",$a,o(s(r)("studio.opt_cta")),1)]),_:1},8,["modelValue"])]),t("div",Sa,[n(O,{value:s(r)("studio.link_label"),for:"studio-link"},null,8,["value"]),n(st,{id:"studio-link",modelValue:V.link,"onUpdate:modelValue":l[12]||(l[12]=e=>V.link=e),type:"text",placeholder:s(r)("studio.link_placeholder"),class:"mt-xs w-full"},null,8,["modelValue","placeholder"])])])):D("",!0)]),t("div",za,[t("p",Ia,o(pe.value),1),j.value?(d(),Z(N,{key:1,size:"md",onClick:l[13]||(l[13]=e=>Pe())},{icon:x(()=>[n(Le,{class:"animate-spin w-5 h-5"})]),default:x(()=>[f(" "+o(s(r)("studio.stop")),1)]),_:1})):(d(),Z(le,{key:0,size:"md",disabled:!b.value,onClick:rt},{icon:x(()=>[n(Ye,{class:"w-5 h-5"})]),default:x(()=>[f(" "+o(s(r)("studio.generate")),1)]),_:1},8,["disabled"]))])]),_:1}),t("div",Va,[t("h2",ja,o(s(r)("studio.results_title")),1),se.value.length?(d(),g("div",Da,[(d(!0),g(z,null,U(se.value,e=>(d(),Z(we,{key:e.id},{default:x(()=>[t("div",La,[t("div",Ta,[n(Xe,{provider:e.provider,class:"w-5 h-5"},null,8,["provider"]),t("span",Aa,o(e.name),1)])]),!i[e.id]||i[e.id].status==="idle"?(d(),g("div",Pa,o(s(r)("studio.card_idle")),1)):i[e.id].status==="loading"?(d(),g("div",Oa,[t("div",Na,[n(Le,{class:"animate-spin w-5 h-5 mr-xs"}),f(" "+o(s(r)("studio.card_loading")),1)]),n(N,{size:"sm",class:"mt-xs",onClick:$=>Pe(e.id)},{default:x(()=>[f(o(s(r)("studio.stop")),1)]),_:1},8,["onClick"])])):i[e.id].status==="error"?(d(),g("div",Ea,[t("p",Ra,o(i[e.id].error),1),i[e.id].insufficientCredits?(d(),g("div",Ba,[m.value?(d(),Z(le,{key:0,size:"sm",onClick:J},{icon:x(()=>[n(y,{icon:"ShoppingBag",size:15})]),default:x(()=>[f(" "+o(s(r)("studio.credits_buy_pack_cta")),1)]),_:1})):D("",!0),n(N,{size:"sm",onClick:_e},{icon:x(()=>[n(y,{icon:"Rocket",size:15})]),default:x(()=>[f(" "+o(s(r)("studio.credits_upgrade_cta")),1)]),_:1})])):(d(),Z(N,{key:1,size:"sm",class:"mt-xs",onClick:$=>Ie(e)},{default:x(()=>[f(o(s(r)("studio.retry")),1)]),_:1},8,["onClick"]))])):i[e.id].status==="filled"?(d(),g("div",Fa,[i[e.id].variants.length>1?(d(),g("div",Ma,[(d(!0),g(z,null,U(i[e.id].variants,($,Q)=>(d(),g("button",{key:Q,type:"button",onClick:Ue=>ot(e.id,Q),class:E(["px-2.5 py-1 rounded-full text-xs font-medium border transition",i[e.id].activeVariant===Q?"bg-orange-600 border-orange-600 text-white":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:border-orange-400"])},o(s(r)("studio.variant"))+" "+o(Q+1),11,qa))),128))])):D("",!0),t("textarea",{value:Ve(e.id),onInput:$=>lt(e.id,$.target.value),rows:"6",class:"w-full rounded-md border-stone-600 dar
1k:border-gray-600 focus:border-primary-200 focus:ring focus:ring-primary-200 focus:ring-opacity-50 outline-none transition-colors ease-in-out duration-200 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400"},null,40,Ha),t("div",{class:E(["mt-xs text-right text-xs",it(e.id,e.provider)?"text-red-600 dark:text-red-400 font-semibold":"text-gray-400 dark:text-gray-500"])},o(Oe(e.id))+"/"+o(R(e.provider)),3),t("div",Ga,[n(N,{size:"sm",onClick:$=>Ie(e)},{default:x(()=>[f(o(s(r)("studio.regenerate")),1)]),_:1},8,["onClick"]),n(le,{size:"sm",onClick:$=>nt(e.id)},{default:x(()=>[f(o(s(r)("studio.create_post")),1)]),_:1},8,["onClick"])])])):D("",!0)]),_:2},1024))),128))])):(d(),g("div",Ua,o(s(r)("studio.previews_empty")),1))])],512),[[kt,G.value==="text"]]),n(et,{show:fe.value,"max-width":"2xl","scrollable-body":"",onClose:l[15]||(l[15]=e=>fe.value=!1)},{header:x(()=>[t("span",Za,o(s(r)("slideshow.style.manager_title")),1)]),body:x(()=>[n(ms,{onChanged:ct})]),footer:x(()=>[n(N,{onClick:l[14]||(l[14]=e=>fe.value=!1)},{default:x(()=>[f(o(s(r)("slideshow.style.manager_close")),1)]),_:1})]),_:1},8,["show"])])],64)}}};export{or as default};

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.