PageSourceSearch

https://snew.ai/assets/Board5Page-DxSSLi1P.js

js snew.ai collected 2026-10-05 15:07:51 UTC 39,365 bytes, 7 lines download raw bytes

1import{u as Re,r as c,j as s,R as K,c as Ve}from"./index-L9AYrVUw.js";import{s as Ke,e as Je,H as Qe}from"./FloatingTopMenu-CIhwk2RR.js";import{p as Ze,A as et}from"./AssetCreatorModal-DfkrU41C.js";import{loadStoreContext as tt}from"./KnowledgeBasePage-DJT9Fkps.js";import{M as ot}from"./boardsMockData-DqHpMT8B.js";import{P as rt,B as nt,a as it}from"./BoardCockpitView-D1dl0hvv.js";import{r as at,B as st,S as lt,a as dt}from"./SceneFeedbackLauncher-CYhp9kmj.js";import{StyleCatalogFloatingButton as ct}from"./StyleCatalogFloatingButton-DGOwxzdY.js";import{m as je}from"./ArrowsClockwise.es-CX8V1pij.js";import{ci as Me,fP as pt,cg as ut,ea as Pe,C as v,R as N,m as L,b2 as F,aC as U,a6 as mt,b0 as Q,u as ht,bD as ft,bh as gt,cj as bt}from"./PlanAccessModal-P_W2GThH.js";import{n as wt}from"./Plus.es-BeVefyFz.js";import{n as yt}from"./Trash.es-D2Zs5Rpt.js";import{T as vt,a as Ae,b as xt}from"./ToolbarPrimitives-DpoRgruO.js";import{P as It}from"./PillSelect-DrQvPMFB.js";import{A as Et}from"./aspectRatios-DDqw6bsx.js";import{T as H}from"./TemplateConnections-DLyAy8gh.js";import{s as Se,t as $e}from"./overrides-DxGb-X-q.js";import{c as At}from"./castingThumbnail-BTwl0DD5.js";import{L as St,r as $t,C as Ct}from"./proposal-0WXgJ1RF.js";import{runCampaignQa as kt}from"./campaignQa-BuUpX9mz.js";import{S as Rt}from"./SceneRecommendationDrawer-B5fXRFYb.js";import"./locale-Cctu0V3Y.js";import"./productFunnel-DiJFcMU2.js";import"./SnewLogo-Cg53XTnQ.js";import"./privateMedia-B7Po080i.js";import"./useStoreProductPublishGate-D57ZGw2b.js";import"./App-DyVHSnY3.js";import"./index-p7aFGi8o.js";import"./dissolve-CQo8GAUH.js";import"./ArrowClockwise.es-CEsBpyry.js";import"./BoardBottomBar-QsrOv3RB.js";import"./ArrowCounterClockwise.es-B3mF2JQM.js";import"./CursorClick.es-C3tPERmx.js";import"./Hand.es-CLd2KHSz.js";import"./Minus.es-Dn8w88Wl.js";import"./SquaresFour.es-BpA8mwXA.js";import"./boardChromeCopy-DnmOEM-I.js";import"./welcomeBoard-4xJYHWeA.js";import"./Cube.es-DwVS_HfU.js";import"./ImageSquare.es-Ckk4CjAE.js";import"./ArrowUp.es-sg_sCqx1.js";import"./round-icon-button-DJH-lznp.js";import"./Image.es-BLTC_PgL.js";import"./Package.es-CyLjTX4J.js";import"./UploadSimple.es-BDJIa312.js";import"./VideoCamera.es-CCLoNiT_.js";import"./PencilSimple.es-DDA0fpvv.js";import"./canvasDocument-BD3jeUPg.js";import"./durableDocument-CwDQPJIK.js";import"./ProductPickerModal-DZV-fDl_.js";import"./firstAsset-DWUwvZpm.js";import"./modal-close-button-BhLoO4jQ.js";import"./tabs-CmDZA0dx.js";import"./index-BKpKuXmL.js";import"./index-Eo00qZvG.js";import"./SearchInput-h5gAN-Be.js";import"./overImage-BfLII5AZ.js";import"./boardSaveRetry-DOnjTgch.js";import"./generationAdapter-BXonAKVC.js";import"./jobRuntime-D9imWnJq.js";import"./snewDefault-bcI9V4vY.js";import"./visualDirection-6RyRmTlC.js";import"./qaSignal-BzonQWWb.js";import"./boardGenerationQueue-CYTlpRvQ.js";import"./stagingComposerPrompt-ut90SPpr.js";import"./admitCommercialProductReference-C8SXMXFm.js";import"./nodeConnectionVisual-Diz8lAIC.js";import"./StarterModalShell-BqsuvlPe.js";import"./useOverridesTick-B6buWBbf.js";import"./generation-shimmer-CRk6nK9x.js";import"./Info.es-yptyVV7H.js";import"./Megaphone.es-CpcQHM6H.js";import"./StudioAIModal-DOvYLOju.js";import"./GearSix.es-DS_4jaPi.js";import"./ThumbsDown.es-CGNKh3eu.js";import"./Upload.es-BDbEacNK.js";import"./PlansModal-arzAnfLd.js";import"./BillingCycleToggle-CYks6Uh5.js";import"./segmented-tabs--x9EQobi.js";import"./historyKey-GcKgTVWl.js";import"./Palette.es-Dd5ZEM4v.js";import"./Resize.es-BwoWh9ki.js";import"./resolveCasting-1-rDPxyF.js";import"./eligibility-B5UjMwH6.js";import"./scoring-Oj4SgCwH.js";import"./productHeight-D88Bzh8q.js";import"./shadow-1gm38VU4.js";import"./productImageClassifier-CtjXT6b0.js";import"./generateAdImage-COaCDGDt.js";import"./socialAdComposedStyleResolver-Cgbeb0Cd.js";import"./christmasCreativeDirections-Ceo-u5n5.js";import"./SnewImageStage-Bp4X6OdJ.js";import"./uiError-CjWj4YDl.js";import"./StandardPopover-ByzlsOLH.js";import"./useAdStyleBriefings-B-lgDCqm.js";import"./PendingAssetPreview-DBUAzWRT.js";import"./FontCategorySelector-BFC0ZGOm.js";import"./StudioChatPanel-CTMIdRq6.js";import"./FrameCorners.es-DEsKEYQB.js";import"./ThumbsUp.es-D_c5yKbs.js";import"./ChatSubmitButton-Bm0hHp2J.js";import"./pill-dropdown-menu-CmrSXir-.js";import"./ThumbCard-ZN7h4mu8.js";import"./pill-BK5sCDTV.js";import"./use-exclusive-open-LN4OUcjO.js";import"./Copy.es-BkRzHo-W.js";import"./CaretDoubleLeft.es-C52M4NEJ.js";import"./CaretLeft.es-CVEVfjVi.js";import"./ChatCircle.es-ys8V5LKI.js";import"./Clock.es-DgpzZNmC.js";import"./Eye.es-UdlNEHEy.js";import"./EyeSlash.es-c1uHZmoR.js";import"./FloppyDisk.es-DCGe340Q.js";import"./Heart.es-Bf3nCVn7.js";import"./MagicWand.es-CAihBnXI.js";import"./Play.es-DBh2Tn7f.js";import"./TextT.es-BlMVVtPw.js";import"./Users.es-CZggLr1m.js";import"./productionOrder-IOxpw38a.js";import"./scheduledPosts-ChXUqWkM.js";import"./PostCalendarPage-B9VW1rlv.js";import"./history-CQXQpNXw.js";import"./useProgressiveImageSource-CrIWUb3O.js";import"./directions-DxJo97Ho.js";import"./button-Bt8F5TkE.js";import"./extrairProdutoPrincipal-DiA7rESH.js";import"./runTemplateShot-DXBX0_Iy.js";import"./brandDnaToCampaignDna-Dm6109r0.js";import"./generationHistory-D4RTxXIf.js";import"./sceneCovers-B-dE7_Ce.js";import"./store-CVXWfzEM.js";import"./vibeMoodboard-C59Lv_0t.js";import"./entries-DM0IuApj.js";import"./catalog-CkHlpXUG.js";import"./types-YVLQw7aQ.js";import"./CastingTagPill-Dxy3OzJ5.js";import"./User.es-DVlkNLFL.js";import"./seasonalCalendar-CyVTeHw6.js";import"./StructuredPromptEditor-Bagkb6hO.js";import"./CampaignWizardModal-5H-1ksX3.js";import"./TrendUp.es-DExjYOFc.js";import"./seasonalDateDetection-D803in5N.js";import"./saveImages-BpUrLvEr.js";import"./cmoGenerationContext-Bbeq5hi5.js";import"./studioVisualLayout-BybetI-G.js";import"./UserBubble-CxEIzIZr.js";import"./AgentMessage-DoKOMvAj.js";import"./ChatInput-AHNVbRXo.js";import"./TypingIndicator-Cu4NOV3A.js";import"./useCampaigns-Bxox62wz.js";import"./antiStock-CfefI4TX.js";import"./types-BznGRwnk.js";import"./useGenerationCreditCost-DQbGS72G.js";import"./ArrowDown.es-BZtv_81U.js";import"./CheckCircle.es-PkF6a2W-.js";import"./DotsSixVertical.es-CqAy0LdQ.js";import"./sheet-CL9mA1Sp.js";import"./textarea-DQFi_3KT.js";import"./popover-DZzanWxt.js";import"./CastingLibraryModal-CIcCfYb6.js";import"./BrandCastingPage-BDc-XNLq.js";import"./snewProductAssets-D38QQN9v.js";import"./socialAdTextEngine-CXTvyP59.js";
1import"./MegaphoneSimple.es-Cci_hVqJ.js";import"./search-BKf_V4_4.js";import"./studioTemplates-ClvTjmU4.js";import"./sceneMeta-DmZMZluj.js";import"./styleGroups-B2OGYl0a.js";import"./CastPickerPopover-DyZqYUSW.js";import"./wfTheme-DA7tTXEm.js";import"./loadRecommendationContext-eK4jCmh4.js";import"./quickActions-Bt6kGa-B.js";import"./recipes-CtHnj9D9.js";import"./sanitized-commercial-metrics-Ctrrpq63.js";import"./Drop.es-D__tlA2W.js";import"./templateBuilders-Du1JTprS.js";import"./BoardTemplatesModal-BzENejTn.js";import"./poseTypes-Bm7PS-WL.js";import"./useStyleTemplates-UDp5QxX4.js";import"./registry-CbzeBfza.js";import"./PendingAssetEditPill-C0aOcQeN.js";import"./promptBox-D9Xxfn9U.js";import"./skeleton-CthpmC5T.js";import"./proxy-DT8nbzDk.js";import"./Globe.es-5iBT42E4.js";import"./Target.es-Ds7XP-fd.js";import"./WarningCircle.es-CHfqKWRY.js";import"./hydrateStoreContext-CnRDd9GD.js";import"./Warning.es-rGCmkxYb.js";import"./storage-DW2oS9tH.js";import"./cmoProductBrief-DbAqRIdr.js";import"./badge-C4DB55EV.js";function jt(d,i){const t=d.fidelity,f=[`PRODUCT TRUTH — the product in frame is "${i}" exactly as it appears in the reference image.`,"Reproduce its geometry, proportions, colours, material, closure and every printed detail exactly as referenced.","Never invent a flavour, variant, claim, cap, applicator, ingredient or packaging surface.",St[t.labelPolicy]];return t.executionMode==="locked_product_composite"?(f.length=0,f.push("PRODUCT — this frame is an EMPTY SET. Do not render the product, and do not render any package, bottle, jar, box, tube, bag, shoe or branded object anywhere in the image.","Leave the designated resting area clear and unobstructed: an empty surface, lit and ready, with nothing standing on it.","The product will be placed into this frame afterwards as a separate layer — anything you draw in its place will be covered or will duplicate it.")):t.executionMode==="masked_controlled_edit"?f.push("EXECUTION — the product region is protected. Geometry and label stay exactly as referenced; edits are bounded to environment, wardrobe, props and lighting around it."):f.push("EXECUTION — the scene is generated around the attached product reference. The reference governs every packaging detail; nothing about the package may be re-authored."),t.risk!=="low"&&t.riskReason&&f.push(`FIDELITY RISK — ${t.riskReason}. Resolve this in favour of the packaging.`),f.join(" ")}function Mt(d){const i=d.humanPresence;if(i.kind==="none")return"PEOPLE — no person, no hand, no body part anywhere in frame.";if(i.kind==="hands")return"PEOPLE — cropped hands only. No face, no shoulders, no torso. Anatomy must be plausible: five fingers, natural joints, real contact pressure where skin meets the product.";const t=Me(i.castingReferenceId);if(d.composition.headInFrame===!1)return["PEOPLE — one adult in frame, cropped so that the head and face are entirely outside the image.",`Only the body below the crop line exists in this photograph: ${(t==null?void 0:t.skinToneEcho)??"consistent skin tone"}, natural build.`,"Do not render a head, a face, a neck or a chin anywhere in the frame, and do not compress the body to fit one in."].join(" ");const f=t!=null&&t.identityBlock?` ${t.identityBlock}`:"",y=i.kind==="face"?"The face is in frame and must stay consistent with the identity reference.":"The body is in frame cropped above the face; identity still follows the reference for skin tone, build and hair.";return`PEOPLE — one adult in frame.${f} ${y}`}function Pt(d){const i=d.wardrobe;return i.applies?[`WARDROBE — ${i.coverage}`,`Main: ${i.mainGarment}. Upper: ${i.companionGarment}. Lower body: ${i.lowerBody}. Footwear: ${i.footwear}. Accessories: ${i.accessories}.`,i.tonalRule,`Never: ${i.avoid.join("; ")}.`].join(" "):null}function Tt(d){return d.props.length?`PROPS — ${d.props.map(t=>t.description).join(" ")} Nothing else shares the frame: no additional object may be added for decoration, mood or balance.`:null}function Lt(d){const{primary:i,secondary:t,contrast:f,adaptationRule:y}=d.palette;if(!i)return null;const l=[`PALETTE — dominant ${i}`];
1return t&&l.push(`support ${t}`),f&&l.push(`accent ${f}`),`${l.join(", ")}. ${y}`}function Nt(d,i){const t=d.sceneBrief,f=[jt(t,i),`SCENE — ${t.directive} The product reads as ${t.product.role.replace(/_/g," ")}, ${t.product.prominence.replace(/_/g," ")} in the frame. ${t.product.interaction}. Placement: ${t.product.placement}.`,`COMPOSITION — ${t.composition.crop}. Camera: ${t.composition.cameraAngle}. Depth: ${t.composition.depthStrategy}.${t.composition.foregroundBehavior?` Foreground: ${t.composition.foregroundBehavior}.`:""}${t.composition.negativeSpace?` Negative space: ${t.composition.negativeSpace}.`:""}`,`ENVIRONMENT — ${t.environment.setting}. Surfaces: ${t.environment.surfaces.join("; ")}. Background: ${t.environment.backgroundBehavior}.`,`LIGHT — ${t.lighting.direction}. ${t.lighting.quality}. Contrast: ${t.lighting.contrast}. Guardrails: ${t.lighting.exposureGuardrails.join("; ")}.`,`ACTION — ${t.action.gesture}. Energy: ${t.action.energy}.${t.action.motionBehavior?` Motion: ${t.action.motionBehavior}.`:""}`,Tt(t),Mt(t),Pt(t),Lt(t),`FORMAT — composed for ${d.format}, framed for this ratio rather than cropped from a wider frame.`,t.avoid.length?`AVOID — ${[...t.avoid,...t.fidelity.executionMode==="locked_product_composite"?["any product, package or branded object of any kind in frame","any object standing on the resting area"]:[]].join("; ")}.`:null];return pt(f.filter(Boolean).join(`
2
3`))}const _t="CAMPAIGN CONTINUITY REFERENCE: one of the attached images is another photograph from this same campaign. Match it on WORLD ONLY — the same environment and surfaces, the same light direction and quality, the same colour grade, the same photographic finish and grain. Do NOT copy its crop, its camera angle, its gesture, its product placement, its human presence or its props: this frame is a different shot of the same campaign, never a variation of the same picture.";function Bt(d){var x,I,C;const{piece:i,productImageUrl:t,productName:f,continuityRefUrl:y}=d,l=i.sceneBrief,j=l.humanPresence,m=j.kind==="body_crop"||j.kind==="face"?j.castingReferenceId:void 0,$=l.composition.headInFrame===!1,S=m&&!$?((x=Me(m))==null?void 0:x.referenceImageUrl)??void 0:void 0,A=S||y?"nanobanana":"gpt-image-2";let M=Nt(i,f);return y&&(M=`${M}
4
5${_t}`),S&&(M=`${M}
6
7${ut}`),{pieceId:i.id,role:i.role,motionIntent:(I=i.videoContinuation)==null?void 0:I.intent,motionEventAppetite:(C=i.videoContinuation)==null?void 0:C.eventAppetite,aspectRatio:i.format,prompt:M,provider:A,model:A==="nanobanana"?"google/gemini-2.5-flash-image":"gpt-image-2",sourceImageUrl:t,identityRefUrl:S,continuityRefUrl:y,executionMode:l.fidelity.executionMode,risk:l.fidelity.risk,locked:l.fidelity.executionMode==="locked_product_composite"?{placement:Ze(l)}:void 0,provenance:{renderAnchorId:l.provenance.renderAnchorId,compositionMode:l.provenance.compositionMode,castingReferenceId:m}}}const le={style:{label:"Preset",color:"#8B6FE6"},persona:{label:"Casting",color:"#E67F4A"},product:{label:"Produto",color:"#1A1A1A"},scene:{label:"Cena",color:"#4A8FE6"}},Ot=["style","persona","product","scene"];function Ce(d){return d==="product"?Pe().map(i=>({id:i.product_id,label:i.name,thumb:i.image})):d==="style"?ft.filter(i=>Se(i.id)).map(i=>{var t;return{id:i.id,label:i.name,thumb:$e(i.id)||i.thumbnailUrl||((t=i.hoverImages)==null?void 0:t[0])}}):d==="scene"?gt.filter(i=>Se(i.id)).map(i=>({id:i.id,label:i.name,thumb:$e(i.id)})):bt.map(i=>({id:i.id,label:i.name,thumb:At(i.id)||i.referenceImageUrl||void 0}))}const J=56,ie=16,Ut=280,Dt=210,ae={id:"format",default:"1:1",isAspectRatio:!0,options:Et.map(d=>({id:d.id,label:d.label}))};function Ft(){return`b5n-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`}function ke(){const d=window.__boardViewport;return d?{x:d.x,y:d.y,scale:d.scale}:{x:0,y:0,scale:1}}function se(){var i;const d=(i=window.__getBoardAssetsSnapshot)==null?void 0:i.call(window);return Array.isArray(d)?d:[]}const zt=({node:d,selected:i,scale:t,onSelect:f,onReplace:y,onDrag:l,scaleRef:j})=>{const[m,$]=c.useState(!1),[S,A]=c.useState(!1),M=le[d.kind],x=I=>
7{if(I.button!==0)return;I.stopPropagation(),I.preventDefault(),f(d.id);const C={mx:I.clientX,my:I.clientY,x:d.x,y:d.y};$(!0);const P=B=>{const E=j.current||1;l(d.id,C.x+(B.clientX-C.mx)/E,C.y+(B.clientY-C.my)/E)},_=()=>{$(!1),window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",P),window.addEventListener("mouseup",_)};return s.jsxs("div",{"data-node-id":d.id,"data-selected":i?"true":void 0,className:i?"is-selected":void 0,onMouseDown:x,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),onWheel:I=>I.stopPropagation(),style:{position:"absolute",left:d.x,top:d.y,width:d.w,height:d.h,pointerEvents:"auto",cursor:m?"grabbing":"grab",userSelect:"none"},children:[s.jsx("div",{style:{width:"100%",height:"100%",background:`hsl(${v.bg.secondary})`,border:i?"2px solid hsl(var(--board-selection))":U.default,borderRadius:N.boardCard,boxShadow:m||i?F.floatRaised:F.floatSoft,overflow:"hidden",boxSizing:"border-box",transition:`box-shadow ${Q.fast}`},children:d.thumb?s.jsx("img",{src:d.thumb,alt:d.label,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):s.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:`hsl(${v.text.tertiary})`,fontSize:13},children:M.label})}),s.jsx("button",{type:"button","aria-label":"Substituir item",title:"Substituir item",onMouseDown:I=>{I.preventDefault(),I.stopPropagation()},onClick:I=>{I.stopPropagation(),y(d)},style:{position:"absolute",top:12/Math.max(.1,t),right:12/Math.max(.1,t),width:36,height:36,transform:`scale(${1/Math.max(.1,t)})`,transformOrigin:"top right",borderRadius:N.pill,border:U.default,background:`hsl(${v.bg.primary} / 0.94)`,color:`hsl(${v.text.secondary})`,display:"grid",placeItems:"center",boxShadow:F.chip,cursor:"pointer",opacity:S?1:0,pointerEvents:S?"auto":"none",transition:`opacity ${Q.fast}`,zIndex:3},children:s.jsx(je,{size:16,weight:"regular"})})]})},Yt=()=>{const d=Re(),[i,t]=c.useState(ke),[f,y]=c.useState(se),[l,j]=c.useState([]),[m,$]=c.useState(null),[S,A]=c.useState(null),[M,x]=c.useState([]),I=c.useRef([]),[C,P]=c.useState(""),[_,B]=c.useState(null),[E,W]=c.useState(null),D=c.useRef(null),[de,Z]=c.useState([]),[ce,Te]=c.useState({}),[Le,ee]=c.useState([]),[te,Ne]=c.useState({}),[q,O]=c.useState({}),pe=c.useRef(i.scale);pe.current=i.scale;const ue=c.useRef(l);ue.current=l;const oe=c.useRef(f);oe.current=f;const G=c.useRef(null);c.useEffect(()=>{const e=()=>t(ke()),o=()=>{var T;const n=se();y(n);const a=G.current;if(!a)return;if(Date.now()>a.until){G.current=null;return}const u=n.filter(g=>!a.known.has(g.id)&&!!g.label&&a.labels.has(g.label));if(!u.length)return;const p=ue.current.find(g=>g.id===a.anchorId),k=p?{x:p.x,y:p.y,w:p.w,h:p.h}:a.anchor;Z(g=>g.filter(h=>h!==a.rootAssetId)),u.forEach(g=>{if(!a.want.has(g.id)){const h=a.want.size;a.want.set(g.id,{x:k.x+k.w+J,y:k.y+h*(k.h+ie),tries:12})}});for(const[g,h]of[...a.want.entries()]){const R=n.find(z=>z.id===g);if(R){if(Math.abs(R.x-h.x)<1&&Math.abs(R.y-h.y)<1){a.want.delete(g);continue}if(h.tries<=0){a.want.delete(g);continue}h.tries-=1,(T=window.__patchBoardAsset)==null||T.call(window,g,{x:h.x,y:h.y})}}const b=new Set(n.map(g=>g.id));ee(g=>{const h=g.filter(w=>w.anchorId!==a.anchorId||b.has(w.assetId)),R=new Set(h.filter(w=>w.anchorId===a.anchorId).map(w=>w.assetId)),z=u.filter(w=>!R.has(w.id)).map(w=>({anchorId:a.anchorId,assetId:w.id}));return z.length?[...h,...z]:h})};window.addEventListener("snew:board-viewport",e),window.addEventListener("snew:board-assets",o);const r=window.setTimeout(()=>{e(),o()},400);return()=>{window.removeEventListener("snew:board-viewport",e),window.removeEventListener("snew:board-assets",o),window.clearTimeout(r)}},[]),c.useEffect(()=>{const e=new Set(f.map(o=>o.id));j(o=>o.filter(r=>e.has(r.rootAssetId))),ee(o=>o.filter(r=>{var n;return e.has(r.assetId)||((n=G.current)==null?void 0:n.anchorId)===r.anchorId}))},[f]),c.useEffect(()=>{ee(e=>e.filter(o=>l.some(r=>r.id===o.anchorId))),Z(e=>e.filter(o=>l.some(r=>r.rootAssetId===o))),S&&!l.some(e=>e.id===S)&&A(null)},[l,S]),c.useEffect(()=>{window.__getAttachedBoardNodes=e=>l.filter(o=>o.rootAssetId===e).map(o=>({kind:o.kind,refId:o.refId,label:o.label,thumb:o.thumb}));try{window.dispatchEvent(new CustomEvent("board-nodes-changed"))}catch{}return()=>{try{delete window.__getAttachedBoardNodes}catch{}}},[l]),c.useEffect(()=>{const e=o=>{const r=o.target,n=r==null?void 0:r.closest("[data-asset-id], [data-node-id]"),a=(n==null?void 0:n.dataset.assetId)??(n==null?void 0:n.dataset.nodeId)??null;if(D.current!==null&&(window.clearTimeout(D.current),D.current=null),a){B(a);return}r!=null&&r.closest("[data-b5-plus], [data-b5-popover]")||(D.current=window.setTimeout(()=>{B(null),D.current=null},90))};return document.addEventListener("pointermove",e,{passive:!0}),()=>{document.removeEventListener("pointermove",e),D.current!==null&&window.clearTimeout(D.current)}},[]),c.useEffect(()=>{const e=r=>{const{additive:n}=r.detail??{};I.current=n?Array.from(new Set([...M,...S?[S]:[]])):[],n||(A(null),x([]))},o=r=>{const n=r.detail;if(!n)return;const a=l.filter(p=>p.x<n.x+n.w&&p.x+p.w>n.x&&p.y<n.y+n.h&&p.y+p.h>n.y).map(p=>
7p.id),u=Array.from(new Set([...I.current,...a]));x(u),A(u.length===1?u[0]:null)};return window.addEventListener("board5:marquee-start",e),window.addEventListener("board5:marquee",o),()=>{window.removeEventListener("board5:marquee-start",e),window.removeEventListener("board5:marquee",o)}},[l,S,M]),c.useEffect(()=>{const e=o=>{var n;(n=o.detail)!=null&&n.assetId&&(A(null),x([]))};return window.addEventListener("board-selection-change",e),()=>window.removeEventListener("board-selection-change",e)},[]),c.useEffect(()=>{const e=o=>{const r=o.target,n=(r==null?void 0:r.closest("[data-b5-popover]"))||(r==null?void 0:r.closest("[data-b5-plus]")),a=(r==null?void 0:r.closest("[data-node-id]"))||(r==null?void 0:r.closest("[data-b5-toolbar]"));n||$(u=>u&&null),!n&&!a&&(A(u=>u&&null),x([]))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const _e=c.useMemo(()=>f.filter(e=>e.width>0&&!!e.imageUrl&&e.type==="image"&&!e.isPlaceholder),[f]),me=c.useCallback(e=>{const o=f.find(n=>n.id===e);if(o)return{x:o.x,y:o.y,w:o.width,h:o.height};const r=l.find(n=>n.id===e);return r?{x:r.x,y:r.y,w:r.w,h:r.h}:null},[f,l]),re=c.useCallback(async e=>{const o=Pe(),r=o.find(u=>u.image&&u.image===e.imageUrl)??o.find(u=>u.name&&u.name===(e.label??"").trim()),n=(r==null?void 0:r.product_id)??e.id,a=at({catalogName:(r==null?void 0:r.name)??null,label:e.label??null})??"este produto";O(u=>({...u,[e.id]:{status:"planning",stage:"reading_product",proposal:null,productName:a}}));try{const{proposal:u,notes:p}=await $t({productId:n,productName:a,imageUrl:e.imageUrl??null,collectionId:e.id,onStage:k=>O(b=>b[e.id]?{...b,[e.id]:{...b[e.id],stage:k}}:b)});console.log("[campaign-proposal]",JSON.stringify({assetId:e.id,notes:p})),O(k=>({...k,[e.id]:{status:"ready_for_approval",stage:"checking_fidelity",proposal:u,productName:a}}))}catch(u){console.warn("[campaign-proposal] falhou:",u),O(p=>({...p,[e.id]:{...p[e.id],status:"needs_attention"}}))}},[]),Be=c.useCallback(async e=>{var g;const o=q[e],r=oe.current.find(h=>h.id===e);if(!(o!=null&&o.proposal)||!(r!=null&&r.imageUrl))return;const n=r.imageUrl;O(h=>({...h,[e]:{...h[e],status:"generating"}}));const a=(h,R)=>new Promise(z=>{const w=Bt({piece:h,productImageUrl:n,productName:o.productName,continuityRefUrl:R});let ve=!1;const xe=ne=>{ve||(ve=!0,window.removeEventListener("board-composed-shot-done",Ie),clearTimeout(Ge),z(ne))},Ie=ne=>{const Ee=ne.detail??{};Ee.pieceId===h.id&&xe(Ee.imageUrl??null)},Ge=setTimeout(()=>xe(null),5*60*1e3);window.addEventListener("board-composed-shot-done",Ie),window.dispatchEvent(new CustomEvent("board-composed-shot-run",{detail:{pieceId:h.id,label:h.publicName,prompt:w.prompt,provider:w.provider,aspectRatio:w.aspectRatio,sourceImageUrl:w.sourceImageUrl,identityRefUrl:w.identityRefUrl,continuityRefUrl:w.continuityRefUrl,anchorSceneId:w.provenance.renderAnchorId,castMemberId:w.provenance.castingReferenceId,locked:w.locked,plannedPiece:h,brandInterpretation:o.proposal.brandInterpretation??null,motionIntent:w.motionIntent,motionEventAppetite:w.motionEventAppetite}}))}),[u,...p]=o.proposal.pieces,k=await a(u),b=await Promise.all(p.map(h=>a(h))),T=[{piece:u,imageUrl:k},...p.map((h,R)=>({piece:h,imageUrl:b[R]}))].filter(h=>!!h.imageUrl);if(T.length)try{const h=await kt({produced:T,sourceImageUrl:n,dominantColor:((g=o.proposal.pieces[0])==null?void 0:g.sceneBrief.palette.primary)||void 0,interpretation:o.proposal.brandInterpretation??null});console.log("[campaign-qa]",JSON.stringify({assetId:e,notes:h.notes})),O(R=>R[e]?{...R,[e]:{...R[e],qa:h}}:R)}catch(h){console.warn("[campaign-qa] falhou:",h)}},[q]);c.useEffect(()=>{const e=o=>{const r=o.detail??{};!r.pieceId||!r.assetId||Ne(n=>({...n,[r.pieceId]:r.assetId}))};return window.addEventListener("board-composed-shot-done",e),()=>window.removeEventListener("board-composed-shot-done",e)},[]),c.useEffect(()=>{O(e=>{let o=!1;const r={...e};for(const[n,a]of Object.entries(e))a.status!=="generating"||!a.proposal||!a.proposal.pieces.every(p=>te[p.id])||(r[n]={...a,status:"completed"},o=!0);return o?r:e})},[te]),c.useEffect(()=>{const e=window;e.__proposalNodeHost=(e.__proposalNodeHost??0)+1;const o=()=>
7{const r=e.__selectedBoardAssetId??null,n=oe.current.find(a=>a.id===r);n&&re(n)};return window.addEventListener("board4:open-batch-proposal",o),()=>{window.removeEventListener("board4:open-batch-proposal",o),e.__proposalNodeHost=Math.max(0,(e.__proposalNodeHost??1)-1)}},[re]);const Oe=(e,o)=>{const r=me(e);r&&(P(""),$({sourceId:e,rootAssetId:o,x:r.x+r.w+56/Math.max(.1,i.scale||1),y:r.y,level:null}))},Ue=e=>{if(!m||!m.level)return;if(m.replaceNodeId){const b=m.level;j(T=>T.map(g=>g.id===m.replaceNodeId?{...g,kind:b,refId:e.id,label:e.label,thumb:e.thumb}:g)),$(null);return}const o=me(m.sourceId);if(!o)return;const r=f.find(b=>b.id===m.rootAssetId),n=(r==null?void 0:r.width)??Ut,a=(r==null?void 0:r.height)??Dt,u=l.filter(b=>b.sourceId===m.sourceId).length,p={id:Ft(),kind:m.level,refId:e.id,label:e.label,thumb:e.thumb,x:o.x+o.w+J,y:o.y+u*(a+ie),w:n,h:a,sourceId:m.sourceId,rootAssetId:m.rootAssetId};j(b=>[...b,p]);const k=m.rootAssetId;Z(b=>b.includes(k)?b:[...b,k]),P(""),B(p.id),$(null)},De=c.useCallback((e,o,r)=>{j(n=>n.map(a=>a.id===e?{...a,x:o,y:r}:a))},[]),Fe=e=>{j(o=>{const r=new Set([e]);let n=!0;for(;n;){n=!1;for(const a of o)!r.has(a.id)&&r.has(a.sourceId)&&(r.add(a.id),n=!0)}return o.filter(a=>!r.has(a.id))})},ze=e=>{const o=e.rootAssetId,r=l.filter(T=>T.rootAssetId===o),n=T=>r.find(g=>g.kind===T),a=n("scene"),u=n("persona"),p=n("style"),k=ce[o]??ae.default,b=[a==null?void 0:a.label,p==null?void 0:p.label,e.label].filter(Boolean);G.current={anchorId:e.id,anchor:{x:e.x,y:e.y,w:e.w,h:e.h},rootAssetId:o,known:new Set(se().map(T=>T.id)),labels:new Set(b),want:new Map,until:Date.now()+12e4},a?window.dispatchEvent(new CustomEvent("board-catalog-scene-run",{detail:{assetId:o,sceneId:a.refId,label:a.label,castMemberId:u==null?void 0:u.refId,aspectRatio:k}})):window.dispatchEvent(new CustomEvent("board-node-generate",{detail:{assetId:o,styleId:p==null?void 0:p.refId,castMemberId:u==null?void 0:u.refId,label:p==null?void 0:p.label,aspectRatio:k}})),ht.success("Enviado para geração")},Y={onMouseDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation()},Ye=c.useMemo(()=>{const e=new Map;for(const o of l){const r=e.get(o.sourceId)??[];r.push(o.id),e.set(o.sourceId,r)}return e},[l]),he=c.useMemo(()=>de.map(e=>{const o=l.filter(n=>n.rootAssetId===e);if(!o.length)return null;const r=o.reduce((n,a)=>a.x>n.x||a.x===n.x&&a.y>n.y?a:n);return{id:`b5out-${e}`,rootAssetId:e,sourceId:r.id,x:r.x+r.w+J,y:r.y,w:r.w,h:r.h}}).filter(Boolean),[de,l]),[V,Xe]=c.useState({}),X=c.useRef(null),He=c.useCallback(e=>o=>{if(o.target.closest("button,a,input,textarea"))return;o.preventDefault();const r=V[e]??{dx:0,dy:0};X.current={id:e,startX:o.clientX,startY:o.clientY,baseX:r.dx,baseY:r.dy},o.currentTarget.setPointerCapture(o.pointerId)},[V]),We=c.useCallback(e=>{const o=X.current;if(!o)return;const r=o.baseX+(e.clientX-o.startX)/i.scale,n=o.baseY+(e.clientY-o.startY)/i.scale;Xe(a=>({...a,[o.id]:{dx:r,dy:n}}))},[i.scale]),fe=c.useCallback(e=>{X.current&&(X.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},[]),ge=c.useMemo(()=>Object.entries(q).map(([e,o])=>{const r=f.find(p=>p.id===e);if(!r||o.status==="dismissed")return null;const n=l.filter(p=>p.rootAssetId===e),a=n.length?Math.max(...n.map(p=>p.y+p.h))+ie:r.y,u=V[`b5prop-${e}`]??{dx:0,dy:0};return{id:`b5prop-${e}`,assetId:e,x:r.x+r.width+J+u.dx,y:a+u.dy,state:o}}).filter(Boolean),[q,f,l,V]),be=72,we=e=>{const o=(be-i.y)/i.scale;return Math.min(Math.max(e.y+4,o),e.y+e.h-40)},qe=e=>i.y+we(e)*i.scale>=be-8,ye=(e,o,r)=>qe(r)?s.jsx("button",{type:"button","data-b5-plus":"true","aria-label":"Conectar",onPointerDown:n=>{n.preventDefault(),n.stopPropagation();const a=n.currentTarget.getBoundingClientRect();n.currentTarget.setPointerCapture(n.pointerId),W({sourceId:e,rootAssetId:o,startX:a.left+a.width/2,startY:a.top+a.height/2,x:n.clientX,y:n.clientY})},onPointerMove:n=>{!E||E.sourceId!==e||W(a=>a?{...a,x:n.clientX,y:n.clientY}:null)},onPointerUp:n=>{!E||E.sourceId!==e||(n.currentTarget.releasePointerCapture(n.pointerId),W(null),Oe(e,o))},onPointerCancel:()=>W(null),onMouseEnter:()=>B(e),onMouseLeave:()=>B(n=>n===e?null:n),...Y,style:{position:"absolute",left:r.x+r.w+10/Math.max(.1,i.scale||1),top:we(r),width:36,height:36,borderRadius:N.pill,border:U.default,background:`hsl(${v.bg.primary})`,color:`hsl(${v.text.secondary})`,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",pointerEvents:"auto",boxShadow:F.chip,opacity:_===e||(m==null?void 0:m.sourceId)===e?1:0,transition:`color ${Q.fast}, opacity ${Q.fast}`,padding:0,transform:`scale(${(E==null?void 0:E.sourceId)===e?1.16/Math.max(.1,i.scale||1):1/Math.max(.1,i.scale||1)})`,transformOrigin:"top left"},children:s.jsx(wt,{size:16,weight:"regular"})},`plus-${e}`):null;return s.jsxs("div",{"data-canvas-root":!0,style:{position:"absolute",inset:0,zIndex:41,pointerEvents:"none"},children:[E&&s.jsx("svg",{"aria-hidden":!0,style:{position:"fixed",inset:0,width:"100vw",height:"100vh",overflow:"visible",pointerEvents:"none",zIndex:100},children:s.jsx("path",{d:`M ${E.startX} ${E.startY} C ${E.startX+70} ${E.startY}, ${E.x-70} ${E.y}, ${E.x} ${E.y}
7`,fill:"none",stroke:"hsl(var(--board-product-connection))",strokeWidth:"2",strokeLinecap:"round"})}),[...Ye.entries()].map(([e,o])=>s.jsx(H,{centerId:e,nodeIds:o},e)),he.map(e=>s.jsx(H,{centerId:e.sourceId,nodeIds:[e.id]},e.id)),Le.map(e=>s.jsx(H,{centerId:e.anchorId,nodeIds:[e.assetId]},`gen-${e.anchorId}-${e.assetId}`)),ge.map(e=>s.jsxs(K.Fragment,{children:[s.jsx(H,{centerId:e.assetId,nodeIds:[e.id]}),e.state.proposal&&s.jsx(H,{centerId:e.id,nodeIds:e.state.proposal.pieces.map(o=>te[o.id]).filter(Boolean)})]},`prop-edge-${e.id}`)),s.jsxs("div",{style:{position:"absolute",top:0,left:0,transform:`translate(${i.x}px, ${i.y}px) scale(${i.scale})`,transformOrigin:"0 0"},children:[_e.map(e=>{const o={x:e.x,y:e.y,w:e.width,h:e.height};return s.jsx(K.Fragment,{children:ye(e.id,e.id,o)},`edge-${e.id}`)}),ge.map(e=>{var o;return s.jsx(K.Fragment,{children:s.jsx("div",{"data-node-id":e.id,...Y,onPointerDown:He(e.id),onPointerMove:We,onPointerUp:fe,onPointerCancel:fe,style:{position:"absolute",left:e.x,top:e.y,pointerEvents:"auto",cursor:((o=X.current)==null?void 0:o.id)===e.id?"grabbing":"grab",userSelect:"none"},children:s.jsx(Ct,{status:e.state.status,stage:e.state.stage,proposal:e.state.proposal,qa:e.state.qa??null,onApprove:()=>void Be(e.assetId),onAdjust:()=>{const r=f.find(n=>n.id===e.assetId);r&&re(r)},onDismiss:()=>O(r=>{const n={...r};return delete n[e.assetId],n}),onTeach:()=>d(`/brand/dna?teach=${encodeURIComponent(e.assetId)}`),onCalibrateBrand:()=>d("/brand/dna")})})},e.id)}),he.map(e=>{const o=e.rootAssetId,r=ce[o]??ae.default;return s.jsxs("div",{"data-node-id":e.id,...Y,style:{position:"absolute",left:e.x,top:e.y,width:e.w,height:e.h,border:`1px dashed hsl(${v.border.secondary})`,borderRadius:N.boardCard,background:`hsl(${v.bg.secondary} / 0.35)`,boxSizing:"border-box",pointerEvents:"auto"},children:[s.jsx("div",{style:{position:"absolute",left:0,right:0,top:"38%",textAlign:"center",fontSize:12,color:`hsl(${v.text.tertiary})`,pointerEvents:"none"},children:"Output will appear here"}),s.jsxs("div",{style:{position:"absolute",left:"50%",bottom:14,transform:`translateX(-50%) scale(${1/(i.scale||1)})`,transformOrigin:"bottom center",display:"flex",alignItems:"center",gap:L[2]},children:[s.jsx(It,{pill:ae,value:r,onChange:n=>Te(a=>({...a,[o]:n}))}),s.jsx("button",{className:"snew-main-action",type:"button",onClick:()=>{const n=l.find(a=>a.id===e.sourceId);n&&ze(n)},style:{height:30,padding:`0 ${L[4]}`,borderRadius:N.pill,border:"none",fontSize:12,fontWeight:500,fontFamily:"inherit",cursor:"pointer",boxShadow:F.chip,whiteSpace:"nowrap"},children:"Gerar"})]})]},e.id)}),l.map(e=>s.jsxs(K.Fragment,{children:[s.jsx(zt,{node:e,selected:S===e.id||M.includes(e.id),scale:i.scale,onSelect:o=>{x([]),A(o),window.dispatchEvent(new CustomEvent("board5:node-selection",{detail:{nodeId:o}}))},onReplace:o=>{P(""),$({sourceId:o.sourceId,rootAssetId:o.rootAssetId,x:o.x+o.w+56/Math.max(.1,i.scale||1),y:o.y,level:o.kind,replaceNodeId:o.id})},onDrag:De,scaleRef:pe}),ye(e.id,e.rootAssetId,{x:e.x,y:e.y,w:e.w,h:e.h})]},e.id)),(()=>{const e=l.find(o=>o.id===S);return e?s.jsx("div",{"data-b5-toolbar":"true",...Y,style:{position:"absolute",left:e.x+e.w/2,top:e.y-12/Math.max(.1,i.scale||1),transform:`translate(-50%, -100%) scale(${1/(i.scale||1)})`,transformOrigin:"bottom center",pointerEvents:"auto",zIndex:100},children:s.jsxs(vt,{size:"md",children:[s.jsx(Ae,{icon:s.jsx(je,{size:18,weight:"light"}),label:"Substituir item",onClick:()=>$({sourceId:e.sourceId,rootAssetId:e.rootAssetId,x:e.x+e.w+56/Math.max(.1,i.scale||1),y:e.y,level:e.kind,replaceNodeId:e.id})}),s.jsx(xt,{}),s.jsx(Ae,{icon:s.jsx(yt,{size:18,weight:"light"}),label:"Remover",onClick:()=>Fe(e.id)})]})}):null})(),m&&s.jsxs("div",{"data-b5-popover":"true",...Y,style:{position:"absolute",left:m.x,top:m.y,width:138,background:`hsl(${v.bg.primary})`,border:U.default,borderRadius:N.lg,boxShadow:F.floatRaised,pointerEvents:"auto",overflow:"visible",display:"flex",flexDirection:"column",transform:`scale(${1/Math.max(.1,i.scale||1)})`,transformOrigin:"top left"},children:[Ot.map(e=>s.jsxs("button",{type:"button",onClick:()=>{P(""),$(o=>o&&{...o,level:e})},onMouseEnter:()=>{m.level!==e&&P(""),$(o=>o&&{...o,level:e})},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:L[2],padding:`${L[2]} ${L[3]}`,border:"none",background:m.level===e?`hsl(${v.bg.secondary})`:"transparent",color:`hsl(${v.text.secondary}
7)`,fontSize:13,fontFamily:"inherit",cursor:"pointer",textAlign:"left"},children:[le[e].label,s.jsx(Ke,{size:12,color:`hsl(${v.text.tertiary})`})]},e)),m.level&&s.jsxs("div",{"data-b5-popover":"true",onMouseLeave:()=>$(e=>e&&{...e,level:null}),style:{position:"absolute",left:"calc(100% + 8px)",top:0,width:320,height:360,background:`hsl(${v.bg.primary})`,border:U.default,borderRadius:N.lg,boxShadow:F.floatRaised,overflow:"hidden",display:"flex",flexDirection:"column"},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",padding:`${L[2]} ${L[3]}`,borderBottom:U.hairline,color:`hsl(${v.text.primary})`,fontSize:12,fontWeight:500},children:le[m.level].label}),(m.level==="style"||m.level==="product")&&s.jsxs("div",{style:{position:"relative",padding:"10px 12px",borderBottom:U.hairline},children:[s.jsx(mt,{size:14,style:{position:"absolute",left:22,top:"50%",transform:"translateY(-50%)",color:`hsl(${v.text.tertiary})`,pointerEvents:"none"}}),s.jsx("input",{autoFocus:!0,value:C,onChange:e=>P(e.target.value),placeholder:m.level==="style"?"Buscar preset":"Buscar produto",style:{width:"100%",height:34,boxSizing:"border-box",padding:"0 12px 0 32px",border:U.hairline,borderRadius:N.md,background:`hsl(${v.bg.secondary})`,color:`hsl(${v.text.primary})`,fontSize:12,fontFamily:"inherit",outline:"none"}})]}),s.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:[Ce(m.level).filter(e=>!C.trim()||e.label.toLocaleLowerCase().includes(C.trim().toLocaleLowerCase())).map(e=>s.jsxs("button",{type:"button",onClick:()=>Ue(e),style:{display:"flex",alignItems:"center",gap:L[2],width:"100%",padding:`${L[1]} ${L[3]}`,border:"none",background:"transparent",color:`hsl(${v.text.secondary})`,fontSize:12,fontFamily:"inherit",cursor:"pointer",textAlign:"left"},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:N.sm,background:`hsl(${v.bg.secondary})`,overflow:"hidden",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e.thumb&&s.jsx("img",{src:e.thumb,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),!1]},e.id)),Ce(m.level).filter(e=>!C.trim()||e.label.toLocaleLowerCase().includes(C.trim().toLocaleLowerCase())).length===0&&s.jsx("div",{style:{padding:20,textAlign:"center",fontSize:12,color:`hsl(${v.text.tertiary})`},children:"Nenhum resultado"})]})]})]})]})]})};function Ii(){var C;const d=Re(),i=Ve(),t=i.state,f=(t==null?void 0:t.autoPrompt)??"",y=t==null?void 0:t.restoreItem,l=t!=null&&t.boardId?ot.find(P=>P.id===t.boardId):null,j=(t==null?void 0:t._ts)??i.key,m=t==null?void 0:t.workflowPreset,[$,S]=c.useState(!!m),[A,M]=c.useState("edicao"),x=c.useMemo(()=>tt(),[]),I={campaignTitle:(y==null?void 0:y.sessionTitle)??(x==null?void 0:x.name)??"",product:((C=x==null?void 0:x.productTypes)==null?void 0:C[0])??"",productImageUrl:(y==null?void 0:y.imageUrl)??"",copyText:"",selectedTone:(x==null?void 0:x.tone)??"",autoPrompt:f||"",restoreChatMessages:(y==null?void 0:y.chatMessages)??(t==null?void 0:t.restoreChatMessages),styleId:(t==null?void 0:t.styleId)??null,styleName:(t==null?void 0:t.styleName)??null,styleDesc:(t==null?void 0:t.styleDesc)??null,campaignType:(t==null?void 0:t.campaignType)??null,initialCategory:(t==null?void 0:t.initialCategory)??null,videoModel:(t==null?void 0:t.videoModel)??null,videoFormat:(t==null?void 0:t.videoFormat)??null,videoDuration:(t==null?void 0:t.videoDuration)??null,videoRefImage:(t==null?void 0:t.videoRefImage)??null,boardId:(l==null?void 0:l.id)??(t!=null&&t.blankBoard?"new":null),boardTitle:(l==null?void 0:l.title)??(t==null?void 0:t.boardTitle)??(t!=null&&t.blankBoard?Je:null),initialBoardAssets:t!=null&&t.initialBoardAssets&&Array.isArray(t.initialBoardAssets)&&t.initialBoardAssets.length>0?t.initialBoardAssets:l?(l.thumbnails??(l.coverUrl?[l.coverUrl]:[])).map((P,_)=>({id:`${l.id}-asset-${_}`,imageUrl:P,x:_%2*304,y:Math.floor(_/2)*234,width:280,height:210,label:l.title,type:"image",aspectRatio:"4:3"})):[],fromOnboarding:!!(t!=null&&t.fromOnboarding),previewMode:!!(t!=null&&t.previewMode),navTs:(t==null?void 0:t._ts)??null,format:(t==null?void 0:t.format)??null,templateThumb:(t==null?void 0:t.templateThumb)??null,templateVideoUrl:(t==null?void 0:t.templateVideoUrl)??null,structuredTemplate:(t==null?void 0:t.structuredTemplate)??null,presetTemplate:(t==null?void 0:t.presetTemplate)??null,cmoAction:(t==null?void 0:t.cmoAction)??null,openStudioAIForAssetId:(t==null?void 0:t.openStudioAIForAssetId)??null,openerBriefId:(t==null?void 0:t.openerBriefId)??null,entryContextLabel:(t==null?void 0:t.entryContextLabel)??null,openerIntroText:(t==null?void 0:t.openerIntroText)??null,openerSuggestionBrief:(t==null?void 0:t.openerSuggestionBrief)??null};return s.jsxs("div",{className:"board4-white-canvas",style:{width:"100vw",height:"100vh",overflow:"hidden",position:"fixed",inset:0},children:[s.jsxs("div",{style:{width:"100%",height:"100%",minWidth:0,minHeight:0,overflow:"hidden",position:"relative"},children:[s.jsx(et,{data:I,onClose:()=>d("/"),embedded:!0,initialBoardMode:!0,initialMode:(t==null?void 0:t.initialMode)??null,boardNamePillLeft:260,hideBottomBar:A==="cockpit",bottomBarMode:"board5"},j),A!=="cockpit"&&s.jsx(Yt,{}),m&&$&&s.jsx(rt,{preset:m,onClose:()=>S(!1)}),A==="cockpit"&&s.jsx(nt,{boardId:(l==null?void 0:l.id)??null}),s.jsx(st,{value:A,onChange:M})]}),A!=="cockpit"&&s.jsx(Rt,{}),s.jsx("div",{style:{position:"absolute",top:0,left:0,zIndex:50,pointerEvents:"auto"},children:s.jsx(Qe,{})}),s.jsx(it,{}),s.jsx(ct,{}),s.jsx(lt,{}),s.jsx(dt,{})]})}
7export{Ii 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.