@shotstack/shotstack-studio 2.24.4 → 2.24.5

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.
@@ -11,7 +11,7 @@ import "pixi.js/text-html";
11
11
  import "pixi.js/sprite-tiling";
12
12
  import "pixi.js/filters";
13
13
  import "pixi.js/mesh";
14
- const xI = "2.24.3", CI = {
14
+ const xI = "2.24.4", CI = {
15
15
  version: xI
16
16
  };
17
17
  function Ev(e, t, i) {
@@ -1,4 +1,4 @@
1
- (function(Ti,xr){typeof exports=="object"&&typeof module<"u"?xr(exports,require("pixi.js"),require("howler"),require("pixi-filters"),require("opentype.js"),require("pixi.js/app"),require("pixi.js/events"),require("pixi.js/graphics"),require("pixi.js/text"),require("pixi.js/text-html"),require("pixi.js/sprite-tiling"),require("pixi.js/filters"),require("pixi.js/mesh")):typeof define=="function"&&define.amd?define(["exports","pixi.js","howler","pixi-filters","opentype.js","pixi.js/app","pixi.js/events","pixi.js/graphics","pixi.js/text","pixi.js/text-html","pixi.js/sprite-tiling","pixi.js/filters","pixi.js/mesh"],xr):(Ti=typeof globalThis<"u"?globalThis:Ti||self,xr(Ti.ShotstackStudio={},Ti.PIXI,Ti.Howler,Ti.PIXI,Ti.opentype))})(this,function(Ti,xr,bI,vI,wI){"use strict";var Qr=typeof document<"u"?document.currentScript:null;function ed(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const K=ed(xr),fv=ed(bI),Bl=ed(vI),z0=ed(wI),xI={version:"2.24.3"};function hv(e,t,i){const n=1-e;return 3*n*n*e*t+3*n*e*e*i+e*e*e}class CI{curves={};constructor(){this.initializeCurves()}initializeCurves(){this.curves={smooth:[[.5,0],[.5,1]],ease:[[.25,.1],[.25,1]],easeIn:[[.42,0],[1,1]],easeOut:[[0,0],[.58,1]],easeInOut:[[.42,0],[.58,1]],easeInQuad:[[.55,.085],[.68,.53]],easeInCubic:[[.55,.055],[.675,.19]],easeInQuart:[[.895,.03],[.685,.22]],easeInQuint:[[.755,.05],[.855,.06]],easeInSine:[[.47,0],[.745,.715]],easeInExpo:[[.95,.05],[.795,.035]],easeInCirc:[[.6,.04],[.98,.335]],easeInBack:[[.6,-.28],[.735,.045]],easeOutQuad:[[.25,.46],[.45,.94]],easeOutCubic:[[.215,.61],[.355,1]],easeOutQuart:[[.165,.84],[.44,1]],easeOutQuint:[[.23,1],[.32,1]],easeOutSine:[[.39,.575],[.565,1]],easeOutExpo:[[.19,1],[.22,1]],easeOutCirc:[[.075,.82],[.165,1]],easeOutBack:[[.175,.885],[.32,1.275]],easeInOutQuad:[[.455,.03],[.515,.955]],easeInOutCubic:[[.645,.045],[.355,1]],easeInOutQuart:[[.77,0],[.175,1]],easeInOutQuint:[[.86,0],[.07,1]],easeInOutSine:[[.445,.05],[.55,.95]],easeInOutExpo:[[1,0],[0,1]],easeInOutCirc:[[.785,.135],[.15,.86]],easeInOutBack:[[.68,-.55],[.265,1.55]]}}getValue(t,i,n,r){if(n<=0)return t;if(n>=1)return i;const s=this.curves[r??""]??this.curves.ease,[[a,o],[l,u]]=s,c=this.solveForT(n,a,l),d=hv(c,o,u);return t+(i-t)*d}solveForT(t,i,n){let r=0,s=1,a=t;for(let o=0;o<24;o+=1){const l=hv(a,i,n)-t;if(Math.abs(l)<1e-5)break;l<0?r=a:s=a,a=(r+s)/2}return a}}const vi=1e-6;class zs{property;length;cubicBuilder;cachedIndex=0;constructor(t,i,n=0){this.property=this.createKeyframes(t,i,n),this.length=i,this.cubicBuilder=new CI}getValue(t){const i=this.findKeyframe(t);if(!i){if(this.property.length>0){if(t>=this.length)return this.property[this.property.length-1].to;if(t<0)return this.property[0].from}return 1}const n=(t-i.start)/i.length;switch(i.interpolation){case"bezier":return this.cubicBuilder.getValue(i.from,i.to,n,i.easing);case"constant":return i.from;case"linear":default:return i.from+(i.to-i.from)*n}}findKeyframe(t){const i=this.property;if(i.length===0)return;const n=i[this.cachedIndex];if(n){const o=n.start+n.length;if(Number.isFinite(o)&&t>=n.start&&t<o)return n}const r=this.cachedIndex+1;if(r<i.length){const o=i[r],l=o.start+o.length;if(Number.isFinite(l)&&t>=o.start&&t<l)return this.cachedIndex=r,o}const s=this.cachedIndex-1;if(s>=0){const o=i[s],l=o.start+o.length;if(Number.isFinite(l)&&t>=o.start&&t<l)return this.cachedIndex=s,o}const a=this.binarySearchKeyframe(t);if(a!==-1)return this.cachedIndex=a,i[a]}binarySearchKeyframe(t){const i=this.property;let n=0,r=i.length-1;for(;n<=r;){const s=Math.floor((n+r)/2),a=i[s],o=a.start+a.length;if(!Number.isFinite(o)||t>=o)n=s+1;else if(t<a.start)r=s-1;else return s}return-1}createKeyframes(t,i,n=0){if(typeof t=="number")return[{start:0,length:i,from:t,to:t}];if(!t.length)throw new Error("Keyframes should have at least one value.");const r=this.createNormalizedKeyframes(t);return this.normaliseAdjacentBoundaries(r),this.validateKeyframes(r),this.insertFillerKeyframes(r,i,n)}createNormalizedKeyframes(t){return t.filter(i=>typeof i.start=="number"&&typeof i.length=="number").sort((i,n)=>i.start-n.start).map(i=>({start:i.start,length:i.length,from:typeof i.from=="number"?i.from:0,to:typeof i.to=="number"?i.to:0,interpolation:i.interpolation,easing:i.easing}))}normaliseAdjacentBoundaries(t){for(let i=0;i<t.length-1;i+=1){const n=t[i],r=t[i+1],s=n.start+n.length-r.start,a=r.start-n.start;Math.abs(s)<=vi&&a>0&&(n.length=a)}}validateKeyframes(t){for(let i=0;i<t.length;i+=1){const n=t[i],r=t[i+1];if(!r)break;if(n.start+n.length-r.start>vi)throw new Error("Overlapping keyframes detected.")}}insertFillerKeyframes(t,i,n=0){const r=[];for(let s=0;s<t.length;s+=1){const a=t[s],o=t[s+1];if(s===0&&a.start>0){const c={start:0,length:a.start,from:n,to:a.from};r.push(c)}if(r.push(a),!o){if(i-(a.start+a.length)>0){const d=a.start+a.length,f={start:d,length:i-d,from:a.to,to:a.to};r.push(f)}break}if(o.start-(a.start+a.length)>0){const c=a.start+a.length,d=o.start-c,f={start:c,length:d,from:a.to,to:o.from};r.push(f)}}return r}}class Aa{baseValue;mode;layers=[];length;clampRange;constructor(t,i,n,r){this.baseValue=t,this.length=i,this.mode=n,this.clampRange=r}addLayer(t){if(t.length===0)return;const i=this.mode==="additive"?0:1;this.layers.push(new zs(t,this.length,i))}getValue(t){if(this.layers.length===0)return this.baseValue;if(this.mode==="additive"){let n=this.baseValue;for(const r of this.layers)n+=r.getValue(t);return n}let i=this.baseValue;for(const n of this.layers)i*=n.getValue(t);return this.clampRange&&(i=Math.max(this.clampRange.min,Math.min(this.clampRange.max,i))),i}}class kI{clipConfiguration;effectPreset;constructor(t){this.clipConfiguration=t;const[i,n]=(t.effect??"").split(/(Slow|Fast)/);this.effectPreset={name:i,speed:n}}buildRelative(t,i){const n=[],r=[],s=[],a=[],o=[],{effect:l,length:u}=this.clipConfiguration;if(!l)return{offsetXKeyframes:n,offsetYKeyframes:r,opacityKeyframes:s,scaleKeyframes:a,rotationKeyframes:o};const c=0,d=this.getPresetName();switch(d){case"zoomIn":{const f=this.getZoomSpeed();a.push({from:1,to:f,start:c,length:u,interpolation:"linear"});break}case"zoomOut":{const f=this.getZoomSpeed();a.push({from:f,to:1,start:c,length:u,interpolation:"linear"});break}case"slideLeft":case"slideRight":case"slideUp":case"slideDown":{const f=d==="slideLeft"||d==="slideRight",h=d==="slideLeft"||d==="slideUp",p=this.getFittedSize(t,i),g=f?t.width:t.height,y=f?p.width:p.height;let w=this.getSlideStart();const C=g+g*w*2;if(y<C){const k=C/y;a.push({from:k,to:k,start:c,length:u,interpolation:"linear"})}else w=(y-g)/2/g;const[x,S]=h?[w,-w]:[-w,w];(f?n:r).push({from:x,to:S,start:c,length:u});break}}return{offsetXKeyframes:n,offsetYKeyframes:r,opacityKeyframes:s,scaleKeyframes:a,rotationKeyframes:o}}getPresetName(){return this.effectPreset.name}getZoomSpeed(){const{name:t,speed:i}=this.effectPreset;if(t.startsWith("zoom"))switch(i){case"Slow":return 1.1;case"Fast":return 1.7;default:return 1.3}return 0}getSlideStart(){const{name:t,speed:i}=this.effectPreset;if(t.startsWith("slide"))switch(i){case"Slow":return .03;case"Fast":return .2;default:return .12}return 0}getFittedSize(t,i){switch(this.clipConfiguration.fit??"crop"){case"cover":case"crop":{const r=Math.max(t.width/i.width,t.height/i.height);return{width:i.width*r,height:i.height*r}}case"contain":{const r=Math.min(t.width/i.width,t.height/i.height);return{width:i.width*r,height:i.height*r}}case"none":default:return i}}}class SI{clipConfiguration;inPreset;outPreset;constructor(t){this.clipConfiguration=t,this.inPreset=this.parseTransition(t.transition?.in),this.outPreset=this.parseTransition(t.transition?.out)}parseTransition(t){const[i,n]=(t??"").split(/(Slow|Fast|VeryFast)/);return{name:i,speed:n}}buildRelative(){return{in:this.buildTransitionKeyframes("in"),out:this.buildTransitionKeyframes("out")}}createEmptyKeyframeSet(){return{offsetXKeyframes:[],offsetYKeyframes:[],opacityKeyframes:[],scaleKeyframes:[],rotationKeyframes:[],maskXKeyframes:[],brightnessKeyframes:[],wipeFromRight:!1}}buildTransitionKeyframes(t){const i=this.createEmptyKeyframeSet();if(!(t==="in"?this.clipConfiguration.transition?.in:this.clipConfiguration.transition?.out))return i;const r=this.getPresetLength(t),s=t==="in"?0:this.clipConfiguration.length-r,a=this.getPresetName(t),o=t==="in";switch(a){case"fade":{const[l,u]=o?[0,1]:[1,0];i.opacityKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"easeInOut"});break}case"zoom":{const[l,u]=o?[10,1]:[1,10],[c,d]=o?[0,1]:[1,0],f=o?"easeIn":"easeOut";o?i.scaleKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"linear"}):i.scaleKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:f}),i.opacityKeyframes.push({from:c,to:d,start:s,length:r,interpolation:"bezier",easing:f});break}case"slideLeft":case"slideRight":case"slideUp":case"slideDown":{const l=a==="slideLeft"||a==="slideRight",u=a==="slideLeft"||a==="slideUp",c=.025,[d,f]=o?[u?c:-c,0]:[0,u?-c:c],h=o?"linear":"bezier",[p,g]=o?[0,1]:[1,0];(l?i.offsetXKeyframes:i.offsetYKeyframes).push(o?{from:d,to:f,start:s,length:r,interpolation:h}:{from:d,to:f,start:s,length:r,interpolation:h,easing:"ease"}),i.opacityKeyframes.push({from:p,to:g,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"carouselLeft":case"carouselRight":case"carouselUp":case"carouselDown":{const l=a==="carouselLeft"||a==="carouselRight",u=a==="carouselLeft"||a==="carouselUp",c=l&&1||(o?1.05:1.1),[d,f]=o?[u?c:-c,0]:[0,u?-c:c];(l?i.offsetXKeyframes:i.offsetYKeyframes).push(o?{from:d,to:f,start:s,length:r,interpolation:"linear"}:{from:d,to:f,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"reveal":{const[l,u]=o?[0,1]:[1,0];i.maskXKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"wipeLeft":case"wipeRight":{const[l,u]=o?[1,-1]:[-1,1];i.brightnessKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"easeInOut"}),i.wipeFromRight=a==="wipeLeft"?o:!o;break}}return i}getPresetName(t){return t==="in"?this.inPreset.name:this.outPreset.name}getPresetLength(t){const{name:i,speed:n}=t==="in"?this.inPreset:this.outPreset,r=i.startsWith("carousel"),s=i.startsWith("slide");if(i==="zoom")return .4;switch(n){case"Slow":return 2;case"Fast":return r||s?.25:.5;case"VeryFast":return .25;default:return r||s?.5:1}}}const pv="1.1764706",_I=`
1
+ (function(Ti,xr){typeof exports=="object"&&typeof module<"u"?xr(exports,require("pixi.js"),require("howler"),require("pixi-filters"),require("opentype.js"),require("pixi.js/app"),require("pixi.js/events"),require("pixi.js/graphics"),require("pixi.js/text"),require("pixi.js/text-html"),require("pixi.js/sprite-tiling"),require("pixi.js/filters"),require("pixi.js/mesh")):typeof define=="function"&&define.amd?define(["exports","pixi.js","howler","pixi-filters","opentype.js","pixi.js/app","pixi.js/events","pixi.js/graphics","pixi.js/text","pixi.js/text-html","pixi.js/sprite-tiling","pixi.js/filters","pixi.js/mesh"],xr):(Ti=typeof globalThis<"u"?globalThis:Ti||self,xr(Ti.ShotstackStudio={},Ti.PIXI,Ti.Howler,Ti.PIXI,Ti.opentype))})(this,function(Ti,xr,bI,vI,wI){"use strict";var Qr=typeof document<"u"?document.currentScript:null;function ed(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const K=ed(xr),fv=ed(bI),Bl=ed(vI),z0=ed(wI),xI={version:"2.24.4"};function hv(e,t,i){const n=1-e;return 3*n*n*e*t+3*n*e*e*i+e*e*e}class CI{curves={};constructor(){this.initializeCurves()}initializeCurves(){this.curves={smooth:[[.5,0],[.5,1]],ease:[[.25,.1],[.25,1]],easeIn:[[.42,0],[1,1]],easeOut:[[0,0],[.58,1]],easeInOut:[[.42,0],[.58,1]],easeInQuad:[[.55,.085],[.68,.53]],easeInCubic:[[.55,.055],[.675,.19]],easeInQuart:[[.895,.03],[.685,.22]],easeInQuint:[[.755,.05],[.855,.06]],easeInSine:[[.47,0],[.745,.715]],easeInExpo:[[.95,.05],[.795,.035]],easeInCirc:[[.6,.04],[.98,.335]],easeInBack:[[.6,-.28],[.735,.045]],easeOutQuad:[[.25,.46],[.45,.94]],easeOutCubic:[[.215,.61],[.355,1]],easeOutQuart:[[.165,.84],[.44,1]],easeOutQuint:[[.23,1],[.32,1]],easeOutSine:[[.39,.575],[.565,1]],easeOutExpo:[[.19,1],[.22,1]],easeOutCirc:[[.075,.82],[.165,1]],easeOutBack:[[.175,.885],[.32,1.275]],easeInOutQuad:[[.455,.03],[.515,.955]],easeInOutCubic:[[.645,.045],[.355,1]],easeInOutQuart:[[.77,0],[.175,1]],easeInOutQuint:[[.86,0],[.07,1]],easeInOutSine:[[.445,.05],[.55,.95]],easeInOutExpo:[[1,0],[0,1]],easeInOutCirc:[[.785,.135],[.15,.86]],easeInOutBack:[[.68,-.55],[.265,1.55]]}}getValue(t,i,n,r){if(n<=0)return t;if(n>=1)return i;const s=this.curves[r??""]??this.curves.ease,[[a,o],[l,u]]=s,c=this.solveForT(n,a,l),d=hv(c,o,u);return t+(i-t)*d}solveForT(t,i,n){let r=0,s=1,a=t;for(let o=0;o<24;o+=1){const l=hv(a,i,n)-t;if(Math.abs(l)<1e-5)break;l<0?r=a:s=a,a=(r+s)/2}return a}}const vi=1e-6;class zs{property;length;cubicBuilder;cachedIndex=0;constructor(t,i,n=0){this.property=this.createKeyframes(t,i,n),this.length=i,this.cubicBuilder=new CI}getValue(t){const i=this.findKeyframe(t);if(!i){if(this.property.length>0){if(t>=this.length)return this.property[this.property.length-1].to;if(t<0)return this.property[0].from}return 1}const n=(t-i.start)/i.length;switch(i.interpolation){case"bezier":return this.cubicBuilder.getValue(i.from,i.to,n,i.easing);case"constant":return i.from;case"linear":default:return i.from+(i.to-i.from)*n}}findKeyframe(t){const i=this.property;if(i.length===0)return;const n=i[this.cachedIndex];if(n){const o=n.start+n.length;if(Number.isFinite(o)&&t>=n.start&&t<o)return n}const r=this.cachedIndex+1;if(r<i.length){const o=i[r],l=o.start+o.length;if(Number.isFinite(l)&&t>=o.start&&t<l)return this.cachedIndex=r,o}const s=this.cachedIndex-1;if(s>=0){const o=i[s],l=o.start+o.length;if(Number.isFinite(l)&&t>=o.start&&t<l)return this.cachedIndex=s,o}const a=this.binarySearchKeyframe(t);if(a!==-1)return this.cachedIndex=a,i[a]}binarySearchKeyframe(t){const i=this.property;let n=0,r=i.length-1;for(;n<=r;){const s=Math.floor((n+r)/2),a=i[s],o=a.start+a.length;if(!Number.isFinite(o)||t>=o)n=s+1;else if(t<a.start)r=s-1;else return s}return-1}createKeyframes(t,i,n=0){if(typeof t=="number")return[{start:0,length:i,from:t,to:t}];if(!t.length)throw new Error("Keyframes should have at least one value.");const r=this.createNormalizedKeyframes(t);return this.normaliseAdjacentBoundaries(r),this.validateKeyframes(r),this.insertFillerKeyframes(r,i,n)}createNormalizedKeyframes(t){return t.filter(i=>typeof i.start=="number"&&typeof i.length=="number").sort((i,n)=>i.start-n.start).map(i=>({start:i.start,length:i.length,from:typeof i.from=="number"?i.from:0,to:typeof i.to=="number"?i.to:0,interpolation:i.interpolation,easing:i.easing}))}normaliseAdjacentBoundaries(t){for(let i=0;i<t.length-1;i+=1){const n=t[i],r=t[i+1],s=n.start+n.length-r.start,a=r.start-n.start;Math.abs(s)<=vi&&a>0&&(n.length=a)}}validateKeyframes(t){for(let i=0;i<t.length;i+=1){const n=t[i],r=t[i+1];if(!r)break;if(n.start+n.length-r.start>vi)throw new Error("Overlapping keyframes detected.")}}insertFillerKeyframes(t,i,n=0){const r=[];for(let s=0;s<t.length;s+=1){const a=t[s],o=t[s+1];if(s===0&&a.start>0){const c={start:0,length:a.start,from:n,to:a.from};r.push(c)}if(r.push(a),!o){if(i-(a.start+a.length)>0){const d=a.start+a.length,f={start:d,length:i-d,from:a.to,to:a.to};r.push(f)}break}if(o.start-(a.start+a.length)>0){const c=a.start+a.length,d=o.start-c,f={start:c,length:d,from:a.to,to:o.from};r.push(f)}}return r}}class Aa{baseValue;mode;layers=[];length;clampRange;constructor(t,i,n,r){this.baseValue=t,this.length=i,this.mode=n,this.clampRange=r}addLayer(t){if(t.length===0)return;const i=this.mode==="additive"?0:1;this.layers.push(new zs(t,this.length,i))}getValue(t){if(this.layers.length===0)return this.baseValue;if(this.mode==="additive"){let n=this.baseValue;for(const r of this.layers)n+=r.getValue(t);return n}let i=this.baseValue;for(const n of this.layers)i*=n.getValue(t);return this.clampRange&&(i=Math.max(this.clampRange.min,Math.min(this.clampRange.max,i))),i}}class kI{clipConfiguration;effectPreset;constructor(t){this.clipConfiguration=t;const[i,n]=(t.effect??"").split(/(Slow|Fast)/);this.effectPreset={name:i,speed:n}}buildRelative(t,i){const n=[],r=[],s=[],a=[],o=[],{effect:l,length:u}=this.clipConfiguration;if(!l)return{offsetXKeyframes:n,offsetYKeyframes:r,opacityKeyframes:s,scaleKeyframes:a,rotationKeyframes:o};const c=0,d=this.getPresetName();switch(d){case"zoomIn":{const f=this.getZoomSpeed();a.push({from:1,to:f,start:c,length:u,interpolation:"linear"});break}case"zoomOut":{const f=this.getZoomSpeed();a.push({from:f,to:1,start:c,length:u,interpolation:"linear"});break}case"slideLeft":case"slideRight":case"slideUp":case"slideDown":{const f=d==="slideLeft"||d==="slideRight",h=d==="slideLeft"||d==="slideUp",p=this.getFittedSize(t,i),g=f?t.width:t.height,y=f?p.width:p.height;let w=this.getSlideStart();const C=g+g*w*2;if(y<C){const k=C/y;a.push({from:k,to:k,start:c,length:u,interpolation:"linear"})}else w=(y-g)/2/g;const[x,S]=h?[w,-w]:[-w,w];(f?n:r).push({from:x,to:S,start:c,length:u});break}}return{offsetXKeyframes:n,offsetYKeyframes:r,opacityKeyframes:s,scaleKeyframes:a,rotationKeyframes:o}}getPresetName(){return this.effectPreset.name}getZoomSpeed(){const{name:t,speed:i}=this.effectPreset;if(t.startsWith("zoom"))switch(i){case"Slow":return 1.1;case"Fast":return 1.7;default:return 1.3}return 0}getSlideStart(){const{name:t,speed:i}=this.effectPreset;if(t.startsWith("slide"))switch(i){case"Slow":return .03;case"Fast":return .2;default:return .12}return 0}getFittedSize(t,i){switch(this.clipConfiguration.fit??"crop"){case"cover":case"crop":{const r=Math.max(t.width/i.width,t.height/i.height);return{width:i.width*r,height:i.height*r}}case"contain":{const r=Math.min(t.width/i.width,t.height/i.height);return{width:i.width*r,height:i.height*r}}case"none":default:return i}}}class SI{clipConfiguration;inPreset;outPreset;constructor(t){this.clipConfiguration=t,this.inPreset=this.parseTransition(t.transition?.in),this.outPreset=this.parseTransition(t.transition?.out)}parseTransition(t){const[i,n]=(t??"").split(/(Slow|Fast|VeryFast)/);return{name:i,speed:n}}buildRelative(){return{in:this.buildTransitionKeyframes("in"),out:this.buildTransitionKeyframes("out")}}createEmptyKeyframeSet(){return{offsetXKeyframes:[],offsetYKeyframes:[],opacityKeyframes:[],scaleKeyframes:[],rotationKeyframes:[],maskXKeyframes:[],brightnessKeyframes:[],wipeFromRight:!1}}buildTransitionKeyframes(t){const i=this.createEmptyKeyframeSet();if(!(t==="in"?this.clipConfiguration.transition?.in:this.clipConfiguration.transition?.out))return i;const r=this.getPresetLength(t),s=t==="in"?0:this.clipConfiguration.length-r,a=this.getPresetName(t),o=t==="in";switch(a){case"fade":{const[l,u]=o?[0,1]:[1,0];i.opacityKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"easeInOut"});break}case"zoom":{const[l,u]=o?[10,1]:[1,10],[c,d]=o?[0,1]:[1,0],f=o?"easeIn":"easeOut";o?i.scaleKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"linear"}):i.scaleKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:f}),i.opacityKeyframes.push({from:c,to:d,start:s,length:r,interpolation:"bezier",easing:f});break}case"slideLeft":case"slideRight":case"slideUp":case"slideDown":{const l=a==="slideLeft"||a==="slideRight",u=a==="slideLeft"||a==="slideUp",c=.025,[d,f]=o?[u?c:-c,0]:[0,u?-c:c],h=o?"linear":"bezier",[p,g]=o?[0,1]:[1,0];(l?i.offsetXKeyframes:i.offsetYKeyframes).push(o?{from:d,to:f,start:s,length:r,interpolation:h}:{from:d,to:f,start:s,length:r,interpolation:h,easing:"ease"}),i.opacityKeyframes.push({from:p,to:g,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"carouselLeft":case"carouselRight":case"carouselUp":case"carouselDown":{const l=a==="carouselLeft"||a==="carouselRight",u=a==="carouselLeft"||a==="carouselUp",c=l&&1||(o?1.05:1.1),[d,f]=o?[u?c:-c,0]:[0,u?-c:c];(l?i.offsetXKeyframes:i.offsetYKeyframes).push(o?{from:d,to:f,start:s,length:r,interpolation:"linear"}:{from:d,to:f,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"reveal":{const[l,u]=o?[0,1]:[1,0];i.maskXKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"ease"});break}case"wipeLeft":case"wipeRight":{const[l,u]=o?[1,-1]:[-1,1];i.brightnessKeyframes.push({from:l,to:u,start:s,length:r,interpolation:"bezier",easing:"easeInOut"}),i.wipeFromRight=a==="wipeLeft"?o:!o;break}}return i}getPresetName(t){return t==="in"?this.inPreset.name:this.outPreset.name}getPresetLength(t){const{name:i,speed:n}=t==="in"?this.inPreset:this.outPreset,r=i.startsWith("carousel"),s=i.startsWith("slide");if(i==="zoom")return .4;switch(n){case"Slow":return 2;case"Fast":return r||s?.25:.5;case"VeryFast":return .25;default:return r||s?.5:1}}}const pv="1.1764706",_I=`
2
2
  in vec2 vTextureCoord;
3
3
  out vec4 finalColor;
4
4
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "dazzatron",
7
7
  "kratos2k7"
8
8
  ],
9
- "version": "2.24.4",
9
+ "version": "2.24.5",
10
10
  "description": "A video editing library for creating and editing videos with Shotstack",
11
11
  "type": "module",
12
12
  "main": "dist/shotstack-studio.umd.js",
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "@shotstack/schemas": "1.22.0",
103
- "@shotstack/shotstack-canvas": "^2.12.0",
103
+ "@shotstack/shotstack-canvas": "^2.13.1",
104
104
  "howler": "^2.2.4",
105
105
  "mediabunny": "^1.11.2",
106
106
  "opentype.js": "^1.3.4",