videobook 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/chat-router.js +1 -1
  3. package/dist/guides/seedance_2_prompting_guide.md +1 -1
  4. package/dist/image-edit-models.js +1 -0
  5. package/dist/jobs/generate-media.js +18 -6
  6. package/dist/jobs/run-notebook.js +23 -4
  7. package/dist/media/adapters/fal.js +7 -0
  8. package/dist/media/catalog.js +4 -2
  9. package/dist/media/cost.js +2 -2
  10. package/dist/media/refs.js +13 -0
  11. package/dist/media/request.js +7 -0
  12. package/dist/media/seedance-edit.js +9 -0
  13. package/dist/provider-usage.js +3 -1
  14. package/dist/tools/estimate-cost.js +4 -1
  15. package/dist/tools/generate-media.js +2 -1
  16. package/dist/tools/reconcile-project-work.js +2 -1
  17. package/package.json +14 -14
  18. package/ui/assets/{alive-captions-DPEr1nKM.js → alive-captions-C48o6dfv.js} +1 -1
  19. package/ui/assets/confirm-bodies-aq6Az8Md.js +1 -0
  20. package/ui/assets/{fullscreen-B7nw4YbE.js → fullscreen-4m0qtZ7w.js} +1 -1
  21. package/ui/assets/{goal-ui-DK-xTCK0.js → goal-ui-2pUWP_B2.js} +2 -2
  22. package/ui/assets/{index-kS1905s5.js → index-DmDH4gYr.js} +2 -2
  23. package/ui/assets/{inspector-MlzQbTVo.js → inspector-CnKySYc5.js} +1 -1
  24. package/ui/assets/{jobs-ui-CoinOWx0.js → jobs-ui-lRoS1MbL.js} +1 -1
  25. package/ui/assets/{music-video-Cbe80kmQ.js → music-video-BQnnPp-X.js} +1 -1
  26. package/ui/assets/ui-OHFUngrc.js +2 -0
  27. package/ui/assets/{vendor-flow-BXbeWxW7.js → vendor-flow-zBavaNEW.js} +1 -1
  28. package/ui/assets/{vendor-mcp-BTlEJcHV.js → vendor-mcp-DQ7EusT9.js} +1 -1
  29. package/ui/assets/vendor-yctIZ9Dz.js +19 -0
  30. package/ui/assets/{videobook-Qlp9HQFu.js → videobook-DZ58pKW5.js} +12 -12
  31. package/ui/index.html +11 -11
  32. package/ui/assets/confirm-bodies-D8ouHXKy.js +0 -1
  33. package/ui/assets/ui-xo_Y1yQg.js +0 -2
  34. package/ui/assets/vendor-DfTCWgKm.js +0 -19
