videobook 0.2.0 → 0.2.1
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.
- package/CHANGELOG.md +9 -0
- package/package.json +2 -2
- package/ui/assets/{alive-captions-DPEr1nKM.js → alive-captions-e-n3xmCd.js} +1 -1
- package/ui/assets/{confirm-bodies-D8ouHXKy.js → confirm-bodies-DS6jh0Kb.js} +1 -1
- package/ui/assets/{fullscreen-B7nw4YbE.js → fullscreen-VY7f4mJ-.js} +1 -1
- package/ui/assets/{goal-ui-DK-xTCK0.js → goal-ui-B__NgZYz.js} +1 -1
- package/ui/assets/{index-kS1905s5.js → index-BPco0HoT.js} +2 -2
- package/ui/assets/{inspector-MlzQbTVo.js → inspector-BBuZIaqg.js} +1 -1
- package/ui/assets/{jobs-ui-CoinOWx0.js → jobs-ui-vmEH4zBT.js} +1 -1
- package/ui/assets/{music-video-Cbe80kmQ.js → music-video-CklLKD1R.js} +1 -1
- package/ui/assets/{ui-xo_Y1yQg.js → ui-CtYXY_po.js} +1 -1
- package/ui/assets/{vendor-DfTCWgKm.js → vendor-OClqq_Da.js} +2 -2
- package/ui/assets/{vendor-flow-BXbeWxW7.js → vendor-flow-DY81i6dC.js} +1 -1
- package/ui/assets/{vendor-mcp-BTlEJcHV.js → vendor-mcp-BsGNAD4I.js} +1 -1
- package/ui/assets/{videobook-Qlp9HQFu.js → videobook-lhLK6e6Q.js} +1 -1
- package/ui/index.html +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ce,a as ye,j as t}from"./vendor-react-Dj7D1fD4.js";import{b_ as Jt,b$ as Zt,c0 as el,c1 as tl,i as ll,c2 as sl,c3 as nl,c4 as il,c5 as Ot,c6 as Ht,c7 as Ut,c8 as al,c9 as rl,ad as ol,ca as cl,cb as dl,cc as ml,cd as ul,ce as yt,cf as hl,cg as wt,ch as fl,b2 as pl,E as xl,ci as gl,cj as bl,ck as Vt,ae as vl,cl as jl,Y as yl,bG as wl,b3 as Nl,cm as Sl,cn as Cl,co as Pl,cp as Ze,cq as Nt,cr as St,cs as kl,ct as _l,cu as Ct,cv as El,cw as $l,cx as Al,cy as Rl,cz as Tl,cA as Il,cB as Ll,bc as Fl,cC as Ml,x as Dl,cD as Ol,cE as Hl,cF as Ul,cG as Vl,cH as Ql,cI as ql,cJ as Bl,cK as Qt,cL as Wl,cM as Pt,cN as kt,cO as _t,cP as zl,cQ as Gl,cR as Et,cS as $t,cT as Kl,cU as Yl,cV as Xl,cW as Jl,cX as Zl,cY as gt,cZ as es,c_ as qt,c$ as ts,d0 as ls,d1 as ss,d2 as ns,d3 as is}from"./videobook-Qlp9HQFu.js";import{P as as,I as rs,G as At,V as os,a as cs,D as ds,R as ms,M as us}from"./ui-xo_Y1yQg.js";import{F as Bt,ac as jt,c as bt,x as Wt,g as hs,h as fs,X as zt,m as ps,i as xs,k as gs,w as bs,V as vs,ai as js,ad as ys,_ as Rt}from"./vendor-icons-CGqhCIXV.js";function wn(i){const e=ce.c(40),{review:s,onChange:l,disabled:n}=i,a=ye.useRef(null),r=ye.useRef(null),u=ye.useRef(!1),[c,p]=ye.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?Jt(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],ye.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 $;e[34]!==v||e[35]!==_?($=t.jsxs("div",{className:"cold-open-controls",children:[v,_]}),e[34]=v,e[35]=_,e[36]=$):$=e[36];let A;return e[37]!==$||e[38]!==b?(A=t.jsxs("div",{className:"cold-open-review-body",children:[b,$]}),e[37]=$,e[38]=b,e[39]=A):A=e[39],A}const ws={en:"EN",th:"TH · ไทย"};function Ns(i){if(!i)return"Media details unavailable";const e=[i.duration?ol(i.duration):null,i.width&&i.height?`${i.width}×${i.height}`:null].filter(Boolean);return e.length?e.join(" · "):i.type}function Ss(i){const e=ce.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(Bt,{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=Ns(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(jt,{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(bt,{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(bt,{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 Cs(i){const e=ce.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=ml.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=ul.map(h=>t.jsx("button",{type:"button","aria-pressed":r.language===h,disabled:l,onClick:()=>a(h),children:ws[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 Ps(i){const e=ce.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(yt(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(hs,{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(yt(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(fs,{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 ks(i){const e=ce.c(37),{copy:s,disabled:l,onCopyChange:n}=i,[a,r]=ye.useState("");let u,c,p,o,f,d,m,h;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==n){h=Ot(s)?.tags??[];let y;e[12]!==s||e[13]!==a||e[14]!==n?(y=()=>{a.trim()&&(n(hl(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(wt(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(wt(s,b)),children:t.jsx(zt,{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 _s(i){const e=ce.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=Ut[s.platform],d=Ht[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(Wt,{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=cl.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 Es(i){const e=ce.c(84),{post:s,review:l,busy:n,onCopyChange:a,onLanguage:r,onRegen:u}=i;let c;e[0]!==s?(c=nl(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 z=il(o);let se;e[18]!==o?(se=Ot(o),e[18]=o,e[19]=se):se=e[19],b=se;const G=b&&b.origin!=="saved"&&b.origin!=="edited";m="post-delivery-caption";const F=d||!!o.drafting;e[20]!==a||e[21]!==r||e[22]!==l||e[23]!==F?(h=t.jsx(Cs,{review:l,disabled:F,onCopyChange:a,onLanguage:r}),e[20]=a,e[21]=r,e[22]=l,e[23]=F,e[24]=h):h=e[24],k="post-delivery-label-row";let Z;e[25]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("label",{htmlFor:"post-delivery-caption",children:"Caption"}),e[25]=Z):Z=e[25];let T;e[26]!==G?(T=G&&t.jsxs("span",{className:"post-copy-badge",children:[t.jsx(Wt,{size:10,"aria-hidden":"true"}),"Auto · from video analysis"]}),e[26]=G,e[27]=T):T=e[27],e[28]!==T?(w=t.jsxs("span",{className:"post-copy-caption-label",children:[Z,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(Ps,{copy:o,disabled:U,onCopyChange:a}),e[30]=o,e[31]=a,e[32]=U,e[33]=y):y=e[33],x=z.over||z.length>dl?"confirm-field-error":void 0,g=z.length.toLocaleString(),S=" / ",j=z.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 $;e[43]!==_||e[44]!==k||e[45]!==w?($=t.jsxs("div",{className:k,children:[w,_]}),e[43]=_,e[44]=k,e[45]=w,e[46]=$):$=e[46];let A;e[47]!==n||e[48]!==o||e[49]!==f||e[50]!==p||e[51]!==a||e[52]!==s||e[53]!==b?.body?(A=f?t.jsxs("div",{className:"post-copy-drafting",role:"status",children:["Astra is writing the ",Ht[o.language]," caption for ",Ut[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:z=>a(al(o,{body:z.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]=A):A=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(ks,{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.":`${rl(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 M;e[67]!==I?(M=t.jsx("small",{children:I}),e[67]=I,e[68]=M):M=e[68];let D;e[69]!==n||e[70]!==o||e[71]!==p||e[72]!==a||e[73]!==u?(D=!p&&t.jsx(_s,{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]!==$||e[78]!==A||e[79]!==N||e[80]!==E||e[81]!==M||e[82]!==D?(L=t.jsxs("div",{className:m,children:[h,$,A,N,E,M,D]}),e[75]=m,e[76]=h,e[77]=$,e[78]=A,e[79]=N,e[80]=E,e[81]=M,e[82]=D,e[83]=L):L=e[83],L}function $s(i){const e=ce.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(bt,{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 As(i){return i.trim().replace(/\/+$/u,"")||"…"}function Nn(i){const e=ce.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?Zt(i.review.icloudFolder):el(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=tl(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?ll(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(Ss,{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(Es,{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(jt,{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:A=>i.onFolderChange(A.target.value)}),t.jsxs("small",{children:["Appears on iPhone in Files › Shared › Videobook › ",As(l)]})]}):t.jsxs(t.Fragment,{children:[t.jsx($s,{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:A=>i.onFolderChange(A.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=sl(i.post)&&t.jsx(as,{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 $;return e[61]!==_||e[62]!==f||e[63]!==d?($=t.jsxs("div",{className:"post-delivery-body",children:[f,d,_]}),e[61]=_,e[62]=f,e[63]=d,e[64]=$):$=e[64],$}const Rs=new Map;function Ts(i){const e=i.cell.inputs;return e&&typeof e.generationMode=="string"?e.generationMode:""}function Is(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 Vt(e).urlPlaceholders){const n=s.get(l.reference);n&&s.set(l.url,n)}return s}function Tt(i){const e=ce.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(us,{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 Sn(i){const e=ce.c(226),{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:$,onSettingChange:A}=i,N=S===void 0?!1:S,E=j===void 0?"":j,[I,M]=ye.useState(!1);let D;e[0]!==n?(D=fl(n),e[0]=n,e[1]=D):D=e[1];const L=D;let z;e[2]!==n.cell.inputs?(z=n.cell.inputs??{},e[2]=n.cell.inputs,e[3]=z):z=e[3];let se;e[4]!==n.action.model||e[5]!==z?(se=pl(n.action.model,z),e[4]=n.action.model,e[5]=z,e[6]=se):se=e[6];const G=se,F=xl();let Z;e[7]!==d?(Z=()=>{d&&d.ensureLoaded().catch(qs)},e[7]=d,e[8]=Z):Z=e[8];const T=Z;let U;e[9]!==d?(U=()=>{d&&d.refresh().catch(Qs)},e[9]=d,e[10]=U):U=e[10];const ae=U;let re;e[11]!==n.action.controls||e[12]!==n.cell.type?(re=n.cell.type==="generate_audio"?n.action.controls.find(Vs):void 0,e[11]=n.action.controls,e[12]=n.cell.type,e[13]=re):re=e[13];const ee=re;let de;e[14]!==d?.voices||e[15]!==ee?(de=ee?d?.voices??[]:[],e[14]=d?.voices,e[15]=ee,e[16]=de):de=e[16];const ie=de,te=ie.length>0,pe=typeof L.voice_id=="string"?L.voice_id:"";let le;e[17]!==n.action.model?(le=gl(n.action.model),e[17]=n.action.model,e[18]=le):le=e[18];const me=le;let H,xe,K,ue,Y,he,X,Q,q,B,W;if(e[19]!==s||e[20]!==l||e[21]!==g||e[22]!==C||e[23]!==n||e[24]!==T||e[25]!==G||e[26]!==x||e[27]!==me||e[28]!==a||e[29]!==E||e[30]!==y||e[31]!==k||e[32]!==w||e[33]!==b||e[34]!==_||e[35]!==$||e[36]!==A||e[37]!==r||e[38]!==u||e[39]!==c||e[40]!==F||e[41]!==p||e[42]!==m||e[43]!==h||e[44]!==ae||e[45]!==pe||e[46]!==L||e[47]!==I||e[48]!==te||e[49]!==f||e[50]!==N||e[51]!==o||e[52]!==d||e[53]!==ee||e[54]!==ie){const we=me?n.action.controls.filter(Us):n.action.controls,Se=te?n.action.controls.filter(Hs):we,Ce=Se.filter(Os),oe=Se.filter(Ds);let Te;e[66]!==r?(Te=wl(r),e[66]=r,e[67]=Te):Te=e[67];const _e=Te;let Ee;e[68]!==r||e[69]!==o?(Ee=Is(o,r),e[68]=r,e[69]=o,e[70]=Ee):Ee=e[70];const Ie=Ee;H=bl(r);const Le=p?[]:Vt(r).promptLeaks;let Me;e[71]!==n.action.model||e[72]!==n.action.provider||e[73]!==n.action.tool||e[74]!==n.cell.inputs||e[75]!==n.cell.prompt||e[76]!==_e?(Me=_e??{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[71]=n.action.model,e[72]=n.action.provider,e[73]=n.action.tool,e[74]=n.cell.inputs,e[75]=n.cell.prompt,e[76]=_e,e[77]=Me):Me=e[77];const Oe=Me;let $e;e[78]!==n.cell||e[79]!==E||e[80]!==N?($e=N?vl(E,n.cell).length:0,e[78]=n.cell,e[79]=E,e[80]=N,e[81]=$e):$e=e[81];const Ge=$e;he="confirm-generation",X=N?"source":"form";let Ae;e[82]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("span",{className:"confirm-section-label",children:"Inputs"}),e[82]=Ae):Ae=e[82];let Fe;if(e[83]!==l||e[84]!==_||e[85]!==$||e[86]!==o){let O;e[88]!==l||e[89]!==_||e[90]!==$?(O=ze=>t.jsxs("div",{className:"generation-review-source-wrap",children:[t.jsx(Tt,{badge:"Input",busy:l,source:ze,title:`Select @${ze.address} on the board`,onClick:()=>$(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(zt,{size:11,"aria-hidden":"true"})})]},`${ze.cellId}:${ze.targetInput??""}`),e[88]=l,e[89]=_,e[90]=$,e[91]=O):O=e[91],Fe=o.map(O),e[83]=l,e[84]=_,e[85]=$,e[86]=o,e[87]=Fe}else Fe=e[87];let Pe;e[92]!==o.length?(Pe=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[92]=o.length,e[93]=Pe):Pe=e[93];let ke;e[94]!==l||e[95]!==I||e[96]!==f.length?(ke=f.length>0&&t.jsxs("button",{type:"button",className:"generation-review-source-add",disabled:l,"aria-expanded":I,onClick:()=>M(Ms),children:[t.jsx(ps,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:"Add input"})]}),e[94]=l,e[95]=I,e[96]=f.length,e[97]=ke):ke=e[97];let He;e[98]!==Fe||e[99]!==Pe||e[100]!==ke?(He=t.jsxs("div",{className:"generation-review-sources",children:[Fe,Pe,ke]}),e[98]=Fe,e[99]=Pe,e[100]=ke,e[101]=He):He=e[101];let P;e[102]!==l||e[103]!==k||e[104]!==I||e[105]!==f?(P=I&&f.length>0&&t.jsx("div",{className:"generation-review-sources generation-review-source-options","aria-label":"Available input cells",children:f.map(O=>t.jsx(Tt,{badge:"Add",busy:l,source:O,title:`Add @${O.address} as ${O.targetLabel??"input"}`,onClick:()=>{k(O.cellId,O.targetInput),M(!1)}},`${O.cellId}:${O.targetInput??""}`))}),e[102]=l,e[103]=k,e[104]=I,e[105]=f,e[106]=P):P=e[106],e[107]!==x||e[108]!==He||e[109]!==P?(Q=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Inputs",children:[Ae,He,P,x]}),e[107]=x,e[108]=He,e[109]=P,e[110]=Q):Q=e[110];const fe=N===!0;let Ve;e[111]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("span",{className:"confirm-section-label",children:"Model"}),e[111]=Ve):Ve=e[111];const et=n.action.id,Je=l||s.length===0;let Ke;e[112]!==y?(Ke=O=>y(O.target.value),e[112]=y,e[113]=Ke):Ke=e[113];let Ye;e[114]!==s?(Ye=s.map(Fs),e[114]=s,e[115]=Ye):Ye=e[115];let Qe;e[116]!==n.action.id||e[117]!==Je||e[118]!==Ke||e[119]!==Ye?(Qe=t.jsxs("label",{children:[Ve,t.jsx("select",{"aria-label":"Generation model",value:et,disabled:Je,onChange:Ke,children:Ye})]}),e[116]=n.action.id,e[117]=Je,e[118]=Ke,e[119]=Ye,e[120]=Qe):Qe=e[120];let qe;e[121]!==l||e[122]!==g||e[123]!==n||e[124]!==a||e[125]!==w?(qe=a.length>1&&t.jsxs("label",{children:[t.jsx("span",{className:"confirm-section-label",children:"Type"}),t.jsx("select",{"aria-label":"Generation type",value:Ts(n),disabled:l,onChange:O=>w(O.target.value),children:a.map(O=>t.jsxs("option",{value:O.id,children:[jl(O.id),g&&!g.has(O.id)?" · check inputs":""]},O.id))})]}),e[121]=l,e[122]=g,e[123]=n,e[124]=a,e[125]=w,e[126]=qe):qe=e[126];let Be;e[127]!==Qe||e[128]!==qe?(Be=t.jsxs("section",{className:"generation-review-model-section","aria-label":"Model",children:[Qe,qe]}),e[127]=Qe,e[128]=qe,e[129]=Be):Be=e[129];let We;e[130]!==l||e[131]!==n.action.controls||e[132]!==me||e[133]!==A||e[134]!==L||e[135]!==o?(We=me&&t.jsx(rs,{sources:o,settings:L,controls:n.action.controls,busy:l,onChange:A}),e[130]=l,e[131]=n.action.controls,e[132]=me,e[133]=A,e[134]=L,e[135]=o,e[136]=We):We=e[136];let Xe;e[137]!==G?(Xe=G&&t.jsx("p",{className:"muted",children:Nl}),e[137]=G,e[138]=Xe):Xe=e[138];let R;e[139]!==l||e[140]!==T||e[141]!==G||e[142]!==A||e[143]!==L?(R=O=>t.jsx(At,{control:O,settings:L,busy:l||O.name==="aspect_ratio"&&!!G,toggleClassName:"generation-review-toggle",onFocus:O.name==="voice_id"?T:void 0,onChange:ze=>A(O.name,ze)},O.name),e[139]=l,e[140]=T,e[141]=G,e[142]=A,e[143]=L,e[144]=R):R=e[144];const V=t.jsxs("div",{className:"generation-review-settings",children:[Ce.map(R),Se.length===0&&t.jsx("span",{className:"generation-review-defaults",children:"Provider defaults"})]}),De=oe.length>0&&t.jsx("div",{className:"generation-review-toggles",children:oe.map(O=>t.jsx(At,{control:O,settings:L,busy:l,toggleClassName:"generation-review-toggle",onChange:ze=>A(O.name,ze)},O.name))});let Re;e[145]!==Xe||e[146]!==V||e[147]!==De?(Re=t.jsxs("section",{className:"generation-review-settings-section","aria-label":"Settings",children:[Xe,V,De]}),e[145]=Xe,e[146]=V,e[147]=De,e[148]=Re):Re=e[148];let Ue;e[149]!==l||e[150]!==A||e[151]!==F||e[152]!==ae||e[153]!==pe||e[154]!==te||e[155]!==d||e[156]!==ee||e[157]!==ie?(Ue=ee&&d&&t.jsxs("section",{className:"generation-review-voice-section","aria-label":"Voice",children:[t.jsx("span",{className:"confirm-section-label",children:"Voice"}),te&&t.jsx("div",{className:"generation-review-voices",role:"listbox","aria-label":"ElevenLabs voices","data-testid":"generation-review-voices",children:t.jsx(os,{voices:ie,selectedVoiceId:pe,playingVoiceId:F.playingVoiceId,disabled:l,onSelect:O=>{yl(O),A("voice_id",O)},onTogglePreview:F.toggle})}),d.loading&&ie.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:ae,children:d.loading?"Loading voices…":d.error?"Retry voices":te?"Refresh voices":"Load voices"}),d?.warning&&t.jsx("small",{children:d.warning})]}),e[149]=l,e[150]=A,e[151]=F,e[152]=ae,e[153]=pe,e[154]=te,e[155]=d,e[156]=ee,e[157]=ie,e[158]=Ue):Ue=e[158];const lt=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(cs,{history:h,disabled:l})]}),t.jsx("textarea",{rows:3,"aria-label":"Prompt",value:n.cell.prompt??"","aria-invalid":Le.length>0,disabled:l,onChange:O=>b(O.target.value),onKeyDown:O=>{h?.handlePromptKeyDown(O)}})]}),st=Le.length>0&&t.jsx("div",{className:"generation-review-reference-errors",role:"alert",children:Le.map(Ls)});let tt;e[159]!==lt||e[160]!==st?(tt=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Prompt",children:[lt,st]}),e[159]=lt,e[160]=st,e[161]=tt):tt=e[161],e[162]!==fe||e[163]!==Be||e[164]!==We||e[165]!==Re||e[166]!==Ue||e[167]!==tt?(q=t.jsxs("div",{className:"confirm-section generation-review-editor",hidden:fe,children:[Be,We,Re,Ue,tt]}),e[162]=fe,e[163]=Be,e[164]=We,e[165]=Re,e[166]=Ue,e[167]=tt,e[168]=q):q=e[168],e[169]!==C||e[170]!==Ge||e[171]!==n.cell||e[172]!==E||e[173]!==N?(B=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 · ",Ge," columns"]})]}),t.jsx("div",{className:"generation-review-dolt",tabIndex:0,"aria-label":"Dolt source preview",children:t.jsx(ds,{notebookId:E,cell:n.cell,artifactAssets:C??Rs,heading:!1})})]}),e[169]=C,e[170]=Ge,e[171]=n.cell,e[172]=E,e[173]=N,e[174]=B):B=e[174];const ft=N?"MCP payload":"Payload",pt=N?"MCP payload":"Payload";let it;e[175]!==pt?(it=t.jsx("span",{children:pt}),e[175]=pt,e[176]=it):it=e[176];let at;e[177]!==c||e[178]!==p?(at=(p||c)&&t.jsx("small",{className:"generation-review-json-stale",role:"status",children:"Updating…"}),e[177]=c,e[178]=p,e[179]=at):at=e[179];let rt;e[180]!==it||e[181]!==at?(rt=t.jsxs("div",{className:"confirm-section-heading",children:[it,at]}),e[180]=it,e[181]=at,e[182]=rt):rt=e[182];const xt=N?"MCP payload preview":"Generation payload preview";let ot;e[183]!==Ie||e[184]!==u||e[185]!==Oe||e[186]!==c||e[187]!==_e?.payload||e[188]!==N?(ot=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(ms,{value:N?Oe:_e?.payload??null,ariaLabel:N?"MCP payload JSON":"Generation payload JSON",artifactAssets:Ie,mediaDisplay:"preview"}),e[183]=Ie,e[184]=u,e[185]=Oe,e[186]=c,e[187]=_e?.payload,e[188]=N,e[189]=ot):ot=e[189];let ct;e[190]!==c||e[191]!==xt||e[192]!==ot?(ct=t.jsx("div",{className:"generation-review-json",tabIndex:0,"aria-label":xt,"aria-busy":c,children:ot}),e[190]=c,e[191]=xt,e[192]=ot,e[193]=ct):ct=e[193],e[194]!==ft||e[195]!==rt||e[196]!==ct?(W=t.jsxs("section",{className:"confirm-section generation-review-source-section","aria-label":ft,children:[rt,ct]}),e[194]=ft,e[195]=rt,e[196]=ct,e[197]=W):W=e[197],K="confirm-section generation-review-estimate-section",ue="Estimate",e[198]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[198]=Y):Y=e[198],xe=c||p?"…":!u&&H.usd!==null&&!H.unknown?`$${H.usd.toFixed(H.usd<.01?4:2)}`:"—",e[19]=s,e[20]=l,e[21]=g,e[22]=C,e[23]=n,e[24]=T,e[25]=G,e[26]=x,e[27]=me,e[28]=a,e[29]=E,e[30]=y,e[31]=k,e[32]=w,e[33]=b,e[34]=_,e[35]=$,e[36]=A,e[37]=r,e[38]=u,e[39]=c,e[40]=F,e[41]=p,e[42]=m,e[43]=h,e[44]=ae,e[45]=pe,e[46]=L,e[47]=I,e[48]=te,e[49]=f,e[50]=N,e[51]=o,e[52]=d,e[53]=ee,e[54]=ie,e[55]=H,e[56]=xe,e[57]=K,e[58]=ue,e[59]=Y,e[60]=he,e[61]=X,e[62]=Q,e[63]=q,e[64]=B,e[65]=W}else H=e[55],xe=e[56],K=e[57],ue=e[58],Y=e[59],he=e[60],X=e[61],Q=e[62],q=e[63],B=e[64],W=e[65];let ne;e[199]!==xe?(ne=t.jsx("strong",{children:xe}),e[199]=xe,e[200]=ne):ne=e[200];let J;e[201]!==H.currency?(J=t.jsx("span",{children:H.currency}),e[201]=H.currency,e[202]=J):J=e[202];const ve=c||p?"Updating estimate…":u||H.unknown||H.usd===null?"Cost estimate unavailable":"Estimated provider cost";let je;e[203]!==ve?(je=t.jsx("small",{children:ve}),e[203]=ve,e[204]=je):je=e[204];let ge;e[205]!==l||e[206]!==v||e[207]!==u||e[208]!==c?(ge=u&&t.jsxs("button",{type:"button",disabled:l||c,onClick:v,children:[t.jsx(gs,{size:10,"aria-hidden":"true"}),"Retry preview"]}),e[205]=l,e[206]=v,e[207]=u,e[208]=c,e[209]=ge):ge=e[209];let be;e[210]!==K||e[211]!==ue||e[212]!==Y||e[213]!==ne||e[214]!==J||e[215]!==je||e[216]!==ge?(be=t.jsxs("section",{className:K,"aria-label":ue,children:[Y,ne,J,je,ge]}),e[210]=K,e[211]=ue,e[212]=Y,e[213]=ne,e[214]=J,e[215]=je,e[216]=ge,e[217]=be):be=e[217];let Ne;return e[218]!==he||e[219]!==X||e[220]!==Q||e[221]!==q||e[222]!==B||e[223]!==W||e[224]!==be?(Ne=t.jsxs("div",{className:he,"data-view":X,children:[Q,q,B,W,be]}),e[218]=he,e[219]=X,e[220]=Q,e[221]=q,e[222]=B,e[223]=W,e[224]=be,e[225]=Ne):Ne=e[225],Ne}function Ls(i){return t.jsxs("span",{title:i.message,children:[t.jsx(xs,{size:12,"aria-hidden":"true"}),t.jsx("code",{children:i.token}),i.message]},`${i.token}:${i.code}`)}function Fs(i){return t.jsxs("option",{value:i.id,children:[i.title," · ",i.providerLabel]},i.id)}function Ms(i){return!i}function Ds(i){return i.kind==="boolean"}function Os(i){return i.kind!=="boolean"}function Hs(i){return i.name!=="voice_id"}function Us(i){return!["start_time","resume_time","duration"].includes(i.name)}function Vs(i){return i.name==="voice_id"}function Qs(){}function qs(){}function It(i){const e=ce.c(28),{label:s,mediaUrl:l,muted:n,playbackRate:a,windows:r}=i,u=ye.useRef(null),c=ye.useRef(null),p=ye.useRef(0);let o;e[0]!==r?(o=r.map(Gs).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(zs);p.current=0;const _=v[0]?.startSeconds??0,$=()=>{b.currentTime=_,c.current=_,b.playbackRate=a,b.play().catch(Ws)};let A=0,N,E=!1;const I=()=>{N!==void 0&&typeof b.cancelVideoFrameCallback=="function"&&(b.cancelVideoFrameCallback(N),N=void 0),A&&(cancelAnimationFrame(A),A=0)},M=()=>{if(E)return;const L=Al({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(Bs)):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(()=>M());return}A=requestAnimationFrame(()=>M())}};return b.readyState>=HTMLMediaElement.HAVE_METADATA?$():b.addEventListener("loadedmetadata",$,{once:!0}),D(),()=>{E=!0,I(),b.removeEventListener("loadedmetadata",$)}},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],ye.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]),ye.useEffect(h,x);let g;e[12]!==r?(g=r[0]?`${Ze(r[0].startSeconds)}–${Ze(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 Bs(){}function Ws(){}function zs(i){const[e,s]=i.split(":").map(Number);return Number.isFinite(e)&&Number.isFinite(s)&&s>e?[{startSeconds:e,endSeconds:s}]:[]}function Gs(i){return`${i.startSeconds}:${i.endSeconds}`}const Ks=[-1,-.1,-.01,.01,.1,1],Ys=[-1,-.1,.1,1];function Cn(i){const e=ce.c(178),{cutPointsSeconds:s,mediaUrl:l,onChange:n,outputMode:a,selectedIndex:r,sourceDurationSeconds:u,sourceFps:c}=i,p=ye.useRef(null),[o,f]=ye.useState(!1),[d,m]=ye.useState("in"),[h,x]=ye.useState(null),[g,S]=ye.useState(null),[j,C]=ye.useState(null),[y,k]=ye.useState(null);let w;e[0]!==s||e[1]!==u?(w=Sl({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?(_=_l(c),e[3]=c,e[4]=_):_=e[4];const $=_;let A;e[5]!==v||e[6]!==u?(A=v?Cl({segment:v,sourceDurationSeconds:u}):{segment:{startSeconds:0,endSeconds:0},surroundings:[]},e[5]=v,e[6]=u,e[7]=A):A=e[7];const N=A,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 M=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 z;e[14]!==E||e[15]!==v?.durationSeconds||e[16]!==y?(z=y?.key===E?y.value:Pl(v?.durationSeconds??1),e[14]=E,e[15]=v?.durationSeconds,e[16]=y,e[17]=z):z=e[17];const se=z;let G;e[18]!==n||e[19]!==a?(G=R=>{C(null),x(null),S(null),n({cutPointsSeconds:R.cutPointsSeconds,outputMode:R.outputMode??a,selectedIndex:R.selectedIndex})},e[18]=n,e[19]=a,e[20]=G):G=e[20];const F=G;let Z;e[21]!==F?(Z=R=>{x(null),S(null),F(R)},e[21]=F,e[22]=Z):Z=e[22];const T=Z;let U;e[23]!==T||e[24]!==s||e[25]!==r||e[26]!==u?(U=R=>{T(Nt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[23]=T,e[24]=s,e[25]=r,e[26]=u,e[27]=U):U=e[27];const ae=U;let re;e[28]!==T||e[29]!==s||e[30]!==r||e[31]!==u?(re=R=>{T(St({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[28]=T,e[29]=s,e[30]=r,e[31]=u,e[32]=re):re=e[32];const ee=re;let de;e[33]!==T||e[34]!==s||e[35]!==v||e[36]!==r||e[37]!==u?(de=(R,V)=>{if(!v)return;const De=Math.round(Number(R)*1e3)/1e3,Re=Math.round(Number(V)*1e3)/1e3;if(!Number.isFinite(De)||!Number.isFinite(Re)){C("Enter start and end times in seconds");return}const Ue=Ct({cutPointsSeconds:s,endSeconds:Re,index:r,sourceDurationSeconds:u,startSeconds:De});if(Ue.cutPointsSeconds.length===s.length&&Ue.cutPointsSeconds.every((lt,st)=>lt===s[st])&&(De!==v.startSeconds||Re!==v.endSeconds)){C(`Choose a range from ${Ze(v.startSeconds)} that stays inside neighbouring pieces`),x(null),S(null);return}T(Ue)},e[33]=T,e[34]=s,e[35]=v,e[36]=r,e[37]=u,e[38]=de):de=e[38];const ie=de;let te;e[39]!==T||e[40]!==s||e[41]!==v||e[42]!==r||e[43]!==u?(te=R=>{const V=p.current?.currentTime;!v||typeof V!="number"||!Number.isFinite(V)||T(Ct({cutPointsSeconds:s,endSeconds:R==="out"?V:v.endSeconds,index:r,sourceDurationSeconds:u,startSeconds:R==="in"?V:v.startSeconds}))},e[39]=T,e[40]=s,e[41]=v,e[42]=r,e[43]=u,e[44]=te):te=e[44];const pe=te;let le;e[45]!==d||e[46]!==ae||e[47]!==ee?(le=R=>{if(R.key!=="ArrowLeft"&&R.key!=="ArrowRight"||R.target instanceof HTMLInputElement)return;R.preventDefault();const V=R.key==="ArrowLeft"?-1:1,De=R.altKey?.01:R.shiftKey?1:.1;d==="out"?ee(V*De):ae(V*De)},e[45]=d,e[46]=ae,e[47]=ee,e[48]=le):le=e[48];const me=le,H=se?.25:1,xe=a==="remove"?"JOIN PREVIEW":"SURROUNDINGS";let K;e[49]!==a||e[50]!==b.length||e[51]!==v?(K=v?a==="all"?`Apply creates ${b.length} cells`:a==="keep"?`Apply creates 1 cell: ${Ze(v.startSeconds)}-${Ze(v.endSeconds)}`:`Apply creates 1 cell without ${Ze(v.startSeconds)}-${Ze(v.endSeconds)}`:"",e[49]=a,e[50]=b.length,e[51]=v,e[52]=K):K=e[52];const ue=K;let Y;e[53]!==s||e[54]!==$||e[55]!==r?(Y=(R,V,De)=>t.jsxs("div",{className:"confirm-split-nudges",children:[Ks.map(Re=>{const Ue=De(Re),lt=Ue.cutPointsSeconds.every((st,tt)=>st===s[tt])&&Ue.selectedIndex===r;return t.jsxs("button",{type:"button",disabled:lt,onFocus:()=>m(R),onClick:()=>V(Re),children:[Re>0?"+":"−",Math.abs(Re),"s"]},`${R}:${Re}`)}),$!==null&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Previous frame",title:"Previous frame",onFocus:()=>m(R),onClick:()=>V(-$),children:"◂"}),t.jsx("button",{type:"button","aria-label":"Next frame",title:"Next frame",onFocus:()=>m(R),onClick:()=>V($),children:"▸"})]})]}),e[53]=s,e[54]=$,e[55]=r,e[56]=Y):Y=e[56];const he=Y;let X;e[57]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("span",{children:"Source"}),e[57]=X):X=e[57];let Q;e[58]!==u?(Q=Ze(u),e[58]=u,e[59]=Q):Q=e[59];let q;e[60]!==Q?(q=t.jsxs("div",{className:"confirm-section-heading",children:[X,t.jsxs("strong",{children:[Q," total"]})]}),e[60]=Q,e[61]=q):q=e[61];let B;e[62]!==l?(B=t.jsx("video",{ref:p,src:l,controls:!0,playsInline:!0,preload:"metadata"}),e[62]=l,e[63]=B):B=e[63];let W;e[64]!==pe?(W=t.jsx("button",{type:"button",onClick:()=>pe("in"),children:"SET IN HERE"}),e[64]=pe,e[65]=W):W=e[65];let ne;e[66]!==pe?(ne=t.jsx("button",{type:"button",onClick:()=>pe("out"),children:"SET OUT HERE"}),e[66]=pe,e[67]=ne):ne=e[67];let J;e[68]!==W||e[69]!==ne?(J=t.jsxs("div",{className:"confirm-actions-row",children:[W,ne]}),e[68]=W,e[69]=ne,e[70]=J):J=e[70];let ve;e[71]!==q||e[72]!==B||e[73]!==J?(ve=t.jsxs("section",{className:"confirm-section","aria-label":"Source player",children:[q,B,J]}),e[71]=q,e[72]=B,e[73]=J,e[74]=ve):ve=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 ge;if(e[76]!==s||e[77]!==F||e[78]!==b||e[79]!==r){let R;e[81]!==s||e[82]!==F||e[83]!==r?(R=V=>t.jsxs("button",{type:"button",role:"listitem",className:V.index===r?"active":void 0,"aria-pressed":V.index===r,onClick:()=>F({cutPointsSeconds:s,selectedIndex:V.index}),children:[String(V.index+1).padStart(2,"0")," ",Ze(V.startSeconds),"-",Ze(V.endSeconds)]},`${V.startSeconds}:${V.endSeconds}`),e[81]=s,e[82]=F,e[83]=r,e[84]=R):R=e[84],ge=b.map(R),e[76]=s,e[77]=F,e[78]=b,e[79]=r,e[80]=ge}else ge=e[80];let be;e[85]!==ge?(be=t.jsx("div",{className:"confirm-chips",role:"list",children:ge}),e[85]=ge,e[86]=be):be=e[86];const Ne=!v||v.durationSeconds<.04;let we;e[87]!==T||e[88]!==s||e[89]!==r||e[90]!==u?(we=()=>T(El({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[87]=T,e[88]=s,e[89]=r,e[90]=u,e[91]=we):we=e[91];let Se;e[92]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx(bs,{size:12,"aria-hidden":"true"}),e[92]=Se):Se=e[92];let Ce;e[93]!==Ne||e[94]!==we?(Ce=t.jsxs("button",{type:"button",disabled:Ne,onClick:we,children:[Se,"Split piece in half"]}),e[93]=Ne,e[94]=we,e[95]=Ce):Ce=e[95];const oe=r>=b.length-1;let Te;e[96]!==T||e[97]!==s||e[98]!==r||e[99]!==u?(Te=()=>T($l({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[96]=T,e[97]=s,e[98]=r,e[99]=u,e[100]=Te):Te=e[100];let _e;e[101]!==oe||e[102]!==Te?(_e=t.jsx("button",{type:"button",disabled:oe,onClick:Te,children:"Merge with next"}),e[101]=oe,e[102]=Te,e[103]=_e):_e=e[103];let Ee;e[104]!==Ce||e[105]!==_e?(Ee=t.jsxs("div",{className:"confirm-actions-row",children:[Ce,_e]}),e[104]=Ce,e[105]=_e,e[106]=Ee):Ee=e[106];let Ie;e[107]!==be||e[108]!==Ee?(Ie=t.jsxs("section",{className:"confirm-section","aria-label":"Pieces",children:[je,be,Ee]}),e[107]=be,e[108]=Ee,e[109]=Ie):Ie=e[109];let Le;e[110]!==ve||e[111]!==Ie?(Le=t.jsxs("div",{className:"confirm-split-column",children:[ve,Ie]}),e[110]=ve,e[111]=Ie,e[112]=Le):Le=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 Oe;e[114]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>f(Xs),e[114]=Oe):Oe=e[114];let $e;e[115]!==o?($e=o?t.jsx(vs,{size:13}):t.jsx(js,{size:13}),e[115]=o,e[116]=$e):$e=e[116];const Ge=o?"Sound on":"Sound off";let Ae;e[117]!==o||e[118]!==$e||e[119]!==Ge?(Ae=t.jsxs("div",{className:"confirm-section-heading",children:[Me,t.jsxs("button",{type:"button","aria-pressed":o,onClick:Oe,children:[$e,Ge]})]}),e[117]=o,e[118]=$e,e[119]=Ge,e[120]=Ae):Ae=e[120];const Fe=!o;let Pe;e[121]!==N.segment?(Pe=[N.segment],e[121]=N.segment,e[122]=Pe):Pe=e[122];let ke;e[123]!==l||e[124]!==H||e[125]!==Fe||e[126]!==Pe?(ke=t.jsx(It,{label:"SEGMENT",mediaUrl:l,muted:Fe,playbackRate:H,windows:Pe}),e[123]=l,e[124]=H,e[125]=Fe,e[126]=Pe,e[127]=ke):ke=e[127];const He=!o;let P;e[128]!==l||e[129]!==H||e[130]!==xe||e[131]!==He||e[132]!==N.surroundings?(P=t.jsx(It,{label:xe,mediaUrl:l,muted:He,playbackRate:H,windows:N.surroundings}),e[128]=l,e[129]=H,e[130]=xe,e[131]=He,e[132]=N.surroundings,e[133]=P):P=e[133];let fe;e[134]!==ke||e[135]!==P?(fe=t.jsxs("div",{className:"confirm-split-loops",children:[ke,P]}),e[134]=ke,e[135]=P,e[136]=fe):fe=e[136];let Ve;e[137]!==T||e[138]!==ie||e[139]!==s||e[140]!==M||e[141]!==he||e[142]!==ae||e[143]!==ee||e[144]!==L||e[145]!==E||e[146]!==v||e[147]!==r||e[148]!==se||e[149]!==u?(Ve=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:M,onFocus:()=>m("in"),onChange:R=>x(R.target.value),onBlur:()=>ie(M,L),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),ie(M,L))}}),he("in",ae,R=>Nt({cutPointsSeconds:s,deltaSeconds:R,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:R=>S(R.target.value),onBlur:()=>ie(M,L),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),ie(M,L))}}),he("out",ee,R=>St({cutPointsSeconds:s,deltaSeconds:R,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:[Ys.map(R=>{const V=kl({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}),De=V.cutPointsSeconds.every((Re,Ue)=>Re===s[Ue]);return t.jsxs("button",{type:"button",disabled:De,onClick:()=>T(V),children:[R>0?"+":"−",Math.abs(R),"s"]},`move:${R}`)}),t.jsx("button",{type:"button","aria-pressed":se,onClick:()=>k({key:E,value:!se}),children:"Slow ×0.25"})]})]})]}),e[137]=T,e[138]=ie,e[139]=s,e[140]=M,e[141]=he,e[142]=ae,e[143]=ee,e[144]=L,e[145]=E,e[146]=v,e[147]=r,e[148]=se,e[149]=u,e[150]=Ve):Ve=e[150];let et;e[151]!==j?(et=j&&t.jsx("p",{className:"confirm-field-error",role:"alert",children:j}),e[151]=j,e[152]=et):et=e[152];let Je;e[153]!==Ae||e[154]!==fe||e[155]!==Ve||e[156]!==et?(Je=t.jsxs("section",{className:"confirm-section","aria-label":"Loops",children:[Ae,fe,Ve,et]}),e[153]=Ae,e[154]=fe,e[155]=Ve,e[156]=et,e[157]=Je):Je=e[157];let Ke;e[158]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsx("span",{className:"confirm-section-label",children:"Output"}),e[158]=Ke):Ke=e[158];let Ye;e[159]===Symbol.for("react.memo_cache_sentinel")?(Ye=[["keep","KEEP segment"],["remove","REMOVE segment"],["all","ALL pieces"]],e[159]=Ye):Ye=e[159];let Qe;e[160]!==s||e[161]!==F||e[162]!==a||e[163]!==b.length||e[164]!==r?(Qe=t.jsx("div",{className:"confirm-chips",children:Ye.map(R=>{const[V,De]=R;return t.jsx("button",{type:"button",className:a===V?"active":void 0,"aria-pressed":a===V,disabled:V==="remove"&&b.length<2,onClick:()=>F({cutPointsSeconds:s,outputMode:V,selectedIndex:r}),children:De},V)})}),e[160]=s,e[161]=F,e[162]=a,e[163]=b.length,e[164]=r,e[165]=Qe):Qe=e[165];let qe;e[166]!==ue?(qe=t.jsx("p",{className:"confirm-help",children:ue}),e[166]=ue,e[167]=qe):qe=e[167];let Be;e[168]!==Qe||e[169]!==qe?(Be=t.jsxs("section",{className:"confirm-section","aria-label":"Output mode",children:[Ke,Qe,qe]}),e[168]=Qe,e[169]=qe,e[170]=Be):Be=e[170];let We;e[171]!==Je||e[172]!==Be?(We=t.jsxs("div",{className:"confirm-split-column",children:[Je,Be]}),e[171]=Je,e[172]=Be,e[173]=We):We=e[173];let Xe;return e[174]!==me||e[175]!==Le||e[176]!==We?(Xe=t.jsxs("div",{className:"confirm-split",onKeyDown:me,children:[Le,We]}),e[174]=me,e[175]=Le,e[176]=We,e[177]=Xe):Xe=e[177],Xe}function Xs(i){return!i}function Gt(i){const e=ce.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 Kt({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 Pn(i){const e=ce.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=Rl(n?.status??null);let k;e[2]!==n?(k=n?.status?Tl(n.status):null,e[2]=n,e[3]=k):k=e[3];const w=k,b=a.postText.length>y;let v,_,$,A,N,E,I,M,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 G=h?Il(h):[];let F;e[36]!==h?(F=h?Ll(h.context):!1,e[36]=h,e[37]=F):F=e[37];const Z=F;let T;e[38]!==n?(T=n?.status?Fl(n.status,{connecting:n.connecting}):null,e[38]=n,e[39]=T):T=e[39];const U=T,ae=U!==null&&U.tone!=="connected";_="confirm-routed confirm-post";let re;e[40]!==f?(re=t.jsx(Gt,{prompt:f}),e[40]=f,e[41]=re):re=e[41];let ee;e[42]!==d?(ee=t.jsx(Kt,{columns:2,settings:d}),e[42]=d,e[43]=ee):ee=e[43],e[44]!==re||e[45]!==ee?($=t.jsxs("div",{className:"confirm-routed-main",children:[re,ee]}),e[44]=re,e[45]=ee,e[46]=$):$=e[46],A="x-post-preview",N="X post preview";let de,ie;e[47]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("span",{"aria-hidden":"true",children:"X"}),ie=t.jsx("strong",{children:"Post preview"}),e[47]=de,e[48]=ie):(de=e[47],ie=e[48]),e[49]!==m?(E=t.jsxs("header",{children:[de,t.jsxs("div",{children:[ie,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]!==ae?(I=ae&&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]=ae,e[56]=I):I=e[56],e[57]!==s||e[58]!==g||e[59]!==m||e[60]!==x?(M=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(Bt,{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]=M):M=e[61];let te;e[62]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx("label",{htmlFor:"x-post-title",children:"Title"}),e[62]=te):te=e[62];const pe=C||b;let le;e[63]!==r?(le=oe=>r({postText:oe.target.value}),e[63]=r,e[64]=le):le=e[64];let me;e[65]!==l||e[66]!==a.postText||e[67]!==pe||e[68]!==le?(me=t.jsx("textarea",{id:"x-post-title","aria-invalid":pe,disabled:l,placeholder:"Title (required)",required:!0,rows:3,value:a.postText,onChange:le}),e[65]=l,e[66]=a.postText,e[67]=pe,e[68]=le,e[69]=me):me=e[69];const H=C||b?"confirm-field-error":void 0,xe=C?"A title is required":`${a.postText.length}/${y} characters`;let K;e[70]!==H||e[71]!==xe?(K=t.jsx("small",{className:H,children:xe}),e[70]=H,e[71]=xe,e[72]=K):K=e[72];let ue;e[73]!==w?(ue=w&&t.jsx("small",{className:"x-post-account",children:w}),e[73]=w,e[74]=ue):ue=e[74],e[75]!==me||e[76]!==K||e[77]!==ue?(D=t.jsxs("div",{className:"x-post-preview-copy",children:[te,me,K,ue]}),e[75]=me,e[76]=K,e[77]=ue,e[78]=D):D=e[78];let Y;e[79]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx("span",{children:"Publish"}),e[79]=Y):Y=e[79];const he=S?"schedule":"now";let X;e[80]!==r?(X=oe=>r({scheduledFor:oe.target.value==="schedule"?Ql():null}),e[80]=r,e[81]=X):X=e[81];let Q,q;e[82]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("option",{value:"now",children:"Now"}),q=t.jsx("option",{value:"schedule",children:"Schedule"}),e[82]=Q,e[83]=q):(Q=e[82],q=e[83]);let B;e[84]!==l||e[85]!==he||e[86]!==X?(B=t.jsxs("label",{className:"confirm-field",children:[Y,t.jsxs("select",{"aria-label":"Publish timing",disabled:l,value:he,onChange:X,children:[Q,q]})]}),e[84]=l,e[85]=he,e[86]=X,e[87]=B):B=e[87];let W;e[88]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx("span",{children:"Orientation"}),e[88]=W):W=e[88];const ne=l||s?.type==="image",J=a.orientation??"source";let ve;e[89]!==r?(ve=oe=>r({orientation:oe.target.value==="portrait"||oe.target.value==="landscape"?oe.target.value:null}),e[89]=r,e[90]=ve):ve=e[90];let je,ge,be;e[91]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx("option",{value:"source",children:"Keep source"}),ge=t.jsx("option",{value:"portrait",children:"Portrait"}),be=t.jsx("option",{value:"landscape",children:"Landscape"}),e[91]=je,e[92]=ge,e[93]=be):(je=e[91],ge=e[92],be=e[93]);let Ne;e[94]!==ne||e[95]!==J||e[96]!==ve?(Ne=t.jsxs("select",{"aria-label":"Video orientation",disabled:ne,value:J,onChange:ve,children:[je,ge,be]}),e[94]=ne,e[95]=J,e[96]=ve,e[97]=Ne):Ne=e[97];let we;e[98]!==s?.type?(we=s?.type==="image"&&t.jsx("small",{children:"Video posts only"}),e[98]=s?.type,e[99]=we):we=e[99];let Se;e[100]!==Ne||e[101]!==we?(Se=t.jsxs("label",{className:"confirm-field",children:[W,Ne,we]}),e[100]=Ne,e[101]=we,e[102]=Se):Se=e[102];let Ce;e[103]!==l||e[104]!==a.scheduledFor||e[105]!==r||e[106]!==S?(Ce=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:Dl(a.scheduledFor??""),onChange:oe=>r({scheduledFor:Ml(oe.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]=Ce):Ce=e[107],e[108]!==B||e[109]!==Se||e[110]!==Ce?(L=t.jsxs("div",{className:"x-post-preview-options",role:"group","aria-label":"Post options",children:[B,Se,Ce]}),e[108]=B,e[109]=Se,e[110]=Ce,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||!Z,onChange:oe=>p?.({enabled:oe.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}):Z?h.options.enabled?t.jsxs("div",{className:"x-post-thread-steps",children:[h.context.steps.map((oe,Te)=>t.jsx(en,{busy:l,index:Te,maxCharacters:y,prompt:Ol(h,oe),reply:G.find(_e=>_e.stepId===oe.id)??null,step:oe,stepCount:h.context.steps.length,onPromptChange:o},oe.id)),h.context.credits.length>0&&t.jsx(ln,{busy:l,maxCharacters:y,replyCount:G.filter(Js).length,text:Hl(h),onChange:c}),G.length===0&&t.jsx("small",{className:"confirm-field-error",children:Ul})]}):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]=$,e[29]=A,e[30]=N,e[31]=E,e[32]=I,e[33]=M,e[34]=D,e[35]=L}else v=e[26],_=e[27],$=e[28],A=e[29],N=e[30],E=e[31],I=e[32],M=e[33],D=e[34],L=e[35];let z;e[112]!==v||e[113]!==A||e[114]!==N||e[115]!==E||e[116]!==I||e[117]!==M||e[118]!==D||e[119]!==L?(z=t.jsxs("article",{className:A,"aria-label":N,children:[E,I,M,D,L,v]}),e[112]=v,e[113]=A,e[114]=N,e[115]=E,e[116]=I,e[117]=M,e[118]=D,e[119]=L,e[120]=z):z=e[120];let se;return e[121]!==_||e[122]!==$||e[123]!==z?(se=t.jsxs("div",{className:_,children:[$,z]}),e[121]=_,e[122]=$,e[123]=z,e[124]=se):se=e[124],se}function Js(i){return i.stepId===null}function Yt(i){return i===0?"nothing to post":`posts as ${i} ${i===1?"reply":"replies"}`}function Zs(i){const e=Vl(i.images).length;return e===i.images.length?"Input images":`Input images · first ${e} of ${i.images.length} attach`}function en(i){const e=ce.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=Yt(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=A=>a?.(c.id,A.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:Zs(c)}),t.jsx("div",{className:"x-post-thread-images",children:c.images.map(tn)})]}),e[29]=c,e[30]=_):_=e[30];let $;return e[31]!==m||e[32]!==v||e[33]!==_||e[34]!==h||e[35]!==x?($=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]=$):$=e[36],$}function tn(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 ln(i){const e=ce.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=Yt(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 sn(i){const e=ce.c(15),{effectiveSpeed:s,mediaUrl:l,thumbnailUrl:n}=i,a=ye.useRef(null),[r,u]=ye.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],ye.useEffect(p,o);let f;e[5]!==s?(f=s?`preview at ${ql(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 kn(i){const e=ce.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(Gt,{prompt:s}),e[0]=s,e[1]=c):c=e[1];let p;e[2]!==r||e[3]!==l?(p=t.jsx(Kt,{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(sn,{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 _n(i){const e=ce.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(jt,{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(ys,{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 En(i){const e=ce.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 Lt={"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"},Xt=["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"],ht=Xt.length;function nn(){const i=[];for(let e=0;e<ht;e+=1){const s=Xt[e];for(let l=0;l<ht;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 an=nn(),Ft=28,rn=16,on={center:"Centered","above-qr":"Above QR","on-qr":"On QR","below-qr":"Below QR"};function cn(){const i=ce.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 ${ht} ${ht}`,shapeRendering:"crispEdges",children:t.jsx("path",{d:an,fill:"currentColor"})}),i[0]=e):e=i[0],e}function dn(i){const e=ce.c(5),{platform:s}=i,l=`watermark-preview-platform-icon watermark-preview-${s}-icon`,n=Zl[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 mt(i){return Math.round(i*100)}function mn(i){return i>0?`${i.toFixed(1)}s`:"Off"}function un(i,e,s){if(s<=0)return{left:0,width:100};const l=dt(i/s*100,0,100),n=dt((e??s)/s*100,l,100);return{left:l,width:n-l}}function dt(i,e,s){return Math.min(s,Math.max(e,i))}function Mt(i){return Number.isFinite(i)?`${i.toFixed(1)}s`:"0.0s"}function vt(i,e){return rn*(Math.min(i,e)/e)}function hn(i,e,s){const[l,n]=i.split("-"),a=[],r={aspectRatio:"1 / 1",height:`${vt(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 fn(i,e,s,l,n,a){const r=qt(l);if(n==="center")return{aspectRatio:`${gt} / ${r}`,height:`${vt(i,e)*(r/es)}%`,top:`${s}%`,left:"50%",transform:"translate(-50%, -50%)"};const[u,c]=a.split("-"),p=vt(i,e),o=p*(e/i),f=p*(r/gt),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=dt(h,2,98-o),g=dt(g,d,100-d-f),{aspectRatio:`${gt} / ${r}`,width:`${o}%`,height:"auto",top:`${g}%`,left:`${h}%`}}function pn(i,e,s){const l=(qt(e)-2)/2*(s/100);return{paddingInline:`${i/Ft}em`,borderRadius:`${l/Ft}em`}}function ut(i){const e=ce.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 nt(i){const e=ce.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 Dt(i){const e=ce.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=ts(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=un(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`,$=`${u} start`,A=n>0?n:void 0;let N;e[19]!==a||e[20]!==c?(N=J=>c(Math.max(0,Number(J.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]!==$||e[26]!==A||e[27]!==N?(E=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[v,t.jsx("input",{id:_,"aria-label":$,type:"number",min:"0",max:A,step:"0.1",value:o,disabled:s,onChange:N})]}),e[22]=s,e[23]=o,e[24]=_,e[25]=$,e[26]=A,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 M=`${r}-end`,D=`${u} end`,L=!d,z=n>0?n:void 0,se=a??"";let G;e[30]!==n?(G=n>0?n.toFixed(1):"Clip end",e[30]=n,e[31]=G):G=e[31];let F;e[32]!==c||e[33]!==o?(F=J=>c(o,J.target.value===""?null:Math.max(0,Number(J.target.value)||0)),e[32]=c,e[33]=o,e[34]=F):F=e[34];let Z;e[35]!==s||e[36]!==M||e[37]!==D||e[38]!==L||e[39]!==z||e[40]!==se||e[41]!==G||e[42]!==F?(Z=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[I,t.jsx("input",{id:M,"aria-label":D,"aria-invalid":L,type:"number",min:"0",max:z,step:"0.1",value:se,placeholder:G,disabled:s,onChange:F})]}),e[35]=s,e[36]=M,e[37]=D,e[38]=L,e[39]=z,e[40]=se,e[41]=G,e[42]=F,e[43]=Z):Z=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`,ae=`${u} duration`,re=!d,ee=n>0?Math.max(0,n-o):void 0;let de;e[45]!==o||e[46]!==x?(de=x===null?"":Number(Math.max(0,x-o).toFixed(6)),e[45]=o,e[46]=x,e[47]=de):de=e[47];let ie;e[48]!==n||e[49]!==c||e[50]!==o?(ie=J=>c(o,J.target.value===""?null:Number(Math.min(n>0?n:1/0,o+Math.max(0,Number(J.target.value)||0)).toFixed(6))),e[48]=n,e[49]=c,e[50]=o,e[51]=ie):ie=e[51];let te;e[52]!==s||e[53]!==U||e[54]!==ae||e[55]!==re||e[56]!==ee||e[57]!==de||e[58]!==ie?(te=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[T,t.jsx("input",{id:U,"aria-label":ae,"aria-invalid":re,type:"number",min:"0",max:ee,step:"any",value:de,placeholder:"Clip end",disabled:s,onChange:ie})]}),e[52]=s,e[53]=U,e[54]=ae,e[55]=re,e[56]=ee,e[57]=de,e[58]=ie,e[59]=te):te=e[59];const pe=`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 me;e[64]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(Rt,{size:8,"aria-hidden":"true"}),e[64]=me):me=e[64];let H;e[65]!==s||e[66]!==pe||e[67]!==le?(H=t.jsxs("button",{type:"button","aria-label":pe,disabled:s,onClick:le,children:[me,"Start"]}),e[65]=s,e[66]=pe,e[67]=le,e[68]=H):H=e[68];const xe=`Set ${u} end from playhead`;let K;e[69]!==l||e[70]!==c||e[71]!==o?(K=()=>c(o,Math.max(l,o+.1)),e[69]=l,e[70]=c,e[71]=o,e[72]=K):K=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Rt,{size:8,"aria-hidden":"true"}),e[73]=ue):ue=e[73];let Y;e[74]!==s||e[75]!==xe||e[76]!==K?(Y=t.jsxs("button",{type:"button","aria-label":xe,disabled:s,onClick:K,children:[ue,"End"]}),e[74]=s,e[75]=xe,e[76]=K,e[77]=Y):Y=e[77];const he=`Use whole clip for ${u}`;let X;e[78]!==c?(X=()=>c(0,null),e[78]=c,e[79]=X):X=e[79];let Q;e[80]!==s||e[81]!==he||e[82]!==X?(Q=t.jsx("button",{type:"button","aria-label":he,disabled:s,onClick:X,children:"Whole"}),e[80]=s,e[81]=he,e[82]=X,e[83]=Q):Q=e[83];let q;e[84]!==H||e[85]!==Y||e[86]!==Q?(q=t.jsxs("div",{className:"confirm-watermark-timing-actions",children:[H,Y,Q]}),e[84]=H,e[85]=Y,e[86]=Q,e[87]=q):q=e[87];let B;e[88]!==b||e[89]!==E||e[90]!==Z||e[91]!==te||e[92]!==S||e[93]!==q?(B=t.jsxs("div",{className:"confirm-watermark-timing-row",children:[S,b,E,Z,te,q]}),e[88]=b,e[89]=E,e[90]=Z,e[91]=te,e[92]=S,e[93]=q,e[94]=B):B=e[94];let W;e[95]!==u||e[96]!==d?(W=!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]=W):W=e[97];let ne;return e[98]!==g||e[99]!==B||e[100]!==W?(ne=t.jsxs("div",{className:"confirm-watermark-timing",role:"group","aria-label":g,children:[B,W]}),e[98]=g,e[99]=B,e[100]=W,e[101]=ne):ne=e[101],ne}function xn(i){const e=ce.c(228),{busy:s,state:l,onChange:n,onMediaMetadata:a}=i,[r,u]=ye.useState(0),c=l.identities[l.platform];let p,o,f;e[0]!==c.handle||e[1]!==l.platform?(p=Bl(c.handle),o=Qt[l.platform],f=Wl(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=Pt(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=Pt(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?dt(r/m*100,0,100):0,e[23]=r,e[24]=m,e[25]=v):v=e[25];const _=v;let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"Preview"}),e[26]=$):$=e[26];let A;e[27]!==r?(A=Mt(r),e[27]=r,e[28]=A):A=e[28];let N;e[29]!==m?(N=m>0?Mt(m):"—",e[29]=m,e[30]=N):N=e[30];let E;e[31]!==A||e[32]!==N?(E=t.jsxs("div",{className:"confirm-section-heading",children:[$,t.jsxs("strong",{children:[A," / ",N]})]}),e[31]=A,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(Dt,{busy:s,currentTime:r,duration:m,endSeconds:l.qrEndSeconds,idPrefix:"watermark-qr-timing",label:"QR",playhead:_,startSeconds:l.qrStartSeconds,onChange:(P,fe)=>n({qrStartSeconds:P,qrEndSeconds:fe})}),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 M;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?(M=l.includeHandle&&t.jsx(Dt,{busy:s,currentTime:r,duration:m,endSeconds:l.handleEndSeconds,idPrefix:"watermark-handle-timing",label:"Handle",playhead:_,startSeconds:l.handleStartSeconds,onChange:(P,fe)=>n({handleStartSeconds:P,handleEndSeconds:fe})}),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]=M):M=e[51];let D;e[52]!==I||e[53]!==M?(D=t.jsxs("div",{className:"confirm-watermark-timings",children:[I,M]}),e[52]=I,e[53]=M,e[54]=D):D=e[54];const L=`${w} / ${b}`,z=w/b;let se;e[55]!==L||e[56]!==z?(se={aspectRatio:L,"--watermark-preview-ratio":z},e[55]=L,e[56]=z,e[57]=se):se=e[57];const G=se;let F;e[58]!==a||e[59]!==l.mediaUrl||e[60]!==l.thumbnailUrl?(F=l.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:P=>{const fe=P.currentTarget;Number.isFinite(fe.duration)&&fe.duration>0&&fe.videoWidth>0&&fe.videoHeight>0&&a({durationSeconds:fe.duration,width:fe.videoWidth,height:fe.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]=F):F=e[61];let Z;e[62]!==b||e[63]!==k||e[64]!==w||e[65]!==j||e[66]!==l.includeQr?(Z=l.includeQr&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-qr",style:{...hn(k,w,b),opacity:j},"aria-hidden":"true",children:t.jsx(cn,{})}),e[62]=b,e[63]=k,e[64]=w,e[65]=j,e[66]=l.includeQr,e[67]=Z):Z=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:{...fn(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:pn(l.handlePadding,l.handlePaddingY,l.handleRounding),children:[l.includePlatformIcon&&t.jsx(dn,{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 ae;e[87]!==G||e[88]!==F||e[89]!==Z||e[90]!==T||e[91]!==U?(ae=t.jsxs("div",{className:"watermark-video-stage",style:G,children:[F,Z,T,U]}),e[87]=G,e[88]=F,e[89]=Z,e[90]=T,e[91]=U,e[92]=ae):ae=e[92];let re;e[93]!==D||e[94]!==ae||e[95]!==E?(re=t.jsxs("section",{className:"confirm-section confirm-watermark-preview","aria-label":"Preview",children:[E,D,ae]}),e[93]=D,e[94]=ae,e[95]=E,e[96]=re):re=e[96];let ee;e[97]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("span",{className:"confirm-section-label",children:"Identity"}),e[97]=ee):ee=e[97];let de;e[98]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("span",{children:"Platform"}),e[98]=de):de=e[98];const ie=l.platform;let te;e[99]!==n?(te=P=>{const fe=P.target.value;ls(fe)&&n({platform:fe})},e[99]=n,e[100]=te):te=e[100];let pe;e[101]===Symbol.for("react.memo_cache_sentinel")?(pe=ss.map(gn),e[101]=pe):pe=e[101];let le;e[102]!==s||e[103]!==l.platform||e[104]!==te?(le=t.jsxs("label",{className:"confirm-field",children:[de,t.jsx("select",{value:ie,disabled:s,onChange:te,children:pe})]}),e[102]=s,e[103]=l.platform,e[104]=te,e[105]=le):le=e[105];const me=l.includeHandle&&!l.includeQr;let H;e[106]!==n?(H=P=>n({includeHandle:P}),e[106]=n,e[107]=H):H=e[107];let xe;e[108]!==s||e[109]!==l.includeHandle||e[110]!==me||e[111]!==H?(xe=t.jsx(ut,{busy:s,checked:l.includeHandle,description:"Centered account badge",disabled:me,label:"Include handle",onChange:H}),e[108]=s,e[109]=l.includeHandle,e[110]=me,e[111]=H,e[112]=xe):xe=e[112];let K;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?(K=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]=K):K=e[122];const ue=l.includeQr&&!l.includeHandle;let Y;e[123]!==n?(Y=P=>n({includeQr:P,...P?{}:{handlePlacement:"center"}}),e[123]=n,e[124]=Y):Y=e[124];let he;e[125]!==s||e[126]!==l.includeQr||e[127]!==ue||e[128]!==Y?(he=t.jsx(ut,{busy:s,checked:l.includeQr,description:"Separately placed scannable link",disabled:ue,label:"Include QR code",onChange:Y}),e[125]=s,e[126]=l.includeQr,e[127]=ue,e[128]=Y,e[129]=he):he=e[129];let X;e[130]!==s||e[131]!==g||e[132]!==n||e[133]!==l.includeQr||e[134]!==l.url||e[135]!==d?(X=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]=X):X=e[136];let Q;e[137]!==s||e[138]!==n||e[139]!==l.includeHandle||e[140]!==l.saveDefault?(Q=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]=Q):Q=e[141];let q;e[142]!==le||e[143]!==xe||e[144]!==K||e[145]!==he||e[146]!==X||e[147]!==Q?(q=t.jsxs("section",{className:"confirm-section","aria-label":"Identity",children:[ee,le,xe,K,he,X,Q]}),e[142]=le,e[143]=xe,e[144]=K,e[145]=he,e[146]=X,e[147]=Q,e[148]=q):q=e[148];let B;e[149]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"confirm-section-label",children:"Appearance"}),e[149]=B):B=e[149];let W;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?(W=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsx(ut,{busy:s,checked:l.includePlatformIcon,description:`${o} mark before the handle`,label:`Show ${o} icon`,onChange:P=>n({includePlatformIcon:P})}),t.jsx(ut,{busy:s,checked:l.includeHandleBorder,description:"Outline around the pill",label:"Handle border",onChange:P=>n({includeHandleBorder:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-padding-x",label:"Handle padding X",min:_t,max:kt,output:`${l.handlePadding}px`,value:l.handlePadding,onChange:P=>n({handlePadding:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-padding-y",label:"Handle padding Y",min:_t,max:kt,output:`${l.handlePaddingY}px`,value:l.handlePaddingY,onChange:P=>n({handlePaddingY:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-rounding",label:"Corner rounding",min:Gl,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]=W):W=e[159];let ne;e[160]!==s||e[161]!==n||e[162]!==l.includeQr||e[163]!==l.qrOpacity?(ne=l.includeQr&&t.jsx(nt,{busy:s,id:"watermark-qr-opacity",label:"QR opacity",min:$t*100,max:Et*100,output:`${mt(l.qrOpacity)}%`,value:mt(l.qrOpacity),onChange:P=>n({qrOpacity:P/100})}),e[160]=s,e[161]=n,e[162]=l.includeQr,e[163]=l.qrOpacity,e[164]=ne):ne=e[164];let J;e[165]!==s||e[166]!==n||e[167]!==l.handleOpacity||e[168]!==l.includeHandle?(J=l.includeHandle&&t.jsx(nt,{busy:s,id:"watermark-handle-opacity",label:"Handle opacity",min:$t*100,max:Et*100,output:`${mt(l.handleOpacity)}%`,value:mt(l.handleOpacity),onChange:P=>n({handleOpacity:P/100})}),e[165]=s,e[166]=n,e[167]=l.handleOpacity,e[168]=l.includeHandle,e[169]=J):J=e[169];let ve;e[170]!==l.fadeSeconds?(ve=mn(l.fadeSeconds),e[170]=l.fadeSeconds,e[171]=ve):ve=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 ge;e[174]!==n?(ge=P=>n({fadeSeconds:P/10}),e[174]=n,e[175]=ge):ge=e[175];let be;e[176]!==s||e[177]!==ve||e[178]!==je||e[179]!==ge?(be=t.jsx(nt,{busy:s,id:"watermark-fade",label:"Fade in/out",min:is*10,max:ns*10,output:ve,value:je,onChange:ge}),e[176]=s,e[177]=ve,e[178]=je,e[179]=ge,e[180]=be):be=e[180];let Ne;e[181]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("small",{className:"confirm-help",children:"Fades only where a watermark starts or ends inside the clip."}),e[181]=Ne):Ne=e[181];let we;e[182]!==W||e[183]!==ne||e[184]!==J||e[185]!==be?(we=t.jsxs("section",{className:"confirm-section","aria-label":"Appearance",children:[B,W,ne,J,be,Ne]}),e[182]=W,e[183]=ne,e[184]=J,e[185]=be,e[186]=we):we=e[186];let Se;e[187]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("span",{className:"confirm-section-label",children:"Position"}),e[187]=Se):Se=e[187];let Ce;e[188]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("span",{children:"QR position"}),e[188]=Ce):Ce=e[188];const oe=`confirm-chip${l.position==="auto"?" active":""}`,Te=l.position==="auto",_e=s||!l.includeQr;let Ee;e[189]!==n?(Ee=()=>n({position:"auto"}),e[189]=n,e[190]=Ee):Ee=e[190];let Ie;e[191]!==oe||e[192]!==Te||e[193]!==_e||e[194]!==Ee?(Ie=t.jsxs("div",{className:"confirm-watermark-qr-position-heading",children:[Ce,t.jsx("button",{type:"button",className:oe,"aria-pressed":Te,disabled:_e,onClick:Ee,children:"Auto"})]}),e[191]=oe,e[192]=Te,e[193]=_e,e[194]=Ee,e[195]=Ie):Ie=e[195];let Le;e[196]!==s||e[197]!==n||e[198]!==l.includeQr||e[199]!==l.position?(Le=Kl.map(P=>t.jsx("button",{type:"button",className:l.position===P?"active":"","aria-label":Lt[P],"aria-pressed":l.position===P,title:Lt[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]=Le):Le=e[200];let Me;e[201]!==Le?(Me=t.jsx("div",{className:"confirm-position-grid",role:"group","aria-label":"QR position",children:Le}),e[201]=Le,e[202]=Me):Me=e[202];let Oe;e[203]!==Ie||e[204]!==Me?(Oe=t.jsxs("div",{className:"confirm-watermark-qr-position",children:[Ie,Me]}),e[203]=Ie,e[204]=Me,e[205]=Oe):Oe=e[205];let $e;e[206]!==s||e[207]!==n||e[208]!==l.handlePlacement||e[209]!==l.handleVerticalPercent||e[210]!==l.includeHandle||e[211]!==l.includeQr?($e=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:Yl.map(P=>{const Ve=s||P!=="center"&&!l.includeQr;return t.jsx("button",{type:"button",className:l.handlePlacement===P?"active":"","aria-pressed":l.handlePlacement===P,disabled:Ve,onClick:()=>n({handlePlacement:P}),children:on[P]},P)})})]}),l.handlePlacement==="center"&&t.jsx(nt,{busy:s,id:"watermark-handle-vertical",label:"Handle vertical position",min:Jl,max:Xl,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]=$e):$e=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 Ae;e[213]!==Ge?(Ae=t.jsx("small",{className:"confirm-help",children:Ge}),e[213]=Ge,e[214]=Ae):Ae=e[214];let Fe;e[215]!==$e||e[216]!==Ae?(Fe=t.jsxs("div",{className:"confirm-watermark-handle-position",children:[$e,Ae]}),e[215]=$e,e[216]=Ae,e[217]=Fe):Fe=e[217];let Pe;e[218]!==Oe||e[219]!==Fe?(Pe=t.jsxs("section",{className:"confirm-section confirm-watermark-position","aria-label":"Position",children:[Se,Oe,Fe]}),e[218]=Oe,e[219]=Fe,e[220]=Pe):Pe=e[220];let ke;e[221]!==q||e[222]!==we||e[223]!==Pe?(ke=t.jsxs("div",{className:"confirm-watermark-controls",children:[q,we,Pe]}),e[221]=q,e[222]=we,e[223]=Pe,e[224]=ke):ke=e[224];let He;return e[225]!==re||e[226]!==ke?(He=t.jsxs("div",{className:"confirm-watermark",children:[re,ke]}),e[225]=re,e[226]=ke,e[227]=He):He=e[227],He}function gn(i){return t.jsx("option",{value:i,children:Qt[i]},i)}const $n=Object.freeze(Object.defineProperty({__proto__:null,WatermarkBody:xn},Symbol.toStringTag,{value:"Module"}));export{wn as C,Sn as G,En as N,Nn as P,kn as R,Cn as S,$n as W,_n as a,Pn as b};
|
|
1
|
+
import{c as ce,a as ye,j as t}from"./vendor-react-Dj7D1fD4.js";import{b_ as Jt,b$ as Zt,c0 as el,c1 as tl,i as ll,c2 as sl,c3 as nl,c4 as il,c5 as Ot,c6 as Ht,c7 as Ut,c8 as al,c9 as rl,ad as ol,ca as cl,cb as dl,cc as ml,cd as ul,ce as yt,cf as hl,cg as wt,ch as fl,b2 as pl,E as xl,ci as gl,cj as bl,ck as Vt,ae as vl,cl as jl,Y as yl,bG as wl,b3 as Nl,cm as Sl,cn as Cl,co as Pl,cp as Ze,cq as Nt,cr as St,cs as kl,ct as _l,cu as Ct,cv as El,cw as $l,cx as Al,cy as Rl,cz as Tl,cA as Il,cB as Ll,bc as Fl,cC as Ml,x as Dl,cD as Ol,cE as Hl,cF as Ul,cG as Vl,cH as Ql,cI as ql,cJ as Bl,cK as Qt,cL as Wl,cM as Pt,cN as kt,cO as _t,cP as zl,cQ as Gl,cR as Et,cS as $t,cT as Kl,cU as Yl,cV as Xl,cW as Jl,cX as Zl,cY as gt,cZ as es,c_ as qt,c$ as ts,d0 as ls,d1 as ss,d2 as ns,d3 as is}from"./videobook-lhLK6e6Q.js";import{P as as,I as rs,G as At,V as os,a as cs,D as ds,R as ms,M as us}from"./ui-CtYXY_po.js";import{F as Bt,ac as jt,c as bt,x as Wt,g as hs,h as fs,X as zt,m as ps,i as xs,k as gs,w as bs,V as vs,ai as js,ad as ys,_ as Rt}from"./vendor-icons-CGqhCIXV.js";function wn(i){const e=ce.c(40),{review:s,onChange:l,disabled:n}=i,a=ye.useRef(null),r=ye.useRef(null),u=ye.useRef(!1),[c,p]=ye.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?Jt(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],ye.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 $;e[34]!==v||e[35]!==_?($=t.jsxs("div",{className:"cold-open-controls",children:[v,_]}),e[34]=v,e[35]=_,e[36]=$):$=e[36];let A;return e[37]!==$||e[38]!==b?(A=t.jsxs("div",{className:"cold-open-review-body",children:[b,$]}),e[37]=$,e[38]=b,e[39]=A):A=e[39],A}const ws={en:"EN",th:"TH · ไทย"};function Ns(i){if(!i)return"Media details unavailable";const e=[i.duration?ol(i.duration):null,i.width&&i.height?`${i.width}×${i.height}`:null].filter(Boolean);return e.length?e.join(" · "):i.type}function Ss(i){const e=ce.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(Bt,{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=Ns(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(jt,{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(bt,{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(bt,{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 Cs(i){const e=ce.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=ml.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=ul.map(h=>t.jsx("button",{type:"button","aria-pressed":r.language===h,disabled:l,onClick:()=>a(h),children:ws[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 Ps(i){const e=ce.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(yt(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(hs,{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(yt(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(fs,{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 ks(i){const e=ce.c(37),{copy:s,disabled:l,onCopyChange:n}=i,[a,r]=ye.useState("");let u,c,p,o,f,d,m,h;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==n){h=Ot(s)?.tags??[];let y;e[12]!==s||e[13]!==a||e[14]!==n?(y=()=>{a.trim()&&(n(hl(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(wt(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(wt(s,b)),children:t.jsx(zt,{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 _s(i){const e=ce.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=Ut[s.platform],d=Ht[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(Wt,{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=cl.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 Es(i){const e=ce.c(84),{post:s,review:l,busy:n,onCopyChange:a,onLanguage:r,onRegen:u}=i;let c;e[0]!==s?(c=nl(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 z=il(o);let se;e[18]!==o?(se=Ot(o),e[18]=o,e[19]=se):se=e[19],b=se;const G=b&&b.origin!=="saved"&&b.origin!=="edited";m="post-delivery-caption";const F=d||!!o.drafting;e[20]!==a||e[21]!==r||e[22]!==l||e[23]!==F?(h=t.jsx(Cs,{review:l,disabled:F,onCopyChange:a,onLanguage:r}),e[20]=a,e[21]=r,e[22]=l,e[23]=F,e[24]=h):h=e[24],k="post-delivery-label-row";let Z;e[25]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("label",{htmlFor:"post-delivery-caption",children:"Caption"}),e[25]=Z):Z=e[25];let T;e[26]!==G?(T=G&&t.jsxs("span",{className:"post-copy-badge",children:[t.jsx(Wt,{size:10,"aria-hidden":"true"}),"Auto · from video analysis"]}),e[26]=G,e[27]=T):T=e[27],e[28]!==T?(w=t.jsxs("span",{className:"post-copy-caption-label",children:[Z,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(Ps,{copy:o,disabled:U,onCopyChange:a}),e[30]=o,e[31]=a,e[32]=U,e[33]=y):y=e[33],x=z.over||z.length>dl?"confirm-field-error":void 0,g=z.length.toLocaleString(),S=" / ",j=z.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 $;e[43]!==_||e[44]!==k||e[45]!==w?($=t.jsxs("div",{className:k,children:[w,_]}),e[43]=_,e[44]=k,e[45]=w,e[46]=$):$=e[46];let A;e[47]!==n||e[48]!==o||e[49]!==f||e[50]!==p||e[51]!==a||e[52]!==s||e[53]!==b?.body?(A=f?t.jsxs("div",{className:"post-copy-drafting",role:"status",children:["Astra is writing the ",Ht[o.language]," caption for ",Ut[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:z=>a(al(o,{body:z.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]=A):A=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(ks,{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.":`${rl(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 M;e[67]!==I?(M=t.jsx("small",{children:I}),e[67]=I,e[68]=M):M=e[68];let D;e[69]!==n||e[70]!==o||e[71]!==p||e[72]!==a||e[73]!==u?(D=!p&&t.jsx(_s,{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]!==$||e[78]!==A||e[79]!==N||e[80]!==E||e[81]!==M||e[82]!==D?(L=t.jsxs("div",{className:m,children:[h,$,A,N,E,M,D]}),e[75]=m,e[76]=h,e[77]=$,e[78]=A,e[79]=N,e[80]=E,e[81]=M,e[82]=D,e[83]=L):L=e[83],L}function $s(i){const e=ce.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(bt,{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 As(i){return i.trim().replace(/\/+$/u,"")||"…"}function Nn(i){const e=ce.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?Zt(i.review.icloudFolder):el(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=tl(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?ll(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(Ss,{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(Es,{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(jt,{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:A=>i.onFolderChange(A.target.value)}),t.jsxs("small",{children:["Appears on iPhone in Files › Shared › Videobook › ",As(l)]})]}):t.jsxs(t.Fragment,{children:[t.jsx($s,{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:A=>i.onFolderChange(A.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=sl(i.post)&&t.jsx(as,{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 $;return e[61]!==_||e[62]!==f||e[63]!==d?($=t.jsxs("div",{className:"post-delivery-body",children:[f,d,_]}),e[61]=_,e[62]=f,e[63]=d,e[64]=$):$=e[64],$}const Rs=new Map;function Ts(i){const e=i.cell.inputs;return e&&typeof e.generationMode=="string"?e.generationMode:""}function Is(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 Vt(e).urlPlaceholders){const n=s.get(l.reference);n&&s.set(l.url,n)}return s}function Tt(i){const e=ce.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(us,{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 Sn(i){const e=ce.c(226),{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:$,onSettingChange:A}=i,N=S===void 0?!1:S,E=j===void 0?"":j,[I,M]=ye.useState(!1);let D;e[0]!==n?(D=fl(n),e[0]=n,e[1]=D):D=e[1];const L=D;let z;e[2]!==n.cell.inputs?(z=n.cell.inputs??{},e[2]=n.cell.inputs,e[3]=z):z=e[3];let se;e[4]!==n.action.model||e[5]!==z?(se=pl(n.action.model,z),e[4]=n.action.model,e[5]=z,e[6]=se):se=e[6];const G=se,F=xl();let Z;e[7]!==d?(Z=()=>{d&&d.ensureLoaded().catch(qs)},e[7]=d,e[8]=Z):Z=e[8];const T=Z;let U;e[9]!==d?(U=()=>{d&&d.refresh().catch(Qs)},e[9]=d,e[10]=U):U=e[10];const ae=U;let re;e[11]!==n.action.controls||e[12]!==n.cell.type?(re=n.cell.type==="generate_audio"?n.action.controls.find(Vs):void 0,e[11]=n.action.controls,e[12]=n.cell.type,e[13]=re):re=e[13];const ee=re;let de;e[14]!==d?.voices||e[15]!==ee?(de=ee?d?.voices??[]:[],e[14]=d?.voices,e[15]=ee,e[16]=de):de=e[16];const ie=de,te=ie.length>0,pe=typeof L.voice_id=="string"?L.voice_id:"";let le;e[17]!==n.action.model?(le=gl(n.action.model),e[17]=n.action.model,e[18]=le):le=e[18];const me=le;let H,xe,K,ue,Y,he,X,Q,q,B,W;if(e[19]!==s||e[20]!==l||e[21]!==g||e[22]!==C||e[23]!==n||e[24]!==T||e[25]!==G||e[26]!==x||e[27]!==me||e[28]!==a||e[29]!==E||e[30]!==y||e[31]!==k||e[32]!==w||e[33]!==b||e[34]!==_||e[35]!==$||e[36]!==A||e[37]!==r||e[38]!==u||e[39]!==c||e[40]!==F||e[41]!==p||e[42]!==m||e[43]!==h||e[44]!==ae||e[45]!==pe||e[46]!==L||e[47]!==I||e[48]!==te||e[49]!==f||e[50]!==N||e[51]!==o||e[52]!==d||e[53]!==ee||e[54]!==ie){const we=me?n.action.controls.filter(Us):n.action.controls,Se=te?n.action.controls.filter(Hs):we,Ce=Se.filter(Os),oe=Se.filter(Ds);let Te;e[66]!==r?(Te=wl(r),e[66]=r,e[67]=Te):Te=e[67];const _e=Te;let Ee;e[68]!==r||e[69]!==o?(Ee=Is(o,r),e[68]=r,e[69]=o,e[70]=Ee):Ee=e[70];const Ie=Ee;H=bl(r);const Le=p?[]:Vt(r).promptLeaks;let Me;e[71]!==n.action.model||e[72]!==n.action.provider||e[73]!==n.action.tool||e[74]!==n.cell.inputs||e[75]!==n.cell.prompt||e[76]!==_e?(Me=_e??{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[71]=n.action.model,e[72]=n.action.provider,e[73]=n.action.tool,e[74]=n.cell.inputs,e[75]=n.cell.prompt,e[76]=_e,e[77]=Me):Me=e[77];const Oe=Me;let $e;e[78]!==n.cell||e[79]!==E||e[80]!==N?($e=N?vl(E,n.cell).length:0,e[78]=n.cell,e[79]=E,e[80]=N,e[81]=$e):$e=e[81];const Ge=$e;he="confirm-generation",X=N?"source":"form";let Ae;e[82]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("span",{className:"confirm-section-label",children:"Inputs"}),e[82]=Ae):Ae=e[82];let Fe;if(e[83]!==l||e[84]!==_||e[85]!==$||e[86]!==o){let O;e[88]!==l||e[89]!==_||e[90]!==$?(O=ze=>t.jsxs("div",{className:"generation-review-source-wrap",children:[t.jsx(Tt,{badge:"Input",busy:l,source:ze,title:`Select @${ze.address} on the board`,onClick:()=>$(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(zt,{size:11,"aria-hidden":"true"})})]},`${ze.cellId}:${ze.targetInput??""}`),e[88]=l,e[89]=_,e[90]=$,e[91]=O):O=e[91],Fe=o.map(O),e[83]=l,e[84]=_,e[85]=$,e[86]=o,e[87]=Fe}else Fe=e[87];let Pe;e[92]!==o.length?(Pe=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[92]=o.length,e[93]=Pe):Pe=e[93];let ke;e[94]!==l||e[95]!==I||e[96]!==f.length?(ke=f.length>0&&t.jsxs("button",{type:"button",className:"generation-review-source-add",disabled:l,"aria-expanded":I,onClick:()=>M(Ms),children:[t.jsx(ps,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:"Add input"})]}),e[94]=l,e[95]=I,e[96]=f.length,e[97]=ke):ke=e[97];let He;e[98]!==Fe||e[99]!==Pe||e[100]!==ke?(He=t.jsxs("div",{className:"generation-review-sources",children:[Fe,Pe,ke]}),e[98]=Fe,e[99]=Pe,e[100]=ke,e[101]=He):He=e[101];let P;e[102]!==l||e[103]!==k||e[104]!==I||e[105]!==f?(P=I&&f.length>0&&t.jsx("div",{className:"generation-review-sources generation-review-source-options","aria-label":"Available input cells",children:f.map(O=>t.jsx(Tt,{badge:"Add",busy:l,source:O,title:`Add @${O.address} as ${O.targetLabel??"input"}`,onClick:()=>{k(O.cellId,O.targetInput),M(!1)}},`${O.cellId}:${O.targetInput??""}`))}),e[102]=l,e[103]=k,e[104]=I,e[105]=f,e[106]=P):P=e[106],e[107]!==x||e[108]!==He||e[109]!==P?(Q=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Inputs",children:[Ae,He,P,x]}),e[107]=x,e[108]=He,e[109]=P,e[110]=Q):Q=e[110];const fe=N===!0;let Ve;e[111]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("span",{className:"confirm-section-label",children:"Model"}),e[111]=Ve):Ve=e[111];const et=n.action.id,Je=l||s.length===0;let Ke;e[112]!==y?(Ke=O=>y(O.target.value),e[112]=y,e[113]=Ke):Ke=e[113];let Ye;e[114]!==s?(Ye=s.map(Fs),e[114]=s,e[115]=Ye):Ye=e[115];let Qe;e[116]!==n.action.id||e[117]!==Je||e[118]!==Ke||e[119]!==Ye?(Qe=t.jsxs("label",{children:[Ve,t.jsx("select",{"aria-label":"Generation model",value:et,disabled:Je,onChange:Ke,children:Ye})]}),e[116]=n.action.id,e[117]=Je,e[118]=Ke,e[119]=Ye,e[120]=Qe):Qe=e[120];let qe;e[121]!==l||e[122]!==g||e[123]!==n||e[124]!==a||e[125]!==w?(qe=a.length>1&&t.jsxs("label",{children:[t.jsx("span",{className:"confirm-section-label",children:"Type"}),t.jsx("select",{"aria-label":"Generation type",value:Ts(n),disabled:l,onChange:O=>w(O.target.value),children:a.map(O=>t.jsxs("option",{value:O.id,children:[jl(O.id),g&&!g.has(O.id)?" · check inputs":""]},O.id))})]}),e[121]=l,e[122]=g,e[123]=n,e[124]=a,e[125]=w,e[126]=qe):qe=e[126];let Be;e[127]!==Qe||e[128]!==qe?(Be=t.jsxs("section",{className:"generation-review-model-section","aria-label":"Model",children:[Qe,qe]}),e[127]=Qe,e[128]=qe,e[129]=Be):Be=e[129];let We;e[130]!==l||e[131]!==n.action.controls||e[132]!==me||e[133]!==A||e[134]!==L||e[135]!==o?(We=me&&t.jsx(rs,{sources:o,settings:L,controls:n.action.controls,busy:l,onChange:A}),e[130]=l,e[131]=n.action.controls,e[132]=me,e[133]=A,e[134]=L,e[135]=o,e[136]=We):We=e[136];let Xe;e[137]!==G?(Xe=G&&t.jsx("p",{className:"muted",children:Nl}),e[137]=G,e[138]=Xe):Xe=e[138];let R;e[139]!==l||e[140]!==T||e[141]!==G||e[142]!==A||e[143]!==L?(R=O=>t.jsx(At,{control:O,settings:L,busy:l||O.name==="aspect_ratio"&&!!G,toggleClassName:"generation-review-toggle",onFocus:O.name==="voice_id"?T:void 0,onChange:ze=>A(O.name,ze)},O.name),e[139]=l,e[140]=T,e[141]=G,e[142]=A,e[143]=L,e[144]=R):R=e[144];const V=t.jsxs("div",{className:"generation-review-settings",children:[Ce.map(R),Se.length===0&&t.jsx("span",{className:"generation-review-defaults",children:"Provider defaults"})]}),De=oe.length>0&&t.jsx("div",{className:"generation-review-toggles",children:oe.map(O=>t.jsx(At,{control:O,settings:L,busy:l,toggleClassName:"generation-review-toggle",onChange:ze=>A(O.name,ze)},O.name))});let Re;e[145]!==Xe||e[146]!==V||e[147]!==De?(Re=t.jsxs("section",{className:"generation-review-settings-section","aria-label":"Settings",children:[Xe,V,De]}),e[145]=Xe,e[146]=V,e[147]=De,e[148]=Re):Re=e[148];let Ue;e[149]!==l||e[150]!==A||e[151]!==F||e[152]!==ae||e[153]!==pe||e[154]!==te||e[155]!==d||e[156]!==ee||e[157]!==ie?(Ue=ee&&d&&t.jsxs("section",{className:"generation-review-voice-section","aria-label":"Voice",children:[t.jsx("span",{className:"confirm-section-label",children:"Voice"}),te&&t.jsx("div",{className:"generation-review-voices",role:"listbox","aria-label":"ElevenLabs voices","data-testid":"generation-review-voices",children:t.jsx(os,{voices:ie,selectedVoiceId:pe,playingVoiceId:F.playingVoiceId,disabled:l,onSelect:O=>{yl(O),A("voice_id",O)},onTogglePreview:F.toggle})}),d.loading&&ie.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:ae,children:d.loading?"Loading voices…":d.error?"Retry voices":te?"Refresh voices":"Load voices"}),d?.warning&&t.jsx("small",{children:d.warning})]}),e[149]=l,e[150]=A,e[151]=F,e[152]=ae,e[153]=pe,e[154]=te,e[155]=d,e[156]=ee,e[157]=ie,e[158]=Ue):Ue=e[158];const lt=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(cs,{history:h,disabled:l})]}),t.jsx("textarea",{rows:3,"aria-label":"Prompt",value:n.cell.prompt??"","aria-invalid":Le.length>0,disabled:l,onChange:O=>b(O.target.value),onKeyDown:O=>{h?.handlePromptKeyDown(O)}})]}),st=Le.length>0&&t.jsx("div",{className:"generation-review-reference-errors",role:"alert",children:Le.map(Ls)});let tt;e[159]!==lt||e[160]!==st?(tt=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Prompt",children:[lt,st]}),e[159]=lt,e[160]=st,e[161]=tt):tt=e[161],e[162]!==fe||e[163]!==Be||e[164]!==We||e[165]!==Re||e[166]!==Ue||e[167]!==tt?(q=t.jsxs("div",{className:"confirm-section generation-review-editor",hidden:fe,children:[Be,We,Re,Ue,tt]}),e[162]=fe,e[163]=Be,e[164]=We,e[165]=Re,e[166]=Ue,e[167]=tt,e[168]=q):q=e[168],e[169]!==C||e[170]!==Ge||e[171]!==n.cell||e[172]!==E||e[173]!==N?(B=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 · ",Ge," columns"]})]}),t.jsx("div",{className:"generation-review-dolt",tabIndex:0,"aria-label":"Dolt source preview",children:t.jsx(ds,{notebookId:E,cell:n.cell,artifactAssets:C??Rs,heading:!1})})]}),e[169]=C,e[170]=Ge,e[171]=n.cell,e[172]=E,e[173]=N,e[174]=B):B=e[174];const ft=N?"MCP payload":"Payload",pt=N?"MCP payload":"Payload";let it;e[175]!==pt?(it=t.jsx("span",{children:pt}),e[175]=pt,e[176]=it):it=e[176];let at;e[177]!==c||e[178]!==p?(at=(p||c)&&t.jsx("small",{className:"generation-review-json-stale",role:"status",children:"Updating…"}),e[177]=c,e[178]=p,e[179]=at):at=e[179];let rt;e[180]!==it||e[181]!==at?(rt=t.jsxs("div",{className:"confirm-section-heading",children:[it,at]}),e[180]=it,e[181]=at,e[182]=rt):rt=e[182];const xt=N?"MCP payload preview":"Generation payload preview";let ot;e[183]!==Ie||e[184]!==u||e[185]!==Oe||e[186]!==c||e[187]!==_e?.payload||e[188]!==N?(ot=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(ms,{value:N?Oe:_e?.payload??null,ariaLabel:N?"MCP payload JSON":"Generation payload JSON",artifactAssets:Ie,mediaDisplay:"preview"}),e[183]=Ie,e[184]=u,e[185]=Oe,e[186]=c,e[187]=_e?.payload,e[188]=N,e[189]=ot):ot=e[189];let ct;e[190]!==c||e[191]!==xt||e[192]!==ot?(ct=t.jsx("div",{className:"generation-review-json",tabIndex:0,"aria-label":xt,"aria-busy":c,children:ot}),e[190]=c,e[191]=xt,e[192]=ot,e[193]=ct):ct=e[193],e[194]!==ft||e[195]!==rt||e[196]!==ct?(W=t.jsxs("section",{className:"confirm-section generation-review-source-section","aria-label":ft,children:[rt,ct]}),e[194]=ft,e[195]=rt,e[196]=ct,e[197]=W):W=e[197],K="confirm-section generation-review-estimate-section",ue="Estimate",e[198]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[198]=Y):Y=e[198],xe=c||p?"…":!u&&H.usd!==null&&!H.unknown?`$${H.usd.toFixed(H.usd<.01?4:2)}`:"—",e[19]=s,e[20]=l,e[21]=g,e[22]=C,e[23]=n,e[24]=T,e[25]=G,e[26]=x,e[27]=me,e[28]=a,e[29]=E,e[30]=y,e[31]=k,e[32]=w,e[33]=b,e[34]=_,e[35]=$,e[36]=A,e[37]=r,e[38]=u,e[39]=c,e[40]=F,e[41]=p,e[42]=m,e[43]=h,e[44]=ae,e[45]=pe,e[46]=L,e[47]=I,e[48]=te,e[49]=f,e[50]=N,e[51]=o,e[52]=d,e[53]=ee,e[54]=ie,e[55]=H,e[56]=xe,e[57]=K,e[58]=ue,e[59]=Y,e[60]=he,e[61]=X,e[62]=Q,e[63]=q,e[64]=B,e[65]=W}else H=e[55],xe=e[56],K=e[57],ue=e[58],Y=e[59],he=e[60],X=e[61],Q=e[62],q=e[63],B=e[64],W=e[65];let ne;e[199]!==xe?(ne=t.jsx("strong",{children:xe}),e[199]=xe,e[200]=ne):ne=e[200];let J;e[201]!==H.currency?(J=t.jsx("span",{children:H.currency}),e[201]=H.currency,e[202]=J):J=e[202];const ve=c||p?"Updating estimate…":u||H.unknown||H.usd===null?"Cost estimate unavailable":"Estimated provider cost";let je;e[203]!==ve?(je=t.jsx("small",{children:ve}),e[203]=ve,e[204]=je):je=e[204];let ge;e[205]!==l||e[206]!==v||e[207]!==u||e[208]!==c?(ge=u&&t.jsxs("button",{type:"button",disabled:l||c,onClick:v,children:[t.jsx(gs,{size:10,"aria-hidden":"true"}),"Retry preview"]}),e[205]=l,e[206]=v,e[207]=u,e[208]=c,e[209]=ge):ge=e[209];let be;e[210]!==K||e[211]!==ue||e[212]!==Y||e[213]!==ne||e[214]!==J||e[215]!==je||e[216]!==ge?(be=t.jsxs("section",{className:K,"aria-label":ue,children:[Y,ne,J,je,ge]}),e[210]=K,e[211]=ue,e[212]=Y,e[213]=ne,e[214]=J,e[215]=je,e[216]=ge,e[217]=be):be=e[217];let Ne;return e[218]!==he||e[219]!==X||e[220]!==Q||e[221]!==q||e[222]!==B||e[223]!==W||e[224]!==be?(Ne=t.jsxs("div",{className:he,"data-view":X,children:[Q,q,B,W,be]}),e[218]=he,e[219]=X,e[220]=Q,e[221]=q,e[222]=B,e[223]=W,e[224]=be,e[225]=Ne):Ne=e[225],Ne}function Ls(i){return t.jsxs("span",{title:i.message,children:[t.jsx(xs,{size:12,"aria-hidden":"true"}),t.jsx("code",{children:i.token}),i.message]},`${i.token}:${i.code}`)}function Fs(i){return t.jsxs("option",{value:i.id,children:[i.title," · ",i.providerLabel]},i.id)}function Ms(i){return!i}function Ds(i){return i.kind==="boolean"}function Os(i){return i.kind!=="boolean"}function Hs(i){return i.name!=="voice_id"}function Us(i){return!["start_time","resume_time","duration"].includes(i.name)}function Vs(i){return i.name==="voice_id"}function Qs(){}function qs(){}function It(i){const e=ce.c(28),{label:s,mediaUrl:l,muted:n,playbackRate:a,windows:r}=i,u=ye.useRef(null),c=ye.useRef(null),p=ye.useRef(0);let o;e[0]!==r?(o=r.map(Gs).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(zs);p.current=0;const _=v[0]?.startSeconds??0,$=()=>{b.currentTime=_,c.current=_,b.playbackRate=a,b.play().catch(Ws)};let A=0,N,E=!1;const I=()=>{N!==void 0&&typeof b.cancelVideoFrameCallback=="function"&&(b.cancelVideoFrameCallback(N),N=void 0),A&&(cancelAnimationFrame(A),A=0)},M=()=>{if(E)return;const L=Al({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(Bs)):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(()=>M());return}A=requestAnimationFrame(()=>M())}};return b.readyState>=HTMLMediaElement.HAVE_METADATA?$():b.addEventListener("loadedmetadata",$,{once:!0}),D(),()=>{E=!0,I(),b.removeEventListener("loadedmetadata",$)}},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],ye.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]),ye.useEffect(h,x);let g;e[12]!==r?(g=r[0]?`${Ze(r[0].startSeconds)}–${Ze(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 Bs(){}function Ws(){}function zs(i){const[e,s]=i.split(":").map(Number);return Number.isFinite(e)&&Number.isFinite(s)&&s>e?[{startSeconds:e,endSeconds:s}]:[]}function Gs(i){return`${i.startSeconds}:${i.endSeconds}`}const Ks=[-1,-.1,-.01,.01,.1,1],Ys=[-1,-.1,.1,1];function Cn(i){const e=ce.c(178),{cutPointsSeconds:s,mediaUrl:l,onChange:n,outputMode:a,selectedIndex:r,sourceDurationSeconds:u,sourceFps:c}=i,p=ye.useRef(null),[o,f]=ye.useState(!1),[d,m]=ye.useState("in"),[h,x]=ye.useState(null),[g,S]=ye.useState(null),[j,C]=ye.useState(null),[y,k]=ye.useState(null);let w;e[0]!==s||e[1]!==u?(w=Sl({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?(_=_l(c),e[3]=c,e[4]=_):_=e[4];const $=_;let A;e[5]!==v||e[6]!==u?(A=v?Cl({segment:v,sourceDurationSeconds:u}):{segment:{startSeconds:0,endSeconds:0},surroundings:[]},e[5]=v,e[6]=u,e[7]=A):A=e[7];const N=A,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 M=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 z;e[14]!==E||e[15]!==v?.durationSeconds||e[16]!==y?(z=y?.key===E?y.value:Pl(v?.durationSeconds??1),e[14]=E,e[15]=v?.durationSeconds,e[16]=y,e[17]=z):z=e[17];const se=z;let G;e[18]!==n||e[19]!==a?(G=R=>{C(null),x(null),S(null),n({cutPointsSeconds:R.cutPointsSeconds,outputMode:R.outputMode??a,selectedIndex:R.selectedIndex})},e[18]=n,e[19]=a,e[20]=G):G=e[20];const F=G;let Z;e[21]!==F?(Z=R=>{x(null),S(null),F(R)},e[21]=F,e[22]=Z):Z=e[22];const T=Z;let U;e[23]!==T||e[24]!==s||e[25]!==r||e[26]!==u?(U=R=>{T(Nt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[23]=T,e[24]=s,e[25]=r,e[26]=u,e[27]=U):U=e[27];const ae=U;let re;e[28]!==T||e[29]!==s||e[30]!==r||e[31]!==u?(re=R=>{T(St({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[28]=T,e[29]=s,e[30]=r,e[31]=u,e[32]=re):re=e[32];const ee=re;let de;e[33]!==T||e[34]!==s||e[35]!==v||e[36]!==r||e[37]!==u?(de=(R,V)=>{if(!v)return;const De=Math.round(Number(R)*1e3)/1e3,Re=Math.round(Number(V)*1e3)/1e3;if(!Number.isFinite(De)||!Number.isFinite(Re)){C("Enter start and end times in seconds");return}const Ue=Ct({cutPointsSeconds:s,endSeconds:Re,index:r,sourceDurationSeconds:u,startSeconds:De});if(Ue.cutPointsSeconds.length===s.length&&Ue.cutPointsSeconds.every((lt,st)=>lt===s[st])&&(De!==v.startSeconds||Re!==v.endSeconds)){C(`Choose a range from ${Ze(v.startSeconds)} that stays inside neighbouring pieces`),x(null),S(null);return}T(Ue)},e[33]=T,e[34]=s,e[35]=v,e[36]=r,e[37]=u,e[38]=de):de=e[38];const ie=de;let te;e[39]!==T||e[40]!==s||e[41]!==v||e[42]!==r||e[43]!==u?(te=R=>{const V=p.current?.currentTime;!v||typeof V!="number"||!Number.isFinite(V)||T(Ct({cutPointsSeconds:s,endSeconds:R==="out"?V:v.endSeconds,index:r,sourceDurationSeconds:u,startSeconds:R==="in"?V:v.startSeconds}))},e[39]=T,e[40]=s,e[41]=v,e[42]=r,e[43]=u,e[44]=te):te=e[44];const pe=te;let le;e[45]!==d||e[46]!==ae||e[47]!==ee?(le=R=>{if(R.key!=="ArrowLeft"&&R.key!=="ArrowRight"||R.target instanceof HTMLInputElement)return;R.preventDefault();const V=R.key==="ArrowLeft"?-1:1,De=R.altKey?.01:R.shiftKey?1:.1;d==="out"?ee(V*De):ae(V*De)},e[45]=d,e[46]=ae,e[47]=ee,e[48]=le):le=e[48];const me=le,H=se?.25:1,xe=a==="remove"?"JOIN PREVIEW":"SURROUNDINGS";let K;e[49]!==a||e[50]!==b.length||e[51]!==v?(K=v?a==="all"?`Apply creates ${b.length} cells`:a==="keep"?`Apply creates 1 cell: ${Ze(v.startSeconds)}-${Ze(v.endSeconds)}`:`Apply creates 1 cell without ${Ze(v.startSeconds)}-${Ze(v.endSeconds)}`:"",e[49]=a,e[50]=b.length,e[51]=v,e[52]=K):K=e[52];const ue=K;let Y;e[53]!==s||e[54]!==$||e[55]!==r?(Y=(R,V,De)=>t.jsxs("div",{className:"confirm-split-nudges",children:[Ks.map(Re=>{const Ue=De(Re),lt=Ue.cutPointsSeconds.every((st,tt)=>st===s[tt])&&Ue.selectedIndex===r;return t.jsxs("button",{type:"button",disabled:lt,onFocus:()=>m(R),onClick:()=>V(Re),children:[Re>0?"+":"−",Math.abs(Re),"s"]},`${R}:${Re}`)}),$!==null&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Previous frame",title:"Previous frame",onFocus:()=>m(R),onClick:()=>V(-$),children:"◂"}),t.jsx("button",{type:"button","aria-label":"Next frame",title:"Next frame",onFocus:()=>m(R),onClick:()=>V($),children:"▸"})]})]}),e[53]=s,e[54]=$,e[55]=r,e[56]=Y):Y=e[56];const he=Y;let X;e[57]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("span",{children:"Source"}),e[57]=X):X=e[57];let Q;e[58]!==u?(Q=Ze(u),e[58]=u,e[59]=Q):Q=e[59];let q;e[60]!==Q?(q=t.jsxs("div",{className:"confirm-section-heading",children:[X,t.jsxs("strong",{children:[Q," total"]})]}),e[60]=Q,e[61]=q):q=e[61];let B;e[62]!==l?(B=t.jsx("video",{ref:p,src:l,controls:!0,playsInline:!0,preload:"metadata"}),e[62]=l,e[63]=B):B=e[63];let W;e[64]!==pe?(W=t.jsx("button",{type:"button",onClick:()=>pe("in"),children:"SET IN HERE"}),e[64]=pe,e[65]=W):W=e[65];let ne;e[66]!==pe?(ne=t.jsx("button",{type:"button",onClick:()=>pe("out"),children:"SET OUT HERE"}),e[66]=pe,e[67]=ne):ne=e[67];let J;e[68]!==W||e[69]!==ne?(J=t.jsxs("div",{className:"confirm-actions-row",children:[W,ne]}),e[68]=W,e[69]=ne,e[70]=J):J=e[70];let ve;e[71]!==q||e[72]!==B||e[73]!==J?(ve=t.jsxs("section",{className:"confirm-section","aria-label":"Source player",children:[q,B,J]}),e[71]=q,e[72]=B,e[73]=J,e[74]=ve):ve=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 ge;if(e[76]!==s||e[77]!==F||e[78]!==b||e[79]!==r){let R;e[81]!==s||e[82]!==F||e[83]!==r?(R=V=>t.jsxs("button",{type:"button",role:"listitem",className:V.index===r?"active":void 0,"aria-pressed":V.index===r,onClick:()=>F({cutPointsSeconds:s,selectedIndex:V.index}),children:[String(V.index+1).padStart(2,"0")," ",Ze(V.startSeconds),"-",Ze(V.endSeconds)]},`${V.startSeconds}:${V.endSeconds}`),e[81]=s,e[82]=F,e[83]=r,e[84]=R):R=e[84],ge=b.map(R),e[76]=s,e[77]=F,e[78]=b,e[79]=r,e[80]=ge}else ge=e[80];let be;e[85]!==ge?(be=t.jsx("div",{className:"confirm-chips",role:"list",children:ge}),e[85]=ge,e[86]=be):be=e[86];const Ne=!v||v.durationSeconds<.04;let we;e[87]!==T||e[88]!==s||e[89]!==r||e[90]!==u?(we=()=>T(El({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[87]=T,e[88]=s,e[89]=r,e[90]=u,e[91]=we):we=e[91];let Se;e[92]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx(bs,{size:12,"aria-hidden":"true"}),e[92]=Se):Se=e[92];let Ce;e[93]!==Ne||e[94]!==we?(Ce=t.jsxs("button",{type:"button",disabled:Ne,onClick:we,children:[Se,"Split piece in half"]}),e[93]=Ne,e[94]=we,e[95]=Ce):Ce=e[95];const oe=r>=b.length-1;let Te;e[96]!==T||e[97]!==s||e[98]!==r||e[99]!==u?(Te=()=>T($l({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[96]=T,e[97]=s,e[98]=r,e[99]=u,e[100]=Te):Te=e[100];let _e;e[101]!==oe||e[102]!==Te?(_e=t.jsx("button",{type:"button",disabled:oe,onClick:Te,children:"Merge with next"}),e[101]=oe,e[102]=Te,e[103]=_e):_e=e[103];let Ee;e[104]!==Ce||e[105]!==_e?(Ee=t.jsxs("div",{className:"confirm-actions-row",children:[Ce,_e]}),e[104]=Ce,e[105]=_e,e[106]=Ee):Ee=e[106];let Ie;e[107]!==be||e[108]!==Ee?(Ie=t.jsxs("section",{className:"confirm-section","aria-label":"Pieces",children:[je,be,Ee]}),e[107]=be,e[108]=Ee,e[109]=Ie):Ie=e[109];let Le;e[110]!==ve||e[111]!==Ie?(Le=t.jsxs("div",{className:"confirm-split-column",children:[ve,Ie]}),e[110]=ve,e[111]=Ie,e[112]=Le):Le=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 Oe;e[114]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>f(Xs),e[114]=Oe):Oe=e[114];let $e;e[115]!==o?($e=o?t.jsx(vs,{size:13}):t.jsx(js,{size:13}),e[115]=o,e[116]=$e):$e=e[116];const Ge=o?"Sound on":"Sound off";let Ae;e[117]!==o||e[118]!==$e||e[119]!==Ge?(Ae=t.jsxs("div",{className:"confirm-section-heading",children:[Me,t.jsxs("button",{type:"button","aria-pressed":o,onClick:Oe,children:[$e,Ge]})]}),e[117]=o,e[118]=$e,e[119]=Ge,e[120]=Ae):Ae=e[120];const Fe=!o;let Pe;e[121]!==N.segment?(Pe=[N.segment],e[121]=N.segment,e[122]=Pe):Pe=e[122];let ke;e[123]!==l||e[124]!==H||e[125]!==Fe||e[126]!==Pe?(ke=t.jsx(It,{label:"SEGMENT",mediaUrl:l,muted:Fe,playbackRate:H,windows:Pe}),e[123]=l,e[124]=H,e[125]=Fe,e[126]=Pe,e[127]=ke):ke=e[127];const He=!o;let P;e[128]!==l||e[129]!==H||e[130]!==xe||e[131]!==He||e[132]!==N.surroundings?(P=t.jsx(It,{label:xe,mediaUrl:l,muted:He,playbackRate:H,windows:N.surroundings}),e[128]=l,e[129]=H,e[130]=xe,e[131]=He,e[132]=N.surroundings,e[133]=P):P=e[133];let fe;e[134]!==ke||e[135]!==P?(fe=t.jsxs("div",{className:"confirm-split-loops",children:[ke,P]}),e[134]=ke,e[135]=P,e[136]=fe):fe=e[136];let Ve;e[137]!==T||e[138]!==ie||e[139]!==s||e[140]!==M||e[141]!==he||e[142]!==ae||e[143]!==ee||e[144]!==L||e[145]!==E||e[146]!==v||e[147]!==r||e[148]!==se||e[149]!==u?(Ve=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:M,onFocus:()=>m("in"),onChange:R=>x(R.target.value),onBlur:()=>ie(M,L),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),ie(M,L))}}),he("in",ae,R=>Nt({cutPointsSeconds:s,deltaSeconds:R,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:R=>S(R.target.value),onBlur:()=>ie(M,L),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),ie(M,L))}}),he("out",ee,R=>St({cutPointsSeconds:s,deltaSeconds:R,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:[Ys.map(R=>{const V=kl({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}),De=V.cutPointsSeconds.every((Re,Ue)=>Re===s[Ue]);return t.jsxs("button",{type:"button",disabled:De,onClick:()=>T(V),children:[R>0?"+":"−",Math.abs(R),"s"]},`move:${R}`)}),t.jsx("button",{type:"button","aria-pressed":se,onClick:()=>k({key:E,value:!se}),children:"Slow ×0.25"})]})]})]}),e[137]=T,e[138]=ie,e[139]=s,e[140]=M,e[141]=he,e[142]=ae,e[143]=ee,e[144]=L,e[145]=E,e[146]=v,e[147]=r,e[148]=se,e[149]=u,e[150]=Ve):Ve=e[150];let et;e[151]!==j?(et=j&&t.jsx("p",{className:"confirm-field-error",role:"alert",children:j}),e[151]=j,e[152]=et):et=e[152];let Je;e[153]!==Ae||e[154]!==fe||e[155]!==Ve||e[156]!==et?(Je=t.jsxs("section",{className:"confirm-section","aria-label":"Loops",children:[Ae,fe,Ve,et]}),e[153]=Ae,e[154]=fe,e[155]=Ve,e[156]=et,e[157]=Je):Je=e[157];let Ke;e[158]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsx("span",{className:"confirm-section-label",children:"Output"}),e[158]=Ke):Ke=e[158];let Ye;e[159]===Symbol.for("react.memo_cache_sentinel")?(Ye=[["keep","KEEP segment"],["remove","REMOVE segment"],["all","ALL pieces"]],e[159]=Ye):Ye=e[159];let Qe;e[160]!==s||e[161]!==F||e[162]!==a||e[163]!==b.length||e[164]!==r?(Qe=t.jsx("div",{className:"confirm-chips",children:Ye.map(R=>{const[V,De]=R;return t.jsx("button",{type:"button",className:a===V?"active":void 0,"aria-pressed":a===V,disabled:V==="remove"&&b.length<2,onClick:()=>F({cutPointsSeconds:s,outputMode:V,selectedIndex:r}),children:De},V)})}),e[160]=s,e[161]=F,e[162]=a,e[163]=b.length,e[164]=r,e[165]=Qe):Qe=e[165];let qe;e[166]!==ue?(qe=t.jsx("p",{className:"confirm-help",children:ue}),e[166]=ue,e[167]=qe):qe=e[167];let Be;e[168]!==Qe||e[169]!==qe?(Be=t.jsxs("section",{className:"confirm-section","aria-label":"Output mode",children:[Ke,Qe,qe]}),e[168]=Qe,e[169]=qe,e[170]=Be):Be=e[170];let We;e[171]!==Je||e[172]!==Be?(We=t.jsxs("div",{className:"confirm-split-column",children:[Je,Be]}),e[171]=Je,e[172]=Be,e[173]=We):We=e[173];let Xe;return e[174]!==me||e[175]!==Le||e[176]!==We?(Xe=t.jsxs("div",{className:"confirm-split",onKeyDown:me,children:[Le,We]}),e[174]=me,e[175]=Le,e[176]=We,e[177]=Xe):Xe=e[177],Xe}function Xs(i){return!i}function Gt(i){const e=ce.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 Kt({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 Pn(i){const e=ce.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=Rl(n?.status??null);let k;e[2]!==n?(k=n?.status?Tl(n.status):null,e[2]=n,e[3]=k):k=e[3];const w=k,b=a.postText.length>y;let v,_,$,A,N,E,I,M,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 G=h?Il(h):[];let F;e[36]!==h?(F=h?Ll(h.context):!1,e[36]=h,e[37]=F):F=e[37];const Z=F;let T;e[38]!==n?(T=n?.status?Fl(n.status,{connecting:n.connecting}):null,e[38]=n,e[39]=T):T=e[39];const U=T,ae=U!==null&&U.tone!=="connected";_="confirm-routed confirm-post";let re;e[40]!==f?(re=t.jsx(Gt,{prompt:f}),e[40]=f,e[41]=re):re=e[41];let ee;e[42]!==d?(ee=t.jsx(Kt,{columns:2,settings:d}),e[42]=d,e[43]=ee):ee=e[43],e[44]!==re||e[45]!==ee?($=t.jsxs("div",{className:"confirm-routed-main",children:[re,ee]}),e[44]=re,e[45]=ee,e[46]=$):$=e[46],A="x-post-preview",N="X post preview";let de,ie;e[47]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("span",{"aria-hidden":"true",children:"X"}),ie=t.jsx("strong",{children:"Post preview"}),e[47]=de,e[48]=ie):(de=e[47],ie=e[48]),e[49]!==m?(E=t.jsxs("header",{children:[de,t.jsxs("div",{children:[ie,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]!==ae?(I=ae&&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]=ae,e[56]=I):I=e[56],e[57]!==s||e[58]!==g||e[59]!==m||e[60]!==x?(M=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(Bt,{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]=M):M=e[61];let te;e[62]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx("label",{htmlFor:"x-post-title",children:"Title"}),e[62]=te):te=e[62];const pe=C||b;let le;e[63]!==r?(le=oe=>r({postText:oe.target.value}),e[63]=r,e[64]=le):le=e[64];let me;e[65]!==l||e[66]!==a.postText||e[67]!==pe||e[68]!==le?(me=t.jsx("textarea",{id:"x-post-title","aria-invalid":pe,disabled:l,placeholder:"Title (required)",required:!0,rows:3,value:a.postText,onChange:le}),e[65]=l,e[66]=a.postText,e[67]=pe,e[68]=le,e[69]=me):me=e[69];const H=C||b?"confirm-field-error":void 0,xe=C?"A title is required":`${a.postText.length}/${y} characters`;let K;e[70]!==H||e[71]!==xe?(K=t.jsx("small",{className:H,children:xe}),e[70]=H,e[71]=xe,e[72]=K):K=e[72];let ue;e[73]!==w?(ue=w&&t.jsx("small",{className:"x-post-account",children:w}),e[73]=w,e[74]=ue):ue=e[74],e[75]!==me||e[76]!==K||e[77]!==ue?(D=t.jsxs("div",{className:"x-post-preview-copy",children:[te,me,K,ue]}),e[75]=me,e[76]=K,e[77]=ue,e[78]=D):D=e[78];let Y;e[79]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx("span",{children:"Publish"}),e[79]=Y):Y=e[79];const he=S?"schedule":"now";let X;e[80]!==r?(X=oe=>r({scheduledFor:oe.target.value==="schedule"?Ql():null}),e[80]=r,e[81]=X):X=e[81];let Q,q;e[82]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("option",{value:"now",children:"Now"}),q=t.jsx("option",{value:"schedule",children:"Schedule"}),e[82]=Q,e[83]=q):(Q=e[82],q=e[83]);let B;e[84]!==l||e[85]!==he||e[86]!==X?(B=t.jsxs("label",{className:"confirm-field",children:[Y,t.jsxs("select",{"aria-label":"Publish timing",disabled:l,value:he,onChange:X,children:[Q,q]})]}),e[84]=l,e[85]=he,e[86]=X,e[87]=B):B=e[87];let W;e[88]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx("span",{children:"Orientation"}),e[88]=W):W=e[88];const ne=l||s?.type==="image",J=a.orientation??"source";let ve;e[89]!==r?(ve=oe=>r({orientation:oe.target.value==="portrait"||oe.target.value==="landscape"?oe.target.value:null}),e[89]=r,e[90]=ve):ve=e[90];let je,ge,be;e[91]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx("option",{value:"source",children:"Keep source"}),ge=t.jsx("option",{value:"portrait",children:"Portrait"}),be=t.jsx("option",{value:"landscape",children:"Landscape"}),e[91]=je,e[92]=ge,e[93]=be):(je=e[91],ge=e[92],be=e[93]);let Ne;e[94]!==ne||e[95]!==J||e[96]!==ve?(Ne=t.jsxs("select",{"aria-label":"Video orientation",disabled:ne,value:J,onChange:ve,children:[je,ge,be]}),e[94]=ne,e[95]=J,e[96]=ve,e[97]=Ne):Ne=e[97];let we;e[98]!==s?.type?(we=s?.type==="image"&&t.jsx("small",{children:"Video posts only"}),e[98]=s?.type,e[99]=we):we=e[99];let Se;e[100]!==Ne||e[101]!==we?(Se=t.jsxs("label",{className:"confirm-field",children:[W,Ne,we]}),e[100]=Ne,e[101]=we,e[102]=Se):Se=e[102];let Ce;e[103]!==l||e[104]!==a.scheduledFor||e[105]!==r||e[106]!==S?(Ce=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:Dl(a.scheduledFor??""),onChange:oe=>r({scheduledFor:Ml(oe.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]=Ce):Ce=e[107],e[108]!==B||e[109]!==Se||e[110]!==Ce?(L=t.jsxs("div",{className:"x-post-preview-options",role:"group","aria-label":"Post options",children:[B,Se,Ce]}),e[108]=B,e[109]=Se,e[110]=Ce,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||!Z,onChange:oe=>p?.({enabled:oe.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}):Z?h.options.enabled?t.jsxs("div",{className:"x-post-thread-steps",children:[h.context.steps.map((oe,Te)=>t.jsx(en,{busy:l,index:Te,maxCharacters:y,prompt:Ol(h,oe),reply:G.find(_e=>_e.stepId===oe.id)??null,step:oe,stepCount:h.context.steps.length,onPromptChange:o},oe.id)),h.context.credits.length>0&&t.jsx(ln,{busy:l,maxCharacters:y,replyCount:G.filter(Js).length,text:Hl(h),onChange:c}),G.length===0&&t.jsx("small",{className:"confirm-field-error",children:Ul})]}):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]=$,e[29]=A,e[30]=N,e[31]=E,e[32]=I,e[33]=M,e[34]=D,e[35]=L}else v=e[26],_=e[27],$=e[28],A=e[29],N=e[30],E=e[31],I=e[32],M=e[33],D=e[34],L=e[35];let z;e[112]!==v||e[113]!==A||e[114]!==N||e[115]!==E||e[116]!==I||e[117]!==M||e[118]!==D||e[119]!==L?(z=t.jsxs("article",{className:A,"aria-label":N,children:[E,I,M,D,L,v]}),e[112]=v,e[113]=A,e[114]=N,e[115]=E,e[116]=I,e[117]=M,e[118]=D,e[119]=L,e[120]=z):z=e[120];let se;return e[121]!==_||e[122]!==$||e[123]!==z?(se=t.jsxs("div",{className:_,children:[$,z]}),e[121]=_,e[122]=$,e[123]=z,e[124]=se):se=e[124],se}function Js(i){return i.stepId===null}function Yt(i){return i===0?"nothing to post":`posts as ${i} ${i===1?"reply":"replies"}`}function Zs(i){const e=Vl(i.images).length;return e===i.images.length?"Input images":`Input images · first ${e} of ${i.images.length} attach`}function en(i){const e=ce.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=Yt(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=A=>a?.(c.id,A.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:Zs(c)}),t.jsx("div",{className:"x-post-thread-images",children:c.images.map(tn)})]}),e[29]=c,e[30]=_):_=e[30];let $;return e[31]!==m||e[32]!==v||e[33]!==_||e[34]!==h||e[35]!==x?($=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]=$):$=e[36],$}function tn(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 ln(i){const e=ce.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=Yt(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 sn(i){const e=ce.c(15),{effectiveSpeed:s,mediaUrl:l,thumbnailUrl:n}=i,a=ye.useRef(null),[r,u]=ye.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],ye.useEffect(p,o);let f;e[5]!==s?(f=s?`preview at ${ql(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 kn(i){const e=ce.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(Gt,{prompt:s}),e[0]=s,e[1]=c):c=e[1];let p;e[2]!==r||e[3]!==l?(p=t.jsx(Kt,{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(sn,{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 _n(i){const e=ce.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(jt,{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(ys,{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 En(i){const e=ce.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 Lt={"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"},Xt=["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"],ht=Xt.length;function nn(){const i=[];for(let e=0;e<ht;e+=1){const s=Xt[e];for(let l=0;l<ht;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 an=nn(),Ft=28,rn=16,on={center:"Centered","above-qr":"Above QR","on-qr":"On QR","below-qr":"Below QR"};function cn(){const i=ce.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 ${ht} ${ht}`,shapeRendering:"crispEdges",children:t.jsx("path",{d:an,fill:"currentColor"})}),i[0]=e):e=i[0],e}function dn(i){const e=ce.c(5),{platform:s}=i,l=`watermark-preview-platform-icon watermark-preview-${s}-icon`,n=Zl[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 mt(i){return Math.round(i*100)}function mn(i){return i>0?`${i.toFixed(1)}s`:"Off"}function un(i,e,s){if(s<=0)return{left:0,width:100};const l=dt(i/s*100,0,100),n=dt((e??s)/s*100,l,100);return{left:l,width:n-l}}function dt(i,e,s){return Math.min(s,Math.max(e,i))}function Mt(i){return Number.isFinite(i)?`${i.toFixed(1)}s`:"0.0s"}function vt(i,e){return rn*(Math.min(i,e)/e)}function hn(i,e,s){const[l,n]=i.split("-"),a=[],r={aspectRatio:"1 / 1",height:`${vt(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 fn(i,e,s,l,n,a){const r=qt(l);if(n==="center")return{aspectRatio:`${gt} / ${r}`,height:`${vt(i,e)*(r/es)}%`,top:`${s}%`,left:"50%",transform:"translate(-50%, -50%)"};const[u,c]=a.split("-"),p=vt(i,e),o=p*(e/i),f=p*(r/gt),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=dt(h,2,98-o),g=dt(g,d,100-d-f),{aspectRatio:`${gt} / ${r}`,width:`${o}%`,height:"auto",top:`${g}%`,left:`${h}%`}}function pn(i,e,s){const l=(qt(e)-2)/2*(s/100);return{paddingInline:`${i/Ft}em`,borderRadius:`${l/Ft}em`}}function ut(i){const e=ce.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 nt(i){const e=ce.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 Dt(i){const e=ce.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=ts(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=un(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`,$=`${u} start`,A=n>0?n:void 0;let N;e[19]!==a||e[20]!==c?(N=J=>c(Math.max(0,Number(J.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]!==$||e[26]!==A||e[27]!==N?(E=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[v,t.jsx("input",{id:_,"aria-label":$,type:"number",min:"0",max:A,step:"0.1",value:o,disabled:s,onChange:N})]}),e[22]=s,e[23]=o,e[24]=_,e[25]=$,e[26]=A,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 M=`${r}-end`,D=`${u} end`,L=!d,z=n>0?n:void 0,se=a??"";let G;e[30]!==n?(G=n>0?n.toFixed(1):"Clip end",e[30]=n,e[31]=G):G=e[31];let F;e[32]!==c||e[33]!==o?(F=J=>c(o,J.target.value===""?null:Math.max(0,Number(J.target.value)||0)),e[32]=c,e[33]=o,e[34]=F):F=e[34];let Z;e[35]!==s||e[36]!==M||e[37]!==D||e[38]!==L||e[39]!==z||e[40]!==se||e[41]!==G||e[42]!==F?(Z=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[I,t.jsx("input",{id:M,"aria-label":D,"aria-invalid":L,type:"number",min:"0",max:z,step:"0.1",value:se,placeholder:G,disabled:s,onChange:F})]}),e[35]=s,e[36]=M,e[37]=D,e[38]=L,e[39]=z,e[40]=se,e[41]=G,e[42]=F,e[43]=Z):Z=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`,ae=`${u} duration`,re=!d,ee=n>0?Math.max(0,n-o):void 0;let de;e[45]!==o||e[46]!==x?(de=x===null?"":Number(Math.max(0,x-o).toFixed(6)),e[45]=o,e[46]=x,e[47]=de):de=e[47];let ie;e[48]!==n||e[49]!==c||e[50]!==o?(ie=J=>c(o,J.target.value===""?null:Number(Math.min(n>0?n:1/0,o+Math.max(0,Number(J.target.value)||0)).toFixed(6))),e[48]=n,e[49]=c,e[50]=o,e[51]=ie):ie=e[51];let te;e[52]!==s||e[53]!==U||e[54]!==ae||e[55]!==re||e[56]!==ee||e[57]!==de||e[58]!==ie?(te=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[T,t.jsx("input",{id:U,"aria-label":ae,"aria-invalid":re,type:"number",min:"0",max:ee,step:"any",value:de,placeholder:"Clip end",disabled:s,onChange:ie})]}),e[52]=s,e[53]=U,e[54]=ae,e[55]=re,e[56]=ee,e[57]=de,e[58]=ie,e[59]=te):te=e[59];const pe=`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 me;e[64]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(Rt,{size:8,"aria-hidden":"true"}),e[64]=me):me=e[64];let H;e[65]!==s||e[66]!==pe||e[67]!==le?(H=t.jsxs("button",{type:"button","aria-label":pe,disabled:s,onClick:le,children:[me,"Start"]}),e[65]=s,e[66]=pe,e[67]=le,e[68]=H):H=e[68];const xe=`Set ${u} end from playhead`;let K;e[69]!==l||e[70]!==c||e[71]!==o?(K=()=>c(o,Math.max(l,o+.1)),e[69]=l,e[70]=c,e[71]=o,e[72]=K):K=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Rt,{size:8,"aria-hidden":"true"}),e[73]=ue):ue=e[73];let Y;e[74]!==s||e[75]!==xe||e[76]!==K?(Y=t.jsxs("button",{type:"button","aria-label":xe,disabled:s,onClick:K,children:[ue,"End"]}),e[74]=s,e[75]=xe,e[76]=K,e[77]=Y):Y=e[77];const he=`Use whole clip for ${u}`;let X;e[78]!==c?(X=()=>c(0,null),e[78]=c,e[79]=X):X=e[79];let Q;e[80]!==s||e[81]!==he||e[82]!==X?(Q=t.jsx("button",{type:"button","aria-label":he,disabled:s,onClick:X,children:"Whole"}),e[80]=s,e[81]=he,e[82]=X,e[83]=Q):Q=e[83];let q;e[84]!==H||e[85]!==Y||e[86]!==Q?(q=t.jsxs("div",{className:"confirm-watermark-timing-actions",children:[H,Y,Q]}),e[84]=H,e[85]=Y,e[86]=Q,e[87]=q):q=e[87];let B;e[88]!==b||e[89]!==E||e[90]!==Z||e[91]!==te||e[92]!==S||e[93]!==q?(B=t.jsxs("div",{className:"confirm-watermark-timing-row",children:[S,b,E,Z,te,q]}),e[88]=b,e[89]=E,e[90]=Z,e[91]=te,e[92]=S,e[93]=q,e[94]=B):B=e[94];let W;e[95]!==u||e[96]!==d?(W=!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]=W):W=e[97];let ne;return e[98]!==g||e[99]!==B||e[100]!==W?(ne=t.jsxs("div",{className:"confirm-watermark-timing",role:"group","aria-label":g,children:[B,W]}),e[98]=g,e[99]=B,e[100]=W,e[101]=ne):ne=e[101],ne}function xn(i){const e=ce.c(228),{busy:s,state:l,onChange:n,onMediaMetadata:a}=i,[r,u]=ye.useState(0),c=l.identities[l.platform];let p,o,f;e[0]!==c.handle||e[1]!==l.platform?(p=Bl(c.handle),o=Qt[l.platform],f=Wl(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=Pt(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=Pt(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?dt(r/m*100,0,100):0,e[23]=r,e[24]=m,e[25]=v):v=e[25];const _=v;let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"Preview"}),e[26]=$):$=e[26];let A;e[27]!==r?(A=Mt(r),e[27]=r,e[28]=A):A=e[28];let N;e[29]!==m?(N=m>0?Mt(m):"—",e[29]=m,e[30]=N):N=e[30];let E;e[31]!==A||e[32]!==N?(E=t.jsxs("div",{className:"confirm-section-heading",children:[$,t.jsxs("strong",{children:[A," / ",N]})]}),e[31]=A,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(Dt,{busy:s,currentTime:r,duration:m,endSeconds:l.qrEndSeconds,idPrefix:"watermark-qr-timing",label:"QR",playhead:_,startSeconds:l.qrStartSeconds,onChange:(P,fe)=>n({qrStartSeconds:P,qrEndSeconds:fe})}),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 M;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?(M=l.includeHandle&&t.jsx(Dt,{busy:s,currentTime:r,duration:m,endSeconds:l.handleEndSeconds,idPrefix:"watermark-handle-timing",label:"Handle",playhead:_,startSeconds:l.handleStartSeconds,onChange:(P,fe)=>n({handleStartSeconds:P,handleEndSeconds:fe})}),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]=M):M=e[51];let D;e[52]!==I||e[53]!==M?(D=t.jsxs("div",{className:"confirm-watermark-timings",children:[I,M]}),e[52]=I,e[53]=M,e[54]=D):D=e[54];const L=`${w} / ${b}`,z=w/b;let se;e[55]!==L||e[56]!==z?(se={aspectRatio:L,"--watermark-preview-ratio":z},e[55]=L,e[56]=z,e[57]=se):se=e[57];const G=se;let F;e[58]!==a||e[59]!==l.mediaUrl||e[60]!==l.thumbnailUrl?(F=l.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:P=>{const fe=P.currentTarget;Number.isFinite(fe.duration)&&fe.duration>0&&fe.videoWidth>0&&fe.videoHeight>0&&a({durationSeconds:fe.duration,width:fe.videoWidth,height:fe.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]=F):F=e[61];let Z;e[62]!==b||e[63]!==k||e[64]!==w||e[65]!==j||e[66]!==l.includeQr?(Z=l.includeQr&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-qr",style:{...hn(k,w,b),opacity:j},"aria-hidden":"true",children:t.jsx(cn,{})}),e[62]=b,e[63]=k,e[64]=w,e[65]=j,e[66]=l.includeQr,e[67]=Z):Z=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:{...fn(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:pn(l.handlePadding,l.handlePaddingY,l.handleRounding),children:[l.includePlatformIcon&&t.jsx(dn,{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 ae;e[87]!==G||e[88]!==F||e[89]!==Z||e[90]!==T||e[91]!==U?(ae=t.jsxs("div",{className:"watermark-video-stage",style:G,children:[F,Z,T,U]}),e[87]=G,e[88]=F,e[89]=Z,e[90]=T,e[91]=U,e[92]=ae):ae=e[92];let re;e[93]!==D||e[94]!==ae||e[95]!==E?(re=t.jsxs("section",{className:"confirm-section confirm-watermark-preview","aria-label":"Preview",children:[E,D,ae]}),e[93]=D,e[94]=ae,e[95]=E,e[96]=re):re=e[96];let ee;e[97]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx("span",{className:"confirm-section-label",children:"Identity"}),e[97]=ee):ee=e[97];let de;e[98]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("span",{children:"Platform"}),e[98]=de):de=e[98];const ie=l.platform;let te;e[99]!==n?(te=P=>{const fe=P.target.value;ls(fe)&&n({platform:fe})},e[99]=n,e[100]=te):te=e[100];let pe;e[101]===Symbol.for("react.memo_cache_sentinel")?(pe=ss.map(gn),e[101]=pe):pe=e[101];let le;e[102]!==s||e[103]!==l.platform||e[104]!==te?(le=t.jsxs("label",{className:"confirm-field",children:[de,t.jsx("select",{value:ie,disabled:s,onChange:te,children:pe})]}),e[102]=s,e[103]=l.platform,e[104]=te,e[105]=le):le=e[105];const me=l.includeHandle&&!l.includeQr;let H;e[106]!==n?(H=P=>n({includeHandle:P}),e[106]=n,e[107]=H):H=e[107];let xe;e[108]!==s||e[109]!==l.includeHandle||e[110]!==me||e[111]!==H?(xe=t.jsx(ut,{busy:s,checked:l.includeHandle,description:"Centered account badge",disabled:me,label:"Include handle",onChange:H}),e[108]=s,e[109]=l.includeHandle,e[110]=me,e[111]=H,e[112]=xe):xe=e[112];let K;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?(K=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]=K):K=e[122];const ue=l.includeQr&&!l.includeHandle;let Y;e[123]!==n?(Y=P=>n({includeQr:P,...P?{}:{handlePlacement:"center"}}),e[123]=n,e[124]=Y):Y=e[124];let he;e[125]!==s||e[126]!==l.includeQr||e[127]!==ue||e[128]!==Y?(he=t.jsx(ut,{busy:s,checked:l.includeQr,description:"Separately placed scannable link",disabled:ue,label:"Include QR code",onChange:Y}),e[125]=s,e[126]=l.includeQr,e[127]=ue,e[128]=Y,e[129]=he):he=e[129];let X;e[130]!==s||e[131]!==g||e[132]!==n||e[133]!==l.includeQr||e[134]!==l.url||e[135]!==d?(X=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]=X):X=e[136];let Q;e[137]!==s||e[138]!==n||e[139]!==l.includeHandle||e[140]!==l.saveDefault?(Q=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]=Q):Q=e[141];let q;e[142]!==le||e[143]!==xe||e[144]!==K||e[145]!==he||e[146]!==X||e[147]!==Q?(q=t.jsxs("section",{className:"confirm-section","aria-label":"Identity",children:[ee,le,xe,K,he,X,Q]}),e[142]=le,e[143]=xe,e[144]=K,e[145]=he,e[146]=X,e[147]=Q,e[148]=q):q=e[148];let B;e[149]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"confirm-section-label",children:"Appearance"}),e[149]=B):B=e[149];let W;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?(W=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsx(ut,{busy:s,checked:l.includePlatformIcon,description:`${o} mark before the handle`,label:`Show ${o} icon`,onChange:P=>n({includePlatformIcon:P})}),t.jsx(ut,{busy:s,checked:l.includeHandleBorder,description:"Outline around the pill",label:"Handle border",onChange:P=>n({includeHandleBorder:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-padding-x",label:"Handle padding X",min:_t,max:kt,output:`${l.handlePadding}px`,value:l.handlePadding,onChange:P=>n({handlePadding:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-padding-y",label:"Handle padding Y",min:_t,max:kt,output:`${l.handlePaddingY}px`,value:l.handlePaddingY,onChange:P=>n({handlePaddingY:P})}),t.jsx(nt,{busy:s,id:"watermark-handle-rounding",label:"Corner rounding",min:Gl,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]=W):W=e[159];let ne;e[160]!==s||e[161]!==n||e[162]!==l.includeQr||e[163]!==l.qrOpacity?(ne=l.includeQr&&t.jsx(nt,{busy:s,id:"watermark-qr-opacity",label:"QR opacity",min:$t*100,max:Et*100,output:`${mt(l.qrOpacity)}%`,value:mt(l.qrOpacity),onChange:P=>n({qrOpacity:P/100})}),e[160]=s,e[161]=n,e[162]=l.includeQr,e[163]=l.qrOpacity,e[164]=ne):ne=e[164];let J;e[165]!==s||e[166]!==n||e[167]!==l.handleOpacity||e[168]!==l.includeHandle?(J=l.includeHandle&&t.jsx(nt,{busy:s,id:"watermark-handle-opacity",label:"Handle opacity",min:$t*100,max:Et*100,output:`${mt(l.handleOpacity)}%`,value:mt(l.handleOpacity),onChange:P=>n({handleOpacity:P/100})}),e[165]=s,e[166]=n,e[167]=l.handleOpacity,e[168]=l.includeHandle,e[169]=J):J=e[169];let ve;e[170]!==l.fadeSeconds?(ve=mn(l.fadeSeconds),e[170]=l.fadeSeconds,e[171]=ve):ve=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 ge;e[174]!==n?(ge=P=>n({fadeSeconds:P/10}),e[174]=n,e[175]=ge):ge=e[175];let be;e[176]!==s||e[177]!==ve||e[178]!==je||e[179]!==ge?(be=t.jsx(nt,{busy:s,id:"watermark-fade",label:"Fade in/out",min:is*10,max:ns*10,output:ve,value:je,onChange:ge}),e[176]=s,e[177]=ve,e[178]=je,e[179]=ge,e[180]=be):be=e[180];let Ne;e[181]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("small",{className:"confirm-help",children:"Fades only where a watermark starts or ends inside the clip."}),e[181]=Ne):Ne=e[181];let we;e[182]!==W||e[183]!==ne||e[184]!==J||e[185]!==be?(we=t.jsxs("section",{className:"confirm-section","aria-label":"Appearance",children:[B,W,ne,J,be,Ne]}),e[182]=W,e[183]=ne,e[184]=J,e[185]=be,e[186]=we):we=e[186];let Se;e[187]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("span",{className:"confirm-section-label",children:"Position"}),e[187]=Se):Se=e[187];let Ce;e[188]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("span",{children:"QR position"}),e[188]=Ce):Ce=e[188];const oe=`confirm-chip${l.position==="auto"?" active":""}`,Te=l.position==="auto",_e=s||!l.includeQr;let Ee;e[189]!==n?(Ee=()=>n({position:"auto"}),e[189]=n,e[190]=Ee):Ee=e[190];let Ie;e[191]!==oe||e[192]!==Te||e[193]!==_e||e[194]!==Ee?(Ie=t.jsxs("div",{className:"confirm-watermark-qr-position-heading",children:[Ce,t.jsx("button",{type:"button",className:oe,"aria-pressed":Te,disabled:_e,onClick:Ee,children:"Auto"})]}),e[191]=oe,e[192]=Te,e[193]=_e,e[194]=Ee,e[195]=Ie):Ie=e[195];let Le;e[196]!==s||e[197]!==n||e[198]!==l.includeQr||e[199]!==l.position?(Le=Kl.map(P=>t.jsx("button",{type:"button",className:l.position===P?"active":"","aria-label":Lt[P],"aria-pressed":l.position===P,title:Lt[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]=Le):Le=e[200];let Me;e[201]!==Le?(Me=t.jsx("div",{className:"confirm-position-grid",role:"group","aria-label":"QR position",children:Le}),e[201]=Le,e[202]=Me):Me=e[202];let Oe;e[203]!==Ie||e[204]!==Me?(Oe=t.jsxs("div",{className:"confirm-watermark-qr-position",children:[Ie,Me]}),e[203]=Ie,e[204]=Me,e[205]=Oe):Oe=e[205];let $e;e[206]!==s||e[207]!==n||e[208]!==l.handlePlacement||e[209]!==l.handleVerticalPercent||e[210]!==l.includeHandle||e[211]!==l.includeQr?($e=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:Yl.map(P=>{const Ve=s||P!=="center"&&!l.includeQr;return t.jsx("button",{type:"button",className:l.handlePlacement===P?"active":"","aria-pressed":l.handlePlacement===P,disabled:Ve,onClick:()=>n({handlePlacement:P}),children:on[P]},P)})})]}),l.handlePlacement==="center"&&t.jsx(nt,{busy:s,id:"watermark-handle-vertical",label:"Handle vertical position",min:Jl,max:Xl,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]=$e):$e=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 Ae;e[213]!==Ge?(Ae=t.jsx("small",{className:"confirm-help",children:Ge}),e[213]=Ge,e[214]=Ae):Ae=e[214];let Fe;e[215]!==$e||e[216]!==Ae?(Fe=t.jsxs("div",{className:"confirm-watermark-handle-position",children:[$e,Ae]}),e[215]=$e,e[216]=Ae,e[217]=Fe):Fe=e[217];let Pe;e[218]!==Oe||e[219]!==Fe?(Pe=t.jsxs("section",{className:"confirm-section confirm-watermark-position","aria-label":"Position",children:[Se,Oe,Fe]}),e[218]=Oe,e[219]=Fe,e[220]=Pe):Pe=e[220];let ke;e[221]!==q||e[222]!==we||e[223]!==Pe?(ke=t.jsxs("div",{className:"confirm-watermark-controls",children:[q,we,Pe]}),e[221]=q,e[222]=we,e[223]=Pe,e[224]=ke):ke=e[224];let He;return e[225]!==re||e[226]!==ke?(He=t.jsxs("div",{className:"confirm-watermark",children:[re,ke]}),e[225]=re,e[226]=ke,e[227]=He):He=e[227],He}function gn(i){return t.jsx("option",{value:i,children:Qt[i]},i)}const $n=Object.freeze(Object.defineProperty({__proto__:null,WatermarkBody:xn},Symbol.toStringTag,{value:"Module"}));export{wn as C,Sn as G,En as N,Nn as P,kn as R,Cn as S,$n as W,_n as a,Pn 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-
|
|
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-CtYXY_po.js";import{bu as X,dH as me,dI as fe,dJ as pe}from"./videobook-lhLK6e6Q.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};
|