1import{u as pe,r,j as t}from"./index-L9AYrVUw.js";import{s as me}from"./CheckCircle.es-PkF6a2W-.js";import{n as z}from"./Plus.es-BeVefyFz.js";import{bi as ue,bj as he,bk as ge,m as X,b2 as F,R as d,C as n,n as xe,be,bl as fe,bp as ye}from"./PlanAccessModal-P_W2GThH.js";import{c as Se}from"./locale-Cctu0V3Y.js";import{P as b,a as Ae,b as ve}from"./promptBox-D9Xxfn9U.js";import{S as Ce}from"./SearchInput-h5gAN-Be.js";import{r as je}from"./studioTemplates-ClvTjmU4.js";import{t as B,a as $,s as Re}from"./overrides-DxGb-X-q.js";import{s as G,c as Ie,a as we,t as U}from"./catalog-CkHlpXUG.js";import{S as H,a as Ee}from"./types-YVLQw7aQ.js";import{n as ke}from"./resolveCasting-1-rDPxyF.js";import{C as Te,a as Me,b as Oe}from"./CastPickerPopover-DyZqYUSW.js";import{A as Le}from"./aspectRatios-DDqw6bsx.js";import{P as W}from"./PillSelect-DrQvPMFB.js";import{C as _e}from"./ChatSubmitButton-Bm0hHp2J.js";import{S as Ne}from"./StarterModalShell-BqsuvlPe.js";import{W as q}from"./wfTheme-DA7tTXEm.js";import{u as Pe}from"./useGenerationCreditCost-DQbGS72G.js";import"./productFunnel-DiJFcMU2.js";import"./entries-DM0IuApj.js";import"./sceneCovers-B-dE7_Ce.js";import"./store-CVXWfzEM.js";import"./eligibility-B5UjMwH6.js";import"./scoring-Oj4SgCwH.js";import"./sceneMeta-DmZMZluj.js";import"./styleGroups-B2OGYl0a.js";import"./visualDirection-6RyRmTlC.js";import"./productHeight-D88Bzh8q.js";import"./qaSignal-BzonQWWb.js";import"./shadow-1gm38VU4.js";import"./castingThumbnail-BTwl0DD5.js";import"./pill-dropdown-menu-CmrSXir-.js";import"./use-exclusive-open-LN4OUcjO.js";const De=856,ze=6,Fe=12,I=24,Be=X[2],$e=X[8],Ge=120,Ue=146,He=`1px dashed hsl(${n.border.secondary})`,We=60,qe=500,Xe=1,Je=.25;function Mt(s){const A=Math.round(s*Je);return Math.round(A/Xe)}const Qe={id:"format",default:"1:1",isAspectRatio:!0,options:Le.map(s=>({id:s.id,label:s.label}))},Ve={id:"quality",default:"hd",options:[{id:"hd",label:"HD"},{id:"2k",label:"2K"},{id:"4k",label:"4K"}]};function Ot({info:s}){const A=pe(),[J,w]=r.useState(!1),[Q,E]=r.useState(null),[c,V]=r.useState(()=>new Set(s.styleId?[s.styleId]:[])),[k,K]=r.useState(""),[T,Y]=r.useState("1:1"),[v,Z]=r.useState("hd"),ee=Pe("nano-banana-2",v),[M,te]=r.useState(!0),[O,L]=r.useState(!1),[oe,re]=r.useState(null),[h,ae]=r.useState(""),[f,se]=r.useState(()=>{var o;const e=(o=ue())==null?void 0:o.id;return e?[e]:[]}),y=s.productName??"Produto",g=s.productImage??null,m=r.useMemo(()=>{const e=(s.productSegment??"fas").toLowerCase();return H.includes(e)?e:"fas"},[s.productSegment]),p=oe??m,C=r.useMemo(()=>{const e=a=>Re(a)&&be(a),o=p===m?je({name:y,category:s.productSegment??null}).filter(e):[],i=[...G(Ie(p)),...G(we(p))].map(a=>a.id).filter(e),l=new Set,S=[];for(const a of o)l.has(a)||(l.add(a),S.push({id:a,recomendado:!0}));for(const a of i)l.has(a)||S.length>=We||(l.add(a),S.push({id:a,recomendado:!1}));return S.map(({id:a,recomendado:ce})=>{const D=U(a);return{id:a,nome:D?$(D):a,capa:B(a,p),recomendado:ce}})},[y,s.productSegment,m,p]),u=r.useMemo(()=>{const e=h.trim().toLowerCase();return e?C.filter(o=>`${o.id} ${o.nome}`.toLowerCase().includes(e)):C},[C,h]),j=r.useMemo(()=>u.filter(e=>e.recomendado),[u]),_=r.useMemo(()=>u.filter(e=>!e.recomendado),[u]),x=r.useMemo(()=>[...c].map(e=>{const o=U(e);return{id:e,nome:o?$(o):e,capa:B(e,m)}}),[c,m]),ne=r.useCallback(e=>{const o=he(e);return o?ke(o):ge(e)},[]),ie=e=>{se(e),fe(e.length===1?e[0]:null)},le=()=>{if(!c.size||!g)return;const e=Date.now();A("/board",{replace:!0,state:ye({productImageUrl:g,productLabel:y,prompt:k,format:T,quality:v,timestamp:e,styles:x.map(i=>({id:i.id,name:i.nome,castMemberId:ne(i.id)?f[0]??null:null}))})})};if(J)return null;const de=e=>{const o=c.has(e.id);return t.jsxs("button",{type:"button",title:e.nome,onClick:()=>V(i=>{const l=new Set(i);return l.has(e.id)?l.delete(e.id):l.add(e.id),l}),style:{position:"relative",minWidth:0,aspectRatio:"3 / 4",padding:0,borderRadius:d.boardCard,overflow:"hidden",cursor:"pointer",background:"hsl(var(--gray-100))",border:`2px solid ${o||Q===e.id?q.accent:"transparent"}`,transition:"border-color 120ms ease"},onMouseEnter:()=>E(e.id),onMouseLeave:()=>E(i=>i===e.id?null:i),children:[e.capa&&t.jsx("img",{src:e.capa,alt:"",loading:"lazy",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}),o&&t.jsx(me,{size:22,weight:"fill",color:q.accent,style:{position:"absolute",top:8,right:8}})]},e.id)},R=e=>t.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${ze}, minmax(0, 1fr))`,gap:Fe},children:e.map(de)}),N=e=>t.jsx("h2",{style:{marginBottom:8,fontSize:11,color:`hsl(${n.text.tertiary})`},children:e}),P=(e,o,i,l)=>t.jsxs("button",{type:"button",onClick:i,style:{width:Ge,flexShrink:0,display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",padding:12,borderRadius:d.lg,background:b.bg,boxShadow:b.shadow,border:o?`1.5px solid hsl(${n.border.primary})`:He,cursor:"pointer",textAlign:"left",fontFamily:"inherit",transition:"border-color 120ms ease"},children:[l,t.jsx("span",{className:"text-muted-foreground",style:{fontSize:12},children:e})]});return t.jsxs(Ne,{width:De,onClose:()=>w(!0),semBotaoFechar:!0,panelStyle:{background:"transparent",boxShadow:"none",borderRadius:0,padding:0,display:"flex",flexDirection:"column",gap:Be,position:"relative",top:$e,minHeight:0},children:[M&&t.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",minHeight:0,padding:`16px ${I}
1px ${I}px`,background:`hsl(${n.bg.tertiary})`,borderRadius:d.modal,boxShadow:F.floatRaised},children:[t.jsx("button",{type:"button","aria-label":"Fechar",onClick:()=>w(!0),style:{position:"absolute",top:14,right:14,width:34,height:34,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:d.pill,border:"none",cursor:"pointer",zIndex:1},className:"bg-secondary text-muted-foreground transition-colors hover:bg-secondary/80 hover:text-foreground",children:t.jsx(xe,{size:14,weight:"bold"})}),t.jsx(Ce,{value:h,onChange:ae,placeholder:"Buscar presets",style:{width:432,maxWidth:"calc(100% - 56px)",flexShrink:0,background:"hsl(var(--gray-100))"}}),t.jsx("div",{style:{display:"flex",gap:4,marginTop:16,flexShrink:0,overflowX:"auto",scrollbarWidth:"thin"},children:H.map(e=>t.jsx("button",{type:"button",onClick:()=>re(e),className:Se("text-muted-foreground transition-colors",p===e?"bg-[hsl(var(--gray-100))]":"hover:bg-secondary/60"),style:{border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:13,padding:"6px 12px",borderRadius:d.sm,background:p===e?void 0:"transparent",whiteSpace:"nowrap",flexShrink:0},children:Ee[e]},e))}),t.jsx("div",{style:{height:qe,minHeight:0,marginTop:16,overflowY:"auto",overscrollBehavior:"contain",paddingRight:4},children:u.length===0?t.jsx("p",{className:"py-10 text-center text-[13px] text-muted-foreground",children:h.trim()?"Nenhum preset encontrado para esta busca.":"Nenhum preset recomendado para este produto ainda."}):h.trim()?R(u):t.jsxs(t.Fragment,{children:[j.length>0&&t.jsxs(t.Fragment,{children:[N("Presets recomendados"),R(j)]}),_.length>0&&t.jsxs("div",{style:{marginTop:j.length>0?24:0},children:[p===m&&N("Mais presets para esta vertical"),R(_)]})]})})]}),t.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:12,flexShrink:0,minHeight:Ue,padding:I,background:`hsl(${n.bg.tertiary})`,borderRadius:d.modal,boxShadow:F.floatRaised},children:[P("Preset",M,()=>te(e=>!e),x.length?t.jsxs("span",{style:{display:"flex",gap:4},children:[x.slice(0,3).map(e=>t.jsx("span",{"aria-hidden":!0,style:{width:22,height:22,borderRadius:d.sm,flexShrink:0,background:e.capa?`url(${e.capa}) center/cover no-repeat, hsl(${n.bg.tertiary})`:`hsl(${n.bg.tertiary})`,boxShadow:`inset 0 0 0 1px hsl(${n.border.secondary})`}},e.id)),x.length>3&&t.jsxs("span",{style:{fontSize:11,color:`hsl(${n.text.tertiary})`,alignSelf:"center"},children:["+",x.length-3]})]}):t.jsx(z,{size:18,className:"text-muted-foreground"})),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"stretch",flexShrink:0},children:[P("Casting",O,()=>L(e=>!e),f.length?t.jsx("span",{style:{display:"flex",gap:4},children:f.slice(0,3).map(e=>t.jsx(Te,{id:e,size:22},e))}):t.jsx(z,{size:18,className:"text-muted-foreground"})),O&&t.jsx(Me,{roleId:Oe,memberIds:f,onApply:({memberIds:e})=>ie(e),onClose:()=>L(!1)})]}),t.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",gap:12,padding:12,background:b.bg,borderRadius:d.lg,border:`1px solid hsl(${n.border.tertiary})`,boxShadow:b.shadow},children:[g&&t.jsx("div",{title:y,style:{aspectRatio:"1",alignSelf:"stretch",flexShrink:0,borderRadius:d.md,border:`1px solid hsl(${n.border.tertiary})`,boxShadow:b.shadow,background:`url(${g}) center/cover no-repeat, hsl(${n.bg.primary})`,overflow:"hidden"}}),t.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[t.jsx("textarea",{value:k,onChange:e=>K(e.target.value),placeholder:"Quer ajustar algo? (opcional)",className:Ae,style:{...ve(56),flex:1,color:`hsl(${n.text.primary})`,boxSizing:"border-box"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(W,{pill:Qe,value:T,onChange:e=>Y(e)}),t.jsx(W,{pill:Ve,value:v,onChange:e=>Z(e)}),t.jsx("div",{style:{flex:1}}),t.jsx(_e,{credits:ee*Math.max(1,c.size),state:c.size&&g?"active":"disabled",onClick:le,ariaLabel:c.size>1?`Gerar ${c.size} imagens`:"Gerar"})]})]})]})]})]})}export{Xe as ZOOM_ABERTURA,Ot as default,Mt as larguraDoProduto};
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.