@@ -0,0 +1 @@
1
+ import{c as ue,a as Ne,j as t}from"./vendor-react-Dj7D1fD4.js";import{c0 as ll,c1 as sl,c2 as nl,c3 as il,i as al,c4 as rl,c5 as ol,c6 as cl,c7 as Qt,c8 as qt,c9 as Bt,ca as dl,cb as ml,ad as ul,cc as hl,cd as fl,ce as pl,cf as xl,cg as Ct,ch as gl,ci as Pt,cj as bl,b2 as vl,E as jl,ck as yl,b3 as wl,cl as Nl,cm as Wt,ae as Sl,cn as Cl,Y as Pl,bI as kl,b4 as _l,b5 as El,co as $l,cp as Al,cq as Rl,cr as Je,cs as kt,ct as _t,cu as Tl,cv as Il,cw as Et,cx as Ll,cy as Ml,cz as Fl,cA as Dl,cB as Ol,cC as Hl,cD as Ul,be as Vl,cE as Ql,x as ql,cF as Bl,cG as Wl,cH as zl,cI as Gl,cJ as Kl,cK as Yl,cL as Xl,cM as zt,cN as Jl,cO as $t,cP as At,cQ as Rt,cR as Zl,cS as es,cT as Tt,cU as It,cV as ts,cW as ls,cX as ss,cY as ns,cZ as is,c_ as yt,c$ as as,d0 as Gt,d1 as rs,d2 as os,d3 as cs,d4 as ds,d5 as ms}from"./videobook-DZ58pKW5.js";import{P as us,I as hs,G as Lt,V as fs,a as ps,D as xs,R as gs,M as bs}from"./ui-OHFUngrc.js";import{F as Kt,ac as St,c as wt,x as Yt,g as vs,h as js,X as Xt,m as ys,i as ws,k as Ns,w as Ss,V as Cs,ai as Ps,ad as ks,_ as Mt}from"./vendor-icons-CGqhCIXV.js";function En(i){const e=ue.c(40),{review:s,onChange:l,disabled:n}=i,a=Ne.useRef(null),r=Ne.useRef(null),u=Ne.useRef(!1),[c,p]=Ne.useState(null),o=s.suggestion,f=o?.startSeconds??0,d=o?.endSeconds??0,m=o?.fps??30;let h;e[0]!==d||e[1]!==o||e[2]!==f?(h=o?ll(f,d,o.durationSeconds):null,e[0]=d,e[1]=o,e[2]=f,e[3]=h):h=e[3];const x=h;let g;e[4]!==d||e[5]!==m?(g=()=>{const N=a.current;if(!N)return;N.pause(),r.current=null;let E=0;const I=()=>{!N.seeking&&r.current==="hook"&&N.currentTime>=d-.5/m&&(u.current?(r.current="full",N.currentTime=0,N.play().catch(()=>p("Press Play to resume the preview."))):(r.current=null,N.pause())),E=requestAnimationFrame(I)};return E=requestAnimationFrame(I),()=>{cancelAnimationFrame(E),N.pause()}},e[4]=d,e[5]=m,e[6]=g):g=e[6];let S;e[7]!==d||e[8]!==m||e[9]!==s.mediaUrl||e[10]!==f?(S=[s.mediaUrl,f,d,m],e[7]=d,e[8]=m,e[9]=s.mediaUrl,e[10]=f,e[11]=S):S=e[11],Ne.useEffect(g,S);let j;e[12]!==f?(j=async N=>{const E=a.current;if(E){p(null),u.current=N,r.current="hook",E.currentTime=f;try{await E.play()}catch{p("Unable to play this preview. Try Play again.")}}},e[12]=f,e[13]=j):j=e[13];const C=j;let y;e[14]!==d||e[15]!==m||e[16]!==l||e[17]!==f?(y=(N,E)=>{if(N.key!=="ArrowLeft"&&N.key!=="ArrowRight")return;N.preventDefault();const I=(N.key==="ArrowRight"?1:-1)*(N.shiftKey?1:1/m);l(E==="start"?f+I:f,E==="end"?d+I:d)},e[14]=d,e[15]=m,e[16]=l,e[17]=f,e[18]=y):y=e[18];const k=y;let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{r.current==="hook"&&u.current&&a.current?(r.current="full",a.current.currentTime=0,a.current.play().catch(()=>p("Press Play to resume the preview."))):r.current=null},e[19]=w):w=e[19];let b;e[20]!==s.mediaUrl?(b=t.jsx("video",{ref:a,src:s.mediaUrl,"aria-label":"Cold-open preview",controls:!0,playsInline:!0,preload:"metadata",onEnded:w}),e[20]=s.mediaUrl,e[21]=b):b=e[21];let v;e[22]!==n||e[23]!==d||e[24]!==m||e[25]!==x||e[26]!==k||e[27]!==l||e[28]!==C||e[29]!==o||e[30]!==f?(v=o?t.jsxs(t.Fragment,{children:[t.jsx("p",{children:o.reason}),t.jsxs("div",{className:"cold-open-bounds",children:[t.jsxs("label",{children:["Start (seconds)",t.jsx("input",{type:"number","aria-label":"Highlight start",step:1/m,min:0,max:o.durationSeconds,value:Number.isFinite(f)?f:"",disabled:n,onKeyDown:N=>k(N,"start"),onChange:N=>l(N.target.valueAsNumber,d)})]}),t.jsxs("label",{children:["End (seconds)",t.jsx("input",{type:"number","aria-label":"Highlight end",step:1/m,min:0,max:o.durationSeconds,value:Number.isFinite(d)?d:"",disabled:n,onKeyDown:N=>k(N,"end"),onChange:N=>l(f,N.target.valueAsNumber)})]})]}),t.jsxs("div",{className:"cold-open-playback",children:[t.jsx("button",{type:"button",disabled:n||!!x,onClick:()=>{C(!1)},children:"Play highlight"}),t.jsx("button",{type:"button",disabled:n||!!x,onClick:()=>{C(!0)},children:"Preview cold open"})]}),t.jsx("p",{children:x??`${(d-f).toFixed(2)}s highlight → full ${o.durationSeconds.toFixed(2)}s clip · ${(o.durationSeconds+d-f).toFixed(2)}s total`}),t.jsx("small",{children:"← → nudge one frame · Shift + ← → nudge one second"})]}):t.jsx("p",{children:"AI will suggest a 2–5 second highlight. Review its timing before creating the copy. Analysis uses your configured provider and may incur charges."}),e[22]=n,e[23]=d,e[24]=m,e[25]=x,e[26]=k,e[27]=l,e[28]=C,e[29]=o,e[30]=f,e[31]=v):v=e[31];let _;e[32]!==c?(_=c&&t.jsx("p",{role:"alert",children:c}),e[32]=c,e[33]=_):_=e[33];let A;e[34]!==v||e[35]!==_?(A=t.jsxs("div",{className:"cold-open-controls",children:[v,_]}),e[34]=v,e[35]=_,e[36]=A):A=e[36];let R;return e[37]!==A||e[38]!==b?(R=t.jsxs("div",{className:"cold-open-review-body",children:[b,A]}),e[37]=A,e[38]=b,e[39]=R):R=e[39],R}const _s={en:"EN",th:"TH · ไทย"};function Es(i){if(!i)return"Media details unavailable";const e=[i.duration?ul(i.duration):null,i.width&&i.height?`${i.width}×${i.height}`:null].filter(Boolean);return e.length?e.join(" · "):i.type}function $s(i){const e=ue.c(34),{post:s,asset:l,onOpenPost:n}=i,a=!!s.definition.source?.snapshotArtifactId;let r;e[0]!==l||e[1]!==s.address?(r=l?.mediaUrl&&l.type==="image"?t.jsx("img",{src:l.mediaUrl,alt:""}):l?.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":`${s.address} clip`}):t.jsx("span",{className:"post-delivery-media-fallback",children:t.jsx(Kt,{size:18,"aria-hidden":"true"})}),e[0]=l,e[1]=s.address,e[2]=r):r=e[2];const u=r,c=`post-delivery-post${a?"":" post-delivery-post-blocked"}`,p=`Post ${s.address}`;let o;e[3]!==u?(o=t.jsx("div",{className:"post-delivery-media",children:u}),e[3]=u,e[4]=o):o=e[4];const f=l?.label??s.label;let d;e[5]!==s.address||e[6]!==f?(d=t.jsxs("strong",{children:[s.address," · ",f]}),e[5]=s.address,e[6]=f,e[7]=d):d=e[7];let m;e[8]!==l?(m=Es(l),e[8]=l,e[9]=m):m=e[9];let h;e[10]!==m?(h=t.jsx("span",{children:m}),e[10]=m,e[11]=h):h=e[11];let x;e[12]!==a||e[13]!==s.definition.createdAt?(x=a?t.jsxs("span",{children:["Clip saved ",new Date(s.definition.createdAt).toLocaleString()]}):t.jsxs("span",{className:"post-delivery-warning",children:[t.jsx(St,{size:12,"aria-hidden":"true"}),"No saved source clip"]}),e[12]=a,e[13]=s.definition.createdAt,e[14]=x):x=e[14];let g;e[15]!==s.runtime.icloud?.completedAt?(g=s.runtime.icloud?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Already on iPhone; saving again checks the files"]}),e[15]=s.runtime.icloud?.completedAt,e[16]=g):g=e[16];let S;e[17]!==s.runtime.dropbox?.completedAt?(S=s.runtime.dropbox?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Already in Dropbox; uploading again checks the files"]}),e[17]=s.runtime.dropbox?.completedAt,e[18]=S):S=e[18];let j;e[19]!==a||e[20]!==n?(j=!a&&t.jsx("button",{type:"button",onClick:n,children:"Choose a clip in the Post panel"}),e[19]=a,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==g||e[23]!==S||e[24]!==j||e[25]!==d||e[26]!==h||e[27]!==x?(C=t.jsxs("div",{className:"post-delivery-post-copy",children:[d,h,x,g,S,j]}),e[22]=g,e[23]=S,e[24]=j,e[25]=d,e[26]=h,e[27]=x,e[28]=C):C=e[28];let y;return e[29]!==C||e[30]!==c||e[31]!==p||e[32]!==o?(y=t.jsxs("article",{className:c,"aria-label":p,children:[o,C]}),e[29]=C,e[30]=c,e[31]=p,e[32]=o,e[33]=y):y=e[33],y}function As(i){const e=ue.c(17),{review:s,disabled:l,onCopyChange:n,onLanguage:a}=i,r=s.copy;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"post-delivery-heading",children:"Platform"}),e[0]=u):u=e[0];let c;e[1]!==r||e[2]!==l||e[3]!==n?(c=pl.map(h=>t.jsx("button",{type:"button","aria-pressed":r.platform===h.id,disabled:l,onClick:()=>n({...r,platform:h.id}),children:h.label},h.id)),e[1]=r,e[2]=l,e[3]=n,e[4]=c):c=e[4];let p;e[5]!==c?(p=t.jsxs("div",{className:"post-copy-group",children:[u,t.jsx("div",{className:"post-delivery-switch",role:"group","aria-label":"Platform",children:c})]}),e[5]=c,e[6]=p):p=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("span",{className:"post-delivery-heading",children:"Language"}),e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==l||e[10]!==a?(f=xl.map(h=>t.jsx("button",{type:"button","aria-pressed":r.language===h,disabled:l,onClick:()=>a(h),children:_s[h]},h)),e[8]=r,e[9]=l,e[10]=a,e[11]=f):f=e[11];let d;e[12]!==f?(d=t.jsxs("div",{className:"post-copy-group",children:[o,t.jsx("div",{className:"post-delivery-switch",role:"group","aria-label":"Caption language",children:f})]}),e[12]=f,e[13]=d):d=e[13];let m;return e[14]!==p||e[15]!==d?(m=t.jsxs("div",{className:"post-copy-toolbar",children:[p,d]}),e[14]=p,e[15]=d,e[16]=m):m=e[16],m}function Rs(i){const e=ue.c(21),{copy:s,disabled:l,onCopyChange:n}=i,a=s.tracks[s.language];if(!a||a.versions.length<2)return null;const r=l||a.index===0;let u;e[0]!==s||e[1]!==n?(u=()=>n(Ct(s,-1)),e[0]=s,e[1]=n,e[2]=u):u=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(vs,{size:12,"aria-hidden":"true"}),e[3]=c):c=e[3];let p;e[4]!==r||e[5]!==u?(p=t.jsx("button",{type:"button","aria-label":"Previous caption version",disabled:r,onClick:u,children:c}),e[4]=r,e[5]=u,e[6]=p):p=e[6];const o=a.index+1;let f;e[7]!==o||e[8]!==a.versions.length?(f=t.jsxs("small",{children:["v",o,"/",a.versions.length]}),e[7]=o,e[8]=a.versions.length,e[9]=f):f=e[9];const d=l||a.index===a.versions.length-1;let m;e[10]!==s||e[11]!==n?(m=()=>n(Ct(s,1)),e[10]=s,e[11]=n,e[12]=m):m=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(js,{size:12,"aria-hidden":"true"}),e[13]=h):h=e[13];let x;e[14]!==d||e[15]!==m?(x=t.jsx("button",{type:"button","aria-label":"Next caption version",disabled:d,onClick:m,children:h}),e[14]=d,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==x||e[18]!==p||e[19]!==f?(g=t.jsxs("span",{className:"post-copy-versions",children:[p,f,x]}),e[17]=x,e[18]=p,e[19]=f,e[20]=g):g=e[20],g}function Ts(i){const e=ue.c(37),{copy:s,disabled:l,onCopyChange:n}=i,[a,r]=Ne.useState("");let u,c,p,o,f,d,m,h;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==n){h=Qt(s)?.tags??[];let y;e[12]!==s||e[13]!==a||e[14]!==n?(y=()=>{a.trim()&&(n(gl(s,a)),r(""))},e[12]=s,e[13]=a,e[14]=n,e[15]=y):y=e[15],u=y,c=b=>{b.key==="Enter"||b.key===","?(b.preventDefault(),u()):b.key==="Backspace"&&!a&&h.length&&n(Pt(s,h[h.length-1]))},d="post-copy-tags";let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("label",{htmlFor:"post-delivery-tag",children:"Tags"}),e[16]=k):k=e[16],m=t.jsxs("div",{className:"post-delivery-label-row",children:[k,t.jsxs("small",{children:[h.length," · added after the caption"]})]}),p="post-copy-tag-field",o=s.language;let w;e[17]!==s||e[18]!==l||e[19]!==n?(w=b=>t.jsxs("span",{className:"post-copy-tag",children:["#",b,t.jsx("button",{type:"button","aria-label":`Remove tag ${b}`,disabled:l,onClick:()=>n(Pt(s,b)),children:t.jsx(Xt,{size:11,"aria-hidden":"true"})})]},b),e[17]=s,e[18]=l,e[19]=n,e[20]=w):w=e[20],f=h.map(w),e[0]=s,e[1]=l,e[2]=a,e[3]=n,e[4]=u,e[5]=c,e[6]=p,e[7]=o,e[8]=f,e[9]=d,e[10]=m,e[11]=h}else u=e[4],c=e[5],p=e[6],o=e[7],f=e[8],d=e[9],m=e[10],h=e[11];const x=h.length?"+ tag":"Add a tag, then Enter";let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=y=>r(y.target.value),e[21]=g):g=e[21];let S;e[22]!==u||e[23]!==l||e[24]!==a||e[25]!==c||e[26]!==x?(S=t.jsx("input",{id:"post-delivery-tag",type:"text",value:a,disabled:l,spellCheck:!1,placeholder:x,onChange:g,onKeyDown:c,onBlur:u}),e[22]=u,e[23]=l,e[24]=a,e[25]=c,e[26]=x,e[27]=S):S=e[27];let j;e[28]!==p||e[29]!==o||e[30]!==f||e[31]!==S?(j=t.jsxs("div",{className:p,lang:o,children:[f,S]}),e[28]=p,e[29]=o,e[30]=f,e[31]=S,e[32]=j):j=e[32];let C;return e[33]!==d||e[34]!==m||e[35]!==j?(C=t.jsxs("div",{className:d,children:[m,j]}),e[33]=d,e[34]=m,e[35]=j,e[36]=C):C=e[36],C}function Is(i){const e=ue.c(34),{copy:s,disabled:l,onCopyChange:n,onRegen:a}=i;let r;e[0]!==s||e[1]!==n?(r=w=>n({...s,prompt:s.prompt.trim()?`${s.prompt.trim()}, ${w.toLowerCase()}`:w}),e[0]=s,e[1]=n,e[2]=r):r=e[2];const u=r;let c;e[3]!==l||e[4]!==a?(c=w=>{w.key!=="Enter"||w.metaKey||w.ctrlKey||(w.preventDefault(),l||a())},e[3]=l,e[4]=a,e[5]=c):c=e[5];const p=c;let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("label",{htmlFor:"post-delivery-astra",children:"Regen with Astra"}),e[6]=o):o=e[6];const f=Bt[s.platform],d=qt[s.language];let m;e[7]!==f||e[8]!==d?(m=t.jsxs("div",{className:"post-delivery-label-row",children:[o,t.jsxs("small",{children:["video analysis + your note · ",f," · ",d]})]}),e[7]=f,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==n?(h=w=>n({...s,prompt:w.target.value}),e[10]=s,e[11]=n,e[12]=h):h=e[12];let x;e[13]!==s.prompt||e[14]!==l||e[15]!==p||e[16]!==h?(x=t.jsx("input",{id:"post-delivery-astra",type:"text",value:s.prompt,disabled:l,maxLength:1e3,placeholder:"Tell Astra how to rewrite — punchier hook, mention the rain, 3 tags…",onChange:h,onKeyDown:p}),e[13]=s.prompt,e[14]=l,e[15]=p,e[16]=h,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Yt,{size:12,"aria-hidden":"true"}),e[18]=g):g=e[18];let S;e[19]!==l||e[20]!==a?(S=t.jsxs("button",{type:"button",className:"post-copy-regen-button",disabled:l,onClick:a,children:[g,"Regen post"]}),e[19]=l,e[20]=a,e[21]=S):S=e[21];let j;e[22]!==S||e[23]!==x?(j=t.jsxs("div",{className:"post-copy-regen-row",children:[x,S]}),e[22]=S,e[23]=x,e[24]=j):j=e[24];let C;e[25]!==u||e[26]!==l?(C=hl.map(w=>t.jsx("button",{type:"button",disabled:l,onClick:()=>u(w),children:w},w)),e[25]=u,e[26]=l,e[27]=C):C=e[27];let y;e[28]!==C?(y=t.jsx("div",{className:"post-copy-presets",children:C}),e[28]=C,e[29]=y):y=e[29];let k;return e[30]!==j||e[31]!==y||e[32]!==m?(k=t.jsxs("div",{className:"post-copy-regen",children:[m,j,y]}),e[30]=j,e[31]=y,e[32]=m,e[33]=k):k=e[33],k}function Ls(i){const e=ue.c(84),{post:s,review:l,busy:n,onCopyChange:a,onLanguage:r,onRegen:u}=i;let c;e[0]!==s?(c=ol(s),e[0]=s,e[1]=c):c=e[1];const p=c,o=l.copy,f=o.drafting?.language===o.language,d=n||p;let m,h,x,g,S,j,C,y,k,w,b;if(e[2]!==o||e[3]!==d||e[4]!==a||e[5]!==r||e[6]!==l){const B=cl(o);let ne;e[18]!==o?(ne=Qt(o),e[18]=o,e[19]=ne):ne=e[19],b=ne;const W=b&&b.origin!=="saved"&&b.origin!=="edited";m="post-delivery-caption";const M=d||!!o.drafting;e[20]!==a||e[21]!==r||e[22]!==l||e[23]!==M?(h=t.jsx(As,{review:l,disabled:M,onCopyChange:a,onLanguage:r}),e[20]=a,e[21]=r,e[22]=l,e[23]=M,e[24]=h):h=e[24],k="post-delivery-label-row";let J;e[25]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx("label",{htmlFor:"post-delivery-caption",children:"Caption"}),e[25]=J):J=e[25];let T;e[26]!==W?(T=W&&t.jsxs("span",{className:"post-copy-badge",children:[t.jsx(Yt,{size:10,"aria-hidden":"true"}),"Auto · from video analysis"]}),e[26]=W,e[27]=T):T=e[27],e[28]!==T?(w=t.jsxs("span",{className:"post-copy-caption-label",children:[J,T]}),e[28]=T,e[29]=w):w=e[29],C="post-copy-caption-meta";const U=d||!!o.drafting;e[30]!==o||e[31]!==a||e[32]!==U?(y=t.jsx(Rs,{copy:o,disabled:U,onCopyChange:a}),e[30]=o,e[31]=a,e[32]=U,e[33]=y):y=e[33],x=B.over||B.length>fl?"confirm-field-error":void 0,g=B.length.toLocaleString(),S=" / ",j=B.limit.toLocaleString(),e[2]=o,e[3]=d,e[4]=a,e[5]=r,e[6]=l,e[7]=m,e[8]=h,e[9]=x,e[10]=g,e[11]=S,e[12]=j,e[13]=C,e[14]=y,e[15]=k,e[16]=w,e[17]=b}else m=e[7],h=e[8],x=e[9],g=e[10],S=e[11],j=e[12],C=e[13],y=e[14],k=e[15],w=e[16],b=e[17];let v;e[34]!==x||e[35]!==g||e[36]!==S||e[37]!==j?(v=t.jsxs("small",{className:x,children:[g,S,j]}),e[34]=x,e[35]=g,e[36]=S,e[37]=j,e[38]=v):v=e[38];let _;e[39]!==v||e[40]!==C||e[41]!==y?(_=t.jsxs("span",{className:C,children:[y,v]}),e[39]=v,e[40]=C,e[41]=y,e[42]=_):_=e[42];let A;e[43]!==_||e[44]!==k||e[45]!==w?(A=t.jsxs("div",{className:k,children:[w,_]}),e[43]=_,e[44]=k,e[45]=w,e[46]=A):A=e[46];let R;e[47]!==n||e[48]!==o||e[49]!==f||e[50]!==p||e[51]!==a||e[52]!==s||e[53]!==b?.body?(R=f?t.jsxs("div",{className:"post-copy-drafting",role:"status",children:["Astra is writing the ",qt[o.language]," caption for ",Bt[o.platform],"…"]}):t.jsx("textarea",{id:"post-delivery-caption",lang:o.language,value:p?s.definition.caption:b?.body??"",disabled:n,readOnly:p,placeholder:"Write the caption that ships with this clip…",onChange:B=>a(dl(o,{body:B.target.value}))}),e[47]=n,e[48]=o,e[49]=f,e[50]=p,e[51]=a,e[52]=s,e[53]=b?.body,e[54]=R):R=e[54];let N;e[55]!==o.error?(N=o.error&&t.jsx("small",{className:"confirm-field-error",children:o.error}),e[55]=o.error,e[56]=N):N=e[56];let E;e[57]!==o||e[58]!==d||e[59]!==f||e[60]!==p||e[61]!==a?(E=!p&&t.jsx(Ts,{copy:o,disabled:d||f,onCopyChange:a}),e[57]=o,e[58]=d,e[59]=f,e[60]=p,e[61]=a,e[62]=E):E=e[62];let I;e[63]!==o||e[64]!==p||e[65]!==s?(I=p?"Frozen at the first delivery. Create a new Post to change it.":`${ml(o)} · Saved to ${s.address} and written to caption.txt${s.definition.credits?" with its credits":""}.`,e[63]=o,e[64]=p,e[65]=s,e[66]=I):I=e[66];let F;e[67]!==I?(F=t.jsx("small",{children:I}),e[67]=I,e[68]=F):F=e[68];let D;e[69]!==n||e[70]!==o||e[71]!==p||e[72]!==a||e[73]!==u?(D=!p&&t.jsx(Is,{copy:o,disabled:n||!!o.drafting,onCopyChange:a,onRegen:u}),e[69]=n,e[70]=o,e[71]=p,e[72]=a,e[73]=u,e[74]=D):D=e[74];let L;return e[75]!==m||e[76]!==h||e[77]!==A||e[78]!==R||e[79]!==N||e[80]!==E||e[81]!==F||e[82]!==D?(L=t.jsxs("div",{className:m,children:[h,A,R,N,E,F,D]}),e[75]=m,e[76]=h,e[77]=A,e[78]=R,e[79]=N,e[80]=E,e[81]=F,e[82]=D,e[83]=L):L=e[83],L}function Ms(i){const e=ue.c(19),{review:s,busy:l,onConnect:n,onCheckConnection:a}=i,r=s.connection;if(!r){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"post-delivery-account",children:"Checking Dropbox…"}),e[0]=x):x=e[0],x}if(r.connected){let x;return e[1]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("p",{className:"post-delivery-account post-delivery-account-ready",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Dropbox connected"]}),e[1]=x):x=e[1],x}const u=s.connecting||r.pending?"Waiting for Dropbox approval…":"Dropbox not connected";let c;e[2]!==u?(c=t.jsx("span",{children:u}),e[2]=u,e[3]=c):c=e[3];const p=l||s.connecting||!r.hasCredentials;let o;e[4]!==n||e[5]!==p?(o=t.jsx("button",{type:"button",disabled:p,onClick:n,children:"Connect Dropbox ↗"}),e[4]=n,e[5]=p,e[6]=o):o=e[6];let f;e[7]!==l||e[8]!==a?(f=t.jsx("button",{type:"button",disabled:l,onClick:a,children:"Check again"}),e[7]=l,e[8]=a,e[9]=f):f=e[9];let d;e[10]!==o||e[11]!==f?(d=t.jsxs("div",{children:[o,f]}),e[10]=o,e[11]=f,e[12]=d):d=e[12];let m;e[13]!==r.error?(m=r.error&&t.jsx("small",{className:"confirm-field-error",children:r.error}),e[13]=r.error,e[14]=m):m=e[14];let h;return e[15]!==c||e[16]!==d||e[17]!==m?(h=t.jsxs("div",{className:"post-delivery-account post-delivery-account-missing",children:[c,d,m]}),e[15]=c,e[16]=d,e[17]=m,e[18]=h):h=e[18],h}function Fs(i){return i.trim().replace(/\/+$/u,"")||"…"}function $n(i){const e=ue.c(65),s=i.review.destination==="icloud",l=s?i.review.icloudFolder:i.review.dropboxFolder;let n;e[0]!==s||e[1]!==i.review.dropboxFolder||e[2]!==i.review.icloudFolder?(n=s?sl(i.review.icloudFolder):nl(i.review.dropboxFolder),e[0]=s,e[1]=i.review.dropboxFolder,e[2]=i.review.icloudFolder,e[3]=n):n=e[3];const a=n;let r;e[4]!==i.review.icloud?(r=il(i.review.icloud),e[4]=i.review.icloud,e[5]=r):r=e[5];const u=r;let c;e[6]!==s||e[7]!==i.review.receipt||e[8]!==i.review.sync?.error||e[9]!==i.review.sync?.phase?(c=i.review.receipt&&s?al(i.review.sync?.phase??null,i.review.sync?.error):null,e[6]=s,e[7]=i.review.receipt,e[8]=i.review.sync?.error,e[9]=i.review.sync?.phase,e[10]=c):c=e[10];const p=c,o=i.review.icloud&&!i.review.icloud.available?i.review.icloud.reason??"iCloud Drive isn't available on this Mac.":null;let f;e[11]!==i.asset||e[12]!==i.onOpenPost||e[13]!==i.post?(f=t.jsx($s,{post:i.post,asset:i.asset,onOpenPost:i.onOpenPost}),e[11]=i.asset,e[12]=i.onOpenPost,e[13]=i.post,e[14]=f):f=e[14];let d;e[15]!==i.busy||e[16]!==i.onCopyChange||e[17]!==i.onLanguage||e[18]!==i.onRegen||e[19]!==i.post||e[20]!==i.review?(d=t.jsx(Ls,{post:i.post,review:i.review,busy:i.busy,onCopyChange:i.onCopyChange,onLanguage:i.onLanguage,onRegen:i.onRegen}),e[15]=i.busy,e[16]=i.onCopyChange,e[17]=i.onLanguage,e[18]=i.onRegen,e[19]=i.post,e[20]=i.review,e[21]=d):d=e[21];let m;e[22]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"post-delivery-heading",children:"Destination"}),e[22]=m):m=e[22];let h;e[23]!==i?(h=()=>i.onDestination("icloud"),e[23]=i,e[24]=h):h=e[24];let x;e[25]!==s||e[26]!==i.busy||e[27]!==h?(x=t.jsx("button",{type:"button","aria-pressed":s,disabled:i.busy,onClick:h,children:"iCloud · iPhone"}),e[25]=s,e[26]=i.busy,e[27]=h,e[28]=x):x=e[28];const g=!s;let S;e[29]!==i?(S=()=>i.onDestination("dropbox"),e[29]=i,e[30]=S):S=e[30];let j;e[31]!==i.busy||e[32]!==g||e[33]!==S?(j=t.jsx("button",{type:"button","aria-pressed":g,disabled:i.busy,onClick:S,children:"Dropbox"}),e[31]=i.busy,e[32]=g,e[33]=S,e[34]=j):j=e[34];let C;e[35]!==j||e[36]!==x?(C=t.jsxs("div",{className:"post-delivery-switch",role:"group","aria-label":"Destination",children:[x,j]}),e[35]=j,e[36]=x,e[37]=C):C=e[37];let y;e[38]!==o?(y=o&&t.jsxs("p",{className:"post-delivery-warning",children:[t.jsx(St,{size:12,"aria-hidden":"true"}),o]}),e[38]=o,e[39]=y):y=e[39];let k;e[40]!==l||e[41]!==a||e[42]!==s||e[43]!==i||e[44]!==u?(k=s?t.jsxs(t.Fragment,{children:[u&&t.jsx("p",{className:i.review.icloud?.shared===!1?"post-delivery-warning":"post-delivery-done",children:u}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:R=>i.onFolderChange(R.target.value)}),t.jsxs("small",{children:["Appears on iPhone in Files › Shared › Videobook › ",Fs(l)]})]}):t.jsxs(t.Fragment,{children:[t.jsx(Ms,{review:i.review,busy:i.busy,onConnect:i.onConnect,onCheckConnection:i.onCheckConnection}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:R=>i.onFolderChange(R.target.value)}),t.jsx("small",{children:"Uploads clip and caption.txt here. Other files in the folder are kept."})]}),e[40]=l,e[41]=a,e[42]=s,e[43]=i,e[44]=u,e[45]=k):k=e[45];let w;e[46]!==i.review.receipt?(w=i.review.receipt&&t.jsx("p",{className:"post-delivery-receipt",children:i.review.receipt}),e[46]=i.review.receipt,e[47]=w):w=e[47];let b;e[48]!==p?(b=p&&t.jsx("p",{className:"post-delivery-progress",children:p}),e[48]=p,e[49]=b):b=e[49];let v;e[50]!==i.busy||e[51]!==i.onLink||e[52]!==i.post?(v=rl(i.post)&&t.jsx(us,{post:i.post,disabled:i.busy,className:"post-delivery-link",onLink:i.onLink}),e[50]=i.busy,e[51]=i.onLink,e[52]=i.post,e[53]=v):v=e[53];let _;e[54]!==C||e[55]!==y||e[56]!==k||e[57]!==w||e[58]!==b||e[59]!==v?(_=t.jsxs("div",{className:"post-delivery-destination",children:[m,C,y,k,w,b,v]}),e[54]=C,e[55]=y,e[56]=k,e[57]=w,e[58]=b,e[59]=v,e[60]=_):_=e[60];let A;return e[61]!==_||e[62]!==f||e[63]!==d?(A=t.jsxs("div",{className:"post-delivery-body",children:[f,d,_]}),e[61]=_,e[62]=f,e[63]=d,e[64]=A):A=e[64],A}const Ds=new Map;function Os(i){const e=i.cell.inputs;return e&&typeof e.generationMode=="string"?e.generationMode:""}function Hs(i,e){const s=new Map;for(const l of i)if(l.asset)for(const n of[l.cellId,`@${l.address}`,l.asset.artifactId,`@${l.asset.artifactId}`,l.asset.mediaUrl,l.asset.thumbnailUrl])n&&s.set(n,l.asset);for(const l of Wt(e).urlPlaceholders){const n=s.get(l.reference);n&&s.set(l.url,n)}return s}function Ft(i){const e=ue.c(25),{badge:s,busy:l,onClick:n,source:a,title:r}=i;let u;e[0]!==s?(u=t.jsx("span",{className:"generation-review-source-badge",children:s}),e[0]=s,e[1]=u):u=e[1];let c;e[2]!==a.asset||e[3]!==a.type?(c=a.asset??{type:a.type,mediaUrl:null,thumbnailUrl:null,duration:null},e[2]=a.asset,e[3]=a.type,e[4]=c):c=e[4];let p;e[5]!==c?(p=t.jsx("span",{className:"generation-review-source-preview",children:t.jsx(bs,{asset:c,eager:!0})}),e[5]=c,e[6]=p):p=e[6];const o=a.mention??a.address;let f;e[7]!==o?(f=t.jsxs("strong",{children:["@",o]}),e[7]=o,e[8]=f):f=e[8];const d=a.mention?`@${a.address} · `:"";let m;e[9]!==a.targetLabel||e[10]!==a.type?(m=a.targetLabel??a.type.replaceAll("_"," "),e[9]=a.targetLabel,e[10]=a.type,e[11]=m):m=e[11];let h;e[12]!==d||e[13]!==m?(h=t.jsxs("small",{children:[d,m]}),e[12]=d,e[13]=m,e[14]=h):h=e[14];let x;e[15]!==f||e[16]!==h?(x=t.jsxs("span",{className:"generation-review-source-copy",children:[f,h]}),e[15]=f,e[16]=h,e[17]=x):x=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==u||e[21]!==p||e[22]!==x||e[23]!==r?(g=t.jsxs("button",{type:"button",className:"generation-review-source",disabled:l,onClick:n,title:r,children:[u,p,x]}),e[18]=l,e[19]=n,e[20]=u,e[21]=p,e[22]=x,e[23]=r,e[24]=g):g=e[24],g}function An(i){const e=ue.c(233),{actions:s,busy:l,draft:n,modes:a,preview:r,previewError:u,previewLoading:c,previewStale:p,sources:o,sourceOptions:f,voiceCatalog:d,promptEditor:m,promptHistory:h,inputFooter:x,compatibleModeIds:g,sourceVisible:S,notebookId:j,doltArtifactAssets:C,onActionChange:y,onAddSource:k,onModeChange:w,onPromptChange:b,onRefreshPreview:v,onRemoveSource:_,onSelectSource:A,onSettingChange:R}=i,N=S===void 0?!1:S,E=j===void 0?"":j,[I,F]=Ne.useState(!1);let D;e[0]!==n?(D=bl(n),e[0]=n,e[1]=D):D=e[1];const L=D;let B;e[2]!==n.cell.inputs?(B=n.cell.inputs??{},e[2]=n.cell.inputs,e[3]=B):B=e[3];let ne;e[4]!==n.action.model||e[5]!==B?(ne=vl(n.action.model,B),e[4]=n.action.model,e[5]=B,e[6]=ne):ne=e[6];const W=ne,M=jl();let J;e[7]!==d?(J=()=>{d&&d.ensureLoaded().catch(Xs)},e[7]=d,e[8]=J):J=e[8];const T=J;let U;e[9]!==d?(U=()=>{d&&d.refresh().catch(Ys)},e[9]=d,e[10]=U):U=e[10];const ce=U;let de;e[11]!==n.action.controls||e[12]!==n.cell.type?(de=n.cell.type==="generate_audio"?n.action.controls.find(Ks):void 0,e[11]=n.action.controls,e[12]=n.cell.type,e[13]=de):de=e[13];const Z=de;let he;e[14]!==d?.voices||e[15]!==Z?(he=Z?d?.voices??[]:[],e[14]=d?.voices,e[15]=Z,e[16]=he):he=e[16];const re=he,ee=re.length>0,ge=typeof L.voice_id=="string"?L.voice_id:"";let le;e[17]!==n.action.model?(le=yl(n.action.model),e[17]=n.action.model,e[18]=le):le=e[18];const fe=le,oe=n.cell.inputs?.generationMode??n.cell.inputs?.mode;let ve;e[19]!==n.action.model||e[20]!==oe?(ve=wl(n.action.model,oe),e[19]=n.action.model,e[20]=oe,e[21]=ve):ve=e[21];const z=ve;let G,se,pe,K,V,Y,X,Q,te,q,ie;if(e[22]!==s||e[23]!==l||e[24]!==g||e[25]!==C||e[26]!==n||e[27]!==T||e[28]!==W||e[29]!==x||e[30]!==fe||e[31]!==a||e[32]!==E||e[33]!==y||e[34]!==k||e[35]!==w||e[36]!==b||e[37]!==_||e[38]!==A||e[39]!==R||e[40]!==r||e[41]!==u||e[42]!==c||e[43]!==M||e[44]!==p||e[45]!==m||e[46]!==h||e[47]!==ce||e[48]!==z||e[49]!==ge||e[50]!==L||e[51]!==I||e[52]!==ee||e[53]!==f||e[54]!==N||e[55]!==o||e[56]!==d||e[57]!==Z||e[58]!==re){const xe=z?n.action.controls.filter(Gs):fe?n.action.controls.filter(zs):n.action.controls,Ie=ee?n.action.controls.filter(Ws):xe,Ue=Ie.filter(Bs),Le=Ie.filter(qs);let _e;e[70]!==r?(_e=kl(r),e[70]=r,e[71]=_e):_e=e[71];const Pe=_e;let Me;e[72]!==r||e[73]!==o?(Me=Hs(o,r),e[72]=r,e[73]=o,e[74]=Me):Me=e[74];const Fe=Me;G=Nl(r);const Ae=p?[]:Wt(r).promptLeaks;let Ge;e[75]!==n.action.model||e[76]!==n.action.provider||e[77]!==n.action.tool||e[78]!==n.cell.inputs||e[79]!==n.cell.prompt||e[80]!==Pe?(Ge=Pe??{status:"unresolved_draft",message:"The server preview has not resolved this draft yet.",payload:null,draft:{tool:n.action.tool,provider:n.action.provider,model:n.action.model,prompt:n.cell.prompt,inputs:n.cell.inputs??{}}},e[75]=n.action.model,e[76]=n.action.provider,e[77]=n.action.tool,e[78]=n.cell.inputs,e[79]=n.cell.prompt,e[80]=Pe,e[81]=Ge):Ge=e[81];const Re=Ge;let De;e[82]!==n.cell||e[83]!==E||e[84]!==N?(De=N?Sl(E,n.cell).length:0,e[82]=n.cell,e[83]=E,e[84]=N,e[85]=De):De=e[85];const Te=De;Y="confirm-generation",X=N?"source":"form";let Ee;e[86]===Symbol.for("react.memo_cache_sentinel")?(Ee=t.jsx("span",{className:"confirm-section-label",children:"Inputs"}),e[86]=Ee):Ee=e[86];let Oe;if(e[87]!==l||e[88]!==_||e[89]!==A||e[90]!==o){let H;e[92]!==l||e[93]!==_||e[94]!==A?(H=ze=>t.jsxs("div",{className:"generation-review-source-wrap",children:[t.jsx(Ft,{badge:"Input",busy:l,source:ze,title:`Select @${ze.address} on the board`,onClick:()=>A(ze.cellId)}),t.jsx("button",{type:"button",className:"generation-review-source-remove",disabled:l,"aria-label":`Remove @${ze.address} input`,title:`Remove @${ze.address} input`,onClick:()=>_(ze.cellId,ze.targetInput),children:t.jsx(Xt,{size:11,"aria-hidden":"true"})})]},`${ze.cellId}:${ze.targetInput??""}`),e[92]=l,e[93]=_,e[94]=A,e[95]=H):H=e[95],Oe=o.map(H),e[87]=l,e[88]=_,e[89]=A,e[90]=o,e[91]=Oe}else Oe=e[91];let P;e[96]!==o.length?(P=o.length===0&&t.jsxs("div",{className:"generation-review-text-input",children:[t.jsx("span",{children:"Input"}),t.jsx("strong",{children:"Prompt only"}),t.jsx("small",{children:"No source media attached"})]}),e[96]=o.length,e[97]=P):P=e[97];let ae;e[98]!==l||e[99]!==I||e[100]!==f.length?(ae=f.length>0&&t.jsxs("button",{type:"button",className:"generation-review-source-add",disabled:l,"aria-expanded":I,onClick:()=>F(Qs),children:[t.jsx(ys,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:"Add input"})]}),e[98]=l,e[99]=I,e[100]=f.length,e[101]=ae):ae=e[101];let He;e[102]!==Oe||e[103]!==P||e[104]!==ae?(He=t.jsxs("div",{className:"generation-review-sources",children:[Oe,P,ae]}),e[102]=Oe,e[103]=P,e[104]=ae,e[105]=He):He=e[105];let Ve;e[106]!==l||e[107]!==k||e[108]!==I||e[109]!==f?(Ve=I&&f.length>0&&t.jsx("div",{className:"generation-review-sources generation-review-source-options","aria-label":"Available input cells",children:f.map(H=>t.jsx(Ft,{badge:"Add",busy:l,source:H,title:`Add @${H.address} as ${H.targetLabel??"input"}`,onClick:()=>{k(H.cellId,H.targetInput),F(!1)}},`${H.cellId}:${H.targetInput??""}`))}),e[106]=l,e[107]=k,e[108]=I,e[109]=f,e[110]=Ve):Ve=e[110],e[111]!==x||e[112]!==He||e[113]!==Ve?(Q=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Inputs",children:[Ee,He,Ve,x]}),e[111]=x,e[112]=He,e[113]=Ve,e[114]=Q):Q=e[114];const Ye=N===!0;let Ze;e[115]===Symbol.for("react.memo_cache_sentinel")?(Ze=t.jsx("span",{className:"confirm-section-label",children:"Model"}),e[115]=Ze):Ze=e[115];const nt=n.action.id,Xe=l||s.length===0;let Qe;e[116]!==y?(Qe=H=>y(H.target.value),e[116]=y,e[117]=Qe):Qe=e[117];let qe;e[118]!==s?(qe=s.map(Vs),e[118]=s,e[119]=qe):qe=e[119];let Be;e[120]!==n.action.id||e[121]!==Xe||e[122]!==Qe||e[123]!==qe?(Be=t.jsxs("label",{children:[Ze,t.jsx("select",{"aria-label":"Generation model",value:nt,disabled:Xe,onChange:Qe,children:qe})]}),e[120]=n.action.id,e[121]=Xe,e[122]=Qe,e[123]=qe,e[124]=Be):Be=e[124];let Ke;e[125]!==l||e[126]!==g||e[127]!==n||e[128]!==a||e[129]!==w?(Ke=a.length>1&&t.jsxs("label",{children:[t.jsx("span",{className:"confirm-section-label",children:"Type"}),t.jsx("select",{"aria-label":"Generation type",value:Os(n),disabled:l,onChange:H=>w(H.target.value),children:a.map(H=>t.jsxs("option",{value:H.id,children:[Cl(H.id),g&&!g.has(H.id)?" · check inputs":""]},H.id))})]}),e[125]=l,e[126]=g,e[127]=n,e[128]=a,e[129]=w,e[130]=Ke):Ke=e[130];let $;e[131]!==Be||e[132]!==Ke?($=t.jsxs("section",{className:"generation-review-model-section","aria-label":"Model",children:[Be,Ke]}),e[131]=Be,e[132]=Ke,e[133]=$):$=e[133];let O;e[134]!==l||e[135]!==n.action.controls||e[136]!==fe||e[137]!==R||e[138]!==L||e[139]!==o?(O=fe&&t.jsx(hs,{sources:o,settings:L,controls:n.action.controls,busy:l,onChange:R}),e[134]=l,e[135]=n.action.controls,e[136]=fe,e[137]=R,e[138]=L,e[139]=o,e[140]=O):O=e[140];let ke;e[141]!==z?(ke=z&&t.jsx("p",{className:"muted",children:_l}),e[141]=z,e[142]=ke):ke=e[142];let $e;e[143]!==W?($e=W&&t.jsx("p",{className:"muted",children:El}),e[143]=W,e[144]=$e):$e=e[144];let We;e[145]!==l||e[146]!==T||e[147]!==W||e[148]!==R||e[149]!==L?(We=H=>t.jsx(Lt,{control:H,settings:L,busy:l||H.name==="aspect_ratio"&&!!W,toggleClassName:"generation-review-toggle",onFocus:H.name==="voice_id"?T:void 0,onChange:ze=>R(H.name,ze)},H.name),e[145]=l,e[146]=T,e[147]=W,e[148]=R,e[149]=L,e[150]=We):We=e[150];const tt=t.jsxs("div",{className:"generation-review-settings",children:[Ue.map(We),Ie.length===0&&t.jsx("span",{className:"generation-review-defaults",children:"Provider defaults"})]}),lt=Le.length>0&&t.jsx("div",{className:"generation-review-toggles",children:Le.map(H=>t.jsx(Lt,{control:H,settings:L,busy:l,toggleClassName:"generation-review-toggle",onChange:ze=>R(H.name,ze)},H.name))});let et;e[151]!==ke||e[152]!==$e||e[153]!==tt||e[154]!==lt?(et=t.jsxs("section",{className:"generation-review-settings-section","aria-label":"Settings",children:[ke,$e,tt,lt]}),e[151]=ke,e[152]=$e,e[153]=tt,e[154]=lt,e[155]=et):et=e[155];let it;e[156]!==l||e[157]!==R||e[158]!==M||e[159]!==ce||e[160]!==ge||e[161]!==ee||e[162]!==d||e[163]!==Z||e[164]!==re?(it=Z&&d&&t.jsxs("section",{className:"generation-review-voice-section","aria-label":"Voice",children:[t.jsx("span",{className:"confirm-section-label",children:"Voice"}),ee&&t.jsx("div",{className:"generation-review-voices",role:"listbox","aria-label":"ElevenLabs voices","data-testid":"generation-review-voices",children:t.jsx(fs,{voices:re,selectedVoiceId:ge,playingVoiceId:M.playingVoiceId,disabled:l,onSelect:H=>{Pl(H),R("voice_id",H)},onTogglePreview:M.toggle})}),d.loading&&re.length===0&&t.jsx("small",{children:"Loading voices…"}),d.error&&t.jsx("small",{role:"alert",children:d.error}),t.jsx("button",{type:"button",disabled:l||d.loading,onClick:ce,children:d.loading?"Loading voices…":d.error?"Retry voices":ee?"Refresh voices":"Load voices"}),d?.warning&&t.jsx("small",{children:d.warning})]}),e[156]=l,e[157]=R,e[158]=M,e[159]=ce,e[160]=ge,e[161]=ee,e[162]=d,e[163]=Z,e[164]=re,e[165]=it):it=e[165];const xt=m??t.jsxs("div",{className:"generation-review-prompt-field",children:[t.jsxs("div",{className:"confirm-section-heading",children:[t.jsx("span",{children:"Prompt"}),h&&t.jsx(ps,{history:h,disabled:l})]}),t.jsx("textarea",{rows:3,"aria-label":"Prompt",value:n.cell.prompt??"","aria-invalid":Ae.length>0,disabled:l,onChange:H=>b(H.target.value),onKeyDown:H=>{h?.handlePromptKeyDown(H)}})]}),gt=Ae.length>0&&t.jsx("div",{className:"generation-review-reference-errors",role:"alert",children:Ae.map(Us)});let at;e[166]!==xt||e[167]!==gt?(at=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Prompt",children:[xt,gt]}),e[166]=xt,e[167]=gt,e[168]=at):at=e[168],e[169]!==Ye||e[170]!==$||e[171]!==O||e[172]!==et||e[173]!==it||e[174]!==at?(te=t.jsxs("div",{className:"confirm-section generation-review-editor",hidden:Ye,children:[$,O,et,it,at]}),e[169]=Ye,e[170]=$,e[171]=O,e[172]=et,e[173]=it,e[174]=at,e[175]=te):te=e[175],e[176]!==C||e[177]!==Te||e[178]!==n.cell||e[179]!==E||e[180]!==N?(q=N&&t.jsxs("section",{className:"confirm-section generation-review-dolt-section","aria-label":"Dolt source",children:[t.jsxs("div",{className:"confirm-section-heading",children:[t.jsx("span",{children:"Dolt source"}),t.jsxs("strong",{children:["cells · ",Te," columns"]})]}),t.jsx("div",{className:"generation-review-dolt",tabIndex:0,"aria-label":"Dolt source preview",children:t.jsx(xs,{notebookId:E,cell:n.cell,artifactAssets:C??Ds,heading:!1})})]}),e[176]=C,e[177]=Te,e[178]=n.cell,e[179]=E,e[180]=N,e[181]=q):q=e[181];const bt=N?"MCP payload":"Payload",vt=N?"MCP payload":"Payload";let rt;e[182]!==vt?(rt=t.jsx("span",{children:vt}),e[182]=vt,e[183]=rt):rt=e[183];let ot;e[184]!==c||e[185]!==p?(ot=(p||c)&&t.jsx("small",{className:"generation-review-json-stale",role:"status",children:"Updating…"}),e[184]=c,e[185]=p,e[186]=ot):ot=e[186];let ct;e[187]!==rt||e[188]!==ot?(ct=t.jsxs("div",{className:"confirm-section-heading",children:[rt,ot]}),e[187]=rt,e[188]=ot,e[189]=ct):ct=e[189];const jt=N?"MCP payload preview":"Generation payload preview";let dt;e[190]!==Fe||e[191]!==u||e[192]!==Re||e[193]!==c||e[194]!==Pe?.payload||e[195]!==N?(dt=c?t.jsx("span",{className:"generation-review-json-status",role:"status",children:"Loading preview…"}):u?t.jsx("span",{className:"generation-review-json-status generation-review-json-error",role:"alert",children:u}):t.jsx(gs,{value:N?Re:Pe?.payload??null,ariaLabel:N?"MCP payload JSON":"Generation payload JSON",artifactAssets:Fe,mediaDisplay:"preview"}),e[190]=Fe,e[191]=u,e[192]=Re,e[193]=c,e[194]=Pe?.payload,e[195]=N,e[196]=dt):dt=e[196];let mt;e[197]!==c||e[198]!==jt||e[199]!==dt?(mt=t.jsx("div",{className:"generation-review-json",tabIndex:0,"aria-label":jt,"aria-busy":c,children:dt}),e[197]=c,e[198]=jt,e[199]=dt,e[200]=mt):mt=e[200],e[201]!==bt||e[202]!==ct||e[203]!==mt?(ie=t.jsxs("section",{className:"confirm-section generation-review-source-section","aria-label":bt,children:[ct,mt]}),e[201]=bt,e[202]=ct,e[203]=mt,e[204]=ie):ie=e[204],pe="confirm-section generation-review-estimate-section",K="Estimate",e[205]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[205]=V):V=e[205],se=c||p?"…":!u&&G.usd!==null&&!G.unknown?`$${G.usd.toFixed(G.usd<.01?4:2)}`:"—",e[22]=s,e[23]=l,e[24]=g,e[25]=C,e[26]=n,e[27]=T,e[28]=W,e[29]=x,e[30]=fe,e[31]=a,e[32]=E,e[33]=y,e[34]=k,e[35]=w,e[36]=b,e[37]=_,e[38]=A,e[39]=R,e[40]=r,e[41]=u,e[42]=c,e[43]=M,e[44]=p,e[45]=m,e[46]=h,e[47]=ce,e[48]=z,e[49]=ge,e[50]=L,e[51]=I,e[52]=ee,e[53]=f,e[54]=N,e[55]=o,e[56]=d,e[57]=Z,e[58]=re,e[59]=G,e[60]=se,e[61]=pe,e[62]=K,e[63]=V,e[64]=Y,e[65]=X,e[66]=Q,e[67]=te,e[68]=q,e[69]=ie}else G=e[59],se=e[60],pe=e[61],K=e[62],V=e[63],Y=e[64],X=e[65],Q=e[66],te=e[67],q=e[68],ie=e[69];let je;e[206]!==se?(je=t.jsx("strong",{children:se}),e[206]=se,e[207]=je):je=e[207];let be;e[208]!==G.currency?(be=t.jsx("span",{children:G.currency}),e[208]=G.currency,e[209]=be):be=e[209];const Se=c||p?"Updating estimate…":u||G.unknown||G.usd===null?"Cost estimate unavailable":"Estimated provider cost";let Ce;e[210]!==Se?(Ce=t.jsx("small",{children:Se}),e[210]=Se,e[211]=Ce):Ce=e[211];let me;e[212]!==l||e[213]!==v||e[214]!==u||e[215]!==c?(me=u&&t.jsxs("button",{type:"button",disabled:l||c,onClick:v,children:[t.jsx(Ns,{size:10,"aria-hidden":"true"}),"Retry preview"]}),e[212]=l,e[213]=v,e[214]=u,e[215]=c,e[216]=me):me=e[216];let ye;e[217]!==pe||e[218]!==K||e[219]!==V||e[220]!==je||e[221]!==be||e[222]!==Ce||e[223]!==me?(ye=t.jsxs("section",{className:pe,"aria-label":K,children:[V,je,be,Ce,me]}),e[217]=pe,e[218]=K,e[219]=V,e[220]=je,e[221]=be,e[222]=Ce,e[223]=me,e[224]=ye):ye=e[224];let we;return e[225]!==Y||e[226]!==X||e[227]!==Q||e[228]!==te||e[229]!==q||e[230]!==ie||e[231]!==ye?(we=t.jsxs("div",{className:Y,"data-view":X,children:[Q,te,q,ie,ye]}),e[225]=Y,e[226]=X,e[227]=Q,e[228]=te,e[229]=q,e[230]=ie,e[231]=ye,e[232]=we):we=e[232],we}function Us(i){return t.jsxs("span",{title:i.message,children:[t.jsx(ws,{size:12,"aria-hidden":"true"}),t.jsx("code",{children:i.token}),i.message]},`${i.token}:${i.code}`)}function Vs(i){return t.jsxs("option",{value:i.id,children:[i.title," · ",i.providerLabel]},i.id)}function Qs(i){return!i}function qs(i){return i.kind==="boolean"}function Bs(i){return i.kind!=="boolean"}function Ws(i){return i.name!=="voice_id"}function zs(i){return!["start_time","resume_time","duration"].includes(i.name)}function Gs(i){return!["duration","aspect_ratio"].includes(i.name)}function Ks(i){return i.name==="voice_id"}function Ys(){}function Xs(){}function Dt(i){const e=ue.c(28),{label:s,mediaUrl:l,muted:n,playbackRate:a,windows:r}=i,u=Ne.useRef(null),c=Ne.useRef(null),p=Ne.useRef(0);let o;e[0]!==r?(o=r.map(tn).join("|"),e[0]=r,e[1]=o):o=e[1];const f=o;let d;e[2]!==a||e[3]!==f?(d=()=>{const b=u.current;if(!b)return;const v=f.split("|").flatMap(en);p.current=0;const _=v[0]?.startSeconds??0,A=()=>{b.currentTime=_,c.current=_,b.playbackRate=a,b.play().catch(Zs)};let R=0,N,E=!1;const I=()=>{N!==void 0&&typeof b.cancelVideoFrameCallback=="function"&&(b.cancelVideoFrameCallback(N),N=void 0),R&&(cancelAnimationFrame(R),R=0)},F=()=>{if(E)return;const L=Fl({activeWindowIndex:p.current,currentTimeSeconds:b.currentTime,pendingSeekSeconds:c.current,windows:v});L.type==="seek"?(b.currentTime=L.timeSeconds,c.current=L.timeSeconds,p.current=L.windowIndex,b.play().catch(Js)):c.current!==null&&Math.abs(b.currentTime-c.current)<=.03333333333333333&&(c.current=null),D()},D=()=>{if(!E){if(typeof b.requestVideoFrameCallback=="function"){N=b.requestVideoFrameCallback(()=>F());return}R=requestAnimationFrame(()=>F())}};return b.readyState>=HTMLMediaElement.HAVE_METADATA?A():b.addEventListener("loadedmetadata",A,{once:!0}),D(),()=>{E=!0,I(),b.removeEventListener("loadedmetadata",A)}},e[2]=a,e[3]=f,e[4]=d):d=e[4];let m;e[5]!==l||e[6]!==a||e[7]!==f?(m=[l,a,f],e[5]=l,e[6]=a,e[7]=f,e[8]=m):m=e[8],Ne.useEffect(d,m);let h,x;e[9]!==a?(h=()=>{const b=u.current;b&&(b.playbackRate=a)},x=[a],e[9]=a,e[10]=h,e[11]=x):(h=e[10],x=e[11]),Ne.useEffect(h,x);let g;e[12]!==r?(g=r[0]?`${Je(r[0].startSeconds)}–${Je(r[r.length-1].endSeconds)}`:"",e[12]=r,e[13]=g):g=e[13];const S=g;let j;e[14]!==s?(j=t.jsx("span",{children:s}),e[14]=s,e[15]=j):j=e[15];let C;e[16]!==S?(C=t.jsx("strong",{children:S}),e[16]=S,e[17]=C):C=e[17];let y;e[18]!==j||e[19]!==C?(y=t.jsxs("div",{className:"confirm-split-loop-heading",children:[j,C]}),e[18]=j,e[19]=C,e[20]=y):y=e[20];let k;e[21]!==s||e[22]!==l||e[23]!==n?(k=t.jsx("video",{ref:u,"aria-label":s,src:l,muted:n,playsInline:!0,preload:"auto"}),e[21]=s,e[22]=l,e[23]=n,e[24]=k):k=e[24];let w;return e[25]!==k||e[26]!==y?(w=t.jsxs("section",{className:"confirm-split-loop",children:[y,k]}),e[25]=k,e[26]=y,e[27]=w):w=e[27],w}function Js(){}function Zs(){}function en(i){const[e,s]=i.split(":").map(Number);return Number.isFinite(e)&&Number.isFinite(s)&&s>e?[{startSeconds:e,endSeconds:s}]:[]}function tn(i){return`${i.startSeconds}:${i.endSeconds}`}const ln=[-1,-.1,-.01,.01,.1,1],sn=[-1,-.1,.1,1];function Rn(i){const e=ue.c(178),{cutPointsSeconds:s,mediaUrl:l,onChange:n,outputMode:a,selectedIndex:r,sourceDurationSeconds:u,sourceFps:c}=i,p=Ne.useRef(null),[o,f]=Ne.useState(!1),[d,m]=Ne.useState("in"),[h,x]=Ne.useState(null),[g,S]=Ne.useState(null),[j,C]=Ne.useState(null),[y,k]=Ne.useState(null);let w;e[0]!==s||e[1]!==u?(w=$l({cutPointsSeconds:s,sourceDurationSeconds:u}),e[0]=s,e[1]=u,e[2]=w):w=e[2];const b=w,v=b[r]??b[0];let _;e[3]!==c?(_=Il(c),e[3]=c,e[4]=_):_=e[4];const A=_;let R;e[5]!==v||e[6]!==u?(R=v?Al({segment:v,sourceDurationSeconds:u}):{segment:{startSeconds:0,endSeconds:0},surroundings:[]},e[5]=v,e[6]=u,e[7]=R):R=e[7];const N=R,E=v?`${v.startSeconds}:${v.endSeconds}`:"";let I;e[8]!==h||e[9]!==v?.startSeconds?(I=h??v?.startSeconds.toFixed(3)??"",e[8]=h,e[9]=v?.startSeconds,e[10]=I):I=e[10];const F=I;let D;e[11]!==g||e[12]!==v?.endSeconds?(D=g??v?.endSeconds.toFixed(3)??"",e[11]=g,e[12]=v?.endSeconds,e[13]=D):D=e[13];const L=D;let B;e[14]!==E||e[15]!==v?.durationSeconds||e[16]!==y?(B=y?.key===E?y.value:Rl(v?.durationSeconds??1),e[14]=E,e[15]=v?.durationSeconds,e[16]=y,e[17]=B):B=e[17];const ne=B;let W;e[18]!==n||e[19]!==a?(W=$=>{C(null),x(null),S(null),n({cutPointsSeconds:$.cutPointsSeconds,outputMode:$.outputMode??a,selectedIndex:$.selectedIndex})},e[18]=n,e[19]=a,e[20]=W):W=e[20];const M=W;let J;e[21]!==M?(J=$=>{x(null),S(null),M($)},e[21]=M,e[22]=J):J=e[22];const T=J;let U;e[23]!==T||e[24]!==s||e[25]!==r||e[26]!==u?(U=$=>{T(kt({cutPointsSeconds:s,deltaSeconds:$,index:r,sourceDurationSeconds:u}))},e[23]=T,e[24]=s,e[25]=r,e[26]=u,e[27]=U):U=e[27];const ce=U;let de;e[28]!==T||e[29]!==s||e[30]!==r||e[31]!==u?(de=$=>{T(_t({cutPointsSeconds:s,deltaSeconds:$,index:r,sourceDurationSeconds:u}))},e[28]=T,e[29]=s,e[30]=r,e[31]=u,e[32]=de):de=e[32];const Z=de;let he;e[33]!==T||e[34]!==s||e[35]!==v||e[36]!==r||e[37]!==u?(he=($,O)=>{if(!v)return;const ke=Math.round(Number($)*1e3)/1e3,$e=Math.round(Number(O)*1e3)/1e3;if(!Number.isFinite(ke)||!Number.isFinite($e)){C("Enter start and end times in seconds");return}const We=Et({cutPointsSeconds:s,endSeconds:$e,index:r,sourceDurationSeconds:u,startSeconds:ke});if(We.cutPointsSeconds.length===s.length&&We.cutPointsSeconds.every((tt,lt)=>tt===s[lt])&&(ke!==v.startSeconds||$e!==v.endSeconds)){C(`Choose a range from ${Je(v.startSeconds)} that stays inside neighbouring pieces`),x(null),S(null);return}T(We)},e[33]=T,e[34]=s,e[35]=v,e[36]=r,e[37]=u,e[38]=he):he=e[38];const re=he;let ee;e[39]!==T||e[40]!==s||e[41]!==v||e[42]!==r||e[43]!==u?(ee=$=>{const O=p.current?.currentTime;!v||typeof O!="number"||!Number.isFinite(O)||T(Et({cutPointsSeconds:s,endSeconds:$==="out"?O:v.endSeconds,index:r,sourceDurationSeconds:u,startSeconds:$==="in"?O:v.startSeconds}))},e[39]=T,e[40]=s,e[41]=v,e[42]=r,e[43]=u,e[44]=ee):ee=e[44];const ge=ee;let le;e[45]!==d||e[46]!==ce||e[47]!==Z?(le=$=>{if($.key!=="ArrowLeft"&&$.key!=="ArrowRight"||$.target instanceof HTMLInputElement)return;$.preventDefault();const O=$.key==="ArrowLeft"?-1:1,ke=$.altKey?.01:$.shiftKey?1:.1;d==="out"?Z(O*ke):ce(O*ke)},e[45]=d,e[46]=ce,e[47]=Z,e[48]=le):le=e[48];const fe=le,oe=ne?.25:1,ve=a==="remove"?"JOIN PREVIEW":"SURROUNDINGS";let z;e[49]!==a||e[50]!==b.length||e[51]!==v?(z=v?a==="all"?`Apply creates ${b.length} cells`:a==="keep"?`Apply creates 1 cell: ${Je(v.startSeconds)}-${Je(v.endSeconds)}`:`Apply creates 1 cell without ${Je(v.startSeconds)}-${Je(v.endSeconds)}`:"",e[49]=a,e[50]=b.length,e[51]=v,e[52]=z):z=e[52];const G=z;let se;e[53]!==s||e[54]!==A||e[55]!==r?(se=($,O,ke)=>t.jsxs("div",{className:"confirm-split-nudges",children:[ln.map($e=>{const We=ke($e),tt=We.cutPointsSeconds.every((lt,et)=>lt===s[et])&&We.selectedIndex===r;return t.jsxs("button",{type:"button",disabled:tt,onFocus:()=>m($),onClick:()=>O($e),children:[$e>0?"+":"−",Math.abs($e),"s"]},`${$}:${$e}`)}),A!==null&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Previous frame",title:"Previous frame",onFocus:()=>m($),onClick:()=>O(-A),children:"◂"}),t.jsx("button",{type:"button","aria-label":"Next frame",title:"Next frame",onFocus:()=>m($),onClick:()=>O(A),children:"▸"})]})]}),e[53]=s,e[54]=A,e[55]=r,e[56]=se):se=e[56];const pe=se;let K;e[57]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("span",{children:"Source"}),e[57]=K):K=e[57];let V;e[58]!==u?(V=Je(u),e[58]=u,e[59]=V):V=e[59];let Y;e[60]!==V?(Y=t.jsxs("div",{className:"confirm-section-heading",children:[K,t.jsxs("strong",{children:[V," total"]})]}),e[60]=V,e[61]=Y):Y=e[61];let X;e[62]!==l?(X=t.jsx("video",{ref:p,src:l,controls:!0,playsInline:!0,preload:"metadata"}),e[62]=l,e[63]=X):X=e[63];let Q;e[64]!==ge?(Q=t.jsx("button",{type:"button",onClick:()=>ge("in"),children:"SET IN HERE"}),e[64]=ge,e[65]=Q):Q=e[65];let te;e[66]!==ge?(te=t.jsx("button",{type:"button",onClick:()=>ge("out"),children:"SET OUT HERE"}),e[66]=ge,e[67]=te):te=e[67];let q;e[68]!==Q||e[69]!==te?(q=t.jsxs("div",{className:"confirm-actions-row",children:[Q,te]}),e[68]=Q,e[69]=te,e[70]=q):q=e[70];let ie;e[71]!==Y||e[72]!==X||e[73]!==q?(ie=t.jsxs("section",{className:"confirm-section","aria-label":"Source player",children:[Y,X,q]}),e[71]=Y,e[72]=X,e[73]=q,e[74]=ie):ie=e[74];let je;e[75]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx("span",{className:"confirm-section-label",children:"Pieces"}),e[75]=je):je=e[75];let be;if(e[76]!==s||e[77]!==M||e[78]!==b||e[79]!==r){let $;e[81]!==s||e[82]!==M||e[83]!==r?($=O=>t.jsxs("button",{type:"button",role:"listitem",className:O.index===r?"active":void 0,"aria-pressed":O.index===r,onClick:()=>M({cutPointsSeconds:s,selectedIndex:O.index}),children:[String(O.index+1).padStart(2,"0")," ",Je(O.startSeconds),"-",Je(O.endSeconds)]},`${O.startSeconds}:${O.endSeconds}`),e[81]=s,e[82]=M,e[83]=r,e[84]=$):$=e[84],be=b.map($),e[76]=s,e[77]=M,e[78]=b,e[79]=r,e[80]=be}else be=e[80];let Se;e[85]!==be?(Se=t.jsx("div",{className:"confirm-chips",role:"list",children:be}),e[85]=be,e[86]=Se):Se=e[86];const Ce=!v||v.durationSeconds<.04;let me;e[87]!==T||e[88]!==s||e[89]!==r||e[90]!==u?(me=()=>T(Ll({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[87]=T,e[88]=s,e[89]=r,e[90]=u,e[91]=me):me=e[91];let ye;e[92]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(Ss,{size:12,"aria-hidden":"true"}),e[92]=ye):ye=e[92];let we;e[93]!==Ce||e[94]!==me?(we=t.jsxs("button",{type:"button",disabled:Ce,onClick:me,children:[ye,"Split piece in half"]}),e[93]=Ce,e[94]=me,e[95]=we):we=e[95];const xe=r>=b.length-1;let Ie;e[96]!==T||e[97]!==s||e[98]!==r||e[99]!==u?(Ie=()=>T(Ml({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[96]=T,e[97]=s,e[98]=r,e[99]=u,e[100]=Ie):Ie=e[100];let Ue;e[101]!==xe||e[102]!==Ie?(Ue=t.jsx("button",{type:"button",disabled:xe,onClick:Ie,children:"Merge with next"}),e[101]=xe,e[102]=Ie,e[103]=Ue):Ue=e[103];let Le;e[104]!==we||e[105]!==Ue?(Le=t.jsxs("div",{className:"confirm-actions-row",children:[we,Ue]}),e[104]=we,e[105]=Ue,e[106]=Le):Le=e[106];let _e;e[107]!==Se||e[108]!==Le?(_e=t.jsxs("section",{className:"confirm-section","aria-label":"Pieces",children:[je,Se,Le]}),e[107]=Se,e[108]=Le,e[109]=_e):_e=e[109];let Pe;e[110]!==ie||e[111]!==_e?(Pe=t.jsxs("div",{className:"confirm-split-column",children:[ie,_e]}),e[110]=ie,e[111]=_e,e[112]=Pe):Pe=e[112];let Me;e[113]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx("span",{children:"Loops"}),e[113]=Me):Me=e[113];let Fe;e[114]===Symbol.for("react.memo_cache_sentinel")?(Fe=()=>f(nn),e[114]=Fe):Fe=e[114];let Ae;e[115]!==o?(Ae=o?t.jsx(Cs,{size:13}):t.jsx(Ps,{size:13}),e[115]=o,e[116]=Ae):Ae=e[116];const Ge=o?"Sound on":"Sound off";let Re;e[117]!==o||e[118]!==Ae||e[119]!==Ge?(Re=t.jsxs("div",{className:"confirm-section-heading",children:[Me,t.jsxs("button",{type:"button","aria-pressed":o,onClick:Fe,children:[Ae,Ge]})]}),e[117]=o,e[118]=Ae,e[119]=Ge,e[120]=Re):Re=e[120];const De=!o;let Te;e[121]!==N.segment?(Te=[N.segment],e[121]=N.segment,e[122]=Te):Te=e[122];let Ee;e[123]!==l||e[124]!==oe||e[125]!==De||e[126]!==Te?(Ee=t.jsx(Dt,{label:"SEGMENT",mediaUrl:l,muted:De,playbackRate:oe,windows:Te}),e[123]=l,e[124]=oe,e[125]=De,e[126]=Te,e[127]=Ee):Ee=e[127];const Oe=!o;let P;e[128]!==l||e[129]!==oe||e[130]!==ve||e[131]!==Oe||e[132]!==N.surroundings?(P=t.jsx(Dt,{label:ve,mediaUrl:l,muted:Oe,playbackRate:oe,windows:N.surroundings}),e[128]=l,e[129]=oe,e[130]=ve,e[131]=Oe,e[132]=N.surroundings,e[133]=P):P=e[133];let ae;e[134]!==Ee||e[135]!==P?(ae=t.jsxs("div",{className:"confirm-split-loops",children:[Ee,P]}),e[134]=Ee,e[135]=P,e[136]=ae):ae=e[136];let He;e[137]!==T||e[138]!==re||e[139]!==s||e[140]!==F||e[141]!==pe||e[142]!==ce||e[143]!==Z||e[144]!==L||e[145]!==E||e[146]!==v||e[147]!==r||e[148]!==ne||e[149]!==u?(He=v&&t.jsxs("div",{className:"confirm-split-bounds",children:[t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"IN"}),t.jsx("input",{type:"number","aria-label":"IN seconds",step:"0.001",value:F,onFocus:()=>m("in"),onChange:$=>x($.target.value),onBlur:()=>re(F,L),onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),re(F,L))}}),pe("in",ce,$=>kt({cutPointsSeconds:s,deltaSeconds:$,index:r,sourceDurationSeconds:u}))]}),t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"OUT"}),t.jsx("input",{type:"number","aria-label":"OUT seconds",step:"0.001",value:L,onFocus:()=>m("out"),onChange:$=>S($.target.value),onBlur:()=>re(F,L),onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),re(F,L))}}),pe("out",Z,$=>_t({cutPointsSeconds:s,deltaSeconds:$,index:r,sourceDurationSeconds:u}))]}),t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"MOVE"}),t.jsxs("output",{"aria-label":"Piece duration",children:[v.durationSeconds.toFixed(3),"s"]}),t.jsxs("div",{className:"confirm-split-nudges",children:[sn.map($=>{const O=Tl({cutPointsSeconds:s,deltaSeconds:$,index:r,sourceDurationSeconds:u}),ke=O.cutPointsSeconds.every(($e,We)=>$e===s[We]);return t.jsxs("button",{type:"button",disabled:ke,onClick:()=>T(O),children:[$>0?"+":"−",Math.abs($),"s"]},`move:${$}`)}),t.jsx("button",{type:"button","aria-pressed":ne,onClick:()=>k({key:E,value:!ne}),children:"Slow ×0.25"})]})]})]}),e[137]=T,e[138]=re,e[139]=s,e[140]=F,e[141]=pe,e[142]=ce,e[143]=Z,e[144]=L,e[145]=E,e[146]=v,e[147]=r,e[148]=ne,e[149]=u,e[150]=He):He=e[150];let Ve;e[151]!==j?(Ve=j&&t.jsx("p",{className:"confirm-field-error",role:"alert",children:j}),e[151]=j,e[152]=Ve):Ve=e[152];let Ye;e[153]!==Re||e[154]!==ae||e[155]!==He||e[156]!==Ve?(Ye=t.jsxs("section",{className:"confirm-section","aria-label":"Loops",children:[Re,ae,He,Ve]}),e[153]=Re,e[154]=ae,e[155]=He,e[156]=Ve,e[157]=Ye):Ye=e[157];let Ze;e[158]===Symbol.for("react.memo_cache_sentinel")?(Ze=t.jsx("span",{className:"confirm-section-label",children:"Output"}),e[158]=Ze):Ze=e[158];let nt;e[159]===Symbol.for("react.memo_cache_sentinel")?(nt=[["keep","KEEP segment"],["remove","REMOVE segment"],["all","ALL pieces"]],e[159]=nt):nt=e[159];let Xe;e[160]!==s||e[161]!==M||e[162]!==a||e[163]!==b.length||e[164]!==r?(Xe=t.jsx("div",{className:"confirm-chips",children:nt.map($=>{const[O,ke]=$;return t.jsx("button",{type:"button",className:a===O?"active":void 0,"aria-pressed":a===O,disabled:O==="remove"&&b.length<2,onClick:()=>M({cutPointsSeconds:s,outputMode:O,selectedIndex:r}),children:ke},O)})}),e[160]=s,e[161]=M,e[162]=a,e[163]=b.length,e[164]=r,e[165]=Xe):Xe=e[165];let Qe;e[166]!==G?(Qe=t.jsx("p",{className:"confirm-help",children:G}),e[166]=G,e[167]=Qe):Qe=e[167];let qe;e[168]!==Xe||e[169]!==Qe?(qe=t.jsxs("section",{className:"confirm-section","aria-label":"Output mode",children:[Ze,Xe,Qe]}),e[168]=Xe,e[169]=Qe,e[170]=qe):qe=e[170];let Be;e[171]!==Ye||e[172]!==qe?(Be=t.jsxs("div",{className:"confirm-split-column",children:[Ye,qe]}),e[171]=Ye,e[172]=qe,e[173]=Be):Be=e[173];let Ke;return e[174]!==fe||e[175]!==Pe||e[176]!==Be?(Ke=t.jsxs("div",{className:"confirm-split",onKeyDown:fe,children:[Pe,Be]}),e[174]=fe,e[175]=Pe,e[176]=Be,e[177]=Ke):Ke=e[177],Ke}function nn(i){return!i}function Jt(i){const e=ue.c(3),{prompt:s}=i;if(!s.trim())return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("b",{"aria-hidden":"true",children:"›"}),e[0]=l):l=e[0];let n;return e[1]!==s?(n=t.jsxs("p",{className:"confirm-prompt-echo",children:[l,t.jsx("span",{children:s})]}),e[1]=s,e[2]=n):n=e[2],n}function Zt({columns:i,settings:e}){return t.jsx("dl",{className:"confirm-settings","aria-label":"Action settings",style:{gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:e.map(s=>t.jsxs("div",{className:[s.wide?"confirm-setting-wide":"",s.tone==="warning"?"confirm-setting-warning":""].join(" ").trim()||void 0,children:[t.jsx("dt",{children:s.label}),t.jsx("dd",{children:s.value})]},s.label))})}function Tn(i){const e=ue.c(125),{asset:s,busy:l,connection:n,draft:a,onChange:r,onConnect:u,onThreadCreditsChange:c,onThreadOptionsChange:p,onThreadPromptChange:o,prompt:f,settings:d,sourceLabel:m,threadReview:h}=i,x=s?.type==="video"||s?.type==="final",g=s?.type==="image"?s.mediaUrl??s.thumbnailUrl:null,S=a.scheduledFor!==null;let j;e[0]!==a.postText?(j=a.postText.trim(),e[0]=a.postText,e[1]=j):j=e[1];const C=j==="",y=Dl(n?.status??null);let k;e[2]!==n?(k=n?.status?Ol(n.status):null,e[2]=n,e[3]=k):k=e[3];const w=k,b=a.postText.length>y;let v,_,A,R,N,E,I,F,D,L;if(e[4]!==w||e[5]!==s||e[6]!==l||e[7]!==n||e[8]!==a.orientation||e[9]!==a.postText||e[10]!==a.scheduledFor||e[11]!==g||e[12]!==y||e[13]!==r||e[14]!==u||e[15]!==c||e[16]!==p||e[17]!==o||e[18]!==f||e[19]!==S||e[20]!==d||e[21]!==m||e[22]!==h||e[23]!==b||e[24]!==C||e[25]!==x){const W=h?Hl(h):[];let M;e[36]!==h?(M=h?Ul(h.context):!1,e[36]=h,e[37]=M):M=e[37];const J=M;let T;e[38]!==n?(T=n?.status?Vl(n.status,{connecting:n.connecting}):null,e[38]=n,e[39]=T):T=e[39];const U=T,ce=U!==null&&U.tone!=="connected";_="confirm-routed confirm-post";let de;e[40]!==f?(de=t.jsx(Jt,{prompt:f}),e[40]=f,e[41]=de):de=e[41];let Z;e[42]!==d?(Z=t.jsx(Zt,{columns:2,settings:d}),e[42]=d,e[43]=Z):Z=e[43],e[44]!==de||e[45]!==Z?(A=t.jsxs("div",{className:"confirm-routed-main",children:[de,Z]}),e[44]=de,e[45]=Z,e[46]=A):A=e[46],R="x-post-preview",N="X post preview";let he,re;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx("span",{"aria-hidden":"true",children:"X"}),re=t.jsx("strong",{children:"Post preview"}),e[47]=he,e[48]=re):(he=e[47],re=e[48]),e[49]!==m?(E=t.jsxs("header",{children:[he,t.jsxs("div",{children:[re,t.jsx("small",{children:m})]})]}),e[49]=m,e[50]=E):E=e[50],e[51]!==l||e[52]!==n||e[53]!==U||e[54]!==u||e[55]!==ce?(I=ce&&U&&t.jsxs("div",{className:`x-post-connection x-post-connection-${U.tone}`,role:"status","aria-label":"X connection",children:[t.jsxs("div",{children:[t.jsx("strong",{children:U.label}),t.jsx("span",{children:U.detail}),n?.connecting&&n.authorizeUrl&&t.jsx("a",{href:n.authorizeUrl,target:"_blank",rel:"noopener noreferrer",children:"Open the X authorization page"})]}),u&&(U.actionLabel||n?.connecting)&&t.jsx("button",{type:"button",disabled:l||n?.connecting,onClick:u,children:n?.connecting?"Waiting…":U.actionLabel})]}),e[51]=l,e[52]=n,e[53]=U,e[54]=u,e[55]=ce,e[56]=I):I=e[56],e[57]!==s||e[58]!==g||e[59]!==m||e[60]!==x?(F=t.jsx("div",{className:"x-post-preview-media",children:x&&s?.mediaUrl?t.jsx("video",{src:s.mediaUrl,poster:s.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata"}):g?t.jsx("img",{src:g,alt:`${m} post preview`}):t.jsxs("div",{className:"x-post-preview-fallback",children:[t.jsx(Kt,{size:28,"aria-hidden":"true"}),t.jsx("span",{children:"Media preview unavailable"})]})}),e[57]=s,e[58]=g,e[59]=m,e[60]=x,e[61]=F):F=e[61];let ee;e[62]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("label",{htmlFor:"x-post-title",children:"Title"}),e[62]=ee):ee=e[62];const ge=C||b;let le;e[63]!==r?(le=xe=>r({postText:xe.target.value}),e[63]=r,e[64]=le):le=e[64];let fe;e[65]!==l||e[66]!==a.postText||e[67]!==ge||e[68]!==le?(fe=t.jsx("textarea",{id:"x-post-title","aria-invalid":ge,disabled:l,placeholder:"Title (required)",required:!0,rows:3,value:a.postText,onChange:le}),e[65]=l,e[66]=a.postText,e[67]=ge,e[68]=le,e[69]=fe):fe=e[69];const oe=C||b?"confirm-field-error":void 0,ve=C?"A title is required":`${a.postText.length}/${y} characters`;let z;e[70]!==oe||e[71]!==ve?(z=t.jsx("small",{className:oe,children:ve}),e[70]=oe,e[71]=ve,e[72]=z):z=e[72];let G;e[73]!==w?(G=w&&t.jsx("small",{className:"x-post-account",children:w}),e[73]=w,e[74]=G):G=e[74],e[75]!==fe||e[76]!==z||e[77]!==G?(D=t.jsxs("div",{className:"x-post-preview-copy",children:[ee,fe,z,G]}),e[75]=fe,e[76]=z,e[77]=G,e[78]=D):D=e[78];let se;e[79]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("span",{children:"Publish"}),e[79]=se):se=e[79];const pe=S?"schedule":"now";let K;e[80]!==r?(K=xe=>r({scheduledFor:xe.target.value==="schedule"?Kl():null}),e[80]=r,e[81]=K):K=e[81];let V,Y;e[82]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("option",{value:"now",children:"Now"}),Y=t.jsx("option",{value:"schedule",children:"Schedule"}),e[82]=V,e[83]=Y):(V=e[82],Y=e[83]);let X;e[84]!==l||e[85]!==pe||e[86]!==K?(X=t.jsxs("label",{className:"confirm-field",children:[se,t.jsxs("select",{"aria-label":"Publish timing",disabled:l,value:pe,onChange:K,children:[V,Y]})]}),e[84]=l,e[85]=pe,e[86]=K,e[87]=X):X=e[87];let Q;e[88]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("span",{children:"Orientation"}),e[88]=Q):Q=e[88];const te=l||s?.type==="image",q=a.orientation??"source";let ie;e[89]!==r?(ie=xe=>r({orientation:xe.target.value==="portrait"||xe.target.value==="landscape"?xe.target.value:null}),e[89]=r,e[90]=ie):ie=e[90];let je,be,Se;e[91]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx("option",{value:"source",children:"Keep source"}),be=t.jsx("option",{value:"portrait",children:"Portrait"}),Se=t.jsx("option",{value:"landscape",children:"Landscape"}),e[91]=je,e[92]=be,e[93]=Se):(je=e[91],be=e[92],Se=e[93]);let Ce;e[94]!==te||e[95]!==q||e[96]!==ie?(Ce=t.jsxs("select",{"aria-label":"Video orientation",disabled:te,value:q,onChange:ie,children:[je,be,Se]}),e[94]=te,e[95]=q,e[96]=ie,e[97]=Ce):Ce=e[97];let me;e[98]!==s?.type?(me=s?.type==="image"&&t.jsx("small",{children:"Video posts only"}),e[98]=s?.type,e[99]=me):me=e[99];let ye;e[100]!==Ce||e[101]!==me?(ye=t.jsxs("label",{className:"confirm-field",children:[Q,Ce,me]}),e[100]=Ce,e[101]=me,e[102]=ye):ye=e[102];let we;e[103]!==l||e[104]!==a.scheduledFor||e[105]!==r||e[106]!==S?(we=S&&t.jsxs("label",{className:"confirm-field",children:[t.jsx("span",{children:"Date and time"}),t.jsx("input",{"aria-label":"Schedule date and time",disabled:l,required:!0,type:"datetime-local",value:ql(a.scheduledFor??""),onChange:xe=>r({scheduledFor:Ql(xe.target.value)})}),t.jsx("small",{children:"Uses your local timezone"})]}),e[103]=l,e[104]=a.scheduledFor,e[105]=r,e[106]=S,e[107]=we):we=e[107],e[108]!==X||e[109]!==ye||e[110]!==we?(L=t.jsxs("div",{className:"x-post-preview-options",role:"group","aria-label":"Post options",children:[X,ye,we]}),e[108]=X,e[109]=ye,e[110]=we,e[111]=L):L=e[111],v=x&&h&&t.jsxs("section",{className:"x-post-thread","aria-label":"How it was made thread",children:[t.jsxs("label",{className:"x-post-thread-master",children:[t.jsx("input",{type:"checkbox",checked:h.options.enabled,disabled:l||h.loading||!J,onChange:xe=>p?.({enabled:xe.target.checked})}),t.jsxs("span",{children:[t.jsx("strong",{children:"Add how-it-was-made thread"}),t.jsx("small",{children:"Reply with the prompt and input images, then thank the original video"})]})]}),h.loading?t.jsx("small",{children:"Loading generation details…"}):h.error?t.jsx("small",{className:"confirm-field-error",children:h.error}):J?h.options.enabled?t.jsxs("div",{className:"x-post-thread-steps",children:[h.context.steps.map((xe,Ie)=>t.jsx(on,{busy:l,index:Ie,maxCharacters:y,prompt:Bl(h,xe),reply:W.find(Ue=>Ue.stepId===xe.id)??null,step:xe,stepCount:h.context.steps.length,onPromptChange:o},xe.id)),h.context.credits.length>0&&t.jsx(dn,{busy:l,maxCharacters:y,replyCount:W.filter(an).length,text:Wl(h),onChange:c}),W.length===0&&t.jsx("small",{className:"confirm-field-error",children:zl})]}):null:t.jsx("small",{children:"No generation details were found."})]}),e[4]=w,e[5]=s,e[6]=l,e[7]=n,e[8]=a.orientation,e[9]=a.postText,e[10]=a.scheduledFor,e[11]=g,e[12]=y,e[13]=r,e[14]=u,e[15]=c,e[16]=p,e[17]=o,e[18]=f,e[19]=S,e[20]=d,e[21]=m,e[22]=h,e[23]=b,e[24]=C,e[25]=x,e[26]=v,e[27]=_,e[28]=A,e[29]=R,e[30]=N,e[31]=E,e[32]=I,e[33]=F,e[34]=D,e[35]=L}else v=e[26],_=e[27],A=e[28],R=e[29],N=e[30],E=e[31],I=e[32],F=e[33],D=e[34],L=e[35];let B;e[112]!==v||e[113]!==R||e[114]!==N||e[115]!==E||e[116]!==I||e[117]!==F||e[118]!==D||e[119]!==L?(B=t.jsxs("article",{className:R,"aria-label":N,children:[E,I,F,D,L,v]}),e[112]=v,e[113]=R,e[114]=N,e[115]=E,e[116]=I,e[117]=F,e[118]=D,e[119]=L,e[120]=B):B=e[120];let ne;return e[121]!==_||e[122]!==A||e[123]!==B?(ne=t.jsxs("div",{className:_,children:[A,B]}),e[121]=_,e[122]=A,e[123]=B,e[124]=ne):ne=e[124],ne}function an(i){return i.stepId===null}function el(i){return i===0?"nothing to post":`posts as ${i} ${i===1?"reply":"replies"}`}function rn(i){const e=Gl(i.images).length;return e===i.images.length?"Input images":`Input images · first ${e} of ${i.images.length} attach`}function on(i){const e=ue.c(37),{busy:s,index:l,maxCharacters:n,onPromptChange:a,prompt:r,reply:u,step:c,stepCount:p}=i,o=`x-post-thread-prompt-${l}`,f=u?.text.length??0,d=f>n,m=p>1?`Generation step ${l+1}`:"Generation step";let h;e[0]!==l||e[1]!==p?(h=p>1&&t.jsxs("small",{className:"x-post-thread-step-ordinal",children:["Step ",l+1," of ",p]}),e[0]=l,e[1]=p,e[2]=h):h=e[2];let x;e[3]!==c.model?(x=c.model&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:"Model"}),t.jsxs("p",{className:"x-post-thread-model",children:[t.jsx("span",{children:c.model.label}),c.model.provider&&t.jsxs("small",{children:["via ",c.model.provider]})]})]}),e[3]=c.model,e[4]=x):x=e[4];let g;e[5]!==o?(g=t.jsx("label",{className:"x-post-thread-label",htmlFor:o,children:"Prompt"}),e[5]=o,e[6]=g):g=e[6];const S=d?"confirm-field-error":void 0,j=u?1:0;let C;e[7]!==j?(C=el(j),e[7]=j,e[8]=C):C=e[8];let y;e[9]!==n||e[10]!==f||e[11]!==S||e[12]!==C?(y=t.jsxs("small",{className:S,children:[f,"/",n," characters with heading"," · ",C]}),e[9]=n,e[10]=f,e[11]=S,e[12]=C,e[13]=y):y=e[13];let k;e[14]!==g||e[15]!==y?(k=t.jsxs("div",{className:"x-post-thread-field-head",children:[g,y]}),e[14]=g,e[15]=y,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==c.id?(w=R=>a?.(c.id,R.target.value),e[17]=a,e[18]=c.id,e[19]=w):w=e[19];let b;e[20]!==s||e[21]!==r||e[22]!==o||e[23]!==w||e[24]!==d?(b=t.jsx("textarea",{id:o,"aria-invalid":d,disabled:s,rows:4,value:r,onChange:w}),e[20]=s,e[21]=r,e[22]=o,e[23]=w,e[24]=d,e[25]=b):b=e[25];let v;e[26]!==b||e[27]!==k?(v=t.jsxs("div",{className:"x-post-thread-field",children:[k,b]}),e[26]=b,e[27]=k,e[28]=v):v=e[28];let _;e[29]!==c?(_=c.images.length>0&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:rn(c)}),t.jsx("div",{className:"x-post-thread-images",children:c.images.map(cn)})]}),e[29]=c,e[30]=_):_=e[30];let A;return e[31]!==m||e[32]!==v||e[33]!==_||e[34]!==h||e[35]!==x?(A=t.jsxs("article",{className:"x-post-thread-step","aria-label":m,children:[h,x,v,_]}),e[31]=m,e[32]=v,e[33]=_,e[34]=h,e[35]=x,e[36]=A):A=e[36],A}function cn(i){return t.jsxs("figure",{children:[t.jsx("img",{src:i.thumbnailUrl??i.mediaUrl??void 0,alt:i.label}),t.jsx("figcaption",{children:i.label})]},i.assetId)}function dn(i){const e=ue.c(18),{busy:s,maxCharacters:l,onChange:n,replyCount:a,text:r}=i,u=r.length>l;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("label",{className:"x-post-thread-label",htmlFor:"x-post-thread-credits",children:"Credits"}),e[0]=c):c=e[0];const p=u?"confirm-field-error":void 0,o=r.length;let f;e[1]!==a?(f=el(a),e[1]=a,e[2]=f):f=e[2];let d;e[3]!==l||e[4]!==p||e[5]!==f||e[6]!==r.length?(d=t.jsxs("div",{className:"x-post-thread-field-head",children:[c,t.jsxs("small",{className:p,children:[o,"/",l," characters · ",f]})]}),e[3]=l,e[4]=p,e[5]=f,e[6]=r.length,e[7]=d):d=e[7];let m;e[8]!==n?(m=g=>n?.(g.target.value),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==m||e[12]!==r||e[13]!==u?(h=t.jsx("textarea",{id:"x-post-thread-credits","aria-invalid":u,disabled:s,rows:2,value:r,onChange:m}),e[10]=s,e[11]=m,e[12]=r,e[13]=u,e[14]=h):h=e[14];let x;return e[15]!==d||e[16]!==h?(x=t.jsx("article",{className:"x-post-thread-step","aria-label":"Credits",children:t.jsxs("div",{className:"x-post-thread-field",children:[d,h]})}),e[15]=d,e[16]=h,e[17]=x):x=e[17],x}function mn(i){const e=ue.c(15),{effectiveSpeed:s,mediaUrl:l,thumbnailUrl:n}=i,a=Ne.useRef(null),[r,u]=Ne.useState(!1),c=s&&s>0?s:1;let p;e[0]!==c?(p=()=>{const j=a.current;if(!j)return;const C=()=>u(!0),y=()=>u(!1);j.defaultPlaybackRate=c;const k=()=>{j.defaultPlaybackRate=c,j.playbackRate=c,j.muted=!0,j.play().catch(()=>u(!1))};return j.addEventListener("play",C),j.addEventListener("pause",y),j.readyState>=HTMLMediaElement.HAVE_METADATA?k():j.addEventListener("loadedmetadata",k,{once:!0}),()=>{j.removeEventListener("loadedmetadata",k),j.removeEventListener("play",C),j.removeEventListener("pause",y),j.pause()}},e[0]=c,e[1]=p):p=e[1];let o;e[2]!==l||e[3]!==c?(o=[l,c],e[2]=l,e[3]=c,e[4]=o):o=e[4],Ne.useEffect(p,o);let f;e[5]!==s?(f=s?`preview at ${Yl(s)}×`:"source preview",e[5]=s,e[6]=f):f=e[6];const d=f,m=n??void 0;let h;e[7]!==l||e[8]!==m?(h=t.jsx("video",{ref:a,src:l,poster:m,controls:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto"}),e[7]=l,e[8]=m,e[9]=h):h=e[9];const x=r?`Live ${d} — source not yet changed`:`Press Play for ${d} — source not yet changed`;let g;e[10]!==x?(g=t.jsx("small",{children:x}),e[10]=x,e[11]=g):g=e[11];let S;return e[12]!==h||e[13]!==g?(S=t.jsxs(t.Fragment,{children:[h,g]}),e[12]=h,e[13]=g,e[14]=S):S=e[14],S}function In(i){const e=ue.c(14),{prompt:s,settings:l,speedPreview:n}=i,a=n===void 0?null:n,r=a?2:Math.min(6,Math.max(1,l.length)),u=`confirm-routed${a?" confirm-routed-with-preview":""}`;let c;e[0]!==s?(c=t.jsx(Jt,{prompt:s}),e[0]=s,e[1]=c):c=e[1];let p;e[2]!==r||e[3]!==l?(p=t.jsx(Zt,{columns:r,settings:l}),e[2]=r,e[3]=l,e[4]=p):p=e[4];let o;e[5]!==c||e[6]!==p?(o=t.jsxs("div",{className:"confirm-routed-main",children:[c,p]}),e[5]=c,e[6]=p,e[7]=o):o=e[7];let f;e[8]!==a?(f=a&&t.jsx("div",{className:"confirm-routed-preview","aria-label":"Speed change preview",children:a.unavailableReason===null?t.jsx(mn,{effectiveSpeed:a.effectiveSpeed,mediaUrl:a.mediaUrl??"",thumbnailUrl:a.thumbnailUrl},a.mediaUrl??"speed-preview"):t.jsx("p",{className:"confirm-routed-preview-fallback",children:`Preview unavailable — ${a.unavailableReason}.`})}),e[8]=a,e[9]=f):f=e[9];let d;return e[10]!==u||e[11]!==o||e[12]!==f?(d=t.jsxs("div",{className:u,children:[o,f]}),e[10]=u,e[11]=o,e[12]=f,e[13]=d):d=e[13],d}function Ln(i){const e=ue.c(19),{busy:s,onToggleSuggestion:l,plan:n,previews:a}=i;let r;e[0]!==n.confirmation.reason?(r=t.jsx("p",{children:n.confirmation.reason}),e[0]=n.confirmation.reason,e[1]=r):r=e[1];let u;e[2]!==s||e[3]!==l||e[4]!==n.suggestions?(u=n.suggestions&&t.jsxs("fieldset",{className:"confirm-plan-suggestions",children:[t.jsx("legend",{children:"Include suggestions"}),n.suggestions.map(d=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:d.included,disabled:s,onChange:()=>l(d.suggestionId)}),t.jsxs("span",{children:[t.jsx("strong",{children:d.label}),d.detail&&t.jsx("small",{children:d.detail})]})]},d.suggestionId))]}),e[2]=s,e[3]=l,e[4]=n.suggestions,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsxs("div",{className:"confirm-plan-context",children:[r,u]}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;if(e[9]!==n.stages||e[10]!==a){let d;e[12]!==a?(d=m=>{const h=m.kind==="edit"?a[m.stageId]:void 0;return t.jsxs("li",{children:[t.jsx("span",{children:m.kind.toUpperCase()}),t.jsx("strong",{children:m.summary}),h&&t.jsxs(t.Fragment,{children:[t.jsxs("small",{children:[h.diff.changedClipIds.length," clips · duration ",h.diff.beforeDurationFrames," → ",h.diff.afterDurationFrames," frames"]}),h.warnings.map((x,g)=>t.jsxs("p",{className:"confirm-stage-warning",children:[t.jsx(St,{size:11,"aria-hidden":"true"}),x.message]},`${m.stageId}:warning:${g}`)),h.conflicts.map((x,g)=>t.jsxs("p",{className:"confirm-stage-conflict",children:[t.jsx(ks,{size:11,"aria-hidden":"true"}),x.message]},`${m.stageId}:conflict:${g}`))]}),m.kind==="queued"&&t.jsxs("small",{children:[m.provider&&m.model?`${m.provider} · ${m.model}`:m.tool,m.estimatedCostUsd!==void 0?` · estimated $${m.estimatedCostUsd.toFixed(4)}`:m.estimateUnavailable?" · cost estimate unavailable":""]})]},m.stageId)},e[12]=a,e[13]=d):d=e[13],p=n.stages.map(d),e[9]=n.stages,e[10]=a,e[11]=p}else p=e[11];let o;e[14]!==p?(o=t.jsx("ol",{className:"confirm-stages","aria-label":"Planned stages",children:p}),e[14]=p,e[15]=o):o=e[15];let f;return e[16]!==c||e[17]!==o?(f=t.jsxs("div",{className:"confirm-plan",children:[c,o]}),e[16]=c,e[17]=o,e[18]=f):f=e[18],f}function Mn(i){const e=ue.c(12),{kindLabel:s,reason:l,stageTitle:n}=i;let a;e[0]!==l?(a=t.jsx("div",{className:"confirm-plan-context",children:t.jsx("p",{children:l})}),e[0]=l,e[1]=a):a=e[1];let r;e[2]!==s?(r=t.jsx("span",{children:s}),e[2]=s,e[3]=r):r=e[3];let u;e[4]!==n?(u=t.jsx("strong",{children:n}),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsx("ol",{className:"confirm-stages","aria-label":"Planned stages",children:t.jsxs("li",{children:[r,u]})}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;return e[9]!==a||e[10]!==c?(p=t.jsxs("div",{className:"confirm-plan",children:[a,c]}),e[9]=a,e[10]=c,e[11]=p):p=e[11],p}const Ot={"top-left":"Top left","top-center":"Top center","top-right":"Top right","middle-left":"Middle left","middle-center":"Middle center","middle-right":"Middle right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},tl=["fe2601bf8","8209bd208","ba34532e8","ba6ee3ae8","ba95bfae8","824f55208","feaaaabf8","00ccb8800","33c3ed680","646dcd668","8abc29c48","f976883d0","2bd10cc08","246bc6840","3ae7049a0","78227f738","1fa124fc0","b072db3a8","f715de7b0","a150ca198","7aac44a60","ed6a62858","060607bf8","5d2a6a4c8","aa0132f80","0087658f0","fe9a35ac0","8277d98f8","ba51bbff0","bacc3e160","ba9403e00","824b0bc28","fe263c180"],pt=tl.length;function un(){const i=[];for(let e=0;e<pt;e+=1){const s=tl[e];for(let l=0;l<pt;l+=1)(Number.parseInt(s.charAt(Math.floor(l/4)),16)&8>>l%4)!==0&&i.push(`M${l} ${e}h1v1h-1z`)}return i.join("")}const hn=un(),Ht=28,fn=16,pn={center:"Centered","above-qr":"Above QR","on-qr":"On QR","below-qr":"Below QR"};function xn(){const i=ue.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("svg",{className:"watermark-preview-qr-modules",viewBox:`0 0 ${pt} ${pt}`,shapeRendering:"crispEdges",children:t.jsx("path",{d:hn,fill:"currentColor"})}),i[0]=e):e=i[0],e}function gn(i){const e=ue.c(5),{platform:s}=i,l=`watermark-preview-platform-icon watermark-preview-${s}-icon`,n=is[s];let a;e[0]!==n?(a=t.jsx("path",{d:n,fill:"currentColor"}),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==l||e[3]!==a?(r=t.jsx("svg",{className:l,viewBox:"0 0 24 24","aria-hidden":"true",children:a}),e[2]=l,e[3]=a,e[4]=r):r=e[4],r}function ht(i){return Math.round(i*100)}function bn(i){return i>0?`${i.toFixed(1)}s`:"Off"}function vn(i,e,s){if(s<=0)return{left:0,width:100};const l=ut(i/s*100,0,100),n=ut((e??s)/s*100,l,100);return{left:l,width:n-l}}function ut(i,e,s){return Math.min(s,Math.max(e,i))}function Ut(i){return Number.isFinite(i)?`${i.toFixed(1)}s`:"0.0s"}function Nt(i,e){return fn*(Math.min(i,e)/e)}function jn(i,e,s){const[l,n]=i.split("-"),a=[],r={aspectRatio:"1 / 1",height:`${Nt(e,s)}%`};n==="left"&&(r.left="2%"),n==="right"&&(r.right="2%"),n==="center"&&(r.left="50%",a.push("translateX(-50%)"));const u=`${2*(e/s)}%`;return l==="top"&&(r.top=u),l==="bottom"&&(r.bottom=u),l==="middle"&&(r.top="50%",a.push("translateY(-50%)")),a.length>0&&(r.transform=a.join(" ")),r}function yn(i,e,s,l,n,a){const r=Gt(l);if(n==="center")return{aspectRatio:`${yt} / ${r}`,height:`${Nt(i,e)*(r/as)}%`,top:`${s}%`,left:"50%",transform:"translate(-50%, -50%)"};const[u,c]=a.split("-"),p=Nt(i,e),o=p*(e/i),f=p*(r/yt),d=2*(i/e),m=Math.max(.4,p*.06);let h=c==="left"?2:c==="right"?98-o:50-o/2;const x=u==="top"?d:u==="bottom"?100-d-p:50-p/2;let g=n==="above-qr"?x-f-m:n==="below-qr"?x+p+m:x+(p-f)/2;return h=ut(h,2,98-o),g=ut(g,d,100-d-f),{aspectRatio:`${yt} / ${r}`,width:`${o}%`,height:"auto",top:`${g}%`,left:`${h}%`}}function wn(i,e,s){const l=(Gt(e)-2)/2*(s/100);return{paddingInline:`${i/Ht}em`,borderRadius:`${l/Ht}em`}}function ft(i){const e=ue.c(16),{busy:s,checked:l,description:n,disabled:a,label:r,onChange:u}=i,p=s||(a===void 0?!1:a);let o;e[0]!==u?(o=g=>u(g.target.checked),e[0]=u,e[1]=o):o=e[1];let f;e[2]!==l||e[3]!==p||e[4]!==o?(f=t.jsx("input",{type:"checkbox",checked:l,disabled:p,onChange:o}),e[2]=l,e[3]=p,e[4]=o,e[5]=f):f=e[5];let d;e[6]!==r?(d=t.jsx("strong",{children:r}),e[6]=r,e[7]=d):d=e[7];let m;e[8]!==n?(m=t.jsx("small",{children:n}),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==d||e[11]!==m?(h=t.jsxs("span",{className:"confirm-toggle-copy",children:[d,m]}),e[10]=d,e[11]=m,e[12]=h):h=e[12];let x;return e[13]!==f||e[14]!==h?(x=t.jsxs("label",{className:"confirm-toggle",children:[f,h]}),e[13]=f,e[14]=h,e[15]=x):x=e[15],x}function st(i){const e=ue.c(19),{busy:s,id:l,label:n,max:a,min:r,onChange:u,output:c,value:p}=i;let o;e[0]!==l||e[1]!==n?(o=t.jsx("label",{htmlFor:l,children:n}),e[0]=l,e[1]=n,e[2]=o):o=e[2];let f;e[3]!==l||e[4]!==c?(f=t.jsx("output",{htmlFor:l,children:c}),e[3]=l,e[4]=c,e[5]=f):f=e[5];let d;e[6]!==u?(d=x=>u(Number(x.target.value)),e[6]=u,e[7]=d):d=e[7];let m;e[8]!==s||e[9]!==l||e[10]!==a||e[11]!==r||e[12]!==d||e[13]!==p?(m=t.jsx("input",{id:l,type:"range",min:r,max:a,step:"1",value:p,disabled:s,onChange:d}),e[8]=s,e[9]=l,e[10]=a,e[11]=r,e[12]=d,e[13]=p,e[14]=m):m=e[14];let h;return e[15]!==o||e[16]!==f||e[17]!==m?(h=t.jsxs("div",{className:"confirm-range",children:[o,f,m]}),e[15]=o,e[16]=f,e[17]=m,e[18]=h):h=e[18],h}function Vt(i){const e=ue.c(102),{busy:s,currentTime:l,duration:n,endSeconds:a,idPrefix:r,label:u,onChange:c,playhead:p,startSeconds:o}=i;let f;e[0]!==n||e[1]!==a||e[2]!==o?(f=rs(o,a,n),e[0]=n,e[1]=a,e[2]=o,e[3]=f):f=e[3];const d=f;let m;e[4]!==n||e[5]!==a||e[6]!==o?(m=vn(o,a,n),e[4]=n,e[5]=a,e[6]=o,e[7]=m):m=e[7];const h=m,x=a??(n>0?n:null),g=`${u} timing`;let S;e[8]!==u?(S=t.jsx("span",{children:u}),e[8]=u,e[9]=S):S=e[9];const j=`${h.left}%`,C=`${h.width}%`;let y;e[10]!==j||e[11]!==C?(y=t.jsx("span",{className:"watermark-timeline-window",style:{left:j,width:C}}),e[10]=j,e[11]=C,e[12]=y):y=e[12];const k=`${p}%`;let w;e[13]!==k?(w=t.jsx("span",{className:"watermark-timeline-playhead",style:{left:k}}),e[13]=k,e[14]=w):w=e[14];let b;e[15]!==y||e[16]!==w?(b=t.jsxs("div",{className:"watermark-timeline","aria-hidden":"true",children:[y,w]}),e[15]=y,e[16]=w,e[17]=b):b=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{children:"Start (s)"}),e[18]=v):v=e[18];const _=`${r}-start`,A=`${u} start`,R=n>0?n:void 0;let N;e[19]!==a||e[20]!==c?(N=q=>c(Math.max(0,Number(q.target.value)||0),a),e[19]=a,e[20]=c,e[21]=N):N=e[21];let E;e[22]!==s||e[23]!==o||e[24]!==_||e[25]!==A||e[26]!==R||e[27]!==N?(E=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[v,t.jsx("input",{id:_,"aria-label":A,type:"number",min:"0",max:R,step:"0.1",value:o,disabled:s,onChange:N})]}),e[22]=s,e[23]=o,e[24]=_,e[25]=A,e[26]=R,e[27]=N,e[28]=E):E=e[28];let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{children:"End (s)"}),e[29]=I):I=e[29];const F=`${r}-end`,D=`${u} end`,L=!d,B=n>0?n:void 0,ne=a??"";let W;e[30]!==n?(W=n>0?n.toFixed(1):"Clip end",e[30]=n,e[31]=W):W=e[31];let M;e[32]!==c||e[33]!==o?(M=q=>c(o,q.target.value===""?null:Math.max(0,Number(q.target.value)||0)),e[32]=c,e[33]=o,e[34]=M):M=e[34];let J;e[35]!==s||e[36]!==F||e[37]!==D||e[38]!==L||e[39]!==B||e[40]!==ne||e[41]!==W||e[42]!==M?(J=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[I,t.jsx("input",{id:F,"aria-label":D,"aria-invalid":L,type:"number",min:"0",max:B,step:"0.1",value:ne,placeholder:W,disabled:s,onChange:M})]}),e[35]=s,e[36]=F,e[37]=D,e[38]=L,e[39]=B,e[40]=ne,e[41]=W,e[42]=M,e[43]=J):J=e[43];let T;e[44]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{children:"Duration (s)"}),e[44]=T):T=e[44];const U=`${r}-duration`,ce=`${u} duration`,de=!d,Z=n>0?Math.max(0,n-o):void 0;let he;e[45]!==o||e[46]!==x?(he=x===null?"":Number(Math.max(0,x-o).toFixed(6)),e[45]=o,e[46]=x,e[47]=he):he=e[47];let re;e[48]!==n||e[49]!==c||e[50]!==o?(re=q=>c(o,q.target.value===""?null:Number(Math.min(n>0?n:1/0,o+Math.max(0,Number(q.target.value)||0)).toFixed(6))),e[48]=n,e[49]=c,e[50]=o,e[51]=re):re=e[51];let ee;e[52]!==s||e[53]!==U||e[54]!==ce||e[55]!==de||e[56]!==Z||e[57]!==he||e[58]!==re?(ee=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[T,t.jsx("input",{id:U,"aria-label":ce,"aria-invalid":de,type:"number",min:"0",max:Z,step:"any",value:he,placeholder:"Clip end",disabled:s,onChange:re})]}),e[52]=s,e[53]=U,e[54]=ce,e[55]=de,e[56]=Z,e[57]=he,e[58]=re,e[59]=ee):ee=e[59];const ge=`Set ${u} start from playhead`;let le;e[60]!==l||e[61]!==a||e[62]!==c?(le=()=>c(a===null?l:Math.min(l,Math.max(0,a-.1)),a),e[60]=l,e[61]=a,e[62]=c,e[63]=le):le=e[63];let fe;e[64]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(Mt,{size:8,"aria-hidden":"true"}),e[64]=fe):fe=e[64];let oe;e[65]!==s||e[66]!==ge||e[67]!==le?(oe=t.jsxs("button",{type:"button","aria-label":ge,disabled:s,onClick:le,children:[fe,"Start"]}),e[65]=s,e[66]=ge,e[67]=le,e[68]=oe):oe=e[68];const ve=`Set ${u} end from playhead`;let z;e[69]!==l||e[70]!==c||e[71]!==o?(z=()=>c(o,Math.max(l,o+.1)),e[69]=l,e[70]=c,e[71]=o,e[72]=z):z=e[72];let G;e[73]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Mt,{size:8,"aria-hidden":"true"}),e[73]=G):G=e[73];let se;e[74]!==s||e[75]!==ve||e[76]!==z?(se=t.jsxs("button",{type:"button","aria-label":ve,disabled:s,onClick:z,children:[G,"End"]}),e[74]=s,e[75]=ve,e[76]=z,e[77]=se):se=e[77];const pe=`Use whole clip for ${u}`;let K;e[78]!==c?(K=()=>c(0,null),e[78]=c,e[79]=K):K=e[79];let V;e[80]!==s||e[81]!==pe||e[82]!==K?(V=t.jsx("button",{type:"button","aria-label":pe,disabled:s,onClick:K,children:"Whole"}),e[80]=s,e[81]=pe,e[82]=K,e[83]=V):V=e[83];let Y;e[84]!==oe||e[85]!==se||e[86]!==V?(Y=t.jsxs("div",{className:"confirm-watermark-timing-actions",children:[oe,se,V]}),e[84]=oe,e[85]=se,e[86]=V,e[87]=Y):Y=e[87];let X;e[88]!==b||e[89]!==E||e[90]!==J||e[91]!==ee||e[92]!==S||e[93]!==Y?(X=t.jsxs("div",{className:"confirm-watermark-timing-row",children:[S,b,E,J,ee,Y]}),e[88]=b,e[89]=E,e[90]=J,e[91]=ee,e[92]=S,e[93]=Y,e[94]=X):X=e[94];let Q;e[95]!==u||e[96]!==d?(Q=!d&&t.jsxs("p",{className:"confirm-field-error",children:[u," end time must be after its start time."]}),e[95]=u,e[96]=d,e[97]=Q):Q=e[97];let te;return e[98]!==g||e[99]!==X||e[100]!==Q?(te=t.jsxs("div",{className:"confirm-watermark-timing",role:"group","aria-label":g,children:[X,Q]}),e[98]=g,e[99]=X,e[100]=Q,e[101]=te):te=e[101],te}function Nn(i){const e=ue.c(228),{busy:s,state:l,onChange:n,onMediaMetadata:a}=i,[r,u]=Ne.useState(0),c=l.identities[l.platform];let p,o,f;e[0]!==c.handle||e[1]!==l.platform?(p=Xl(c.handle),o=zt[l.platform],f=Jl(p||"<handle>",l.platform),e[0]=c.handle,e[1]=l.platform,e[2]=p,e[3]=o,e[4]=f):(p=e[2],o=e[3],f=e[4]);const d=f,m=l.durationSeconds??0,h=l.includeHandle&&!p;let x;e[5]!==p||e[6]!==l.includeQr||e[7]!==l.url?(x=l.includeQr&&!l.url.trim()&&!p,e[5]=p,e[6]=l.includeQr,e[7]=l.url,e[8]=x):x=e[8];const g=x;let S;e[9]!==r||e[10]!==m||e[11]!==l.fadeSeconds||e[12]!==l.qrEndSeconds||e[13]!==l.qrOpacity||e[14]!==l.qrStartSeconds?(S=$t(r,l.qrStartSeconds,l.qrEndSeconds,m,l.qrOpacity,l.fadeSeconds),e[9]=r,e[10]=m,e[11]=l.fadeSeconds,e[12]=l.qrEndSeconds,e[13]=l.qrOpacity,e[14]=l.qrStartSeconds,e[15]=S):S=e[15];const j=S;let C;e[16]!==r||e[17]!==m||e[18]!==l.fadeSeconds||e[19]!==l.handleEndSeconds||e[20]!==l.handleOpacity||e[21]!==l.handleStartSeconds?(C=$t(r,l.handleStartSeconds,l.handleEndSeconds,m,l.handleOpacity,l.fadeSeconds),e[16]=r,e[17]=m,e[18]=l.fadeSeconds,e[19]=l.handleEndSeconds,e[20]=l.handleOpacity,e[21]=l.handleStartSeconds,e[22]=C):C=e[22];const y=C,k=l.position==="auto"?"bottom-right":l.position,w=l.width!==null&&l.width>0?l.width:16,b=l.height!==null&&l.height>0?l.height:9;let v;e[23]!==r||e[24]!==m?(v=m>0?ut(r/m*100,0,100):0,e[23]=r,e[24]=m,e[25]=v):v=e[25];const _=v;let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{children:"Preview"}),e[26]=A):A=e[26];let R;e[27]!==r?(R=Ut(r),e[27]=r,e[28]=R):R=e[28];let N;e[29]!==m?(N=m>0?Ut(m):"—",e[29]=m,e[30]=N):N=e[30];let E;e[31]!==R||e[32]!==N?(E=t.jsxs("div",{className:"confirm-section-heading",children:[A,t.jsxs("strong",{children:[R," / ",N]})]}),e[31]=R,e[32]=N,e[33]=E):E=e[33];let I;e[34]!==s||e[35]!==r||e[36]!==m||e[37]!==n||e[38]!==_||e[39]!==l.includeQr||e[40]!==l.qrEndSeconds||e[41]!==l.qrStartSeconds?(I=l.includeQr&&t.jsx(Vt,{busy:s,currentTime:r,duration:m,endSeconds:l.qrEndSeconds,idPrefix:"watermark-qr-timing",label:"QR",playhead:_,startSeconds:l.qrStartSeconds,onChange:(P,ae)=>n({qrStartSeconds:P,qrEndSeconds:ae})}),e[34]=s,e[35]=r,e[36]=m,e[37]=n,e[38]=_,e[39]=l.includeQr,e[40]=l.qrEndSeconds,e[41]=l.qrStartSeconds,e[42]=I):I=e[42];let F;e[43]!==s||e[44]!==r||e[45]!==m||e[46]!==n||e[47]!==_||e[48]!==l.handleEndSeconds||e[49]!==l.handleStartSeconds||e[50]!==l.includeHandle?(F=l.includeHandle&&t.jsx(Vt,{busy:s,currentTime:r,duration:m,endSeconds:l.handleEndSeconds,idPrefix:"watermark-handle-timing",label:"Handle",playhead:_,startSeconds:l.handleStartSeconds,onChange:(P,ae)=>n({handleStartSeconds:P,handleEndSeconds:ae})}),e[43]=s,e[44]=r,e[45]=m,e[46]=n,e[47]=_,e[48]=l.handleEndSeconds,e[49]=l.handleStartSeconds,e[50]=l.includeHandle,e[51]=F):F=e[51];let D;e[52]!==I||e[53]!==F?(D=t.jsxs("div",{className:"confirm-watermark-timings",children:[I,F]}),e[52]=I,e[53]=F,e[54]=D):D=e[54];const L=`${w} / ${b}`,B=w/b;let ne;e[55]!==L||e[56]!==B?(ne={aspectRatio:L,"--watermark-preview-ratio":B},e[55]=L,e[56]=B,e[57]=ne):ne=e[57];const W=ne;let M;e[58]!==a||e[59]!==l.mediaUrl||e[60]!==l.thumbnailUrl?(M=l.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:P=>{const ae=P.currentTarget;Number.isFinite(ae.duration)&&ae.duration>0&&ae.videoWidth>0&&ae.videoHeight>0&&a({durationSeconds:ae.duration,width:ae.videoWidth,height:ae.videoHeight})},onTimeUpdate:P=>u(P.currentTarget.currentTime),onSeeked:P=>u(P.currentTarget.currentTime)}):l.thumbnailUrl?t.jsx("img",{src:l.thumbnailUrl,alt:""}):t.jsx("span",{className:"watermark-preview-empty",children:"Video preview unavailable"}),e[58]=a,e[59]=l.mediaUrl,e[60]=l.thumbnailUrl,e[61]=M):M=e[61];let J;e[62]!==b||e[63]!==k||e[64]!==w||e[65]!==j||e[66]!==l.includeQr?(J=l.includeQr&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-qr",style:{...jn(k,w,b),opacity:j},"aria-hidden":"true",children:t.jsx(xn,{})}),e[62]=b,e[63]=k,e[64]=w,e[65]=j,e[66]=l.includeQr,e[67]=J):J=e[67];let T;e[68]!==p||e[69]!==y||e[70]!==b||e[71]!==k||e[72]!==w||e[73]!==l.handlePadding||e[74]!==l.handlePaddingY||e[75]!==l.handlePlacement||e[76]!==l.handleRounding||e[77]!==l.handleVerticalPercent||e[78]!==l.includeHandle||e[79]!==l.includeHandleBorder||e[80]!==l.includePlatformIcon||e[81]!==l.includeQr||e[82]!==l.platform?(T=l.includeHandle&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-handle",style:{...yn(w,b,l.handleVerticalPercent,l.handlePaddingY,l.includeQr?l.handlePlacement:"center",k),opacity:y},"aria-hidden":"true",children:t.jsxs("span",{className:`watermark-preview-handle-pill${l.includeHandleBorder?"":" without-border"}`,style:wn(l.handlePadding,l.handlePaddingY,l.handleRounding),children:[l.includePlatformIcon&&t.jsx(gn,{platform:l.platform}),t.jsx("span",{children:p||"handle"})]})}),e[68]=p,e[69]=y,e[70]=b,e[71]=k,e[72]=w,e[73]=l.handlePadding,e[74]=l.handlePaddingY,e[75]=l.handlePlacement,e[76]=l.handleRounding,e[77]=l.handleVerticalPercent,e[78]=l.includeHandle,e[79]=l.includeHandleBorder,e[80]=l.includePlatformIcon,e[81]=l.includeQr,e[82]=l.platform,e[83]=T):T=e[83];let U;e[84]!==l.includeQr||e[85]!==l.position?(U=l.includeQr&&l.position==="auto"&&t.jsx("span",{className:"watermark-auto-preview",children:"AUTO · QR previewing bottom right"}),e[84]=l.includeQr,e[85]=l.position,e[86]=U):U=e[86];let ce;e[87]!==W||e[88]!==M||e[89]!==J||e[90]!==T||e[91]!==U?(ce=t.jsxs("div",{className:"watermark-video-stage",style:W,children:[M,J,T,U]}),e[87]=W,e[88]=M,e[89]=J,e[90]=T,e[91]=U,e[92]=ce):ce=e[92];let de;e[93]!==D||e[94]!==ce||e[95]!==E?(de=t.jsxs("section",{className:"confirm-section confirm-watermark-preview","aria-label":"Preview",children:[E,D,ce]}),e[93]=D,e[94]=ce,e[95]=E,e[96]=de):de=e[96];let Z;e[97]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("span",{className:"confirm-section-label",children:"Identity"}),e[97]=Z):Z=e[97];let he;e[98]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx("span",{children:"Platform"}),e[98]=he):he=e[98];const re=l.platform;let ee;e[99]!==n?(ee=P=>{const ae=P.target.value;os(ae)&&n({platform:ae})},e[99]=n,e[100]=ee):ee=e[100];let ge;e[101]===Symbol.for("react.memo_cache_sentinel")?(ge=cs.map(Sn),e[101]=ge):ge=e[101];let le;e[102]!==s||e[103]!==l.platform||e[104]!==ee?(le=t.jsxs("label",{className:"confirm-field",children:[he,t.jsx("select",{value:re,disabled:s,onChange:ee,children:ge})]}),e[102]=s,e[103]=l.platform,e[104]=ee,e[105]=le):le=e[105];const fe=l.includeHandle&&!l.includeQr;let oe;e[106]!==n?(oe=P=>n({includeHandle:P}),e[106]=n,e[107]=oe):oe=e[107];let ve;e[108]!==s||e[109]!==l.includeHandle||e[110]!==fe||e[111]!==oe?(ve=t.jsx(ft,{busy:s,checked:l.includeHandle,description:"Centered account badge",disabled:fe,label:"Include handle",onChange:oe}),e[108]=s,e[109]=l.includeHandle,e[110]=fe,e[111]=oe,e[112]=ve):ve=e[112];let z;e[113]!==s||e[114]!==p||e[115]!==h||e[116]!==c.handle||e[117]!==c.recent||e[118]!==n||e[119]!==o||e[120]!==l.includeHandle||e[121]!==l.loadingConfig?(z=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"confirm-field",children:[t.jsxs("span",{children:[o," handle"]}),t.jsxs("div",{className:`confirm-handle-field${h?" invalid":""}`,children:[t.jsx("span",{"aria-hidden":"true",children:"@"}),t.jsx("input",{type:"text",value:c.handle,placeholder:l.loadingConfig?"Loading…":"handle","aria-invalid":h,disabled:s,onChange:P=>n({handle:P.target.value})})]}),h&&t.jsx("span",{className:"confirm-field-error",children:"Required while Include handle is on"})]}),c.recent.length>0&&t.jsx("div",{className:"confirm-chips",role:"group","aria-label":"Recent handles",children:c.recent.map(P=>t.jsxs("button",{type:"button",className:P===p?"active":"","aria-pressed":P===p,disabled:s,onClick:()=>n({handle:P}),children:["@",P]},P))})]}),e[113]=s,e[114]=p,e[115]=h,e[116]=c.handle,e[117]=c.recent,e[118]=n,e[119]=o,e[120]=l.includeHandle,e[121]=l.loadingConfig,e[122]=z):z=e[122];const G=l.includeQr&&!l.includeHandle;let se;e[123]!==n?(se=P=>n({includeQr:P,...P?{}:{handlePlacement:"center"}}),e[123]=n,e[124]=se):se=e[124];let pe;e[125]!==s||e[126]!==l.includeQr||e[127]!==G||e[128]!==se?(pe=t.jsx(ft,{busy:s,checked:l.includeQr,description:"Separately placed scannable link",disabled:G,label:"Include QR code",onChange:se}),e[125]=s,e[126]=l.includeQr,e[127]=G,e[128]=se,e[129]=pe):pe=e[129];let K;e[130]!==s||e[131]!==g||e[132]!==n||e[133]!==l.includeQr||e[134]!==l.url||e[135]!==d?(K=l.includeQr&&t.jsxs("label",{className:"confirm-field",children:[t.jsx("span",{children:"QR link"}),t.jsx("input",{type:"text",value:l.url,placeholder:d,"aria-invalid":g,disabled:s,onChange:P=>n({url:P.target.value})}),g&&t.jsx("span",{className:"confirm-field-error",children:"Enter a link, or a handle it can point to"})]}),e[130]=s,e[131]=g,e[132]=n,e[133]=l.includeQr,e[134]=l.url,e[135]=d,e[136]=K):K=e[136];let V;e[137]!==s||e[138]!==n||e[139]!==l.includeHandle||e[140]!==l.saveDefault?(V=l.includeHandle&&t.jsxs("label",{className:"confirm-check",children:[t.jsx("input",{type:"checkbox",checked:l.saveDefault,disabled:s,onChange:P=>n({saveDefault:P.target.checked})}),"Save as default handle"]}),e[137]=s,e[138]=n,e[139]=l.includeHandle,e[140]=l.saveDefault,e[141]=V):V=e[141];let Y;e[142]!==le||e[143]!==ve||e[144]!==z||e[145]!==pe||e[146]!==K||e[147]!==V?(Y=t.jsxs("section",{className:"confirm-section","aria-label":"Identity",children:[Z,le,ve,z,pe,K,V]}),e[142]=le,e[143]=ve,e[144]=z,e[145]=pe,e[146]=K,e[147]=V,e[148]=Y):Y=e[148];let X;e[149]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("span",{className:"confirm-section-label",children:"Appearance"}),e[149]=X):X=e[149];let Q;e[150]!==s||e[151]!==n||e[152]!==o||e[153]!==l.handlePadding||e[154]!==l.handlePaddingY||e[155]!==l.handleRounding||e[156]!==l.includeHandle||e[157]!==l.includeHandleBorder||e[158]!==l.includePlatformIcon?(Q=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsx(ft,{busy:s,checked:l.includePlatformIcon,description:`${o} mark before the handle`,label:`Show ${o} icon`,onChange:P=>n({includePlatformIcon:P})}),t.jsx(ft,{busy:s,checked:l.includeHandleBorder,description:"Outline around the pill",label:"Handle border",onChange:P=>n({includeHandleBorder:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-x",label:"Handle padding X",min:Rt,max:At,output:`${l.handlePadding}px`,value:l.handlePadding,onChange:P=>n({handlePadding:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-y",label:"Handle padding Y",min:Rt,max:At,output:`${l.handlePaddingY}px`,value:l.handlePaddingY,onChange:P=>n({handlePaddingY:P})}),t.jsx(st,{busy:s,id:"watermark-handle-rounding",label:"Corner rounding",min:es,max:Zl,output:`${l.handleRounding}%`,value:l.handleRounding,onChange:P=>n({handleRounding:P})})]}),e[150]=s,e[151]=n,e[152]=o,e[153]=l.handlePadding,e[154]=l.handlePaddingY,e[155]=l.handleRounding,e[156]=l.includeHandle,e[157]=l.includeHandleBorder,e[158]=l.includePlatformIcon,e[159]=Q):Q=e[159];let te;e[160]!==s||e[161]!==n||e[162]!==l.includeQr||e[163]!==l.qrOpacity?(te=l.includeQr&&t.jsx(st,{busy:s,id:"watermark-qr-opacity",label:"QR opacity",min:It*100,max:Tt*100,output:`${ht(l.qrOpacity)}%`,value:ht(l.qrOpacity),onChange:P=>n({qrOpacity:P/100})}),e[160]=s,e[161]=n,e[162]=l.includeQr,e[163]=l.qrOpacity,e[164]=te):te=e[164];let q;e[165]!==s||e[166]!==n||e[167]!==l.handleOpacity||e[168]!==l.includeHandle?(q=l.includeHandle&&t.jsx(st,{busy:s,id:"watermark-handle-opacity",label:"Handle opacity",min:It*100,max:Tt*100,output:`${ht(l.handleOpacity)}%`,value:ht(l.handleOpacity),onChange:P=>n({handleOpacity:P/100})}),e[165]=s,e[166]=n,e[167]=l.handleOpacity,e[168]=l.includeHandle,e[169]=q):q=e[169];let ie;e[170]!==l.fadeSeconds?(ie=bn(l.fadeSeconds),e[170]=l.fadeSeconds,e[171]=ie):ie=e[171];let je;e[172]!==l.fadeSeconds?(je=Math.round(l.fadeSeconds*10),e[172]=l.fadeSeconds,e[173]=je):je=e[173];let be;e[174]!==n?(be=P=>n({fadeSeconds:P/10}),e[174]=n,e[175]=be):be=e[175];let Se;e[176]!==s||e[177]!==ie||e[178]!==je||e[179]!==be?(Se=t.jsx(st,{busy:s,id:"watermark-fade",label:"Fade in/out",min:ms*10,max:ds*10,output:ie,value:je,onChange:be}),e[176]=s,e[177]=ie,e[178]=je,e[179]=be,e[180]=Se):Se=e[180];let Ce;e[181]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("small",{className:"confirm-help",children:"Fades only where a watermark starts or ends inside the clip."}),e[181]=Ce):Ce=e[181];let me;e[182]!==Q||e[183]!==te||e[184]!==q||e[185]!==Se?(me=t.jsxs("section",{className:"confirm-section","aria-label":"Appearance",children:[X,Q,te,q,Se,Ce]}),e[182]=Q,e[183]=te,e[184]=q,e[185]=Se,e[186]=me):me=e[186];let ye;e[187]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx("span",{className:"confirm-section-label",children:"Position"}),e[187]=ye):ye=e[187];let we;e[188]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx("span",{children:"QR position"}),e[188]=we):we=e[188];const xe=`confirm-chip${l.position==="auto"?" active":""}`,Ie=l.position==="auto",Ue=s||!l.includeQr;let Le;e[189]!==n?(Le=()=>n({position:"auto"}),e[189]=n,e[190]=Le):Le=e[190];let _e;e[191]!==xe||e[192]!==Ie||e[193]!==Ue||e[194]!==Le?(_e=t.jsxs("div",{className:"confirm-watermark-qr-position-heading",children:[we,t.jsx("button",{type:"button",className:xe,"aria-pressed":Ie,disabled:Ue,onClick:Le,children:"Auto"})]}),e[191]=xe,e[192]=Ie,e[193]=Ue,e[194]=Le,e[195]=_e):_e=e[195];let Pe;e[196]!==s||e[197]!==n||e[198]!==l.includeQr||e[199]!==l.position?(Pe=ts.map(P=>t.jsx("button",{type:"button",className:l.position===P?"active":"","aria-label":Ot[P],"aria-pressed":l.position===P,title:Ot[P],disabled:s||!l.includeQr,onClick:()=>n({position:P}),children:t.jsx("span",{})},P)),e[196]=s,e[197]=n,e[198]=l.includeQr,e[199]=l.position,e[200]=Pe):Pe=e[200];let Me;e[201]!==Pe?(Me=t.jsx("div",{className:"confirm-position-grid",role:"group","aria-label":"QR position",children:Pe}),e[201]=Pe,e[202]=Me):Me=e[202];let Fe;e[203]!==_e||e[204]!==Me?(Fe=t.jsxs("div",{className:"confirm-watermark-qr-position",children:[_e,Me]}),e[203]=_e,e[204]=Me,e[205]=Fe):Fe=e[205];let Ae;e[206]!==s||e[207]!==n||e[208]!==l.handlePlacement||e[209]!==l.handleVerticalPercent||e[210]!==l.includeHandle||e[211]!==l.includeQr?(Ae=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"confirm-watermark-handle-placement",children:[t.jsx("span",{children:"Handle placement"}),t.jsx("div",{className:"confirm-chips",role:"group","aria-label":"Handle placement",children:ls.map(P=>{const He=s||P!=="center"&&!l.includeQr;return t.jsx("button",{type:"button",className:l.handlePlacement===P?"active":"","aria-pressed":l.handlePlacement===P,disabled:He,onClick:()=>n({handlePlacement:P}),children:pn[P]},P)})})]}),l.handlePlacement==="center"&&t.jsx(st,{busy:s,id:"watermark-handle-vertical",label:"Handle vertical position",min:ns,max:ss,output:`${l.handleVerticalPercent}% from top`,value:l.handleVerticalPercent,onChange:P=>n({handleVerticalPercent:P})})]}),e[206]=s,e[207]=n,e[208]=l.handlePlacement,e[209]=l.handleVerticalPercent,e[210]=l.includeHandle,e[211]=l.includeQr,e[212]=Ae):Ae=e[212];const Ge=l.includeQr&&l.includeHandle?l.handlePlacement==="center"?"Auto places the QR away from faces and text. The handle stays horizontally centered.":"Auto places the QR away from faces and text. The handle sits with the QR.":l.includeQr?"Auto places the QR away from faces and text.":"The handle stays horizontally centered.";let Re;e[213]!==Ge?(Re=t.jsx("small",{className:"confirm-help",children:Ge}),e[213]=Ge,e[214]=Re):Re=e[214];let De;e[215]!==Ae||e[216]!==Re?(De=t.jsxs("div",{className:"confirm-watermark-handle-position",children:[Ae,Re]}),e[215]=Ae,e[216]=Re,e[217]=De):De=e[217];let Te;e[218]!==Fe||e[219]!==De?(Te=t.jsxs("section",{className:"confirm-section confirm-watermark-position","aria-label":"Position",children:[ye,Fe,De]}),e[218]=Fe,e[219]=De,e[220]=Te):Te=e[220];let Ee;e[221]!==Y||e[222]!==me||e[223]!==Te?(Ee=t.jsxs("div",{className:"confirm-watermark-controls",children:[Y,me,Te]}),e[221]=Y,e[222]=me,e[223]=Te,e[224]=Ee):Ee=e[224];let Oe;return e[225]!==de||e[226]!==Ee?(Oe=t.jsxs("div",{className:"confirm-watermark",children:[de,Ee]}),e[225]=de,e[226]=Ee,e[227]=Oe):Oe=e[227],Oe}function Sn(i){return t.jsx("option",{value:i,children:zt[i]},i)}const Fn=Object.freeze(Object.defineProperty({__proto__:null,WatermarkBody:Nn},Symbol.toStringTag,{value:"Module"}));export{En as C,An as G,Mn as N,$n as P,In as R,Rn as S,Fn as W,Ln as a,Tn as b};
@@ -1 +1 @@
1
- import{a as i,j as t,b as ce,c as O}from"./vendor-react-Dj7D1fD4.js";import{B as ue,k as de}from"./ui-xo_Y1yQg.js";import{bu as X,dH as me,dI as fe,dJ as pe}from"./videobook-Qlp9HQFu.js";import{ap as he,a2 as be,X as xe}from"./vendor-icons-CGqhCIXV.js";function J(n){const e=O.c(7),{address:u,asset:a}=n;let o;e[0]!==u?(o=t.jsxs("strong",{children:["@",u]}),e[0]=u,e[1]=o):o=e[1];let l;e[2]!==a?(l=me(a).map(ye),e[2]=a,e[3]=l):l=e[3];let c;return e[4]!==o||e[5]!==l?(c=t.jsxs("p",{className:"media-fullscreen-details",children:[o,l]}),e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function ye(n){return t.jsx("span",{children:n},n)}function ge(n){return n instanceof HTMLElement&&(n.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName))}function je(n){const e=O.c(11),{address:u,playbackUrl:a,posterUrl:o,videoRef:l}=n;if(!a){let d;e[0]!==u||e[1]!==o?(d=o?t.jsx("img",{src:o,alt:`@${u} poster`}):null,e[0]=u,e[1]=o,e[2]=d):d=e[2];let h,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("strong",{children:"Playback unavailable"}),b=t.jsx("p",{children:"This video has a preview image but no playable media yet."}),e[3]=h,e[4]=b):(h=e[3],b=e[4]);let x;return e[5]!==d?(x=t.jsxs("div",{className:"notebook-media-unavailable",role:"status",children:[d,h,b]}),e[5]=d,e[6]=x):x=e[6],x}const c=o??void 0;let p;return e[7]!==a||e[8]!==c||e[9]!==l?(p=t.jsx("video",{ref:l,src:a,poster:c,controls:!0,tabIndex:0,controlsList:"nofullscreen nodownload noremoteplayback",disablePictureInPicture:!0,playsInline:!0,autoPlay:!0,preload:"auto"},a),e[7]=a,e[8]=c,e[9]=l,e[10]=p):p=e[10],p}function Ne({asset:n,address:e,initialMode:u="view",subjectMap:a=null,subjectMapLoading:o=!1,analysisUnavailableReason:l=null,composerPortalRef:c,actionsOpen:p=!1,returnFocus:d=null,initialRegions:h,initialInstruction:b="",onInstructionChange:x,replacementCandidates:G=[],imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,onAnalyzeSubjects:ee,onCaptureFrame:w,onEditingChange:te,onEditSubjects:A,onSubmitEditInstruction:M,onClose:T}){const g=i.useRef(null),$=i.useRef(null),j=i.useRef(null),U=i.useRef(null),N=i.useRef(null),y=i.useRef(!1),m=n.type==="video"||n.type==="final",R=n.mediaUrl,D=n.thumbnailUrl,v=R??D,L=m||!!v,C=!m&&!!(A||M),[se,F]=i.useState(m?"view":u),[ne,re]=i.useState(b),[I,B]=i.useState(!1),[P,S]=i.useState(null),k=se==="edit"&&!m;if(i.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),i.useEffect(()=>{if(!L)return;const s=g.current;if(!s)return;U.current=d??(document.activeElement instanceof HTMLElement?document.activeElement:null);const r=document.querySelector(".app-shell"),E=r?.inert??!1,f=r?.getAttribute("aria-hidden")??null,ie=document.body.style.overflow;return r&&(r.inert=!0,r.setAttribute("aria-hidden","true")),document.body.style.overflow="hidden",s.showModal(),j.current?.focus(),()=>{s.close(),r&&(r.inert=E,f===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",f)),document.body.style.overflow=ie;const V=N.current;if(V){N.current=null,V();return}const W=U.current;X(W),requestAnimationFrame(()=>X(W))}},[L,d]),!m&&!v)return null;const K=s=>{if(!g.current)return;const r=pe(g.current);(s==="first"?r[0]:r.at(-1))?.focus({preventScroll:!0})},z=s=>{s.detail>0&&(N.current=fe()),T()},H=()=>{F("view"),requestAnimationFrame(()=>j.current?.focus())},oe=async()=>{const s=$.current;if(!s||!w||I)return;const r=Number.isFinite(s.duration)?s.duration:null,E=Math.max(0,r===null?s.currentTime:Math.min(s.currentTime,Math.max(0,r-.05)));B(!0),S(null);try{const f=await w(E);y.current&&S({tone:"success",text:`Frame saved to ${f}`})}catch(f){y.current&&S({tone:"error",text:f instanceof Error?f.message:String(f)})}finally{y.current&&B(!1)}},ae=s=>{k||s.defaultPrevented||ge(s.target)||s.metaKey||s.ctrlKey||s.altKey||!C||s.key.toLowerCase()!=="e"||(s.preventDefault(),F("edit"))},le=t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"media-fullscreen-chrome",children:[t.jsx(J,{address:e,asset:n}),t.jsxs("div",{className:"notebook-media-fullscreen-actions",children:[C&&t.jsxs("button",{type:"button",className:"media-fullscreen-edit","aria-keyshortcuts":"E",onClick:()=>F("edit"),children:[t.jsx(he,{size:16}),"Edit image"]}),m&&R&&w&&t.jsxs("button",{type:"button",className:"notebook-media-capture-button",disabled:I,onClick:()=>{oe()},children:[I?t.jsx(ue,{size:16}):t.jsx(be,{size:16}),"Extract frame"]}),t.jsx("button",{ref:j,type:"button",className:"notebook-media-fullscreen-close",onClick:z,"aria-label":"Close fullscreen preview","aria-keyshortcuts":"Escape","data-composer-focus":"return",children:t.jsx(xe,{size:20})}),P&&t.jsx("p",{className:`notebook-media-capture-status ${P.tone}`,role:"status",children:P.text})]})]}),t.jsx("div",{className:"media-fullscreen-stage",children:m?t.jsx(je,{address:e,playbackUrl:R,posterUrl:D,videoRef:$}):t.jsx("img",{src:v??"",alt:`@${e}`})}),C&&t.jsxs("p",{className:"media-fullscreen-keys","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("kbd",{children:"E"})," edit"]}),t.jsxs("span",{children:[t.jsx("kbd",{children:"Esc"})," close"]})]})]}),q=t.jsxs("dialog",{ref:g,className:`notebook-media-fullscreen ${k?"image-editor":"media-viewer"}${m?" playback-only":""}`,role:"dialog","aria-modal":"true","aria-label":`Fullscreen preview for @${e}`,onKeyDown:ae,onCancel:s=>{s.preventDefault(),k?H():T()},children:[p&&t.jsx("div",{ref:c,className:"notebook-media-composer-host actions-only","aria-label":"Media actions input"}),t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("last")}),k?t.jsx(de,{address:e,mediaUrl:v??"",width:a?.width??n.width??1e3,height:a?.height??n.height??1e3,details:t.jsx(J,{address:e,asset:n}),subjectMap:a,subjectMapLoading:o,analysisUnavailableReason:l,initialRegions:h,instruction:ne,onInstructionChange:s=>{re(s),x?.(s)},replacementCandidates:G,imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,closeRef:j,onAnalyzeSubjects:ee,onEditingChange:te,onEditSubjects:A,onSubmitInstruction:M,onBack:H,onClose:z}):le,t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("first")})]});return typeof document>"u"?q:ce.createPortal(q,document.body)}export{Ne as N};
1
+ import{a as i,j as t,b as ce,c as O}from"./vendor-react-Dj7D1fD4.js";import{B as ue,k as de}from"./ui-OHFUngrc.js";import{bw as X,dJ as me,dK as fe,dL as pe}from"./videobook-DZ58pKW5.js";import{ap as he,a2 as be,X as xe}from"./vendor-icons-CGqhCIXV.js";function J(n){const e=O.c(7),{address:u,asset:a}=n;let o;e[0]!==u?(o=t.jsxs("strong",{children:["@",u]}),e[0]=u,e[1]=o):o=e[1];let l;e[2]!==a?(l=me(a).map(ye),e[2]=a,e[3]=l):l=e[3];let c;return e[4]!==o||e[5]!==l?(c=t.jsxs("p",{className:"media-fullscreen-details",children:[o,l]}),e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function ye(n){return t.jsx("span",{children:n},n)}function ge(n){return n instanceof HTMLElement&&(n.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName))}function je(n){const e=O.c(11),{address:u,playbackUrl:a,posterUrl:o,videoRef:l}=n;if(!a){let d;e[0]!==u||e[1]!==o?(d=o?t.jsx("img",{src:o,alt:`@${u} poster`}):null,e[0]=u,e[1]=o,e[2]=d):d=e[2];let h,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("strong",{children:"Playback unavailable"}),b=t.jsx("p",{children:"This video has a preview image but no playable media yet."}),e[3]=h,e[4]=b):(h=e[3],b=e[4]);let x;return e[5]!==d?(x=t.jsxs("div",{className:"notebook-media-unavailable",role:"status",children:[d,h,b]}),e[5]=d,e[6]=x):x=e[6],x}const c=o??void 0;let p;return e[7]!==a||e[8]!==c||e[9]!==l?(p=t.jsx("video",{ref:l,src:a,poster:c,controls:!0,tabIndex:0,controlsList:"nofullscreen nodownload noremoteplayback",disablePictureInPicture:!0,playsInline:!0,autoPlay:!0,preload:"auto"},a),e[7]=a,e[8]=c,e[9]=l,e[10]=p):p=e[10],p}function Ne({asset:n,address:e,initialMode:u="view",subjectMap:a=null,subjectMapLoading:o=!1,analysisUnavailableReason:l=null,composerPortalRef:c,actionsOpen:p=!1,returnFocus:d=null,initialRegions:h,initialInstruction:b="",onInstructionChange:x,replacementCandidates:G=[],imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,onAnalyzeSubjects:ee,onCaptureFrame:w,onEditingChange:te,onEditSubjects:A,onSubmitEditInstruction:M,onClose:T}){const g=i.useRef(null),$=i.useRef(null),j=i.useRef(null),U=i.useRef(null),N=i.useRef(null),y=i.useRef(!1),m=n.type==="video"||n.type==="final",R=n.mediaUrl,D=n.thumbnailUrl,v=R??D,L=m||!!v,C=!m&&!!(A||M),[se,F]=i.useState(m?"view":u),[ne,re]=i.useState(b),[P,K]=i.useState(!1),[S,I]=i.useState(null),k=se==="edit"&&!m;if(i.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),i.useEffect(()=>{if(!L)return;const s=g.current;if(!s)return;U.current=d??(document.activeElement instanceof HTMLElement?document.activeElement:null);const r=document.querySelector(".app-shell"),E=r?.inert??!1,f=r?.getAttribute("aria-hidden")??null,ie=document.body.style.overflow;return r&&(r.inert=!0,r.setAttribute("aria-hidden","true")),document.body.style.overflow="hidden",s.showModal(),j.current?.focus(),()=>{s.close(),r&&(r.inert=E,f===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",f)),document.body.style.overflow=ie;const V=N.current;if(V){N.current=null,V();return}const W=U.current;X(W),requestAnimationFrame(()=>X(W))}},[L,d]),!m&&!v)return null;const B=s=>{if(!g.current)return;const r=pe(g.current);(s==="first"?r[0]:r.at(-1))?.focus({preventScroll:!0})},z=s=>{s.detail>0&&(N.current=fe()),T()},q=()=>{F("view"),requestAnimationFrame(()=>j.current?.focus())},oe=async()=>{const s=$.current;if(!s||!w||P)return;const r=Number.isFinite(s.duration)?s.duration:null,E=Math.max(0,r===null?s.currentTime:Math.min(s.currentTime,Math.max(0,r-.05)));K(!0),I(null);try{const f=await w(E);y.current&&I({tone:"success",text:`Frame saved to ${f}`})}catch(f){y.current&&I({tone:"error",text:f instanceof Error?f.message:String(f)})}finally{y.current&&K(!1)}},ae=s=>{k||s.defaultPrevented||ge(s.target)||s.metaKey||s.ctrlKey||s.altKey||!C||s.key.toLowerCase()!=="e"||(s.preventDefault(),F("edit"))},le=t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"media-fullscreen-chrome",children:[t.jsx(J,{address:e,asset:n}),t.jsxs("div",{className:"notebook-media-fullscreen-actions",children:[C&&t.jsxs("button",{type:"button",className:"media-fullscreen-edit","aria-keyshortcuts":"E",onClick:()=>F("edit"),children:[t.jsx(he,{size:16}),"Edit image"]}),m&&R&&w&&t.jsxs("button",{type:"button",className:"notebook-media-capture-button",disabled:P,onClick:()=>{oe()},children:[P?t.jsx(ue,{size:16}):t.jsx(be,{size:16}),"Extract frame"]}),t.jsx("button",{ref:j,type:"button",className:"notebook-media-fullscreen-close",onClick:z,"aria-label":"Close fullscreen preview","aria-keyshortcuts":"Escape","data-composer-focus":"return",children:t.jsx(xe,{size:20})}),S&&t.jsx("p",{className:`notebook-media-capture-status ${S.tone}`,role:"status",children:S.text})]})]}),t.jsx("div",{className:"media-fullscreen-stage",children:m?t.jsx(je,{address:e,playbackUrl:R,posterUrl:D,videoRef:$}):t.jsx("img",{src:v??"",alt:`@${e}`})}),C&&t.jsxs("p",{className:"media-fullscreen-keys","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("kbd",{children:"E"})," edit"]}),t.jsxs("span",{children:[t.jsx("kbd",{children:"Esc"})," close"]})]})]}),H=t.jsxs("dialog",{ref:g,className:`notebook-media-fullscreen ${k?"image-editor":"media-viewer"}${m?" playback-only":""}`,role:"dialog","aria-modal":"true","aria-label":`Fullscreen preview for @${e}`,onKeyDown:ae,onCancel:s=>{s.preventDefault(),k?q():T()},children:[p&&t.jsx("div",{ref:c,className:"notebook-media-composer-host actions-only","aria-label":"Media actions input"}),t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>B("last")}),k?t.jsx(de,{address:e,mediaUrl:v??"",width:a?.width??n.width??1e3,height:a?.height??n.height??1e3,details:t.jsx(J,{address:e,asset:n}),subjectMap:a,subjectMapLoading:o,analysisUnavailableReason:l,initialRegions:h,instruction:ne,onInstructionChange:s=>{re(s),x?.(s)},replacementCandidates:G,imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,closeRef:j,onAnalyzeSubjects:ee,onEditingChange:te,onEditSubjects:A,onSubmitInstruction:M,onBack:q,onClose:z}):le,t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>B("first")})]});return typeof document>"u"?H:ce.createPortal(H,document.body)}export{Ne as N};