1import{f as C}from"./ctMediaConvertDownload-n0-64pPl.js";import{w as T,c as D}from"./ctPendingDownload-B21SXRKd.js";import{i as L}from"./mediaInputFromFilename-AaKRjYpC.js";import{g as R}from"./ffmpegVideoCompress-C_zYTcnz.js";import{c as I}from"./fileDropzone-CA_uaFcV.js";import{r as N}from"./mediaMetadataDisplay-rUX1VKD5.js";import{w as O}from"./wireMediaToolPageOnce-DYtotjbx.js";import{c as $,w as k}from"./videoToolRuntime-BhBVPdre.js";import"./ctMediaProgressUi-wz6CtyvX.js";import"./ctFullscreenAd-CL-AA_Ul.js";import"./app-gOHIPY12.js";import"./videoEncodeHints-B5HbAqTP.js";import"./transientNotice-Ds_di7lD.js";import"./ffmpegProbeDuration-CZSGPlSL.js";import"./videoToolFilePick-DrReu7dZ.js";import"./ffmpegWasmProbe-Dr2SB0y0.js";import"./videoToolFfmpegSession-vgvYnhrp.js";import"./ctMediaSourceOutputName-BkKiostT.js";function E(d){const o=document.getElementById("ctMuteVidToastBody"),i=document.getElementById("ctMuteVidToast");if(!o||!i||typeof bootstrap>"u"){window.alert(d);return}o.textContent=d,bootstrap.Toast.getOrCreateInstance(i).show()}function te(){const d=document.getElementById("ct-mute-video-online-root");if(!O(d,"ctMuteVidWired"))return;const o=document.getElementById("ctMuteVidFile"),i=document.getElementById("ctMuteVidDrop"),y=document.getElementById("ctMuteVidDropCaption"),c=document.getElementById("ctMuteVidPreview"),l=document.getElementById("ctMuteVidName"),s=document.getElementById("ctMuteVidBtn"),m=document.getElementById("ctMuteVidDownload"),r=D();T(m,r);const u=document.getElementById("ctMuteVidClr"),p=document.getElementById("ctMuteVidMeta"),V=document.getElementById("ctMuteVidWasmStatus");if(!o||!c||!l||!s||!u)return;const f=(d.dataset.ctFormat||"mp4").toLowerCase(),e=$({statusEl:V,progressIds:{barId:"ctMuteVidProgBar",labelId:"ctMuteVidProgLabel",percentId:"ctMuteVidProgPct"},routeFormat:f,probeReadyLabel:"Ready to mute"}),g=()=>{s.disabled=!e.currentFile||e.encodeInFlight},M=t=>{!p||!t||N(p,e.metadata,t,c)};k({fileEl:o,dropEl:i,dropCaptionEl:y,runtime:e,clearBtn:u,nameInput:l,preview:c,metaEl:p,onEmpty:()=>g(),onTooLarge:()=>{E("File size exceeds 500MB limit."),I(o,{drop:i,captionEl:y})},onProbeFailed:()=>E("Failed to read video metadata."),onReady:({file:t})=>{M(t),g()}}),c.addEventListener("loadedmetadata",()=>{const t=e.currentFile;t&&M(t)}),u.addEventListener("click",()=>{r.clear(),r.syncDownloadButton(m),l&&(l.value="muted_video"),e.clearPickState({preview:c,metaEl:p}),I(o,{notify:!1,drop:i,captionEl:y}),u.disabled=!0,g()}),s.addEventListener("click",async()=>{var b,B;if(!e.currentFile)return;const t=e.inputNameFor(e.currentFile),w=e.outputName(),F=R(f,{});r.clear(),r.syncDownloadButton(m),s.disabled=!0;try{const n=await e.runEncode({inName:t,args:["-y","-loglevel","warning","-stats","-i",t,...F,w],encodingLabel:"Mutingâ¦"}),a=await n.readFile(w),v=a.buffer?a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength):a,P=new Blob([v],{type:`video/${f}`}),h=(l.value||"muted_video").replace(/\.[^/.]+$/,"");await C(r,m,{blob:P,filename:`${h}.${f}`,progressUi:(b=e.setProg)==null?void 0:b.ui});try{await n.deleteFile(t),await n.deleteFile(w)}catch{}}catch(n){L(n)||E(n instanceof Error?n.message:"Mute failed."),(B=e.setProg)==null||B.ui.hardReset("Ready to mute")}finally{g()}})}export{te as initMuteVideoOnlinePage};
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.