1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="53845d7f-b68c-4cb0-a1ce-ae50ce90593a",e._sentryDebugIdIdentifier="sentry-dbid-53845d7f-b68c-4cb0-a1ce-ae50ce90593a")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75788],{9827:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},17936:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]])},24089:(e,r,t)=>{function a(e){let r=String(null!=e?e:"").trim();if(!r)return"";let t=[r.indexOf("?"),r.indexOf("#")].filter(e=>e>=0).reduce((e,r)=>Math.min(e,r),r.length);return r.slice(0,t)}function n(e,r){let t=a(e);return t.length>0&&t===a(r)}t.d(r,{s:()=>a,z:()=>n})},29892:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("dice-5",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]])},38680:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},48149:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]])},50947:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},51777:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},52415:(e,r,t)=>{t.d(r,{N:()=>d});var a=t(73365),n=t(1521),o=t(98196),i=t(84131),s=t(10738),l=t(24089),c=t(98378);function d(e){var r;let{items:t,onRemove:d,emptyMessage:m,disabled:b=!1,ariaLabel:p,previewable:h=!1,previewUrl:f,onPreviewUrlChange:g}=e,{t:y}
1=(0,s.s)(),[x,v]=(0,n.useState)(null),w=void 0===f?x:f,k=(0,n.useCallback)(e=>{void 0===f&&v(e),null==g||g(e)},[g,f]),j=(0,n.useCallback)(()=>k(null),[k]),N=(0,n.useRef)(null);(0,i.r)(N,h&&!!w,j),(0,n.useEffect)(()=>{if(!w)return;let e=t.find(e=>(0,l.z)(e.url,w));e?e.url!==w&&k(e.url):k(null)},[w,k,t]);let S=w&&null!=(r=t.find(e=>(0,l.z)(e.url,w)))?r:null;return 0===t.length?m?(0,a.jsx)("p",{className:"text-caption text-[--muted]",children:m}):null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"scrollbar-thin flex gap-sm overflow-x-auto pb-xs pe-xs pt-sm",role:"list","aria-label":null!=p?p:y("library.referenceImages.selected","Selected reference images"),children:t.map((e,r)=>(0,a.jsxs)("div",{className:"w-24 shrink-0",role:"listitem","data-reference-index":r,children:[(0,a.jsxs)("div",{className:"relative mx-auto h-20 w-20",children:[h?(0,a.jsx)("button",{type:"button",onClick:()=>k(e.url),className:"relative h-20 w-20 overflow-hidden rounded-md border bg-[--surface] motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand ".concat(e.inherited?"border-brand/50":"border-[--border] hover:border-[--border-hover]"),"aria-label":"".concat(y("viewer.continue.references.preview","Preview")," ").concat(e.provenance),"data-reference-preview":r,children:(0,a.jsx)(c.p,{src:e.url,alt:e.provenance,fill:!0,sizes:"80px",className:"object-cover",onRetry:e.onRetry})}):(0,a.jsx)("div",{className:"relative h-20 w-20 overflow-hidden rounded-md border bg-[--surface] ".concat(e.inherited?"border-brand/50":"border-[--border]"),children:(0,a.jsx)(c.p,{src:e.url,alt:e.provenance,fill:!0,sizes:"80px",className:"object-cover",onRetry:e.onRetry})}),(0,a.jsx)("button",{type:"button",onClick:()=>d(r),disabled:b,className:"group absolute -end-sm -top-sm flex min-h-11 min-w-11 items-center justify-center rounded-pill focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white disabled:opacity-50","aria-label":"".concat(y("common.remove","Remove")," ").concat(e.provenance),"data-reference-remove":r,children:(0,a.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-pill bg-red-500/90 shadow-e-sm motion-safe:transition-colors group-hover:bg-red-500 group-focus-visible:bg-red-500",children:(0,a.jsx)(u,{className:"h-3.5 w-3.5 text-white"})})})]}),(0,a.jsx)("p",{className:"mt-xs line-clamp-2 text-center text-captionSmall ".concat(e.inherited?"text-brand-light":"text-[--muted]"),children:e.provenance})]},"".concat(e.url,"-").concat(r)))}),S&&"undefined"!=typeof document&&(0,o.createPortal)((0,a.jsx)("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/80 p-lg motion-safe:animate-fade-in",onMouseDown:j,children:(0,a.jsxs)("div",{ref:N,role:"dialog","aria-modal":"true","aria-label":y("viewer.continue.references.fullSize","Full-size reference image"),className:"relative flex h-[80vh] w-full max-w-3xl flex-col overflow-hidden rounded-xl border border-[--border] bg-[--card] shadow-e-xl",onMouseDown:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex min-h-11 items-center justify-between border-b border-[--border] px-lg",children:[(0,a.jsx)("p",{className:"truncate pe-lg text-label font-semibold text-white",children:S.provenance}),(0,a.jsx)("button",{type:"button",onClick:j,className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-[--muted] motion-safe:transition-colors hover:bg-[--surface-hover] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand","aria-label":y("common.close","Close"),children:(0,a.jsx)(u,{className:"h-5 w-5"})})]}),(0,a.jsx)("div",{className:"relative min-h-0 flex-1 bg-[--deep-bg]",children:(0,a.jsx)(c.p,{src:S.url,alt:y("viewer.continue.references.fullSize","Full-size reference image"),fill:!0,sizes:"100vw",className:"object-contain",priority:!0,onRetry:S.onRetry})})]})}),document.body)]})}function u(e){let{className:r}=e;return(0,a.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18
118 6M6 6l12 12"})})}},64966:(e,r,t)=>{function a(e){return!(e.index<e.available)&&(!!e.generating||e.planned>e.available)}async function n(e){var r,t;let n=null!=(r=e.sleep)?r:e=>new Promise(r=>setTimeout(r,e)),o=null!=(t=e.intervalMs)?t:500,i=e.getSnapshot();if(e.index<i.available)return!0;if(!a({index:e.index,available:i.available,generating:i.generating,planned:i.planned}))return!1;for(;!e.isCancelled()&&(await n(o),!e.isCancelled());){let r=e.getSnapshot();if(e.index<r.available)return!0;if(!a({index:e.index,available:r.available,generating:r.generating,planned:r.planned}))break}return!1}function o(e){return e.isAutoplayActive&&e.audioPaused&&e.hasAudioUrl}t.d(r,{AF:()=>d,LW:()=>u,Rm:()=>m,Ty:()=>n,_S:()=>o,a8:()=>l,en:()=>s,g_:()=>c,jw:()=>b});let i=null;function s(){"undefined"!=typeof Audio&&(i||(i=new Audio))}function l(){let e=i;return i=null,e}function c(e){return"new"===e.sessionMode&&0===e.previousFrameCount&&e.frameCount>0&&!e.isPlaying}function d(e){var r;let t=Math.max(0,null!=(r=e.inheritedReadyFrames)?r:0);return t<=0?0:e.frameCount>t?t:Math.max(0,t-1)}function u(e){return e.justStarted&&!e.isPlaying}function m(e){return"new"===e.sessionMode&&!e.isPlaying&&e.frameCount>0}function b(e){return e.programmatic}},67925:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},75788:(e,r,t)=>{t.r(r),t.d(r,{default:()=>rn});var a,n=t(73365),o=t(1521),i=t(98196),s=t(17936),l=t(9827),c=t(48149),d=t(75383);let u=(0,d.A)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var m=t(66819),b=t(50947),p=t(76839),h=t(74174);let f=(0,d.A)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var g=t(29892),y=t(17687),x=t(73119),v=t(83786),w=t(24997),k=t(10738),j=t(68680),N=t(88248),S=t(83892),A=t(23047),_=t(64966),C=t(32731),I=t(63230),M=t(24089),R=t(79138),E=t(98378),P=t(52415),T=t(98297);function z(e,r){var t,a;let n=(null==(t=e.characterName)?void 0:t.trim())||r,o=null==(a=e.storyTitle)?void 0:a.trim();return o?"".concat(n," \xb7 ").concat(o):n}function L(e){let{characterIds:r,onCharacterIdsChange:t,referenceImageUrls:a,onAddReferenceImage:i,onRemoveReferenceImage:s,maxRefs:l=3,disabled:c=!1,onReferenceNotReadyChange:d}=e,{t:u}=(0,k.s)(),[m,b]=(0,o.useState)(null),[p,h]=(0,o.useState)(!1),f=r.length+a.length,g=f>l,y=Math.max(0,l-r.length),x=!c&&f<l,{items:v,status:N,reload:S}=function(e){let r=(0,I.n)(e=>e.accessToken),t=(0,I.n)(e=>e.userId),a=(0,I.n)(e=>e.authorityEpoch),[n,i]=(0,o.useState)([]),[s,l]=(0,o.useState)("idle"),c=(0,o.useRef)(0),d=(0,o.useRef)({accessToken:r,userId:t,authorityEpoch:a});d.current={accessToken:r,userId:t,authorityEpoch:a};let u=(0,o.useCallback)(async()=>{let e=++c.current;if(!r||!t)return i([]),l("ready"),[];l("loading");try{let n=await (0,j.FH)("/api/me/reference-images",{authorizationToken:r,cache:"no-store",noRetry:!0}),o=d.current;if(e!==c.current||o.authorityEpoch!==a||o.userId!==t||o.accessToken!==r)return[];let s=Array.isArray(null==n?void 0:n.items)?n.items.filter(e=>(null==e?void 0:e.sourceKind)==="upload_reference"&&"string"==typeof e.id&&"string"==typeof e.storyId&&"string"==typeof e.url&&/^https?:\/\//i.test(e.url)&&(null===e.storyTitle||"string"==typeof e.storyTitle)&&(null===e.characterName||"string"==typeof e.characterName)&&("lead"===e.role||"cast"===e.role)&&"string"==typeof e.recordedAt).slice(0,12):[];return i(s),l("ready"),s}catch(o){let n=d.current;return e===c.current&&n.authorityEpoch===a&&n.userId===t&&n.accessToken===r&&(i([]),l("error")),[]}},[r,a,t]);return(0,o.useEffect)(()=>()=>{c.current+=1},[]),(0,o.useEffect)(()=>{c.current+=1,i([]),l("idle")},[a,t]),(0,o.useEffect)(()=>
1{e&&u()},[e,u]),{items:n,status:s,reload:u}}("refs"===m),A=(0,o.useCallback)(e=>{h(e),null==d||d(e)},[d]),_=(0,o.useCallback)(async()=>{await S()},[S]),L=(0,o.useCallback)(e=>a.findIndex(r=>(0,M.z)(r,e)),[a]),D=(0,o.useCallback)(e=>{!x||L(e)>=0||i(e)},[x,i,L]),q=(0,o.useCallback)(e=>{let r=L(e.url);if(r>=0)return void s(r);x&&i(e.url)},[x,i,s,L]),F=(0,o.useMemo)(()=>a.map(e=>{let r=v.find(r=>(0,M.z)(r.url,e));return{url:e,provenance:r?z(r,u("conductor.pickers.savedReference","Saved reference")):u("conductor.pickers.currentUpload","Current upload"),onRetry:r?_:void 0}}),[a,_,v,u]),O="inline-flex h-8 items-center gap-xs rounded-pill border px-md text-caption font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 disabled:opacity-50";return(0,n.jsxs)("div",{className:"space-y-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap gap-sm",children:[(0,n.jsxs)("button",{type:"button",disabled:c,onClick:()=>b(e=>"cast"===e?null:"cast"),"aria-expanded":"cast"===m,className:"".concat(O," ").concat("cast"===m||r.length>0?"border-brand/50 bg-brand/20 text-brand-light":"border-[--border] bg-[--bg] text-[--muted] hover:border-[--border-hover] hover:text-white"),children:["\uD83C\uDFAD ",u("conductor.pickers.cast","Cast"),r.length>0?" \xb7 ".concat(r.length):""]}),(0,n.jsxs)("button",{type:"button",disabled:c,onClick:()=>b(e=>"refs"===e?null:"refs"),"aria-expanded":"refs"===m,className:"".concat(O," ").concat("refs"===m||a.length>0?"border-brand/50 bg-brand/20 text-brand-light":"border-[--border] bg-[--bg] text-[--muted] hover:border-[--border-hover] hover:text-white"),children:["\uD83D\uDDBC ",u("conductor.pickers.reference","Reference"),a.length>0?" \xb7 ".concat(a.length):""]}),f>0&&(0,n.jsxs)("span",{className:"inline-flex items-center self-center px-xs text-caption ".concat(g?"text-amber-400":"text-[--muted]"),children:[f,"/",l,g?" \xb7 ".concat(u("conductor.pickers.overBudget","over limit â extras may be dropped")):""]})]}),"cast"===m&&(0,n.jsx)("div",{className:"max-h-48 overflow-y-auto rounded-md border border-[--border] bg-[--bg] p-sm",children:(0,n.jsx)(R.Q,{selectedIds:r,onSelectionChange:t,disabled:c})}),("refs"===m||p)&&(0,n.jsxs)("section",{className:"".concat("refs"===m?"":"hidden ","max-h-80 space-y-md overflow-y-auto rounded-md border border-[--border] bg-[--bg] p-md"),"aria-hidden":"refs"!==m,"aria-label":u("conductor.pickers.reference","Reference"),children:[(0,n.jsxs)("div",{className:"space-y-sm",children:[(0,n.jsx)("h3",{className:"text-label font-semibold text-white",children:u("conductor.pickers.selectedReferences","Selected for this story")}),(0,n.jsx)(P.N,{items:F,onRemove:s,disabled:c,emptyMessage:u("conductor.pickers.referencesDefaultEmpty","No references selected. New stories start without one.")})]}),(0,n.jsxs)("div",{className:"border-t border-[--border] pt-md",children:[(0,n.jsx)("h3",{className:"text-label font-semibold text-white",children:u("conductor.pickers.fromYourStories","From your stories")}),"idle"===N||"loading"===N?(0,n.jsx)("div",{className:"mt-sm flex min-h-xxxl items-center gap-sm","aria-busy":"true","aria-label":u("common.loading","Loadingâ¦"),children:[0,1,2].map(e=>(0,n.jsx)("span",{className:"h-20 w-20 shrink-0 rounded-md bg-[--surface] motion-safe:animate-pulse"},e))}):"error"===N?(0,n.jsxs)("div",{className:"mt-sm flex flex-wrap items-center justify-between gap-sm",role:"alert",children:[(0,n.jsx)("p",{className:"text-caption text-red-400",children:u("conductor.pickers.referencesUnavailable","Saved references could not be loaded.")}),(0,n.jsxs)("button",{type:"button",onClick:()=>void S(),className:"inline-flex min-h-11 items-center gap-xs rounded-md border border-[--border] bg-[--surface] px-md text-label font-semibold text-brand-light motion-safe:transition-colors hover:bg-[--surface-hover] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:[(0,n.jsx)(w.A,{className:"h-4 w-4","aria-hidden":"true"}),u("common.retry","Retry")]})]}):"ready"===N&&0===v.length?(0,n.jsx)("p",{className:"mt-sm text-caption text-[--muted]",children:u("conductor.pickers.noReusableReferences","No earlier uploads yet. Upload one for this story below.")}):(0,n.jsx)("div",{className:"scrollbar-thin mt-sm flex gap-sm overflow-x-auto pb-xs",role:"list",children:v.map(e=>{let r=L(e.url)>=0,t=!r&&!x,a=z(e,u("conductor.pickers.savedReference","Saved reference")),o=r?u("common.remove","Remove"):u("conductor.pickers.useReference","Use");return(0,n.jsx)("div",{className:"w-24 shrink-0",role:"listitem",children:(0,n.jsxs)("button",{type:"button",onClick:()=>q(e),disabled:t,"aria-label":"".concat(o," ").concat(a),"aria-pressed":r,className:"w-full text-left disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:[(0,n.jsxs)("span",{className:"relative mx-auto block h-20 w-20 overflow-hidden rounded-md border bg-[--surface] ".concat(r?"border-brand ring-2 ring-brand/30":"border-[--border]"),
1children:[(0,n.jsx)(E.p,{src:e.url,alt:a,fill:!0,sizes:"80px",className:"object-cover",onRetry:_}),r&&(0,n.jsx)("span",{className:"absolute bottom-xs end-xs flex h-5 w-5 items-center justify-center rounded-pill bg-brand text-white",children:(0,n.jsx)(C.A,{className:"h-3 w-3","aria-hidden":"true"})})]}),(0,n.jsx)("span",{className:"mt-xs block line-clamp-2 text-center text-captionSmall ".concat(r?"text-brand-light":"text-[--muted]"),children:a})]})},e.id)})})]}),(0,n.jsx)(T.V,{images:a,onAdd:D,onRemove:s,maxImages:y,disabled:c||!x,selectionDisplay:"add-only",onUploadingChange:A}),!x&&!g&&(0,n.jsx)("p",{className:"text-caption text-[--muted]",children:u("conductor.pickers.referenceLimitReached","Reference limit reached for this model.")})]})]})}var D=t(51777),q=t(34102),F=t(67925),O=t(54230),U=t(11007);function V(e){var r,t,a,i;let{t:s,state:l,sections:c,order:d,cast:u,castLabel:m,createCtaLabel:b,onMake:p,variant:f,open:g=!1,onOpenChange:y}=e,w=l.hasError?"error":l.pending?"loading":l.hasAction?"review":l.canMake&&l.readyToCreate?"ready":l.hasBrief||l.canMake?"draft":"empty",k=(0,o.useId)(),j="compact"===f,N=null!=(t=null==d?void 0:d.baseCast)?t:[],S=null!=(a=null==d||null==(r=d.referenceImageUrls)?void 0:r.length)?a:0,A=N.length>0,_=A?c.map(e=>"direction"===e.id?{...e,items:e.items.filter(e=>"cast"!==e.id)}:e):c,I=!A&&!!u,M=_.reduce((e,r)=>e+r.items.length,A||I?1:0),R=(i=l.hasBrief,"ready"===w?2:("draft"===w||"review"===w)&&i||("loading"===w||"error"===w)&&M>0&&i?1:0),E=!j||g,P=l.canMake&&!l.pending&&!l.hasAction,T={empty:{label:s("conductor.board.status.waiting","Waiting for brief"),title:s("conductor.board.empty.title","Start with the story brief"),body:s("conductor.board.empty.body","Describe the story you want. Your production choices will collect here.")},loading:"reference"===l.busyReason?{label:s("conductor.board.status.reference","Reference not ready"),title:s("conductor.board.reference.title","Finish the reference"),body:s("conductor.board.reference.body","Wait for the upload to finish, or remove it before production.")}:"activation"===l.busyReason?{label:s("conductor.board.status.starting","Starting production"),title:s("conductor.board.starting.title","Sending the plan to production"),body:s("conductor.board.starting.body","Your brief and direction are being handed to the studio.")}:{label:s("conductor.board.status.updating","Updating board"),title:s("conductor.board.loading.title","Building the production plan"),body:s("conductor.board.loading.body","The Conductor is turning your latest note into production choices.")},draft:{label:s("conductor.board.status.draft","Direction in progress"),title:s("conductor.board.draft.title","Shape the direction"),body:s("conductor.board.draft.body","Keep refining in chat, or use the current plan when it feels right.")},review:{label:s("conductor.board.status.review","Approval needed"),title:s("conductor.board.review.title","Review the proposed action"),body:s("conductor.board.review.body","Approve or skip the proposal in chat before production continues.")},ready:{label:s("conductor.board.status.ready","Ready for production"),title:s("conductor.board.ready.title","Your production plan is ready"),body:s("conductor.board.ready.body","The brief and direction are locked. Start production when you are ready.")},error:{label:s("conductor.board.status.paused","Update paused"),title:s("conductor.board.error.title","The latest update did not land"),body:s("conductor.board.error.body","Your current plan is safe. Try the last step again in chat.")}}[w],z=[s("conductor.board.phase.brief","Brief"),s("conductor.board.phase.direction","Direction"),s("conductor.board.phase.produce","Produce")],L=(0,n.jsxs)("div",{id:k,className:"min-h-0 ".concat(j?"max-h-[min(28dvh,220px)] overflow-y-auto border-t border-[--border] px-4 pb-3 pt-2":"flex flex-1 flex-col overflow-hidden px-3 pb-3"),children:[(0,n.jsx)("ol",{"aria-label":s("conductor.board.phases","Production phases"),className:"grid grid-cols-3 gap-1.5",children:z.map((e,r)=>{let t=r<R,a=r===R;return(0,n.jsxs)("li",{"aria-current":a?"step":void 0,className:"relative flex min-w-0 items-center gap-1.5 rounded-lg border px-2 py-1.5 text-[10px] font-bold uppercase tracking-wide ".concat(a?"border-brand/50 bg-brand/10 text-brand":t?"border-emerald-400/25 bg-emerald-400/[0.06] text-emerald-200":"border-[--border] bg-white/[0.02] text-white/35"),children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ".concat(t?"border-emerald-300/40 bg-emerald-400/15":a?"border-brand/50":"border-white/15"),children:t?(0,n.jsx)(C.A,{className:"h-2.5 w-2.5"}):(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-current"})}),(0,n.jsx)("span",{className:"truncate",children:e}),(0,n.jsx)("span",{className:"sr-only",children:t?s("conductor.board.phase.complete",", complete"):a?s("conductor.board.phase.current",", current"):s("conductor.board.phase.upcoming",", upcoming")})]},e)})}),(0,n.jsxs)("div",{className:"mt-3 rounded-xl border p-3 ".concat("error"===w?"border-red-400/30 bg-red-400/[0.08]":"review"===w?"border-amber-400/30 bg-amber-400/[0.08]":"ready"===w?"border-brand/45 bg-brand/10":"border-[--border] bg-white/[0.025]"),children:[(0,n.jsxs)("div",{role:"status","aria-live":"polite",className:"flex items-start gap-2.5",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg ".concat("error"===w?"bg-red-400/15 text-red-300":"review"===w?"bg-amber-400/15 text-amber-200":"bg-brand/15 text-brand"),children:"loading"===w?(0,n.jsx)(D.A,{className:"h-4 w-4 motion-safe:animate-spin"}):"error"===w?(0,n.jsx)(q.A,{className:"h-4 w-4"}):"ready"===w?(0,n.jsx)(h.A,{className:"h-4 w-4"}):"empty"===w?(0,n.jsx)(F.A,{className:"h-4 w-4"}):(0,n.jsx)(v.A,{className:"h-4 w-4"})}),(0,n.jsxs)("span",{className:"min-w-0",children:[(0,n.jsx)("span",{className:"block text-xs font-bold text-white",children:T.title}),(0,n.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-[--muted]",children:T.body})]})]}),A&&(0,n.jsxs)("div",{"aria-label":s("conductor.pickers.cast","Cast"),className:"mt-3 rounded-lg border border-brand/25 bg-brand/[0.07] px-2.5 py-2",children:[(0,n.jsx)("p",{className:"text-[9px] font-bold uppercase tracking-wide text-brand-light",children:s("conductor.pickers.cast","Cast")}),(0,n.jsx)("ul",{className:"mt-1 space-y-1","aria-label":s("conductor.pickers.cast","Cast"),children:N.map((e,r)=>{var t,a;let o=function(e,r,t){let a=e.referenceIndex;return"number"==typeof a&&Number.isInteger(a)&&a>=0&&a<r?t("conductor.board.cast.upload.v1","Upload #{{index}}",{index:a+1}):"string"==typeof e.characterId&&e.characterId.trim()?t("conductor.board.cast.savedCharacter.v1","S
1aved character"):t("conductor.board.cast.unassigned.v1","Unassigned")}(e,S,s);return(0,n.jsxs)("li",{"aria-label":"".concat(e.name,", ").concat(o),className:"min-w-0",children:[(0,n.jsx)("p",{dir:"auto",className:"break-words text-[11px] leading-4 text-white/90",children:e.name}),(0,n.jsx)("p",{dir:"auto",className:"text-[10px] font-semibold leading-4 text-[--muted]",children:o})]},"".concat(null!=(t=e.characterId)?t:"unassigned","-").concat(null!=(a=e.referenceIndex)?a:"none","-").concat(r))})})]}),P&&(0,n.jsxs)("button",{type:"button",onClick:p,className:"mt-3 inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-lg bg-brand px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-brand/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 focus-visible:ring-offset-[--card]",children:[(0,n.jsx)(x.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:b})]})]}),(0,n.jsx)("div",{className:"".concat(j?"mt-3":"mt-3 min-h-0 flex-1 overflow-y-auto pr-0.5"),children:0===M?(0,n.jsxs)("div",{className:"rounded-xl border border-dashed border-[--border] px-3 py-4 text-center ".concat("loading"===w?"motion-safe:animate-pulse":""),children:[(0,n.jsx)(v.A,{"aria-hidden":"true",className:"mx-auto h-4 w-4 text-white/25"}),(0,n.jsx)("p",{className:"mt-1.5 text-[11px] leading-4 text-white/45",children:"loading"===w?s("conductor.board.loading.details","Production details are coming into focusâ¦"):s("conductor.board.empty.details","Brief, direction, cast, and delivery settings will appear here.")})]}):(0,n.jsx)("div",{className:"space-y-3",children:_.map(e=>{let r="direction"===e.id&&I;return 0!==e.items.length||r?(0,n.jsxs)("section",{"aria-labelledby":"".concat(k,"-").concat(e.id),children:[(0,n.jsx)("h3",{id:"".concat(k,"-").concat(e.id),className:"mb-1.5 text-[10px] font-extrabold uppercase tracking-[0.14em] text-white/45",children:e.label}),(0,n.jsxs)("div",{className:"grid gap-1.5 ".concat(j?"grid-cols-2 sm:grid-cols-3":"grid-cols-2"),children:[e.items.map(e=>(0,n.jsxs)("div",{className:"min-w-0 rounded-lg border border-[--border] bg-[--bg] px-2.5 py-2 ".concat(e.wide?"col-span-full":""),title:"".concat(e.label,": ").concat(e.value),children:[(0,n.jsx)("p",{className:"text-[9px] font-bold uppercase tracking-wide text-white/35",children:e.label}),(0,n.jsx)("p",{className:"".concat(e.wide?"line-clamp-3":"truncate"," mt-0.5 break-words text-[11px] leading-4 text-white/85"),children:e.value})]},e.id)),r&&(0,n.jsxs)("div",{className:"min-w-0 rounded-lg border border-purple-400/25 bg-purple-400/[0.07] px-2.5 py-2",children:[(0,n.jsx)("p",{className:"text-[9px] font-bold uppercase tracking-wide text-purple-200/55",children:null!=m?m:s("conductor.pickers.cast","Cast")}),(0,n.jsx)("div",{className:"mt-1 min-w-0",children:u})]})]})]},e.id):null})})})]});return(0,n.jsxs)("section",{"data-board-status":w,"data-board-layout":f,"aria-busy":"loading"===w,"aria-label":s("conductor.board.title.v2","Creative plan"),className:j?"border-b border-[--border] bg-black/10":"flex h-full min-h-0 flex-col",children:[j?(0,n.jsxs)("button",{type:"button",onClick:()=>null==y?void 0:y(!g),"aria-expanded":g,"aria-controls":k,className:"flex min-h-11 w-full items-center justify-between gap-3 px-4 py-2 text-start transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)(h.A,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-brand"}),(0,n.jsx)("span",{className:"truncate text-xs font-bold text-white",children:s("conductor.board.title.v2","Creative plan")}),M>0&&(0,n.jsx)("span",{className:"rounded-full bg-white/[0.07] px-1.5 py-0.5 text-[10px] font-bold text-white/55",children:M})]}),(0,n.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,n.jsx)("span",{className:"max-w-[9rem] truncate rounded-full border px-2 py-0.5 text-[10px] font-bold ".concat("error"===w?"border-red-400/30 bg-red-400/10 text-red-200":"review"===w?"border-amber-400/30 bg-amber-400/10 text-amber-200":"ready"===w?"border-brand/40 bg-brand/10 text-brand":"border-[--border] bg-white/[0.025] text-white/55"),children:T.label}),g?(0,n.jsx)(O.A,{"aria-hidden":"true",className:"h-4 w-4 text-white/55"}):(0,n.jsx)(U.A,{"aria-hidden":"true",className:"h-4 w-4 text-white/55"})]})]}):(0,n.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 px-3 py-3",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)(h.A,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-brand"}),(0,n.jsx)("span",{className:"truncate text-xs font-bold text-white",children:s("conductor.board.title.v2","Creative plan")})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-bold ".concat("error"===w?"border-red-400/30 bg-red-400/10 text-red-200":"review"===w?"border-amber-400/30 bg-amber-400/10 text-amber-200":"ready"===w?"border-brand/40 bg-brand/10 text-brand":"border-[--border] bg-white/[0.025] text-white/55"),children:T.label})]}),E&&L]})}var B=t(38680),H=t(27637),K=t(1702);function W(e){var r,t,a,i;let{t:s,onStageOrder:l}=e,[c,d]=(0,o.useState)([]),[u,m]=(0,o.useState)({}),[b,p]=(0,o.useState)({}),[h,f]=(0,o.useState)(null),g=null!=(a=null==(r=(0,K.useSearchParams)())?void 0:r.get("worldPulse"))?a:null;(0,o.useEffect)(()=>{let e=!1;return(0,j.FH)("/api/me/resonance?platform=web",{cache:"no-store"}).then(r=>{if(e)return;let t=Array.isArray(r.cards)?r.cards:[];d(t),m(Object.fromEntries(t.map(e=>[e.roundId,e.selectedOptionId]))),p(Object.fromEntries(t.map(e=>{var r;return[e.roundId,null!=(r=e.creatorDirection)?r:""]}))),t.length&&(0,N.u4)("resonance_world_pulse_viewed",{round_count:t.length})}).catch(()=>{}),()=>{e=!0}},[]);let x=(0,o.useMemo)(()=>{var e,r,t;return null!=(t=null!=(r=null!=(e=c.find(e=>e.roundId===g))?e:c.find(e=>"drafted"!==e.status))?r:c[0])?t:null},[c,g]);if(!x)return null;let v=async e=>
1{if(!h){f(x.roundId);try{var r,t,a;let n=await (0,j.FH)("/api/me/resonance/".concat(encodeURIComponent(x.roundId),"/decision"),{method:"PUT",body:"close"===e?{action:"close",platform:"web"}:{action:"continue",optionId:null!=(t=u[x.roundId])?t:null,creatorDirection:null!=(a=b[x.roundId])?a:"",platform:"web"},noRetry:!0});(0,N.u4)("resonance_creator_decision",{round_id:x.roundId,action:e,selected_option:!!u[x.roundId],custom_direction:!!(null==(r=b[x.roundId])?void 0:r.trim())}),n.order&&l(n.order,x.roundId),d(r=>"close"===e?r.filter(e=>e.roundId!==x.roundId):r.map(e=>e.roundId===x.roundId?{...e,status:"accepted"}:e))}finally{f(null)}}},w=!!(u[x.roundId]||(null==(t=b[x.roundId])?void 0:t.trim()));return(0,n.jsxs)("section",{className:"shrink-0 border-b border-emerald-300/15 bg-emerald-400/[0.045] px-4 py-3","aria-label":s("resonance.worldPulse.title","World Pulse"),children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("p",{className:"flex items-center gap-1.5 text-[11px] font-extrabold uppercase tracking-[0.14em] text-emerald-200",children:[(0,n.jsx)(B.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),s("resonance.worldPulse.title","World Pulse")]}),(0,n.jsxs)("h3",{className:"mt-1 truncate text-sm font-bold text-white",children:[x.seriesName," \xb7 ",s("resonance.worldPulse.afterEpisode","After episode")," ",x.episodeNumber]}),(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-white/55",children:[x.totalSignals," ",s("resonance.worldPulse.signals","audience signals")," \xb7 ",s("resonance.worldPulse.private","aggregate only")]})]}),(0,n.jsx)("button",{type:"button",onClick:()=>void v("close"),disabled:!!h,"aria-label":s("resonance.worldPulse.close","Close this pulse"),className:"rounded-lg p-2 text-white/45 hover:bg-white/[0.06] hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-300/60",children:(0,n.jsx)(y.A,{"aria-hidden":"true",className:"h-4 w-4"})})]}),"drafted"===x.status?(0,n.jsx)("p",{className:"mt-3 rounded-lg border border-emerald-300/15 bg-emerald-300/[0.07] px-3 py-2 text-xs font-semibold text-emerald-100",children:s("resonance.worldPulse.inProduction","Your answer is in production. Publish it to complete the loop.")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:x.options.map(e=>{let r=u[x.roundId]===e.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>m(r=>({...r,[x.roundId]:e.id})),"aria-pressed":r,className:"rounded-xl border p-2.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-300/60 ".concat(r?"border-emerald-300/70 bg-emerald-300/10":"border-white/10 bg-black/15 hover:bg-white/[0.04]"),children:[(0,n.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-wide text-white/40",children:[e.signals," ",s("resonance.worldPulse.signals","signals")]}),(0,n.jsx)("span",{className:"mt-1 block text-xs font-semibold leading-snug text-white",children:e.label})]},e.id)})}),(0,n.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,n.jsx)("input",{value:null!=(i=b[x.roundId])?i:"",onChange:e=>p(r=>({...r,[x.roundId]:e.target.value.slice(0,1200)})),placeholder:s("resonance.worldPulse.refine","Add your own refinementâ¦"),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-white/10 bg-black/20 px-3 text-xs text-white outline-none placeholder:text-white/35 focus:border-emerald-300/50"}),(0,n.jsxs)("button",{type:"button",disabled:!w||!!h,onClick:()=>void v("continue"),className:"inline-flex min-h-10 items-center gap-1.5 rounded-lg bg-emerald-300 px-3 text-xs font-extrabold text-black disabled:opacity-45",children:[s("resonance.worldPulse.stage","Stage answer")," ",(0,n.jsx)(H.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]})]}),(0,n.jsx)("p",{className:"mt-1.5 text-[10px] text-white/40",children:s("resonance.worldPulse.explicit","Nothing is created until you review the plan and choose Make this episode.")})]})]})}var Y=t(23668),Z=t(29233),Q=t(10986);let G=new Set(["1","true"]);function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q.env.NEXT_PUBLIC_CONDUCTOR_FIRST_TAP_DISABLED;return!G.has(String(null!=e?e:"").toLowerCase())}function X(e,r){let t=String(null!=e?e:"").trim();return t||String(null!=r?r:"").trim()}function J(e){let r=String(null!=e?e:"").trim();return r.length>34?"".concat(r.slice(0,33),"â¦"):r}var ee=t(84131),er=t(1708),et=t(67359),ea=t(43139),en=t(63503),eo=t(29213),ei=t(89877),es=t(85109),el=t(30548),ec=t(61530);let ed=RegExp("(?<![\\p{L}\\p{M}\\p{N}_])\\p{Lu}[\\p{L}\\p{M}'â.-]{1,40}(?:\\s+\\p{Lu}[\\p{L}\\p{M}'â.-]{1,40}){1,3}(?![\\p{L}\\p{M}\\p{N}_])","gu"),eu=RegExp("(?<![\\p{L}\\p{M}\\p{N}_])\\p{Lu}{2,}(?:[ '-]+\\p{Lu}{2,}){1,3}(?![\\p{L}\\p{M}\\p{N}_])","gu"),em=new Set(["Story Explainer","Horror Twist","Mystery Case","Fable Wonder","Fable & Wonder","Worlds Beyond","Adventure Series","Cinematic Short","Viral Copy","Myria Trends"]),eb=/\b(?:all characters? (?:are|is)|wholly|entirely|explicitly|clearly) fictional\b|\b(?:original|invented|imaginary|made[- ]?up|fictional) (?:adult )?(?:character|person|detective|investigator|protagonist|antagonist|villain|cast)\b|\bno resemblance to (?:any )?real (?:person|people)\b/i,ep=/\b(?:actor|actress|singer|rapper|musician|politician|president|prime minister|governor|mayor|senator|representative|judge|prosecutor|attorney|lawyer|doctor|surgeon|professor|teacher|journalist|reporter|anchor|athlete|footballer|celebrity|influencer|youtuber|tiktoker|streamer|creator|founder|ceo|executive|billionaire|activist|royal|prince|princess|king|queen)\b/i,eh=/\b(?:my|our|a real|the real)\s+(?:neighbor|neighbour|coworker|co-worker|boss|teacher|doctor|therapist|lawyer|landlord|tenant|friend|partner|spouse|wife|husband|boyfriend|girlfriend|ex|classmate|roommate|relative|sister|brother|mother|father|parent|child|son|daughter)\b/i,ef=/\b(?:starring|played by|portrayed by|voiced by|impersonat(?:e|ing)|deepfake|face swap|look(?:s)? exactly like|same face as|likeness of|voice clone of|doppelg[aä]nger of|reenact(?:ment|ing))\b/i,eg=/\b(?:accus(?:e|ed|ation)|alleg(?:e|ed|ation)|claim(?:s|ed)? that|expos(?:e|ing)|evidence against|proof that|confession|guilty|criminal|crime|murder(?:er|ed)?|kill(?:er|ed)?|kidnap(?:per|ped)?|abduct(?:ed|ion)|assault(?:ed)?|abus(?:e|ed)|rape(?:d)?|harass(?:ed|ment)|stalk(?:ed|er)?|corrupt(?:ion)?|fraud|scam(?:mer)?|stole|theft|robbery|cheat(?:ed|ing)|affair|betrayal|cover[- ]?up|conspiracy|secret recording|leaked (?:audio|video|messages?)|fabricated quote|fake quote|words (?:he|she|they) never said)\b/i,ey=RegExp("(?:\\b(?:actor|actress|singer|rapper|musician|politician|president|governor|mayor|senator|judge|lawyer|doctor|surgeon|journalist|athlete|celebrity|influencer|youtuber|tiktoker|streamer|founder|ceo)\\b|\\b(?:my|our|a real|the real)\\s+(?:neighbor|neighbour|coworker|co-worker|boss|teacher|doctor|therapist|lawyer|landlord|friend|partner|spouse|ex|classmate|roommate|relative)\\b|\\b(?:starring|played by|portrayed by|voiced by|impersonating|deepfake of|likeness of|voice clone of)\\b)\\s+(?:named\\s+)?([\\p{L}\\p{M}'â.-]{2,40}\\s+[\\p{L}\\p{M}'â.-]{2,40})","iu");function ex(e){return[...new Set(e.map(e=>
1e.trim()).filter(Boolean))]}let ev=/\b(?:part|episode|chapter|season)\s*(?:#\s*)?([2-9]|\d{2,})\b|\b(?:continue|continuation|next episode|sequel|pick up where)\b/i,ew=/\b(?:mockumentary|fake documentary|fictional documentary|parody documentary|deadpan documentary)\b/i,ek=/\b(?:cinematic short|short film|make (?:a|this) movie|complete film)\b/i,ej=/\b(?:explain|explainer|documentary|true story|real(?:-| )?life|historical (?:account|event|figure|record|case|biography|documentary)|history of|biograph(?:y|ical)|how (?:does|do|did|it works?)|why (?:does|do|did|is|are)|facts? about|science of|news|current events?|real case|true crime|debunk|myth[- ]?bust(?:er|ing)?)\b/i,eN=/\b(?:true crime|real (?:criminal |murder |court |legal )?case|actual (?:crime|case)|unsolved real|historical case)\b/i,eS=/\b(?:current events?|breaking (?:news|story|report)|latest (?:news|developments?|updates?|headlines?)|today(?:'s|âs) (?:news|headlines?|events?|developments?)|ongoing (?:war|conflict|crisis)|recent (?:election|ruling|decision|disaster))\b/i,eA=/\b(?:biograph(?:y|ical)|life (?:and|or )?career of|life of|career of|profile of|real person|living (?:person|public figure)|public figure)\b/i,e_=/\b(?:real person|living (?:person|public figure)|public figure)\b/i,eC=/\b(?:true story|real(?:-| )?life|actual events?|based on (?:a )?true (?:story|events?))\b/i,eI=/\b[Ww]ho (?:is|was) [A-Z][A-Za-z'â-]+(?:\s+[A-Z][A-Za-z'â-]+){1,3}\b/,eM=/\bhow\b[^.!?]{1,80}\bworks?\b/i,eR=[/\b(?:diagnos(?:e|is|tic)|treat(?:ment|ing)|dos(?:e|age|ing)|insulin|medicine|medication|prescription|lawsuit|legal (?:advice|strategy|action)|contract|court filing|tax advice|invest(?:ment|ing)?|stocks?|cryptocurrency|crypto|portfolio|trad(?:e|ing))\b/iu,/(?:diagn[oó]stic|tratamiento|dosis|dosificaci[oó]n|insulina|medicaci[oó]n|medicamento|receta m[eé]dica|demanda judicial|estrategia legal|asesoramiento legal|consejo legal|contrato|impuestos?|inversi[oó]n|invertir|acci[oó](?:n|nes) burs[aá]til(?:es)?|bolsa|criptomoned|cripto|cartera de inversi[oó]n|trading)/iu,/(?:diagn[oó]stic|tratamento|dose|dosagem|insulina|medica[cç][aã]o|medicamento|receita m[eé]dica|processo judicial|a[cç][aã]o judicial|estrat[eé]gia jur[iÃ]dica|aconselhamento jur[iÃ]dico|conselho jur[iÃ]dico|contrato|impostos?|investimento|investir|a[cç][aã]o burs[aá]til|a[cç][oõ]es da bolsa|bolsa de valores|criptomoed|cripto|carteira de investimentos?|trading)/iu,/(?:निदान|à¤à¤²à¤¾à¤|à¤à¤ªà¤à¤¾à¤°|à¤à¥à¤°à¤¾à¤|डà¥à¤|à¤à¤à¤¸à¥à¤²à¤¿à¤¨|दवा|à¤à¤·à¤
1§à¤¿|पà¥à¤°à¤¿à¤¸à¥à¤à¥à¤°à¤¿à¤ªà¥à¤¶à¤¨|मà¥à¤à¤¦à¤®|à¤à¤¾à¤¨à¥à¤¨à¥|à¤à¤¼à¤¾à¤¨à¥à¤¨à¥|à¤
दालत|à¤
नà¥à¤¬à¤à¤§|à¤à¤° सलाह|à¤à¥à¤à¥à¤¸ सलाह|निवà¥à¤¶|शà¥à¤¯à¤°|सà¥à¤à¥à¤|à¤à¥à¤°à¤¿à¤ªà¥à¤à¥|पà¥à¤°à¥à¤à¤«à¥à¤²à¤¿à¤¯à¥|à¤à¥à¤°à¥à¤¡à¤¿à¤à¤)/u,/(?:ØªØ´Ø®ÙØµ|Ø¹ÙØ§Ø¬|جرع(?:Ø©|ات)|Ø¥ÙØ³ÙÙÙÙ|Ø§ÙØ³ÙÙÙÙ|Ø¯ÙØ§Ø¡|أدÙÙØ©|ادÙÙØ©|ÙØµÙØ© Ø·Ø¨ÙØ©|دعÙÙ|ÙØ§ÙÙÙÙ|ÙØ§ÙÙÙÙØ©|Ø§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© ÙØ§ÙÙÙÙØ©|Ø¹ÙØ¯|Ø¶Ø±ÙØ¨(?:Ø©|Ù|ÙØ©|ÙØ©)|استثÙ
ار|أستثÙ
ر|استثÙ
ر|سÙÙ
|أسÙÙ
|اسÙÙ
|Ø¨ÙØ±ØµØ©|عÙ
ÙØ§Øª رÙÙ
ÙØ©|ÙØ±ÙبتÙ|Ù
ØÙظة استثÙ
Ø§Ø±ÙØ©|تداÙÙ)/u,/(?:диагноз|диагноÑÑ|леÑени|доз(?:а|Ñ|иÑовк)|инÑÑлин|лекаÑÑÑв|пÑепаÑаÑ|ÑеÑепÑ|иÑк|ÑÑдебн|ÑÑидиÑеÑк|пÑавов(?:аÑ|ÑÑ|ой) ÑÑÑаÑег|договоÑ|налогов(?:аÑ|ÑÑ) конÑÑлÑÑаÑ|инвеÑÑиÑ|инвеÑÑиÑоваÑÑ|акÑи(?:Ñ|и|Ñ|й)|биÑж|кÑипÑ|поÑÑÑел|ÑÑейдинг|ÑоÑгов(?:лÑ|аÑÑ))/iu],eE=[/\b(?:should i|what should i (?:do|take|use|buy|sell|sign|file)|what [^.!?]{0,40} should i|for me|my symptoms|my (?:case|lawsuit|contract|money|portfolio)|how much should i|tell me (?:exactly )?(?:whether|which|what)|which [^.!?]{0,40}\b(?:should i |to )?(?:buy|sell|take|use)|give me [^.!?]{0,50}\b(?:advice|diagnos(?:e|is)|treatment|dos(?:e|age)|prescription|medic(?:ation|ine)|strategy|recommendation)|recommend [^.!?]{0,40}\bfor me)\b/iu,/(?:\b(?:debo|deber[iÃ]a) (?:hacer|tomar|usar|comprar|vender|invertir|firmar|presentar)\b|\bqu[eé] [^.!?¿¡]{0,40}(?:debo|deber[iÃ]a) (?:hacer|tomar|usar|comprar|vender|invertir|firmar|presentar)\b|mis s[iÃ]ntomas|mi (?:caso|demanda|contrato|dinero|cartera)|cu[aá]nt[oa] [^.!?¿¡]{0,30}(?:debo|deber[iÃ]a) (?:tomar|usar|comprar|vender|invertir)|d[iÃ]me (?:exactamente )?(?:qu[eé]|cu[aá]l|si)|recomi[eé]ndame|acons[eé]jame)/iu,/(?:\b(?:devo|deveria) (?:fazer|tomar|usar|comprar|vender|investir|assinar|apresentar)\b|\b(?:o que|que|qual) [^.!?]{0,40}(?:devo|deveria) (?:fazer|tomar|usar|comprar|vender|investir|assinar|apresentar)\b|meus sintomas|meu (?:caso|processo|contrato|dinheiro|portf[oó]lio)|minha (?:carteira|a[cç][aã]o judicial)|quant[oa] [^.!?]{0,30}(?:devo|deveria) (?:tomar|usar|comprar|vender|investir)|d(?:iga|iz)(?:-me| me) (?:exatamente )?(?:o qu[eê]|qual|se)|recomende-me|aconselhe-me)/iu,/(?:मà¥à¤à¥ [^।.!?]{0,50}(?:लà¥à¤¨à¤¾|लà¥à¤¨à¥|लà¥à¤¨à¥|à¤à¤°à¤¨à¤¾|à¤à¤°à¤¨à¥|à¤
पनाना|à¤
पनानà¥|à¤à¤°à¥à¤¦à¤¨à¤¾|à¤à¤°à¥à¤¦à¤¨à¥|बà¥à¤à¤¨à¤¾|बà¥à¤à¤¨à¥) à¤à¤¾à¤¹à¤¿à¤|मà¥à¤ [^।.!?]{0,40}(?:à¤à¥à¤¯à¤¾ à¤à¤°à¥à¤|à¤à¥à¤¯à¤¾ à¤à¤°à¥à¤|à¤à¥à¤¨ सा à¤à¤°à¥à¤¦à¥à¤|à¤à¥à¤¨ सॠà¤à¤°à¥à¤¦à¥à¤|à¤à¤¿à¤¤à¤¨à¤¾ लà¥à¤|à¤à¤¿à¤¤à¤¨à¥ लà¥à¤)|मà¥à¤°à¥ (?:लà¤à¥à¤·à¤£|मामलà¥|मà¥à¤à¤¦à¤®à¥|à¤
नà¥à¤¬à¤à¤§|पà¥à¤¸à¥|पà¥à¤°à¥à¤à¤«à¥à¤²à¤¿à¤¯à¥)|मà¥à¤°à¥ (?:सà¥à¤¥à¤¿à¤¤à¤¿|दवा|à¤à¥à¤°à¤¾à¤|निवà¥à¤¶)|मà¥à¤à¥ (?:ठà¥à¤-ठà¥à¤|बिलà¥à¤à¥à¤²) [^।.!?]{0,40}बताà¤|मà¥à¤à¥ [^।.!?]{0,30}(?:सलाह|सà¥à¤à¤¾à¤µ) दà¥)/u,/(?:ÙØ¬Ø¨ عÙ(?:Ù|ÙÙ)|ÙÙØ¨ØºÙ (?:ÙÙ|عÙÙ)|Ù
اذا (?:عÙÙ Ø£Ù Ø£ÙØ¹Ù|Ø£ÙØ¹Ù)|أعراض(?:Ù|Ù)|ÙØ¶ÙتÙ|Ø¯Ø¹ÙØ§Ù|Ø¹ÙØ¯Ù|Ø£Ù
ÙØ§ÙÙ|اÙ
ÙØ§ÙÙ|Ù
ØÙظتÙ|أخبرÙÙ (?:Ø¨Ø§ÙØ¶Ø¨Ø· )?(?:Ù
ا|Ù
اذا|Ø£Ù|ÙÙ)|اخبرÙÙ (?:Ø¨Ø§ÙØ¶Ø¨Ø· )?(?:Ù
ا|Ù
اذا|Ø£Ù|ÙÙ)|Ø§ÙØµØÙÙ|Ø£ÙØµÙÙ|Ø§ÙØµÙÙ|Ø§ÙØªØ±Ø عÙÙ)/u,/(?:мне (?:ÑледÑеÑ|ÑÑоиÑ|нÑжно|надо) [^.!?]{0,40}(?:ÑделаÑÑ|пÑинÑÑÑ|пÑинимаÑÑ|иÑполÑзоваÑÑ|кÑпиÑÑ|пÑодаÑÑ|инвеÑÑиÑоваÑÑ|подпиÑаÑÑ|подаÑÑ)|долж(?:ен|на) ли Ñ|ÑÑо мне (?:делаÑÑ|пÑинÑÑÑ|пÑинимаÑÑ|кÑпиÑÑ|пÑодаÑÑ|подпиÑаÑÑ|подаÑÑ)|мо(?:и|й|Ñ|Ñ|е|Ñ|Ñм|ем|его|иÑ
) (?:ÑимпÑом|ÑлÑÑа|дел|иÑк|договоÑ|денÑг|поÑÑÑел)|ÑколÑко мне [^.!?]{0,30}
1(?:пÑинÑÑÑ|пÑинимаÑÑ|кÑпиÑÑ|пÑодаÑÑ|инвеÑÑиÑоваÑÑ)|Ñкажи (?:мне )?ÑоÑно,? (?:ÑÑо|какой|какÑÑ|какие|ÑÑÐ¾Ð¸Ñ Ð»Ð¸)|поÑовеÑÑй|поÑекомендÑй)/iu],eP=[/\b(?:(?:can|could|may)\s+i|am\s+i\s+allowed\s+to|is\s+it\s+safe\s+for\s+me\s+to)\s+(?:(?:safely|legally)\s+)?(?:take|use|buy|sell|invest(?:\s+in)?|sign|file)\b/iu,/\b(?:(?:puedo|podr[iÃ]a)(?:\s+yo)?|es\s+seguro\s+para\s+m[iÃ])\s+(?:(?:legalmente|con\s+seguridad)\s+)?(?:tomar|usar|comprar|vender|invertir(?:\s+en)?|firmar|presentar|interponer)\b/iu,/\b(?:(?:posso|poderia)(?:\s+eu)?|[eé]\s+seguro\s+para\s+mim)\s+(?:(?:legalmente|com\s+seguran[cç]a)\s+)?(?:tomar|usar|comprar|vender|investir(?:\s+em)?|assinar|apresentar|protocolar|ajuizar)\b/iu,/à¤à¥à¤¯à¤¾\s+मà¥à¤\s+[^।.!?\n]{0,60}?(?:लà¥|(?:à¤à¤¸à¥à¤¤à¥à¤®à¤¾à¤²|à¤à¤ªà¤¯à¥à¤)\s+à¤à¤°|à¤à¤°à¥à¤¦|बà¥à¤|निवà¥à¤¶\s+à¤à¤°|हसà¥à¤¤à¤¾à¤à¥à¤·à¤°\s+à¤à¤°|(?:दायर|दाà¤à¤¿à¤²)\s+à¤à¤°)\s+सà¤à¤¤(?:ा|à¥)\s+(?:हà¥à¤|हà¥à¤)/u,RegExp("ÙÙ\\s+(?:(?:ÙÙ
ÙÙÙÙ|Ø£Ø³ØªØ·ÙØ¹|Ø§Ø³ØªØ·ÙØ¹)|(?:Ù
Ù\\s+)?Ø§ÙØ¢Ù
Ù\\s+ÙÙ)\\s+(?:(?:Ø£Ù|اÙ)\\s+)?(?:أخذ|اخذ|آخذ|ØªÙØ§ÙÙ|Ø£ØªÙØ§ÙÙ|Ø§ØªÙØ§ÙÙ|(?:اÙ)?استخداÙ
|أستخدÙ
|استخدÙ
|(?:اÙ)?شراء|أشترÙ|اشترÙ|(?:اÙ)?Ø¨ÙØ¹|Ø£Ø¨ÙØ¹|Ø§Ø¨ÙØ¹|(?:اÙ)?استثÙ
ار|أستثÙ
ر|استثÙ
ر|(?:اÙ)?تÙÙÙØ¹|Ø£ÙÙ(?:Ù)?ع|اÙÙØ¹|(?:اÙ)?ØªÙØ¯ÙÙ
|Ø£ÙØ¯(?:Ù)?Ù
|Ø§ÙØ¯Ù
|(?:اÙ)?Ø±ÙØ¹|Ø£Ø±ÙØ¹|Ø§Ø±ÙØ¹)(?!\\p{L})","u"),RegExp("(?:можно\\s+ли\\s+мне|могÑ\\s+ли\\s+Ñ|безопаÑно\\s+ли\\s+мне)\\s+(?:(?:безопаÑно|законно)\\s+)?(?:пÑинÑÑÑ|пÑинимаÑÑ|иÑполÑзоваÑÑ|кÑпиÑÑ|пÑодаÑÑ|инвеÑÑиÑоваÑÑ|вложиÑÑ|подпиÑаÑÑ|подаÑÑ)(?!\\p{L})","iu")];function eT(e,r){return r.some(r=>r.test(e))}function ez(e){return String(e||"").normalize("NFKC").trim()}let eL=/\b(?:drama|romance|romantic|love|breakup|marriage|family|relationship|betrayal|revenge|divorce|jealous|secret affair|telenovela|soap opera)\b/i,eD=/\b(?:not|no|pas|sans|without)\s+(?:a\s+|the\s+|du\s+|de\s+|d['â])?(?:drama|romance|romantic|love|breakup|marriage|family|relationship|betrayal|revenge|divorce|jealous|secret affair|telenovela|soap opera)\b/gi;function eq(e){return String(e||"").replace(eD," ")}let eF=/\b(?:mystery|detective|investigat(?:e|ion|or)|whodunn?it|clue|case file|noir|heist|conspiracy|solve|deduc(?:e|tion))\b/i,eO=/\b(?:horror|scary|terrifying|dread|haunted|monster|creature|survival|fear|nightmare|found footage|analog horror|uncanny|ghost)\b/i,eU=/\b(?:survival|survive|escape alive|fear|terror|terrifying|dread|being hunted|stay alive|nightmare)\b/i,eV=/\b(?:fantasy|sci(?:ence)?[- ]?fi|worldbuild|otherworld|portal|cosmic|mythic|magic(?:al)?|romantasy|steampunk|civilization|alien world|dying star)\b/i,eB=/\b(?:explore|discover|worldbuild|otherworld|portal|civilization|alien world|dying star|impossible world|inside a dying)\b/i,eH=/\b(?:fable|bedtime|fairy ?tale|folktale|folk tale|moral (?:story|tale)|gentle adventure|children'?s story|kids? story|lesson for (?:kids|children)|family story)\b/i,eK=/\bwhat if\b|\b(?:alternate (?:reality|history|timeline)|counterfactual|parallel (?:world|universe)|changed rule)\b/i,eW=/\b(?:comedy|funny|relatable|awkward|pov|everyday|workplace humor|comic escalation|sitcom)\b/i,eY=/\b(?:fictional|imaginary|invented|made[- ]?up|wholly original|original fictional|pretend)\b|\b(?:as|through|inside) (?:an? )?(?:fable|fairy ?tale|fictional (?:story|world))\b/i,eZ=[[/(?:novela|fam[iÃ]lia|casamento|trai[cç][aã]o|vingan[cç]a|romance|relacionamento)/i,"relationship drama"],[/(?:telenovela|familia|matrimonio|traici[oó]n|venganza|romance|relaci[oó]n)/i,"relationship drama"],[/(?:पारिवारिà¤|परिवार|पà¥à¤°à¥à¤® à¤à¤¹à¤¾à¤¨à¥|बदला|रिशà¥à¤¤à¥|नाà¤à¤)/u,"relationship drama"],[/(?:دراÙ
ا|عائÙ(?:Ø©|Ù)|Ø²ÙØ§Ø¬|Ø®ÙØ§ÙØ©|Ø§ÙØªÙاÙ
|رÙÙ
Ø§ÙØ³ÙØ©|Ø¹ÙØ§ÙØ©)/u,"relationship drama"],[/(?:дÑама|ÑемÑ[Ñи]|Ñемейн|бÑак|пÑедаÑелÑÑÑв|меÑÑÑ|ÑоманÑик|оÑноÑени)/iu,"relationship drama"],[/(?:explica(?:r|[cç][aã]o)|document[aá]rio|biografia|hist[oó]ria real|caso real|not[iÃ]cias atuais|como funciona)/i,"factual explainer documentary"],[/(?:explica(?:r|ci[oó]n)|documental|biograf[iÃ]a|historia real|caso real|noticias actuales|c[oó]mo funciona)/i,"factual explainer documentary"],[/(?:समà¤à¤¾(?:à¤|à¤à¤)?|वà¥à¤¤à¥à
1¤¤à¤à¤¿à¤¤à¥à¤°|à¤à¥à¤µà¤¨à¥|सà¤à¥à¤à¥ à¤à¤¹à¤¾à¤¨à¥|वासà¥à¤¤à¤µà¤¿à¤ मामला|ताà¤à¤¼à¤¾ समाà¤à¤¾à¤°|à¤à¥à¤¸à¥ à¤à¤¾à¤® à¤à¤°à¤¤à¤¾)/u,"factual explainer documentary"],[/(?:اشرØ|ØªÙØ³Ùر|ÙØ«Ø§Ø¦ÙÙ|Ø³ÙØ±Ø©|ÙØµØ© ØÙÙÙÙØ©|ÙØ¶ÙØ© ØÙÙÙÙØ©|(?:اÙ)?أخبار (?:اÙ)?ØØ§ÙÙØ©|ÙÙÙ ÙØ¹Ù
Ù)/u,"factual explainer documentary"],[/(?:обÑÑÑн|докÑменÑалÑн|биогÑаÑ|ÑеалÑн(?:аÑ|ое) (?:иÑÑоÑиÑ|дело)|ÑекÑÑие новоÑÑи|как ÑабоÑаеÑ)/iu,"factual explainer documentary"],[/(?:mist[eé]rio|detetive|investiga[cç][aã]o|pistas?|enigma)/i,"detective mystery clues"],[/(?:misterio|detective|investigaci[oó]n|pistas?|enigma)/i,"detective mystery clues"],[/(?:रहसà¥à¤¯|à¤à¤¾à¤¸à¥à¤¸|à¤à¤¾à¤à¤|सà¥à¤°à¤¾à¤|पहà¥à¤²à¥)/u,"detective mystery clues"],[/(?:غÙ
ÙØ¶|Ù
ØÙÙ|تØÙÙÙ|Ø£Ø¯ÙØ©|ÙØºØ²)/u,"detective mystery clues"],[/(?:Ñайн|деÑекÑив|ÑаÑÑледован|Ñлик|загадк)/iu,"detective mystery clues"],[/(?:terror|medo|assombrad|pesadelo|sobreviver)/i,"horror fear haunted survival"],[/(?:terror|miedo|embrujad|pesadilla|sobrevivir)/i,"horror fear haunted survival"],[/(?:डरावन|à¤à¥à¤¤|दहशत|à¤à¥à¤«|à¤à¥à¤µà¤¿à¤¤ बà¤)/u,"horror fear haunted survival"],[/(?:رعب|Ø®ÙÙ|Ù
سÙÙÙ|ÙØ§Ø¨Ùس|اÙÙØ¬Ø§Ø©)/u,"horror fear haunted survival"],[/(?:ÑжаÑ|ÑÑÑаÑ
|пÑизÑак|коÑмаÑ|вÑжиÑÑ)/iu,"horror fear haunted survival"],[/(?:reino m[aá]gico|mundo alien[iÃ]gena|fantasia|fic[cç][aã]o cient[iÃ]fica|outro mundo)/i,"fantasy science fiction otherworld"],[/(?:reino m[aá]gico|mundo alien[iÃ]gena|fantas[iÃ]a|ciencia ficci[oó]n|otro mundo)/i,"fantasy science fiction otherworld"],[/(?:à¤à¤¾à¤²à¥à¤ªà¤¨à¤¿à¤ दà¥à¤¨à¤¿à¤¯à¤¾|विà¤à¥à¤à¤¾à¤¨ à¤à¤¥à¤¾|à¤à¤¾à¤¦à¥à¤ दà¥à¤¨à¤¿à¤¯à¤¾|दà¥à¤¸à¤°à¥ दà¥à¤¨à¤¿à¤¯à¤¾)/u,"fantasy science fiction otherworld"],[/(?:عاÙÙ
Ø®ÙØ§ÙÙ|Ø®ÙØ§Ù عÙÙ
Ù|عاÙÙ
Ø³ØØ±Ù|عاÙÙ
آخر)/u,"fantasy science fiction otherworld"],[/(?:ÑÑнÑези|наÑÑн.*ÑанÑаÑÑ|волÑебн.*миÑ|иной миÑ)/iu,"fantasy science fiction otherworld"],[/(?:conto infantil|hist[oó]ria infantil|f[aá]bula|conto de fadas|hist[oó]ria moral)/i,"children fable moral story"],[/(?:cuento infantil|historia infantil|f[aá]bula|cuento de hadas|historia moral)/i,"children fable moral story"],[/(?:बà¤à¥à¤à¥à¤ à¤à¥ à¤à¤¹à¤¾à¤¨à¥|परॠà¤à¤¥à¤¾|नà¥à¤¤à¤¿à¤ à¤à¤¹à¤¾à¤¨à¥)/u,"children fable moral story"],[/(?:ÙØµØ© Ø£Ø·ÙØ§Ù|ØÙØ§ÙØ© خراÙÙØ©|ÙØµØ© Ø£Ø®ÙØ§ÙÙØ©)/u,"children fable moral story"],[/(?:деÑÑÐºÐ°Ñ Ñказка|Ñказка Ð´Ð»Ñ Ð´ÐµÑей|поÑÑиÑелÑÐ½Ð°Ñ Ð¸ÑÑоÑиÑ|баÑнÑ)/iu,"children fable moral story"],[/^\s*(?:e se|o qu[eê] aconteceria se)\b/im,"what if counterfactual"],[/^\s*¿?(?:qu[eé] pasar[iÃ]a si|y si)\b/im,"what if counterfactual"],[/(?:à¤à¥à¤¯à¤¾ हॠà¤
à¤à¤°|à¤à¥à¤¯à¤¾ हà¥à¤¤à¤¾ यदि)/u,"what if counterfactual"],[/(?:Ù
اذا ÙÙ|Ù
ا Ø§ÙØ°Ù Ø³ÙØØ¯Ø« ÙÙ)/u,"what if counterfactual"],[/(?:ÑÑо еÑли|ÑÑо бÑло бÑ,? еÑли)/iu,"what if counterfactual"],[/(?:com[eé]dia cotidiana|humor constrangedor|situa[cç][aã]o engra[cç]ada)/i,"relatable awkward comedy"],[/(?:comedia cotidiana|humor inc[oó]modo|situaci[oó]n graciosa)/i,"relatable awkward comedy"],[/(?:रà¥à¤à¤¼à¤®à¤°à¥à¤°à¤¾ à¤à¥ à¤à¥à¤®à¥à¤¡à¥|मà¤à¤¼à¥à¤¦à¤¾à¤° सà¥à¤¥à¤¿à¤¤à¤¿|हासà¥à¤¯)/u,"relatable awkward comedy"],[/(?:ÙÙÙ
ÙØ¯Ùا ÙÙÙ
ÙØ©|Ù
ÙÙÙ Ù
ضØÙ|ÙÙÙ
ÙØ¯Ùا Ù
ØØ±Ø¬Ø©)/u,"relatable awkward comedy"],[/(?:бÑÑÐ¾Ð²Ð°Ñ ÐºÐ¾Ð¼ÐµÐ´Ð¸Ñ|ÑмеÑÐ½Ð°Ñ ÑиÑÑаÑиÑ|неловк.*ÑмоÑ)/iu,"relatable awkward comedy"],[/(?:s[eé]rie de aventura|miss[aã]o de aventura)/i,"adventure series mission"],[/(?:serie de aventuras|misi[oó]n de aventura)/i,"adventure series mission"],[/(?:साहसिठशà¥à¤°à¥à¤à¤à¤²à¤¾|रà¥à¤®à¤¾à¤à¤à¤ मिशन)/u,"adventure series mission"],[/(?:Ø³ÙØ³ÙØ© Ù
غاÙ
رات|Ù
ÙÙ
Ø© Ù
غاÙ
رة)/u,"adventure series mission"],[/(?:пÑиклÑÑенÑеÑкий ÑеÑиал|пÑиклÑÑенÑеÑÐºÐ°Ñ Ð¼Ð¸ÑÑиÑ)/iu,"adventure series mission"],[/(?:curta(?:-metragem)? cinematogr[aá]fic|filme curto cinematogr[aá]fic)/i,"cinematic short"],[/(?:cortometraje cinematogr[aá]fico|pel[iÃ]cula corta cinematogr[aá]fica)/i,"cinematic short"],[/(?:सिनà¥à¤®à¤¾à¤ लà¤à¥ फिलà¥à¤®|à¤à¥à¤à¥ सिनà¥à¤®à¤¾à¤ फिलà¥à¤®)/u,"cinematic short"],[/(?:ÙÙÙÙ
ÙØµÙر سÙÙÙ
ائÙ)/u,"cinematic short"],[/(?:кинемаÑогÑаÑиÑеÑк.*коÑоÑкомеÑÑажн)/iu,"cinematic short"],[/(?:falso document[aá]rio|document[aá]rio fict[iÃ]cio)/i,"fictional mockumentary"],[/(?:falso documental|documental ficticio)/i,"fictional mockumentary"],[/(?:à¤à¤¾à¤²à¥à¤ªà¤¨à
1¤¿à¤ वà¥à¤¤à¥à¤¤à¤à¤¿à¤¤à¥à¤°|नà¤à¤²à¥ वà¥à¤¤à¥à¤¤à¤à¤¿à¤¤à¥à¤°)/u,"fictional mockumentary"],[/(?:ÙØ«Ø§Ø¦Ù٠ساخر|ÙØ«Ø§Ø¦ÙÙ Ø®ÙØ§ÙÙ)/u,"fictional mockumentary"],[/(?:пÑевдодокÑменÑалÑн|вÑмÑÑленн.*докÑменÑалÑн)/iu,"fictional mockumentary"]],eQ=/\b(?:my|our|this|an?|the) (?:original )?(?:fantasy|sci(?:ence)?[- ]?fi|fictional|imaginary|invented) (?:world|kingdom|realm|universe|story|setting)\b/i,eG=/\b(?:dragon|wizard|unicorn|fairy|mermaid|magic(?:al)?|spell|enchanted|monster|ghost|superhero|protagonist|fictional character|talking animal)\b/i,e$=/\b(?:mythology|folklore|literature|biology|physics|chemistry|research|study|evidence|historical record|according to)\b/i,eX=/\b(?:biography|life|career|profile) of [A-Z][A-Za-z'â-]+(?:\s+[A-Z][A-Za-z'â-]+){1,3}\b/,eJ=[["science_fiction",/\b(?:sci(?:ence)?[- ]?fi|cyberpunk|future|futuristic|space|alien|mars|robot|android|technology|dying star)\b/i],["fantasy",/\b(?:fantasy|magic(?:al)?|dragon|wizard|mythic|fairy|enchanted|kingdom)\b/i],["romance",/\b(?:romance|romantic|love|lovers|relationship)\b/i],["family",/\b(?:family|mother|father|parent|sibling|sister|brother|grandparent)\b/i],["noir",/\b(?:noir|neon detective|hardboiled|rain[- ]slicked)\b/i],["cozy",/\b(?:cozy|cosy|gentle|comforting|small town)\b/i]];function e0(e){let r=String(e||"").trim();return r&&"auto"!==r.toLowerCase()&&"myria"!==r.toLowerCase()?r:null}function e1(e){var r;return!!(function(){var e;let r=globalThis.process,t=null==r||null==(e=r.env)?void 0:e.GENERATION_STYLES_HIGH_STAKES_ADVICE_GATE_ENABLED;return"1"===t||(null==t?void 0:t.toLowerCase())==="true"}()&&function(e){let r=ez(e);return!!r&&eT(r,eR)}(r=e)&&function(e){let r=ez(e);return!!r&&(eT(r,eE)||eT(r,eP))}(r)||function(){var e;let r=globalThis.process,t=null==r||null==(e=r.env)?void 0:e.GENERATION_STYLES_OPEN_ENDED_REAL_PERSON_GATE_ENABLED;return"1"===t||(null==t?void 0:t.toLowerCase())==="true"}()&&function(e){var r;let t=String(e||"").normalize("NFKC"),a=null==(r=t.match(ey))?void 0:r[1],n=ex([...function(e){var r,t;let a=String(e||"").normalize("NFKC");return ex([...null!=(r=a.match(ed))?r:[],...null!=(t=a.match(eu))?t:[]]).filter(e=>!em.has(e))}(t),...a?[a]:[]]),o=n.length>0,i=[];return ep.test(t)&&o&&i.push("real_world_role"),eh.test(t)&&o&&i.push("private_relationship"),ef.test(t)&&o&&i.push("likeness_or_performance"),eg.test(t)&&o&&!eb.test(t)&&i.push("allegation_or_evidence"),{risky:i.length>0,names:n,reasons:ex(i)}}(e).risky)||!eY.test(e)&&(!!(eN.test(e)||eS.test(e)||e_.test(e)||eC.test(e)||eX.test(e)||eI.test(e))||!(ew.test(e)||eK.test(e)||eQ.test(e))&&(!!eA.test(e)||(!eG.test(e)||!!e$.test(e))&&(eM.test(e)||ej.test(e))))}var e2=t(10986);let e5={create_generation_style:s.A,create_character:l.A,create_automation:c.A,create_collection:u,save_show_bible:m.A,propose_world_fact:b.A},e3={whatif:p.A,mockumentary:h.A,bedtime:f,surprise:g.A},e4=!["1","true"].includes(String(null!=(a=e2.env.NEXT_PUBLIC_CONDUCTOR_CREATE_PULSE_DISABLED)?a:"").toLowerCase()),e8=$(),e9="Hey â welcome to Myria \uD83C\uDFAC\n\nI'm your story director. Tell me anything you'd love to see â a wild what-if, a bedtime tale, a mini-movie about your day â and I'll shape it into a story you can watch in about a minute.\n\nWhat are you in the mood for?";function e7(e){let r=[...e];for(;r.length>16;)r.splice(0,2);return r}function e6(e){return Array.from(new Set((null!=e?e:[]).filter(e=>"string"==typeof e&&e.length>0)))}function re(e,r,t){return t?e6(r):Array.isArray(null==e?void 0:e.characterIds)?e6(e.characterIds):e6(r)}function rr(){let e=I.n.getState();return(0,es.gi)(e.userId,e)}function rt(e){return(0,es.HV)(e,I.n.getState())}function ra(e,r){return(null==e?void 0:e.principalId)===r.principalId&&e.authorityEpoch===r.authorityEpoch}function rn(e){var r,t,a,s,c,d,u,m,b,p;let{onClose:f,onMeaningfulAction:g,firstRun:C=!1,variant:M="modal",autoFocus:R=!1,contextStoryId:P,initialUserMessage:T,initialOrder:z,onInitialTurnConsumed:D,onFirstRunPremise:q,className:F=""}=e,{t:O,locale:U}=(0,k.s)(),B="modal"===M,H=(0,o.useCallback)(()=>{null==f||f()},[f]),K=(0,I.n)(e=>e.userId),Q=(0,I.n)(e=>e.authorityEpoch),G=(0,I.n)(e=>e.accessToken),es=(0,eo.cD)(e=>e.builtInStyles),ed=(0,eo.cD)(e=>e.releaseTruthReady),eu=(0,eo.cD)(e=>e.fetchStyles),[em,eb]=(0,o.useState)([]),[ep,eh]=(0,o.useState)(null),[ef,eg]=(0,o.useState)(null),[ey,ex]=(0,o.useState)([]),[ej,eN]=(0,o.useState)([]),[eS,eA]=(0,o.useState)(null),e_=(null==eS?void 0:eS.kind)!=="propose_world_fact"||("npc"===eS.payload.kind||"place"===eS.payload.kind||"event"===eS.payload.kind)&&"string"==typeof eS.payload.name&&eS.payload.name.trim().length>=2&&"string"==typeof eS.payload.description&&eS.payload.description.trim().length>=8,[eC,eI]=(0,o.useState)(!1),[eM,eR]=(0,o.useState)(!1),[eE,eP]=(0,o.useState)(null),[eT,ez]=(0,o.useState)(""),[eD,eY]=(0,o.useState)(!1),[eQ,eG]=(0,o.useState)(null),[e$,eX]=(0,o.useState)(void 0),e2=(0,ea.ZT)(),rn=(0,en.CA)(e=>e.characterIds),ro=(0,en.CA)(e=>e.castSelectionAuthority),ri=(0,en.CA)(e=>e.setCharacterIds),rs=(0,en.CA)(e=>e.setCastSelectionAuthority),[rl,rc]=(0,o.useState)(()=>ro?e6(rn):[]),[rd,ru]=(0,o.useState)(!1),[rm,rb]=(0,o.useState)([]),[rp,rh]=(0,o.useState)(!1),[rf,rg]=(0,o.useState)(!1),[ry,rx]=(0,o.useState)(null),rv=(0,o.useRef)(null),rw=(0,o.useRef)(null),rk=(0,o.useRef)(null),rj=(0,o.useRef)(!0),rN=(0,o.useRef)(!1),rS=(0,o.useRef)(!1),rA=(0,o.useRef)(null),r_=(0,o.useRef)(null),rC=(0,o.useRef)({initialUserMessage:T,initialOrder:z,onInitialTurnConsumed:D}),rI=!!ef&&((null==ef?void 0:ef.principalId)!==K||(null==ef?void 0:ef.authorityEpoch)!==Q),rM=(0,o.useCallback)(e=>{if(!rt(e))return null;let r=Symbol("conductor-pending-owner");return r_.current=r,eg({principalId:e.principalId,authorityEpoch:e.authorityEpoch}),eR(!0),r},[]),rR=(0,o.useCallback)(e=>{r_.current===e&&(r_.current=null,rj.current&&eR(!1))},[]);(0,o.useLayoutEffect)(()=>{rI&&(rN.current=!1,rx(null),r_.current=null,rC.current={initialUserMessage:void 0,initialOrder:void 0,onInitialTurnConsumed:void 0},rA.current&&clearTimeout(rA.current),rA.current=null,rS.current=!1,eb([]),eh(null),eg(null),ex([]),eN([]),eA(null),eI(!1),eR(!1),eP(null),ez(""),eY
1(!1),eG(null),eX(void 0),rc([]),ru(!1),rb([]),rh(!1),rg(!1))},[rI]),(0,ee.r)(rv,B,H),(0,o.useEffect)(()=>{if(!R||eM||rf)return;let e=requestAnimationFrame(()=>{var e;return null==(e=rk.current)?void 0:e.focus()});return()=>cancelAnimationFrame(e)},[rf,R,eM]),(0,o.useEffect)(()=>(rj.current=!0,()=>{rj.current=!1}),[]),(0,o.useEffect)(()=>{let e=eo.cD.getState();e.loading||e.releaseTruthReady||eu()},[eu]),(0,o.useEffect)(()=>()=>{rA.current&&clearTimeout(rA.current)},[]),(0,o.useEffect)(()=>{rc(ro?e6(rn):[])},[ro,rn]);let rE=(0,o.useCallback)(e=>{let r=e6(e);ru(!0),rc(r),ri(r),rs(r.length>0?"explicit_selection":null)},[rs,ri]);(0,o.useEffect)(()=>{if(!B)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[B]);let rP=(0,o.useCallback)((e,r)=>{var t,a,n;if(!rj.current||!rt(r))return!1;let o=e6(e.order.characterIds);if(eg({principalId:r.principalId,authorityEpoch:r.authorityEpoch}),eh(e.order),!rd){if(!rt(r))return!1;rc(o),ri(o),rs(null!=(a=e.order.castSelectionAuthority)?a:null)}return ex(P&&e.storyContext?(null==(t=e.storyContext.worldPremiere)?void 0:t.eligible)&&Array.isArray(e.quickReplies)?e.quickReplies:[O("conductor.journey.quickReply.next.v1","What happens next?"),O("conductor.journey.quickReply.leave.v1","Is it safe to leave?"),O("conductor.journey.quickReply.finish.v1","Help me finish it")]:Array.isArray(e.quickReplies)?e.quickReplies:[]),eN(Array.isArray(e.notes)?e.notes:[]),eA(null!=(n=e.action)?n:null),eI(!!e.readyToCreate),eX(e.storyContext),!0},[rd,P,rs,ri,O]),rT=(0,o.useCallback)(()=>{var e;let r=re(ep,rl,rd),t=r.length>0?null!=(e=null==ep?void 0:ep.castSelectionAuthority)?e:ro:null;return ep?{...ep,characterIds:r,castSelectionAuthority:t}:r.length>0?{characterIds:r,castSelectionAuthority:t}:null},[ep,rl,rd,ro]),rz=(0,o.useCallback)(e=>{e instanceof j.hD&&429===e.status?eP(O("conductor.busy","He's mid-scene â give him a minute and try again.")):eP(O("conductor.error","Something broke â your conversation is safe, try again."))},[O]),rL=(0,o.useCallback)(e=>{if(C)return O("conductor.welcome.greeting.storyStudio",e9);if(P)return e.storyContext?O("conductor.journey.opening.v1","I'm looking at this story's verified production state. Ask me what it means or what to do next."):O("conductor.journey.unavailable.v1","I couldn't verify this story's status right now, so I won't guess. Your Library is still safe.");let r=e.opening;if(!r)return e.assistantMessage;if("episode"===r.lane&&r.storyTitle){var t;return O("conductor.opening.episode.v2",'I can continue "{{title}}" as Episode {{n}}. Or tell me what you want instead.',{title:r.storyTitle,n:null!=(t=r.nextEpisode)?t:2})}return"muse"===r.lane?O("conductor.opening.museFromHistory","Fresh idea from your past stories: {{prompt}} â or tell me what you want instead.",{prompt:r.prompt}):O("conductor.opening.promptIdea","Story idea: {{prompt}} â or tell me exactly what you want.",{prompt:r.prompt})},[P,O,C]);(0,o.useEffect)(()=>{var e,r,t,a,n;let o,i=rr();if(!i)return;let s=!rN.current,l=null;if(s){let t=rC.current;l=null!=(r=null==(e=t.initialUserMessage)?void 0:e.trim().slice(0,500))?r:null,o=t.initialOrder}else{if(!ry||ry.principalId!==i.principalId||ry.failedToken===i.authorizationToken||em.length!==ry.expectedMessageCount||null!==ry.expectedFirstRole&&(null==(t=em[0])?void 0:t.role)!==ry.expectedFirstRole)return;l=ry.initialMessage,o=ry.initialOrder,rx(null),eP(null)}rN.current=!0;let c=l?[{role:"user",text:l}]:null;c&&s&&(null==(a=(n=rC.current).onInitialTurnConsumed)||a.call(n),eb(c));let d=rM(i);d&&(C&&!c&&s&&(eb([{role:"assistant",text:O("conductor.welcome.greeting.storyStudio",e9).slice(0,500)}]),rt(i)&&(0,S.H)("spark_surface_viewed",{source:"onboard_conductor"})),(async()=>{try{var e,r,t;let a=await (0,j.$P)("/api/me/conductor",{messages:null!=c?c:[],currentOrder:c?o:void 0,locale:U,contextStoryId:P,platform:"web"},{authorizationToken:i.authorizationToken});if(!rj.current||!rt(i)||!rP(a,i)||!rt(i))return;if(c)eb(e7([...c,{role:"assistant",text:a.assistantMessage.slice(0,500)}]));else if(C){if(e8){let t=X(null==(e=a.order)?void 0:e.prompt,null==(r=a.opening)?void 0:r.prompt);t&&eb(e=>[...e,{role:"assistant",text:O("conductor.welcome.readyIdeaV2",'I\'ve already lined one up for you:\n\n"{{prompt}}"\n\nTap Make it to start it now, pick another idea below, or tell me your own.',{prompt:t}).slice(0,500)}])}}else eb([{role:"assistant",text:rL(a).slice(0,500)}]);if(!rt(i))return;eG(null!=(t=a.opening)?t:null)}catch(e){if(!rj.current||!rt(i))return;s&&e instanceof j.hD&&401===e.status&&rx({principalId:i.principalId,failedToken:i.authorizationToken,initialMessage:l,initialOrder:o,expectedMessageCount:c?1:+!!C,expectedFirstRole:c?"user":C?"assistant":null}),C||rz(e)}finally{rR(d)}})())},[K,Q,G,ry]);let rD=(0,o.useCallback)(async()=>
1{if(eM)return;let e=rr();if(!e)return;let r=rM(e);if(r){eP(null);try{var t;let r=await (0,j.$P)("/api/me/conductor",{messages:[],locale:U,refresh:!0,contextStoryId:P,platform:"web"},{authorizationToken:e.authorizationToken});if(!rj.current||!rt(e)||!rP(r,e)||!rt(e)||(eb([{role:"assistant",text:rL(r).slice(0,500)}]),!rt(e)))return;eG(null!=(t=r.opening)?t:null)}catch(r){if(!rj.current||!rt(e))return;rz(r)}finally{rR(r)}}},[eM,U,P,rL,rP,rz,rM,rR]);(0,o.useEffect)(()=>{let e=rw.current;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})},[em.length,eM,eS,ej.length,eE]);let rq=(0,o.useCallback)(async e=>{let r=e.trim().slice(0,500);if(!r||eM)return;let t=rr();if(!t||ef&&!ra(ef,t))return;let a=rM(t);if(!a)return;eP(null),ex([]);let n=e7([...em,{role:"user",text:r}]);eb(n),ez("");let o=n.filter(e=>"user"===e.role).length;try{var i;let e=await (0,j.$P)("/api/me/conductor",{messages:n,currentOrder:rT(),locale:U,contextStoryId:P,platform:"web"},{authorizationToken:t.authorizationToken});if(!rj.current||!rt(t)||!rP(e,t)||!rt(t)||(eb(e7([...n,{role:"assistant",text:e.assistantMessage.slice(0,500)}])),!rt(t))||(null==g||g(),!rt(t)))return;(0,N.u4)("conductor_turn",{turn:o,story_id:P,context_state:null==(i=e.storyContext)?void 0:i.state})}catch(e){if(!rj.current||!rt(t))return;rz(e)}finally{rR(a)}},[em,rT,eM,U,P,rP,rz,ef,rM,rR,g]),rF=(0,o.useCallback)(async()=>{if(!eS||eM)return;let e=rr();if(!e||ef&&!ra(ef,e))return;let r=rM(e);if(!r)return;eP(null);let t=e7(em);try{let r=await (0,j.$P)("/api/me/conductor",{messages:t,currentOrder:rT(),approveAction:eS,approveActionId:eS.id,locale:U,contextStoryId:P,platform:"web"},{authorizationToken:e.authorizationToken});if(!rj.current||!rt(e)||!rP(r,e)||!rt(e))return;eb(e7([...t,{role:"assistant",text:r.assistantMessage.slice(0,500)}]))}catch(r){if(!rj.current||!rt(e))return;rz(r)}finally{rR(r)}},[eS,em,rT,eM,U,P,rP,rz,ef,rM,rR]),rO=(0,o.useCallback)(()=>eA(null),[]),rU=(0,ei.Iy)(null==ep?void 0:ep.storyPilot,es),rV=rU&&!!(null==(d=(c={prompt:null==ep?void 0:ep.prompt,pending:eM,hasAction:!!eS,referenceNotReady:rp,activating:rf}).prompt)?void 0:d.trim())&&!c.pending&&!c.hasAction&&!c.referenceNotReady&&!c.activating,rB=function(e){var r,t,a,n,o,i;if(String(null!=(a=null==(r=e.order)?void 0:r.resonanceRoundId)?a:"").trim())return e.t("resonance.worldPulse.makeEpisode","Make this episode");if(String(null!=(n=null==(t=e.order)?void 0:t.parentStoryId)?n:"").trim()){let r=J(null==(o=e.order)?void 0:o.seriesName)||J(null==(i=e.order)?void 0:i.title);return r?e.t("conductor.cta.continueSeriesV2","Continue {{series}}",{series:r}):e.t("conductor.cta.continueStoryV2","Continue story")}return e.readyToCreate?e.t("conductor.makeItV2","Make it"):e.t("conductor.useSettingsV2","Use these settings")}({order:ep,readyToCreate:eC,t:O});(0,o.useEffect)(()=>{(null==ep?void 0:ep.storyPilot)&&ed&&!rU&&eh(e=>(null==e?void 0:e.storyPilot)===ep.storyPilot?{...e,storyPilot:"auto"}:e)},[null==ep?void 0:ep.storyPilot,ed,rU]);let rH=e4&&!eM&&rV,rK=X(null==ep?void 0:ep.prompt,null==eQ?void 0:eQ.prompt);(0,o.useEffect)(()=>{C&&(null==q||q(rK.trim()||null))},[C,q,rK]);let rW=!!(null==eQ?void 0:eQ.prompt)&&!(null==ep?void 0:ep.prompt),rY=!!(null==eQ?void 0:eQ.prompt)&&!C&&((null==eQ?void 0:eQ.lane)==="muse"||(null==eQ?void 0:eQ.lane)==="prompt"),rZ=(0,o.useMemo)(()=>C?[{key:"whatif",label:O("conductor.starter.whatifV2","A mind-bending what-if"),seed:O("conductor.starter.whatif.seed","A wild, mind-bending what-if story")},{key:"mockumentary",label:O("conductor.starter.mockumentaryV2","A funny mockumentary"),seed:O("conductor.starter.mockumentary.seed","A funny mockumentary")},{key:"bedtime",label:O("conductor.starter.bedtimeV2","A cozy bedtime story"),seed:O("conductor.starter.bedtime.seed","A cozy, calming bedtime story")},{key:"surprise",label:O("conductor.starter.surpriseV2","Surprise me"),seed:O("conductor.starter.surprise.seed","Surprise me â pick something amazing and run with it")}]:[],[C,O]),rQ=C&&!eM&&em.length>0&&em.every(e=>"user"!==e.role),rG=(null!=(m=(u={firstRun:C,canMake:rV,pending:eM,hasAction:!!eS,readyPromptPreview:rK,firstTapEnabled:e8}
1).firstTapEnabled)?m:$())&&!0===u.firstRun&&u.canMake&&!u.pending&&!u.hasAction&&!!u.readyPromptPreview.trim(),r$=(null!=(p=(b={firstRun:C,showStarters:rQ,readyToCreate:eC,orderPrompt:null==ep?void 0:ep.prompt,firstTapEnabled:e8}).firstTapEnabled)?p:$())&&!0===b.firstRun&&b.showStarters&&b.readyToCreate&&!!String(b.orderPrompt||"").trim(),rX=(0,o.useCallback)(function(){var e;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"footer";if(!ep||!rV||rS.current)return;let t=rr();if(!t||!ra(ef,t)||!rt(t))return;rS.current=!0,rg(!0),rA.current&&clearTimeout(rA.current),rA.current=setTimeout(()=>{rS.current=!1,rj.current&&rg(!1)},5e3);let a=re(ep,rl,rd),n={...ep,characterIds:a,castSelectionAuthority:a.length>0?rd?"explicit_selection":null!=(e=ep.castSelectionAuthority)?e:ro:null,referenceImageUrls:rm},o=(0,A.q)(n,{principalId:t.principalId,authorityEpoch:t.authorityEpoch,source:"conductor"});if(null===o||!rt(t)){rA.current&&clearTimeout(rA.current),rA.current=null,rS.current=!1,rj.current&&rg(!1);return}if(rt(t)&&(null==g||g(),rt(t))&&((0,S.H)("spark_first_seed_source",{source:"conductor"}),rt(t)))(0,S.H)("spark_create_started",{source:"conductor",seed_source:"conductor",conductor_create_source:r}),rt(t)&&((0,N.u4)("conductor_order_applied",{turns:em.filter(e=>"user"===e.role).length,fields_set:o,surface:"web",create_source:r,picked_cast:a.length,picked_refs:rm.length}),rt(t)&&((0,_.en)(),H()))},[ep,rV,em,H,rd,rl,rm,ef,g,ro]),rJ=null!=(a=en.oP[null!=(t=null==ep?void 0:ep.imageModel)?t:"gemini"])?a:3,r0=(0,o.useCallback)(e=>{e.preventDefault(),rq(eT)},[eT,rq]),r1=(0,o.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),rq(eT))},[eT,rq]),{characters:r2}=(0,er.Ib)("all"),r5=(0,o.useMemo)(()=>{var e,r,t;let a={id:"brief",label:O("conductor.board.section.brief","Story brief"),items:[]},n={id:"direction",label:O("conductor.board.section.direction","Creative direction"),items:[]},o={id:"delivery",label:O("conductor.board.section.delivery","Delivery"),items:[]},i=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:160;return e.length>r?"".concat(e.slice(0,r-1),"â¦"):e},s=function(e,r,t,a){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];null!=a&&""!==a&&e.items.push({id:r,label:t,value:i(String(a)),wide:n})},l=()=>{0!==rm.length&&s(n,"references",O("conductor.pickers.reference","Reference"),O("conductor.board.referencesSelected","{{count}} selected",{count:rm.length}))};if(!ep)return l(),[a,n,o];s(a,"story",O("conductor.board.story","Story"),ep.prompt,!0),s(a,"title",O("conductor.board.titleField","Title"),ep.title),ep.parentStoryId&&(s(a,"series",O("conductor.board.series","Series"),null!=(r=ep.seriesName)?r:ep.title),s(a,"episode",O("conductor.board.episode","Episode"),null!=(t=ep.episodeNumber)?t:2)),s(n,"theme",O("conductor.board.theme","Theme"),ep.customTheme||(ep.theme?O("theme.".concat(ep.theme),ep.theme):null)),s(n,"style",O("conductor.board.visualStyle","Visual style"),ep.customStyle||(ep.imageStyle?O("style.".concat(ep.imageStyle),ep.imageStyle):null)),s(n,"story-pilot",O("conductor.board.storyPilot","Story Pilot"),ep.storyPilot?(()=>{let e=en.yt.find(e=>e.id===ep.storyPilot);return e?O(e.nameKey,e.name):ep.storyPilot})():null),s(n,"curation",O("curator.recipe.title","Curated"),null==(e=ep.curation)?void 0:e.name),s(n,"world",O("conductor.board.world","World"),[ep.worldId===Z.Ei?O("conductor.world.prime","Myria Prime"):ep.worldName||(ep.worldId?O("conductor.world.named","Living world"):O("conductor.world.none","No world")),ep.worldReason].filter(Boolean).join(" â ")),s(n,"image-direction",O("conductor.board.imageDirection","Image direction"),ep.imageDirective,!0),l();let c=ep.imageModel&&(0,ec.TQ)(ep.imageModel)?"creator"!==ep.imageModelAuthority?O("library.imageModel.automaticWithModel","Automatic â {{model}}",{model:ec.a8[ep.imageModel].name}):ec.a8[ep.imageModel].name:ep.imageModel;return s(o,"model",O("conductor.board.model","Model"),c),s(o,"quality",O("conductor.board.quality","Quality"),ep.imageQuality),s(o,"voice",O("conductor.board.voice","Voice"),ep.voiceId),s(o,"narration",O("conductor.board.narration","Narration"),ep.customNarrationStyle||(ep.narrationStyle?O("library.narrationStyle.".concat(ep.narrationStyle),ep.narrationStyle.charAt(0).toUpperCase()+ep.narrationStyle.slice(1)):null)),s(o,"language",O("conductor.board.language","Language"),ep.language),s(o,"frame",O("conductor.board.frame","Frame"),ep.aspectRatio),s(o,"pace",O("conductor.board.pace","Pace"),ep.wpm?"".concat(ep.wpm," wpm"):null),s(o,"lens",O("conductor.board.lens","Lens"),ep.cameraLens?O("cameraLens.".concat(ep.cameraLens),ep.cameraLens):null),[a,n,o]},[ep,rm.length,O]),r3=(0,o.useMemo)(()=>re(ep,rl,rd),[ep,rl,rd]),r4=(0,o.useMemo)(()=>
1{if(!(null==ep?void 0:ep.storyPilot)||!ep.prompt)return null;let e=el.m8.find(e=>e.id===ep.storyPilot);if(!e)return null;let r=function(e){var r,t,a,n,o,i,s,l,c,d,u,m,b,p,h,f,g,y,x,v;let w,k,j=function(e){let r=eZ.filter(r=>{let[t]=r;return t.test(e)}).map(e=>{let[,r]=e;return r});return r.length>0?"".concat(e,"\n").concat([...new Set(r)].join(" ")):e}(eq(String(e.prompt||"").trim())),N=e0(e.explicitStyleId),S=e0(null==(r=e.parent)?void 0:r.styleId),A=null!=N?N:S,_=e1(j);if(_&&A&&"story_explainer"!==A)w="story_explainer",k="safety_reroute";else if(S&&(!N||N===S))w=S,k="continuation";else if(N)w=N,k="explicit";else if(_)w="story_explainer",k="structural_intent";else{let r=function(e){let r=e.prompt;return e.hasSourceVideo?"viral_copy":e.hasPhotoSequence?"slideshow_story":/\b(?:rank|tier list|s tier|ranking)\b/i.test(r)?"ranktier":/\b(?:quiz|which .{0,40} are you|guess (?:who|what|which)|reveal quiz|birth month)\b/i.test(r)?"quiz":/\b(?:eye reveal|eyes? close[- ]?up|iris macro)\b/i.test(r)?"charactereyes":/\b(?:villain showcase|dark character showcase|meet the villain)\b/i.test(r)?"villain":/\b(?:30[- ]?day transformation|transformation journey|day 1 .* day 30)\b/i.test(r)?"transformation_drop":/\b(?:before and after|before\/after|glow[- ]?up)\b/i.test(r)?"before_after_glow":/\b(?:fruit drama|object drama|anthropomorphic (?:fruit|object)|product soap)\b/i.test(r)?"fruitdrama":null}(e);r?(w=r,k=e.hasSourceVideo||e.hasPhotoSequence?"required_input":"specialist_intent"):k="movie"!==(w=function(e){return e1(e)?"story_explainer":ew.test(e)?"mockumentary":ek.test(e)?"movie":eH.test(e)?"fable":eK.test(e)?"whatif":eL.test(eq(e))?"drama":eF.test(e)&&eO.test(e)&&eU.test(e)?"horror_twist":eF.test(e)?"mystery_case":eO.test(e)&&eU.test(e)?"horror_twist":eV.test(e)&&eB.test(e)?"worlds_beyond":eW.test(e)?"viral":/\b(?:series|episode|adventure|quest|mission)\b/i.test(e)?"series":"movie"}(j))||ek.test(j)?"structural_intent":"fallback"}let C=(0,el.Q8)(w),I="continuation"===k?null==(t=e.parent)?void 0:t.mode:void 0,M="continuation"===k?null!=(d=null==(a=e.parent)?void 0:a.seriality)?d:"continuation":void 0,R=ev.test(j)?"continuation":void 0,E=C?function(e,r,t){var a;let n=(0,el.Q8)(e);if(!n||!n.modes.length)return null;let o=String(r||"").trim();return o&&n.modes.some(e=>e.id===o)?o:null!=(a=function(e,r){var t,a,n;let o=r.toLowerCase();return null!=(n=null==(a=({drama:[["romance",/\b(?:romance|romantic|love|lovers|dating|marriage)\b/i],["family",/\b(?:family|parent|mother|father|sibling|generational)\b/i],["revenge",/\b(?:revenge|vengeance|payback|wronged)\b/i],["workplace",/\b(?:workplace|office|coworker|boss|job)\b/i],["melodrama",/\b(?:melodrama|telenovela|soap opera|heightened)\b/i],["slice_of_life",/\b(?:slice of life|everyday|grounded daily)\b/i]],worlds_beyond:[["romantasy",/\bromantasy\b/i],["steampunk",/\bsteampunk\b/i],["magical_realism",/\bmagical realism\b/i],["portal",/\bportal|other world|isekai\b/i],["science_fiction",/\bsci(?:ence)?[- ]?fi|future|space|alien|technology|robot|mars|dying star\b/i],["cosmic",/\bcosmic|galactic|universe\b/i],["mythic",/\bmythic|mythology|legend|ancient god\b/i],["fantasy",/\bfantasy|magic|dragon|wizard|enchanted\b/i]],horror_twist:[["found_footage",/\bfound footage|body ?cam|handheld recording\b/i],["analog_horror",/\banalog horror|vhs|broadcast|emergency tape\b/i],["psychological",/\bpsychological|unreliable|paranoia|perception\b/i],["creature",/\bcreature|monster|beast\b/i],["supernatural",/\bsupernatural|ghost|haunted|curse|demon\b/i]],mystery_case:[["cozy_mystery",/\bcozy|cosy|village|small town\b/i],["noir",/\bnoir|hardboiled|neon detective\b|\bdetective\b[^.!?]{0,40}\bneon\b|\bneon\b[^.!?]{0,40}\bdetective\b/i],["crime_procedural",/\bprocedural|forensic|evidence lab|police method\b/i],["heist",/\bheist|robbery|stolen\b/i],["paranormal",/\bparanormal|haunted clues?|ghost evidence\b/i],["conspiracy",/\bconspiracy|cover[- ]?up|hidden system\b/i],["detective",/\bdetective|investigat|clue|whodunn?it|solve\b/i]],viral:[["workplace",/\bworkplace|office|coworker|boss|job\b/i],["family",/\bfamily|parent|sibling|household\b/i],["pov",/\bpov\b/i],["awkward",/\bawkward|embarrass|cringe\b/i],["escalation",/\bescalat|keeps getting worse|snowball\b/i]],fable:[["bedtime",/\bbedtime|sleep story|soothing\b/i],["moral_fable",/\bfable|moral|lesson\b/i],["fairytale",/\bfairy ?tale|princess|enchanted kingdom\b/i],["folk_tale",/\bfolk ?tale|folklore|traditional tale\b/i],["gentle_adventure",/\bgentle adventure|little quest\b/i]],story_explainer:[["myth_buster",/\bmyth|misconception|debunk|fact check\b/i],["biography",/\bbiograph|life of|career of|profile of|who (?:is|was)\b/i],["mini_documentary",/\bdocumentary|history|true story|true crime|real (?:criminal )?case|current event|breaking news|latest news|today(?:'s|âs) (?:news|headlines?)|ongoing (?:war|conflict)\b/i],["how_it_works",/\bhow (?:does|do|did|it works?)|\bhow\b[^.!?]{1,80}
1\bworks?\b|mechanism\b/i],["story_analogy",/\banalogy|as a story|simple story\b/i]]})[e])||null==(t=a.find(e=>{let[,r]=e;return r.test(o)}))?void 0:t[0])?n:null}(e,t))?a:n.defaultMode}(w,null!=(u=null==(n=e.options)?void 0:n.mode)?u:I,j):null!=(b=null!=(m=null==(o=e.options)?void 0:o.mode)?m:I)?b:null,P=function(e,r){let t=(0,el.Q8)(e);return t?r&&t.supportedSerialities.includes(r)?r:t.defaultSeriality:null!=r?r:"one_shot"}(w,null!=(h=null!=(p=null==(i=e.options)?void 0:i.seriality)?p:R)?h:M),T=null!=(g=null!=(f=null==(s=e.options)?void 0:s.audienceBand)?f:"continuation"===k?null==(l=e.parent)?void 0:l.audienceBand:null)?g:"fable"===w?"family":null,z=(null!=(y=null==C?void 0:C.requiredInputs)?y:[]).filter(r=>"source_video"!==r||!0!==e.hasSourceVideo);return{styleId:w,mode:E,seriality:P,audienceBand:T,promptVersion:null!=(x=null==C?void 0:C.promptVersion)?x:null,routingSource:k,themeTags:eJ.filter(e=>{let[,r]=e;return r.test(j)}).map(e=>{let[r]=e;return r}),readiness:0===z.length?"ready":"missing_required_input",missingRequiredInputs:[...z],..."continuation"===k?{worldSeed:null!=(v=null==(c=e.parent)?void 0:c.worldSeed)?v:null}:{}}}({prompt:ep.prompt,explicitStyleId:ep.storyPilot}),t=r.mode?e.modes.find(e=>e.id===r.mode):null;return{label:[O(e.nameKey,e.name),t?O(t.nameKey,t.name):null,O("generationOptions.seriality.".concat(r.seriality,".v2"),"one_shot"===r.seriality?"One-shot":"episode"===r.seriality?"Episode":"Continuation"),"story_explainer"===r.styleId?O("generationOptions.grounding.web.v2","Search the web"):null].filter(e=>!!e).join(" \xb7 "),styleId:r.styleId}},[ep,O]),r8=(0,o.useMemo)(()=>r3.map(e=>r2.find(r=>r.id===e)).filter(e=>!!e),[r3,r2]),r9=r3.length>0,r7=0===r8.length?null:r8.length<=2?r8.map(e=>e.name).join(" & "):"".concat(r8[0].name,", ").concat(r8[1].name," +").concat(r8.length-2),r6=r9?(0,n.jsx)("span",{className:"flex min-w-0 items-center gap-1.5 text-[11px] text-purple-100",title:null!=r7?r7:void 0,children:r8.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"flex shrink-0 -space-x-1.5",children:r8.slice(0,3).map(e=>(0,n.jsx)("span",{className:"relative h-4 w-4 shrink-0 overflow-hidden rounded-full bg-purple-500/20 ring-1 ring-[--card]",children:e.primaryImageUrl?(0,n.jsx)(E.p,{src:e.primaryImageUrl,alt:e.name,fill:!0,className:"object-cover",sizes:"16px"}):(0,n.jsx)("span",{className:"flex h-full w-full items-center justify-center","aria-hidden":!0,children:(0,n.jsx)(l.A,{className:"h-2.5 w-2.5"})})},e.id))}),(0,n.jsx)("span",{className:"truncate",children:r7})]}):(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 truncate",children:[(0,n.jsx)(l.A,{"aria-hidden":"true",className:"h-3 w-3 shrink-0"}),(0,n.jsx)("span",{children:r3.length})]})}):null,te={pending:eM||rp||rf,busyReason:rp?"reference":rf?"activation":"conductor",hasError:!!eE,hasOrder:r9||r5.some(e=>e.items.length>0),hasBrief:!!(null==ep||null==(r=ep.prompt)?void 0:r.trim()),hasAction:!!eS,canMake:rV,readyToCreate:eC},tr=P?null!=(s=null==e2?void 0:e2.items.find(e=>e.identity.storyId===P))?s:e$:void 0;if(rI)return null;let tt=(0,n.jsxs)("div",{ref:rv,role:B?"dialog":"region","aria-modal":B?"true":void 0,"aria-label":O("conductor.title.storyStudio","Story Studio"),className:B?"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-[--card] shadow-2xl sm:h-[min(94dvh,56rem)] sm:max-h-[56rem] sm:w-[min(52rem,calc(100%-2rem))] sm:rounded-2xl sm:border sm:border-[--border]":"flex h-[min(88svh,820px)] min-h-[520px] w-full flex-col overflow-hidden rounded-xl border border-[--border] bg-[--card] shadow-sm ".concat(F),children:[(0,n.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b border-[--border] px-4 py-3 sm:px-5",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,n.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-brand/25 bg-brand/10 text-brand",children:(0,n.jsx)(h.A,{"aria-hidden":"true",className:"h-4 w-4"})}),(0,n.jsxs)("span",{className:"min-w-0",children:[(0,n.jsx)("h2",{className:"truncate text-sm font-bold text-white",children:O("conductor.title.storyStudio","Story Studio")}
1),(0,n.jsx)("span",{className:"hidden truncate text-[11px] text-[--muted] sm:block",children:O("conductor.subtitle.productionRoom","Brief, direct, and produce in one room.")})]})]}),B&&(0,n.jsx)("button",{type:"button",onClick:H,"aria-label":O("conductor.close.storyStudio","Close Story Studio"),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-lg text-[--muted] transition-colors hover:bg-white/10 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:(0,n.jsx)(y.A,{"aria-hidden":"true",className:"h-5 w-5"})})]}),tr?(0,n.jsxs)("div",{className:"shrink-0 border-b border-violet-300/15 bg-violet-500/[0.055] px-4 py-3 sm:px-5",children:[(0,n.jsx)("p",{className:"mb-2 text-[11px] font-extrabold uppercase tracking-wide text-violet-200",children:O("conductor.liveProduction.v1","Live production")}),(0,n.jsx)(et.c,{item:tr,compact:!0,onRetry:null==e2?void 0:e2.refresh,onClick:e2?()=>{e2.openArtifact(tr,"conductor"),H()}:void 0})]}):null,(0,n.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,n.jsx)("div",{className:"shrink-0",children:(0,n.jsx)(W,{t:O,onStageOrder:(e,r)=>{eh(e),eI(!0),(0,N.u4)("resonance_answer_plan_staged",{round_id:r})}})}),(0,n.jsx)("div",{className:"shrink-0 lg:hidden",children:(0,n.jsx)(V,{t:O,state:te,sections:r5,order:ep,cast:r6,castLabel:O("conductor.pickers.cast","Cast"),createCtaLabel:rB,onMake:()=>rX("board"),variant:"compact",open:eD,onOpenChange:eY})}),r4?(0,n.jsxs)("div",{className:"shrink-0 border-b border-[--border] bg-brand/[0.035] px-4 py-2.5",children:[(0,n.jsxs)("p",{className:"text-[11px] font-semibold text-brand-light",children:[O("conductor.styleReceipt.v1","Resolved story engine"),": ",(0,n.jsx)("span",{className:"font-normal text-white/80",children:r4.label})]}),(0,n.jsx)("div",{className:"mt-2 flex gap-1.5 overflow-x-auto pb-1",role:"radiogroup","aria-label":O("conductor.styleOverride.v1","Override story engine"),children:(0,ei.Sb)(es,"story_engine").map(e=>(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":(null==ep?void 0:ep.storyPilot)===e.id,onClick:()=>eh(r=>r?{...r,storyPilot:e.id}:r),className:"h-8 shrink-0 rounded-full border px-2.5 text-[11px] font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:min-h-9 sm:px-3 sm:text-xs ".concat((null==ep?void 0:ep.storyPilot)===e.id?"border-brand bg-brand/20 text-white":"border-white/10 text-[--muted] hover:text-white"),children:O(e.nameKey,e.name)},e.id))})]}):null,(0,n.jsxs)("div",{className:"shrink-0 border-b border-[--border] px-4 py-2.5",children:[(0,n.jsx)(Y.Y,{worldId:null==ep?void 0:ep.worldId,onChange:e=>eh(r=>{var t;return r?{...r,worldId:e,worldReason:e===r.worldId&&null!=(t=r.worldReason)?t:null}:r})}),(null==ep?void 0:ep.worldReason)?(0,n.jsx)("p",{className:"mt-1.5 text-xs text-[--muted]",children:ep.worldReason}):null]}),(0,n.jsxs)("div",{ref:rw,className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-4",role:"log","aria-live":"polite",children:[em.map((e,r)=>(0,n.jsx)("div",{className:"flex ".concat("user"===e.role?"justify-end":"justify-start"),children:(0,n.jsx)("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl border px-3 py-2 text-sm leading-snug ".concat("user"===e.role?"border-brand bg-brand text-white":"border-[--border] bg-[--bg] text-white"),children:e.text})},r)),ej.length>0&&(0,n.jsx)("div",{className:"space-y-1 rounded-lg border border-amber-400/30 bg-amber-400/10 px-2.5 py-2",children:ej.map((e,r)=>(0,n.jsxs)("p",{className:"flex items-start gap-1.5 text-[12px] text-amber-200/90",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"mt-px shrink-0",children:"â"}),(0,n.jsx)("span",{children:O("conductor.noteAdjusted","Adjusted: {{note}}",{note:e})})]},r))}),rG&&(0,n.jsxs)("button",{type:"button",onClick:()=>rX("ready_card"),className:"group flex w-full flex-col gap-3 rounded-lg border border-brand/45 bg-brand/10 p-3 text-left transition-colors hover:bg-brand/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:flex-row sm:items-center",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block text-[11px] font-extrabold uppercase text-brand",children:O("conductor.readyCard.eyebrow","Ready to make")}),(0,n.jsx)("span",{className:"mt-1 block max-h-10 overflow-hidden break-words text-sm leading-5 text-white",children:rK})]}),(0,n.jsxs)("span",{className:"inline-flex w-full shrink-0 items-center justify-center rounded-lg bg-brand px-3 py-1.5 text-xs font-bold text-white transition-colors group-hover:bg-brand/90 sm:w-auto",children:[(0,n.jsx)(x.A,{"aria-hidden":"true",className:"mr-1.5 h-3.5 w-3.5"}),rB]})]}),eS&&(()=>{var e;let r=null!=(e=e5[eS.kind])?e:v.A;return(0,n.jsxs)("div",{className:"space-y-2 rounded-xl border border-brand/40 bg-brand/10 p-3",children:[(0,n.jsxs)("p",{className:"flex items-start gap-2 text-sm text-white",children:[(0,n.jsx)(r,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0 text-brand"}),(0,n.jsx)("span",{children:eS.summary})]}),"propose_world_fact"===eS.kind&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-wider text-[--muted]",children:O("worldPremiere.proposedState.v1","Proposed \xb7 not canon")}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":O("worldPremiere.factKind.v1","Type of world fact"),children:["npc","place","event"].map(e=>{let r=eS.payload.kind===e;return(0,n.jsx)("button",{type:"button","aria-pressed":r,onClick:()=>eA(r=>r?{...r,payload:{...r.payload,kind:e}}:r),className:"min-h-11 rounded-full border px-3 py-2 text-xs font-bold ".concat(r?"border-brand bg-brand/20 text-brand":"border-[--border] bg-[--bg] text-[--muted]"),children:O("worldPremiere.kind.".concat(e,".v1"),e)},e)})}),(0,n.jsx)("input",{value:"string"==typeof eS.payload.name?eS.payload.name:"",maxLength:80,onChange:e=>eA(r=>r?{...r,payload:{...r.payload,name:e.target.value.slice(0,80)}}:r),"aria-label":O("worldPremiere.factName.v1","Name the mark"),placeholder:O("worldPremiere.factName.v1","Name the mark"),className:"min-h-11 w-full rounded-lg border border-[--border] bg-[--bg] px-3 py-2 text-sm text-white placeholder:text-[--muted] focu
1s:outline-none focus-visible:ring-2 focus-visible:ring-brand"}),(0,n.jsx)("textarea",{value:"string"==typeof eS.payload.description?eS.payload.description:"",maxLength:500,rows:3,onChange:e=>eA(r=>r?{...r,payload:{...r.payload,description:e.target.value.slice(0,500)}}:r),"aria-label":O("worldPremiere.factDescription.v1","Describe what the story adds to this world"),placeholder:O("worldPremiere.factDescription.v1","Describe what the story adds to this world"),className:"w-full resize-y rounded-lg border border-[--border] bg-[--bg] px-3 py-2 text-sm text-white placeholder:text-[--muted] focus:outline-none focus-visible:ring-2 focus-visible:ring-brand"})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>void rF(),disabled:eM||!e_,className:"min-h-11 rounded-lg bg-brand px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-brand/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:opacity-50",children:"propose_world_fact"===eS.kind?O("worldPremiere.submitProposal.v1","Submit proposal"):O("conductor.action.approve","Do it")}),(0,n.jsx)("button",{type:"button",onClick:rO,disabled:eM,className:"min-h-11 rounded-lg border border-[--border] px-3 py-2 text-xs font-semibold text-[--muted] transition-colors hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:opacity-50",children:O("conductor.action.skip","Skip")})]})]})})(),eM&&(0,n.jsx)("div",{className:"flex justify-start",children:(0,n.jsx)("div",{className:"rounded-2xl border border-[--border] bg-[--bg] px-3 py-2 text-sm text-[--muted] motion-safe:animate-pulse",children:O("conductor.thinking","Configuringâ¦")})}),eE&&(0,n.jsx)("p",{className:"text-xs text-red-400",role:"alert",children:eE}),(ey.length>0||rW||rY||rQ)&&!eM&&!rf&&(0,n.jsxs)("div",{className:"flex gap-1.5 overflow-x-auto pb-0.5 scrollbar-thin",children:[r$&&rV&&(0,n.jsxs)("button",{type:"button",onClick:()=>rX("first_run_hero"),className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-brand bg-brand px-2.5 text-[11px] font-bold text-white transition-colors hover:bg-brand/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 sm:px-3 sm:text-xs".concat(rH?" motion-safe:animate-breathe":""),children:[(0,n.jsx)(x.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:O("conductor.makeThisIdeaV2","Make this one")})]}),rQ&&rZ.map(e=>{var r;let t=null!=(r=e3[e.key])?r:v.A;return(0,n.jsxs)("button",{type:"button",onClick:()=>void rq(e.seed),className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-brand/30 bg-brand/10 px-2.5 text-[11px] text-brand transition-colors hover:bg-brand/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 sm:px-3 sm:text-xs",children:[(0,n.jsx)(t,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),(0,n.jsx)("span",{className:"whitespace-nowrap",children:e.label})]},e.key)}),rW&&eQ&&(0,n.jsxs)("button",{type:"button",onClick:()=>void rq(eQ.prompt),className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-brand/30 bg-brand/10 px-2.5 text-[11px] text-brand transition-colors hover:bg-brand/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 sm:px-3 sm:text-xs",children:[(0,n.jsx)(v.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{className:"whitespace-nowrap",children:O("conductor.useIdeaV2","Use this idea")})]}),rY&&(0,n.jsxs)("button",{type:"button",onClick:()=>void rD(),className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-white/10 px-2.5 text-[11px] text-[--muted] transition-colors hover:bg-white/5 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 sm:px-3 sm:text-xs",children:[(0,n.jsx)(w.A,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{className:"whitespace-nowrap",children:O("conductor.refreshIdea.v3","Another idea")})]}),ey.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>void rq(e),className:"h-8 shrink-0 rounded-full border border-brand/30 bg-brand/10 px-2.5 text-[11px] text-brand transition-colors hover:bg-brand/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand sm:h-11 sm:px-3 sm:text-xs",children:(0,n.jsx)("span",{className:"whitespace-nowrap",children:e})},e))]}),(0,n.jsx)(L,{characterIds:rl,onCharacterIdsChange:rE,referenceImageUrls:rm,onAddReferenceImage:e=>rb(r=>[...r,e].slice(-rJ)),onRemoveReferenceImage:e=>rb(r=>r.filter((r,t)=>t!==e)),maxRefs:rJ,disabled:eM||rf,onReferenceNotReadyChange:rh}),!eD&&(0,n.jsxs)("button",{type:"button",onClick:()=>rX("footer"),disabled:eM||!rV,"aria-busy":rf,className:"inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg bg-brand px-4 py-2 text-sm font-bold text-white transition-colors hover:bg-brand/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:opacity-50 sm:min-h-11 lg:border lg:border-brand/40 lg:bg-brand/10 lg:text-brand lg:hover:bg-brand/15".concat(rH?" motion-safe:animate-breathe":"").concat(rV&&!eS?" lg:hidden":""),children:[(0,n.jsx)(x.A,{"aria-hidden":"true",className:"h-4 w-4"}),(0,n.jsx)("span",{children:rB})]})]}),(0,n.jsx)("div",{className:"flex shrink-0 flex-col border-t border-[--border] bg-[--card] px-3 pt-2 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:(0,n.jsxs)("form",{onSubmit:r0,className:"flex shrink-0 items-end gap-2",children:[(0,n.jsx)("textarea",{ref:rk,value:eT,onChange:e=>ez(e.target.value.slice(0,500)),onKeyDown:r1,placeholder:O("conductor.placeholder","Describe the story you wantâ¦"),rows:1,enterKeyHint:"send",maxLength:500,disabled:eM||rf,"aria-label":O("conductor.placeholder","Describe the story you wantâ¦"),className:"max-h-24 min-h-11 flex-1 resize-none rounded-lg border border-[--border] bg-[--bg] px-3 py-2.5 text-sm leading-tight text-white outline-none focus:border-brand focus-visible:ring-2 focus-visible:ring-brand"}),(0,n.jsx)("button",{type:"submit",disabled:!eT.trim()||eM||rf,"aria-busy":eM||rf,className:"min-h-11 rounded-lg bg-brand px-3 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:opacity-50",children:O("conductor.send","Send")})]})})]}),(0,n.jsx)("aside",{className:"hidden w-72 shrink-0 flex-col border-s border-[--border] bg-black/10 lg:flex",children:(0,n.jsx)(V,{t:O,state:te,sections:r5,order:ep,cast:r6,castLabel:O("conductor.pickers.cast","Cast"),createCtaLabel:rB,onMake:()=>rX("board"),variant:"rail"})})]})]});return B?(0,i.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[200] flex h-[100dvh] max-h-[100dvh] flex-col pb-[env(safe-area-inset-bottom,0px)] pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)] pt-[env(safe-area-inset-top,0px)] sm:items-center sm:justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/85 backdrop-blur-sm",onClick:H,"aria-hidden":!0}),tt]}),document.body):tt}},76839:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(75383).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])}}]);
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.