videobook 0.2.2 → 0.2.3
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 +25 -0
- package/README.md +7 -8
- package/dist/book-manager.js +40 -2
- package/dist/env-secrets.js +1 -0
- package/dist/image-edit-models.js +1 -0
- package/dist/media/catalog.js +13 -0
- package/dist/media/cost.js +79 -6
- package/dist/media/json-schema.js +7 -0
- package/dist/media/ref-fields.js +11 -3
- package/dist/media/request.js +49 -0
- package/dist/provider-usage.js +19 -7
- package/dist/tools/estimate-cost.js +4 -4
- package/dist/tools/provider-key-status.js +2 -0
- package/package.json +13 -13
- package/ui/assets/{alive-captions-C48o6dfv.js → alive-captions-4QySEGdt.js} +1 -1
- package/ui/assets/confirm-bodies-Bw818V9J.js +1 -0
- package/ui/assets/{fullscreen-4m0qtZ7w.js → fullscreen-CzTnPPG5.js} +1 -1
- package/ui/assets/{goal-ui-2pUWP_B2.js → goal-ui-CosrK_ko.js} +1 -1
- package/ui/assets/index-C9xjFEGL.js +37 -0
- package/ui/assets/{inspector-CnKySYc5.js → inspector-BN2fezh4.js} +1 -1
- package/ui/assets/{jobs-ui-lRoS1MbL.js → jobs-ui-C4Wgy6I1.js} +1 -1
- package/ui/assets/{music-video-BQnnPp-X.js → music-video-BSj8SgbQ.js} +1 -1
- package/ui/assets/{ui-OHFUngrc.js → ui-Cpr6zMTA.js} +1 -1
- package/ui/assets/{videobook-DZ58pKW5.js → videobook-B5G0jMoi.js} +13 -13
- package/ui/index.html +8 -8
- package/ui/assets/confirm-bodies-aq6Az8Md.js +0 -1
- package/ui/assets/index-DmDH4gYr.js +0 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as F,j as t,a as A}from"./vendor-react-Dj7D1fD4.js";import{u as be,a as pe,V as Se,A as xe,P as Ne}from"./vendor-remotion-CH1HXrlc.js";import{ec as Ce,ed as ke,ee as we,ef as $e,eg as Pe,eh as de,ei as Te,ej as me,ek as Re,el as Ae,em as Me,en as _e,eo as Ee,ep as Oe,eq as fe,bw as We}from"./videobook-DZ58pKW5.js";import{g as Le,a6 as ze,_ as Fe,h as He,X as Ie}from"./vendor-icons-CGqhCIXV.js";import"./vendor-yctIZ9Dz.js";import"./vendor-mcp-DQ7EusT9.js";const Be={face:"#63c7d8",text:"#f0a860",graphic:"#f0a860"};function De(a){const e=F.c(25),{phrase:s,cue:n,settings:o,sourceWidth:c,sourceHeight:l}=a,{width:i,height:h}=pe();let r,f,m,d;if(e[0]!==h||e[1]!==s.id||e[2]!==s.regions||e[3]!==o||e[4]!==l||e[5]!==c||e[6]!==i){const j={sourceWidth:c,sourceHeight:l,targetWidth:i,targetHeight:h};let v;e[11]!==s.regions||e[12]!==o?(v=new Set($e(s.regions,o)),e[11]=s.regions,e[12]=o,e[13]=v):v=e[13];const C=v;let y;e[14]!==i?(y=Math.round(i/480),e[14]=i,e[15]=y):y=e[15],f=Math.max(2,y),r=xe,e[16]===Symbol.for("react.memo_cache_sentinel")?(m={pointerEvents:"none"},e[16]=m):m=e[16],d=s.regions.map((w,$)=>{const b=Pe(w,j);return t.jsx("div",{style:{position:"absolute",left:b.x*i,top:b.y*h,width:b.width*i,height:b.height*h,border:`${f}px dashed ${Be[w.kind]}`,opacity:C.has(w)?1:.4,borderRadius:f*2}},`${s.id}-${$}`)}),e[0]=h,e[1]=s.id,e[2]=s.regions,e[3]=o,e[4]=l,e[5]=c,e[6]=i,e[7]=r,e[8]=f,e[9]=m,e[10]=d}else r=e[7],f=e[8],m=e[9],d=e[10];let g;e[17]!==n.column||e[18]!==f?(g=t.jsx(Ue,{column:n.column,stroke:f}),e[17]=n.column,e[18]=f,e[19]=g):g=e[19];let u;return e[20]!==r||e[21]!==m||e[22]!==d||e[23]!==g?(u=t.jsxs(r,{style:m,children:[d,g]}),e[20]=r,e[21]=m,e[22]=d,e[23]=g,e[24]=u):u=e[24],u}function Ue(a){const e=F.c(7),{column:s,stroke:n}=a,o=`${Math.max(1,n/2)}px dashed rgba(114, 231, 170, 0.6)`,c=n*2;let l;return e[0]!==s.height||e[1]!==s.width||e[2]!==s.x||e[3]!==s.y||e[4]!==o||e[5]!==c?(l=t.jsx("div",{style:{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,border:o,borderRadius:c}}),e[0]=s.height,e[1]=s.width,e[2]=s.x,e[3]=s.y,e[4]=o,e[5]=c,e[6]=l):l=e[6],l}function Ke(a){const e=F.c(34),{mediaUrl:s,sourceWidth:n,sourceHeight:o,cues:c,phrases:l,settings:i,showRegions:h}=a,r=be(),{fps:f,width:m,height:d}=pe();let g;e[0]!==d||e[1]!==o||e[2]!==n||e[3]!==m?(g=ke({sourceWidth:n,sourceHeight:o,targetWidth:m,targetHeight:d}),e[0]=d,e[1]=o,e[2]=n,e[3]=m,e[4]=g):g=e[4];const u=g,j=r/f;let v;e[5]!==c||e[6]!==j?(v=Ce(c,j),e[5]=c,e[6]=j,e[7]=v):v=e[7];const C=v;let y;e[8]!==C||e[9]!==l?(y=C?l.find(M=>M.id===C.id):void 0,e[8]=C,e[9]=l,e[10]=y):y=e[10];const w=y;let $;e[11]===Symbol.for("react.memo_cache_sentinel")?($={background:"#000000"},e[11]=$):$=e[11];let b;e[12]!==u.height||e[13]!==u.width||e[14]!==u.x||e[15]!==u.y?(b={position:"absolute",left:u.x,top:u.y,width:u.width,height:u.height},e[12]=u.height,e[13]=u.width,e[14]=u.x,e[15]=u.y,e[16]=b):b=e[16];let N;e[17]!==s||e[18]!==b?(N=t.jsx(Se,{src:s,style:b}),e[17]=s,e[18]=b,e[19]=N):N=e[19];let P;e[20]!==C||e[21]!==w||e[22]!==i||e[23]!==h||e[24]!==o||e[25]!==n?(P=h&&C&&w&&t.jsx(De,{phrase:w,cue:C,settings:i,sourceWidth:n,sourceHeight:o}),e[20]=C,e[21]=w,e[22]=i,e[23]=h,e[24]=o,e[25]=n,e[26]=P):P=e[26];let p;e[27]!==c||e[28]!==i?(p=t.jsx(we,{cues:c,settings:i,strokeWidth:6,strokeColor:"#000000",shadowBlur:6,shadowOpacity:60}),e[27]=c,e[28]=i,e[29]=p):p=e[29];let k;return e[30]!==N||e[31]!==P||e[32]!==p?(k=t.jsxs(xe,{style:$,children:[N,P,p]}),e[30]=N,e[31]=P,e[32]=p,e[33]=k):k=e[33],k}const ue=[{id:"stack",label:"Stack",hint:"Words land one by one and build a stacked block beside the subject, each line sized to fill the column."},{id:"punch",label:"Punch",hint:"One word at a time, as big as the free space allows. Best on fast verses."},{id:"karaoke",label:"Karaoke",hint:"The whole stacked phrase shows dimmed and lights up word by word."}],Ve=[{id:"pop",label:"Pop"},{id:"slam",label:"Slam"},{id:"rise",label:"Rise"}],qe=[{name:"Green",color:"#72E7AA"},{name:"Pink",color:"#F0B9D0"},{name:"Cyan",color:"#63C7D8"},{name:"Amber",color:"#E7C372"}];function Ge(a,e){if(!a.drifted)return de(a.start);const s=a.driftMs>0?"+":"";return e?`${de(a.start)} · snapped`:`${de(a.start)} · ${s}${a.driftMs}ms`}function Xe(a){const e=F.c(21),{rows:s,phraseLabels:n,activePhrase:o,time:c,snapped:l,onSeek:i}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("h3",{children:"Transcript"}),e[0]=h):h=e[0];let r;e[1]!==s.length?(r=t.jsxs("header",{className:"alive-panel-header",children:[h,t.jsxs("p",{children:[s.length," words · timed to the vocal"]})]}),e[1]=s.length,e[2]=r):r=e[2];let f;if(e[3]!==o||e[4]!==i||e[5]!==n||e[6]!==s||e[7]!==l||e[8]!==c){let g;e[10]!==o||e[11]!==i||e[12]!==s||e[13]!==l||e[14]!==c?(g=(u,j)=>t.jsxs("div",{className:"alive-phrase","data-active":j===o||void 0,children:[t.jsxs("div",{className:"alive-phrase-head",children:[t.jsxs("span",{children:["Phrase ",j+1]}),t.jsx("span",{children:u})]}),t.jsx("div",{className:"alive-phrase-words",children:s.filter(v=>v.phraseIndex===j).map(v=>t.jsxs("button",{type:"button",className:"alive-word","data-active":c>=v.start&&c<v.end||void 0,"data-drifted":v.drifted&&!l||void 0,onClick:()=>i(v.start+.03),children:[t.jsx("span",{children:v.text}),t.jsx("small",{children:Ge(v,l)})]},v.key))})]},`${j}-${u}`),e[10]=o,e[11]=i,e[12]=s,e[13]=l,e[14]=c,e[15]=g):g=e[15],f=n.map(g),e[3]=o,e[4]=i,e[5]=n,e[6]=s,e[7]=l,e[8]=c,e[9]=f}else f=e[9];let m;e[16]!==f?(m=t.jsx("div",{className:"alive-transcript-list",children:f}),e[16]=f,e[17]=m):m=e[17];let d;return e[18]!==r||e[19]!==m?(d=t.jsxs("section",{className:"alive-panel alive-transcript","aria-label":"Transcript",children:[r,m]}),e[18]=r,e[19]=m,e[20]=d):d=e[20],d}function ve(a){const e=F.c(10),{label:s,options:n,value:o,onChange:c}=a;let l;if(e[0]!==c||e[1]!==n||e[2]!==o){let h;e[4]!==c||e[5]!==o?(h=r=>t.jsx("button",{type:"button","aria-pressed":r.id===o,onClick:()=>c(r.id),children:r.label},r.id),e[4]=c,e[5]=o,e[6]=h):h=e[6],l=n.map(h),e[0]=c,e[1]=n,e[2]=o,e[3]=l}else l=e[3];let i;return e[7]!==s||e[8]!==l?(i=t.jsx("div",{className:"alive-segmented",role:"group","aria-label":s,children:l}),e[7]=s,e[8]=l,e[9]=i):i=e[9],i}function re(a){const e=F.c(8),{checked:s,onChange:n,children:o}=a;let c;e[0]!==n?(c=h=>n(h.target.checked),e[0]=n,e[1]=c):c=e[1];let l;e[2]!==s||e[3]!==c?(l=t.jsx("input",{type:"checkbox",checked:s,onChange:c}),e[2]=s,e[3]=c,e[4]=l):l=e[4];let i;return e[5]!==o||e[6]!==l?(i=t.jsxs("label",{className:"alive-toggle",children:[l,o]}),e[5]=o,e[6]=l,e[7]=i):i=e[7],i}function Ye(a){const e=F.c(69),{settings:s,showRegions:n,regionsAnalyzed:o,working:c,onChange:l,onShowRegions:i,onReanalyze:h}=a;let r;e[0]!==s.style?(r=ue.find(S=>S.id===s.style)?.hint,e[0]=s.style,e[1]=r):r=e[1];const f=r;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("h4",{children:"Style"}),e[2]=m):m=e[2];let d;e[3]!==l?(d=S=>l({style:S}),e[3]=l,e[4]=d):d=e[4];let g;e[5]!==s.style||e[6]!==d?(g=t.jsx(ve,{label:"Caption style",options:ue,value:s.style,onChange:d}),e[5]=s.style,e[6]=d,e[7]=g):g=e[7];let u;e[8]!==f?(u=t.jsx("p",{className:"alive-hint",children:f}),e[8]=f,e[9]=u):u=e[9];let j;e[10]!==g||e[11]!==u?(j=t.jsxs("div",{className:"alive-field",children:[m,g,u]}),e[10]=g,e[11]=u,e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("h4",{children:"Word entrance"}),e[13]=v):v=e[13];let C;e[14]!==l?(C=S=>l({motion:S}),e[14]=l,e[15]=C):C=e[15];let y;e[16]!==s.motion||e[17]!==C?(y=t.jsxs("div",{className:"alive-field",children:[v,t.jsx(ve,{label:"Word entrance",options:Ve,value:s.motion,onChange:C})]}),e[16]=s.motion,e[17]=C,e[18]=y):y=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("h4",{children:"Frame awareness"}),e[19]=w):w=e[19];let $;e[20]!==l?($=S=>l({avoidFaces:S}),e[20]=l,e[21]=$):$=e[21];let b;e[22]!==s.avoidFaces||e[23]!==$?(b=t.jsx(re,{checked:s.avoidFaces,onChange:$,children:"Keep words off faces"}),e[22]=s.avoidFaces,e[23]=$,e[24]=b):b=e[24];let N;e[25]!==l?(N=S=>l({avoidText:S}),e[25]=l,e[26]=N):N=e[26];let P;e[27]!==s.avoidText||e[28]!==N?(P=t.jsx(re,{checked:s.avoidText,onChange:N,children:"Keep words off on-screen text"}),e[27]=s.avoidText,e[28]=N,e[29]=P):P=e[29];let p;e[30]!==i||e[31]!==n?(p=t.jsx(re,{checked:n,onChange:i,children:"Show detected regions"}),e[30]=i,e[31]=n,e[32]=p):p=e[32];let k;e[33]!==o?(k=!o&&t.jsx("p",{className:"alive-hint alive-warning",children:"Face and text detection did not run, so stacks use the default columns. Set OPENAI_API_KEY and re-run the analysis."}),e[33]=o,e[34]=k):k=e[34];let M;e[35]!==b||e[36]!==P||e[37]!==p||e[38]!==k?(M=t.jsxs("div",{className:"alive-field",children:[w,b,P,p,k]}),e[35]=b,e[36]=P,e[37]=p,e[38]=k,e[39]=M):M=e[39];let D;e[40]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("h4",{children:"Audio"}),e[40]=D):D=e[40];let O;e[41]!==l?(O=S=>l({energySizing:S}),e[41]=l,e[42]=O):O=e[42];let _;e[43]!==s.energySizing||e[44]!==O?(_=t.jsxs("div",{className:"alive-field",children:[D,t.jsx(re,{checked:s.energySizing,onChange:O,children:"Size words by vocal energy"})]}),e[43]=s.energySizing,e[44]=O,e[45]=_):_=e[45];let H;e[46]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("h4",{children:"Hit color"}),e[46]=H):H=e[46];let W;e[47]!==l||e[48]!==s.hitColor?(W=qe.map(S=>t.jsx("button",{type:"button","aria-label":S.name,"aria-pressed":s.hitColor.toUpperCase()===S.color,onClick:()=>l({hitColor:S.color}),children:t.jsx("span",{style:{background:S.color}})},S.color)),e[47]=l,e[48]=s.hitColor,e[49]=W):W=e[49];let R;e[50]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{children:"Text"}),e[50]=R):R=e[50];let x;e[51]!==l?(x=S=>l({textColor:S.target.value.toUpperCase()}),e[51]=l,e[52]=x):x=e[52];let L;e[53]!==s.textColor||e[54]!==x?(L=t.jsxs("label",{className:"alive-color-input",children:[R,t.jsx("input",{type:"color",value:s.textColor,onChange:x})]}),e[53]=s.textColor,e[54]=x,e[55]=L):L=e[55];let I;e[56]!==W||e[57]!==L?(I=t.jsxs("div",{className:"alive-field",children:[H,t.jsxs("div",{className:"alive-swatches",children:[W,L]})]}),e[56]=W,e[57]=L,e[58]=I):I=e[58];let z;e[59]!==h||e[60]!==c?(z=t.jsx("div",{className:"alive-field",children:t.jsx("button",{type:"button",className:"alive-secondary",disabled:c,onClick:h,children:"Re-run analysis"})}),e[59]=h,e[60]=c,e[61]=z):z=e[61];let B;return e[62]!==M||e[63]!==_||e[64]!==I||e[65]!==z||e[66]!==j||e[67]!==y?(B=t.jsxs("section",{className:"alive-panel alive-settings","aria-label":"Caption settings",children:[j,y,M,_,I,z]}),e[62]=M,e[63]=_,e[64]=I,e[65]=z,e[66]=j,e[67]=y,e[68]=B):B=e[68],B}const Je=90;function U(a,e){return`${Math.max(0,a)/e*100}%`}function Qe(a,e,s){if(e.count===0)return`All ${s} words already sit on their vocal onsets`;if(a)return`${e.count} words snapped to their vocal onsets`;const n=e.minMs===e.maxMs?`${e.maxMs}`:`${e.minMs}–${e.maxMs}`;return`${e.count} words start ${n} ms off the vocal`}function Ze(a){const e=a>120?10:a>30?5:1,s=[];for(let n=0;n<=a;n+=e)s.push(n);return s}function et(a,e,s){const n=F.c(5),o=A.useRef(null);let c,l;return n[0]!==e||n[1]!==s||n[2]!==a?(c=()=>{const i=o.current;if(!i||!s)return;const h=a/e*i.scrollWidth;(h<i.scrollLeft||h>i.scrollLeft+i.clientWidth*.85)&&(i.scrollLeft=Math.max(0,h-i.clientWidth*.2))},l=[a,e,s],n[0]=e,n[1]=s,n[2]=a,n[3]=c,n[4]=l):(c=n[3],l=n[4]),A.useEffect(c,l),o}function tt(a){const e=F.c(105),{duration:s,fps:n,time:o,playing:c,envelope:l,rows:i,cues:h,activeCue:r,snapped:f,drift:m}=a,d=Math.max(s,.1),g=et(o,d,c);let u;e[0]!==a||e[1]!==d?(u=T=>{const E=T.currentTarget.getBoundingClientRect();a.onSeek((T.clientX-E.left)/E.width*d)},e[0]=a,e[1]=d,e[2]=u):u=e[2];const j=u;let v;e[3]!==a?(v=()=>a.onStep(-1),e[3]=a,e[4]=v):v=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Le,{size:16}),e[5]=C):C=e[5];let y;e[6]!==v?(y=t.jsx("button",{type:"button","aria-label":"Previous frame",onClick:v,children:C}),e[6]=v,e[7]=y):y=e[7];const w=c?"Pause":"Play";let $;e[8]!==c?($=c?t.jsx(ze,{size:16}):t.jsx(Fe,{size:16}),e[8]=c,e[9]=$):$=e[9];let b;e[10]!==a.onTogglePlay||e[11]!==w||e[12]!==$?(b=t.jsx("button",{type:"button",className:"alive-play","aria-label":w,onClick:a.onTogglePlay,children:$}),e[10]=a.onTogglePlay,e[11]=w,e[12]=$,e[13]=b):b=e[13];let N;e[14]!==a?(N=()=>a.onStep(1),e[14]=a,e[15]=N):N=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(He,{size:16}),e[16]=P):P=e[16];let p;e[17]!==N?(p=t.jsx("button",{type:"button","aria-label":"Next frame",onClick:N,children:P}),e[17]=N,e[18]=p):p=e[18];let k;e[19]!==o?(k=de(o),e[19]=o,e[20]=k):k=e[20];let M;e[21]!==k?(M=t.jsx("strong",{className:"alive-clock",children:k}),e[21]=k,e[22]=M):M=e[22];const D=Math.floor(o*n),O=Math.floor(d*n);let _;e[23]!==D||e[24]!==O?(_=t.jsxs("span",{className:"alive-muted",children:["frame ",D," / ",O]}),e[23]=D,e[24]=O,e[25]=_):_=e[25];let H;e[26]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("span",{className:"alive-spacer"}),e[26]=H):H=e[26];const W=m.count>0&&!f||void 0;let R;e[27]!==m||e[28]!==i.length||e[29]!==f?(R=Qe(f,m,i.length),e[27]=m,e[28]=i.length,e[29]=f,e[30]=R):R=e[30];let x;e[31]!==W||e[32]!==R?(x=t.jsx("span",{className:"alive-drift","data-drifted":W,children:R}),e[31]=W,e[32]=R,e[33]=x):x=e[33];const L=f?"alive-secondary":"alive-primary alive-warn",I=m.count===0,z=f?"Use transcript timing":"Snap words to audio";let B;e[34]!==a.onToggleSnap||e[35]!==L||e[36]!==I||e[37]!==z?(B=t.jsx("button",{type:"button",className:L,disabled:I,onClick:a.onToggleSnap,children:z}),e[34]=a.onToggleSnap,e[35]=L,e[36]=I,e[37]=z,e[38]=B):B=e[38];let S;e[39]!==M||e[40]!==_||e[41]!==x||e[42]!==B||e[43]!==y||e[44]!==b||e[45]!==p?(S=t.jsxs("div",{className:"alive-transport",children:[y,b,p,M,_,H,x,B]}),e[39]=M,e[40]=_,e[41]=x,e[42]=B,e[43]=y,e[44]=b,e[45]=p,e[46]=S):S=e[46];let ne;e[47]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsxs("div",{className:"alive-lane-labels","aria-hidden":"true",children:[t.jsx("span",{className:"alive-lane-ruler"}),t.jsx("span",{className:"alive-lane-audio",children:"Audio"}),t.jsx("span",{className:"alive-lane-words",children:"Words"}),t.jsx("span",{className:"alive-lane-stacks",children:"Stacks"})]}),e[47]=ne):ne=e[47];const he=d*Je;let K;e[48]!==he?(K={minWidth:he},e[48]=he,e[49]=K):K=e[49];let V;e[50]!==d?(V=Ze(d).map(T=>t.jsxs("span",{style:{left:U(T,d)},children:[T,"s"]},T)),e[50]=d,e[51]=V):V=e[51];let q;e[52]!==V?(q=t.jsx("div",{className:"alive-lane-ruler",children:V}),e[52]=V,e[53]=q):q=e[53];let G;e[54]!==l?(G=Te(l),e[54]=l,e[55]=G):G=e[55];let X;e[56]!==G?(X=t.jsx("svg",{viewBox:"0 0 1000 100",preserveAspectRatio:"none","aria-hidden":"true",children:t.jsx("path",{d:G})}),e[56]=G,e[57]=X):X=e[57];let Y;e[58]!==i||e[59]!==d||e[60]!==f?(Y=!f&&i.filter(st).map(T=>t.jsx("span",{className:"alive-onset",style:{left:U(T.onset,d)}},T.key)),e[58]=i,e[59]=d,e[60]=f,e[61]=Y):Y=e[61];let J;e[62]!==X||e[63]!==Y?(J=t.jsxs("div",{className:"alive-lane-audio",children:[X,Y]}),e[62]=X,e[63]=Y,e[64]=J):J=e[64];let Q;if(e[65]!==i||e[66]!==d||e[67]!==f||e[68]!==o){let T;e[70]!==d||e[71]!==f||e[72]!==o?(T=E=>t.jsx("span",{className:"alive-chip","data-active":o>=E.start&&o<E.end||void 0,"data-drifted":E.drifted&&!f||void 0,style:{left:U(E.start,d),width:U(E.end-E.start,d)},children:E.text},E.key),e[70]=d,e[71]=f,e[72]=o,e[73]=T):T=e[73],Q=i.map(T),e[65]=i,e[66]=d,e[67]=f,e[68]=o,e[69]=Q}else Q=e[69];let Z;e[74]!==Q?(Z=t.jsx("div",{className:"alive-lane-words",children:Q}),e[74]=Q,e[75]=Z):Z=e[75];let ee;if(e[76]!==r||e[77]!==h||e[78]!==d){let T;e[80]!==r||e[81]!==d?(T=(E,ye)=>t.jsx("span",{className:"alive-stack-bar","data-active":ye===r||void 0,style:{left:U(E.start,d),width:U(E.end-E.start,d)},children:me(E)},E.id),e[80]=r,e[81]=d,e[82]=T):T=e[82],ee=h.map(T),e[76]=r,e[77]=h,e[78]=d,e[79]=ee}else ee=e[79];let te;e[83]!==ee?(te=t.jsx("div",{className:"alive-lane-stacks",children:ee}),e[83]=ee,e[84]=te):te=e[84];let se;e[85]!==d||e[86]!==o?(se=U(o,d),e[85]=d,e[86]=o,e[87]=se):se=e[87];let le;e[88]!==se?(le=t.jsx("span",{className:"alive-playhead",style:{left:se}}),e[88]=se,e[89]=le):le=e[89];let ae;e[90]!==j||e[91]!==K||e[92]!==q||e[93]!==J||e[94]!==Z||e[95]!==te||e[96]!==le?(ae=t.jsxs("div",{className:"alive-lane-tracks",style:K,onClick:j,role:"presentation",children:[q,J,Z,te,le]}),e[90]=j,e[91]=K,e[92]=q,e[93]=J,e[94]=Z,e[95]=te,e[96]=le,e[97]=ae):ae=e[97];let ie;e[98]!==g||e[99]!==ae?(ie=t.jsxs("div",{className:"alive-lanes",children:[ne,t.jsx("div",{className:"alive-lane-scroll",ref:g,children:ae})]}),e[98]=g,e[99]=ae,e[100]=ie):ie=e[100];let oe;e[101]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsxs("div",{className:"alive-legend","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-chip"}),"Transcript word"]}),t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-drift"}),"Word off its vocal onset"]}),t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-onset"}),"Detected vocal onset"]})]}),e[101]=oe):oe=e[101];let ce;return e[102]!==S||e[103]!==ie?(ce=t.jsxs("section",{className:"alive-panel alive-timeline","aria-label":"Caption timeline",children:[S,ie,oe]}),e[102]=S,e[103]=ie,e[104]=ce):ce=e[104],ce}function st(a){return a.drifted}const ge=30;function lt(a){const e=F.c(3),s=A.useRef(null);let n,o;return e[0]!==a?(n=()=>{const c=s.current;return c?.showModal(),c?.querySelector(".alive-close")?.focus(),()=>{c?.close(),We(a)}},o=[a],e[0]=a,e[1]=n,e[2]=o):(n=e[1],o=e[2]),A.useEffect(n,o),s}function at(a){const e=F.c(6),[s,n]=A.useState(0),[o,c]=A.useState(!1);let l,i;e[0]!==a?(l=()=>{const r=a.current;if(!r)return;const f=g=>n(g.detail.frame),m=()=>c(!0),d=()=>c(!1);return r.addEventListener("frameupdate",f),r.addEventListener("play",m),r.addEventListener("pause",d),()=>{r.removeEventListener("frameupdate",f),r.removeEventListener("play",m),r.removeEventListener("pause",d)}},i=[a],e[0]=a,e[1]=l,e[2]=i):(l=e[1],i=e[2]),A.useEffect(l,i);let h;return e[3]!==s||e[4]!==o?(h={frame:s,playing:o},e[3]=s,e[4]=o,e[5]=h):h=e[5],h}function ft(a){const e=F.c(14),{asset:s,state:n,returnFocus:o,onClose:c}=a,l=lt(o),i=`Alive captions for ${s.label}`;let h;e[0]!==c?(h=m=>{m.preventDefault(),c()},e[0]=c,e[1]=h):h=e[1];let r;e[2]!==s.label||e[3]!==c||e[4]!==a||e[5]!==n.data||e[6]!==n.message||e[7]!==n.status?(r=n.status==="ready"?t.jsx(it,{...a,data:n.data}):t.jsxs("div",{className:"alive-studio-message",children:[t.jsx(je,{label:s.label,detail:null,onClose:c}),t.jsx("p",{role:n.status==="error"?"alert":"status",children:n.status==="error"?n.message:"Analysing vocals, phrases and faces…"})]}),e[2]=s.label,e[3]=c,e[4]=a,e[5]=n.data,e[6]=n.message,e[7]=n.status,e[8]=r):r=e[8];let f;return e[9]!==l||e[10]!==i||e[11]!==h||e[12]!==r?(f=t.jsx("dialog",{className:"alive-studio","aria-label":i,onCancel:h,ref:l,children:r}),e[9]=l,e[10]=i,e[11]=h,e[12]=r,e[13]=f):f=e[13],f}function je(a){const e=F.c(12),{label:s,detail:n,onClose:o,children:c}=a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("h2",{children:"Alive captions"}),e[0]=l):l=e[0];const i=n?` · ${n}`:"";let h;e[1]!==s||e[2]!==i?(h=t.jsxs("span",{className:"alive-muted",children:[s,i]}),e[1]=s,e[2]=i,e[3]=h):h=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"alive-spacer"}),e[4]=r):r=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ie,{size:16}),e[5]=f):f=e[5];let m;e[6]!==o?(m=t.jsx("button",{type:"button",className:"alive-close","aria-label":"Close alive captions",onClick:o,children:f}),e[6]=o,e[7]=m):m=e[7];let d;return e[8]!==c||e[9]!==h||e[10]!==m?(d=t.jsxs("header",{className:"alive-header",children:[l,h,r,c,m]}),e[8]=c,e[9]=h,e[10]=m,e[11]=d):d=e[11],d}function it({asset:a,data:e,onClose:s,onSave:n,onRender:o,onReanalyze:c}){const{analysis:l}=e,i=Math.round(a.fps??ge)||ge,h=Math.max(1,Math.round(l.durationSeconds*i)),[r,f]=A.useState(e.settings),[m,d]=A.useState(()=>Re(a.width,a.height)),[g,u]=A.useState(!0),[j,v]=A.useState(null),[C,y]=A.useState(null),w=A.useRef(null),{frame:$,playing:b}=at(w),N=$/i,P=A.useMemo(()=>Ae(l,m),[l,m]),p=A.useMemo(()=>Me(l.phrases,r,P),[l.phrases,r,P]),k=A.useMemo(()=>_e(l,r),[l,r]),M=A.useMemo(()=>Ee(k),[k]),D=A.useMemo(()=>({mediaUrl:a.mediaUrl,sourceWidth:l.sourceWidth,sourceHeight:l.sourceHeight,cues:p,phrases:l.phrases,settings:r,showRegions:g}),[a.mediaUrl,l,p,r,g]),O=Oe(p,N),_=x=>w.current?.seekTo(Math.max(0,Math.min(h-1,Math.round(x*i)))),H=x=>f(L=>({...L,...x})),W=async(x,L,I)=>{v(x),y(null);try{await L(),y(I)}catch(z){y(z instanceof Error?z.message:String(z))}finally{v(null)}},R=fe.find(x=>x.id===m)??fe[0];return t.jsxs("div",{className:"alive-studio-body",children:[t.jsxs(je,{label:a.label,detail:`${l.sourceWidth}×${l.sourceHeight} · ${i} fps`,onClose:s,children:[t.jsx("div",{className:"alive-segmented",role:"group","aria-label":"Preview orientation",children:fe.map(x=>t.jsx("button",{type:"button","aria-pressed":x.id===m,onClick:()=>d(x.id),children:x.label},x.id))}),t.jsx("button",{type:"button",className:"alive-secondary",disabled:j!==null,onClick:()=>{W("Saving",()=>n(r),"Saved. Renders of this video now use alive captions.")},children:"Save"}),t.jsxs("button",{type:"button",className:"alive-primary",disabled:j!==null,onClick:()=>{W("Rendering",()=>o(r,m),`Saved and queued a ${R.label} render.`)},children:["Render ",R.label]})]}),t.jsxs("div",{className:"alive-main",children:[t.jsx(Xe,{rows:k,phraseLabels:p.map(me),activePhrase:O,time:N,snapped:r.snapToOnsets,onSeek:_}),t.jsxs("div",{className:"alive-stage",children:[t.jsx("div",{className:"alive-player",style:{aspectRatio:`${R.width} / ${R.height}`},children:t.jsx(Ne,{ref:w,component:Ke,inputProps:D,durationInFrames:h,fps:i,compositionWidth:R.width,compositionHeight:R.height,style:{width:"100%",height:"100%"},clickToPlay:!0,spaceKeyToPlayOrPause:!0})}),t.jsx("p",{className:"alive-status",role:"status",children:j?`${j}…`:C??(O>=0?`${me(p[O])} · ${p[O].lines.length} lines`:"Between phrases")})]}),t.jsx(Ye,{settings:r,showRegions:g,regionsAnalyzed:l.regionsAnalyzed,working:j!==null,onChange:H,onShowRegions:u,onReanalyze:()=>{W("Re-running analysis",c,"Analysis refreshed.")}})]}),t.jsx(tt,{duration:l.durationSeconds,fps:i,time:N,playing:b,envelope:l.envelope,rows:k,cues:p,activeCue:O,snapped:r.snapToOnsets,drift:M,onSeek:_,onStep:x=>_(N+x/i),onTogglePlay:()=>w.current?.toggle(),onToggleSnap:()=>H({snapToOnsets:!r.snapToOnsets})})]})}export{ft as AliveCaptionsStudio};
|
|
1
|
+
import{c as F,j as t,a as A}from"./vendor-react-Dj7D1fD4.js";import{u as be,a as pe,V as Se,A as xe,P as Ne}from"./vendor-remotion-CH1HXrlc.js";import{ed as Ce,ee as ke,ef as we,eg as $e,eh as Pe,ei as de,ej as Te,ek as me,el as Re,em as Ae,en as Me,eo as _e,ep as Ee,eq as Oe,er as fe,bw as We}from"./videobook-B5G0jMoi.js";import{g as Le,a6 as ze,_ as Fe,h as He,X as Ie}from"./vendor-icons-CGqhCIXV.js";import"./vendor-yctIZ9Dz.js";import"./vendor-mcp-DQ7EusT9.js";const Be={face:"#63c7d8",text:"#f0a860",graphic:"#f0a860"};function De(a){const e=F.c(25),{phrase:s,cue:n,settings:o,sourceWidth:c,sourceHeight:l}=a,{width:i,height:h}=pe();let r,f,m,d;if(e[0]!==h||e[1]!==s.id||e[2]!==s.regions||e[3]!==o||e[4]!==l||e[5]!==c||e[6]!==i){const j={sourceWidth:c,sourceHeight:l,targetWidth:i,targetHeight:h};let v;e[11]!==s.regions||e[12]!==o?(v=new Set($e(s.regions,o)),e[11]=s.regions,e[12]=o,e[13]=v):v=e[13];const C=v;let y;e[14]!==i?(y=Math.round(i/480),e[14]=i,e[15]=y):y=e[15],f=Math.max(2,y),r=xe,e[16]===Symbol.for("react.memo_cache_sentinel")?(m={pointerEvents:"none"},e[16]=m):m=e[16],d=s.regions.map((w,$)=>{const b=Pe(w,j);return t.jsx("div",{style:{position:"absolute",left:b.x*i,top:b.y*h,width:b.width*i,height:b.height*h,border:`${f}px dashed ${Be[w.kind]}`,opacity:C.has(w)?1:.4,borderRadius:f*2}},`${s.id}-${$}`)}),e[0]=h,e[1]=s.id,e[2]=s.regions,e[3]=o,e[4]=l,e[5]=c,e[6]=i,e[7]=r,e[8]=f,e[9]=m,e[10]=d}else r=e[7],f=e[8],m=e[9],d=e[10];let g;e[17]!==n.column||e[18]!==f?(g=t.jsx(Ue,{column:n.column,stroke:f}),e[17]=n.column,e[18]=f,e[19]=g):g=e[19];let u;return e[20]!==r||e[21]!==m||e[22]!==d||e[23]!==g?(u=t.jsxs(r,{style:m,children:[d,g]}),e[20]=r,e[21]=m,e[22]=d,e[23]=g,e[24]=u):u=e[24],u}function Ue(a){const e=F.c(7),{column:s,stroke:n}=a,o=`${Math.max(1,n/2)}px dashed rgba(114, 231, 170, 0.6)`,c=n*2;let l;return e[0]!==s.height||e[1]!==s.width||e[2]!==s.x||e[3]!==s.y||e[4]!==o||e[5]!==c?(l=t.jsx("div",{style:{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,border:o,borderRadius:c}}),e[0]=s.height,e[1]=s.width,e[2]=s.x,e[3]=s.y,e[4]=o,e[5]=c,e[6]=l):l=e[6],l}function Ke(a){const e=F.c(34),{mediaUrl:s,sourceWidth:n,sourceHeight:o,cues:c,phrases:l,settings:i,showRegions:h}=a,r=be(),{fps:f,width:m,height:d}=pe();let g;e[0]!==d||e[1]!==o||e[2]!==n||e[3]!==m?(g=ke({sourceWidth:n,sourceHeight:o,targetWidth:m,targetHeight:d}),e[0]=d,e[1]=o,e[2]=n,e[3]=m,e[4]=g):g=e[4];const u=g,j=r/f;let v;e[5]!==c||e[6]!==j?(v=Ce(c,j),e[5]=c,e[6]=j,e[7]=v):v=e[7];const C=v;let y;e[8]!==C||e[9]!==l?(y=C?l.find(M=>M.id===C.id):void 0,e[8]=C,e[9]=l,e[10]=y):y=e[10];const w=y;let $;e[11]===Symbol.for("react.memo_cache_sentinel")?($={background:"#000000"},e[11]=$):$=e[11];let b;e[12]!==u.height||e[13]!==u.width||e[14]!==u.x||e[15]!==u.y?(b={position:"absolute",left:u.x,top:u.y,width:u.width,height:u.height},e[12]=u.height,e[13]=u.width,e[14]=u.x,e[15]=u.y,e[16]=b):b=e[16];let N;e[17]!==s||e[18]!==b?(N=t.jsx(Se,{src:s,style:b}),e[17]=s,e[18]=b,e[19]=N):N=e[19];let P;e[20]!==C||e[21]!==w||e[22]!==i||e[23]!==h||e[24]!==o||e[25]!==n?(P=h&&C&&w&&t.jsx(De,{phrase:w,cue:C,settings:i,sourceWidth:n,sourceHeight:o}),e[20]=C,e[21]=w,e[22]=i,e[23]=h,e[24]=o,e[25]=n,e[26]=P):P=e[26];let p;e[27]!==c||e[28]!==i?(p=t.jsx(we,{cues:c,settings:i,strokeWidth:6,strokeColor:"#000000",shadowBlur:6,shadowOpacity:60}),e[27]=c,e[28]=i,e[29]=p):p=e[29];let k;return e[30]!==N||e[31]!==P||e[32]!==p?(k=t.jsxs(xe,{style:$,children:[N,P,p]}),e[30]=N,e[31]=P,e[32]=p,e[33]=k):k=e[33],k}const ue=[{id:"stack",label:"Stack",hint:"Words land one by one and build a stacked block beside the subject, each line sized to fill the column."},{id:"punch",label:"Punch",hint:"One word at a time, as big as the free space allows. Best on fast verses."},{id:"karaoke",label:"Karaoke",hint:"The whole stacked phrase shows dimmed and lights up word by word."}],Ve=[{id:"pop",label:"Pop"},{id:"slam",label:"Slam"},{id:"rise",label:"Rise"}],qe=[{name:"Green",color:"#72E7AA"},{name:"Pink",color:"#F0B9D0"},{name:"Cyan",color:"#63C7D8"},{name:"Amber",color:"#E7C372"}];function Ge(a,e){if(!a.drifted)return de(a.start);const s=a.driftMs>0?"+":"";return e?`${de(a.start)} · snapped`:`${de(a.start)} · ${s}${a.driftMs}ms`}function Xe(a){const e=F.c(21),{rows:s,phraseLabels:n,activePhrase:o,time:c,snapped:l,onSeek:i}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("h3",{children:"Transcript"}),e[0]=h):h=e[0];let r;e[1]!==s.length?(r=t.jsxs("header",{className:"alive-panel-header",children:[h,t.jsxs("p",{children:[s.length," words · timed to the vocal"]})]}),e[1]=s.length,e[2]=r):r=e[2];let f;if(e[3]!==o||e[4]!==i||e[5]!==n||e[6]!==s||e[7]!==l||e[8]!==c){let g;e[10]!==o||e[11]!==i||e[12]!==s||e[13]!==l||e[14]!==c?(g=(u,j)=>t.jsxs("div",{className:"alive-phrase","data-active":j===o||void 0,children:[t.jsxs("div",{className:"alive-phrase-head",children:[t.jsxs("span",{children:["Phrase ",j+1]}),t.jsx("span",{children:u})]}),t.jsx("div",{className:"alive-phrase-words",children:s.filter(v=>v.phraseIndex===j).map(v=>t.jsxs("button",{type:"button",className:"alive-word","data-active":c>=v.start&&c<v.end||void 0,"data-drifted":v.drifted&&!l||void 0,onClick:()=>i(v.start+.03),children:[t.jsx("span",{children:v.text}),t.jsx("small",{children:Ge(v,l)})]},v.key))})]},`${j}-${u}`),e[10]=o,e[11]=i,e[12]=s,e[13]=l,e[14]=c,e[15]=g):g=e[15],f=n.map(g),e[3]=o,e[4]=i,e[5]=n,e[6]=s,e[7]=l,e[8]=c,e[9]=f}else f=e[9];let m;e[16]!==f?(m=t.jsx("div",{className:"alive-transcript-list",children:f}),e[16]=f,e[17]=m):m=e[17];let d;return e[18]!==r||e[19]!==m?(d=t.jsxs("section",{className:"alive-panel alive-transcript","aria-label":"Transcript",children:[r,m]}),e[18]=r,e[19]=m,e[20]=d):d=e[20],d}function ve(a){const e=F.c(10),{label:s,options:n,value:o,onChange:c}=a;let l;if(e[0]!==c||e[1]!==n||e[2]!==o){let h;e[4]!==c||e[5]!==o?(h=r=>t.jsx("button",{type:"button","aria-pressed":r.id===o,onClick:()=>c(r.id),children:r.label},r.id),e[4]=c,e[5]=o,e[6]=h):h=e[6],l=n.map(h),e[0]=c,e[1]=n,e[2]=o,e[3]=l}else l=e[3];let i;return e[7]!==s||e[8]!==l?(i=t.jsx("div",{className:"alive-segmented",role:"group","aria-label":s,children:l}),e[7]=s,e[8]=l,e[9]=i):i=e[9],i}function re(a){const e=F.c(8),{checked:s,onChange:n,children:o}=a;let c;e[0]!==n?(c=h=>n(h.target.checked),e[0]=n,e[1]=c):c=e[1];let l;e[2]!==s||e[3]!==c?(l=t.jsx("input",{type:"checkbox",checked:s,onChange:c}),e[2]=s,e[3]=c,e[4]=l):l=e[4];let i;return e[5]!==o||e[6]!==l?(i=t.jsxs("label",{className:"alive-toggle",children:[l,o]}),e[5]=o,e[6]=l,e[7]=i):i=e[7],i}function Ye(a){const e=F.c(69),{settings:s,showRegions:n,regionsAnalyzed:o,working:c,onChange:l,onShowRegions:i,onReanalyze:h}=a;let r;e[0]!==s.style?(r=ue.find(S=>S.id===s.style)?.hint,e[0]=s.style,e[1]=r):r=e[1];const f=r;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("h4",{children:"Style"}),e[2]=m):m=e[2];let d;e[3]!==l?(d=S=>l({style:S}),e[3]=l,e[4]=d):d=e[4];let g;e[5]!==s.style||e[6]!==d?(g=t.jsx(ve,{label:"Caption style",options:ue,value:s.style,onChange:d}),e[5]=s.style,e[6]=d,e[7]=g):g=e[7];let u;e[8]!==f?(u=t.jsx("p",{className:"alive-hint",children:f}),e[8]=f,e[9]=u):u=e[9];let j;e[10]!==g||e[11]!==u?(j=t.jsxs("div",{className:"alive-field",children:[m,g,u]}),e[10]=g,e[11]=u,e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("h4",{children:"Word entrance"}),e[13]=v):v=e[13];let C;e[14]!==l?(C=S=>l({motion:S}),e[14]=l,e[15]=C):C=e[15];let y;e[16]!==s.motion||e[17]!==C?(y=t.jsxs("div",{className:"alive-field",children:[v,t.jsx(ve,{label:"Word entrance",options:Ve,value:s.motion,onChange:C})]}),e[16]=s.motion,e[17]=C,e[18]=y):y=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("h4",{children:"Frame awareness"}),e[19]=w):w=e[19];let $;e[20]!==l?($=S=>l({avoidFaces:S}),e[20]=l,e[21]=$):$=e[21];let b;e[22]!==s.avoidFaces||e[23]!==$?(b=t.jsx(re,{checked:s.avoidFaces,onChange:$,children:"Keep words off faces"}),e[22]=s.avoidFaces,e[23]=$,e[24]=b):b=e[24];let N;e[25]!==l?(N=S=>l({avoidText:S}),e[25]=l,e[26]=N):N=e[26];let P;e[27]!==s.avoidText||e[28]!==N?(P=t.jsx(re,{checked:s.avoidText,onChange:N,children:"Keep words off on-screen text"}),e[27]=s.avoidText,e[28]=N,e[29]=P):P=e[29];let p;e[30]!==i||e[31]!==n?(p=t.jsx(re,{checked:n,onChange:i,children:"Show detected regions"}),e[30]=i,e[31]=n,e[32]=p):p=e[32];let k;e[33]!==o?(k=!o&&t.jsx("p",{className:"alive-hint alive-warning",children:"Face and text detection did not run, so stacks use the default columns. Set OPENAI_API_KEY and re-run the analysis."}),e[33]=o,e[34]=k):k=e[34];let M;e[35]!==b||e[36]!==P||e[37]!==p||e[38]!==k?(M=t.jsxs("div",{className:"alive-field",children:[w,b,P,p,k]}),e[35]=b,e[36]=P,e[37]=p,e[38]=k,e[39]=M):M=e[39];let D;e[40]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("h4",{children:"Audio"}),e[40]=D):D=e[40];let O;e[41]!==l?(O=S=>l({energySizing:S}),e[41]=l,e[42]=O):O=e[42];let _;e[43]!==s.energySizing||e[44]!==O?(_=t.jsxs("div",{className:"alive-field",children:[D,t.jsx(re,{checked:s.energySizing,onChange:O,children:"Size words by vocal energy"})]}),e[43]=s.energySizing,e[44]=O,e[45]=_):_=e[45];let H;e[46]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("h4",{children:"Hit color"}),e[46]=H):H=e[46];let W;e[47]!==l||e[48]!==s.hitColor?(W=qe.map(S=>t.jsx("button",{type:"button","aria-label":S.name,"aria-pressed":s.hitColor.toUpperCase()===S.color,onClick:()=>l({hitColor:S.color}),children:t.jsx("span",{style:{background:S.color}})},S.color)),e[47]=l,e[48]=s.hitColor,e[49]=W):W=e[49];let R;e[50]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{children:"Text"}),e[50]=R):R=e[50];let x;e[51]!==l?(x=S=>l({textColor:S.target.value.toUpperCase()}),e[51]=l,e[52]=x):x=e[52];let L;e[53]!==s.textColor||e[54]!==x?(L=t.jsxs("label",{className:"alive-color-input",children:[R,t.jsx("input",{type:"color",value:s.textColor,onChange:x})]}),e[53]=s.textColor,e[54]=x,e[55]=L):L=e[55];let I;e[56]!==W||e[57]!==L?(I=t.jsxs("div",{className:"alive-field",children:[H,t.jsxs("div",{className:"alive-swatches",children:[W,L]})]}),e[56]=W,e[57]=L,e[58]=I):I=e[58];let z;e[59]!==h||e[60]!==c?(z=t.jsx("div",{className:"alive-field",children:t.jsx("button",{type:"button",className:"alive-secondary",disabled:c,onClick:h,children:"Re-run analysis"})}),e[59]=h,e[60]=c,e[61]=z):z=e[61];let B;return e[62]!==M||e[63]!==_||e[64]!==I||e[65]!==z||e[66]!==j||e[67]!==y?(B=t.jsxs("section",{className:"alive-panel alive-settings","aria-label":"Caption settings",children:[j,y,M,_,I,z]}),e[62]=M,e[63]=_,e[64]=I,e[65]=z,e[66]=j,e[67]=y,e[68]=B):B=e[68],B}const Je=90;function U(a,e){return`${Math.max(0,a)/e*100}%`}function Qe(a,e,s){if(e.count===0)return`All ${s} words already sit on their vocal onsets`;if(a)return`${e.count} words snapped to their vocal onsets`;const n=e.minMs===e.maxMs?`${e.maxMs}`:`${e.minMs}–${e.maxMs}`;return`${e.count} words start ${n} ms off the vocal`}function Ze(a){const e=a>120?10:a>30?5:1,s=[];for(let n=0;n<=a;n+=e)s.push(n);return s}function et(a,e,s){const n=F.c(5),o=A.useRef(null);let c,l;return n[0]!==e||n[1]!==s||n[2]!==a?(c=()=>{const i=o.current;if(!i||!s)return;const h=a/e*i.scrollWidth;(h<i.scrollLeft||h>i.scrollLeft+i.clientWidth*.85)&&(i.scrollLeft=Math.max(0,h-i.clientWidth*.2))},l=[a,e,s],n[0]=e,n[1]=s,n[2]=a,n[3]=c,n[4]=l):(c=n[3],l=n[4]),A.useEffect(c,l),o}function tt(a){const e=F.c(105),{duration:s,fps:n,time:o,playing:c,envelope:l,rows:i,cues:h,activeCue:r,snapped:f,drift:m}=a,d=Math.max(s,.1),g=et(o,d,c);let u;e[0]!==a||e[1]!==d?(u=T=>{const E=T.currentTarget.getBoundingClientRect();a.onSeek((T.clientX-E.left)/E.width*d)},e[0]=a,e[1]=d,e[2]=u):u=e[2];const j=u;let v;e[3]!==a?(v=()=>a.onStep(-1),e[3]=a,e[4]=v):v=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Le,{size:16}),e[5]=C):C=e[5];let y;e[6]!==v?(y=t.jsx("button",{type:"button","aria-label":"Previous frame",onClick:v,children:C}),e[6]=v,e[7]=y):y=e[7];const w=c?"Pause":"Play";let $;e[8]!==c?($=c?t.jsx(ze,{size:16}):t.jsx(Fe,{size:16}),e[8]=c,e[9]=$):$=e[9];let b;e[10]!==a.onTogglePlay||e[11]!==w||e[12]!==$?(b=t.jsx("button",{type:"button",className:"alive-play","aria-label":w,onClick:a.onTogglePlay,children:$}),e[10]=a.onTogglePlay,e[11]=w,e[12]=$,e[13]=b):b=e[13];let N;e[14]!==a?(N=()=>a.onStep(1),e[14]=a,e[15]=N):N=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(He,{size:16}),e[16]=P):P=e[16];let p;e[17]!==N?(p=t.jsx("button",{type:"button","aria-label":"Next frame",onClick:N,children:P}),e[17]=N,e[18]=p):p=e[18];let k;e[19]!==o?(k=de(o),e[19]=o,e[20]=k):k=e[20];let M;e[21]!==k?(M=t.jsx("strong",{className:"alive-clock",children:k}),e[21]=k,e[22]=M):M=e[22];const D=Math.floor(o*n),O=Math.floor(d*n);let _;e[23]!==D||e[24]!==O?(_=t.jsxs("span",{className:"alive-muted",children:["frame ",D," / ",O]}),e[23]=D,e[24]=O,e[25]=_):_=e[25];let H;e[26]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("span",{className:"alive-spacer"}),e[26]=H):H=e[26];const W=m.count>0&&!f||void 0;let R;e[27]!==m||e[28]!==i.length||e[29]!==f?(R=Qe(f,m,i.length),e[27]=m,e[28]=i.length,e[29]=f,e[30]=R):R=e[30];let x;e[31]!==W||e[32]!==R?(x=t.jsx("span",{className:"alive-drift","data-drifted":W,children:R}),e[31]=W,e[32]=R,e[33]=x):x=e[33];const L=f?"alive-secondary":"alive-primary alive-warn",I=m.count===0,z=f?"Use transcript timing":"Snap words to audio";let B;e[34]!==a.onToggleSnap||e[35]!==L||e[36]!==I||e[37]!==z?(B=t.jsx("button",{type:"button",className:L,disabled:I,onClick:a.onToggleSnap,children:z}),e[34]=a.onToggleSnap,e[35]=L,e[36]=I,e[37]=z,e[38]=B):B=e[38];let S;e[39]!==M||e[40]!==_||e[41]!==x||e[42]!==B||e[43]!==y||e[44]!==b||e[45]!==p?(S=t.jsxs("div",{className:"alive-transport",children:[y,b,p,M,_,H,x,B]}),e[39]=M,e[40]=_,e[41]=x,e[42]=B,e[43]=y,e[44]=b,e[45]=p,e[46]=S):S=e[46];let ne;e[47]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsxs("div",{className:"alive-lane-labels","aria-hidden":"true",children:[t.jsx("span",{className:"alive-lane-ruler"}),t.jsx("span",{className:"alive-lane-audio",children:"Audio"}),t.jsx("span",{className:"alive-lane-words",children:"Words"}),t.jsx("span",{className:"alive-lane-stacks",children:"Stacks"})]}),e[47]=ne):ne=e[47];const he=d*Je;let K;e[48]!==he?(K={minWidth:he},e[48]=he,e[49]=K):K=e[49];let V;e[50]!==d?(V=Ze(d).map(T=>t.jsxs("span",{style:{left:U(T,d)},children:[T,"s"]},T)),e[50]=d,e[51]=V):V=e[51];let q;e[52]!==V?(q=t.jsx("div",{className:"alive-lane-ruler",children:V}),e[52]=V,e[53]=q):q=e[53];let G;e[54]!==l?(G=Te(l),e[54]=l,e[55]=G):G=e[55];let X;e[56]!==G?(X=t.jsx("svg",{viewBox:"0 0 1000 100",preserveAspectRatio:"none","aria-hidden":"true",children:t.jsx("path",{d:G})}),e[56]=G,e[57]=X):X=e[57];let Y;e[58]!==i||e[59]!==d||e[60]!==f?(Y=!f&&i.filter(st).map(T=>t.jsx("span",{className:"alive-onset",style:{left:U(T.onset,d)}},T.key)),e[58]=i,e[59]=d,e[60]=f,e[61]=Y):Y=e[61];let J;e[62]!==X||e[63]!==Y?(J=t.jsxs("div",{className:"alive-lane-audio",children:[X,Y]}),e[62]=X,e[63]=Y,e[64]=J):J=e[64];let Q;if(e[65]!==i||e[66]!==d||e[67]!==f||e[68]!==o){let T;e[70]!==d||e[71]!==f||e[72]!==o?(T=E=>t.jsx("span",{className:"alive-chip","data-active":o>=E.start&&o<E.end||void 0,"data-drifted":E.drifted&&!f||void 0,style:{left:U(E.start,d),width:U(E.end-E.start,d)},children:E.text},E.key),e[70]=d,e[71]=f,e[72]=o,e[73]=T):T=e[73],Q=i.map(T),e[65]=i,e[66]=d,e[67]=f,e[68]=o,e[69]=Q}else Q=e[69];let Z;e[74]!==Q?(Z=t.jsx("div",{className:"alive-lane-words",children:Q}),e[74]=Q,e[75]=Z):Z=e[75];let ee;if(e[76]!==r||e[77]!==h||e[78]!==d){let T;e[80]!==r||e[81]!==d?(T=(E,ye)=>t.jsx("span",{className:"alive-stack-bar","data-active":ye===r||void 0,style:{left:U(E.start,d),width:U(E.end-E.start,d)},children:me(E)},E.id),e[80]=r,e[81]=d,e[82]=T):T=e[82],ee=h.map(T),e[76]=r,e[77]=h,e[78]=d,e[79]=ee}else ee=e[79];let te;e[83]!==ee?(te=t.jsx("div",{className:"alive-lane-stacks",children:ee}),e[83]=ee,e[84]=te):te=e[84];let se;e[85]!==d||e[86]!==o?(se=U(o,d),e[85]=d,e[86]=o,e[87]=se):se=e[87];let le;e[88]!==se?(le=t.jsx("span",{className:"alive-playhead",style:{left:se}}),e[88]=se,e[89]=le):le=e[89];let ae;e[90]!==j||e[91]!==K||e[92]!==q||e[93]!==J||e[94]!==Z||e[95]!==te||e[96]!==le?(ae=t.jsxs("div",{className:"alive-lane-tracks",style:K,onClick:j,role:"presentation",children:[q,J,Z,te,le]}),e[90]=j,e[91]=K,e[92]=q,e[93]=J,e[94]=Z,e[95]=te,e[96]=le,e[97]=ae):ae=e[97];let ie;e[98]!==g||e[99]!==ae?(ie=t.jsxs("div",{className:"alive-lanes",children:[ne,t.jsx("div",{className:"alive-lane-scroll",ref:g,children:ae})]}),e[98]=g,e[99]=ae,e[100]=ie):ie=e[100];let oe;e[101]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsxs("div",{className:"alive-legend","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-chip"}),"Transcript word"]}),t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-drift"}),"Word off its vocal onset"]}),t.jsxs("span",{children:[t.jsx("i",{className:"alive-legend-onset"}),"Detected vocal onset"]})]}),e[101]=oe):oe=e[101];let ce;return e[102]!==S||e[103]!==ie?(ce=t.jsxs("section",{className:"alive-panel alive-timeline","aria-label":"Caption timeline",children:[S,ie,oe]}),e[102]=S,e[103]=ie,e[104]=ce):ce=e[104],ce}function st(a){return a.drifted}const ge=30;function lt(a){const e=F.c(3),s=A.useRef(null);let n,o;return e[0]!==a?(n=()=>{const c=s.current;return c?.showModal(),c?.querySelector(".alive-close")?.focus(),()=>{c?.close(),We(a)}},o=[a],e[0]=a,e[1]=n,e[2]=o):(n=e[1],o=e[2]),A.useEffect(n,o),s}function at(a){const e=F.c(6),[s,n]=A.useState(0),[o,c]=A.useState(!1);let l,i;e[0]!==a?(l=()=>{const r=a.current;if(!r)return;const f=g=>n(g.detail.frame),m=()=>c(!0),d=()=>c(!1);return r.addEventListener("frameupdate",f),r.addEventListener("play",m),r.addEventListener("pause",d),()=>{r.removeEventListener("frameupdate",f),r.removeEventListener("play",m),r.removeEventListener("pause",d)}},i=[a],e[0]=a,e[1]=l,e[2]=i):(l=e[1],i=e[2]),A.useEffect(l,i);let h;return e[3]!==s||e[4]!==o?(h={frame:s,playing:o},e[3]=s,e[4]=o,e[5]=h):h=e[5],h}function ft(a){const e=F.c(14),{asset:s,state:n,returnFocus:o,onClose:c}=a,l=lt(o),i=`Alive captions for ${s.label}`;let h;e[0]!==c?(h=m=>{m.preventDefault(),c()},e[0]=c,e[1]=h):h=e[1];let r;e[2]!==s.label||e[3]!==c||e[4]!==a||e[5]!==n.data||e[6]!==n.message||e[7]!==n.status?(r=n.status==="ready"?t.jsx(it,{...a,data:n.data}):t.jsxs("div",{className:"alive-studio-message",children:[t.jsx(je,{label:s.label,detail:null,onClose:c}),t.jsx("p",{role:n.status==="error"?"alert":"status",children:n.status==="error"?n.message:"Analysing vocals, phrases and faces…"})]}),e[2]=s.label,e[3]=c,e[4]=a,e[5]=n.data,e[6]=n.message,e[7]=n.status,e[8]=r):r=e[8];let f;return e[9]!==l||e[10]!==i||e[11]!==h||e[12]!==r?(f=t.jsx("dialog",{className:"alive-studio","aria-label":i,onCancel:h,ref:l,children:r}),e[9]=l,e[10]=i,e[11]=h,e[12]=r,e[13]=f):f=e[13],f}function je(a){const e=F.c(12),{label:s,detail:n,onClose:o,children:c}=a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("h2",{children:"Alive captions"}),e[0]=l):l=e[0];const i=n?` · ${n}`:"";let h;e[1]!==s||e[2]!==i?(h=t.jsxs("span",{className:"alive-muted",children:[s,i]}),e[1]=s,e[2]=i,e[3]=h):h=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"alive-spacer"}),e[4]=r):r=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ie,{size:16}),e[5]=f):f=e[5];let m;e[6]!==o?(m=t.jsx("button",{type:"button",className:"alive-close","aria-label":"Close alive captions",onClick:o,children:f}),e[6]=o,e[7]=m):m=e[7];let d;return e[8]!==c||e[9]!==h||e[10]!==m?(d=t.jsxs("header",{className:"alive-header",children:[l,h,r,c,m]}),e[8]=c,e[9]=h,e[10]=m,e[11]=d):d=e[11],d}function it({asset:a,data:e,onClose:s,onSave:n,onRender:o,onReanalyze:c}){const{analysis:l}=e,i=Math.round(a.fps??ge)||ge,h=Math.max(1,Math.round(l.durationSeconds*i)),[r,f]=A.useState(e.settings),[m,d]=A.useState(()=>Re(a.width,a.height)),[g,u]=A.useState(!0),[j,v]=A.useState(null),[C,y]=A.useState(null),w=A.useRef(null),{frame:$,playing:b}=at(w),N=$/i,P=A.useMemo(()=>Ae(l,m),[l,m]),p=A.useMemo(()=>Me(l.phrases,r,P),[l.phrases,r,P]),k=A.useMemo(()=>_e(l,r),[l,r]),M=A.useMemo(()=>Ee(k),[k]),D=A.useMemo(()=>({mediaUrl:a.mediaUrl,sourceWidth:l.sourceWidth,sourceHeight:l.sourceHeight,cues:p,phrases:l.phrases,settings:r,showRegions:g}),[a.mediaUrl,l,p,r,g]),O=Oe(p,N),_=x=>w.current?.seekTo(Math.max(0,Math.min(h-1,Math.round(x*i)))),H=x=>f(L=>({...L,...x})),W=async(x,L,I)=>{v(x),y(null);try{await L(),y(I)}catch(z){y(z instanceof Error?z.message:String(z))}finally{v(null)}},R=fe.find(x=>x.id===m)??fe[0];return t.jsxs("div",{className:"alive-studio-body",children:[t.jsxs(je,{label:a.label,detail:`${l.sourceWidth}×${l.sourceHeight} · ${i} fps`,onClose:s,children:[t.jsx("div",{className:"alive-segmented",role:"group","aria-label":"Preview orientation",children:fe.map(x=>t.jsx("button",{type:"button","aria-pressed":x.id===m,onClick:()=>d(x.id),children:x.label},x.id))}),t.jsx("button",{type:"button",className:"alive-secondary",disabled:j!==null,onClick:()=>{W("Saving",()=>n(r),"Saved. Renders of this video now use alive captions.")},children:"Save"}),t.jsxs("button",{type:"button",className:"alive-primary",disabled:j!==null,onClick:()=>{W("Rendering",()=>o(r,m),`Saved and queued a ${R.label} render.`)},children:["Render ",R.label]})]}),t.jsxs("div",{className:"alive-main",children:[t.jsx(Xe,{rows:k,phraseLabels:p.map(me),activePhrase:O,time:N,snapped:r.snapToOnsets,onSeek:_}),t.jsxs("div",{className:"alive-stage",children:[t.jsx("div",{className:"alive-player",style:{aspectRatio:`${R.width} / ${R.height}`},children:t.jsx(Ne,{ref:w,component:Ke,inputProps:D,durationInFrames:h,fps:i,compositionWidth:R.width,compositionHeight:R.height,style:{width:"100%",height:"100%"},clickToPlay:!0,spaceKeyToPlayOrPause:!0})}),t.jsx("p",{className:"alive-status",role:"status",children:j?`${j}…`:C??(O>=0?`${me(p[O])} · ${p[O].lines.length} lines`:"Between phrases")})]}),t.jsx(Ye,{settings:r,showRegions:g,regionsAnalyzed:l.regionsAnalyzed,working:j!==null,onChange:H,onShowRegions:u,onReanalyze:()=>{W("Re-running analysis",c,"Analysis refreshed.")}})]}),t.jsx(tt,{duration:l.durationSeconds,fps:i,time:N,playing:b,envelope:l.envelope,rows:k,cues:p,activeCue:O,snapped:r.snapToOnsets,drift:M,onSeek:_,onStep:x=>_(N+x/i),onTogglePlay:()=>w.current?.toggle(),onToggleSnap:()=>H({snapToOnsets:!r.snapToOnsets})})]})}export{ft as AliveCaptionsStudio};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as de,a as we,j as t}from"./vendor-react-Dj7D1fD4.js";import{c0 as ll,c1 as sl,c2 as nl,c3 as il,i as al,c4 as rl,c5 as ol,c6 as cl,c7 as Qt,c8 as qt,c9 as Bt,ca as dl,cb as ml,ad as ul,cc as hl,cd as fl,ce as pl,cf as xl,cg as Ct,ch as gl,ci as Pt,cj as bl,b2 as vl,E as jl,ck as yl,b3 as wl,cl as Nl,cm as Wt,ae as Sl,cn as Cl,Y as Pl,co as kl,bI as _l,b4 as El,b5 as Al,cp as $l,cq as Rl,cr as Tl,cs as Ze,ct as kt,cu as _t,cv as Il,cw as Ll,cx as Et,cy as Ml,cz as Fl,cA as Dl,cB as Ol,cC as Hl,cD as Ul,cE as Vl,be as Ql,cF as ql,x as Bl,cG as Wl,cH as zl,cI as Gl,cJ as Kl,cK as Yl,cL as Xl,cM as Jl,cN as zt,cO as Zl,cP as At,cQ as $t,cR as Rt,cS as es,cT as ts,cU as Tt,cV as It,cW as ls,cX as ss,cY as ns,cZ as is,c_ as as,c$ as yt,d0 as rs,d1 as Gt,d2 as os,d3 as cs,d4 as ds,d5 as ms,d6 as us}from"./videobook-B5G0jMoi.js";import{P as hs,I as fs,G as Lt,V as ps,a as xs,D as gs,R as bs,M as vs}from"./ui-Cpr6zMTA.js";import{F as Kt,ac as St,c as wt,x as Yt,g as js,h as ys,X as Xt,m as ws,i as Ns,k as Ss,w as Cs,V as Ps,ai as ks,ad as _s,_ as Mt}from"./vendor-icons-CGqhCIXV.js";function An(i){const e=de.c(40),{review:s,onChange:l,disabled:n}=i,a=we.useRef(null),r=we.useRef(null),u=we.useRef(!1),[c,p]=we.useState(null),o=s.suggestion,f=o?.startSeconds??0,d=o?.endSeconds??0,m=o?.fps??30;let h;e[0]!==d||e[1]!==o||e[2]!==f?(h=o?ll(f,d,o.durationSeconds):null,e[0]=d,e[1]=o,e[2]=f,e[3]=h):h=e[3];const x=h;let g;e[4]!==d||e[5]!==m?(g=()=>{const N=a.current;if(!N)return;N.pause(),r.current=null;let E=0;const I=()=>{!N.seeking&&r.current==="hook"&&N.currentTime>=d-.5/m&&(u.current?(r.current="full",N.currentTime=0,N.play().catch(()=>p("Press Play to resume the preview."))):(r.current=null,N.pause())),E=requestAnimationFrame(I)};return E=requestAnimationFrame(I),()=>{cancelAnimationFrame(E),N.pause()}},e[4]=d,e[5]=m,e[6]=g):g=e[6];let S;e[7]!==d||e[8]!==m||e[9]!==s.mediaUrl||e[10]!==f?(S=[s.mediaUrl,f,d,m],e[7]=d,e[8]=m,e[9]=s.mediaUrl,e[10]=f,e[11]=S):S=e[11],we.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 R;return e[37]!==$||e[38]!==b?(R=t.jsxs("div",{className:"cold-open-review-body",children:[b,$]}),e[37]=$,e[38]=b,e[39]=R):R=e[39],R}const Es={en:"EN",th:"TH · ไทย"};function As(i){if(!i)return"Media details unavailable";const e=[i.duration?ul(i.duration):null,i.width&&i.height?`${i.width}×${i.height}`:null].filter(Boolean);return e.length?e.join(" · "):i.type}function $s(i){const e=de.c(34),{post:s,asset:l,onOpenPost:n}=i,a=!!s.definition.source?.snapshotArtifactId;let r;e[0]!==l||e[1]!==s.address?(r=l?.mediaUrl&&l.type==="image"?t.jsx("img",{src:l.mediaUrl,alt:""}):l?.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":`${s.address} clip`}):t.jsx("span",{className:"post-delivery-media-fallback",children:t.jsx(Kt,{size:18,"aria-hidden":"true"})}),e[0]=l,e[1]=s.address,e[2]=r):r=e[2];const u=r,c=`post-delivery-post${a?"":" post-delivery-post-blocked"}`,p=`Post ${s.address}`;let o;e[3]!==u?(o=t.jsx("div",{className:"post-delivery-media",children:u}),e[3]=u,e[4]=o):o=e[4];const f=l?.label??s.label;let d;e[5]!==s.address||e[6]!==f?(d=t.jsxs("strong",{children:[s.address," · ",f]}),e[5]=s.address,e[6]=f,e[7]=d):d=e[7];let m;e[8]!==l?(m=As(l),e[8]=l,e[9]=m):m=e[9];let h;e[10]!==m?(h=t.jsx("span",{children:m}),e[10]=m,e[11]=h):h=e[11];let x;e[12]!==a||e[13]!==s.definition.createdAt?(x=a?t.jsxs("span",{children:["Clip saved ",new Date(s.definition.createdAt).toLocaleString()]}):t.jsxs("span",{className:"post-delivery-warning",children:[t.jsx(St,{size:12,"aria-hidden":"true"}),"No saved source clip"]}),e[12]=a,e[13]=s.definition.createdAt,e[14]=x):x=e[14];let g;e[15]!==s.runtime.icloud?.completedAt?(g=s.runtime.icloud?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Already on iPhone; saving again checks the files"]}),e[15]=s.runtime.icloud?.completedAt,e[16]=g):g=e[16];let S;e[17]!==s.runtime.dropbox?.completedAt?(S=s.runtime.dropbox?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Already in Dropbox; uploading again checks the files"]}),e[17]=s.runtime.dropbox?.completedAt,e[18]=S):S=e[18];let j;e[19]!==a||e[20]!==n?(j=!a&&t.jsx("button",{type:"button",onClick:n,children:"Choose a clip in the Post panel"}),e[19]=a,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==g||e[23]!==S||e[24]!==j||e[25]!==d||e[26]!==h||e[27]!==x?(C=t.jsxs("div",{className:"post-delivery-post-copy",children:[d,h,x,g,S,j]}),e[22]=g,e[23]=S,e[24]=j,e[25]=d,e[26]=h,e[27]=x,e[28]=C):C=e[28];let y;return e[29]!==C||e[30]!==c||e[31]!==p||e[32]!==o?(y=t.jsxs("article",{className:c,"aria-label":p,children:[o,C]}),e[29]=C,e[30]=c,e[31]=p,e[32]=o,e[33]=y):y=e[33],y}function Rs(i){const e=de.c(17),{review:s,disabled:l,onCopyChange:n,onLanguage:a}=i,r=s.copy;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"post-delivery-heading",children:"Platform"}),e[0]=u):u=e[0];let c;e[1]!==r||e[2]!==l||e[3]!==n?(c=pl.map(h=>t.jsx("button",{type:"button","aria-pressed":r.platform===h.id,disabled:l,onClick:()=>n({...r,platform:h.id}),children:h.label},h.id)),e[1]=r,e[2]=l,e[3]=n,e[4]=c):c=e[4];let p;e[5]!==c?(p=t.jsxs("div",{className:"post-copy-group",children:[u,t.jsx("div",{className:"post-delivery-switch",role:"group","aria-label":"Platform",children:c})]}),e[5]=c,e[6]=p):p=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("span",{className:"post-delivery-heading",children:"Language"}),e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==l||e[10]!==a?(f=xl.map(h=>t.jsx("button",{type:"button","aria-pressed":r.language===h,disabled:l,onClick:()=>a(h),children:Es[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 Ts(i){const e=de.c(21),{copy:s,disabled:l,onCopyChange:n}=i,a=s.tracks[s.language];if(!a||a.versions.length<2)return null;const r=l||a.index===0;let u;e[0]!==s||e[1]!==n?(u=()=>n(Ct(s,-1)),e[0]=s,e[1]=n,e[2]=u):u=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(js,{size:12,"aria-hidden":"true"}),e[3]=c):c=e[3];let p;e[4]!==r||e[5]!==u?(p=t.jsx("button",{type:"button","aria-label":"Previous caption version",disabled:r,onClick:u,children:c}),e[4]=r,e[5]=u,e[6]=p):p=e[6];const o=a.index+1;let f;e[7]!==o||e[8]!==a.versions.length?(f=t.jsxs("small",{children:["v",o,"/",a.versions.length]}),e[7]=o,e[8]=a.versions.length,e[9]=f):f=e[9];const d=l||a.index===a.versions.length-1;let m;e[10]!==s||e[11]!==n?(m=()=>n(Ct(s,1)),e[10]=s,e[11]=n,e[12]=m):m=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ys,{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 Is(i){const e=de.c(37),{copy:s,disabled:l,onCopyChange:n}=i,[a,r]=we.useState("");let u,c,p,o,f,d,m,h;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==n){h=Qt(s)?.tags??[];let y;e[12]!==s||e[13]!==a||e[14]!==n?(y=()=>{a.trim()&&(n(gl(s,a)),r(""))},e[12]=s,e[13]=a,e[14]=n,e[15]=y):y=e[15],u=y,c=b=>{b.key==="Enter"||b.key===","?(b.preventDefault(),u()):b.key==="Backspace"&&!a&&h.length&&n(Pt(s,h[h.length-1]))},d="post-copy-tags";let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("label",{htmlFor:"post-delivery-tag",children:"Tags"}),e[16]=k):k=e[16],m=t.jsxs("div",{className:"post-delivery-label-row",children:[k,t.jsxs("small",{children:[h.length," · added after the caption"]})]}),p="post-copy-tag-field",o=s.language;let w;e[17]!==s||e[18]!==l||e[19]!==n?(w=b=>t.jsxs("span",{className:"post-copy-tag",children:["#",b,t.jsx("button",{type:"button","aria-label":`Remove tag ${b}`,disabled:l,onClick:()=>n(Pt(s,b)),children:t.jsx(Xt,{size:11,"aria-hidden":"true"})})]},b),e[17]=s,e[18]=l,e[19]=n,e[20]=w):w=e[20],f=h.map(w),e[0]=s,e[1]=l,e[2]=a,e[3]=n,e[4]=u,e[5]=c,e[6]=p,e[7]=o,e[8]=f,e[9]=d,e[10]=m,e[11]=h}else u=e[4],c=e[5],p=e[6],o=e[7],f=e[8],d=e[9],m=e[10],h=e[11];const x=h.length?"+ tag":"Add a tag, then Enter";let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=y=>r(y.target.value),e[21]=g):g=e[21];let S;e[22]!==u||e[23]!==l||e[24]!==a||e[25]!==c||e[26]!==x?(S=t.jsx("input",{id:"post-delivery-tag",type:"text",value:a,disabled:l,spellCheck:!1,placeholder:x,onChange:g,onKeyDown:c,onBlur:u}),e[22]=u,e[23]=l,e[24]=a,e[25]=c,e[26]=x,e[27]=S):S=e[27];let j;e[28]!==p||e[29]!==o||e[30]!==f||e[31]!==S?(j=t.jsxs("div",{className:p,lang:o,children:[f,S]}),e[28]=p,e[29]=o,e[30]=f,e[31]=S,e[32]=j):j=e[32];let C;return e[33]!==d||e[34]!==m||e[35]!==j?(C=t.jsxs("div",{className:d,children:[m,j]}),e[33]=d,e[34]=m,e[35]=j,e[36]=C):C=e[36],C}function Ls(i){const e=de.c(34),{copy:s,disabled:l,onCopyChange:n,onRegen:a}=i;let r;e[0]!==s||e[1]!==n?(r=w=>n({...s,prompt:s.prompt.trim()?`${s.prompt.trim()}, ${w.toLowerCase()}`:w}),e[0]=s,e[1]=n,e[2]=r):r=e[2];const u=r;let c;e[3]!==l||e[4]!==a?(c=w=>{w.key!=="Enter"||w.metaKey||w.ctrlKey||(w.preventDefault(),l||a())},e[3]=l,e[4]=a,e[5]=c):c=e[5];const p=c;let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("label",{htmlFor:"post-delivery-astra",children:"Regen with Astra"}),e[6]=o):o=e[6];const f=Bt[s.platform],d=qt[s.language];let m;e[7]!==f||e[8]!==d?(m=t.jsxs("div",{className:"post-delivery-label-row",children:[o,t.jsxs("small",{children:["video analysis + your note · ",f," · ",d]})]}),e[7]=f,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==n?(h=w=>n({...s,prompt:w.target.value}),e[10]=s,e[11]=n,e[12]=h):h=e[12];let x;e[13]!==s.prompt||e[14]!==l||e[15]!==p||e[16]!==h?(x=t.jsx("input",{id:"post-delivery-astra",type:"text",value:s.prompt,disabled:l,maxLength:1e3,placeholder:"Tell Astra how to rewrite — punchier hook, mention the rain, 3 tags…",onChange:h,onKeyDown:p}),e[13]=s.prompt,e[14]=l,e[15]=p,e[16]=h,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Yt,{size:12,"aria-hidden":"true"}),e[18]=g):g=e[18];let S;e[19]!==l||e[20]!==a?(S=t.jsxs("button",{type:"button",className:"post-copy-regen-button",disabled:l,onClick:a,children:[g,"Regen post"]}),e[19]=l,e[20]=a,e[21]=S):S=e[21];let j;e[22]!==S||e[23]!==x?(j=t.jsxs("div",{className:"post-copy-regen-row",children:[x,S]}),e[22]=S,e[23]=x,e[24]=j):j=e[24];let C;e[25]!==u||e[26]!==l?(C=hl.map(w=>t.jsx("button",{type:"button",disabled:l,onClick:()=>u(w),children:w},w)),e[25]=u,e[26]=l,e[27]=C):C=e[27];let y;e[28]!==C?(y=t.jsx("div",{className:"post-copy-presets",children:C}),e[28]=C,e[29]=y):y=e[29];let k;return e[30]!==j||e[31]!==y||e[32]!==m?(k=t.jsxs("div",{className:"post-copy-regen",children:[m,j,y]}),e[30]=j,e[31]=y,e[32]=m,e[33]=k):k=e[33],k}function Ms(i){const e=de.c(84),{post:s,review:l,busy:n,onCopyChange:a,onLanguage:r,onRegen:u}=i;let c;e[0]!==s?(c=ol(s),e[0]=s,e[1]=c):c=e[1];const p=c,o=l.copy,f=o.drafting?.language===o.language,d=n||p;let m,h,x,g,S,j,C,y,k,w,b;if(e[2]!==o||e[3]!==d||e[4]!==a||e[5]!==r||e[6]!==l){const B=cl(o);let se;e[18]!==o?(se=Qt(o),e[18]=o,e[19]=se):se=e[19],b=se;const W=b&&b.origin!=="saved"&&b.origin!=="edited";m="post-delivery-caption";const M=d||!!o.drafting;e[20]!==a||e[21]!==r||e[22]!==l||e[23]!==M?(h=t.jsx(Rs,{review:l,disabled:M,onCopyChange:a,onLanguage:r}),e[20]=a,e[21]=r,e[22]=l,e[23]=M,e[24]=h):h=e[24],k="post-delivery-label-row";let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("label",{htmlFor:"post-delivery-caption",children:"Caption"}),e[25]=X):X=e[25];let T;e[26]!==W?(T=W&&t.jsxs("span",{className:"post-copy-badge",children:[t.jsx(Yt,{size:10,"aria-hidden":"true"}),"Auto · from video analysis"]}),e[26]=W,e[27]=T):T=e[27],e[28]!==T?(w=t.jsxs("span",{className:"post-copy-caption-label",children:[X,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(Ts,{copy:o,disabled:U,onCopyChange:a}),e[30]=o,e[31]=a,e[32]=U,e[33]=y):y=e[33],x=B.over||B.length>fl?"confirm-field-error":void 0,g=B.length.toLocaleString(),S=" / ",j=B.limit.toLocaleString(),e[2]=o,e[3]=d,e[4]=a,e[5]=r,e[6]=l,e[7]=m,e[8]=h,e[9]=x,e[10]=g,e[11]=S,e[12]=j,e[13]=C,e[14]=y,e[15]=k,e[16]=w,e[17]=b}else m=e[7],h=e[8],x=e[9],g=e[10],S=e[11],j=e[12],C=e[13],y=e[14],k=e[15],w=e[16],b=e[17];let v;e[34]!==x||e[35]!==g||e[36]!==S||e[37]!==j?(v=t.jsxs("small",{className:x,children:[g,S,j]}),e[34]=x,e[35]=g,e[36]=S,e[37]=j,e[38]=v):v=e[38];let _;e[39]!==v||e[40]!==C||e[41]!==y?(_=t.jsxs("span",{className:C,children:[y,v]}),e[39]=v,e[40]=C,e[41]=y,e[42]=_):_=e[42];let $;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 R;e[47]!==n||e[48]!==o||e[49]!==f||e[50]!==p||e[51]!==a||e[52]!==s||e[53]!==b?.body?(R=f?t.jsxs("div",{className:"post-copy-drafting",role:"status",children:["Astra is writing the ",qt[o.language]," caption for ",Bt[o.platform],"…"]}):t.jsx("textarea",{id:"post-delivery-caption",lang:o.language,value:p?s.definition.caption:b?.body??"",disabled:n,readOnly:p,placeholder:"Write the caption that ships with this clip…",onChange:B=>a(dl(o,{body:B.target.value}))}),e[47]=n,e[48]=o,e[49]=f,e[50]=p,e[51]=a,e[52]=s,e[53]=b?.body,e[54]=R):R=e[54];let N;e[55]!==o.error?(N=o.error&&t.jsx("small",{className:"confirm-field-error",children:o.error}),e[55]=o.error,e[56]=N):N=e[56];let E;e[57]!==o||e[58]!==d||e[59]!==f||e[60]!==p||e[61]!==a?(E=!p&&t.jsx(Is,{copy:o,disabled:d||f,onCopyChange:a}),e[57]=o,e[58]=d,e[59]=f,e[60]=p,e[61]=a,e[62]=E):E=e[62];let I;e[63]!==o||e[64]!==p||e[65]!==s?(I=p?"Frozen at the first delivery. Create a new Post to change it.":`${ml(o)} · Saved to ${s.address} and written to caption.txt${s.definition.credits?" with its credits":""}.`,e[63]=o,e[64]=p,e[65]=s,e[66]=I):I=e[66];let F;e[67]!==I?(F=t.jsx("small",{children:I}),e[67]=I,e[68]=F):F=e[68];let D;e[69]!==n||e[70]!==o||e[71]!==p||e[72]!==a||e[73]!==u?(D=!p&&t.jsx(Ls,{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]!==R||e[79]!==N||e[80]!==E||e[81]!==F||e[82]!==D?(L=t.jsxs("div",{className:m,children:[h,$,R,N,E,F,D]}),e[75]=m,e[76]=h,e[77]=$,e[78]=R,e[79]=N,e[80]=E,e[81]=F,e[82]=D,e[83]=L):L=e[83],L}function Fs(i){const e=de.c(19),{review:s,busy:l,onConnect:n,onCheckConnection:a}=i,r=s.connection;if(!r){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"post-delivery-account",children:"Checking Dropbox…"}),e[0]=x):x=e[0],x}if(r.connected){let x;return e[1]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("p",{className:"post-delivery-account post-delivery-account-ready",children:[t.jsx(wt,{size:12,"aria-hidden":"true"}),"Dropbox connected"]}),e[1]=x):x=e[1],x}const u=s.connecting||r.pending?"Waiting for Dropbox approval…":"Dropbox not connected";let c;e[2]!==u?(c=t.jsx("span",{children:u}),e[2]=u,e[3]=c):c=e[3];const p=l||s.connecting||!r.hasCredentials;let o;e[4]!==n||e[5]!==p?(o=t.jsx("button",{type:"button",disabled:p,onClick:n,children:"Connect Dropbox ↗"}),e[4]=n,e[5]=p,e[6]=o):o=e[6];let f;e[7]!==l||e[8]!==a?(f=t.jsx("button",{type:"button",disabled:l,onClick:a,children:"Check again"}),e[7]=l,e[8]=a,e[9]=f):f=e[9];let d;e[10]!==o||e[11]!==f?(d=t.jsxs("div",{children:[o,f]}),e[10]=o,e[11]=f,e[12]=d):d=e[12];let m;e[13]!==r.error?(m=r.error&&t.jsx("small",{className:"confirm-field-error",children:r.error}),e[13]=r.error,e[14]=m):m=e[14];let h;return e[15]!==c||e[16]!==d||e[17]!==m?(h=t.jsxs("div",{className:"post-delivery-account post-delivery-account-missing",children:[c,d,m]}),e[15]=c,e[16]=d,e[17]=m,e[18]=h):h=e[18],h}function Ds(i){return i.trim().replace(/\/+$/u,"")||"…"}function $n(i){const e=de.c(65),s=i.review.destination==="icloud",l=s?i.review.icloudFolder:i.review.dropboxFolder;let n;e[0]!==s||e[1]!==i.review.dropboxFolder||e[2]!==i.review.icloudFolder?(n=s?sl(i.review.icloudFolder):nl(i.review.dropboxFolder),e[0]=s,e[1]=i.review.dropboxFolder,e[2]=i.review.icloudFolder,e[3]=n):n=e[3];const a=n;let r;e[4]!==i.review.icloud?(r=il(i.review.icloud),e[4]=i.review.icloud,e[5]=r):r=e[5];const u=r;let c;e[6]!==s||e[7]!==i.review.receipt||e[8]!==i.review.sync?.error||e[9]!==i.review.sync?.phase?(c=i.review.receipt&&s?al(i.review.sync?.phase??null,i.review.sync?.error):null,e[6]=s,e[7]=i.review.receipt,e[8]=i.review.sync?.error,e[9]=i.review.sync?.phase,e[10]=c):c=e[10];const p=c,o=i.review.icloud&&!i.review.icloud.available?i.review.icloud.reason??"iCloud Drive isn't available on this Mac.":null;let f;e[11]!==i.asset||e[12]!==i.onOpenPost||e[13]!==i.post?(f=t.jsx($s,{post:i.post,asset:i.asset,onOpenPost:i.onOpenPost}),e[11]=i.asset,e[12]=i.onOpenPost,e[13]=i.post,e[14]=f):f=e[14];let d;e[15]!==i.busy||e[16]!==i.onCopyChange||e[17]!==i.onLanguage||e[18]!==i.onRegen||e[19]!==i.post||e[20]!==i.review?(d=t.jsx(Ms,{post:i.post,review:i.review,busy:i.busy,onCopyChange:i.onCopyChange,onLanguage:i.onLanguage,onRegen:i.onRegen}),e[15]=i.busy,e[16]=i.onCopyChange,e[17]=i.onLanguage,e[18]=i.onRegen,e[19]=i.post,e[20]=i.review,e[21]=d):d=e[21];let m;e[22]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"post-delivery-heading",children:"Destination"}),e[22]=m):m=e[22];let h;e[23]!==i?(h=()=>i.onDestination("icloud"),e[23]=i,e[24]=h):h=e[24];let x;e[25]!==s||e[26]!==i.busy||e[27]!==h?(x=t.jsx("button",{type:"button","aria-pressed":s,disabled:i.busy,onClick:h,children:"iCloud · iPhone"}),e[25]=s,e[26]=i.busy,e[27]=h,e[28]=x):x=e[28];const g=!s;let S;e[29]!==i?(S=()=>i.onDestination("dropbox"),e[29]=i,e[30]=S):S=e[30];let j;e[31]!==i.busy||e[32]!==g||e[33]!==S?(j=t.jsx("button",{type:"button","aria-pressed":g,disabled:i.busy,onClick:S,children:"Dropbox"}),e[31]=i.busy,e[32]=g,e[33]=S,e[34]=j):j=e[34];let C;e[35]!==j||e[36]!==x?(C=t.jsxs("div",{className:"post-delivery-switch",role:"group","aria-label":"Destination",children:[x,j]}),e[35]=j,e[36]=x,e[37]=C):C=e[37];let y;e[38]!==o?(y=o&&t.jsxs("p",{className:"post-delivery-warning",children:[t.jsx(St,{size:12,"aria-hidden":"true"}),o]}),e[38]=o,e[39]=y):y=e[39];let k;e[40]!==l||e[41]!==a||e[42]!==s||e[43]!==i||e[44]!==u?(k=s?t.jsxs(t.Fragment,{children:[u&&t.jsx("p",{className:i.review.icloud?.shared===!1?"post-delivery-warning":"post-delivery-done",children:u}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:R=>i.onFolderChange(R.target.value)}),t.jsxs("small",{children:["Appears on iPhone in Files › Shared › Videobook › ",Ds(l)]})]}):t.jsxs(t.Fragment,{children:[t.jsx(Fs,{review:i.review,busy:i.busy,onConnect:i.onConnect,onCheckConnection:i.onCheckConnection}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:R=>i.onFolderChange(R.target.value)}),t.jsx("small",{children:"Uploads clip and caption.txt here. Other files in the folder are kept."})]}),e[40]=l,e[41]=a,e[42]=s,e[43]=i,e[44]=u,e[45]=k):k=e[45];let w;e[46]!==i.review.receipt?(w=i.review.receipt&&t.jsx("p",{className:"post-delivery-receipt",children:i.review.receipt}),e[46]=i.review.receipt,e[47]=w):w=e[47];let b;e[48]!==p?(b=p&&t.jsx("p",{className:"post-delivery-progress",children:p}),e[48]=p,e[49]=b):b=e[49];let v;e[50]!==i.busy||e[51]!==i.onLink||e[52]!==i.post?(v=rl(i.post)&&t.jsx(hs,{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 Os=new Map;function Hs(i){const e=i.cell.inputs;return e&&typeof e.generationMode=="string"?e.generationMode:""}function Us(i,e){const s=new Map;for(const l of i)if(l.asset)for(const n of[l.cellId,`@${l.address}`,l.asset.artifactId,`@${l.asset.artifactId}`,l.asset.mediaUrl,l.asset.thumbnailUrl])n&&s.set(n,l.asset);for(const l of Wt(e).urlPlaceholders){const n=s.get(l.reference);n&&s.set(l.url,n)}return s}function Ft(i){const e=de.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(vs,{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 Rn(i){const e=de.c(232),{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:R}=i,N=S===void 0?!1:S,E=j===void 0?"":j,[I,F]=we.useState(!1);let D;e[0]!==n?(D=bl(n),e[0]=n,e[1]=D):D=e[1];const L=D;let B;e[2]!==n.cell.inputs?(B=n.cell.inputs??{},e[2]=n.cell.inputs,e[3]=B):B=e[3];let se;e[4]!==n.action.model||e[5]!==B?(se=vl(n.action.model,B),e[4]=n.action.model,e[5]=B,e[6]=se):se=e[6];const W=se,M=jl();let X;e[7]!==d?(X=()=>{d&&d.ensureLoaded().catch(Js)},e[7]=d,e[8]=X):X=e[8];const T=X;let U;e[9]!==d?(U=()=>{d&&d.refresh().catch(Xs)},e[9]=d,e[10]=U):U=e[10];const oe=U;let ce;e[11]!==n.action.controls||e[12]!==n.cell.type?(ce=n.cell.type==="generate_audio"?n.action.controls.find(Ys):void 0,e[11]=n.action.controls,e[12]=n.cell.type,e[13]=ce):ce=e[13];const J=ce;let me;e[14]!==d?.voices||e[15]!==J?(me=J?d?.voices??[]:[],e[14]=d?.voices,e[15]=J,e[16]=me):me=e[16];const ae=me,Z=ae.length>0,xe=typeof L.voice_id=="string"?L.voice_id:"";let te;e[17]!==n.action.model?(te=yl(n.action.model),e[17]=n.action.model,e[18]=te):te=e[18];const ue=te,re=n.cell.inputs?.generationMode??n.cell.inputs?.mode;let ye;e[19]!==n.action.model||e[20]!==re?(ye=wl(n.action.model,re),e[19]=n.action.model,e[20]=re,e[21]=ye):ye=e[21];const z=ye;let he,le,fe,V,Q,G,K,Y,ee,q,ne,ge;if(e[22]!==s||e[23]!==l||e[24]!==g||e[25]!==C||e[26]!==n||e[27]!==T||e[28]!==W||e[29]!==x||e[30]!==ue||e[31]!==a||e[32]!==E||e[33]!==y||e[34]!==k||e[35]!==w||e[36]!==b||e[37]!==_||e[38]!==$||e[39]!==R||e[40]!==r||e[41]!==u||e[42]!==c||e[43]!==M||e[44]!==p||e[45]!==m||e[46]!==h||e[47]!==oe||e[48]!==z||e[49]!==xe||e[50]!==L||e[51]!==I||e[52]!==Z||e[53]!==f||e[54]!==N||e[55]!==o||e[56]!==d||e[57]!==J||e[58]!==ae){const Ee=z?n.action.controls.filter(Ks):ue?n.action.controls.filter(Gs):n.action.controls,Se=Z?n.action.controls.filter(zs):Ee,pe=Se.filter(Ws),Fe=Se.filter(Bs);let Ie;e[71]!==r?(Ie=_l(r),e[71]=r,e[72]=Ie):Ie=e[72];const Ce=Ie;let Ae;e[73]!==r||e[74]!==o?(Ae=Us(o,r),e[73]=r,e[74]=o,e[75]=Ae):Ae=e[75];const Le=Ae,Pe=Nl(r),De=p?[]:Wt(r).promptLeaks;let $e;e[76]!==n.action.model||e[77]!==n.action.provider||e[78]!==n.action.tool||e[79]!==n.cell.inputs||e[80]!==n.cell.prompt||e[81]!==Ce?($e=Ce??{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[76]=n.action.model,e[77]=n.action.provider,e[78]=n.action.tool,e[79]=n.cell.inputs,e[80]=n.cell.prompt,e[81]=Ce,e[82]=$e):$e=e[82];const Ge=$e;let Re;e[83]!==n.cell||e[84]!==E||e[85]!==N?(Re=N?Sl(E,n.cell).length:0,e[83]=n.cell,e[84]=E,e[85]=N,e[86]=Re):Re=e[86];const Ue=Re;K="confirm-generation",Y=N?"source":"form";let Te;e[87]===Symbol.for("react.memo_cache_sentinel")?(Te=t.jsx("span",{className:"confirm-section-label",children:"Inputs"}),e[87]=Te):Te=e[87];let ke;if(e[88]!==l||e[89]!==_||e[90]!==$||e[91]!==o){let H;e[93]!==l||e[94]!==_||e[95]!==$?(H=We=>t.jsxs("div",{className:"generation-review-source-wrap",children:[t.jsx(Ft,{badge:"Input",busy:l,source:We,title:`Select @${We.address} on the board`,onClick:()=>$(We.cellId)}),t.jsx("button",{type:"button",className:"generation-review-source-remove",disabled:l,"aria-label":`Remove @${We.address} input`,title:`Remove @${We.address} input`,onClick:()=>_(We.cellId,We.targetInput),children:t.jsx(Xt,{size:11,"aria-hidden":"true"})})]},`${We.cellId}:${We.targetInput??""}`),e[93]=l,e[94]=_,e[95]=$,e[96]=H):H=e[96],ke=o.map(H),e[88]=l,e[89]=_,e[90]=$,e[91]=o,e[92]=ke}else ke=e[92];let Oe;e[97]!==o.length?(Oe=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[97]=o.length,e[98]=Oe):Oe=e[98];let P;e[99]!==l||e[100]!==I||e[101]!==f.length?(P=f.length>0&&t.jsxs("button",{type:"button",className:"generation-review-source-add",disabled:l,"aria-expanded":I,onClick:()=>F(qs),children:[t.jsx(ws,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:"Add input"})]}),e[99]=l,e[100]=I,e[101]=f.length,e[102]=P):P=e[102];let ie;e[103]!==ke||e[104]!==Oe||e[105]!==P?(ie=t.jsxs("div",{className:"generation-review-sources",children:[ke,Oe,P]}),e[103]=ke,e[104]=Oe,e[105]=P,e[106]=ie):ie=e[106];let He;e[107]!==l||e[108]!==k||e[109]!==I||e[110]!==f?(He=I&&f.length>0&&t.jsx("div",{className:"generation-review-sources generation-review-source-options","aria-label":"Available input cells",children:f.map(H=>t.jsx(Ft,{badge:"Add",busy:l,source:H,title:`Add @${H.address} as ${H.targetLabel??"input"}`,onClick:()=>{k(H.cellId,H.targetInput),F(!1)}},`${H.cellId}:${H.targetInput??""}`))}),e[107]=l,e[108]=k,e[109]=I,e[110]=f,e[111]=He):He=e[111],e[112]!==x||e[113]!==ie||e[114]!==He?(ee=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Inputs",children:[Te,ie,He,x]}),e[112]=x,e[113]=ie,e[114]=He,e[115]=ee):ee=e[115];const Xe=N===!0;let Ke;e[116]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsx("span",{className:"confirm-section-label",children:"Model"}),e[116]=Ke):Ke=e[116];const nt=n.action.id,et=l||s.length===0;let Ve;e[117]!==y?(Ve=H=>y(H.target.value),e[117]=y,e[118]=Ve):Ve=e[118];let Qe;e[119]!==s?(Qe=s.map(Qs),e[119]=s,e[120]=Qe):Qe=e[120];let qe;e[121]!==n.action.id||e[122]!==et||e[123]!==Ve||e[124]!==Qe?(qe=t.jsxs("label",{children:[Ke,t.jsx("select",{"aria-label":"Generation model",value:nt,disabled:et,onChange:Ve,children:Qe})]}),e[121]=n.action.id,e[122]=et,e[123]=Ve,e[124]=Qe,e[125]=qe):qe=e[125];let Be;e[126]!==l||e[127]!==g||e[128]!==n||e[129]!==a||e[130]!==w?(Be=a.length>1&&t.jsxs("label",{children:[t.jsx("span",{className:"confirm-section-label",children:"Type"}),t.jsx("select",{"aria-label":"Generation type",value:Hs(n),disabled:l,onChange:H=>w(H.target.value),children:a.map(H=>t.jsxs("option",{value:H.id,children:[Cl(H.id),g&&!g.has(H.id)?" · check inputs":""]},H.id))})]}),e[126]=l,e[127]=g,e[128]=n,e[129]=a,e[130]=w,e[131]=Be):Be=e[131];let Ye;e[132]!==qe||e[133]!==Be?(Ye=t.jsxs("section",{className:"generation-review-model-section","aria-label":"Model",children:[qe,Be]}),e[132]=qe,e[133]=Be,e[134]=Ye):Ye=e[134];let A;e[135]!==l||e[136]!==n.action.controls||e[137]!==ue||e[138]!==R||e[139]!==L||e[140]!==o?(A=ue&&t.jsx(fs,{sources:o,settings:L,controls:n.action.controls,busy:l,onChange:R}),e[135]=l,e[136]=n.action.controls,e[137]=ue,e[138]=R,e[139]=L,e[140]=o,e[141]=A):A=e[141];let O;e[142]!==z?(O=z&&t.jsx("p",{className:"muted",children:El}),e[142]=z,e[143]=O):O=e[143];let _e;e[144]!==W?(_e=W&&t.jsx("p",{className:"muted",children:Al}),e[144]=W,e[145]=_e):_e=e[145];let Me;e[146]!==l||e[147]!==T||e[148]!==W||e[149]!==R||e[150]!==L?(Me=H=>t.jsx(Lt,{control:H,settings:L,busy:l||H.name==="aspect_ratio"&&!!W,toggleClassName:"generation-review-toggle",onFocus:H.name==="voice_id"?T:void 0,onChange:We=>R(H.name,We)},H.name),e[146]=l,e[147]=T,e[148]=W,e[149]=R,e[150]=L,e[151]=Me):Me=e[151];const ze=t.jsxs("div",{className:"generation-review-settings",children:[pe.map(Me),Se.length===0&&t.jsx("span",{className:"generation-review-defaults",children:"Provider defaults"})]}),lt=Fe.length>0&&t.jsx("div",{className:"generation-review-toggles",children:Fe.map(H=>t.jsx(Lt,{control:H,settings:L,busy:l,toggleClassName:"generation-review-toggle",onChange:We=>R(H.name,We)},H.name))});let Je;e[152]!==O||e[153]!==_e||e[154]!==ze||e[155]!==lt?(Je=t.jsxs("section",{className:"generation-review-settings-section","aria-label":"Settings",children:[O,_e,ze,lt]}),e[152]=O,e[153]=_e,e[154]=ze,e[155]=lt,e[156]=Je):Je=e[156];let tt;e[157]!==l||e[158]!==R||e[159]!==M||e[160]!==oe||e[161]!==xe||e[162]!==Z||e[163]!==d||e[164]!==J||e[165]!==ae?(tt=J&&d&&t.jsxs("section",{className:"generation-review-voice-section","aria-label":"Voice",children:[t.jsx("span",{className:"confirm-section-label",children:"Voice"}),Z&&t.jsx("div",{className:"generation-review-voices",role:"listbox","aria-label":"ElevenLabs voices","data-testid":"generation-review-voices",children:t.jsx(ps,{voices:ae,selectedVoiceId:xe,playingVoiceId:M.playingVoiceId,disabled:l,onSelect:H=>{Pl(H),R("voice_id",H)},onTogglePreview:M.toggle})}),d.loading&&ae.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:oe,children:d.loading?"Loading voices…":d.error?"Retry voices":Z?"Refresh voices":"Load voices"}),d?.warning&&t.jsx("small",{children:d.warning})]}),e[157]=l,e[158]=R,e[159]=M,e[160]=oe,e[161]=xe,e[162]=Z,e[163]=d,e[164]=J,e[165]=ae,e[166]=tt):tt=e[166];const pt=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(xs,{history:h,disabled:l})]}),t.jsx("textarea",{rows:3,"aria-label":"Prompt",value:n.cell.prompt??"","aria-invalid":De.length>0,disabled:l,onChange:H=>b(H.target.value),onKeyDown:H=>{h?.handlePromptKeyDown(H)}})]}),xt=De.length>0&&t.jsx("div",{className:"generation-review-reference-errors",role:"alert",children:De.map(Vs)});let it;e[167]!==pt||e[168]!==xt?(it=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Prompt",children:[pt,xt]}),e[167]=pt,e[168]=xt,e[169]=it):it=e[169],e[170]!==Xe||e[171]!==Ye||e[172]!==A||e[173]!==Je||e[174]!==tt||e[175]!==it?(q=t.jsxs("div",{className:"confirm-section generation-review-editor",hidden:Xe,children:[Ye,A,Je,tt,it]}),e[170]=Xe,e[171]=Ye,e[172]=A,e[173]=Je,e[174]=tt,e[175]=it,e[176]=q):q=e[176],e[177]!==C||e[178]!==Ue||e[179]!==n.cell||e[180]!==E||e[181]!==N?(ne=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 · ",Ue," columns"]})]}),t.jsx("div",{className:"generation-review-dolt",tabIndex:0,"aria-label":"Dolt source preview",children:t.jsx(gs,{notebookId:E,cell:n.cell,artifactAssets:C??Os,heading:!1})})]}),e[177]=C,e[178]=Ue,e[179]=n.cell,e[180]=E,e[181]=N,e[182]=ne):ne=e[182];const gt=N?"MCP payload":"Payload",bt=N?"MCP payload":"Payload";let at;e[183]!==bt?(at=t.jsx("span",{children:bt}),e[183]=bt,e[184]=at):at=e[184];let rt;e[185]!==c||e[186]!==p?(rt=(p||c)&&t.jsx("small",{className:"generation-review-json-stale",role:"status",children:"Updating…"}),e[185]=c,e[186]=p,e[187]=rt):rt=e[187];let ot;e[188]!==at||e[189]!==rt?(ot=t.jsxs("div",{className:"confirm-section-heading",children:[at,rt]}),e[188]=at,e[189]=rt,e[190]=ot):ot=e[190];const vt=N?"MCP payload preview":"Generation payload preview";let ct;e[191]!==Le||e[192]!==u||e[193]!==Ge||e[194]!==c||e[195]!==Ce?.payload||e[196]!==N?(ct=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(bs,{value:N?Ge:Ce?.payload??null,ariaLabel:N?"MCP payload JSON":"Generation payload JSON",artifactAssets:Le,mediaDisplay:"preview"}),e[191]=Le,e[192]=u,e[193]=Ge,e[194]=c,e[195]=Ce?.payload,e[196]=N,e[197]=ct):ct=e[197];let dt;e[198]!==c||e[199]!==vt||e[200]!==ct?(dt=t.jsx("div",{className:"generation-review-json",tabIndex:0,"aria-label":vt,"aria-busy":c,children:ct}),e[198]=c,e[199]=vt,e[200]=ct,e[201]=dt):dt=e[201],e[202]!==gt||e[203]!==ot||e[204]!==dt?(ge=t.jsxs("section",{className:"confirm-section generation-review-source-section","aria-label":gt,children:[ot,dt]}),e[202]=gt,e[203]=ot,e[204]=dt,e[205]=ge):ge=e[205],le="confirm-section generation-review-estimate-section",fe="Estimate",e[206]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[206]=V):V=e[206];const jt=c||p?"…":!u&&Pe.usd!==null&&!Pe.unknown?`$${Pe.usd.toFixed(Pe.usd<.01?4:2)}`:"—";e[207]!==jt?(Q=t.jsx("strong",{children:jt}),e[207]=jt,e[208]=Q):Q=e[208],G=t.jsx("span",{children:Pe.currency}),he=c||p?"Updating estimate…":u||Pe.unknown||Pe.usd===null?"Cost estimate unavailable":kl(Pe.warnings)?"Historical average per call; this request can differ":"Estimated provider cost",e[22]=s,e[23]=l,e[24]=g,e[25]=C,e[26]=n,e[27]=T,e[28]=W,e[29]=x,e[30]=ue,e[31]=a,e[32]=E,e[33]=y,e[34]=k,e[35]=w,e[36]=b,e[37]=_,e[38]=$,e[39]=R,e[40]=r,e[41]=u,e[42]=c,e[43]=M,e[44]=p,e[45]=m,e[46]=h,e[47]=oe,e[48]=z,e[49]=xe,e[50]=L,e[51]=I,e[52]=Z,e[53]=f,e[54]=N,e[55]=o,e[56]=d,e[57]=J,e[58]=ae,e[59]=he,e[60]=le,e[61]=fe,e[62]=V,e[63]=Q,e[64]=G,e[65]=K,e[66]=Y,e[67]=ee,e[68]=q,e[69]=ne,e[70]=ge}else he=e[59],le=e[60],fe=e[61],V=e[62],Q=e[63],G=e[64],K=e[65],Y=e[66],ee=e[67],q=e[68],ne=e[69],ge=e[70];let be;e[209]!==he?(be=t.jsx("small",{children:he}),e[209]=he,e[210]=be):be=e[210];let ve;e[211]!==l||e[212]!==v||e[213]!==u||e[214]!==c?(ve=u&&t.jsxs("button",{type:"button",disabled:l||c,onClick:v,children:[t.jsx(Ss,{size:10,"aria-hidden":"true"}),"Retry preview"]}),e[211]=l,e[212]=v,e[213]=u,e[214]=c,e[215]=ve):ve=e[215];let Ne;e[216]!==le||e[217]!==fe||e[218]!==V||e[219]!==Q||e[220]!==G||e[221]!==be||e[222]!==ve?(Ne=t.jsxs("section",{className:le,"aria-label":fe,children:[V,Q,G,be,ve]}),e[216]=le,e[217]=fe,e[218]=V,e[219]=Q,e[220]=G,e[221]=be,e[222]=ve,e[223]=Ne):Ne=e[223];let je;return e[224]!==K||e[225]!==Y||e[226]!==ee||e[227]!==q||e[228]!==ne||e[229]!==ge||e[230]!==Ne?(je=t.jsxs("div",{className:K,"data-view":Y,children:[ee,q,ne,ge,Ne]}),e[224]=K,e[225]=Y,e[226]=ee,e[227]=q,e[228]=ne,e[229]=ge,e[230]=Ne,e[231]=je):je=e[231],je}function Vs(i){return t.jsxs("span",{title:i.message,children:[t.jsx(Ns,{size:12,"aria-hidden":"true"}),t.jsx("code",{children:i.token}),i.message]},`${i.token}:${i.code}`)}function Qs(i){return t.jsxs("option",{value:i.id,children:[i.title," · ",i.providerLabel]},i.id)}function qs(i){return!i}function Bs(i){return i.kind==="boolean"}function Ws(i){return i.kind!=="boolean"}function zs(i){return i.name!=="voice_id"}function Gs(i){return!["start_time","resume_time","duration"].includes(i.name)}function Ks(i){return!["duration","aspect_ratio"].includes(i.name)}function Ys(i){return i.name==="voice_id"}function Xs(){}function Js(){}function Dt(i){const e=de.c(28),{label:s,mediaUrl:l,muted:n,playbackRate:a,windows:r}=i,u=we.useRef(null),c=we.useRef(null),p=we.useRef(0);let o;e[0]!==r?(o=r.map(ln).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(tn);p.current=0;const _=v[0]?.startSeconds??0,$=()=>{b.currentTime=_,c.current=_,b.playbackRate=a,b.play().catch(en)};let R=0,N,E=!1;const I=()=>{N!==void 0&&typeof b.cancelVideoFrameCallback=="function"&&(b.cancelVideoFrameCallback(N),N=void 0),R&&(cancelAnimationFrame(R),R=0)},F=()=>{if(E)return;const L=Dl({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(Zs)):c.current!==null&&Math.abs(b.currentTime-c.current)<=.03333333333333333&&(c.current=null),D()},D=()=>{if(!E){if(typeof b.requestVideoFrameCallback=="function"){N=b.requestVideoFrameCallback(()=>F());return}R=requestAnimationFrame(()=>F())}};return b.readyState>=HTMLMediaElement.HAVE_METADATA?$():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],we.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]),we.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 Zs(){}function en(){}function tn(i){const[e,s]=i.split(":").map(Number);return Number.isFinite(e)&&Number.isFinite(s)&&s>e?[{startSeconds:e,endSeconds:s}]:[]}function ln(i){return`${i.startSeconds}:${i.endSeconds}`}const sn=[-1,-.1,-.01,.01,.1,1],nn=[-1,-.1,.1,1];function Tn(i){const e=de.c(178),{cutPointsSeconds:s,mediaUrl:l,onChange:n,outputMode:a,selectedIndex:r,sourceDurationSeconds:u,sourceFps:c}=i,p=we.useRef(null),[o,f]=we.useState(!1),[d,m]=we.useState("in"),[h,x]=we.useState(null),[g,S]=we.useState(null),[j,C]=we.useState(null),[y,k]=we.useState(null);let w;e[0]!==s||e[1]!==u?(w=$l({cutPointsSeconds:s,sourceDurationSeconds:u}),e[0]=s,e[1]=u,e[2]=w):w=e[2];const b=w,v=b[r]??b[0];let _;e[3]!==c?(_=Ll(c),e[3]=c,e[4]=_):_=e[4];const $=_;let R;e[5]!==v||e[6]!==u?(R=v?Rl({segment:v,sourceDurationSeconds:u}):{segment:{startSeconds:0,endSeconds:0},surroundings:[]},e[5]=v,e[6]=u,e[7]=R):R=e[7];const N=R,E=v?`${v.startSeconds}:${v.endSeconds}`:"";let I;e[8]!==h||e[9]!==v?.startSeconds?(I=h??v?.startSeconds.toFixed(3)??"",e[8]=h,e[9]=v?.startSeconds,e[10]=I):I=e[10];const F=I;let D;e[11]!==g||e[12]!==v?.endSeconds?(D=g??v?.endSeconds.toFixed(3)??"",e[11]=g,e[12]=v?.endSeconds,e[13]=D):D=e[13];const L=D;let B;e[14]!==E||e[15]!==v?.durationSeconds||e[16]!==y?(B=y?.key===E?y.value:Tl(v?.durationSeconds??1),e[14]=E,e[15]=v?.durationSeconds,e[16]=y,e[17]=B):B=e[17];const se=B;let W;e[18]!==n||e[19]!==a?(W=A=>{C(null),x(null),S(null),n({cutPointsSeconds:A.cutPointsSeconds,outputMode:A.outputMode??a,selectedIndex:A.selectedIndex})},e[18]=n,e[19]=a,e[20]=W):W=e[20];const M=W;let X;e[21]!==M?(X=A=>{x(null),S(null),M(A)},e[21]=M,e[22]=X):X=e[22];const T=X;let U;e[23]!==T||e[24]!==s||e[25]!==r||e[26]!==u?(U=A=>{T(kt({cutPointsSeconds:s,deltaSeconds:A,index:r,sourceDurationSeconds:u}))},e[23]=T,e[24]=s,e[25]=r,e[26]=u,e[27]=U):U=e[27];const oe=U;let ce;e[28]!==T||e[29]!==s||e[30]!==r||e[31]!==u?(ce=A=>{T(_t({cutPointsSeconds:s,deltaSeconds:A,index:r,sourceDurationSeconds:u}))},e[28]=T,e[29]=s,e[30]=r,e[31]=u,e[32]=ce):ce=e[32];const J=ce;let me;e[33]!==T||e[34]!==s||e[35]!==v||e[36]!==r||e[37]!==u?(me=(A,O)=>{if(!v)return;const _e=Math.round(Number(A)*1e3)/1e3,Me=Math.round(Number(O)*1e3)/1e3;if(!Number.isFinite(_e)||!Number.isFinite(Me)){C("Enter start and end times in seconds");return}const ze=Et({cutPointsSeconds:s,endSeconds:Me,index:r,sourceDurationSeconds:u,startSeconds:_e});if(ze.cutPointsSeconds.length===s.length&&ze.cutPointsSeconds.every((lt,Je)=>lt===s[Je])&&(_e!==v.startSeconds||Me!==v.endSeconds)){C(`Choose a range from ${Ze(v.startSeconds)} that stays inside neighbouring pieces`),x(null),S(null);return}T(ze)},e[33]=T,e[34]=s,e[35]=v,e[36]=r,e[37]=u,e[38]=me):me=e[38];const ae=me;let Z;e[39]!==T||e[40]!==s||e[41]!==v||e[42]!==r||e[43]!==u?(Z=A=>{const O=p.current?.currentTime;!v||typeof O!="number"||!Number.isFinite(O)||T(Et({cutPointsSeconds:s,endSeconds:A==="out"?O:v.endSeconds,index:r,sourceDurationSeconds:u,startSeconds:A==="in"?O:v.startSeconds}))},e[39]=T,e[40]=s,e[41]=v,e[42]=r,e[43]=u,e[44]=Z):Z=e[44];const xe=Z;let te;e[45]!==d||e[46]!==oe||e[47]!==J?(te=A=>{if(A.key!=="ArrowLeft"&&A.key!=="ArrowRight"||A.target instanceof HTMLInputElement)return;A.preventDefault();const O=A.key==="ArrowLeft"?-1:1,_e=A.altKey?.01:A.shiftKey?1:.1;d==="out"?J(O*_e):oe(O*_e)},e[45]=d,e[46]=oe,e[47]=J,e[48]=te):te=e[48];const ue=te,re=se?.25:1,ye=a==="remove"?"JOIN PREVIEW":"SURROUNDINGS";let z;e[49]!==a||e[50]!==b.length||e[51]!==v?(z=v?a==="all"?`Apply creates ${b.length} cells`:a==="keep"?`Apply creates 1 cell: ${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]=z):z=e[52];const he=z;let le;e[53]!==s||e[54]!==$||e[55]!==r?(le=(A,O,_e)=>t.jsxs("div",{className:"confirm-split-nudges",children:[sn.map(Me=>{const ze=_e(Me),lt=ze.cutPointsSeconds.every((Je,tt)=>Je===s[tt])&&ze.selectedIndex===r;return t.jsxs("button",{type:"button",disabled:lt,onFocus:()=>m(A),onClick:()=>O(Me),children:[Me>0?"+":"−",Math.abs(Me),"s"]},`${A}:${Me}`)}),$!==null&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Previous frame",title:"Previous frame",onFocus:()=>m(A),onClick:()=>O(-$),children:"◂"}),t.jsx("button",{type:"button","aria-label":"Next frame",title:"Next frame",onFocus:()=>m(A),onClick:()=>O($),children:"▸"})]})]}),e[53]=s,e[54]=$,e[55]=r,e[56]=le):le=e[56];const fe=le;let V;e[57]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("span",{children:"Source"}),e[57]=V):V=e[57];let Q;e[58]!==u?(Q=Ze(u),e[58]=u,e[59]=Q):Q=e[59];let G;e[60]!==Q?(G=t.jsxs("div",{className:"confirm-section-heading",children:[V,t.jsxs("strong",{children:[Q," total"]})]}),e[60]=Q,e[61]=G):G=e[61];let K;e[62]!==l?(K=t.jsx("video",{ref:p,src:l,controls:!0,playsInline:!0,preload:"metadata"}),e[62]=l,e[63]=K):K=e[63];let Y;e[64]!==xe?(Y=t.jsx("button",{type:"button",onClick:()=>xe("in"),children:"SET IN HERE"}),e[64]=xe,e[65]=Y):Y=e[65];let ee;e[66]!==xe?(ee=t.jsx("button",{type:"button",onClick:()=>xe("out"),children:"SET OUT HERE"}),e[66]=xe,e[67]=ee):ee=e[67];let q;e[68]!==Y||e[69]!==ee?(q=t.jsxs("div",{className:"confirm-actions-row",children:[Y,ee]}),e[68]=Y,e[69]=ee,e[70]=q):q=e[70];let ne;e[71]!==G||e[72]!==K||e[73]!==q?(ne=t.jsxs("section",{className:"confirm-section","aria-label":"Source player",children:[G,K,q]}),e[71]=G,e[72]=K,e[73]=q,e[74]=ne):ne=e[74];let ge;e[75]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("span",{className:"confirm-section-label",children:"Pieces"}),e[75]=ge):ge=e[75];let be;if(e[76]!==s||e[77]!==M||e[78]!==b||e[79]!==r){let A;e[81]!==s||e[82]!==M||e[83]!==r?(A=O=>t.jsxs("button",{type:"button",role:"listitem",className:O.index===r?"active":void 0,"aria-pressed":O.index===r,onClick:()=>M({cutPointsSeconds:s,selectedIndex:O.index}),children:[String(O.index+1).padStart(2,"0")," ",Ze(O.startSeconds),"-",Ze(O.endSeconds)]},`${O.startSeconds}:${O.endSeconds}`),e[81]=s,e[82]=M,e[83]=r,e[84]=A):A=e[84],be=b.map(A),e[76]=s,e[77]=M,e[78]=b,e[79]=r,e[80]=be}else be=e[80];let ve;e[85]!==be?(ve=t.jsx("div",{className:"confirm-chips",role:"list",children:be}),e[85]=be,e[86]=ve):ve=e[86];const Ne=!v||v.durationSeconds<.04;let je;e[87]!==T||e[88]!==s||e[89]!==r||e[90]!==u?(je=()=>T(Ml({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[87]=T,e[88]=s,e[89]=r,e[90]=u,e[91]=je):je=e[91];let Ee;e[92]===Symbol.for("react.memo_cache_sentinel")?(Ee=t.jsx(Cs,{size:12,"aria-hidden":"true"}),e[92]=Ee):Ee=e[92];let Se;e[93]!==Ne||e[94]!==je?(Se=t.jsxs("button",{type:"button",disabled:Ne,onClick:je,children:[Ee,"Split piece in half"]}),e[93]=Ne,e[94]=je,e[95]=Se):Se=e[95];const pe=r>=b.length-1;let Fe;e[96]!==T||e[97]!==s||e[98]!==r||e[99]!==u?(Fe=()=>T(Fl({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[96]=T,e[97]=s,e[98]=r,e[99]=u,e[100]=Fe):Fe=e[100];let Ie;e[101]!==pe||e[102]!==Fe?(Ie=t.jsx("button",{type:"button",disabled:pe,onClick:Fe,children:"Merge with next"}),e[101]=pe,e[102]=Fe,e[103]=Ie):Ie=e[103];let Ce;e[104]!==Se||e[105]!==Ie?(Ce=t.jsxs("div",{className:"confirm-actions-row",children:[Se,Ie]}),e[104]=Se,e[105]=Ie,e[106]=Ce):Ce=e[106];let Ae;e[107]!==ve||e[108]!==Ce?(Ae=t.jsxs("section",{className:"confirm-section","aria-label":"Pieces",children:[ge,ve,Ce]}),e[107]=ve,e[108]=Ce,e[109]=Ae):Ae=e[109];let Le;e[110]!==ne||e[111]!==Ae?(Le=t.jsxs("div",{className:"confirm-split-column",children:[ne,Ae]}),e[110]=ne,e[111]=Ae,e[112]=Le):Le=e[112];let Pe;e[113]===Symbol.for("react.memo_cache_sentinel")?(Pe=t.jsx("span",{children:"Loops"}),e[113]=Pe):Pe=e[113];let De;e[114]===Symbol.for("react.memo_cache_sentinel")?(De=()=>f(an),e[114]=De):De=e[114];let $e;e[115]!==o?($e=o?t.jsx(Ps,{size:13}):t.jsx(ks,{size:13}),e[115]=o,e[116]=$e):$e=e[116];const Ge=o?"Sound on":"Sound off";let Re;e[117]!==o||e[118]!==$e||e[119]!==Ge?(Re=t.jsxs("div",{className:"confirm-section-heading",children:[Pe,t.jsxs("button",{type:"button","aria-pressed":o,onClick:De,children:[$e,Ge]})]}),e[117]=o,e[118]=$e,e[119]=Ge,e[120]=Re):Re=e[120];const Ue=!o;let Te;e[121]!==N.segment?(Te=[N.segment],e[121]=N.segment,e[122]=Te):Te=e[122];let ke;e[123]!==l||e[124]!==re||e[125]!==Ue||e[126]!==Te?(ke=t.jsx(Dt,{label:"SEGMENT",mediaUrl:l,muted:Ue,playbackRate:re,windows:Te}),e[123]=l,e[124]=re,e[125]=Ue,e[126]=Te,e[127]=ke):ke=e[127];const Oe=!o;let P;e[128]!==l||e[129]!==re||e[130]!==ye||e[131]!==Oe||e[132]!==N.surroundings?(P=t.jsx(Dt,{label:ye,mediaUrl:l,muted:Oe,playbackRate:re,windows:N.surroundings}),e[128]=l,e[129]=re,e[130]=ye,e[131]=Oe,e[132]=N.surroundings,e[133]=P):P=e[133];let ie;e[134]!==ke||e[135]!==P?(ie=t.jsxs("div",{className:"confirm-split-loops",children:[ke,P]}),e[134]=ke,e[135]=P,e[136]=ie):ie=e[136];let He;e[137]!==T||e[138]!==ae||e[139]!==s||e[140]!==F||e[141]!==fe||e[142]!==oe||e[143]!==J||e[144]!==L||e[145]!==E||e[146]!==v||e[147]!==r||e[148]!==se||e[149]!==u?(He=v&&t.jsxs("div",{className:"confirm-split-bounds",children:[t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"IN"}),t.jsx("input",{type:"number","aria-label":"IN seconds",step:"0.001",value:F,onFocus:()=>m("in"),onChange:A=>x(A.target.value),onBlur:()=>ae(F,L),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),ae(F,L))}}),fe("in",oe,A=>kt({cutPointsSeconds:s,deltaSeconds:A,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:A=>S(A.target.value),onBlur:()=>ae(F,L),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),ae(F,L))}}),fe("out",J,A=>_t({cutPointsSeconds:s,deltaSeconds:A,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:[nn.map(A=>{const O=Il({cutPointsSeconds:s,deltaSeconds:A,index:r,sourceDurationSeconds:u}),_e=O.cutPointsSeconds.every((Me,ze)=>Me===s[ze]);return t.jsxs("button",{type:"button",disabled:_e,onClick:()=>T(O),children:[A>0?"+":"−",Math.abs(A),"s"]},`move:${A}`)}),t.jsx("button",{type:"button","aria-pressed":se,onClick:()=>k({key:E,value:!se}),children:"Slow ×0.25"})]})]})]}),e[137]=T,e[138]=ae,e[139]=s,e[140]=F,e[141]=fe,e[142]=oe,e[143]=J,e[144]=L,e[145]=E,e[146]=v,e[147]=r,e[148]=se,e[149]=u,e[150]=He):He=e[150];let Xe;e[151]!==j?(Xe=j&&t.jsx("p",{className:"confirm-field-error",role:"alert",children:j}),e[151]=j,e[152]=Xe):Xe=e[152];let Ke;e[153]!==Re||e[154]!==ie||e[155]!==He||e[156]!==Xe?(Ke=t.jsxs("section",{className:"confirm-section","aria-label":"Loops",children:[Re,ie,He,Xe]}),e[153]=Re,e[154]=ie,e[155]=He,e[156]=Xe,e[157]=Ke):Ke=e[157];let nt;e[158]===Symbol.for("react.memo_cache_sentinel")?(nt=t.jsx("span",{className:"confirm-section-label",children:"Output"}),e[158]=nt):nt=e[158];let et;e[159]===Symbol.for("react.memo_cache_sentinel")?(et=[["keep","KEEP segment"],["remove","REMOVE segment"],["all","ALL pieces"]],e[159]=et):et=e[159];let Ve;e[160]!==s||e[161]!==M||e[162]!==a||e[163]!==b.length||e[164]!==r?(Ve=t.jsx("div",{className:"confirm-chips",children:et.map(A=>{const[O,_e]=A;return t.jsx("button",{type:"button",className:a===O?"active":void 0,"aria-pressed":a===O,disabled:O==="remove"&&b.length<2,onClick:()=>M({cutPointsSeconds:s,outputMode:O,selectedIndex:r}),children:_e},O)})}),e[160]=s,e[161]=M,e[162]=a,e[163]=b.length,e[164]=r,e[165]=Ve):Ve=e[165];let Qe;e[166]!==he?(Qe=t.jsx("p",{className:"confirm-help",children:he}),e[166]=he,e[167]=Qe):Qe=e[167];let qe;e[168]!==Ve||e[169]!==Qe?(qe=t.jsxs("section",{className:"confirm-section","aria-label":"Output mode",children:[nt,Ve,Qe]}),e[168]=Ve,e[169]=Qe,e[170]=qe):qe=e[170];let Be;e[171]!==Ke||e[172]!==qe?(Be=t.jsxs("div",{className:"confirm-split-column",children:[Ke,qe]}),e[171]=Ke,e[172]=qe,e[173]=Be):Be=e[173];let Ye;return e[174]!==ue||e[175]!==Le||e[176]!==Be?(Ye=t.jsxs("div",{className:"confirm-split",onKeyDown:ue,children:[Le,Be]}),e[174]=ue,e[175]=Le,e[176]=Be,e[177]=Ye):Ye=e[177],Ye}function an(i){return!i}function Jt(i){const e=de.c(3),{prompt:s}=i;if(!s.trim())return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("b",{"aria-hidden":"true",children:"›"}),e[0]=l):l=e[0];let n;return e[1]!==s?(n=t.jsxs("p",{className:"confirm-prompt-echo",children:[l,t.jsx("span",{children:s})]}),e[1]=s,e[2]=n):n=e[2],n}function Zt({columns:i,settings:e}){return t.jsx("dl",{className:"confirm-settings","aria-label":"Action settings",style:{gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:e.map(s=>t.jsxs("div",{className:[s.wide?"confirm-setting-wide":"",s.tone==="warning"?"confirm-setting-warning":""].join(" ").trim()||void 0,children:[t.jsx("dt",{children:s.label}),t.jsx("dd",{children:s.value})]},s.label))})}function In(i){const e=de.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=Ol(n?.status??null);let k;e[2]!==n?(k=n?.status?Hl(n.status):null,e[2]=n,e[3]=k):k=e[3];const w=k,b=a.postText.length>y;let v,_,$,R,N,E,I,F,D,L;if(e[4]!==w||e[5]!==s||e[6]!==l||e[7]!==n||e[8]!==a.orientation||e[9]!==a.postText||e[10]!==a.scheduledFor||e[11]!==g||e[12]!==y||e[13]!==r||e[14]!==u||e[15]!==c||e[16]!==p||e[17]!==o||e[18]!==f||e[19]!==S||e[20]!==d||e[21]!==m||e[22]!==h||e[23]!==b||e[24]!==C||e[25]!==x){const W=h?Ul(h):[];let M;e[36]!==h?(M=h?Vl(h.context):!1,e[36]=h,e[37]=M):M=e[37];const X=M;let T;e[38]!==n?(T=n?.status?Ql(n.status,{connecting:n.connecting}):null,e[38]=n,e[39]=T):T=e[39];const U=T,oe=U!==null&&U.tone!=="connected";_="confirm-routed confirm-post";let ce;e[40]!==f?(ce=t.jsx(Jt,{prompt:f}),e[40]=f,e[41]=ce):ce=e[41];let J;e[42]!==d?(J=t.jsx(Zt,{columns:2,settings:d}),e[42]=d,e[43]=J):J=e[43],e[44]!==ce||e[45]!==J?($=t.jsxs("div",{className:"confirm-routed-main",children:[ce,J]}),e[44]=ce,e[45]=J,e[46]=$):$=e[46],R="x-post-preview",N="X post preview";let me,ae;e[47]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{"aria-hidden":"true",children:"X"}),ae=t.jsx("strong",{children:"Post preview"}),e[47]=me,e[48]=ae):(me=e[47],ae=e[48]),e[49]!==m?(E=t.jsxs("header",{children:[me,t.jsxs("div",{children:[ae,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]!==oe?(I=oe&&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]=oe,e[56]=I):I=e[56],e[57]!==s||e[58]!==g||e[59]!==m||e[60]!==x?(F=t.jsx("div",{className:"x-post-preview-media",children:x&&s?.mediaUrl?t.jsx("video",{src:s.mediaUrl,poster:s.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata"}):g?t.jsx("img",{src:g,alt:`${m} post preview`}):t.jsxs("div",{className:"x-post-preview-fallback",children:[t.jsx(Kt,{size:28,"aria-hidden":"true"}),t.jsx("span",{children:"Media preview unavailable"})]})}),e[57]=s,e[58]=g,e[59]=m,e[60]=x,e[61]=F):F=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("label",{htmlFor:"x-post-title",children:"Title"}),e[62]=Z):Z=e[62];const xe=C||b;let te;e[63]!==r?(te=pe=>r({postText:pe.target.value}),e[63]=r,e[64]=te):te=e[64];let ue;e[65]!==l||e[66]!==a.postText||e[67]!==xe||e[68]!==te?(ue=t.jsx("textarea",{id:"x-post-title","aria-invalid":xe,disabled:l,placeholder:"Title (required)",required:!0,rows:3,value:a.postText,onChange:te}),e[65]=l,e[66]=a.postText,e[67]=xe,e[68]=te,e[69]=ue):ue=e[69];const re=C||b?"confirm-field-error":void 0,ye=C?"A title is required":`${a.postText.length}/${y} characters`;let z;e[70]!==re||e[71]!==ye?(z=t.jsx("small",{className:re,children:ye}),e[70]=re,e[71]=ye,e[72]=z):z=e[72];let he;e[73]!==w?(he=w&&t.jsx("small",{className:"x-post-account",children:w}),e[73]=w,e[74]=he):he=e[74],e[75]!==ue||e[76]!==z||e[77]!==he?(D=t.jsxs("div",{className:"x-post-preview-copy",children:[Z,ue,z,he]}),e[75]=ue,e[76]=z,e[77]=he,e[78]=D):D=e[78];let le;e[79]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx("span",{children:"Publish"}),e[79]=le):le=e[79];const fe=S?"schedule":"now";let V;e[80]!==r?(V=pe=>r({scheduledFor:pe.target.value==="schedule"?Yl():null}),e[80]=r,e[81]=V):V=e[81];let Q,G;e[82]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("option",{value:"now",children:"Now"}),G=t.jsx("option",{value:"schedule",children:"Schedule"}),e[82]=Q,e[83]=G):(Q=e[82],G=e[83]);let K;e[84]!==l||e[85]!==fe||e[86]!==V?(K=t.jsxs("label",{className:"confirm-field",children:[le,t.jsxs("select",{"aria-label":"Publish timing",disabled:l,value:fe,onChange:V,children:[Q,G]})]}),e[84]=l,e[85]=fe,e[86]=V,e[87]=K):K=e[87];let Y;e[88]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx("span",{children:"Orientation"}),e[88]=Y):Y=e[88];const ee=l||s?.type==="image",q=a.orientation??"source";let ne;e[89]!==r?(ne=pe=>r({orientation:pe.target.value==="portrait"||pe.target.value==="landscape"?pe.target.value:null}),e[89]=r,e[90]=ne):ne=e[90];let ge,be,ve;e[91]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("option",{value:"source",children:"Keep source"}),be=t.jsx("option",{value:"portrait",children:"Portrait"}),ve=t.jsx("option",{value:"landscape",children:"Landscape"}),e[91]=ge,e[92]=be,e[93]=ve):(ge=e[91],be=e[92],ve=e[93]);let Ne;e[94]!==ee||e[95]!==q||e[96]!==ne?(Ne=t.jsxs("select",{"aria-label":"Video orientation",disabled:ee,value:q,onChange:ne,children:[ge,be,ve]}),e[94]=ee,e[95]=q,e[96]=ne,e[97]=Ne):Ne=e[97];let je;e[98]!==s?.type?(je=s?.type==="image"&&t.jsx("small",{children:"Video posts only"}),e[98]=s?.type,e[99]=je):je=e[99];let Ee;e[100]!==Ne||e[101]!==je?(Ee=t.jsxs("label",{className:"confirm-field",children:[Y,Ne,je]}),e[100]=Ne,e[101]=je,e[102]=Ee):Ee=e[102];let Se;e[103]!==l||e[104]!==a.scheduledFor||e[105]!==r||e[106]!==S?(Se=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:Bl(a.scheduledFor??""),onChange:pe=>r({scheduledFor:ql(pe.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]=Se):Se=e[107],e[108]!==K||e[109]!==Ee||e[110]!==Se?(L=t.jsxs("div",{className:"x-post-preview-options",role:"group","aria-label":"Post options",children:[K,Ee,Se]}),e[108]=K,e[109]=Ee,e[110]=Se,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||!X,onChange:pe=>p?.({enabled:pe.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}):X?h.options.enabled?t.jsxs("div",{className:"x-post-thread-steps",children:[h.context.steps.map((pe,Fe)=>t.jsx(cn,{busy:l,index:Fe,maxCharacters:y,prompt:Wl(h,pe),reply:W.find(Ie=>Ie.stepId===pe.id)??null,step:pe,stepCount:h.context.steps.length,onPromptChange:o},pe.id)),h.context.credits.length>0&&t.jsx(mn,{busy:l,maxCharacters:y,replyCount:W.filter(rn).length,text:zl(h),onChange:c}),W.length===0&&t.jsx("small",{className:"confirm-field-error",children:Gl})]}):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]=R,e[30]=N,e[31]=E,e[32]=I,e[33]=F,e[34]=D,e[35]=L}else v=e[26],_=e[27],$=e[28],R=e[29],N=e[30],E=e[31],I=e[32],F=e[33],D=e[34],L=e[35];let B;e[112]!==v||e[113]!==R||e[114]!==N||e[115]!==E||e[116]!==I||e[117]!==F||e[118]!==D||e[119]!==L?(B=t.jsxs("article",{className:R,"aria-label":N,children:[E,I,F,D,L,v]}),e[112]=v,e[113]=R,e[114]=N,e[115]=E,e[116]=I,e[117]=F,e[118]=D,e[119]=L,e[120]=B):B=e[120];let se;return e[121]!==_||e[122]!==$||e[123]!==B?(se=t.jsxs("div",{className:_,children:[$,B]}),e[121]=_,e[122]=$,e[123]=B,e[124]=se):se=e[124],se}function rn(i){return i.stepId===null}function el(i){return i===0?"nothing to post":`posts as ${i} ${i===1?"reply":"replies"}`}function on(i){const e=Kl(i.images).length;return e===i.images.length?"Input images":`Input images · first ${e} of ${i.images.length} attach`}function cn(i){const e=de.c(37),{busy:s,index:l,maxCharacters:n,onPromptChange:a,prompt:r,reply:u,step:c,stepCount:p}=i,o=`x-post-thread-prompt-${l}`,f=u?.text.length??0,d=f>n,m=p>1?`Generation step ${l+1}`:"Generation step";let h;e[0]!==l||e[1]!==p?(h=p>1&&t.jsxs("small",{className:"x-post-thread-step-ordinal",children:["Step ",l+1," of ",p]}),e[0]=l,e[1]=p,e[2]=h):h=e[2];let x;e[3]!==c.model?(x=c.model&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:"Model"}),t.jsxs("p",{className:"x-post-thread-model",children:[t.jsx("span",{children:c.model.label}),c.model.provider&&t.jsxs("small",{children:["via ",c.model.provider]})]})]}),e[3]=c.model,e[4]=x):x=e[4];let g;e[5]!==o?(g=t.jsx("label",{className:"x-post-thread-label",htmlFor:o,children:"Prompt"}),e[5]=o,e[6]=g):g=e[6];const S=d?"confirm-field-error":void 0,j=u?1:0;let C;e[7]!==j?(C=el(j),e[7]=j,e[8]=C):C=e[8];let y;e[9]!==n||e[10]!==f||e[11]!==S||e[12]!==C?(y=t.jsxs("small",{className:S,children:[f,"/",n," characters with heading"," · ",C]}),e[9]=n,e[10]=f,e[11]=S,e[12]=C,e[13]=y):y=e[13];let k;e[14]!==g||e[15]!==y?(k=t.jsxs("div",{className:"x-post-thread-field-head",children:[g,y]}),e[14]=g,e[15]=y,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==c.id?(w=R=>a?.(c.id,R.target.value),e[17]=a,e[18]=c.id,e[19]=w):w=e[19];let b;e[20]!==s||e[21]!==r||e[22]!==o||e[23]!==w||e[24]!==d?(b=t.jsx("textarea",{id:o,"aria-invalid":d,disabled:s,rows:4,value:r,onChange:w}),e[20]=s,e[21]=r,e[22]=o,e[23]=w,e[24]=d,e[25]=b):b=e[25];let v;e[26]!==b||e[27]!==k?(v=t.jsxs("div",{className:"x-post-thread-field",children:[k,b]}),e[26]=b,e[27]=k,e[28]=v):v=e[28];let _;e[29]!==c?(_=c.images.length>0&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:on(c)}),t.jsx("div",{className:"x-post-thread-images",children:c.images.map(dn)})]}),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 dn(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 mn(i){const e=de.c(18),{busy:s,maxCharacters:l,onChange:n,replyCount:a,text:r}=i,u=r.length>l;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("label",{className:"x-post-thread-label",htmlFor:"x-post-thread-credits",children:"Credits"}),e[0]=c):c=e[0];const p=u?"confirm-field-error":void 0,o=r.length;let f;e[1]!==a?(f=el(a),e[1]=a,e[2]=f):f=e[2];let d;e[3]!==l||e[4]!==p||e[5]!==f||e[6]!==r.length?(d=t.jsxs("div",{className:"x-post-thread-field-head",children:[c,t.jsxs("small",{className:p,children:[o,"/",l," characters · ",f]})]}),e[3]=l,e[4]=p,e[5]=f,e[6]=r.length,e[7]=d):d=e[7];let m;e[8]!==n?(m=g=>n?.(g.target.value),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==m||e[12]!==r||e[13]!==u?(h=t.jsx("textarea",{id:"x-post-thread-credits","aria-invalid":u,disabled:s,rows:2,value:r,onChange:m}),e[10]=s,e[11]=m,e[12]=r,e[13]=u,e[14]=h):h=e[14];let x;return e[15]!==d||e[16]!==h?(x=t.jsx("article",{className:"x-post-thread-step","aria-label":"Credits",children:t.jsxs("div",{className:"x-post-thread-field",children:[d,h]})}),e[15]=d,e[16]=h,e[17]=x):x=e[17],x}function un(i){const e=de.c(15),{effectiveSpeed:s,mediaUrl:l,thumbnailUrl:n}=i,a=we.useRef(null),[r,u]=we.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],we.useEffect(p,o);let f;e[5]!==s?(f=s?`preview at ${Xl(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 Ln(i){const e=de.c(14),{prompt:s,settings:l,speedPreview:n}=i,a=n===void 0?null:n,r=a?2:Math.min(6,Math.max(1,l.length)),u=`confirm-routed${a?" confirm-routed-with-preview":""}`;let c;e[0]!==s?(c=t.jsx(Jt,{prompt:s}),e[0]=s,e[1]=c):c=e[1];let p;e[2]!==r||e[3]!==l?(p=t.jsx(Zt,{columns:r,settings:l}),e[2]=r,e[3]=l,e[4]=p):p=e[4];let o;e[5]!==c||e[6]!==p?(o=t.jsxs("div",{className:"confirm-routed-main",children:[c,p]}),e[5]=c,e[6]=p,e[7]=o):o=e[7];let f;e[8]!==a?(f=a&&t.jsx("div",{className:"confirm-routed-preview","aria-label":"Speed change preview",children:a.unavailableReason===null?t.jsx(un,{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 Mn(i){const e=de.c(19),{busy:s,onToggleSuggestion:l,plan:n,previews:a}=i;let r;e[0]!==n.confirmation.reason?(r=t.jsx("p",{children:n.confirmation.reason}),e[0]=n.confirmation.reason,e[1]=r):r=e[1];let u;e[2]!==s||e[3]!==l||e[4]!==n.suggestions?(u=n.suggestions&&t.jsxs("fieldset",{className:"confirm-plan-suggestions",children:[t.jsx("legend",{children:"Include suggestions"}),n.suggestions.map(d=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:d.included,disabled:s,onChange:()=>l(d.suggestionId)}),t.jsxs("span",{children:[t.jsx("strong",{children:d.label}),d.detail&&t.jsx("small",{children:d.detail})]})]},d.suggestionId))]}),e[2]=s,e[3]=l,e[4]=n.suggestions,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsxs("div",{className:"confirm-plan-context",children:[r,u]}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;if(e[9]!==n.stages||e[10]!==a){let d;e[12]!==a?(d=m=>{const h=m.kind==="edit"?a[m.stageId]:void 0;return t.jsxs("li",{children:[t.jsx("span",{children:m.kind.toUpperCase()}),t.jsx("strong",{children:m.summary}),h&&t.jsxs(t.Fragment,{children:[t.jsxs("small",{children:[h.diff.changedClipIds.length," clips · duration ",h.diff.beforeDurationFrames," → ",h.diff.afterDurationFrames," frames"]}),h.warnings.map((x,g)=>t.jsxs("p",{className:"confirm-stage-warning",children:[t.jsx(St,{size:11,"aria-hidden":"true"}),x.message]},`${m.stageId}:warning:${g}`)),h.conflicts.map((x,g)=>t.jsxs("p",{className:"confirm-stage-conflict",children:[t.jsx(_s,{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 Fn(i){const e=de.c(12),{kindLabel:s,reason:l,stageTitle:n}=i;let a;e[0]!==l?(a=t.jsx("div",{className:"confirm-plan-context",children:t.jsx("p",{children:l})}),e[0]=l,e[1]=a):a=e[1];let r;e[2]!==s?(r=t.jsx("span",{children:s}),e[2]=s,e[3]=r):r=e[3];let u;e[4]!==n?(u=t.jsx("strong",{children:n}),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsx("ol",{className:"confirm-stages","aria-label":"Planned stages",children:t.jsxs("li",{children:[r,u]})}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;return e[9]!==a||e[10]!==c?(p=t.jsxs("div",{className:"confirm-plan",children:[a,c]}),e[9]=a,e[10]=c,e[11]=p):p=e[11],p}const Ot={"top-left":"Top left","top-center":"Top center","top-right":"Top right","middle-left":"Middle left","middle-center":"Middle center","middle-right":"Middle right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},tl=["fe2601bf8","8209bd208","ba34532e8","ba6ee3ae8","ba95bfae8","824f55208","feaaaabf8","00ccb8800","33c3ed680","646dcd668","8abc29c48","f976883d0","2bd10cc08","246bc6840","3ae7049a0","78227f738","1fa124fc0","b072db3a8","f715de7b0","a150ca198","7aac44a60","ed6a62858","060607bf8","5d2a6a4c8","aa0132f80","0087658f0","fe9a35ac0","8277d98f8","ba51bbff0","bacc3e160","ba9403e00","824b0bc28","fe263c180"],ft=tl.length;function hn(){const i=[];for(let e=0;e<ft;e+=1){const s=tl[e];for(let l=0;l<ft;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 fn=hn(),Ht=28,pn=16,xn={center:"Centered","above-qr":"Above QR","on-qr":"On QR","below-qr":"Below QR"};function gn(){const i=de.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 ${ft} ${ft}`,shapeRendering:"crispEdges",children:t.jsx("path",{d:fn,fill:"currentColor"})}),i[0]=e):e=i[0],e}function bn(i){const e=de.c(5),{platform:s}=i,l=`watermark-preview-platform-icon watermark-preview-${s}-icon`,n=as[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 ut(i){return Math.round(i*100)}function vn(i){return i>0?`${i.toFixed(1)}s`:"Off"}function jn(i,e,s){if(s<=0)return{left:0,width:100};const l=mt(i/s*100,0,100),n=mt((e??s)/s*100,l,100);return{left:l,width:n-l}}function mt(i,e,s){return Math.min(s,Math.max(e,i))}function Ut(i){return Number.isFinite(i)?`${i.toFixed(1)}s`:"0.0s"}function Nt(i,e){return pn*(Math.min(i,e)/e)}function yn(i,e,s){const[l,n]=i.split("-"),a=[],r={aspectRatio:"1 / 1",height:`${Nt(e,s)}%`};n==="left"&&(r.left="2%"),n==="right"&&(r.right="2%"),n==="center"&&(r.left="50%",a.push("translateX(-50%)"));const u=`${2*(e/s)}%`;return l==="top"&&(r.top=u),l==="bottom"&&(r.bottom=u),l==="middle"&&(r.top="50%",a.push("translateY(-50%)")),a.length>0&&(r.transform=a.join(" ")),r}function wn(i,e,s,l,n,a){const r=Gt(l);if(n==="center")return{aspectRatio:`${yt} / ${r}`,height:`${Nt(i,e)*(r/rs)}%`,top:`${s}%`,left:"50%",transform:"translate(-50%, -50%)"};const[u,c]=a.split("-"),p=Nt(i,e),o=p*(e/i),f=p*(r/yt),d=2*(i/e),m=Math.max(.4,p*.06);let h=c==="left"?2:c==="right"?98-o:50-o/2;const x=u==="top"?d:u==="bottom"?100-d-p:50-p/2;let g=n==="above-qr"?x-f-m:n==="below-qr"?x+p+m:x+(p-f)/2;return h=mt(h,2,98-o),g=mt(g,d,100-d-f),{aspectRatio:`${yt} / ${r}`,width:`${o}%`,height:"auto",top:`${g}%`,left:`${h}%`}}function Nn(i,e,s){const l=(Gt(e)-2)/2*(s/100);return{paddingInline:`${i/Ht}em`,borderRadius:`${l/Ht}em`}}function ht(i){const e=de.c(16),{busy:s,checked:l,description:n,disabled:a,label:r,onChange:u}=i,p=s||(a===void 0?!1:a);let o;e[0]!==u?(o=g=>u(g.target.checked),e[0]=u,e[1]=o):o=e[1];let f;e[2]!==l||e[3]!==p||e[4]!==o?(f=t.jsx("input",{type:"checkbox",checked:l,disabled:p,onChange:o}),e[2]=l,e[3]=p,e[4]=o,e[5]=f):f=e[5];let d;e[6]!==r?(d=t.jsx("strong",{children:r}),e[6]=r,e[7]=d):d=e[7];let m;e[8]!==n?(m=t.jsx("small",{children:n}),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==d||e[11]!==m?(h=t.jsxs("span",{className:"confirm-toggle-copy",children:[d,m]}),e[10]=d,e[11]=m,e[12]=h):h=e[12];let x;return e[13]!==f||e[14]!==h?(x=t.jsxs("label",{className:"confirm-toggle",children:[f,h]}),e[13]=f,e[14]=h,e[15]=x):x=e[15],x}function st(i){const e=de.c(19),{busy:s,id:l,label:n,max:a,min:r,onChange:u,output:c,value:p}=i;let o;e[0]!==l||e[1]!==n?(o=t.jsx("label",{htmlFor:l,children:n}),e[0]=l,e[1]=n,e[2]=o):o=e[2];let f;e[3]!==l||e[4]!==c?(f=t.jsx("output",{htmlFor:l,children:c}),e[3]=l,e[4]=c,e[5]=f):f=e[5];let d;e[6]!==u?(d=x=>u(Number(x.target.value)),e[6]=u,e[7]=d):d=e[7];let m;e[8]!==s||e[9]!==l||e[10]!==a||e[11]!==r||e[12]!==d||e[13]!==p?(m=t.jsx("input",{id:l,type:"range",min:r,max:a,step:"1",value:p,disabled:s,onChange:d}),e[8]=s,e[9]=l,e[10]=a,e[11]=r,e[12]=d,e[13]=p,e[14]=m):m=e[14];let h;return e[15]!==o||e[16]!==f||e[17]!==m?(h=t.jsxs("div",{className:"confirm-range",children:[o,f,m]}),e[15]=o,e[16]=f,e[17]=m,e[18]=h):h=e[18],h}function Vt(i){const e=de.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=os(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=jn(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`,R=n>0?n:void 0;let N;e[19]!==a||e[20]!==c?(N=q=>c(Math.max(0,Number(q.target.value)||0),a),e[19]=a,e[20]=c,e[21]=N):N=e[21];let E;e[22]!==s||e[23]!==o||e[24]!==_||e[25]!==$||e[26]!==R||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:R,step:"0.1",value:o,disabled:s,onChange:N})]}),e[22]=s,e[23]=o,e[24]=_,e[25]=$,e[26]=R,e[27]=N,e[28]=E):E=e[28];let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{children:"End (s)"}),e[29]=I):I=e[29];const F=`${r}-end`,D=`${u} end`,L=!d,B=n>0?n:void 0,se=a??"";let W;e[30]!==n?(W=n>0?n.toFixed(1):"Clip end",e[30]=n,e[31]=W):W=e[31];let M;e[32]!==c||e[33]!==o?(M=q=>c(o,q.target.value===""?null:Math.max(0,Number(q.target.value)||0)),e[32]=c,e[33]=o,e[34]=M):M=e[34];let X;e[35]!==s||e[36]!==F||e[37]!==D||e[38]!==L||e[39]!==B||e[40]!==se||e[41]!==W||e[42]!==M?(X=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[I,t.jsx("input",{id:F,"aria-label":D,"aria-invalid":L,type:"number",min:"0",max:B,step:"0.1",value:se,placeholder:W,disabled:s,onChange:M})]}),e[35]=s,e[36]=F,e[37]=D,e[38]=L,e[39]=B,e[40]=se,e[41]=W,e[42]=M,e[43]=X):X=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`,oe=`${u} duration`,ce=!d,J=n>0?Math.max(0,n-o):void 0;let me;e[45]!==o||e[46]!==x?(me=x===null?"":Number(Math.max(0,x-o).toFixed(6)),e[45]=o,e[46]=x,e[47]=me):me=e[47];let ae;e[48]!==n||e[49]!==c||e[50]!==o?(ae=q=>c(o,q.target.value===""?null:Number(Math.min(n>0?n:1/0,o+Math.max(0,Number(q.target.value)||0)).toFixed(6))),e[48]=n,e[49]=c,e[50]=o,e[51]=ae):ae=e[51];let Z;e[52]!==s||e[53]!==U||e[54]!==oe||e[55]!==ce||e[56]!==J||e[57]!==me||e[58]!==ae?(Z=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[T,t.jsx("input",{id:U,"aria-label":oe,"aria-invalid":ce,type:"number",min:"0",max:J,step:"any",value:me,placeholder:"Clip end",disabled:s,onChange:ae})]}),e[52]=s,e[53]=U,e[54]=oe,e[55]=ce,e[56]=J,e[57]=me,e[58]=ae,e[59]=Z):Z=e[59];const xe=`Set ${u} start from playhead`;let te;e[60]!==l||e[61]!==a||e[62]!==c?(te=()=>c(a===null?l:Math.min(l,Math.max(0,a-.1)),a),e[60]=l,e[61]=a,e[62]=c,e[63]=te):te=e[63];let ue;e[64]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Mt,{size:8,"aria-hidden":"true"}),e[64]=ue):ue=e[64];let re;e[65]!==s||e[66]!==xe||e[67]!==te?(re=t.jsxs("button",{type:"button","aria-label":xe,disabled:s,onClick:te,children:[ue,"Start"]}),e[65]=s,e[66]=xe,e[67]=te,e[68]=re):re=e[68];const ye=`Set ${u} end from playhead`;let z;e[69]!==l||e[70]!==c||e[71]!==o?(z=()=>c(o,Math.max(l,o+.1)),e[69]=l,e[70]=c,e[71]=o,e[72]=z):z=e[72];let he;e[73]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Mt,{size:8,"aria-hidden":"true"}),e[73]=he):he=e[73];let le;e[74]!==s||e[75]!==ye||e[76]!==z?(le=t.jsxs("button",{type:"button","aria-label":ye,disabled:s,onClick:z,children:[he,"End"]}),e[74]=s,e[75]=ye,e[76]=z,e[77]=le):le=e[77];const fe=`Use whole clip for ${u}`;let V;e[78]!==c?(V=()=>c(0,null),e[78]=c,e[79]=V):V=e[79];let Q;e[80]!==s||e[81]!==fe||e[82]!==V?(Q=t.jsx("button",{type:"button","aria-label":fe,disabled:s,onClick:V,children:"Whole"}),e[80]=s,e[81]=fe,e[82]=V,e[83]=Q):Q=e[83];let G;e[84]!==re||e[85]!==le||e[86]!==Q?(G=t.jsxs("div",{className:"confirm-watermark-timing-actions",children:[re,le,Q]}),e[84]=re,e[85]=le,e[86]=Q,e[87]=G):G=e[87];let K;e[88]!==b||e[89]!==E||e[90]!==X||e[91]!==Z||e[92]!==S||e[93]!==G?(K=t.jsxs("div",{className:"confirm-watermark-timing-row",children:[S,b,E,X,Z,G]}),e[88]=b,e[89]=E,e[90]=X,e[91]=Z,e[92]=S,e[93]=G,e[94]=K):K=e[94];let Y;e[95]!==u||e[96]!==d?(Y=!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]=Y):Y=e[97];let ee;return e[98]!==g||e[99]!==K||e[100]!==Y?(ee=t.jsxs("div",{className:"confirm-watermark-timing",role:"group","aria-label":g,children:[K,Y]}),e[98]=g,e[99]=K,e[100]=Y,e[101]=ee):ee=e[101],ee}function Sn(i){const e=de.c(228),{busy:s,state:l,onChange:n,onMediaMetadata:a}=i,[r,u]=we.useState(0),c=l.identities[l.platform];let p,o,f;e[0]!==c.handle||e[1]!==l.platform?(p=Jl(c.handle),o=zt[l.platform],f=Zl(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=At(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=At(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?mt(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 R;e[27]!==r?(R=Ut(r),e[27]=r,e[28]=R):R=e[28];let N;e[29]!==m?(N=m>0?Ut(m):"—",e[29]=m,e[30]=N):N=e[30];let E;e[31]!==R||e[32]!==N?(E=t.jsxs("div",{className:"confirm-section-heading",children:[$,t.jsxs("strong",{children:[R," / ",N]})]}),e[31]=R,e[32]=N,e[33]=E):E=e[33];let I;e[34]!==s||e[35]!==r||e[36]!==m||e[37]!==n||e[38]!==_||e[39]!==l.includeQr||e[40]!==l.qrEndSeconds||e[41]!==l.qrStartSeconds?(I=l.includeQr&&t.jsx(Vt,{busy:s,currentTime:r,duration:m,endSeconds:l.qrEndSeconds,idPrefix:"watermark-qr-timing",label:"QR",playhead:_,startSeconds:l.qrStartSeconds,onChange:(P,ie)=>n({qrStartSeconds:P,qrEndSeconds:ie})}),e[34]=s,e[35]=r,e[36]=m,e[37]=n,e[38]=_,e[39]=l.includeQr,e[40]=l.qrEndSeconds,e[41]=l.qrStartSeconds,e[42]=I):I=e[42];let F;e[43]!==s||e[44]!==r||e[45]!==m||e[46]!==n||e[47]!==_||e[48]!==l.handleEndSeconds||e[49]!==l.handleStartSeconds||e[50]!==l.includeHandle?(F=l.includeHandle&&t.jsx(Vt,{busy:s,currentTime:r,duration:m,endSeconds:l.handleEndSeconds,idPrefix:"watermark-handle-timing",label:"Handle",playhead:_,startSeconds:l.handleStartSeconds,onChange:(P,ie)=>n({handleStartSeconds:P,handleEndSeconds:ie})}),e[43]=s,e[44]=r,e[45]=m,e[46]=n,e[47]=_,e[48]=l.handleEndSeconds,e[49]=l.handleStartSeconds,e[50]=l.includeHandle,e[51]=F):F=e[51];let D;e[52]!==I||e[53]!==F?(D=t.jsxs("div",{className:"confirm-watermark-timings",children:[I,F]}),e[52]=I,e[53]=F,e[54]=D):D=e[54];const L=`${w} / ${b}`,B=w/b;let se;e[55]!==L||e[56]!==B?(se={aspectRatio:L,"--watermark-preview-ratio":B},e[55]=L,e[56]=B,e[57]=se):se=e[57];const W=se;let M;e[58]!==a||e[59]!==l.mediaUrl||e[60]!==l.thumbnailUrl?(M=l.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:P=>{const ie=P.currentTarget;Number.isFinite(ie.duration)&&ie.duration>0&&ie.videoWidth>0&&ie.videoHeight>0&&a({durationSeconds:ie.duration,width:ie.videoWidth,height:ie.videoHeight})},onTimeUpdate:P=>u(P.currentTarget.currentTime),onSeeked:P=>u(P.currentTarget.currentTime)}):l.thumbnailUrl?t.jsx("img",{src:l.thumbnailUrl,alt:""}):t.jsx("span",{className:"watermark-preview-empty",children:"Video preview unavailable"}),e[58]=a,e[59]=l.mediaUrl,e[60]=l.thumbnailUrl,e[61]=M):M=e[61];let X;e[62]!==b||e[63]!==k||e[64]!==w||e[65]!==j||e[66]!==l.includeQr?(X=l.includeQr&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-qr",style:{...yn(k,w,b),opacity:j},"aria-hidden":"true",children:t.jsx(gn,{})}),e[62]=b,e[63]=k,e[64]=w,e[65]=j,e[66]=l.includeQr,e[67]=X):X=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:{...wn(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:Nn(l.handlePadding,l.handlePaddingY,l.handleRounding),children:[l.includePlatformIcon&&t.jsx(bn,{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 oe;e[87]!==W||e[88]!==M||e[89]!==X||e[90]!==T||e[91]!==U?(oe=t.jsxs("div",{className:"watermark-video-stage",style:W,children:[M,X,T,U]}),e[87]=W,e[88]=M,e[89]=X,e[90]=T,e[91]=U,e[92]=oe):oe=e[92];let ce;e[93]!==D||e[94]!==oe||e[95]!==E?(ce=t.jsxs("section",{className:"confirm-section confirm-watermark-preview","aria-label":"Preview",children:[E,D,oe]}),e[93]=D,e[94]=oe,e[95]=E,e[96]=ce):ce=e[96];let J;e[97]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx("span",{className:"confirm-section-label",children:"Identity"}),e[97]=J):J=e[97];let me;e[98]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{children:"Platform"}),e[98]=me):me=e[98];const ae=l.platform;let Z;e[99]!==n?(Z=P=>{const ie=P.target.value;cs(ie)&&n({platform:ie})},e[99]=n,e[100]=Z):Z=e[100];let xe;e[101]===Symbol.for("react.memo_cache_sentinel")?(xe=ds.map(Cn),e[101]=xe):xe=e[101];let te;e[102]!==s||e[103]!==l.platform||e[104]!==Z?(te=t.jsxs("label",{className:"confirm-field",children:[me,t.jsx("select",{value:ae,disabled:s,onChange:Z,children:xe})]}),e[102]=s,e[103]=l.platform,e[104]=Z,e[105]=te):te=e[105];const ue=l.includeHandle&&!l.includeQr;let re;e[106]!==n?(re=P=>n({includeHandle:P}),e[106]=n,e[107]=re):re=e[107];let ye;e[108]!==s||e[109]!==l.includeHandle||e[110]!==ue||e[111]!==re?(ye=t.jsx(ht,{busy:s,checked:l.includeHandle,description:"Centered account badge",disabled:ue,label:"Include handle",onChange:re}),e[108]=s,e[109]=l.includeHandle,e[110]=ue,e[111]=re,e[112]=ye):ye=e[112];let z;e[113]!==s||e[114]!==p||e[115]!==h||e[116]!==c.handle||e[117]!==c.recent||e[118]!==n||e[119]!==o||e[120]!==l.includeHandle||e[121]!==l.loadingConfig?(z=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"confirm-field",children:[t.jsxs("span",{children:[o," handle"]}),t.jsxs("div",{className:`confirm-handle-field${h?" invalid":""}`,children:[t.jsx("span",{"aria-hidden":"true",children:"@"}),t.jsx("input",{type:"text",value:c.handle,placeholder:l.loadingConfig?"Loading…":"handle","aria-invalid":h,disabled:s,onChange:P=>n({handle:P.target.value})})]}),h&&t.jsx("span",{className:"confirm-field-error",children:"Required while Include handle is on"})]}),c.recent.length>0&&t.jsx("div",{className:"confirm-chips",role:"group","aria-label":"Recent handles",children:c.recent.map(P=>t.jsxs("button",{type:"button",className:P===p?"active":"","aria-pressed":P===p,disabled:s,onClick:()=>n({handle:P}),children:["@",P]},P))})]}),e[113]=s,e[114]=p,e[115]=h,e[116]=c.handle,e[117]=c.recent,e[118]=n,e[119]=o,e[120]=l.includeHandle,e[121]=l.loadingConfig,e[122]=z):z=e[122];const he=l.includeQr&&!l.includeHandle;let le;e[123]!==n?(le=P=>n({includeQr:P,...P?{}:{handlePlacement:"center"}}),e[123]=n,e[124]=le):le=e[124];let fe;e[125]!==s||e[126]!==l.includeQr||e[127]!==he||e[128]!==le?(fe=t.jsx(ht,{busy:s,checked:l.includeQr,description:"Separately placed scannable link",disabled:he,label:"Include QR code",onChange:le}),e[125]=s,e[126]=l.includeQr,e[127]=he,e[128]=le,e[129]=fe):fe=e[129];let V;e[130]!==s||e[131]!==g||e[132]!==n||e[133]!==l.includeQr||e[134]!==l.url||e[135]!==d?(V=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]=V):V=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 G;e[142]!==te||e[143]!==ye||e[144]!==z||e[145]!==fe||e[146]!==V||e[147]!==Q?(G=t.jsxs("section",{className:"confirm-section","aria-label":"Identity",children:[J,te,ye,z,fe,V,Q]}),e[142]=te,e[143]=ye,e[144]=z,e[145]=fe,e[146]=V,e[147]=Q,e[148]=G):G=e[148];let K;e[149]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("span",{className:"confirm-section-label",children:"Appearance"}),e[149]=K):K=e[149];let Y;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?(Y=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsx(ht,{busy:s,checked:l.includePlatformIcon,description:`${o} mark before the handle`,label:`Show ${o} icon`,onChange:P=>n({includePlatformIcon:P})}),t.jsx(ht,{busy:s,checked:l.includeHandleBorder,description:"Outline around the pill",label:"Handle border",onChange:P=>n({includeHandleBorder:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-x",label:"Handle padding X",min:Rt,max:$t,output:`${l.handlePadding}px`,value:l.handlePadding,onChange:P=>n({handlePadding:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-y",label:"Handle padding Y",min:Rt,max:$t,output:`${l.handlePaddingY}px`,value:l.handlePaddingY,onChange:P=>n({handlePaddingY:P})}),t.jsx(st,{busy:s,id:"watermark-handle-rounding",label:"Corner rounding",min:ts,max:es,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]=Y):Y=e[159];let ee;e[160]!==s||e[161]!==n||e[162]!==l.includeQr||e[163]!==l.qrOpacity?(ee=l.includeQr&&t.jsx(st,{busy:s,id:"watermark-qr-opacity",label:"QR opacity",min:It*100,max:Tt*100,output:`${ut(l.qrOpacity)}%`,value:ut(l.qrOpacity),onChange:P=>n({qrOpacity:P/100})}),e[160]=s,e[161]=n,e[162]=l.includeQr,e[163]=l.qrOpacity,e[164]=ee):ee=e[164];let q;e[165]!==s||e[166]!==n||e[167]!==l.handleOpacity||e[168]!==l.includeHandle?(q=l.includeHandle&&t.jsx(st,{busy:s,id:"watermark-handle-opacity",label:"Handle opacity",min:It*100,max:Tt*100,output:`${ut(l.handleOpacity)}%`,value:ut(l.handleOpacity),onChange:P=>n({handleOpacity:P/100})}),e[165]=s,e[166]=n,e[167]=l.handleOpacity,e[168]=l.includeHandle,e[169]=q):q=e[169];let ne;e[170]!==l.fadeSeconds?(ne=vn(l.fadeSeconds),e[170]=l.fadeSeconds,e[171]=ne):ne=e[171];let ge;e[172]!==l.fadeSeconds?(ge=Math.round(l.fadeSeconds*10),e[172]=l.fadeSeconds,e[173]=ge):ge=e[173];let be;e[174]!==n?(be=P=>n({fadeSeconds:P/10}),e[174]=n,e[175]=be):be=e[175];let ve;e[176]!==s||e[177]!==ne||e[178]!==ge||e[179]!==be?(ve=t.jsx(st,{busy:s,id:"watermark-fade",label:"Fade in/out",min:us*10,max:ms*10,output:ne,value:ge,onChange:be}),e[176]=s,e[177]=ne,e[178]=ge,e[179]=be,e[180]=ve):ve=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 je;e[182]!==Y||e[183]!==ee||e[184]!==q||e[185]!==ve?(je=t.jsxs("section",{className:"confirm-section","aria-label":"Appearance",children:[K,Y,ee,q,ve,Ne]}),e[182]=Y,e[183]=ee,e[184]=q,e[185]=ve,e[186]=je):je=e[186];let Ee;e[187]===Symbol.for("react.memo_cache_sentinel")?(Ee=t.jsx("span",{className:"confirm-section-label",children:"Position"}),e[187]=Ee):Ee=e[187];let Se;e[188]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("span",{children:"QR position"}),e[188]=Se):Se=e[188];const pe=`confirm-chip${l.position==="auto"?" active":""}`,Fe=l.position==="auto",Ie=s||!l.includeQr;let Ce;e[189]!==n?(Ce=()=>n({position:"auto"}),e[189]=n,e[190]=Ce):Ce=e[190];let Ae;e[191]!==pe||e[192]!==Fe||e[193]!==Ie||e[194]!==Ce?(Ae=t.jsxs("div",{className:"confirm-watermark-qr-position-heading",children:[Se,t.jsx("button",{type:"button",className:pe,"aria-pressed":Fe,disabled:Ie,onClick:Ce,children:"Auto"})]}),e[191]=pe,e[192]=Fe,e[193]=Ie,e[194]=Ce,e[195]=Ae):Ae=e[195];let Le;e[196]!==s||e[197]!==n||e[198]!==l.includeQr||e[199]!==l.position?(Le=ls.map(P=>t.jsx("button",{type:"button",className:l.position===P?"active":"","aria-label":Ot[P],"aria-pressed":l.position===P,title:Ot[P],disabled:s||!l.includeQr,onClick:()=>n({position:P}),children:t.jsx("span",{})},P)),e[196]=s,e[197]=n,e[198]=l.includeQr,e[199]=l.position,e[200]=Le):Le=e[200];let Pe;e[201]!==Le?(Pe=t.jsx("div",{className:"confirm-position-grid",role:"group","aria-label":"QR position",children:Le}),e[201]=Le,e[202]=Pe):Pe=e[202];let De;e[203]!==Ae||e[204]!==Pe?(De=t.jsxs("div",{className:"confirm-watermark-qr-position",children:[Ae,Pe]}),e[203]=Ae,e[204]=Pe,e[205]=De):De=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:ss.map(P=>{const He=s||P!=="center"&&!l.includeQr;return t.jsx("button",{type:"button",className:l.handlePlacement===P?"active":"","aria-pressed":l.handlePlacement===P,disabled:He,onClick:()=>n({handlePlacement:P}),children:xn[P]},P)})})]}),l.handlePlacement==="center"&&t.jsx(st,{busy:s,id:"watermark-handle-vertical",label:"Handle vertical position",min:is,max:ns,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 Re;e[213]!==Ge?(Re=t.jsx("small",{className:"confirm-help",children:Ge}),e[213]=Ge,e[214]=Re):Re=e[214];let Ue;e[215]!==$e||e[216]!==Re?(Ue=t.jsxs("div",{className:"confirm-watermark-handle-position",children:[$e,Re]}),e[215]=$e,e[216]=Re,e[217]=Ue):Ue=e[217];let Te;e[218]!==De||e[219]!==Ue?(Te=t.jsxs("section",{className:"confirm-section confirm-watermark-position","aria-label":"Position",children:[Ee,De,Ue]}),e[218]=De,e[219]=Ue,e[220]=Te):Te=e[220];let ke;e[221]!==G||e[222]!==je||e[223]!==Te?(ke=t.jsxs("div",{className:"confirm-watermark-controls",children:[G,je,Te]}),e[221]=G,e[222]=je,e[223]=Te,e[224]=ke):ke=e[224];let Oe;return e[225]!==ce||e[226]!==ke?(Oe=t.jsxs("div",{className:"confirm-watermark",children:[ce,ke]}),e[225]=ce,e[226]=ke,e[227]=Oe):Oe=e[227],Oe}function Cn(i){return t.jsx("option",{value:i,children:zt[i]},i)}const Dn=Object.freeze(Object.defineProperty({__proto__:null,WatermarkBody:Sn},Symbol.toStringTag,{value:"Module"}));export{An as C,Rn as G,Fn as N,$n as P,Ln as R,Tn as S,Dn as W,Mn as a,In as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,j as t,b as ce,c as
|
|
1
|
+
import{a as i,j as t,b as ce,c as G}from"./vendor-react-Dj7D1fD4.js";import{B as ue,k as de}from"./ui-Cpr6zMTA.js";import{bw as X,dK as me,dL as fe,dM as pe}from"./videobook-B5G0jMoi.js";import{ap as he,a2 as be,X as xe}from"./vendor-icons-CGqhCIXV.js";function O(n){const e=G.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=G.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:J=[],imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,onAnalyzeSubjects:ee,onCaptureFrame:w,onEditingChange:te,onEditSubjects:M,onSubmitEditInstruction:A,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&&!!(M||A),[se,F]=i.useState(m?"view":u),[ne,re]=i.useState(b),[P,K]=i.useState(!1),[S,I]=i.useState(null),k=se==="edit"&&!m;if(i.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),i.useEffect(()=>{if(!L)return;const s=g.current;if(!s)return;U.current=d??(document.activeElement instanceof HTMLElement?document.activeElement:null);const r=document.querySelector(".app-shell"),E=r?.inert??!1,f=r?.getAttribute("aria-hidden")??null,ie=document.body.style.overflow;return r&&(r.inert=!0,r.setAttribute("aria-hidden","true")),document.body.style.overflow="hidden",s.showModal(),j.current?.focus(),()=>{s.close(),r&&(r.inert=E,f===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",f)),document.body.style.overflow=ie;const V=N.current;if(V){N.current=null,V();return}const W=U.current;X(W),requestAnimationFrame(()=>X(W))}},[L,d]),!m&&!v)return null;const B=s=>{if(!g.current)return;const r=pe(g.current);(s==="first"?r[0]:r.at(-1))?.focus({preventScroll:!0})},z=s=>{s.detail>0&&(N.current=fe()),T()},q=()=>{F("view"),requestAnimationFrame(()=>j.current?.focus())},oe=async()=>{const s=$.current;if(!s||!w||P)return;const r=Number.isFinite(s.duration)?s.duration:null,E=Math.max(0,r===null?s.currentTime:Math.min(s.currentTime,Math.max(0,r-.05)));K(!0),I(null);try{const f=await w(E);y.current&&I({tone:"success",text:`Frame saved to ${f}`})}catch(f){y.current&&I({tone:"error",text:f instanceof Error?f.message:String(f)})}finally{y.current&&K(!1)}},ae=s=>{k||s.defaultPrevented||ge(s.target)||s.metaKey||s.ctrlKey||s.altKey||!C||s.key.toLowerCase()!=="e"||(s.preventDefault(),F("edit"))},le=t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"media-fullscreen-chrome",children:[t.jsx(O,{address:e,asset:n}),t.jsxs("div",{className:"notebook-media-fullscreen-actions",children:[C&&t.jsxs("button",{type:"button",className:"media-fullscreen-edit","aria-keyshortcuts":"E",onClick:()=>F("edit"),children:[t.jsx(he,{size:16}),"Edit image"]}),m&&R&&w&&t.jsxs("button",{type:"button",className:"notebook-media-capture-button",disabled:P,onClick:()=>{oe()},children:[P?t.jsx(ue,{size:16}):t.jsx(be,{size:16}),"Extract frame"]}),t.jsx("button",{ref:j,type:"button",className:"notebook-media-fullscreen-close",onClick:z,"aria-label":"Close fullscreen preview","aria-keyshortcuts":"Escape","data-composer-focus":"return",children:t.jsx(xe,{size:20})}),S&&t.jsx("p",{className:`notebook-media-capture-status ${S.tone}`,role:"status",children:S.text})]})]}),t.jsx("div",{className:"media-fullscreen-stage",children:m?t.jsx(je,{address:e,playbackUrl:R,posterUrl:D,videoRef:$}):t.jsx("img",{src:v??"",alt:`@${e}`})}),C&&t.jsxs("p",{className:"media-fullscreen-keys","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("kbd",{children:"E"})," edit"]}),t.jsxs("span",{children:[t.jsx("kbd",{children:"Esc"})," close"]})]})]}),H=t.jsxs("dialog",{ref:g,className:`notebook-media-fullscreen ${k?"image-editor":"media-viewer"}${m?" playback-only":""}`,role:"dialog","aria-modal":"true","aria-label":`Fullscreen preview for @${e}`,onKeyDown:ae,onCancel:s=>{s.preventDefault(),k?q():T()},children:[p&&t.jsx("div",{ref:c,className:"notebook-media-composer-host actions-only","aria-label":"Media actions input"}),t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>B("last")}),k?t.jsx(de,{address:e,mediaUrl:v??"",width:a?.width??n.width??1e3,height:a?.height??n.height??1e3,details:t.jsx(O,{address:e,asset:n}),subjectMap:a,subjectMapLoading:o,analysisUnavailableReason:l,initialRegions:h,instruction:ne,onInstructionChange:s=>{re(s),x?.(s)},replacementCandidates:J,imageEditModels:Q,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,closeRef:j,onAnalyzeSubjects:ee,onEditingChange:te,onEditSubjects:M,onSubmitInstruction:A,onBack:q,onClose:z}):le,t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>B("first")})]});return typeof document>"u"?H:ce.createPortal(H,document.body)}export{Ne as N};
|