PageSourceSearch

https://www.myria.pro/_next/static/chunks/40982.6f93dbe3ed6ced06.js

js myria.pro collected 2026-10-02 02:08:16 UTC 25,083 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="132342a6-9ed2-45ac-b805-8e8bc5c7b43a",e._sentryDebugIdIdentifier="sentry-dbid-132342a6-9ed2-45ac-b805-8e8bc5c7b43a")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40982],{40982:(e,t,a)=>{a.r(t),a.d(t,{ScreenplayInspectorModal:()=>A});var r=a(73365),n=a(1521),s=a(74174),l=a(72296),i=a(75383);let c=(0,i.A)("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]),o=(0,i.A)("thumbs-down",[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]]);var d=a(54230),u=a(11007),m=a(83786),p=a(97271),h=a(27637),x=a(96942),f=a(62948),y=a(68680),b=a(83892),g=a(10738),v=a(1702),w=a(30321),k=a(73657);let N=["customStyle","customPrompts","imageStyle","imageDirective","useImageDirective"],j=[{key:"screenplayInspector.chipCinematic",fallback:"More cinematic"},{key:"screenplayInspector.chipLessGeneric",fallback:"Less generic"},{key:"screenplayInspector.chipBrighter",fallback:"Brighter, more vivid"},{key:"screenplayInspector.chipSlower",fallback:"Slower, dreamier pacing"},{key:"screenplayInspector.chipRetro",fallback:"More retro / nostalgic"},{key:"screenplayInspector.chipPunchier",fallback:"Punchier captions"}],I=[{value:"off_brief",label:"Off brief"},{value:"weak_hook",label:"Weak hook"},{value:"story",label:"Story"},{value:"visuals",label:"Visuals"},{value:"character_consistency",label:"Characters"},{value:"pacing",label:"Pacing"},{value:"voice_audio",label:"Voice / audio"},{value:"too_generic",label:"Too generic"},{value:"technical",label:"Technical"}],S=(e,t)=>Array.isArray(e)||Array.isArray(t)?JSON.stringify(e)===JSON.stringify(t):e===t,C=["name","intervalMinutes","generationStyle","customStyle","customPrompts","useTrending","useTrendingFormat","trendCategories","imageStyle","imageDirective","useImageDirective","imageModel","narrationStyle","customNarrationStyle","voiceId","narratorPreset","wpm","videoModel","videoDurationSeconds","videoDialogMode","videoCustomDirective","seriesEnabled","seriesName","aspectRatio"],_={name:200,customStyle:2e3,imageDirective:2e3,customNarrationStyle:500,videoCustomDirective:1e3,seriesName:200};function A(e){let{storyId:t,onClose:a}=e,{t:i,locale:A}=(0,g.s)(),D=(0,v.useRouter)(),[P,M]=(0,n.useState)(null),[R,V]=(0,n.useState)(!1),[T,F]=(0,n.useState)(null),[H,E]=(0,n.useState)(null),[O,L]=(0,n.useState)(""),[B,G]=(0,n.useState)(!1),[U,$]=(0,n.useState)(null),[q,W]=(0,n.useState)(t),[Y,J]=(0,n.useState)(null),[Z,z]=(0,n.useState)(null),[K,Q]=(0,n.useState)(null),[X,ee]=(0,n.use
1State)(!1),[et,ea]=(0,n.useState)(null),[er,en]=(0,n.useState)(null),[es,el]=(0,n.useState)([]),[ei,ec]=(0,n.useState)(null),[eo,ed]=(0,n.useState)(""),[eu,em]=(0,n.useState)(!1),[ep,eh]=(0,n.useState)(null),[ex,ef]=(0,n.useState)(!1),ey=(0,n.useRef)(null),[eb,eg]=(0,n.useState)(null),ev=(0,n.useRef)(void 0),ew=(0,n.useRef)(!1);(0,n.useEffect)(()=>(ew.current=!0,()=>{ew.current=!1,clearTimeout(ev.current)}),[]);let[ek,eN]=(0,n.useState)(null),[ej,eI]=(0,n.useState)([]),[eS,eC]=(0,n.useState)(!1),[e_,eA]=(0,n.useState)(!1),eD=async(e,t)=>{if(t)try{if(await navigator.clipboard.writeText(t),!ew.current)return;eg(e),clearTimeout(ev.current);let a=setTimeout(()=>{ev.current===a&&(ev.current=void 0),eg(t=>t===e?null:t)},1500);ev.current=a}catch(e){}},eP=e=>{switch(e){case"customStyle":return i("screenplayInspector.fieldCustomStyle","Style note");case"customPrompts":return i("screenplayInspector.fieldCustomPrompts","Prompts");case"imageStyle":return i("screenplayInspector.fieldImageStyle","Image style");case"imageDirective":return i("screenplayInspector.fieldImageDirective","Image directive");case"useImageDirective":return i("screenplayInspector.fieldUseImageDirective","Use image directive");default:return e}},eM=e=>{if(null==e||""===e)return i("screenplayInspector.none","(none)");if(Array.isArray(e)){if(0===e.length)return i("screenplayInspector.none","(none)");let t=e.join(" / ");return"".concat(e.length,"\xd7 \xb7 ").concat(t.length>70?t.slice(0,70)+"…":t)}if("boolean"==typeof e)return e?"on":"off";let t=String(e);return t.length>90?t.slice(0,90)+"…":t};(0,n.useEffect)(()=>{ey.current&&(ey.current.cancelled=!0),W(t),J(null),em(!1),eh(null),t&&(0,b.H)("screenplay_inspector_opened",{story_id:t}).catch(()=>{})},[t]),(0,n.useEffect)(()=>{if(!q)return;let e=!1;return V(!0),F(null),M(null),E(null),L(""),$(null),Q(null),ea(null),el([]),ec(null),ed(""),eN(null),eI([]),eA(!1),(0,y.apiGet)("/api/story/".concat(q,"/screenplay")).then(t=>{e||(M(t),J(e=>null!=e?e:t.automationId))}).catch(t=>{e||F((0,w.a)(t,i).message)}).finally(()=>{e||V(!1)}),()=>{e=!0}},[q]),(0,n.useEffect)(()=>{if(!Y)return void z(null);let e=!1;return(0,y.apiGet)("/api/automations/".concat(Y)).then(t=>{var a,r,n,s;if(e)return;let l=t.automation||{};z({customStyle:null!=(a=l.customStyle)?a:null,customPrompts:null!=(r=l.customPrompts)?r:[],imageStyle:null!=(n=l.imageStyle)?n:"",imageDirective:null!=(s=l.imageDirective)?s:null,useImageDirective:!!l.useImageDirective})}).catch(()=>{e||z(null)}),()=>{e=!0}},[Y]);let eR=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ej;if((null==P?void 0:P.curation)&&!eS){eN(e),eC(!0),eA(!1);try{await (0,y.$P)("/api/curator/feedback",{storyId:P.storyId,recommendationId:P.curation.id,verdict:e,reasons:"needs_work"===e?t:[]}),eA(!0)}catch(e){F((0,w.a)(e,i).message)}finally{eC(!1)}}},eV=async(e,t)=>{if(Y&&P&&!B&&(!t||ei)){G(!0),$(null),t||(Q(null),ea(null),en(null),el([]),ec(null)),(0,b.H)("screenplay_refine_requested",{automation_id:Y,story_id:q,has_feedback:!!e.trim(),follow_up:t}).catch(()=>{});try{var a;let r={prompt:e.trim()||"Refine this automation based on what it just produced.",feedback:e.trim()||void 0};t&&ei?r.currentForm=function(e){let t={};for(let a of C){let r=e[a];void 0!==r&&("string"==typeof r&&_[a]&&(r=r.slice(0,_[a])),t[a]=r)}return Array.isArray(t.customPrompts)&&(t.customPrompts=t.customPrompts.slice(0,20).map(e=>"string"==typeof e?e.slice(0,3e3):e)),Array.isArray(t.trendCategories)&&(t.trendCategories=t.trendCategories.slice(0,10).map(e=>"string"==typeof e?e.slice(0,50):e)),t}(ei):r.sampleStoryId=P.storyId;let n=await (0,y.$P)("/api/automations/helper",r),s=null!=(a=n.suggestion)?a:{};ec(s),el(a=>[...t?a:[],{feedback:e.trim(),rationale:n.rationale||""}]),ed("");let l=[],c={};for(let e of N){let t=s[e];if(void 0===t)continue;let a=Z?Z[e]:void 0;Z&&S(a,t)||(l.push({key:e,label:eP(e),before:a,after:t}),c[e]=t)}if(0!==l.length||t)Q({rationale:n.rationale||"",changes:l,patch:c});else{let e=i("screenplayInspector.noChanges","Reviewed — looks on-target, no changes suggested.");$({ok:!0,text:n.rationale?"".concat(e," ").concat(n.rationale):e})}}catch(e){$({ok:!1,text:(0,w.a)(e,i).message})}finally{G(!1)}}},eT=()=>{Q(null),el([]),ec(null),ed("")},eF=async()=>
1{if(K&&Y&&!X){ee(!0),$(null);try{let e=!!Z,t={};if(Z)for(let e of K.changes)t[e.key]=Z[e.key];await (0,y.mu)("/api/automations/".concat(Y),{...K.patch,_source:"ai_refine",...K.rationale?{_label:K.rationale.slice(0,500)}:{}}),(0,b.H)("screenplay_refine_applied",{automation_id:Y,story_id:q,fields_modified:K.changes.map(e=>e.key)}).catch(()=>{}),z(e=>e?{...e,...K.patch}:e),ea(e?{prev:t}:null),eT(),$({ok:!0,text:i("screenplayInspector.appliedFuture","Applied ✓ Your next runs will use these settings.")})}catch(e){$({ok:!1,text:(0,w.a)(e,i).message})}finally{ee(!1)}}},eH=async()=>{if(et&&Y&&!X){ee(!0),$(null);try{await (0,y.mu)("/api/automations/".concat(Y),et.prev),z(e=>e?{...e,...et.prev}:e),ea(null),$({ok:!0,text:i("screenplayInspector.reverted","Reverted to your previous settings.")})}catch(e){$({ok:!1,text:(0,w.a)(e,i).message})}finally{ee(!1)}}},eE=async()=>{if(K&&Y&&!X){ee(!0),$(null),en(null);try{var e,t;let a=await (0,y.$P)("/api/automations/".concat(Y,"/variant"),{patch:K.patch});en(null!=(t=null==a||null==(e=a.automation)?void 0:e.id)?t:null),eT(),$({ok:!0,text:i("screenplayInspector.variantCreated","✓ Saved as a new variant (paused) — your original is untouched. Find & enable it in Automations.")})}catch(e){$({ok:!1,text:(0,w.a)(e,i).message})}finally{ee(!1)}}},eO=async()=>{if(!Y||eu)return;em(!0),$(null),eh(i("screenplayInspector.previewStarting","Starting a fresh sample…"));let e={cancelled:!1};ey.current&&(ey.current.cancelled=!0),ey.current=e;let t=Date.now()+(ex?16:10)*6e4;try{let a=await (0,y.$P)("/api/automations/".concat(Y,"/preview"),{videofy:ex});if(e.cancelled)return;let r=a.previewAutomationId;(0,b.H)("fresh_sample_generated",{automation_id:Y,source_story_id:q,videofy:ex}).catch(()=>{}),eh(i("screenplayInspector.previewRendering","Rendering your sample — usually a few minutes. You can keep this open."));let n=async()=>{if(!e.cancelled)try{let a=await (0,y.apiGet)("/api/automations/".concat(r,"/status"));if(e.cancelled)return;if(a.error){em(!1),eh(i("screenplayInspector.previewFailed","Sample generation failed — try again.")),(0,y.Al)("/api/automations/".concat(r)).catch(()=>{});return}if(a.completed&&a.storyId){em(!1),eh(null),(0,y.mu)("/api/automations/".concat(r),{enabled:!1}).catch(()=>{}),(0,b.H)("fresh_sample_viewed",{automation_id:Y,preview_story_id:a.storyId}).catch(()=>{}),W(a.storyId);return}if(a.storyId&&a.frameCount>0&&eh(i("screenplayInspector.previewProgress","Rendering frame {n}/{t}…").replace("{n}",String(a.frameCount)).replace("{t}",String(a.totalFrames))),Date.now()>t){em(!1),eh(i("screenplayInspector.previewSlow","Still rendering — check your Library shortly."));return}setTimeout(n,3e3)}catch(a){if(e.cancelled)return;if(Date.now()>t){em(!1),eh(i("screenplayInspector.previewFailed","Sample generation failed — try again."));return}setTimeout(n,4e3)}};setTimeout(n,3e3)}catch(t){e.cancelled||(em(!1),eh((0,w.a)(t,i).message))}};return(0,r.jsxs)(f.BaseModal,{isOpen:!!t,onClose:a,title:i("screenplayInspector.titleV2","Behind the scenes"),children:[(0,r.jsxs)("div",{className:"mb-3 flex items-start gap-3",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-brand/25 bg-brand/15 text-brand-light",children:(0,r.jsx)(s.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[11px] font-extrabold uppercase text-brand-light",children:i("screenplayInspector.eyebrow","Screenplay Inspector")}),(0,r.jsx)("p",{className:"text-sm text-[--muted]",children:i("screenplayInspector.subtitle","What the AI wrote + rendered, frame by frame.")})]})]}),P&&P.frames.length>0&&(0,r.jsxs)("button",{type:"button",onClick:()=>eD("all",function(e){let t=[];for(let a of(e.title&&t.push(e.title,""),e.frames)){t.push("Frame ".concat(a.frameNumber)),a.textOverlay&&t.push('Caption: "'.concat(a.textOverlay,'"')),a.imageDirective&&t.push("Image: ".concat(a.imageDirective));let e=[a.videoDirective.cameraMotion,a.videoDirective.action].filter(Boolean).join(" \xb7 ");e&&t.push("Motion: ".concat(e));let r=a.narration?(0,k.s)(a.narration):"";r&&t.push("Narration: ".concat(r)),t.push("")}return t.join("\n").trim()}(P)),className:"mb-3 inline-flex items-center gap-1.5 text-xs font-semibold text-brand",children:[(0,r.jsx)(l.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"all"===eb?i("screenplayInspector.copiedAllV2","Copied screenplay"):i("screenplayInspector.copyAllV2","Copy whole screenplay")]}),R&&(0,r.jsx)("div",{className:"py-8 text-center text-[--muted] text-sm",children:"…"}),T&&(0,r.jsx)("p",{className:"text-sm text-red-400 my-4",children:T}),P&&(0,r.jsxs)("div",{className:"space-y-2 max-h-[55vh] overflow-y-auto pr-1",children:[P.curation&&(0,r.jsxs)("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/10 p-3",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-white",children:P.curation.name}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-[--muted]",children:P.curation.rationale}),(0,r.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>eR("love",[]),disabled:eS,className:"inline-flex flex-1 items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-xs font-semibold ".concat("love"===ek?"border-emerald-400 bg-emerald-500/20 text-emerald-200":"border-[--border] text-white"),children:[(0,r.jsx)(c,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("curator.feedback.love","Love it")]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{eN("needs_work"),eA(!1)},disabled:eS,className:"inline-flex flex-1 items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-xs font-semibold ".concat("needs_work"===ek?"border-amber-400 bg-amber-500/15 text-amber-200":"border-[--border] text-white"),children:[(0,r.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("curator.feedback.needsWork","Needs work")]})]}),"needs_work"===ek&&(0,r.jsxs)("div",{className:"mt-2",children:[(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:I.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.value,void(eI(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t].slice(0,5)),eA(!1))},className:"rounded-md border px-2 py-1 text-[11px] ".concat(ej.includes(e.value)?"border-amber-400 bg-amber-500/15 text-amber-100":"border-[--border] text-[--muted]"),children:i("curator.feedback.reason.".concat(e.value),e.label)},e.value))}),(0,r.jsx)("button",{type:"button",onClick:()=>eR("needs_work"),disabled:eS,className:"mt-2 w-full rounded-md bg-brand px-3 py-2 text-xs font-semibold text-white disabled:opacity-60",children:eS?"...":i("curator.feedback.send","Send feedback")})]}),e_&&(0,r.jsx)("p",{className:"mt-2 text-xs text-emerald-300",children:i("curator.feedback.saved","Feedback saved")})]}),P.frames.map(e=>{let t=H===e.frameNumber,a=[e.videoDirective.cameraMotion,e.videoDirective.action].filter(
1Boolean).join(" \xb7 "),n=e.narration?(0,k.s)(e.narration):"";return(0,r.jsxs)("div",{className:"flex gap-3 border border-[--border] rounded-xl p-2 bg-[--surface]",children:[e.imageUrl?(0,r.jsx)("img",{src:e.imageUrl,alt:i("screenplayInspector.frameAlt","Frame {n} render").replace("{n}",String(e.frameNumber)),width:64,height:112,loading:"lazy",decoding:"async",className:"w-16 h-28 rounded-lg object-cover shrink-0"}):(0,r.jsx)("div",{className:"w-16 h-28 rounded-lg bg-[--bg] shrink-0 flex items-center justify-center text-[10px] text-[--muted]",children:i("screenplayInspector.noImage","rendering…")}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-[11px] uppercase tracking-wider text-[--muted] font-bold",children:i("screenplayInspector.frame","Frame {n}").replace("{n}",String(e.frameNumber))}),e.textOverlay&&(0,r.jsx)("div",{className:"text-sm italic text-white mt-0.5",children:"“".concat(e.textOverlay,"”")}),(0,r.jsxs)("button",{type:"button",onClick:()=>E(t?null:e.frameNumber),className:"mt-1 inline-flex items-center gap-1 text-xs font-semibold text-brand",children:[t?(0,r.jsx)(d.A,{className:"h-3 w-3","aria-hidden":"true"}):(0,r.jsx)(u.A,{className:"h-3 w-3","aria-hidden":"true"}),t?i("screenplayInspector.hideV2","Hide prompts"):i("screenplayInspector.showV2","Show prompts")]}),t&&(0,r.jsxs)("div",{className:"mt-1 space-y-1",children:[e.imageDirective&&(0,r.jsxs)("button",{type:"button",onClick:()=>eD("".concat(e.frameNumber,"-img"),e.imageDirective),className:"block w-full text-left",title:i("screenplayInspector.clickToCopy","Click to copy"),children:[(0,r.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider ".concat(eb==="".concat(e.frameNumber,"-img")?"text-emerald-400":"text-[--muted]"),children:[(0,r.jsx)(l.A,{className:"h-3 w-3","aria-hidden":"true"}),eb==="".concat(e.frameNumber,"-img")?i("screenplayInspector.copiedV2","Copied"):i("screenplayInspector.imagePrompt","Image prompt")]}),(0,r.jsx)("div",{className:"text-xs text-white leading-snug",children:e.imageDirective})]}),a&&(0,r.jsxs)("button",{type:"button",onClick:()=>eD("".concat(e.frameNumber,"-mot"),a),className:"block w-full text-left",title:i("screenplayInspector.clickToCopy","Click to copy"),children:[(0,r.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider ".concat(eb==="".concat(e.frameNumber,"-mot")?"text-emerald-400":"text-[--muted]"),children:[(0,r.jsx)(l.A,{className:"h-3 w-3","aria-hidden":"true"}),eb==="".concat(e.frameNumber,"-mot")?i("screenplayInspector.copiedV2","Copied"):i("screenplayInspector.motion","Motion")]}),(0,r.jsx)("div",{className:"text-xs text-white leading-snug",children:a})]}),n&&(0,r.jsxs)("button",{type:"button",onClick:()=>eD("".concat(e.frameNumber,"-nar"),n),className:"block w-full text-left",title:i("screenplayInspector.clickToCopy","Click to copy"),children:[(0,r.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider ".concat(eb==="".concat(e.frameNumber,"-nar")?"text-emerald-400":"text-[--muted]"),children:[(0,r.jsx)(l.A,{className:"h-3 w-3","aria-hidden":"true"}),eb==="".concat(e.frameNumber,"-nar")?i("screenplayInspector.copiedV2","Copied"):i("screenplayInspector.narration","Narration")]}),(0,r.jsx)("div",{className:"text-xs text-white leading-snug",children:n})]})]})]})]},e.frameNumber)}),Y&&(0,r.jsxs)("div",{className:"border border-[--border] rounded-xl p-3 bg-[--surface] mt-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm font-bold text-white",children:[(0,r.jsx)(m.A,{className:"h-4 w-4 text-brand-light","aria-hidden":"true"}),i("screenplayInspector.refineHeadingV2","Refine this automation from what it made")]}),(0,r.jsx)("div",{className:"text-xs text-[--muted] mt-0.5 mb-2",children:i("screenplayInspector.refineHint","The AI looks at the rendered frames + your note, then tunes the prompts.")}),K?(0,r.jsxs)("div",{className:"rounded-lg border border-[--border] bg-[--bg] p-2.5",children:[(0,r.jsx)("div",{className:"text-xs font-bold text-white mb-1.5",children:i("screenplayInspector.proposedHeading","Proposed changes")}
1),es.map((e,t)=>(0,r.jsxs)("div",{className:"mb-1.5",children:[e.feedback&&(0,r.jsx)("p",{className:"text-xs text-white font-semibold",children:"".concat(i("screenplayInspector.youSaid","You:")," ").concat(e.feedback)}),e.rationale&&(0,r.jsx)("p",{className:"text-xs text-[--muted]",children:e.rationale})]},t)),(0,r.jsxs)("div",{className:"space-y-1.5",children:[K.changes.map(e=>(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsx)("span",{className:"font-semibold text-[--muted]",children:e.label}),(0,r.jsxs)("div",{className:"text-white/90 leading-snug",children:[void 0!==e.before&&(0,r.jsx)("span",{className:"line-through opacity-50",children:eM(e.before)}),void 0!==e.before&&" → ",(0,r.jsx)("span",{className:"text-emerald-300",children:eM(e.after)})]})]},e.key)),0===K.changes.length&&(0,r.jsx)("p",{className:"text-xs text-[--muted]",children:i("screenplayInspector.noNetChange","No net change from your current settings yet — keep refining.")})]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,r.jsx)("input",{type:"text",value:eo,onChange:e=>ed(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eo.trim()&&!B&&eV(eo,!0)},disabled:B,placeholder:i("screenplayInspector.replyPlaceholder","Reply to refine further… e.g. keep the grain but warmer"),className:"flex-1 rounded-lg bg-[--surface] border border-[--border] px-2 py-1.5 text-xs text-white"}),(0,r.jsx)("button",{type:"button",onClick:()=>eV(eo,!0),disabled:B||!eo.trim(),className:"inline-flex shrink-0 items-center gap-1 text-xs font-bold text-brand disabled:opacity-50",children:B?"…":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i("screenplayInspector.refineAgainV2","Refine again")]})})]}),(0,r.jsx)("p",{className:"text-[10px] text-[--muted] mt-1",children:i("screenplayInspector.refineAgainHint","Reply to keep refining \xb7 each uses a credit")}),(0,r.jsxs)("div",{className:"flex gap-2 mt-3",children:[(0,r.jsx)("button",{type:"button",onClick:eF,disabled:X||B||0===K.changes.length,className:"flex-1 rounded-full bg-brand text-white py-2 text-sm font-bold disabled:opacity-50",children:X?"…":i("screenplayInspector.apply","Apply these changes")}),(0,r.jsx)("button",{type:"button",onClick:eT,disabled:X||B,className:"rounded-full border border-[--border] text-[--muted] px-4 py-2 text-sm font-semibold disabled:opacity-70",children:i("screenplayInspector.discard","Discard")})]}),(0,r.jsx)("button",{type:"button",onClick:eE,disabled:X||B||0===K.changes.length,className:"w-full mt-2 text-xs font-bold text-brand disabled:opacity-50",children:i("screenplayInspector.saveAsVariant","+ Save as a new variant instead (keep original)")})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:j.map(e=>{let t=i(e.key,e.fallback);return(0,r.jsx)("button",{type:"button",onClick:()=>{L(e=>e.includes(t)?e:e.trim()?"".concat(e.trim(),"; ").concat(t):t)},className:"rounded-full border border-[--border] text-[--muted] hover:text-white hover:border-brand px-2.5 py-1 text-[11px]",children:t},e.key)})}),(0,r.jsx)("textarea",{value:O,onChange:e=>L(e.target.value),disabled:B,placeholder:i("screenplayInspector.feedbackPlaceholder","What's off? e.g. too generic — make it more retro low-poly"),className:"w-full min-h-[64px] rounded-lg bg-[--bg] border border-[--border] p-2 text-sm text-white"}),(0,r.jsx)("button",{type:"button",onClick:()=>eV(O,!1),disabled:B,className:"mt-2 w-full rounded-full bg-brand text-white py-2.5 text-sm font-bold disabled:opacity-70",children:B?"…":i("screenplayInspector.refine","Refine with AI")}),(0,r.jsx)("p",{className:"text-[10px] text-[--muted] text-center mt-1.5",children:i("screenplayInspector.creditNote","Reviews the rendered frames \xb7 uses AI credits")})]}),U&&(0,r.jsxs)("p",{className:"text-xs mt-2 ".concat(U.ok?"text-emerald-400":"text-red-400"),children:[U.ok?"✓ ":"",U.text,U.ok&&et&&(0,r.jsx)("button",{type:"button",onClick:eH,disabled:X,className:"ml-2 underline font-semibold disabled:opacity-70",children:i("screenplayInspector.undo","Undo")}),U.ok&&er&&(0,r.jsxs)("button",{type:"button",onClick:()=>{a(),D.push("/".concat(A,"/automations/").concat(er))},className:"ml-2 underline font-semibold",children:[i("screenplayInspector.viewVariantV2","Open the variant"),
1(0,r.jsx)(h.A,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})]}),!K&&(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-[--border]",children:[(0,r.jsxs)("label",{className:"flex items-center gap-2 mb-2 text-xs text-[--muted] cursor-pointer select-none",children:[(0,r.jsx)("input",{type:"checkbox",checked:ex,onChange:e=>ef(e.target.checked),disabled:eu,className:"accent-brand"}),i("screenplayInspector.previewIncludeVideo","Also render video (watch in Library)")]}),(0,r.jsx)("button",{type:"button",onClick:eO,disabled:eu,className:"inline-flex w-full items-center justify-center gap-2 rounded-full border border-brand py-2 text-sm font-bold text-brand disabled:opacity-70",children:eu?"…":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{className:"h-4 w-4","aria-hidden":"true"}),i("screenplayInspector.previewSampleV2","Generate a fresh sample")]})}),(0,r.jsx)("p",{className:"text-[10px] text-[--muted] text-center mt-1.5",children:null!=ep?ep:i("screenplayInspector.previewNote","Renders one new story from these settings \xb7 never posts \xb7 ~few min")})]})]})]})]})}},73657:(e,t,a)=>{function r(e){return e?e.replace(/\s*\[[^\]]*\]:?\s*/g," ").replace(/\s+/g," ").trim():""}a.d(t,{s:()=>r,t:()=>s});let n=/\s*\[[^\]]*\]:?\s*/g;function s(e,t){if(!e.trim())return"";let a=[...t.matchAll(n)];if(!a.length)return e;let s=r(t);if(e===s)return t;let l=e.length-s.length,i=Math.min(s.length,e.length),c=0;for(;c<i&&s[c]===e[c];)c+=1;let o=0;for(;o<i-c&&s[s.length-1-o]===e[e.length-1-o];)o+=1;let d=s.length-o,u=t=>{if(t<=0)return 0;if(t>=e.length)return e.length;if(/\s/.test(e[t-1])||/\s/.test(e[t]))return t;let a=t;for(;a>0&&!/\s/.test(e[a-1]);)a-=1;let r=t;for(;r<e.length&&!/\s/.test(e[r]);)r+=1;return t-a<=r-t?a:r},m=e;for(let e=a.length-1;e>=0;e-=1){var p;let n=a[e][0].trim();if(!n)continue;let s=r(t.slice(0,null!=(p=a[e].index)?p:0)).length,i=Math.max(0,Math.min(u(s<=c?s:s>=d?s+l:c+Math.round((s-c)*(d+l-c)/(d-c))),m.length)),o=m.slice(0,i),h=m.slice(i);m=o+(o&&!/\s$/.test(o)?" ":"")+n+(h&&!/^\s/.test(h)?" ":"")+h}return m}},97271:(e,t,a)=>{a.d(t,{A:()=>r});let r=(0,a(75383).A)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])}}]);

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.