@loaders.gl/video 5.0.0-alpha.11 → 5.0.0-alpha.13

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/LICENSE CHANGED
@@ -30,7 +30,7 @@ MIT License reproduced above.
30
30
 
31
31
  Copyright (c) 2016-17 Karl Cheng
32
32
 
33
- Portions of modules/schema-utils/src/lib/utils/async-queue.ts are adapted from
33
+ Portions of modules/core/src/schema-utils/lib/utils/async-queue.ts are adapted from
34
34
  async-iter-demo (https://github.com/rauschma/async-iter-demo) under the MIT
35
35
  License reproduced above.
36
36
 
package/dist/dist.dev.js CHANGED
@@ -39,7 +39,6 @@ var __exports__ = (() => {
39
39
  }
40
40
  return to;
41
41
  };
42
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
43
42
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
44
43
  // If the importer is in node compatibility mode or this is not an ESM
45
44
  // file that has been converted to a CommonJS file using a Babel-
@@ -139,11 +138,72 @@ var __exports__ = (() => {
139
138
  // bundle.ts
140
139
  var bundle_exports = {};
141
140
  __export(bundle_exports, {
141
+ FetchError: () => import_core.FetchError,
142
142
  GIFBuilder: () => GIFBuilder,
143
+ JSONLoader: () => import_core.JSONLoader,
144
+ NullLoader: () => import_core.NullLoader,
145
+ NullWorkerLoader: () => import_core.NullWorkerLoader,
146
+ RequestScheduler: () => import_core.RequestScheduler,
143
147
  VideoFormat: () => VideoFormat,
144
- VideoLoader: () => VideoLoader
148
+ VideoLoader: () => VideoLoader,
149
+ _BrowserFileSystem: () => import_core._BrowserFileSystem,
150
+ _fetchProgress: () => import_core._fetchProgress,
151
+ _selectSource: () => import_core._selectSource,
152
+ _unregisterLoaders: () => import_core._unregisterLoaders,
153
+ assert: () => import_core.assert,
154
+ concatenateArrayBuffersAsync: () => import_core.concatenateArrayBuffersAsync,
155
+ coreApi: () => import_core.coreApi,
156
+ createDataSource: () => import_core.createDataSource,
157
+ document: () => import_core.document,
158
+ encode: () => import_core.encode,
159
+ encodeInBatches: () => import_core.encodeInBatches,
160
+ encodeSync: () => import_core.encodeSync,
161
+ encodeTable: () => import_core.encodeTable,
162
+ encodeTableAsText: () => import_core.encodeTableAsText,
163
+ encodeTableInBatches: () => import_core.encodeTableInBatches,
164
+ encodeText: () => import_core.encodeText,
165
+ encodeTextSync: () => import_core.encodeTextSync,
166
+ encodeURLtoURL: () => import_core.encodeURLtoURL,
167
+ fetchFile: () => import_core.fetchFile,
168
+ forEach: () => import_core.forEach,
169
+ getLoaderOptions: () => import_core.getLoaderOptions,
170
+ getPathPrefix: () => import_core.getPathPrefix,
171
+ global: () => import_core.global,
172
+ isAsyncIterable: () => import_core.isAsyncIterable,
173
+ isBrowser: () => import_core.isBrowser,
174
+ isIterable: () => import_core.isIterable,
175
+ isIterator: () => import_core.isIterator,
176
+ isPromise: () => import_core.isPromise,
177
+ isPureObject: () => import_core.isPureObject,
178
+ isReadableStream: () => import_core.isReadableStream,
179
+ isResponse: () => import_core.isResponse,
180
+ isWorker: () => import_core.isWorker,
181
+ isWritableStream: () => import_core.isWritableStream,
182
+ load: () => import_core.load,
183
+ loadInBatches: () => import_core.loadInBatches,
184
+ makeIterator: () => import_core.makeIterator,
185
+ makeLineIterator: () => import_core.makeLineIterator,
186
+ makeNumberedLineIterator: () => import_core.makeNumberedLineIterator,
187
+ makeStream: () => import_core.makeStream,
188
+ makeTextDecoderIterator: () => import_core.makeTextDecoderIterator,
189
+ makeTextEncoderIterator: () => import_core.makeTextEncoderIterator,
190
+ parse: () => import_core.parse,
191
+ parseFile: () => import_core.parseFile,
192
+ parseInBatches: () => import_core.parseInBatches,
193
+ parseSync: () => import_core.parseSync,
194
+ preload: () => import_core.preload,
195
+ preloadSync: () => import_core.preloadSync,
196
+ readArrayBuffer: () => import_core.readArrayBuffer,
197
+ registerLoaders: () => import_core.registerLoaders,
198
+ resolvePath: () => import_core.resolvePath,
199
+ selectLoader: () => import_core.selectLoader,
200
+ selectLoaderSync: () => import_core.selectLoaderSync,
201
+ self: () => import_core.self,
202
+ setLoaderOptions: () => import_core.setLoaderOptions,
203
+ setPathPrefix: () => import_core.setPathPrefix,
204
+ window: () => import_core.window
145
205
  });
146
- __reExport(bundle_exports, __toESM(require_core(), 1));
206
+ var import_core = __toESM(require_core(), 1);
147
207
 
148
208
  // src/index.ts
149
209
  init_video_format();
@@ -1199,7 +1259,7 @@ var __exports__ = (() => {
1199
1259
  AnimatedGIF.prototype = {
1200
1260
  workerMethods: workerCode(),
1201
1261
  initializeWebWorkers: function initializeWebWorkers(options) {
1202
- const self = this;
1262
+ const self2 = this;
1203
1263
  const processFrameWorkerCode = `${NeuQuant.toString()}(${workerCode.toString()}());`;
1204
1264
  let webWorkerObj = void 0;
1205
1265
  let objectUrl = void 0;
@@ -1213,11 +1273,11 @@ var __exports__ = (() => {
1213
1273
  if (utils.isObject(webWorkerObj)) {
1214
1274
  objectUrl = webWorkerObj.objectUrl;
1215
1275
  webWorker = webWorkerObj.worker;
1216
- self.workers.push({
1276
+ self2.workers.push({
1217
1277
  worker: webWorker,
1218
1278
  objectUrl
1219
1279
  });
1220
- self.availableWorkers.push(webWorker);
1280
+ self2.availableWorkers.push(webWorker);
1221
1281
  } else {
1222
1282
  workerError = webWorkerObj;
1223
1283
  utils.webWorkerError = Boolean(webWorkerObj);
@@ -1255,25 +1315,25 @@ var __exports__ = (() => {
1255
1315
  return str;
1256
1316
  },
1257
1317
  onFrameFinished: function onFrameFinished(progressCallback) {
1258
- const self = this;
1259
- const frames = self.frames;
1260
- const options = self.options;
1318
+ const self2 = this;
1319
+ const frames = self2.frames;
1320
+ const options = self2.options;
1261
1321
  const hasExistingImages = Boolean((options.images || []).length);
1262
1322
  const allDone = frames.every(function(frame) {
1263
1323
  return !frame.beingProcessed && frame.done;
1264
1324
  });
1265
- self.numRenderedFrames++;
1325
+ self2.numRenderedFrames++;
1266
1326
  if (hasExistingImages) {
1267
- progressCallback(self.numRenderedFrames / frames.length);
1327
+ progressCallback(self2.numRenderedFrames / frames.length);
1268
1328
  }
1269
- self.onRenderProgressCallback(self.numRenderedFrames * 0.75 / frames.length);
1329
+ self2.onRenderProgressCallback(self2.numRenderedFrames * 0.75 / frames.length);
1270
1330
  if (allDone) {
1271
- if (!self.generatingGIF) {
1272
- self.generateGIF(frames, self.onRenderCompleteCallback);
1331
+ if (!self2.generatingGIF) {
1332
+ self2.generateGIF(frames, self2.onRenderCompleteCallback);
1273
1333
  }
1274
1334
  } else {
1275
1335
  utils.requestTimeout(function() {
1276
- self.processNextFrame();
1336
+ self2.processNextFrame();
1277
1337
  }, 1);
1278
1338
  }
1279
1339
  },
@@ -1379,9 +1439,9 @@ var __exports__ = (() => {
1379
1439
  },
1380
1440
  addFrame: function addFrame(element, gifshotOptions) {
1381
1441
  gifshotOptions = utils.isObject(gifshotOptions) ? gifshotOptions : {};
1382
- const self = this;
1383
- const ctx = self.ctx;
1384
- const options = self.options;
1442
+ const self2 = this;
1443
+ const ctx = self2.ctx;
1444
+ const options = self2.options;
1385
1445
  const width = options.gifWidth;
1386
1446
  const height = options.gifHeight;
1387
1447
  const fontSize = utils.getFontSize(gifshotOptions);
@@ -1410,7 +1470,7 @@ var __exports__ = (() => {
1410
1470
  ctx.fillText(text, textXCoordinate, textYCoordinate);
1411
1471
  }
1412
1472
  imageData = ctx.getImageData(0, 0, width, height);
1413
- self.addFrameImageData(imageData);
1473
+ self2.addFrameImageData(imageData);
1414
1474
  } catch (e) {
1415
1475
  return `${e}`;
1416
1476
  }
@@ -1437,14 +1497,14 @@ var __exports__ = (() => {
1437
1497
  return this.generatingGIF;
1438
1498
  },
1439
1499
  getBase64GIF: function getBase64GIF(completeCallback) {
1440
- const self = this;
1500
+ const self2 = this;
1441
1501
  const onRenderComplete = function onRenderComplete2(gif) {
1442
- self.destroyWorkers();
1502
+ self2.destroyWorkers();
1443
1503
  utils.requestTimeout(function() {
1444
1504
  completeCallback(gif);
1445
1505
  }, 0);
1446
1506
  };
1447
- self.startRendering(onRenderComplete);
1507
+ self2.startRendering(onRenderComplete);
1448
1508
  },
1449
1509
  destroyWorkers: function destroyWorkers() {
1450
1510
  if (this.workerError) {
package/dist/dist.min.js CHANGED
@@ -4,6 +4,6 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['loaders'] = factory();
6
6
  else root['loaders'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Ge=Object.create;var de=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var fe=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var qe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Te=(t,e)=>{for(var n in e)de(t,n,{get:e[n],enumerable:!0})},ce=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of je(e))!$e.call(t,i)&&i!==n&&de(t,i,{get:()=>e[i],enumerable:!(o=De(e,i))||o.enumerable});return t},me=(t,e,n)=>(ce(t,e,"default"),n&&ce(n,e,"default")),Xe=(t,e,n)=>(n=t!=null?Ge(Ne(t)):{},ce(e||!t||!t.__esModule?de(n,"default",{value:t,enumerable:!0}):n,t)),Ye=t=>ce(de({},"__esModule",{value:!0}),t);var Ee=qe((pt,We)=>{We.exports=globalThis.loaders});var ue,ve=fe(()=>{"use strict";ue={name:"Video",id:"video",module:"video",encoding:"video",format:"video",extensions:["mp4"],mimeTypes:["video/mp4"],category:"video",binary:!0}});async function xe(t){let e=document.createElement("video");return e.src=URL.createObjectURL(t),e}async function we(t){return await xe(new Blob([t]))}var Ie=fe(()=>{"use strict"});var Ae={};Te(Ae,{VideoLoaderWithParser:()=>Ke});var yt,Qe,Ke,ze=fe(()=>{"use strict";Ie();ye();({preload:yt,...Qe}=ge),Ke={...Qe,parse:we,parseBlob:xe}});async function Je(){let{VideoLoaderWithParser:t}=await Promise.resolve().then(()=>(ze(),Ae));return t}var Ze,ge,ye=fe(()=>{"use strict";ve();Ze="5.0.0-alpha.11";ge={dataType:null,batchType:null,...ue,version:Ze,options:{video:{}},preload:Je}});var se={};Te(se,{GIFBuilder:()=>re,VideoFormat:()=>ue,VideoLoader:()=>ge});me(se,Xe(Ee(),1));ve();ye();function Ve(t,e){if(!t)throw new Error(e)}var j=globalThis.document||{},r={URL:globalThis.URL||globalThis.webkitURL||globalThis.mozURL||globalThis.msURL,getUserMedia:(function(){if(!globalThis.navigator)return globalThis.navigator;let t=globalThis.navigator.getUserMedia||globalThis.navigator.webkitGetUserMedia||globalThis.navigator.mozGetUserMedia||globalThis.navigator.msGetUserMedia;return t&&t.bind(globalThis.navigator)})(),requestAnimFrame:globalThis.requestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.mozRequestAnimationFrame||globalThis.oRequestAnimationFrame||globalThis.msRequestAnimationFrame,requestTimeout:function(e,n){if(e=e||r.noop,n=n||0,!r.requestAnimFrame)return setTimeout(e,n);let o=new Date().getTime(),i=new Object,a=r.requestAnimFrame,l=function s(){new Date().getTime()-o>=n?e.call():i.value=a(s)};return i.value=a(l),i},Blob:globalThis.Blob||globalThis.BlobBuilder||globalThis.WebKitBlobBuilder||globalThis.MozBlobBuilder||globalThis.MSBlobBuilder,btoa:(function(){let t=globalThis.btoa||function(e){let n="",o=0,i=e.length,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l,s,d,h,x,k,m;for(;o<i;)l=e.charCodeAt(o++),s=e.charCodeAt(o++),d=e.charCodeAt(o++),h=l>>2,x=(l&3)<<4|s>>4,k=(s&15)<<2|d>>6,m=d&63,Number.isNaN(s)?k=m=64:Number.isNaN(d)&&(m=64),n=n+a.charAt(h)+a.charAt(x)+a.charAt(k)+a.charAt(m);return n};return t?t.bind(globalThis):r.noop})(),isObject:function(e){return e&&Object.prototype.toString.call(e)==="[object Object]"},isEmptyObject:function(e){return r.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&typeof e=="function"},isElement:function(e){return e&&e.nodeType===1},isImageBitmap:function(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap},isDrawable:function(e){return r.isElement(e)||r.isImageBitmap(e)},isString:function(e){return typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"},isSupported:{canvas:function(){let e=j.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return globalThis.Worker},blob:function(){return r.Blob},Uint8Array:function(){return globalThis.Uint8Array},Uint32Array:function(){return globalThis.Uint32Array},videoCodecs:(function(){let t=j.createElement("video"),e={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{t&&t.canPlayType&&(e.mp4=t.canPlayType('video/mp4; codecs="mp4v.20.8"')!=="",e.h264=(t.canPlayType('video/mp4; codecs="avc1.42E01E"')||t.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'))!=="",e.ogv=t.canPlayType('video/ogg; codecs="theora"')!=="",e.ogg=t.canPlayType('video/ogg; codecs="theora"')!=="",e.webm=t.canPlayType('video/webm; codecs="vp8, vorbis"')!==-1)}catch{}return e})()},noop:function(){},each:function(e,n){let o,i;if(r.isArray(e))for(o=-1,i=e.length;++o<i&&n(o,e[o])!==!1;);else if(r.isObject(e)){for(o in e)if(e.hasOwnProperty(o)&&n(o,e[o])===!1)break}},normalizeOptions:function(e,n){if(!r.isObject(e)||!r.isObject(n)||!Object.keys)return;let o={};return r.each(e,function(i,a){o[i]=e[i]}),r.each(n,function(i,a){let l=n[i];r.isObject(l)&&e[i]?o[i]=r.normalizeOptions(e[i],l):o[i]=l}),o},setCSSAttr:function(e,n,o){r.isElement(e)&&(r.isString(n)&&r.isString(o)?e.style[n]=o:r.isObject(n)&&r.each(n,function(i,a){e.style[i]=a}))},removeElement:function(e){r.isElement(e)&&e.parentNode&&e.parentNode.removeChild(e)},createWebWorker:function(e){if(!r.isString(e))return{};try{let n=new r.Blob([e],{type:"text/javascript"}),o=r.URL.createObjectURL(n),i=new Worker(o);return{objectUrl:o,worker:i}}catch(n){return`${n}`}},getExtension:function(e){return e.substr(e.lastIndexOf(".")+1,e.length)},getFontSize:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!j.body||e.resizeFont===!1)return e.fontSize;let n=e.text,o=e.gifWidth,i=parseInt(e.fontSize,10),a=parseInt(e.minFontSize,10),l=j.createElement("div"),s=j.createElement("span");for(l.setAttribute("width",o),l.appendChild(s),s.innerHTML=n,s.style.fontSize=`${i}px`,s.style.textIndent="-9999px",s.style.visibility="hidden",j.body.appendChild(s);s.offsetWidth>o&&i>=a;)s.style.fontSize=`${--i}px`;return j.body.removeChild(s),`${i}px`},webWorkerError:!1},et=Object.freeze({default:r}),q={validate:function(e){e=r.isObject(e)?e:{};let n={};return r.each(q.validators,function(o,i){let a=i.errorCode;if(!e[a]&&!i.condition)return n=i,n.error=!0,!1}),delete n.condition,n},isValid:function(e){return q.validate(e).error!==!0},validators:[{condition:r.isFunction(r.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:r.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:r.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:r.isFunction(r.URL),errorCode:"globalThis.URL",errorMsg:"The globalThis.URL API is not supported in your browser"},{condition:r.isSupported.blob(),errorCode:"globalThis.Blob",errorMsg:"The globalThis.Blob File API is not supported in your browser"},{condition:r.isSupported.Uint8Array(),errorCode:"globalThis.Uint8Array",errorMsg:"The globalThis.Uint8Array function constructor is not supported in your browser"},{condition:r.isSupported.Uint32Array(),errorCode:"globalThis.Uint32Array",errorMsg:"The globalThis.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},tt=Object.freeze({default:q}),Oe=function(){},Fe={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:Oe,completeCallback:Oe,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},it=Object.freeze({default:Fe});function nt(){return q.isValid()}function Ue(){return q.isValid()}function ot(){let t={getUserMedia:!0};return q.isValid(t)}function rt(t){let e=!1;if(r.isArray(t)&&t.length){if(r.each(t,function(n,o){r.isSupported.videoCodecs[o]&&(e=!0)}),!e)return!1}else if(r.isString(t)&&t.length&&!r.isSupported.videoCodecs[t])return!1;return q.isValid({getUserMedia:!0})}function _e(){let M,H,D,X,F,P=[],Q=[],K=[],J=[];function he(u,p,W){let g,b;for(H=u,D=p,X=W,F=new Array(256),g=0;g<256;g++)F[g]=new Array(4),b=F[g],b[0]=b[1]=b[2]=(g<<12)/256|0,K[g]=65536/256|0,Q[g]=0}function pe(){let u=[],p=new Array(256);for(let g=0;g<256;g++)p[F[g][3]]=g;let W=0;for(let g=0;g<256;g++){let b=p[g];u[W++]=F[b][0],u[W++]=F[b][1],u[W++]=F[b][2]}return u}function ee(){let u,p,W,g,b,c,f,S;for(f=0,S=0,u=0;u<256;u++){for(b=F[u],W=u,g=b[1],p=u+1;p<256;p++)c=F[p],c[1]<g&&(W=p,g=c[1]);if(c=F[W],u!==W&&(p=c[0],c[0]=b[0],b[0]=p,p=c[1],c[1]=b[1],b[1]=p,p=c[2],c[2]=b[2],b[2]=p,p=c[3],c[3]=b[3],b[3]=p),g!==f){for(P[f]=S+u>>1,p=f+1;p<g;p++)P[p]=u;f=g,S=u}}for(P[f]=S+255>>1,p=f+1;p<256;p++)P[p]=255}function te(){let u,p,W,g,b,c,f,S,T,V,$,I,G,ke;for(D<1509&&(X=1),M=30+(X-1)/3,I=H,G=0,ke=D,$=D/(3*X),V=$/100|0,S=1024,c=2048,f=c>>6,f<=1&&(f=0),u=0;u<f;u++)J[u]=S*((f*f-u*u)*256/(f*f));for(D<1509?T=3:D%499!==0?T=3*499:D%491!==0?T=3*491:D%487!==0?T=3*487:T=3*503,u=0;u<$;)if(W=(I[G+0]&255)<<4,g=(I[G+1]&255)<<4,b=(I[G+2]&255)<<4,p=le(W,g,b),ae(S,p,W,g,b),f!==0&&oe(f,p,W,g,b),G+=T,G>=ke&&(G-=D),u++,V===0&&(V=1),u%V===0)for(S-=S/M,c-=c/30,f=c>>6,f<=1&&(f=0),p=0;p<f;p++)J[p]=S*((f*f-p*p)*256/(f*f))}function ie(u,p,W){let g,b,c,f,S,T,V;for(S=1e3,V=-1,g=P[p],b=g-1;g<256||b>=0;)g<256&&(T=F[g],c=T[1]-p,c>=S?g=256:(g++,c<0&&(c=-c),f=T[0]-u,f<0&&(f=-f),c+=f,c<S&&(f=T[2]-W,f<0&&(f=-f),c+=f,c<S&&(S=c,V=T[3])))),b>=0&&(T=F[b],c=p-T[1],c>=S?b=-1:(b--,c<0&&(c=-c),f=T[0]-u,f<0&&(f=-f),c+=f,c<S&&(f=T[2]-W,f<0&&(f=-f),c+=f,c<S&&(S=c,V=T[3]))));return V}function ne(){return te(),be(),ee(),pe()}function be(){let u,p;for(u=0;u<256;u++)F[u][0]>>=4,F[u][1]>>=4,F[u][2]>>=4,F[u][3]=u}function oe(u,p,W,g,b){let c,f,S,T,V,$,I;for(S=p-u,S<-1&&(S=-1),T=p+u,T>256&&(T=256),c=p+1,f=p-1,$=1;c<T||f>S;){if(V=J[$++],c<T){I=F[c++];try{I[0]-=V*(I[0]-W)/262144|0,I[1]-=V*(I[1]-g)/262144|0,I[2]-=V*(I[2]-b)/262144|0}catch{}}if(f>S){I=F[f--];try{I[0]-=V*(I[0]-W)/262144|0,I[1]-=V*(I[1]-g)/262144|0,I[2]-=V*(I[2]-b)/262144|0}catch{}}}}function ae(u,p,W,g,b){let c=F[p],f=u/1024;c[0]-=f*(c[0]-W)|0,c[1]-=f*(c[1]-g)|0,c[2]-=f*(c[2]-b)|0}function le(u,p,W){let g,b,c,f,S,T,V,$,I,G;for($=~(1<<31),I=$,T=-1,V=T,g=0;g<256;g++)G=F[g],b=G[0]-u,b<0&&(b=-b),c=G[1]-p,c<0&&(c=-c),b+=c,c=G[2]-W,c<0&&(c=-c),b+=c,b<$&&($=b,T=g),f=b-(Q[g]>>12),f<I&&(I=f,V=g),S=K[g]>>10,K[g]-=S,Q[g]+=S<<10;return K[T]+=64,Q[T]-=65536,V}he.apply(this,arguments);let Z={};return Z.map=ie,Z.process=ne,Z}function Re(){let t=this;try{globalThis.onmessage=function(n){let o=n.data||{},i;o.gifshot&&(i=e.run(o),postMessage(i))}}catch{}var e={dataToRGB:function(o,i,a){let l=i*a*4,s=0,d=[];for(;s<l;)d.push(o[s++]),d.push(o[s++]),d.push(o[s++]),s++;return d},componentizedPaletteToArray:function(o){o=o||[];let i=[];for(let a=0;a<o.length;a+=3){let l=o[a],s=o[a+1],d=o[a+2];i.push(l<<16|s<<8|d)}return i},processFrameWithQuantizer:function(o,i,a,l){let s=this.dataToRGB(o,i,a),d=new _e(s,s.length,l),h=d.process(),x=new Uint32Array(this.componentizedPaletteToArray(h)),k=i*a,m=new Uint8Array(k),v=0;for(let w=0;w<k;w++){let E=s[v++],y=s[v++],C=s[v++];m[w]=d.map(E,y,C)}return{pixels:m,palette:x}},run:function(o){o=o||{};let i=o,a=i.height,l=i.palette,s=i.sampleInterval,d=i.width,h=o.data;return this.processFrameWithQuantizer(h,d,a,s)}};return e}function st(t,e,n,o){let i=0;o=o===void 0?{}:o;let a=o.loop===void 0?null:o.loop,l=o.palette===void 0?null:o.palette;if(e<=0||n<=0||e>65535||n>65535)throw"Width/Height invalid.";function s(m){let v=m.length;if(v<2||v>256||v&v-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return v}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;let d=0,h=0;if(t[i++]=e&255,t[i++]=e>>8&255,t[i++]=n&255,t[i++]=n>>8&255,t[i++]=(l!==null?128:0)|d,t[i++]=h,t[i++]=0,a!==null){if(a<0||a>65535)throw"Loop count invalid.";t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=a&255,t[i++]=a>>8&255,t[i++]=0}let x=!1;this.addFrame=function(m,v,w,E,y,C){if(x===!0&&(--i,x=!1),C=C===void 0?{}:C,m<0||v<0||m>65535||v>65535)throw"x/y invalid.";if(w<=0||E<=0||w>65535||E>65535)throw"Width/Height invalid.";if(y.length<w*E)throw"Not enough pixels for the frame size.";let A=!0,z=C.palette;if(z==null&&(A=!1,z=l),z==null)throw"Must supply either a local or global palette.";let O=s(z),U=0;for(O>>=1;O;)++U,O>>=1;O=1<<U;let R=C.delay===void 0?0:C.delay,M=C.disposal===void 0?0:C.disposal;if(M<0||M>3)throw"Disposal out of range.";let Y=!1,_=0;if(C.transparent!==void 0&&C.transparent!==null&&(Y=!0,_=C.transparent,_<0||_>=O))throw"Transparent color index.";if((M!==0||Y||R!==0)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=M<<2|(Y===!0?1:0),t[i++]=R&255,t[i++]=R>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=m&255,t[i++]=m>>8&255,t[i++]=v&255,t[i++]=v>>8&255,t[i++]=w&255,t[i++]=w>>8&255,t[i++]=E&255,t[i++]=E>>8&255,t[i++]=A===!0?128|U-1:0,A===!0)for(let L=0,N=z.length;L<N;++L){let H=z[L];t[i++]=H>>16&255,t[i++]=H>>8&255,t[i++]=H&255}i=k(t,i,U<2?2:U,y)},this.end=function(){return x===!1&&(t[i++]=59,x=!0),i};function k(m,v,w,E){m[v++]=w;let y=v++,C=1<<w,A=C-1,z=C+1,O=z+1,U=w+1,R=0,M=0;function Y(H){for(;R>=H;)m[v++]=M&255,M>>=8,R-=8,v===y+256&&(m[y]=255,y=v++)}function _(H){M|=H<<R,R+=U,Y(8)}let L=E[0]&A,N={};_(C);for(let H=1,D=E.length;H<D;++H){let X=E[H]&A,F=L<<8|X,P=N[F];if(P===void 0){for(M|=L<<R,R+=U;R>=8;)m[v++]=M&255,M>>=8,R-=8,v===y+256&&(m[y]=255,y=v++);O===4096?(_(C),O=z+1,U=w+1,N={}):(O>=1<<U&&++U,N[F]=O++),L=X}else L=P}return _(L),_(z),Y(1),y+1===v?m[y]=0:(m[y]=v-y-1,m[v++]=0),v}}var Me=function(){},Se=function(e){this.canvas=null,this.ctx=null,this.repeat=0,this.frames=[],this.numRenderedFrames=0,this.onRenderCompleteCallback=Me,this.onRenderProgressCallback=Me,this.workers=[],this.availableWorkers=[],this.generatingGIF=!1,this.options=e,this.initializeWebWorkers(e)};Se.prototype={workerMethods:Re(),initializeWebWorkers:function(e){let n=this,o=`${_e.toString()}(${Re.toString()}());`,i,a,l,s,d=-1,h="";for(s=e.numWorkers;++d<s;)i=r.createWebWorker(o),r.isObject(i)?(a=i.objectUrl,l=i.worker,n.workers.push({worker:l,objectUrl:a}),n.availableWorkers.push(l)):(h=i,r.webWorkerError=!!i);this.workerError=h,this.canvas=j.createElement("canvas"),this.canvas.width=e.gifWidth,this.canvas.height=e.gifHeight,this.ctx=this.canvas.getContext("2d"),this.frames=[]},getWorker:function(){return this.availableWorkers.pop()},freeWorker:function(e){this.availableWorkers.push(e)},byteMap:(function(){let t=[];for(let e=0;e<256;e++)t[e]=String.fromCharCode(e);return t})(),bufferToString:function(e){let n=e.length,o="",i=-1;for(;++i<n;)o+=this.byteMap[e[i]];return o},onFrameFinished:function(e){let n=this,o=n.frames,a=!!(n.options.images||[]).length,l=o.every(function(s){return!s.beingProcessed&&s.done});n.numRenderedFrames++,a&&e(n.numRenderedFrames/o.length),n.onRenderProgressCallback(n.numRenderedFrames*.75/o.length),l?n.generatingGIF||n.generateGIF(o,n.onRenderCompleteCallback):r.requestTimeout(function(){n.processNextFrame()},1)},processFrame:function(e){let n=this,o=this.options,i=o.progressCallback,a=o.sampleInterval,l=this.frames,s,d,h=function(){let m=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).data;delete s.data,s.pixels=Array.prototype.slice.call(m.pixels),s.palette=Array.prototype.slice.call(m.palette),s.done=!0,s.beingProcessed=!1,n.freeWorker(d),n.onFrameFinished(i)};if(s=l[e],s.beingProcessed||s.done){this.onFrameFinished();return}s.sampleInterval=a,s.beingProcessed=!0,s.gifshot=!0,d=this.getWorker(),d?(d.onmessage=h,d.postMessage(s)):h({data:n.workerMethods.run(s)})},startRendering:function(e){this.onRenderCompleteCallback=e;for(let n=0;n<this.options.numWorkers&&n<this.frames.length;n++)this.processFrame(n)},processNextFrame:function(){let e=-1;for(let n=0;n<this.frames.length;n++){let o=this.frames[n];if(!o.done&&!o.beingProcessed){e=n;break}}e>=0&&this.processFrame(e)},generateGIF:function(e,n){let o=[],i={loop:this.repeat},a=this.options,l=a.interval,s=a.frameDuration,h=!!a.images.length,x=a.gifHeight,k=a.gifWidth,m=new st(o,k,x,i),v=this.onRenderProgressCallback,w=h?l*100:0,E,y;this.generatingGIF=!0,r.each(e,function(C,A){let z=A.palette;v(.75+.25*A.position*1/e.length);for(let O=0;O<s;O++)m.addFrame(0,0,k,x,A.pixels,{palette:z,delay:w})}),m.end(),v(1),this.frames=[],this.generatingGIF=!1,r.isFunction(n)&&(E=this.bufferToString(o),y=`data:image/gif;base64,${r.btoa(E)}`,n(y))},setRepeat:function(e){this.repeat=e},addFrame:function(e,n){n=r.isObject(n)?n:{};let o=this,i=o.ctx,a=o.options,l=a.gifWidth,s=a.gifHeight,d=r.getFontSize(n),h=n,x=h.filter,k=h.fontColor,m=h.fontFamily,v=h.fontWeight,w=h.gifHeight,E=h.gifWidth,y=h.text,C=h.textAlign,A=h.textBaseline,z=n.textXCoordinate?n.textXCoordinate:C==="left"?1:C==="right"?l:l/2,O=n.textYCoordinate?n.textYCoordinate:A==="top"?1:A==="center"?s/2:s,U=`${v} ${d} ${m}`,R;try{i.filter=x,i.drawImage(e,0,0,l,s),y&&(i.font=U,i.fillStyle=k,i.textAlign=C,i.textBaseline=A,i.fillText(y,z,O)),R=i.getImageData(0,0,l,s),o.addFrameImageData(R)}catch(M){return`${M}`}},addFrameImageData:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.frames,o=e.data;this.frames.push({data:o,width:e.width,height:e.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:n.length})},onRenderProgress:function(e){this.onRenderProgressCallback=e},isRendering:function(){return this.generatingGIF},getBase64GIF:function(e){let n=this,o=function(a){n.destroyWorkers(),r.requestTimeout(function(){e(a)},0)};n.startRendering(o)},destroyWorkers:function(){if(this.workerError)return;let e=this.workers;r.each(e,function(n,o){let i=o.worker,a=o.objectUrl;i.terminate(),r.URL.revokeObjectURL(a)})}};function at(t,e){t.getBase64GIF(function(n){e({error:!1,errorCode:"",errorMsg:"",image:n})})}function lt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this,n=t.callback,o=t.images,i=t.options,a=t.imagesLength,l={getUserMedia:!0,"globalThis.URL":!0},s=q.validate(l),d=[],h=0,x,k;if(s.error)return n(s);k=new Se(i),r.each(o,function(v,w){let E=w;r.isDrawable(E)?(i.crossOrigin&&(E.crossOrigin=i.crossOrigin),d[v]=E,h+=1,h===a&&m()):r.isString(E)&&(x=new Image,i.crossOrigin&&(x.crossOrigin=i.crossOrigin),(function(y){w.text&&(y.text=w.text),y.onerror=function(C){let A;if(--a,a===0)return A={},A.error="None of the requested images was capable of being retrieved",n(A)},y.onload=function(C){w.text?d[v]={img:y,text:y.text}:d[v]=y,h+=1,h===a&&m(),r.removeElement(y)},y.src=E})(x),r.setCSSAttr(x,{position:"fixed",opacity:"0"}),j.body.appendChild(x))});function m(){r.each(d,function(v,w){w&&(w.text?k.addFrame(w.img,i,w.text):k.addFrame(w,i))}),at(k,n)}}var ct=function(){},Ce={getGIF:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments[1];n=r.isFunction(n)?n:ct;let o=j.createElement("canvas"),i,l=!!e.images.length,s=e.cameraStream,d=e.crop,h=e.filter,x=e.fontColor,k=e.fontFamily,m=e.fontWeight,v=e.keepCameraOn,w=e.numWorkers,E=e.progressCallback,y=e.saveRenderingContexts,C=e.savedRenderingContexts,A=e.text,z=e.textAlign,O=e.textBaseline,U=e.videoElement,R=e.videoHeight,M=e.videoWidth,Y=e.webcamVideoElement,_=Number(e.gifWidth),L=Number(e.gifHeight),N=Number(e.interval),H=Number(e.sampleInterval),D=l?0:N*1e3,X=[],F=C.length?C.length:e.numFrames,P=F,Q=new Se(e),K=r.getFontSize(e),J=e.textXCoordinate?e.textXCoordinate:z==="left"?1:z==="right"?_:_/2,he=e.textYCoordinate?e.textYCoordinate:O==="top"?1:O==="center"?L/2:L,pe=`${m} ${K} ${k}`,ee=d?Math.floor(d.scaledWidth/2):0,te=d?M-d.scaledWidth:0,ie=d?Math.floor(d.scaledHeight/2):0,ne=d?R-d.scaledHeight:0,be=function oe(){let ae=P-1;C.length?(i.putImageData(C[F-P],0,0),Z()):le();function le(){try{te>M&&(te=M),ne>R&&(ne=R),ee<0&&(ee=0),ie<0&&(ie=0),i.filter=h,i.drawImage(U,ee,ie,te,ne,0,0,_,L),Z()}catch(u){if(u.name==="NS_ERROR_NOT_AVAILABLE")r.requestTimeout(le,100);else throw u}}function Z(){let u;y&&X.push(i.getImageData(0,0,_,L)),A&&(i.font=pe,i.fillStyle=x,i.textAlign=z,i.textBaseline=O,i.fillText(A,J,he)),u=i.getImageData(0,0,_,L),Q.addFrameImageData(u),P=ae,E((F-P)/F),ae>0&&r.requestTimeout(oe,D),P||Q.getBase64GIF(function(p){n({error:!1,errorCode:"",errorMsg:"",image:p,cameraStream:s,videoElement:U,webcamVideoElement:Y,savedRenderingContexts:X,keepCameraOn:v})})}};F=F!==void 0?F:10,N=N!==void 0?N:.1,o.width=_,o.height=L,i=o.getContext("2d"),(function oe(){if(!C.length&&U.currentTime===0){r.requestTimeout(oe,100);return}be()})()},getCropDimensions:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.videoWidth,o=e.videoHeight,i=e.gifWidth,a=e.gifHeight,l={width:0,height:0,scaledWidth:0,scaledHeight:0};return n>o?(l.width=Math.round(n*(a/o))-i,l.scaledWidth=Math.round(l.width*(o/a))):(l.height=Math.round(o*(i/n))-a,l.scaledHeight=Math.round(l.height*(n/i))),l}},B={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function t(e){t.attempts=t.attempts||0;let n=e.cameraStream,o=e.completedCallback,i=e.videoElement;i&&(i.videoWidth>0&&i.videoHeight>0?(i.removeEventListener("loadeddata",B.findVideoSize),o({videoElement:i,cameraStream:n,videoWidth:i.videoWidth,videoHeight:i.videoHeight})):t.attempts<10?(t.attempts+=1,r.requestTimeout(function(){B.findVideoSize(e)},400)):o({videoElement:i,cameraStream:n,videoWidth:B.defaultVideoDimensions.width,videoHeight:B.defaultVideoDimensions.height}))},onStreamingTimeout:function(e){r.isFunction(e)&&e({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - Timed out while trying to start streaming",image:null,cameraStream:{}})},stream:function(e){let n=r.isArray(e.existingVideo)?e.existingVideo[0]:e.existingVideo,o=e.cameraStream,i=e.completedCallback,a=e.streamedCallback,l=e.videoElement;if(r.isFunction(a)&&a(),n){if(r.isString(n))l.src=n,l.innerHTML=`<source src="${n}" type="video/${r.getExtension(n)}" />`;else if(n instanceof Blob){try{l.src=r.URL.createObjectURL(n)}catch{}l.innerHTML=`<source src="${n}" type="${n.type}" />`}}else if(l.mozSrcObject)l.mozSrcObject=o;else if(r.URL)try{l.srcObject=o,l.src=r.URL.createObjectURL(o)}catch{l.srcObject=o}l.play(),r.requestTimeout(function s(){s.count=s.count||0,B.loadedData===!0?(B.findVideoSize({videoElement:l,cameraStream:o,completedCallback:i}),B.loadedData=!1):(s.count+=1,s.count>10?B.findVideoSize({videoElement:l,cameraStream:o,completedCallback:i}):s())},0)},startStreaming:function(e){let n=r.isFunction(e.error)?e.error:r.noop,o=r.isFunction(e.streamed)?e.streamed:r.noop,i=r.isFunction(e.completed)?e.completed:r.noop,a=e.crossOrigin,l=e.existingVideo,s=e.lastCameraStream,d=e.options,h=e.webcamVideoElement,x=r.isElement(l)?l:h||j.createElement("video"),k=void 0;a&&(x.crossOrigin=d.crossOrigin),x.autoplay=!0,x.loop=!0,x.muted=!0,x.addEventListener("loadeddata",function(m){B.loadedData=!0,d.offset&&(x.currentTime=d.offset)}),l?B.stream({videoElement:x,existingVideo:l,completedCallback:i}):s?B.stream({videoElement:x,cameraStream:s,streamedCallback:o,completedCallback:i}):r.getUserMedia({video:!0},function(m){B.stream({videoElement:x,cameraStream:m,streamedCallback:o,completedCallback:i})},n)},startVideoStreaming:function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.timeout!==void 0?n.timeout:0,i=n.callback,a=n.webcamVideoElement,l;o>0&&(l=r.requestTimeout(function(){B.onStreamingTimeout(i)},1e4)),B.startStreaming({error:function(){i({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - the user probably denied permission",image:null,cameraStream:{}})},streamed:function(){clearTimeout(l)},completed:function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=d.cameraStream,x=d.videoElement,k=d.videoHeight,m=d.videoWidth;e({cameraStream:h,videoElement:x,videoHeight:k,videoWidth:m})},lastCameraStream:n.lastCameraStream,webcamVideoElement:a,crossOrigin:n.crossOrigin,options:n})},stopVideoStreaming:function(e){e=r.isObject(e)?e:{};let n=e,o=n.keepCameraOn,i=n.videoElement,a=n.webcamVideoElement,l=e.cameraStream||{},s=l.getTracks?l.getTracks()||[]:[],d=!!s.length,h=s[0];!o&&d&&r.isFunction(h.stop)&&h.stop(),r.isElement(i)&&!a&&(i.pause(),r.isFunction(r.URL.revokeObjectURL)&&!r.webWorkerError&&i.src&&r.URL.revokeObjectURL(i.src),r.removeElement(i))}};function Le(t){t=r.isObject(t)?t:{},B.stopVideoStreaming(t)}function Be(t,e){let n=t.options||{},o=n.images,i=n.video,a=Number(n.gifWidth),l=Number(n.gifHeight),s=Number(n.numFrames),d=t.cameraStream,h=t.videoElement,x=t.videoWidth,k=t.videoHeight,m=Ce.getCropDimensions({videoWidth:x,videoHeight:k,gifHeight:l,gifWidth:a}),v=e;n.crop=m,n.videoElement=h,n.videoWidth=x,n.videoHeight=k,n.cameraStream=d,r.isElement(h)&&(h.width=a+m.width,h.height=l+m.height,n.webcamVideoElement||(r.setCSSAttr(h,{position:"fixed",opacity:"0"}),j.body.appendChild(h)),h.play(),Ce.getGIF(n,function(w){(!o||!o.length)&&(!i||!i.length)&&Le(w),v(w)}))}function dt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.callback,n=t.existingVideo,o=t.options,i={getUserMedia:!0,"globalThis.URL":!0},a=q.validate(i),l=0,s,d,h=void 0,x=void 0;if(a.error)return e(a);if(r.isElement(n)&&n.src){if(d=n.src,s=r.getExtension(d),!r.isSupported.videoCodecs[s])return e(q.messages.videoCodecs)}else r.isArray(n)&&r.each(n,function(k,m){if(m instanceof Blob?s=m.type.substr(m.type.lastIndexOf("/")+1,m.length):s=m.substr(m.lastIndexOf(".")+1,m.length),r.isSupported.videoCodecs[s])return n=m,!1});B.startStreaming({completed:function(m){m.options=o||{},Be(m,e)},existingVideo:n,crossOrigin:o.crossOrigin,options:o})}function ft(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.callback,n=t.lastCameraStream,o=t.options,i=t.webcamVideoElement;if(!Ue())return e(q.validate());if(o.savedRenderingContexts.length){Ce.getGIF(o,function(a){e(a)});return}B.startVideoStreaming(function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};a.options=o||{},Be(a,e)},{lastCameraStream:n,callback:e,webcamVideoElement:i,crossOrigin:o.crossOrigin})}function He(t,e){if(e=r.isFunction(t)?t:e,t=r.isObject(t)?t:{},!r.isFunction(e))return;let n=r.normalizeOptions(Fe,t)||{},o=t.cameraStream,i=n.images,a=i?i.length:0,l=n.video,s=n.webcamVideoElement;n=r.normalizeOptions(n,{gifWidth:Math.floor(n.gifWidth),gifHeight:Math.floor(n.gifHeight)}),a?lt({images:i,imagesLength:a,callback:e,options:n}):l?dt({existingVideo:l,callback:e,options:n}):ft({lastCameraStream:o,callback:e,webcamVideoElement:s,options:n})}function mt(t,e){if(e=r.isFunction(t)?t:e,t=r.isObject(t)?t:{},!r.isFunction(e))return;let n=r.normalizeOptions(Fe,t),o=r.normalizeOptions(n,{interval:.1,numFrames:1,gifWidth:Math.floor(n.gifWidth),gifHeight:Math.floor(n.gifHeight)});He(o,e)}var ut={utils:et,error:tt,defaultOptions:it,createGIF:He,takeSnapShot:mt,stopVideoStreaming:Le,isSupported:nt,isWebCamGIFSupported:Ue,isExistingVideoGIFSupported:rt,isExistingImagesGIFSupported:ot,VERSION:"0.4.5"},Pe=ut;var gt={source:"images",width:200,height:200,crossOrigin:"Anonymous",progressCallback:t=>{},completeCallback:()=>{},numWorkers:2,sampleInterval:10,interval:.1,offset:null,numFrames:10,frameDuration:1,filter:"",waterMark:null,waterMarkHeight:null,waterMarkWidth:null,waterMarkXCoordinate:1,waterMarkYCoordinate:1,text:"",showFrameText:!0,fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,webcamVideoElement:null,keepCameraOn:!1,cameraStream:null,saveRenderingContexts:!1,savedRenderingContexts:[]},re=class t{static get properties(){return{id:"gif",name:"GIF",extensions:["gif"],mimeTypes:["image/gif"],builder:t,options:gt}}constructor(e){this.options={...e},this.source=e.source,delete e.source,this.files=[],this.gifshot=Pe}async initialize(e){}async add(e){await this.initialize(),this.files.push(e)}async build(){switch(await this.initialize(),this._cleanOptions(this.options),this.source){case"images":this.options.images=this.files;break;case"video":this.options.video=this.files;break;case"webcam":Ve(this.files.length===0);break;default:throw new Error("GIFBuilder: invalid source")}return await this._createGIF()}async _createGIF(){return new Promise((e,n)=>{this.gifshot.createGIF(this.options,o=>{if(o.error){n(o.errorMsg);return}e(o.image)})})}_cleanOptions(e){(e.video||e.images||e.gifWidth||e.gifHeight)&&console.warn("GIFBuilder: ignoring options"),delete e.video,delete e.images,e.gifWidth=e.width,e.gifHeight=e.height,delete e.width,delete e.height}};return Ye(se);})();
7
+ "use strict";var __exports__=(()=>{var De=Object.create;var fe=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var me=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var qe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Fe=(t,e)=>{for(var n in e)fe(t,n,{get:e[n],enumerable:!0})},ke=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ge(e))!Ne.call(t,i)&&i!==n&&fe(t,i,{get:()=>e[i],enumerable:!(o=He(e,i))||o.enumerable});return t};var $e=(t,e,n)=>(n=t!=null?De(je(t)):{},ke(e||!t||!t.__esModule?fe(n,"default",{value:t,enumerable:!0}):n,t)),Xe=t=>ke(fe({},"__esModule",{value:!0}),t);var We=qe((pt,Te)=>{Te.exports=globalThis.loaders});var ae,pe=me(()=>{"use strict";ae={name:"Video",id:"video",module:"video",encoding:"video",format:"video",extensions:["mp4"],mimeTypes:["video/mp4"],category:"video",binary:!0}});async function be(t){let e=document.createElement("video");return e.src=URL.createObjectURL(t),e}async function xe(t){return await be(new Blob([t]))}var Ie=me(()=>{"use strict"});var Ae={};Fe(Ae,{VideoLoaderWithParser:()=>Qe});var wt,Ye,Qe,Ee=me(()=>{"use strict";Ie();ve();({preload:wt,...Ye}=le),Qe={...Ye,parse:xe,parseBlob:be}});async function Ke(){let{VideoLoaderWithParser:t}=await Promise.resolve().then(()=>(Ee(),Ae));return t}var Je,le,ve=me(()=>{"use strict";pe();Je="5.0.0-alpha.13";le={dataType:null,batchType:null,...ae,version:Je,options:{video:{}},preload:Ke}});var gt={};Fe(gt,{FetchError:()=>r.FetchError,GIFBuilder:()=>ee,JSONLoader:()=>r.JSONLoader,NullLoader:()=>r.NullLoader,NullWorkerLoader:()=>r.NullWorkerLoader,RequestScheduler:()=>r.RequestScheduler,VideoFormat:()=>ae,VideoLoader:()=>le,_BrowserFileSystem:()=>r._BrowserFileSystem,_fetchProgress:()=>r._fetchProgress,_selectSource:()=>r._selectSource,_unregisterLoaders:()=>r._unregisterLoaders,assert:()=>r.assert,concatenateArrayBuffersAsync:()=>r.concatenateArrayBuffersAsync,coreApi:()=>r.coreApi,createDataSource:()=>r.createDataSource,document:()=>r.document,encode:()=>r.encode,encodeInBatches:()=>r.encodeInBatches,encodeSync:()=>r.encodeSync,encodeTable:()=>r.encodeTable,encodeTableAsText:()=>r.encodeTableAsText,encodeTableInBatches:()=>r.encodeTableInBatches,encodeText:()=>r.encodeText,encodeTextSync:()=>r.encodeTextSync,encodeURLtoURL:()=>r.encodeURLtoURL,fetchFile:()=>r.fetchFile,forEach:()=>r.forEach,getLoaderOptions:()=>r.getLoaderOptions,getPathPrefix:()=>r.getPathPrefix,global:()=>r.global,isAsyncIterable:()=>r.isAsyncIterable,isBrowser:()=>r.isBrowser,isIterable:()=>r.isIterable,isIterator:()=>r.isIterator,isPromise:()=>r.isPromise,isPureObject:()=>r.isPureObject,isReadableStream:()=>r.isReadableStream,isResponse:()=>r.isResponse,isWorker:()=>r.isWorker,isWritableStream:()=>r.isWritableStream,load:()=>r.load,loadInBatches:()=>r.loadInBatches,makeIterator:()=>r.makeIterator,makeLineIterator:()=>r.makeLineIterator,makeNumberedLineIterator:()=>r.makeNumberedLineIterator,makeStream:()=>r.makeStream,makeTextDecoderIterator:()=>r.makeTextDecoderIterator,makeTextEncoderIterator:()=>r.makeTextEncoderIterator,parse:()=>r.parse,parseFile:()=>r.parseFile,parseInBatches:()=>r.parseInBatches,parseSync:()=>r.parseSync,preload:()=>r.preload,preloadSync:()=>r.preloadSync,readArrayBuffer:()=>r.readArrayBuffer,registerLoaders:()=>r.registerLoaders,resolvePath:()=>r.resolvePath,selectLoader:()=>r.selectLoader,selectLoaderSync:()=>r.selectLoaderSync,self:()=>r.self,setLoaderOptions:()=>r.setLoaderOptions,setPathPrefix:()=>r.setPathPrefix,window:()=>r.window});var r=$e(We(),1);pe();ve();function Oe(t,e){if(!t)throw new Error(e)}var N=globalThis.document||{},s={URL:globalThis.URL||globalThis.webkitURL||globalThis.mozURL||globalThis.msURL,getUserMedia:(function(){if(!globalThis.navigator)return globalThis.navigator;let t=globalThis.navigator.getUserMedia||globalThis.navigator.webkitGetUserMedia||globalThis.navigator.mozGetUserMedia||globalThis.navigator.msGetUserMedia;return t&&t.bind(globalThis.navigator)})(),requestAnimFrame:globalThis.requestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.mozRequestAnimationFrame||globalThis.oRequestAnimationFrame||globalThis.msRequestAnimationFrame,requestTimeout:function(e,n){if(e=e||s.noop,n=n||0,!s.requestAnimFrame)return setTimeout(e,n);let o=new Date().getTime(),i=new Object,l=s.requestAnimFrame,c=function a(){new Date().getTime()-o>=n?e.call():i.value=l(a)};return i.value=l(c),i},Blob:globalThis.Blob||globalThis.BlobBuilder||globalThis.WebKitBlobBuilder||globalThis.MozBlobBuilder||globalThis.MSBlobBuilder,btoa:(function(){let t=globalThis.btoa||function(e){let n="",o=0,i=e.length,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c,a,f,p,y,T,u;for(;o<i;)c=e.charCodeAt(o++),a=e.charCodeAt(o++),f=e.charCodeAt(o++),p=c>>2,y=(c&3)<<4|a>>4,T=(a&15)<<2|f>>6,u=f&63,Number.isNaN(a)?T=u=64:Number.isNaN(f)&&(u=64),n=n+l.charAt(p)+l.charAt(y)+l.charAt(T)+l.charAt(u);return n};return t?t.bind(globalThis):s.noop})(),isObject:function(e){return e&&Object.prototype.toString.call(e)==="[object Object]"},isEmptyObject:function(e){return s.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&typeof e=="function"},isElement:function(e){return e&&e.nodeType===1},isImageBitmap:function(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap},isDrawable:function(e){return s.isElement(e)||s.isImageBitmap(e)},isString:function(e){return typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"},isSupported:{canvas:function(){let e=N.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return globalThis.Worker},blob:function(){return s.Blob},Uint8Array:function(){return globalThis.Uint8Array},Uint32Array:function(){return globalThis.Uint32Array},videoCodecs:(function(){let t=N.createElement("video"),e={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{t&&t.canPlayType&&(e.mp4=t.canPlayType('video/mp4; codecs="mp4v.20.8"')!=="",e.h264=(t.canPlayType('video/mp4; codecs="avc1.42E01E"')||t.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'))!=="",e.ogv=t.canPlayType('video/ogg; codecs="theora"')!=="",e.ogg=t.canPlayType('video/ogg; codecs="theora"')!=="",e.webm=t.canPlayType('video/webm; codecs="vp8, vorbis"')!==-1)}catch{}return e})()},noop:function(){},each:function(e,n){let o,i;if(s.isArray(e))for(o=-1,i=e.length;++o<i&&n(o,e[o])!==!1;);else if(s.isObject(e)){for(o in e)if(e.hasOwnProperty(o)&&n(o,e[o])===!1)break}},normalizeOptions:function(e,n){if(!s.isObject(e)||!s.isObject(n)||!Object.keys)return;let o={};return s.each(e,function(i,l){o[i]=e[i]}),s.each(n,function(i,l){let c=n[i];s.isObject(c)&&e[i]?o[i]=s.normalizeOptions(e[i],c):o[i]=c}),o},setCSSAttr:function(e,n,o){s.isElement(e)&&(s.isString(n)&&s.isString(o)?e.style[n]=o:s.isObject(n)&&s.each(n,function(i,l){e.style[i]=l}))},removeElement:function(e){s.isElement(e)&&e.parentNode&&e.parentNode.removeChild(e)},createWebWorker:function(e){if(!s.isString(e))return{};try{let n=new s.Blob([e],{type:"text/javascript"}),o=s.URL.createObjectURL(n),i=new Worker(o);return{objectUrl:o,worker:i}}catch(n){return`${n}`}},getExtension:function(e){return e.substr(e.lastIndexOf(".")+1,e.length)},getFontSize:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!N.body||e.resizeFont===!1)return e.fontSize;let n=e.text,o=e.gifWidth,i=parseInt(e.fontSize,10),l=parseInt(e.minFontSize,10),c=N.createElement("div"),a=N.createElement("span");for(c.setAttribute("width",o),c.appendChild(a),a.innerHTML=n,a.style.fontSize=`${i}px`,a.style.textIndent="-9999px",a.style.visibility="hidden",N.body.appendChild(a);a.offsetWidth>o&&i>=l;)a.style.fontSize=`${--i}px`;return N.body.removeChild(a),`${i}px`},webWorkerError:!1},Ze=Object.freeze({default:s}),X={validate:function(e){e=s.isObject(e)?e:{};let n={};return s.each(X.validators,function(o,i){let l=i.errorCode;if(!e[l]&&!i.condition)return n=i,n.error=!0,!1}),delete n.condition,n},isValid:function(e){return X.validate(e).error!==!0},validators:[{condition:s.isFunction(s.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:s.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:s.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:s.isFunction(s.URL),errorCode:"globalThis.URL",errorMsg:"The globalThis.URL API is not supported in your browser"},{condition:s.isSupported.blob(),errorCode:"globalThis.Blob",errorMsg:"The globalThis.Blob File API is not supported in your browser"},{condition:s.isSupported.Uint8Array(),errorCode:"globalThis.Uint8Array",errorMsg:"The globalThis.Uint8Array function constructor is not supported in your browser"},{condition:s.isSupported.Uint32Array(),errorCode:"globalThis.Uint32Array",errorMsg:"The globalThis.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},et=Object.freeze({default:X}),Re=function(){},we={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:Re,completeCallback:Re,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},tt=Object.freeze({default:we});function it(){return X.isValid()}function Le(){return X.isValid()}function nt(){let t={getUserMedia:!0};return X.isValid(t)}function ot(t){let e=!1;if(s.isArray(t)&&t.length){if(s.each(t,function(n,o){s.isSupported.videoCodecs[o]&&(e=!0)}),!e)return!1}else if(s.isString(t)&&t.length&&!s.isSupported.videoCodecs[t])return!1;return X.isValid({getUserMedia:!0})}function Ue(){let U,D,j,Y,F,H=[],J=[],K=[],te=[];function ue(g,b,I){let h,x;for(D=g,j=b,Y=I,F=new Array(256),h=0;h<256;h++)F[h]=new Array(4),x=F[h],x[0]=x[1]=x[2]=(h<<12)/256|0,K[h]=65536/256|0,J[h]=0}function ge(){let g=[],b=new Array(256);for(let h=0;h<256;h++)b[F[h][3]]=h;let I=0;for(let h=0;h<256;h++){let x=b[h];g[I++]=F[x][0],g[I++]=F[x][1],g[I++]=F[x][2]}return g}function ie(){let g,b,I,h,x,d,m,k;for(m=0,k=0,g=0;g<256;g++){for(x=F[g],I=g,h=x[1],b=g+1;b<256;b++)d=F[b],d[1]<h&&(I=b,h=d[1]);if(d=F[I],g!==I&&(b=d[0],d[0]=x[0],x[0]=b,b=d[1],d[1]=x[1],x[1]=b,b=d[2],d[2]=x[2],x[2]=b,b=d[3],d[3]=x[3],x[3]=b),h!==m){for(H[m]=k+g>>1,b=m+1;b<h;b++)H[b]=g;m=h,k=g}}for(H[m]=k+255>>1,b=m+1;b<256;b++)H[b]=255}function ne(){let g,b,I,h,x,d,m,k,W,z,$,E,G,Ce;for(j<1509&&(Y=1),U=30+(Y-1)/3,E=D,G=0,Ce=j,$=j/(3*Y),z=$/100|0,k=1024,d=2048,m=d>>6,m<=1&&(m=0),g=0;g<m;g++)te[g]=k*((m*m-g*g)*256/(m*m));for(j<1509?W=3:j%499!==0?W=3*499:j%491!==0?W=3*491:j%487!==0?W=3*487:W=3*503,g=0;g<$;)if(I=(E[G+0]&255)<<4,h=(E[G+1]&255)<<4,x=(E[G+2]&255)<<4,b=de(I,h,x),ce(k,b,I,h,x),m!==0&&se(m,b,I,h,x),G+=W,G>=Ce&&(G-=j),g++,z===0&&(z=1),g%z===0)for(k-=k/U,d-=d/30,m=d>>6,m<=1&&(m=0),b=0;b<m;b++)te[b]=k*((m*m-b*b)*256/(m*m))}function oe(g,b,I){let h,x,d,m,k,W,z;for(k=1e3,z=-1,h=H[b],x=h-1;h<256||x>=0;)h<256&&(W=F[h],d=W[1]-b,d>=k?h=256:(h++,d<0&&(d=-d),m=W[0]-g,m<0&&(m=-m),d+=m,d<k&&(m=W[2]-I,m<0&&(m=-m),d+=m,d<k&&(k=d,z=W[3])))),x>=0&&(W=F[x],d=b-W[1],d>=k?x=-1:(x--,d<0&&(d=-d),m=W[0]-g,m<0&&(m=-m),d+=m,d<k&&(m=W[2]-I,m<0&&(m=-m),d+=m,d<k&&(k=d,z=W[3]))));return z}function re(){return ne(),he(),ie(),ge()}function he(){let g,b;for(g=0;g<256;g++)F[g][0]>>=4,F[g][1]>>=4,F[g][2]>>=4,F[g][3]=g}function se(g,b,I,h,x){let d,m,k,W,z,$,E;for(k=b-g,k<-1&&(k=-1),W=b+g,W>256&&(W=256),d=b+1,m=b-1,$=1;d<W||m>k;){if(z=te[$++],d<W){E=F[d++];try{E[0]-=z*(E[0]-I)/262144|0,E[1]-=z*(E[1]-h)/262144|0,E[2]-=z*(E[2]-x)/262144|0}catch{}}if(m>k){E=F[m--];try{E[0]-=z*(E[0]-I)/262144|0,E[1]-=z*(E[1]-h)/262144|0,E[2]-=z*(E[2]-x)/262144|0}catch{}}}}function ce(g,b,I,h,x){let d=F[b],m=g/1024;d[0]-=m*(d[0]-I)|0,d[1]-=m*(d[1]-h)|0,d[2]-=m*(d[2]-x)|0}function de(g,b,I){let h,x,d,m,k,W,z,$,E,G;for($=~(1<<31),E=$,W=-1,z=W,h=0;h<256;h++)G=F[h],x=G[0]-g,x<0&&(x=-x),d=G[1]-b,d<0&&(d=-d),x+=d,d=G[2]-I,d<0&&(d=-d),x+=d,x<$&&($=x,W=h),m=x-(J[h]>>12),m<E&&(E=m,z=h),k=K[h]>>10,K[h]-=k,J[h]+=k<<10;return K[W]+=64,J[W]-=65536,z}ue.apply(this,arguments);let Z={};return Z.map=oe,Z.process=re,Z}function ze(){let t=this;try{globalThis.onmessage=function(n){let o=n.data||{},i;o.gifshot&&(i=e.run(o),postMessage(i))}}catch{}var e={dataToRGB:function(o,i,l){let c=i*l*4,a=0,f=[];for(;a<c;)f.push(o[a++]),f.push(o[a++]),f.push(o[a++]),a++;return f},componentizedPaletteToArray:function(o){o=o||[];let i=[];for(let l=0;l<o.length;l+=3){let c=o[l],a=o[l+1],f=o[l+2];i.push(c<<16|a<<8|f)}return i},processFrameWithQuantizer:function(o,i,l,c){let a=this.dataToRGB(o,i,l),f=new Ue(a,a.length,c),p=f.process(),y=new Uint32Array(this.componentizedPaletteToArray(p)),T=i*l,u=new Uint8Array(T),v=0;for(let w=0;w<T;w++){let A=a[v++],S=a[v++],C=a[v++];u[w]=f.map(A,S,C)}return{pixels:u,palette:y}},run:function(o){o=o||{};let i=o,l=i.height,c=i.palette,a=i.sampleInterval,f=i.width,p=o.data;return this.processFrameWithQuantizer(p,f,l,a)}};return e}function rt(t,e,n,o){let i=0;o=o===void 0?{}:o;let l=o.loop===void 0?null:o.loop,c=o.palette===void 0?null:o.palette;if(e<=0||n<=0||e>65535||n>65535)throw"Width/Height invalid.";function a(u){let v=u.length;if(v<2||v>256||v&v-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return v}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;let f=0,p=0;if(t[i++]=e&255,t[i++]=e>>8&255,t[i++]=n&255,t[i++]=n>>8&255,t[i++]=(c!==null?128:0)|f,t[i++]=p,t[i++]=0,l!==null){if(l<0||l>65535)throw"Loop count invalid.";t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=l&255,t[i++]=l>>8&255,t[i++]=0}let y=!1;this.addFrame=function(u,v,w,A,S,C){if(y===!0&&(--i,y=!1),C=C===void 0?{}:C,u<0||v<0||u>65535||v>65535)throw"x/y invalid.";if(w<=0||A<=0||w>65535||A>65535)throw"Width/Height invalid.";if(S.length<w*A)throw"Not enough pixels for the frame size.";let O=!0,R=C.palette;if(R==null&&(O=!1,R=c),R==null)throw"Must supply either a local or global palette.";let V=a(R),M=0;for(V>>=1;V;)++M,V>>=1;V=1<<M;let L=C.delay===void 0?0:C.delay,U=C.disposal===void 0?0:C.disposal;if(U<0||U>3)throw"Disposal out of range.";let Q=!1,_=0;if(C.transparent!==void 0&&C.transparent!==null&&(Q=!0,_=C.transparent,_<0||_>=V))throw"Transparent color index.";if((U!==0||Q||L!==0)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=U<<2|(Q===!0?1:0),t[i++]=L&255,t[i++]=L>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=u&255,t[i++]=u>>8&255,t[i++]=v&255,t[i++]=v>>8&255,t[i++]=w&255,t[i++]=w>>8&255,t[i++]=A&255,t[i++]=A>>8&255,t[i++]=O===!0?128|M-1:0,O===!0)for(let B=0,q=R.length;B<q;++B){let D=R[B];t[i++]=D>>16&255,t[i++]=D>>8&255,t[i++]=D&255}i=T(t,i,M<2?2:M,S)},this.end=function(){return y===!1&&(t[i++]=59,y=!0),i};function T(u,v,w,A){u[v++]=w;let S=v++,C=1<<w,O=C-1,R=C+1,V=R+1,M=w+1,L=0,U=0;function Q(D){for(;L>=D;)u[v++]=U&255,U>>=8,L-=8,v===S+256&&(u[S]=255,S=v++)}function _(D){U|=D<<L,L+=M,Q(8)}let B=A[0]&O,q={};_(C);for(let D=1,j=A.length;D<j;++D){let Y=A[D]&O,F=B<<8|Y,H=q[F];if(H===void 0){for(U|=B<<L,L+=M;L>=8;)u[v++]=U&255,U>>=8,L-=8,v===S+256&&(u[S]=255,S=v++);V===4096?(_(C),V=R+1,M=w+1,q={}):(V>=1<<M&&++M,q[F]=V++),B=Y}else B=H}return _(B),_(R),Q(1),S+1===v?u[S]=0:(u[S]=v-S-1,u[v++]=0),v}}var Ve=function(){},Se=function(e){this.canvas=null,this.ctx=null,this.repeat=0,this.frames=[],this.numRenderedFrames=0,this.onRenderCompleteCallback=Ve,this.onRenderProgressCallback=Ve,this.workers=[],this.availableWorkers=[],this.generatingGIF=!1,this.options=e,this.initializeWebWorkers(e)};Se.prototype={workerMethods:ze(),initializeWebWorkers:function(e){let n=this,o=`${Ue.toString()}(${ze.toString()}());`,i,l,c,a,f=-1,p="";for(a=e.numWorkers;++f<a;)i=s.createWebWorker(o),s.isObject(i)?(l=i.objectUrl,c=i.worker,n.workers.push({worker:c,objectUrl:l}),n.availableWorkers.push(c)):(p=i,s.webWorkerError=!!i);this.workerError=p,this.canvas=N.createElement("canvas"),this.canvas.width=e.gifWidth,this.canvas.height=e.gifHeight,this.ctx=this.canvas.getContext("2d"),this.frames=[]},getWorker:function(){return this.availableWorkers.pop()},freeWorker:function(e){this.availableWorkers.push(e)},byteMap:(function(){let t=[];for(let e=0;e<256;e++)t[e]=String.fromCharCode(e);return t})(),bufferToString:function(e){let n=e.length,o="",i=-1;for(;++i<n;)o+=this.byteMap[e[i]];return o},onFrameFinished:function(e){let n=this,o=n.frames,l=!!(n.options.images||[]).length,c=o.every(function(a){return!a.beingProcessed&&a.done});n.numRenderedFrames++,l&&e(n.numRenderedFrames/o.length),n.onRenderProgressCallback(n.numRenderedFrames*.75/o.length),c?n.generatingGIF||n.generateGIF(o,n.onRenderCompleteCallback):s.requestTimeout(function(){n.processNextFrame()},1)},processFrame:function(e){let n=this,o=this.options,i=o.progressCallback,l=o.sampleInterval,c=this.frames,a,f,p=function(){let u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).data;delete a.data,a.pixels=Array.prototype.slice.call(u.pixels),a.palette=Array.prototype.slice.call(u.palette),a.done=!0,a.beingProcessed=!1,n.freeWorker(f),n.onFrameFinished(i)};if(a=c[e],a.beingProcessed||a.done){this.onFrameFinished();return}a.sampleInterval=l,a.beingProcessed=!0,a.gifshot=!0,f=this.getWorker(),f?(f.onmessage=p,f.postMessage(a)):p({data:n.workerMethods.run(a)})},startRendering:function(e){this.onRenderCompleteCallback=e;for(let n=0;n<this.options.numWorkers&&n<this.frames.length;n++)this.processFrame(n)},processNextFrame:function(){let e=-1;for(let n=0;n<this.frames.length;n++){let o=this.frames[n];if(!o.done&&!o.beingProcessed){e=n;break}}e>=0&&this.processFrame(e)},generateGIF:function(e,n){let o=[],i={loop:this.repeat},l=this.options,c=l.interval,a=l.frameDuration,p=!!l.images.length,y=l.gifHeight,T=l.gifWidth,u=new rt(o,T,y,i),v=this.onRenderProgressCallback,w=p?c*100:0,A,S;this.generatingGIF=!0,s.each(e,function(C,O){let R=O.palette;v(.75+.25*O.position*1/e.length);for(let V=0;V<a;V++)u.addFrame(0,0,T,y,O.pixels,{palette:R,delay:w})}),u.end(),v(1),this.frames=[],this.generatingGIF=!1,s.isFunction(n)&&(A=this.bufferToString(o),S=`data:image/gif;base64,${s.btoa(A)}`,n(S))},setRepeat:function(e){this.repeat=e},addFrame:function(e,n){n=s.isObject(n)?n:{};let o=this,i=o.ctx,l=o.options,c=l.gifWidth,a=l.gifHeight,f=s.getFontSize(n),p=n,y=p.filter,T=p.fontColor,u=p.fontFamily,v=p.fontWeight,w=p.gifHeight,A=p.gifWidth,S=p.text,C=p.textAlign,O=p.textBaseline,R=n.textXCoordinate?n.textXCoordinate:C==="left"?1:C==="right"?c:c/2,V=n.textYCoordinate?n.textYCoordinate:O==="top"?1:O==="center"?a/2:a,M=`${v} ${f} ${u}`,L;try{i.filter=y,i.drawImage(e,0,0,c,a),S&&(i.font=M,i.fillStyle=T,i.textAlign=C,i.textBaseline=O,i.fillText(S,R,V)),L=i.getImageData(0,0,c,a),o.addFrameImageData(L)}catch(U){return`${U}`}},addFrameImageData:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.frames,o=e.data;this.frames.push({data:o,width:e.width,height:e.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:n.length})},onRenderProgress:function(e){this.onRenderProgressCallback=e},isRendering:function(){return this.generatingGIF},getBase64GIF:function(e){let n=this,o=function(l){n.destroyWorkers(),s.requestTimeout(function(){e(l)},0)};n.startRendering(o)},destroyWorkers:function(){if(this.workerError)return;let e=this.workers;s.each(e,function(n,o){let i=o.worker,l=o.objectUrl;i.terminate(),s.URL.revokeObjectURL(l)})}};function st(t,e){t.getBase64GIF(function(n){e({error:!1,errorCode:"",errorMsg:"",image:n})})}function at(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this,n=t.callback,o=t.images,i=t.options,l=t.imagesLength,c={getUserMedia:!0,"globalThis.URL":!0},a=X.validate(c),f=[],p=0,y,T;if(a.error)return n(a);T=new Se(i),s.each(o,function(v,w){let A=w;s.isDrawable(A)?(i.crossOrigin&&(A.crossOrigin=i.crossOrigin),f[v]=A,p+=1,p===l&&u()):s.isString(A)&&(y=new Image,i.crossOrigin&&(y.crossOrigin=i.crossOrigin),(function(S){w.text&&(S.text=w.text),S.onerror=function(C){let O;if(--l,l===0)return O={},O.error="None of the requested images was capable of being retrieved",n(O)},S.onload=function(C){w.text?f[v]={img:S,text:S.text}:f[v]=S,p+=1,p===l&&u(),s.removeElement(S)},S.src=A})(y),s.setCSSAttr(y,{position:"fixed",opacity:"0"}),N.body.appendChild(y))});function u(){s.each(f,function(v,w){w&&(w.text?T.addFrame(w.img,i,w.text):T.addFrame(w,i))}),st(T,n)}}var lt=function(){},ye={getGIF:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments[1];n=s.isFunction(n)?n:lt;let o=N.createElement("canvas"),i,c=!!e.images.length,a=e.cameraStream,f=e.crop,p=e.filter,y=e.fontColor,T=e.fontFamily,u=e.fontWeight,v=e.keepCameraOn,w=e.numWorkers,A=e.progressCallback,S=e.saveRenderingContexts,C=e.savedRenderingContexts,O=e.text,R=e.textAlign,V=e.textBaseline,M=e.videoElement,L=e.videoHeight,U=e.videoWidth,Q=e.webcamVideoElement,_=Number(e.gifWidth),B=Number(e.gifHeight),q=Number(e.interval),D=Number(e.sampleInterval),j=c?0:q*1e3,Y=[],F=C.length?C.length:e.numFrames,H=F,J=new Se(e),K=s.getFontSize(e),te=e.textXCoordinate?e.textXCoordinate:R==="left"?1:R==="right"?_:_/2,ue=e.textYCoordinate?e.textYCoordinate:V==="top"?1:V==="center"?B/2:B,ge=`${u} ${K} ${T}`,ie=f?Math.floor(f.scaledWidth/2):0,ne=f?U-f.scaledWidth:0,oe=f?Math.floor(f.scaledHeight/2):0,re=f?L-f.scaledHeight:0,he=function se(){let ce=H-1;C.length?(i.putImageData(C[F-H],0,0),Z()):de();function de(){try{ne>U&&(ne=U),re>L&&(re=L),ie<0&&(ie=0),oe<0&&(oe=0),i.filter=p,i.drawImage(M,ie,oe,ne,re,0,0,_,B),Z()}catch(g){if(g.name==="NS_ERROR_NOT_AVAILABLE")s.requestTimeout(de,100);else throw g}}function Z(){let g;S&&Y.push(i.getImageData(0,0,_,B)),O&&(i.font=ge,i.fillStyle=y,i.textAlign=R,i.textBaseline=V,i.fillText(O,te,ue)),g=i.getImageData(0,0,_,B),J.addFrameImageData(g),H=ce,A((F-H)/F),ce>0&&s.requestTimeout(se,j),H||J.getBase64GIF(function(b){n({error:!1,errorCode:"",errorMsg:"",image:b,cameraStream:a,videoElement:M,webcamVideoElement:Q,savedRenderingContexts:Y,keepCameraOn:v})})}};F=F!==void 0?F:10,q=q!==void 0?q:.1,o.width=_,o.height=B,i=o.getContext("2d"),(function se(){if(!C.length&&M.currentTime===0){s.requestTimeout(se,100);return}he()})()},getCropDimensions:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.videoWidth,o=e.videoHeight,i=e.gifWidth,l=e.gifHeight,c={width:0,height:0,scaledWidth:0,scaledHeight:0};return n>o?(c.width=Math.round(n*(l/o))-i,c.scaledWidth=Math.round(c.width*(o/l))):(c.height=Math.round(o*(i/n))-l,c.scaledHeight=Math.round(c.height*(n/i))),c}},P={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function t(e){t.attempts=t.attempts||0;let n=e.cameraStream,o=e.completedCallback,i=e.videoElement;i&&(i.videoWidth>0&&i.videoHeight>0?(i.removeEventListener("loadeddata",P.findVideoSize),o({videoElement:i,cameraStream:n,videoWidth:i.videoWidth,videoHeight:i.videoHeight})):t.attempts<10?(t.attempts+=1,s.requestTimeout(function(){P.findVideoSize(e)},400)):o({videoElement:i,cameraStream:n,videoWidth:P.defaultVideoDimensions.width,videoHeight:P.defaultVideoDimensions.height}))},onStreamingTimeout:function(e){s.isFunction(e)&&e({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - Timed out while trying to start streaming",image:null,cameraStream:{}})},stream:function(e){let n=s.isArray(e.existingVideo)?e.existingVideo[0]:e.existingVideo,o=e.cameraStream,i=e.completedCallback,l=e.streamedCallback,c=e.videoElement;if(s.isFunction(l)&&l(),n){if(s.isString(n))c.src=n,c.innerHTML=`<source src="${n}" type="video/${s.getExtension(n)}" />`;else if(n instanceof Blob){try{c.src=s.URL.createObjectURL(n)}catch{}c.innerHTML=`<source src="${n}" type="${n.type}" />`}}else if(c.mozSrcObject)c.mozSrcObject=o;else if(s.URL)try{c.srcObject=o,c.src=s.URL.createObjectURL(o)}catch{c.srcObject=o}c.play(),s.requestTimeout(function a(){a.count=a.count||0,P.loadedData===!0?(P.findVideoSize({videoElement:c,cameraStream:o,completedCallback:i}),P.loadedData=!1):(a.count+=1,a.count>10?P.findVideoSize({videoElement:c,cameraStream:o,completedCallback:i}):a())},0)},startStreaming:function(e){let n=s.isFunction(e.error)?e.error:s.noop,o=s.isFunction(e.streamed)?e.streamed:s.noop,i=s.isFunction(e.completed)?e.completed:s.noop,l=e.crossOrigin,c=e.existingVideo,a=e.lastCameraStream,f=e.options,p=e.webcamVideoElement,y=s.isElement(c)?c:p||N.createElement("video"),T=void 0;l&&(y.crossOrigin=f.crossOrigin),y.autoplay=!0,y.loop=!0,y.muted=!0,y.addEventListener("loadeddata",function(u){P.loadedData=!0,f.offset&&(y.currentTime=f.offset)}),c?P.stream({videoElement:y,existingVideo:c,completedCallback:i}):a?P.stream({videoElement:y,cameraStream:a,streamedCallback:o,completedCallback:i}):s.getUserMedia({video:!0},function(u){P.stream({videoElement:y,cameraStream:u,streamedCallback:o,completedCallback:i})},n)},startVideoStreaming:function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.timeout!==void 0?n.timeout:0,i=n.callback,l=n.webcamVideoElement,c;o>0&&(c=s.requestTimeout(function(){P.onStreamingTimeout(i)},1e4)),P.startStreaming({error:function(){i({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - the user probably denied permission",image:null,cameraStream:{}})},streamed:function(){clearTimeout(c)},completed:function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=f.cameraStream,y=f.videoElement,T=f.videoHeight,u=f.videoWidth;e({cameraStream:p,videoElement:y,videoHeight:T,videoWidth:u})},lastCameraStream:n.lastCameraStream,webcamVideoElement:l,crossOrigin:n.crossOrigin,options:n})},stopVideoStreaming:function(e){e=s.isObject(e)?e:{};let n=e,o=n.keepCameraOn,i=n.videoElement,l=n.webcamVideoElement,c=e.cameraStream||{},a=c.getTracks?c.getTracks()||[]:[],f=!!a.length,p=a[0];!o&&f&&s.isFunction(p.stop)&&p.stop(),s.isElement(i)&&!l&&(i.pause(),s.isFunction(s.URL.revokeObjectURL)&&!s.webWorkerError&&i.src&&s.URL.revokeObjectURL(i.src),s.removeElement(i))}};function Me(t){t=s.isObject(t)?t:{},P.stopVideoStreaming(t)}function _e(t,e){let n=t.options||{},o=n.images,i=n.video,l=Number(n.gifWidth),c=Number(n.gifHeight),a=Number(n.numFrames),f=t.cameraStream,p=t.videoElement,y=t.videoWidth,T=t.videoHeight,u=ye.getCropDimensions({videoWidth:y,videoHeight:T,gifHeight:c,gifWidth:l}),v=e;n.crop=u,n.videoElement=p,n.videoWidth=y,n.videoHeight=T,n.cameraStream=f,s.isElement(p)&&(p.width=l+u.width,p.height=c+u.height,n.webcamVideoElement||(s.setCSSAttr(p,{position:"fixed",opacity:"0"}),N.body.appendChild(p)),p.play(),ye.getGIF(n,function(w){(!o||!o.length)&&(!i||!i.length)&&Me(w),v(w)}))}function ct(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.callback,n=t.existingVideo,o=t.options,i={getUserMedia:!0,"globalThis.URL":!0},l=X.validate(i),c=0,a,f,p=void 0,y=void 0;if(l.error)return e(l);if(s.isElement(n)&&n.src){if(f=n.src,a=s.getExtension(f),!s.isSupported.videoCodecs[a])return e(X.messages.videoCodecs)}else s.isArray(n)&&s.each(n,function(T,u){if(u instanceof Blob?a=u.type.substr(u.type.lastIndexOf("/")+1,u.length):a=u.substr(u.lastIndexOf(".")+1,u.length),s.isSupported.videoCodecs[a])return n=u,!1});P.startStreaming({completed:function(u){u.options=o||{},_e(u,e)},existingVideo:n,crossOrigin:o.crossOrigin,options:o})}function dt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.callback,n=t.lastCameraStream,o=t.options,i=t.webcamVideoElement;if(!Le())return e(X.validate());if(o.savedRenderingContexts.length){ye.getGIF(o,function(l){e(l)});return}P.startVideoStreaming(function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l.options=o||{},_e(l,e)},{lastCameraStream:n,callback:e,webcamVideoElement:i,crossOrigin:o.crossOrigin})}function Be(t,e){if(e=s.isFunction(t)?t:e,t=s.isObject(t)?t:{},!s.isFunction(e))return;let n=s.normalizeOptions(we,t)||{},o=t.cameraStream,i=n.images,l=i?i.length:0,c=n.video,a=n.webcamVideoElement;n=s.normalizeOptions(n,{gifWidth:Math.floor(n.gifWidth),gifHeight:Math.floor(n.gifHeight)}),l?at({images:i,imagesLength:l,callback:e,options:n}):c?ct({existingVideo:c,callback:e,options:n}):dt({lastCameraStream:o,callback:e,webcamVideoElement:a,options:n})}function ft(t,e){if(e=s.isFunction(t)?t:e,t=s.isObject(t)?t:{},!s.isFunction(e))return;let n=s.normalizeOptions(we,t),o=s.normalizeOptions(n,{interval:.1,numFrames:1,gifWidth:Math.floor(n.gifWidth),gifHeight:Math.floor(n.gifHeight)});Be(o,e)}var mt={utils:Ze,error:et,defaultOptions:tt,createGIF:Be,takeSnapShot:ft,stopVideoStreaming:Me,isSupported:it,isWebCamGIFSupported:Le,isExistingVideoGIFSupported:ot,isExistingImagesGIFSupported:nt,VERSION:"0.4.5"},Pe=mt;var ut={source:"images",width:200,height:200,crossOrigin:"Anonymous",progressCallback:t=>{},completeCallback:()=>{},numWorkers:2,sampleInterval:10,interval:.1,offset:null,numFrames:10,frameDuration:1,filter:"",waterMark:null,waterMarkHeight:null,waterMarkWidth:null,waterMarkXCoordinate:1,waterMarkYCoordinate:1,text:"",showFrameText:!0,fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,webcamVideoElement:null,keepCameraOn:!1,cameraStream:null,saveRenderingContexts:!1,savedRenderingContexts:[]},ee=class t{static get properties(){return{id:"gif",name:"GIF",extensions:["gif"],mimeTypes:["image/gif"],builder:t,options:ut}}constructor(e){this.options={...e},this.source=e.source,delete e.source,this.files=[],this.gifshot=Pe}async initialize(e){}async add(e){await this.initialize(),this.files.push(e)}async build(){switch(await this.initialize(),this._cleanOptions(this.options),this.source){case"images":this.options.images=this.files;break;case"video":this.options.video=this.files;break;case"webcam":Oe(this.files.length===0);break;default:throw new Error("GIFBuilder: invalid source")}return await this._createGIF()}async _createGIF(){return new Promise((e,n)=>{this.gifshot.createGIF(this.options,o=>{if(o.error){n(o.errorMsg);return}e(o.image)})})}_cleanOptions(e){(e.video||e.images||e.gifWidth||e.gifHeight)&&console.warn("GIFBuilder: ignoring options"),delete e.video,delete e.images,e.gifWidth=e.width,e.gifHeight=e.height,delete e.width,delete e.height}};return Xe(gt);})();
8
8
  return __exports__;
