1"use strict";(self.webpackChunkalitu_frontend=self.webpackChunkalitu_frontend||[]).push([[3529,4793,7470],{23428(e,i,t){t.d(i,{A:()=>r});var n=t(17154),s=t(9255),o=t(74848);function r({color:e,...i}){return(0,o.jsx)(n.I,{height:"2px",width:"14px",...i,children:(0,o.jsx)("svg",{viewBox:"0 0 14 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("rect",{width:"14",height:"2",rx:"1",fill:e||s.Ay.podcastShade400})})})}},99766(e,i,t){t.d(i,{A:()=>o});var n=t(17154),s=t(74848);function o({...e}){return(0,s.jsx)(n.I,{width:"16px",height:"16px",...e,children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"m 14.302007,3.8374846 4.679,4.702 -11.8429997,11.9010004 -4.678,-4.701 z m 8.229,-1.134 -2.087,-2.09599997 a 2.063,2.063 0 0 0 -2.924,0 l -2,2.00799997 4.68,4.702 2.33,-2.343 a 1.608,1.608 0 0 0 0,-2.27 z M 0.01300727,22.347485 c -0.085,0.385 0.26,0.73 0.644,0.636 l 5.21400003,-1.27 -4.676,-4.701 z",fill:"currentColor",fillRule:"nonzero"})})})}},88236(e,i,t){t.d(i,{A:()=>r});var n=t(17154),s=t(9255),o=t(74848);function r({color:e,...i}){return(0,o.jsx)(n.I,{width:"14px",height:"14px",...i,children:(0,o.jsxs)("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{y:"6",width:"14",height:"2",rx:"1",fill:e||s.Ay.podcastShade400}),(0,o.jsx)("rect",{x:"8",width:"14",height:"2",rx:"1",transform:"rotate(90 8 0)",fill:e||s.Ay.podcastShade400})]})})}},18257(e,i,t){t.d(i,{A:()=>o});var n=t(17154),s=t(74848);function o({width:e,height:i,...t}){return(0,s.jsx)(n.I,{width:e,height:i,...t,children:(0,s.jsx)("svg",{fill:"none",viewBox:t.viewBox||"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsxs)("svg",{children:[(0,s.jsx)("path",{d:"M166 332h180c8.284 0 15-6.716 15-15s-6.716-15-15-15H166c-8.284 0-15 6.716-15 15s6.716 15 15 15zm0 60h180c8.284 0 15-6.716 15-15s-6.716-15-15-15H166c-8.284 0-15 6.716-15 15s6.716 15 15 15z"}),(0,s.jsx)("path",{d:"m507.606 84.394-80-80C424.793 1.58 420.978 0 417 0H15C6.716 0 0 6.716 0 15v482c0 8.284 6.716 15 15 15h482c8.284 0 15-6.716 15-15V95c0-3.979-1.581-7.794-4.394-10.606zM121 30h210v100H121V30zm270 452H121V272h270v210zm91 0h-61V257c0-8.284-6.716-15-15-15H106c-8.284 0-15 6.716-15 15v225H30V30h61v115c0 8.284 6.716 15 15 15h240c8.284 0 15-6.716 15-15V30h49.787L482 101.213V482z"}),(0,s.jsx)("path",{d:"M166 452h180c8.284 0 15-6.716 15-15s-6.716-15-15-15H166c-8.284 0-15 6.716-15 15s6.716 15 15 15z"})]})})})}},48736(e,i,t){var n=t(96540),s=t(55386),o=t(39541),r=t(74848);const c=(0,n.forwardRef)((({invalid:e=!1,inputFieldProps:i,...t},n)=>(0,r.jsx)(o._K,{ref:n,invalid:e,...t,min:0,children:(0,r.jsx)(o.OO,{...i,_focusWithin:{...s.A.variants?.visual?.primary._focusWithin,...i._focusWithin},onFocus:e=>{i?.onFocus?.(e)},onBlur:e=>{i?.onBlur?.(e)}})})));t.d(i,["A",0,c])},7176(e,i,t){t.d(i,{A:()=>l});var n=t(47499),s=t(62300),o=t(66448),r=t(13198),c=t(75632),a=t(74848);function l({open:e,onClose:i,heading:t,Body:n,Footer:s,width:r,isRobotIcon:c=!0}){return(0,a.jsx)(d,{open:e,onOpenChange:e=>!e.open&&i(),children:(0,a.jsxs)(o.Cf,{width:r||"420px",children:[(0,a.jsx)(u,{heading:t,mb:"8px",isRobotIcon:c}),(0,a.jsx)(p,{children:n}),(0,a.jsx)(h,{children:s})]})})}function d(e){return(0,a.jsxs)(o.Dz,{placement:"center",scrollBehavior:"inside",trapFocus:!1,...e,children:[(0,a.jsx)(o.Xi,{}),(0,a.jsx)(o.f5,{children:e.children})]})}function u({heading:e,isRobotIcon:i=!0,...t}){return(0,a.jsxs)(n.a,{mt:i?"30px":"0",mx:"30px",...t,children:[i&&(0,a.jsx)(r._,{src:c,h:"44px"}),(0,a.jsx)(o.tK,{top:i?"29px":"20px",right:"30px"}),(0,a.jsx)(s.D,{color:"podcastShade600",size:"h5",mt:"20px",children:e})]})}function p(e){return(0,a.jsx)(n.a,{px:"30px",...e})}function h(e){return(0,a.jsx)(n.a,{p:"30px",...e})}},73529(e,i,t){t.d(i,{Ay:()=>r,K7:()=>c});var n=t(47499),s=t(96540),o=t(74848);function r(e){const{title:i,...t}=e;return(0,s.useEffect)((()=>{document.title=i?`${i} - Alitu`:"Alitu"}),[i]),(0,o.jsx)(n.a,{className:"page",as:"section",w:"100%",h:"100%",minH:"100vh",bg:"podcastShade100",zIndex:"1",alignItems:"stretch",...t})}function c(e){return(0,o.jsx)(n.a,{as:"main",...a,...e,children:e.children})}const a={maxWidth:"68.75rem",py:"1.875rem",mx:"auto"};t.d(i,["BA",0,a])},48678(e,i,t){t.a(e,(async(e,n)=>{try{var s=t(95420),o=t(47499),r=t(62300),c=t(7233),a=t(27823),l=t(42218),d=t(61702),u=t(99766),p=t(18257),h=t(78721),x=t(94196),m=t(96540),f=t(69470),g=t(4646),y=t(10614),v=t(85769),A=t(86256),w=t(67583),j=t(57848),b=t(9255),P=t(95638),C=t(1922),k=t(34251),S=t(37047),E=t(33766),I=t(68151),R=t(23423),V=t(74848),M=e([v]),F=M.then?(await M)():M;function L({kind:e,asset:i,isPlaying:t,disabledControls:n,position:M,onTogglePlay:F,onSelect:L,onEdit:T,onSeek:W,isMusicEdited:$,isVoiceEdited:O,dispatch:z}){const B=(0,f.Z1)(),N=Number(i?.codecInformation?.format?.duration),H=!("music"!==e),D="music"===e?$:O,[_,q]=(0,m.useState)(!1),[K,G]=(0,m.useState)(),[Z,J]=(0,m.useState)(!1),[U,{data:Q}]=(0,j.Ihg)({fetchPolicy:"network-only",pollInterval:K?1e3:0}),[X]=(0,s.n)(j.T4L,{fetchPolicy:"no-cache"}),[Y]=(0,j.Ihg)({fetchPolicy:"network-only",pollInterval:K?1e3:0});return(0,m.useEffect)((()=>{(0,S.A)(B,"user is not defined"),K&&U({variables:{id:K.id,projectId:B.activeProjectId}})}),[K,B,U]),(0,m.useEffect)((()=>
1{if("complete"===Q?.file?.audioJob?.status&&K){const e={...Q.file,tags:Q.file.tags?Q.file.tags:[]};L(e),G(null)}}),[Q,K,L]),(0,m.useEffect)((()=>()=>{x.Howler.stop()}),[]),K?(0,V.jsx)(R.A,{}):(0,V.jsxs)(V.Fragment,{children:[!i&&(0,V.jsx)(I.A,{children:(0,V.jsxs)(a.$,{size:"lg",minWidth:"197px",visual:H?"secondary":"primary",onClick:()=>q(!0),children:[H?(0,V.jsx)(A.FI.Music,{opacity:"0.8",color:"white"}):(0,V.jsx)(A.FI.VoiceClip,{opacity:"0.8",color:"white"}),"Add ",e," track"]})}),i&&(0,V.jsxs)(I.A,{children:[(0,V.jsx)(o.a,{margin:"10px 20px",w:"60px",children:P.A.toMinutesAndSeconds(M)}),(0,V.jsxs)(l.s,{as:"section",width:"100%",justifyContent:"center",flexDirection:"column",children:[(0,V.jsx)(r.D,{fontFamily:k.A.normal,margin:"auto",children:(0,C.A)(i.name)}),(0,V.jsxs)(l.s,{justifyContent:"flex-end",flexDirection:"row",width:"90%",margin:"0 auto 5px",children:[(0,V.jsx)("button",{type:"button",title:`Edit ${e}`,onClick:T,children:(0,V.jsx)(o.a,{ml:"8px",cursor:"pointer",children:(0,V.jsx)(u.A,{color:b.Ay.podcastShade400})})}),(0,V.jsx)("button",{type:"button",title:`Remove ${e}`,onClick:function(){z({type:"stopPreview"}),L(null)},children:(0,V.jsx)(o.a,{ml:"8px",cursor:"pointer",children:(0,V.jsx)(h.A,{fill:b.Ay.podcastShade400,width:"16px",height:"16px"})})}),D&&(0,V.jsx)(o.a,{ml:"8px",cursor:"pointer",children:(0,V.jsx)(p.A,{width:"18px",height:"18px",viewBox:"0, -10, 520, 520",fill:b.Ay.podcastShade400,onClick:()=>async function(){(0,S.A)(i,"asset is not defined"),X({variables:{id:i.id,newData:{tags:["main_asset","music"],name:`${(0,C.A)(i.name)} - edited`}}}),J(!0)}()})})]}),(0,V.jsxs)(o.a,{"data-label":"Clip.tsx",position:"relative",width:"90%",margin:"0 auto",css:{"&&.waveform":{display:"none"}},children:[(0,V.jsx)(E.A,{value:[1e3*M/N],min:0,max:1e3,step:1,onValueChange:e=>W(e.value[0]*N/1e3),cursor:"pointer",disabled:n,visual:"grey"}),(0,V.jsx)(o.a,{textAlign:"center",mt:"15px",children:(0,V.jsx)(d.K,{_focus:{border:"none",boxShadow:"none !important"},disabled:n,visual:"empty","aria-label":t?"pause":"play",onClick:()=>F(),color:b.Ay.podcastShade300,children:t?(0,V.jsx)(g.A,{boxSize:"1.5em"}):(0,V.jsx)(y.A,{boxSize:"1.5em"})})})]})]}),(0,V.jsx)(o.a,{margin:"10px 20px",children:P.A.toMinutesAndSeconds(N)})]}),(0,V.jsx)(v.A,{open:_,onClose:()=>q(!1),onAddFiles:function(e){const i=e[0];(0,S.A)(B,"user is not defined"),Y({variables:{id:i,projectId:B.activeProjectId}}).then((({data:e})=>{if(e)if("complete"!==e?.file?.audioJob?.status){const i=e.file;G(i)}else{const i=e.file;L(i)}})),q(!1)},allowMultiple:!1}),(0,V.jsx)(w.Ay,{open:Z,onClose:()=>J(!1),heading:"That's saved",Body:(0,V.jsx)(c.E,{children:"Okay! We've saved the edited version of the file in your Library."}),Footer:(0,V.jsx)(a.$,{onClick:()=>J(!1),w:"100%",children:"Done"})})]})}v=F[0];const T=L;t.d(i,["A",0,T]),n()}catch(W){n(W)}}
1))},68151(e,i,t){t.d(i,{A:()=>r});var n=t(42218),s=t(9255),o=t(74848);function r({children:e}){return(0,o.jsx)(n.s,{w:"700px",h:"156px",border:`2px solid ${s.Ay.podcastShade200}`,bg:s.Ay.white,borderRadius:"12px",alignItems:"center",justifyContent:"center",children:e})}},90028(e,i,t){t.a(e,(async(e,n)=>{try{t.r(i);var s=t(47499),o=t(62300),r=t(7233),c=t(33008),a=t(27823),l=t(42218),d=t(33834),u=t(94196),p=t(96540),h=t(69470),x=t(4646),m=t(10614),f=t(7793),g=t(48736),y=t(29929),v=t(79517),A=t(73529),w=t(58542),j=t(57848),b=t(26362),P=t(29886),C=t(9255),k=t(87504),S=t(84899),E=t(37047),I=t(88486),R=t(3719),V=t(7176),M=t(48678),F=t(13846),L=t(34255),T=t(26025),W=t(89550),$=t(74848),O=e([M]),z=O.then?(await O)():O;M=z[0];const B={voiceAsset:null,musicAsset:null,voicePosition:0,musicPosition:0,voicePlaying:!1,musicPlaying:!1,previewPlaying:!1,musicIntroLength:3,musicOutroLength:5,musicTimeline:[],voiceTimeline:[],fileName:"",isVoiceEdited:!1,isMusicEdited:!1,musicVolume:.5};function N(e,i,t,n){const s=(0,h.Z1)();(0,p.useEffect)((()=>(e&&(t.current=new u.Howl({src:(0,k.A)({fileId:e.id,type:"preview"}),html5:!0,onloaderror:(i,t)=>G(t,e.id)})),()=>{t.current?.unload()})),[s,e,t]),(0,p.useEffect)((()=>(i&&(n.current=new u.Howl({src:(0,k.A)({fileId:i.id,type:"preview"}),html5:!0,onloaderror:(e,t)=>G(t,i.id)})),()=>{n.current?.unload()})),[i,n,s])}function H(e,i,t,n){const s=(0,p.useCallback)((function(e){return function s(){const o="voice"===e?t:n,r="voice"===e?"setVoicePosition":"setMusicPosition";(0,E.A)(o.current,"audioRef.current is not defined in getTickFn");const c=o.current.seek();i({type:r,payload:"object"==typeof c?0:c}),o.current.playing()&&requestAnimationFrame(s)}}),[i,n,t]);(0,p.useEffect)((()=>{const n=t.current;if(e.voiceAsset){(0,E.A)(n,"voice is not defined in useSetupAudioEventListeners");let t=n.seek();n.on("load",(()=>{t>0&&(n.seek(t),e.voicePlaying&&n.play())})),n.on("play",(()=>{requestAnimationFrame(s("voice")),i({type:"playVoice"})})),n.on("seek",(()=>{requestAnimationFrame(s("voice")),t=n.seek()})),n.on("pause",(()=>{requestAnimationFrame(s("voice")),i({type:"pauseVoice"})})),n.on("stop",(()=>{requestAnimationFrame(s("voice")),i({type:"pauseVoice"})})),n.on("end",(()=>i({type:"pauseVoice"}))),n.on("loaderror",((i,t)=>{if(t!==MediaError.MEDIA_ERR_NETWORK)throw new Error(`Howl load error: ${t}`);n.unload(),(0,E.A)(e.voiceAsset,"state.voiceAsset is not defined in useSetupAudioEventListeners"),n.load()}))}return()=>{n?.off("load"),n?.off("play"),n?.off("seek"),n?.off("pause"),n?.off("stop"),n?.off("end"),n?.off("loaderror")}}),[e.voiceAsset,e.voicePlaying,t,i,s]),(0,p.useEffect)((()=>{const t=n.current;if(e.musicAsset){(0,E.A)(t,"music is not defined in useSetupAudioEventListeners");let o=t.seek();t.on("load",(()=>{o>0&&(t.seek(o),e.musicPlaying&&t.play())})),t.on("play",(()=>{requestAnimationFrame(s("music")),i({type:"playMusic"})})),t.on("seek",(()=>{requestAnimationFrame(s("music")),o=t.seek()})),t.on("pause",(()=>{i({type:"pauseMusic"}),requestAnimationFrame(s("music"))})),t.on("stop",(()=>{i({type:"pauseMusic"}),requestAnimationFrame(s("music"))})),t.on("end",(()=>{n.current&&(n.current.loop()||i({type:"pauseMusic"}))})),t.on("loaderror",((e,i)=>{if(i!==MediaError.MEDIA_ERR_NETWORK)throw new Error(`Howl load error: ${i}`);t.unload(),t.load()}))}return()=>{t?.off("load"),t?.off("play"),t?.off("seek"),t?.off("pause"),t?.off("stop"),t?.off("end"),t?.off("loaderror")}}),[e.musicAsset,e.musicPlaying,n,i,s])}function D(e,i,t,n){const s=(0,P.A)(e.previewPlaying),o=e.voiceAsset&&Number(e.voiceAsset.codecInformation.format.duration),r=e.musicAsset&&Number(e.musicAsset.codecInformation.format.duration),c=e.musicIntroLength+(o??0)+e.musicOutroLength,a=e.musicIntroLength+(o??0),l=1e3,d=(0,p.useRef)(0),u=(0,P.A)(e.musicPosition);(0,p.useEffect)((()=>{if(e.previewPlaying&&r)if(e.musicPosition>u){const i=e.musicPosition-u;d.current+=i<1?i:0}else if(e.musicPosition<u){const i=r+e.musicPosition-u;d.current+=i<1?i:0}})),(0,p.useEffect)((()=>{e.previewPlaying&&!s&&r?((0,E.A)(t.current,"voiceRef.current is not defined"),(0,E.A)(n.current,"musicRef.current is not defined"),t.current.stop(),n.current.stop(),d.current=0,c>r&&n.current.loop(!0)):!e.previewPlaying&&s&&((0,E.A)(t.current,"voiceRef.current is not defined"),(0,E.A)(n.current,"musicRef.current is not defined"),n.current.loop(!1),n.current.stop(),t.current.stop(),d.current=0)}),[e.previewPlaying,r,o,n,t,i,e.musicPosition,e.musicIntroLength,s,c]);const h=e.musicIntroLength,x=e.previewPlaying&&!e.voicePlaying&&d.current>=h&&d.current<h+(o??0)/2,m=e.musicIntroLength>0,f=e.previewPlaying&&!s;(0,p.useEffect)((()=>{f&&((0,E.A)(n.current,"musicRef.current is not defined"),m?n.current.fade(0,1,500):n.current.fade(e.musicVolume,e.musicVolume,0),n.current.play())}),[f,m,n,i,e.musicVolume]);const g=m&&e.previewPlaying&&d.current>=h-.5&&d.current<=h;(0,p.useEffect)((()=>{g&&((0,E.A)(n.current,"musicRef.current is not defined"),n.current.fade(1,e.musicVolume,l))}),[g,n,e.musicVolume]),(0,p.useEffect)((()=>{x&&((0,E.A)(t.current,"voiceRef.current is not defined"),t.current.play())}),[x,i,t]);const y=e.musicOutroLength>0,v=y&&e.previewPlaying&&d.current>=a-.5&&d.current<=a,A=y&&e.previewPlaying&&d.current>=c-.5&&d.current<=c;(0,p.useEffect)((()=>{v?((0,E.A)(n.current,"musicRef.current is not defined"),n.current.fade(.1,1,l)):A&&((0,E.A)(n.current,"musicRef.current is not defined"),n.current.fade(1,0,500))}),[v,A,n]);const w=d.current>=c;(0,p.useEffect)((()=>{w&&i({type:"stopPreview"})}),[w,i])}function _(){const[e,i]=(0,p.useReducer)(K,B),t=(0,p.useRef)(),n=(0,p.useRef)(),[u,h]=(0,p.useState)(),P=!!u,{open:k,onOpen:O,onClose:z}=(0,c.j)(),_=(0,I.Ub)("(max-width: 550px)"),q=(0,S.A)(),[G,{error:Z}]=(0,j.wcF)();(0,b.A)(Z);const{voiceAsset:J,musicAsset:U,voicePlaying:Q,voicePosition:X,previewPlaying:Y,musicPlaying:ee,musicPosition:ie,isVoiceEdited:te,isMusicEdited:ne}=e,se=J&&U,oe=(0,p.useCallback)(((e,t)=>{i({type:"voice"===e?"selectVoice":"selectMusic",payload:t})}),[]);function re(e){const i="voice"===e?t:n;return(0,E.A)(i.current,"audioRef.current is not defined in togglePlay"),i.current.playing()?i.current.pause():i.current.play()}function ce({timeline:e}){const t={timeline:e};"music"===u?i({type:"saveMusicTimeline",payload:t}):"voice"===u&&i({type:"saveVoiceTimeline",payload:t})}function ae(e,i){let s;switch(i){case"voice":s=t;break;case"music":s=n;break;default:return new Error("Kind should be 'voice' or 'music'")}return(0,E.A)(s.current,"audioRef.current is not defined in handleSeek"),s.current.seek(e)}return N(J,U,t,n),H(e,i,t,n),D(e,i,t,n),(0,$.jsxs)("div",{children:[(0,$.jsx)(R.A,{isBlocked:!(!J&&!U||k),title:"Are you sure you want to exit Clip Genie?",bodyText:"Your work will be lost if you leave this page."}),P&&(0,$.jsx)(T.A,{file:e[`${u}Asset`],onSave:ce,timeline:e[`${u}Timeline`],onClose:function(e){e&&("music"===u&&(U.id!==e.id&&i({type:"setIsMusicEdited"}),i({type:"selectMusic",payload:e})),"voice"===u&&(J.id!==e.id&&i({type:"setIsVoiceEdited"}),i({type:"selectVoice",payload:e}))),ce({timeline:[]}),h(null)}}),_&&(0,$.jsx)(v.A,{children:"For the best Alitu experience please use a higher screen resolution. Alitu is optimized for screens above 550
1px wide."}),!P&&(0,$.jsxs)(A.Ay,{title:"Clip Genie",children:[(0,$.jsx)(w.ud,{children:(0,$.jsxs)(o.D,{size:"h1",textAlign:"center",children:["Clip Genie",(0,$.jsx)(y.A,{})]})}),(0,$.jsxs)(A.K7,{h:"calc(100vh - 128px - 84px)",children:[(0,$.jsx)(F.B,{children:(0,$.jsx)(M.A,{kind:"voice",asset:J,isPlaying:Q,position:X,disabledControls:Y,onSelect:e=>oe("voice",e),onTogglePlay:()=>re("voice"),onSeek:e=>ae(e,"voice"),onEdit:()=>{i({type:"stopPreview"}),h("voice")},isVoiceEdited:te,dispatch:i})}),(0,$.jsxs)(F.B,{hasSelectedAsset:!!U,children:[U&&(0,$.jsxs)(L.O,{children:[(0,$.jsx)(s.a,{as:"span",mb:"10px",display:"block",children:"Intro length"}),(0,$.jsxs)(l.s,{alignItems:"center",gridGap:"5px",children:[(0,$.jsx)(g.A,{defaultValue:"0",min:0,minW:"70px",name:"intro-length",disabled:e.previewPlaying,value:e.musicIntroLength.toString(),onValueChange:e=>i({type:"setMusicIntroLength",payload:e.valueAsNumber}),inputFieldProps:{bgColor:C.Ay.white,paddingLeft:"9px",_focusWithin:{paddingLeft:"9px"}}}),"seconds"]})]}),(0,$.jsx)(M.A,{kind:"music",asset:U,isPlaying:ee,position:ie,disabledControls:Y,onSelect:e=>oe("music",e),onTogglePlay:()=>re("music"),onEdit:()=>{i({type:"stopPreview"}),h("music")},onSeek:e=>ae(e,"music"),isMusicEdited:ne,dispatch:i}),U&&(0,$.jsxs)(L.O,{children:[(0,$.jsx)(s.a,{as:"span",mb:"10px",display:"block",children:"Outro length"}),(0,$.jsxs)(l.s,{alignItems:"center",gridGap:"5px",children:[(0,$.jsx)(g.A,{defaultValue:"0",min:0,minW:"70px",name:"outro-length",disabled:e.previewPlaying,value:e.musicOutroLength.toString(),onValueChange:e=>i({type:"setMusicOutroLength",payload:e.valueAsNumber}),width:"80px",inputFieldProps:{bgColor:C.Ay.white,paddingLeft:"9px",_focusWithin:{paddingLeft:"9px"}}}),"seconds"]})]})]}),se&&(0,$.jsx)(l.s,{justifyContent:"center",mt:"18px",mx:"auto",background:C.Ay.white,p:"9px 20px",border:`2px solid ${C.Ay.podcastShade200}`,borderRadius:"12px",w:"fit-content",children:(0,$.jsx)(W.A,{defaultVolume:e.musicVolume||.5,onChangeVolume:e=>{i({type:"setMusicVolume",payload:e})},isPlaying:e.musicPlaying,text:"Music Volume"})}),(0,$.jsx)(V.A,{open:k,isRobotIcon:!1,onClose:z,heading:"Save clip to Library",Body:(0,$.jsxs)(s.a,{children:[(0,$.jsx)(r.E,{mb:"14px",children:"Please enter the name of your new clip:"}),(0,$.jsx)(d.p,{placeholder:"e.g. My Awesome Ad",onChange:e=>i({type:"setFileName",payload:e.target.value}),value:e.fileName,width:"100%",margin:"0 0 !important"})]}),Footer:(0,$.jsxs)(l.s,{gap:"10px",children:[(0,$.jsx)(a.$,{onClick:async()=>{!async function(){await G({variables:{fileName:e.fileName,voice:e.voiceAsset,music:e.musicAsset,introDuration:e.musicIntroLength,outroDuration:e.musicOutroLength,musicVolume:e.musicVolume}}),q.render({title:"Saved to Library",description:`as ${e.fileName||"Clip Genie Result"}`})}(),i({type:"reset"}),z()},children:"Save to Library"}),(0,$.jsx)(a.$,{visual:"tertiary",onClick:z,children:"Cancel"})]})})]}),se&&(0,$.jsxs)(f.A,{bg:C.Ay.white,borderTop:`2px solid ${C.Ay.podcastShade200}`,px:"60px",gap:"10px",children:[(0,$.jsxs)(a.$,{onClick:()=>i({type:"togglePlayPreview"}),visual:"secondary",size:"lg",children:[Y?(0,$.jsx)(x.A,{opacity:"0.8",w:"20px",h:"20px"}):(0,$.jsx)(m.A,{opacity:"0.8",w:"20px",h:"20px"}),"Preview clip"]}),(0,$.jsx)(a.$,{onClick:O,size:"lg",children:"Save clip to library"})]})]})]})}const q=_;function K(e,{type:i,payload:t}){switch(i){case"selectVoice":return{...e,voiceAsset:t,voicePlaying:!1,voicePosition:0};case"selectMusic":return{...e,musicAsset:t,musicPlaying:!1,musicPosition:0};case"togglePlayVoice":return{...e,voicePlaying:!e.voicePlaying};case"playVoice":return{...e,voicePlaying:!0};case"pauseVoice":return{...e,voicePlaying:!1};case"setVoicePosition":return{...e,voicePosition:t};case"setMusicPosition":return{...e,musicPosition:t};case"togglePlayMusic":return{...e,musicPlaying:!e.musicPlaying};case"playMusic":return{...e,musicPlaying:!0};case"pauseMusic":return{...e,musicPlaying:!1};case"togglePlayPreview":return{...e,previewPlaying:!e.previewPlaying};case"stopPreview":return{...e,previewPlaying:!1,previewStartTime:null};case"setMusicIntroLength":return{...e,musicIntroLength:t};case"setMusicOutroLength":return{...e,musicOutroLength:t};case"saveVoiceTimeline":return{...e,voiceTimeline:t.timeline};case"saveMusicTimeline":return{...e,musicTimeline:t.timeline};case"setFileName":return{...e,fileName:t};case"setIsVoiceEdited":return{...e,isVoiceEdited:!0};case"setIsMusicEdited":return{...e,isMusicEdited:!0};case"setMusicVolume":return{...e,musicVolume:Number.isFinite(t)?t:e.musicVolume};case"reset":return{...B};default:return e}}function G(e,i){const t=e.currentTarget?.error?.code;if(t===MediaError.MEDIA_ERR_NETWORK){const{currentTime:t,paused:n}=e.currentTarget;n||e.currentTarget.pause(),e.currentTarget.src=(0,k.A)({fileId:i,type:"preview"}),e.currentTarget.load(),e.currentTarget.currentTime=t,n||e.currentTarget.play()}}t.d(i,["default",0,q]),n()}catch(Z){n(Z)}}))},23423(e,i,t){t.d(i,{A:()=>a});var n=t(47499),s=t(70255),o=t(34251),r=t(9255),c=t(74848);function a(){return(0,c.jsxs)(n.a,{width:"700px",boxShadow:`0 0 10px ${r.Ay.podcastShade400}`,margin:"30px auto",padding:"30px 0",children:[(0,c.jsx)(n.a,{height:"10px",margin:"10px auto",width:"90%",children:(0,c.jsx)(s.A,{height:"100%"})}),(0,c.jsx)(n.a,{width:"150px",margin:"0 auto",fontFamily:o.A.bold,height:"25px",lineHeight:"25px",borderRadius:"100px",backgroundColor:r.Ay.podcastShade200,fontSize:"12px",color:"grey",mb:"13px",textAlign:"center",children:"Cleaning up audio"})]})}},13846(e,i,t){t.d(i,{B:()=>o});var n=t(42218),s=t(74848);function o({children:e,hasSelectedAsset:i}){return(0,s.jsx)(n.s,{flexDirection:"row",alignItems:"center",justifyContent:i?"space-between":"center",mt:"30px",children:e})}},34255(e,i,t){t.d(i,{O:()=>r});var n=t(47499),s=t(9255),o=t(74848);function r({children:e}){return(0,o.jsx)(n.a,{padding:"20px",width:"175px",border:`2px solid ${s.Ay.podcastShade300}`,borderRadius:"18px",children:e})}},26025(e,i,t){t.d(i,{A:()=>z});var n=t(47499),s=t(62300),o=t(42218),r=t(27823),c=t(96540),a=t(69470),l=t(98885),d=t(57848),u=t(71037),p=t(37047),h=t(98794),x=t(30287),m=t(33008),f=t(28034),g=t(38864),y=t(43296),v=t(76213),A=t(610),w=t(51802),j=t(33620),b=t(43321),P=t(91821),C=t(19154),k=t(11613),S=t(84236),E=t(47304),I=t(27777),R=t(25858),V=t.n(R),M=t(75901);var F=t(59068),L=t(68490),T=t(74848);function W({asset:e,timeline:i,onSave:t}){const s=(0,c.useRef)(),[r,l]=(0,u.W)(),[{position:d}]=(0,I.k)(),h=(0,c.useRef)(null),R=(0,g.A)(i)??e.duration??0,{setPlaybackRate:W,increasePlaybackRate:$,decreasePlaybackRate:O}=(0,P.A)();(0,k.A)(h);const z=(0,c.useCallback)((e=>{s.current=e,(0,C.A)({alituWavesRef:s,timeline:i}),l({waveformReady:!0})}),[l,i]),B=(0,E.A)({alituWavesRef:s,onSave:t}),N=(0,m.j)(),H=(0,m.j)(),D=(0,m.j)(),_=(0,c.useCallback)((e=>{s.current?.dispatch(e)}),[]),q=(0,c.useCallback)((e=>{l({numberOfCutsBeingReplaced:e}),_({type:"pause"}),H.onOpen()}),[l,_,H]);const K=(0,S.A)({});(0,b.A)({dispatch:_,increasePlaybackRate:$,decreasePlaybackRate:O});const{eventHandler:G,errorMessage:Z}=function({onReady:e,handleRegionBeingEditedChange:i,openAutoCollapseExplainerDialog:t,openWarningDialog:n,save:s,confirmReplaceCuts:o}){const[,r]=(0,u.W)(),[,a]=(0,I.k)(),[,l]=(0,M.w)(),[d,p]=(0,c.useState)(null),h=V()((e=>{a({position:e})}),100),x=V()((e=>{a({hoverPosition:e})}),100);return{eventHandler:(0,c.useCallback)(((c,a)=>{const d={error:()=>{p(a)},"loaded-percent":()=>r({percentLoaded:a.percent}),ready:()=>e(a),"time-change":()=>{h(a)},"time-hover":()=>x(a),play:()=>r({playing:!0}),pause:()=>r({playing:!1}),ended:()=>r({playing:!1}),tooltip:()=>l(a),dialog:()=>{r({dialog:a}),n()},"region-being-edited":()=>i&&i(a),"region-auto-collapse":()=>t(),"cut-region-removed":()=>s(),"cut-region-edit-start":()=>r({activeTool:"cut"}),"region-updated":()=>{s()},"region-newly-created-set":()=>r({isRegionNewlyCreated:!0}),"region-newly-created-clear":()=>r({isRegionNewlyCreated:!1}),"preview-start":()=>r({isPreviewing:!0}),"preview-progress":()=>r({previewProgress:a}),"preview-finished":()=>r({isPreviewing:!1,previewProgress:0}),"confirm-replace-cuts":()=>o(a)}[c];d&&d()}),[r,e,h,x,l,n,i,t,s,o]),errorMessage:d}}({onReady:z,openAutoCollapseExplainerDialog:N.onOpen,openWarningDialog:D.onOpen,confirmReplaceCuts:q,save:B}),J=(0,a.Z1)();(0,p.A)(J?.activeProjectId,"activeProjectId is required");const U=(0,v.Zp)();return Z?(0,T.jsx)(y.A,{Body:Z,open:!0,onTryAgain:()=>{U(0)},onClose:()=>U(0)}):(0,T.jsxs)(n.a,{flexGrow:1,minW:"500px",position:"relative",children:[N.open&&(0,T.jsx)(L.A,{open:!0,onClose:N.onClose}),D.open&&(0,T.jsx)(F.A,{open:!0,onClose:D.onClose}),(0,T.jsx)(o.s,{direction:"column",h:"100%",children:(0,T.jsxs)(j.A.WaveformBlock,{onWheel:function(e){s.current?.onWheel(e)},ref:h,mb:"0",children:[(0,T.jsxs)(n.a,{children:[(0,T.jsxs)(n.a,{outline:"none",position:"relative",tabIndex:-1,role:"button",onMouseEnter:()=>l({overlay:!1}),children:[(0,T.jsx)(w.A,{}),(0,T.jsx)(x.A,{options:K,mainFileId:e.id,additionalFiles:e.additionalFiles?.filter((e=>null!==e)),eventHandler:G,playbackRate:r.playbackRate,isActiveView:!0})]}),(0,T.jsx)(f.w,{h:"1px"}),(0,T.jsx)(A.A,{dispatch:_,playing:r.playing,timestamp:d,duration:e.duration??0,lengthAfterEdits:R,playbackRate:r.playbackRate,setPlaybackRate:W,showLengthBeforeEdits:!0})]}),(0,T.jsx)(f.w,{h:"1px"})]})})]})}const $=function({asset:e,onSave:i,timeline:t}){return(0,T.jsx)(M.E,{children:(0,T.jsx)(I.U,{children:(0,T.jsx)(W,{timeline:t,asset:e,onSave:i})})})};function O({file:e,timeline:i,onSave:t,onClose:x}){const m=(0,a.Z1)();(0,p.A)(m,"User not found");const[f]=(0,u.W)(),[g,y]=(0,c.useState)(!1),[v,{data:A}]=(0,d.Ihg)({fetchPolicy:"network-only",pollInterval:g?1e3:0}),[w]=(0,d.oOh)();return(0,c.useEffect)((()=>{"complete"===A?.file?.audioJob?.status&&(y(!1),x(A.file))}),[A,x]),(0,T.jsxs)(T.Fragment,{children:[!f.waveformReady&&(0,T.jsx)(h.A,{open:!f.waveformReady,dialogText:"Loading up your recordings... won't be long!",progressPercentage:f.percentLoaded}),g&&(0,T.jsx)(h.A,{open:g,dialogText:"Processing your edits... won't be long!"}),(0,T.jsxs)(n.a,{textAlign:"center",pt:"30px",pb:"90px",margin:"auto !important",width:"90%",children:[(0,T.jsx)(s.D,{size:"h5",mb:"7px",display:"inline-flex",mt:"40px",children:e?.name}),e&&(0,T.jsx)(n.a,{borderColor:"podcastShade200",borderWidth:"2px",borderStyle:"solid",borderBottomWidth:0,children:(0,T.jsx)($,{asset:{id:e.id,name:e.name,duration:Number(e.codecInformation?.format?.duration),fade:{},tags:e.tags,uniqueId:"",type:d.OQ.Timeline,hasVideo:!1},timeline:i,onSave:t})}),(0,T.jsx)("section",{children:(0,T.jsxs)(o.s,{alignItems:"centre",justifyContent:"space-between",margin:"0 auto",maxWidth:"500px",padding:"40px 0",width:"80%",children:[(0,T.jsx)(r.$,{visual:"tertiary",onClick:()=>x(),size:"xl",children:"Go Back"}),(0,T.jsxs)(r.$,{visual:"secondary",size:"xl",onClick:async function(){if((0,p.A)(m,"User not found"),i.length<2)return void x(e);y(!0);const t=await w({variables:{fileId:e.id,timeline:i}}),n=t.data?.createMusicEditorEditJob;(0,p.A)(n,"newFileId is missing"),v({variables:{id:n,projectId:m.activeProjectId}})},children:["Save",(0,T.jsx)(l.A,{})]})]})})]})]})}function z(e){return(0,T.jsx)(u.S,{children:(0,T.jsx)(O,{...e})})}},89550(e,i,t){t.d(i,{A:()=>g});var n=t(42218),s=t(7233),o=t(27823),r=t(47499),c=t(96540),a=t(23428),l=t(88236),d=t(17154),u=t(9255),p=t(74848);function h({color:e,...i}){return(0,p.jsx)(d.I,{width:"1px",height:"18px",...i,children:(0,p.jsx)("svg",{viewBox:"0 0 1 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("rect",{width:"1",height:"18",rx:"0.5",fill:e||u.Ay.podcastShade300})})})}function x({volume:e,...i}){const t=Array.from({length:5},((i,t)=>t<10*e/2?u.Ay.podcastPurple:u.Ay.podcastShade300));return(0,p.jsx)(d.I,{width:"23px",height:"12px",...i,children:(0,p.jsxs)("svg",{viewBox:"0 0 23 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsx)("rect",{y:"8",width:"3",height:"4",rx:"1.5",fill:t[0]}
1),(0,p.jsx)("rect",{x:"5",y:"6",width:"3",height:"6",rx:"1.5",fill:t[1]}),(0,p.jsx)("rect",{x:"10",y:"4",width:"3",height:"8",rx:"1.5",fill:t[2]}),(0,p.jsx)("rect",{x:"15",y:"2",width:"3",height:"10",rx:"1.5",fill:t[3]}),(0,p.jsx)("rect",{x:"20",width:"3",height:"12",rx:"1.5",fill:t[4]})]})})}var m=t(34251),f=t(27298);function g({isPlaying:e,onChangeVolume:i,defaultVolume:t,text:d}){const[g,y]=(0,c.useState)(t||.5),v=[.1,.3,.5,.7,.9],A=v.indexOf(g);return(0,p.jsxs)(n.s,{h:"24px",alignItems:"center",children:[(0,p.jsx)(s.E,{fontSize:"14px",lineHeight:"18px",fontFamily:m.A.bold,color:e?(0,f.A)(u.Ay.podcastShade500,.2):"podcastShade500",mr:"8px",userSelect:"none",children:d||"Volume:"}),(0,p.jsxs)(n.s,{border:`1px solid ${u.Ay.podcastShade400}`,borderRadius:"6px",zIndex:"5",children:[(0,p.jsx)(o.$,{visual:"empty",minW:"unset",pr:"6px",pl:"6px",onClick:()=>{i(v[A-1]),y(v[A-1])},disabled:.1===g||e,_focus:{boxShadow:"none"},children:(0,p.jsx)(a.A,{width:"10px",color:.1===g?u.Ay.podcastShade400:u.Ay.podcastShade600})}),(0,p.jsxs)(r.a,{position:"relative",children:[(0,p.jsx)(h,{top:"3px",position:"absolute"}),(0,p.jsx)(x,{volume:g,mx:"6px",mb:"4px"}),(0,p.jsx)(h,{top:"3px",position:"absolute"})]}),(0,p.jsx)(o.$,{visual:"empty",minW:"unset",pr:"6px",pl:"6px",onClick:()=>{i(v[A+1]),y(v[A+1])},disabled:.9===g||e,_focus:{boxShadow:"none"},children:(0,p.jsx)(l.A,{mb:"2px",width:"10px",height:"10px",color:.9===g?u.Ay.podcastShade400:u.Ay.podcastShade600})})]})]})}},70255(e,i,t){t.d(i,{A:()=>c});var n=t(96540);const s=n.createContext({}),o=!0;function r({baseColor:e,highlightColor:i,width:t,height:n,borderRadius:s,circle:o,direction:r,duration:c,enableAnimation:a=true,customHighlightBackgroun
vendor: 1,436 bytes, lines 1-2
1d:l}){const d={};return"rtl"===r&&(d["--animation-direction"]="reverse"),"number"==typeof c&&(d["--animation-duration"]=`${c}s`),a||(d["--pseudo-element-display"]="none"),"string"!=typeof t&&"number"!=typeof t||(d.width=t),"string"!=typeof n&&"number"!=typeof n||(d.height=n),"string"!=typeof s&&"number"!=typeof s||(d.borderRadius=s),o&&(d.borderRadius="50%"),void 0!==e&&(d["--base-color"]=e),void 0!==i&&(d["--highlight-color"]=i),"string"==typeof l&&(d["--custom-highlight-background"]=l),d}function c({count:e=1,wrapper:i,className:t,containerClassName:c,containerTestId:a,circle:l=!1,style:d,...u}){var p,h,x;const m=n.useContext(s),f={...u};for(const[e,i]of Object.entries(u))void 0===i&&delete f[e];const g={...m,...f,circle:l},y={...d,...r(g)};let v="react-loading-skeleton";t&&(v+=` ${t}`);const A=null!==(p=g.inline)&&void 0!==p&&p,w=[],j=Math.ceil(e);for(let i=0;i<j;i++){let t=y;if(j>e&&i===j-1){const i=null!==(h=t.width)&&void 0!==h?h:"100%",n=e%1,s="number"==typeof i?i*n:`calc(${i} * ${n})`;t={...t,width:s}}const s=n.createElement("span",{className:v,style:t,key:i},"â");A?w.push(s):w.push(n.createElement(n.Fragment,{key:i},s,n.createElement("br",null)))}return n.createElement("span",{className:c,"data-testid":a,"aria-live":"polite","aria-busy":null!==(x=g.enableAnimation)&&void 0!==x?x:o},i?w.map(((e,t)=>n.createElement(i,{key:t},e))):w)}}}]); 2//# sourceMappingURL=clip-genie-9c15ec33259ecc02db60.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.