Viewing File: /home/ubuntu/allinonecluster-landing/blog/wp-content/plugins/web-stories/assets/js/chunk-ffmpeg.js
(globalThis.webpackChunkweb_stories_wp=globalThis.webpackChunkweb_stories_wp||[]).push([[7098],{74076:(e,t,r)=>{r(85072);const{devDependencies:o}=r(93681);e.exports={corePath:`https://unpkg.com/@ffmpeg/core@${o["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}},92339:(e,t,r)=>{const o=r(85072);e.exports=async e=>{let t=e;if(void 0===e)return new Uint8Array;if("string"==typeof e)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e))t=atob(e.split(",")[1]).split("").map((e=>e.charCodeAt(0)));else{const r=await fetch(o(e));t=await r.arrayBuffer()}else(e instanceof File||e instanceof Blob)&&(t=await(r=e,new Promise(((e,t)=>{const o=new FileReader;o.onload=()=>{e(o.result)},o.onerror=({target:{error:{code:e}}})=>{t(Error(`File could not be read! Code=${e}`))},o.readAsArrayBuffer(r)}))));var r;return new Uint8Array(t)}},71440:(e,t,r)=>{const o=r(85072),{log:n}=r(70888),i=async(e,t)=>{n("info",`fetch ${e}`);const r=await(await fetch(e)).arrayBuffer();n("info",`${e} file size = ${r.byteLength} bytes`);const o=new Blob([r],{type:t}),i=URL.createObjectURL(o);return n("info",`${e} blob URL = ${i}`),i};e.exports=async({corePath:e})=>{if("string"!=typeof e)throw Error("corePath should be a string!");const t=o(e),r=await i(t,"application/javascript"),a=await i(t.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),s=await i(t.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((e=>{const t=document.createElement("script"),o=()=>{t.removeEventListener("load",o),n("info","ffmpeg-core.js script loaded"),e({createFFmpegCore,corePath:r,wasmPath:a,workerPath:s})};t.src=r,t.type="text/javascript",t.addEventListener("load",o),document.getElementsByTagName("head")[0].appendChild(t)})):(n("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:r,wasmPath:a,workerPath:s}))}},43451:(e,t,r)=>{const o=r(74076),n=r(71440),i=r(92339);e.exports={defaultOptions:o,getCreateFFmpegCore:n,fetchFile:i}},41617:e=>{e.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},22648:(e,t,r)=>{const{defaultArgs:o,baseOptions:n}=r(41617),{setLogging:i,setCustomLogger:a,log:s}=r(70888),c=r(46405),l=r(7010),{defaultOptions:f,getCreateFFmpegCore:u}=r(43451),{version:p}=r(93681),h=Error("ffmpeg.wasm is not ready, make sure you have completed load().");e.exports=(e={})=>{const{log:t,logger:r,progress:m,...g}={...n,...f,...e};let d=null,y=null,w=null,v=!1,b=m;const x=({type:e,message:t})=>{s(e,t),c(t,b),(e=>{"FFMPEG_END"===e&&null!==w&&(w(),w=null,v=!1)})(t)};return i(t),a(r),s("info",`use ffmpeg.wasm v${p}`),{setProgress:e=>{b=e},setLogger:e=>{a(e)},setLogging:i,load:async()=>{if(s("info","load ffmpeg-core"),null!==d)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{s("info","loading ffmpeg-core");const{createFFmpegCore:e,corePath:t,workerPath:r,wasmPath:o}=await u(g);d=await e({mainScriptUrlOrBlob:t,printErr:e=>x({type:"fferr",message:e}),print:e=>x({type:"ffout",message:e}),locateFile:(e,t)=>{if("undefined"!=typeof window){if(void 0!==o&&e.endsWith("ffmpeg-core.wasm"))return o;if(void 0!==r&&e.endsWith("ffmpeg-core.worker.js"))return r}return t+e}}),y=d.cwrap("proxy_main","number",["number","number"]),s("info","ffmpeg-core loaded")}},isLoaded:()=>null!==d,run:(...e)=>{if(s("info",`run ffmpeg command: ${e.join(" ")}`),null===d)throw h;if(v)throw Error("ffmpeg.wasm can only run one command at a time");return v=!0,new Promise((t=>{const r=[...o,...e].filter((e=>0!==e.length));w=t,y(...l(d,r))}))},exit:()=>{if(null===d)throw h;v=!1,d.exit(1),d=null,y=null,w=null},FS:(e,...t)=>{if(s("info",`run FS.${e} ${t.map((e=>"string"==typeof e?e:`<${e.length} bytes binary file>`)).join(" ")}`),null===d)throw h;{let r=null;try{r=d.FS[e](...t)}catch(r){throw"readdir"===e?Error(`ffmpeg.FS('readdir', '${t[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===e?Error(`ffmpeg.FS('readFile', '${t[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},15045:(e,t,r)=>{r(35666);const o=r(22648),{fetchFile:n}=r(43451);e.exports={createFFmpeg:o,fetchFile:n}},70888:e=>{let t=!1,r=()=>{};e.exports={logging:t,setLogging:e=>{t=e},setCustomLogger:e=>{r=e},log:(e,o)=>{r({type:e,message:o}),t&&console.log(`[${e}] ${o}`)}}},7010:e=>{e.exports=(e,t)=>{const r=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach(((t,o)=>{const n=e._malloc(t.length+1);e.writeAsciiToMemory(t,n),e.setValue(r+Uint32Array.BYTES_PER_ELEMENT*o,n,"i32")})),[t.length,r]}},46405:e=>{let t=0,r=0;const o=e=>{const[t,r,o]=e.split(":");return 60*parseFloat(t)*60+60*parseFloat(r)+parseFloat(o)};e.exports=(e,n)=>{if("string"==typeof e)if(e.startsWith(" Duration")){const i=e.split(", ")[0].split(": ")[1],a=o(i);n({duration:a,ratio:r}),(0===t||t>a)&&(t=a)}else if(e.startsWith("frame")||e.startsWith("size")){const i=e.split("time=")[1].split(" ")[0],a=o(i);r=a/t,n({ratio:r,time:a})}else e.startsWith("video:")&&(n({ratio:1}),t=0)}},35666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,o=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var n=t&&t.prototype instanceof Generator?t:Generator,i=Object.create(n.prototype),a=new Context(o||[]);return i._invoke=function(e,t,r){var o=u;return function(n,i){if(o===h)throw new Error("Generator is already running");if(o===m){if("throw"===n)throw i;return P()}for(r.method=n,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===u)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,t,r);if("normal"===c.type){if(o=r.done?m:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var d={};d[i]=function(){return this};var y=Object.getPrototypeOf,w=y&&y(y(L([])));w&&w!==r&&o.call(w,i)&&(d=w);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function r(n,i,a,s){var c=f(e[n],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var n;this._invoke=function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}}function x(e,r){var o=e.iterator[r.method];if(o===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,g;var i=n.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function F(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(F,this),this.reset(!0)}function L(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return GeneratorFunction.prototype=v.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=c(GeneratorFunctionPrototype,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,c(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(AsyncIterator.prototype),AsyncIterator.prototype[a]=function(){return this},e.AsyncIterator=AsyncIterator,e.async=function(t,r,o,n,i){void 0===i&&(i=Promise);var a=new AsyncIterator(l(t,r,o,n),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),c(v,s,"Generator"),v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var o=t.pop();if(o in e)return r.value=o,r.done=!1,r}return r.done=!0,r}},e.values=L,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return s.type="throw",s.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;E(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:L(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},85072:function(e,t,r){var o,n;o=function(){function e(){var e=arguments.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var t=document.createElement("base");if(t.href=arguments[0],1===e)return t.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(t,r.firstChild);for(var o,n=document.createElement("a"),i=1;i<e;i++)n.href=arguments[i],o=n.href,t.href=o;return r.removeChild(t),o}return e},void 0===(n="function"==typeof o?o.call(t,r,t,e):o)||(e.exports=n)},93681:e=>{"use strict";e.exports=JSON.parse('{"name":"@ffmpeg/ffmpeg","version":"0.10.1","description":"FFmpeg WebAssembly version","main":"src/index.js","types":"src/index.d.ts","directories":{"example":"examples"},"scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","prepublishOnly":"npm run build","lint":"eslint src","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"keywords":["ffmpeg","WebAssembly","video"],"author":"Jerome Wu <jeromewus@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.10.0","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"}}')}}]);
Back to Directory
File Manager