9
9
  });
package/dist/index.cjs CHANGED
@@ -89,7 +89,7 @@ var init_video_loader = __esm({
89
89
  "dist/video-loader.js"() {
90
90
  "use strict";
91
91
  init_video_format();
92
- VERSION = true ? "5.0.0-alpha.11" : "latest";
92
+ VERSION = true ? "5.0.0-alpha.13" : "latest";
93
93
  VideoLoader = {
94
94
  dataType: null,
95
95
  batchType: null,
@@ -1,3 +1,3 @@
1
- import { type LoadLibraryOptions } from '@loaders.gl/worker-utils';
1
+ import { type LoadLibraryOptions } from '@loaders.gl/core/worker-utils';
2
2
  export declare function loadGifshotModule(options?: LoadLibraryOptions): Promise<any>;
3
3
  //# sourceMappingURL=gifshot-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gifshot-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/gifshot/gifshot-loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAK9E,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,gBAQvE"}
1
+ {"version":3,"file":"gifshot-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/gifshot/gifshot-loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAKnF,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,gBAQvE"}
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  // @ts-nocheck
5
- import { loadLibrary } from '@loaders.gl/worker-utils';
6
- import { registerJSModules, getJSModule } from '@loaders.gl/loader-utils';
5
+ import { loadLibrary } from '@loaders.gl/core/worker-utils';
6
+ import { registerJSModules, getJSModule } from '@loaders.gl/core/loader-utils';
7
7
  let loadGifshotPromise;
8
8
  export async function loadGifshotModule(options = {}) {
9
9
  registerJSModules(options.modules);
@@ -1 +1 @@
1
- {"version":3,"file":"gifshot-loader.js","sourceRoot":"","sources":["../../../src/lib/gifshot/gifshot-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,cAAc;AACd,OAAO,EAAC,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAExE,IAAI,kBAAkB,CAAC;AAEvB,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAA8B,EAAE;IACtE,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,kBAAkB,GAAG,kBAAkB,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IAChE,OAAO,MAAM,kBAAkB,CAAC;AAClC,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,OAA2B;IACpD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAEpE,oCAAoC;IACpC,qDAAqD;IACrD,OAAO,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"gifshot-loader.js","sourceRoot":"","sources":["../../../src/lib/gifshot/gifshot-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,cAAc;AACd,OAAO,EAAC,WAAW,EAA0B,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE7E,IAAI,kBAAkB,CAAC;AAEvB,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAA8B,EAAE;IACtE,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,kBAAkB,GAAG,kBAAkB,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IAChE,OAAO,MAAM,kBAAkB,CAAC;AAClC,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,OAA2B;IACpD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAEpE,oCAAoC;IACpC,qDAAqD;IACrD,OAAO,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC;AACvC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { LoaderOptions } from '@loaders.gl/loader-utils';
1
+ import type { LoaderOptions } from '@loaders.gl/core/loader-utils';
2
2
  import parseVideo, { parseVideoBlob } from "./lib/parsers/parse-video.js";
3
3
  export type VideoLoaderOptions = LoaderOptions & {
4
4
  video: {};
@@ -1 +1 @@
1
- {"version":3,"file":"video-loader-with-parser.d.ts","sourceRoot":"","sources":["../src/video-loader-with-parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,UAAU,EAAE,EAAC,cAAc,EAAC,qCAAkC;AAKrE,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;CAIgD,CAAC"}
1
+ {"version":3,"file":"video-loader-with-parser.d.ts","sourceRoot":"","sources":["../src/video-loader-with-parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACnF,OAAO,UAAU,EAAE,EAAC,cAAc,EAAC,qCAAkC;AAKrE,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;CAIgD,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { LoaderOptions } from '@loaders.gl/loader-utils';
1
+ import type { LoaderOptions } from '@loaders.gl/core/loader-utils';
2
2
  export type VideoLoaderOptions = LoaderOptions & {
3
3
  video: {};
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"video-loader.d.ts","sourceRoot":"","sources":["../src/video-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAS,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAOpE,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAEF,+DAA+D;AAC/D,iBAAe,OAAO;;;;;;;;;;;;;;;;uBAOS,gBAAgB;wBAC1B,KAAK;GALzB;AAED,iEAAiE;AACjE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;uBACO,gBAAgB;wBAC1B,KAAK;CAQ8C,CAAC"}
1
+ {"version":3,"file":"video-loader.d.ts","sourceRoot":"","sources":["../src/video-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAS,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAOzE,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAEF,+DAA+D;AAC/D,iBAAe,OAAO;;;;;;;;;;;;;;;;uBAOS,gBAAgB;wBAC1B,KAAK;GALzB;AAED,iEAAiE;AACjE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;uBACO,gBAAgB;wBAC1B,KAAK;CAQ8C,CAAC"}
@@ -4,7 +4,7 @@
4
4
  import { VideoFormat } from "./video-format.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "5.0.0-alpha.11" !== 'undefined' ? "5.0.0-alpha.11" : 'latest';
7
+ const VERSION = typeof "5.0.0-alpha.13" !== 'undefined' ? "5.0.0-alpha.13" : 'latest';
8
8
  /** Preloads the parser-bearing video loader implementation. */
9
9
  async function preload() {
10
10
  const { VideoLoaderWithParser } = await import("./video-loader-with-parser.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/video",
3
- "version": "5.0.0-alpha.11",
3
+ "version": "5.0.0-alpha.13",
4
4
  "description": "Framework-independent loaders and writers for video (MP4, WEBM, ...)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,12 +48,8 @@
48
48
  "build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
49
49
  "build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
50
50
  },
51
- "dependencies": {
52
- "@loaders.gl/loader-utils": "5.0.0-alpha.11",
53
- "@loaders.gl/worker-utils": "5.0.0-alpha.11"
54
- },
55
51
  "peerDependencies": {
56
52
  "@loaders.gl/core": "~5.0.0-alpha.0"
57
53
  },
58
- "gitHead": "31449661e98c1c3f97bb4f8a7bcba7f19596ac00"
54
+ "gitHead": "1464ee8e912521b658a51f96c88c3b2310ceb2cd"
59
55
  }
@@ -3,8 +3,8 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  // @ts-nocheck
6
- import {loadLibrary, type LoadLibraryOptions} from '@loaders.gl/worker-utils';
7
- import {registerJSModules, getJSModule} from '@loaders.gl/loader-utils';
6
+ import {loadLibrary, type LoadLibraryOptions} from '@loaders.gl/core/worker-utils';
7
+ import {registerJSModules, getJSModule} from '@loaders.gl/core/loader-utils';
8
8
 
9
9
  let loadGifshotPromise;
10
10
 
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {Format} from '@loaders.gl/loader-utils';
5
+ import type {Format} from '@loaders.gl/core/loader-utils';
6
6
 
7
7
  /** Video media format. */
8
8
  export const VideoFormat = {
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
5
+ import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/core/loader-utils';
6
6
  import parseVideo, {parseVideoBlob} from './lib/parsers/parse-video';
7
7
  import {VideoLoader as VideoLoaderMetadata} from './video-loader';
8
8
 
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';
5
+ import type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';
6
6
  import {VideoFormat} from './video-format';
7
7
 
8
8
  // __VERSION__ is injected by babel-plugin-version-inline