@designcombo/state 1.0.4 → 1.0.6
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/dist/index.es.js +742 -734
- package/dist/index.umd.js +2 -2
- package/dist/utils/load-item.d.ts +2 -0
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(b,
|
1
|
+
(function(b,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("@designcombo/events")):typeof define=="function"&&define.amd?define(["exports","@designcombo/events"],Y):(b=typeof globalThis<"u"?globalThis:b||self,Y(b.events={},b.events))})(this,function(b,Y){"use strict";var Cs=Object.defineProperty;var Rs=(b,Y,jt)=>Y in b?Cs(b,Y,{enumerable:!0,configurable:!0,writable:!0,value:jt}):b[Y]=jt;var de=(b,Y,jt)=>Rs(b,typeof Y!="symbol"?Y+"":Y,jt);var jt=function(t,r){return jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},jt(t,r)};function Te(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");jt(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}function Sr(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tr(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),s,c=[],d;try{for(;(r===void 0||r-- >0)&&!(s=i.next()).done;)c.push(s.value)}catch(p){d={error:p}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(d)throw d.error}}return c}function kr(t,r,n){if(n||arguments.length===2)for(var i=0,s=r.length,c;i<s;i++)(c||!(i in r))&&(c||(c=Array.prototype.slice.call(r,0,i)),c[i]=r[i]);return t.concat(c||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;function xt(t){return typeof t=="function"}function Rn(t){var r=function(i){Error.call(i),i.stack=new Error().stack},n=t(r);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var wr=Rn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
2
2
|
`+n.map(function(i,s){return s+1+") "+i.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ar(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var Ke=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,n,i,s,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var p=Sr(d),A=p.next();!A.done;A=p.next()){var O=A.value;O.remove(this)}}catch(u){r={error:u}}finally{try{A&&!A.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}else d.remove(this);var S=this.initialTeardown;if(Rt(S))try{S()}catch(u){c=u instanceof wr?u.errors:[u]}var R=this._finalizers;if(R){this._finalizers=null;try{for(var m=Sr(R),M=m.next();!M.done;M=m.next()){var D=M.value;try{Fn(D)}catch(u){c=c??[],u instanceof wr?c=kr(kr([],Tr(c)),Tr(u.errors)):c.push(u)}}}catch(u){i={error:u}}finally{try{M&&!M.done&&(s=m.return)&&s.call(m)}finally{if(i)throw i.error}}}if(c)throw new wr(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)Fn(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(r)}},t.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},t.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},t.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&Ar(n,r)},t.prototype.remove=function(r){var n=this._finalizers;n&&Ar(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),xn=Ke.EMPTY;function Ln(t){return t instanceof Ke||t&&"closed"in t&&Rt(t.remove)&&Rt(t.add)&&Rt(t.unsubscribe)}function Fn(t){Rt(t)?t():t.unsubscribe()}var Nn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Hn={setTimeout:function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,kr([t,r],Tr(n)))},clearTimeout:function(t){var r=Hn.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Yi(t){Hn.setTimeout(function(){throw t})}function jn(){}function Be(t){t()}var zn=function(t){Se(r,t);function r(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Ln(n)&&n.add(i)):i.destination=Ki,i}return r.create=function(n,i,s){return new Dr(n,i,s)},r.prototype.next=function(n){this.isStopped||this._next(n)},r.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(Ke),Gi=Function.prototype.bind;function Mr(t,r){return Gi.call(t,r)}var Wi=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var n=this.partialObserver;if(n.next)try{n.next(r)}catch(i){Ve(i)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(i){Ve(i)}else Ve(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){Ve(n)}},t}(),Dr=function(t){Se(r,t);function r(n,i,s){var c=t.call(this)||this,d;if(Rt(n)||!n)d={next:n??void 0,error:i??void 0,complete:s??void 0};else{var p;c&&Nn.useDeprecatedNextContext?(p=Object.create(n),p.unsubscribe=function(){return c.unsubscribe()},d={next:n.next&&Mr(n.next,p),error:n.error&&Mr(n.error,p),complete:n.complete&&Mr(n.complete,p)}):d=n}return c.destination=new Wi(d),c}return r}(zn);function Ve(t){Yi(t)}function Xi(t){throw t}var Ki={closed:!0,next:jn,error:Xi,complete:jn},Bi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Vi(t){return t}function Zi(t){return t.length===0?Vi:t.length===1?t[0]:function(n){return t.reduce(function(i,s){return s(i)},n)}}var $n=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(r,n,i){var s=this,c=Ji(r)?r:new Dr(r,n,i);return Be(function(){var d=s,p=d.operator,A=d.source;c.add(p?p.call(c,A):A?s._subscribe(c):s._trySubscribe(c))}),c},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},t.prototype.forEach=function(r,n){var i=this;return n=Un(n),new n(function(s,c){var d=new Dr({next:function(p){try{r(p)}catch(A){c(A),d.unsubscribe()}},error:c,complete:s});i.subscribe(d)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[Bi]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Zi(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Un(r),new r(function(i,s){var c;n.subscribe(function(d){return c=d},function(d){return s(d)},function(){return i(c)})})},t.create=function(r){return new t(r)},t}();function Un(t){var r;return(r=t??Nn.Promise)!==null&&r!==void 0?r:Promise}function qi(t){return t&&Rt(t.next)&&Rt(t.error)&&Rt(t.complete)}function Ji(t){return t&&t instanceof zn||qi(t)&&Ln(t)}var Qi=Rn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Yn=function(t){Se(r,t);function r(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return r.prototype.lift=function(n){var i=new Gn(this,this);return i.operator=n,i},r.prototype._throwIfClosed=function(){if(this.closed)throw new Qi},r.prototype.next=function(n){var i=this;Be(function(){var s,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Sr(i.currentObservers),p=d.next();!p.done;p=d.next()){var A=p.value;A.next(n)}}catch(O){s={error:O}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(s)throw s.error}}}})},r.prototype.error=function(n){var i=this;Be(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var s=i.observers;s.length;)s.shift().error(n)}})},r.prototype.complete=function(){var n=this;Be(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var i=this,s=this,c=s.hasError,d=s.isStopped,p=s.observers;return c||d?xn:(this.currentObservers=null,p.push(n),new Ke(function(){i.currentObservers=null,Ar(p,n)}))},r.prototype._checkFinalizedStatuses=function(n){var i=this,s=i.hasError,c=i.thrownError,d=i.isStopped;s?n.error(c):d&&n.complete()},r.prototype.asObservable=function(){var n=new $n;return n.source=this,n},r.create=function(n,i){return new Gn(n,i)},r}($n),Gn=function(t){Se(r,t);function r(n,i){var s=t.call(this)||this;return s.destination=n,s.source=i,s}return r.prototype.next=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,n)},r.prototype.error=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,n)},r.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},r.prototype._subscribe=function(n){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&s!==void 0?s:xn},r}(Yn),Wn=function(t){Se(r,t);function r(n){var i=t.call(this)||this;return i._value=n,i}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(n){var i=t.prototype._subscribe.call(this,n);return!i.closed&&n.next(this._value),i},r.prototype.getValue=function(){var n=this,i=n.hasError,s=n.thrownError,c=n._value;if(i)throw s;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Yn),vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ze={exports:{}};Ze.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=1,c=2,d=9007199254740991,p="[object Arguments]",A="[object Array]",O="[object AsyncFunction]",S="[object Boolean]",R="[object Date]",m="[object Error]",M="[object Function]",D="[object GeneratorFunction]",u="[object Map]",f="[object Number]",g="[object Null]",y="[object Object]",h="[object Promise]",_="[object Proxy]",v="[object RegExp]",I="[object Set]",E="[object String]",Y="[object Symbol]",x="[object Undefined]",C="[object WeakMap]",w="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",q="[object Float64Array]",tt="[object Int8Array]",Ut="[object Int16Array]",Yt="[object Int32Array]",bt="[object Uint8Array]",te="[object Uint8ClampedArray]",F="[object Uint16Array]",W="[object Uint32Array]",dt=/[\\^$.*+?()[\]{}|]/g,K=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,N={};N[j]=N[q]=N[tt]=N[Ut]=N[Yt]=N[bt]=N[te]=N[F]=N[W]=!0,N[p]=N[A]=N[w]=N[S]=N[T]=N[R]=N[m]=N[M]=N[u]=N[f]=N[y]=N[v]=N[I]=N[E]=N[C]=!1;var Tt=typeof vt=="object"&&vt&&vt.Object===Object&&vt,fe=typeof self=="object"&&self&&self.Object===Object&&self,z=Tt||fe||Function("return this")(),B=r&&!r.nodeType&&r,L=B&&!0&&t&&!t.nodeType&&t,pt=L&&L.exports===B,st=pt&&Tt.process,ot=function(){try{return st&&st.binding&&st.binding("util")}catch{}}(),ht=ot&&ot.isTypedArray;function et(e,a){for(var o=-1,l=e==null?0:e.length,P=0,k=[];++o<l;){var $=e[o];a($,o,e)&&(k[P++]=$)}return k}function xt(e,a){for(var o=-1,l=a.length,P=e.length;++o<l;)e[P+o]=a[o];return e}function de(e,a){for(var o=-1,l=e==null?0:e.length;++o<l;)if(a(e[o],o,e))return!0;return!1}function Q(e,a){for(var o=-1,l=Array(e);++o<e;)l[o]=a(o);return l}function At(e){return function(a){return e(a)}}function Mt(e,a){return e.has(a)}function ee(e,a){return e==null?void 0:e[a]}function Gt(e){var a=-1,o=Array(e.size);return e.forEach(function(l,P){o[++a]=[P,l]}),o}function sr(e,a){return function(o){return e(a(o))}}function Dt(e){var a=-1,o=Array(e.size);return e.forEach(function(l){o[++a]=l}),o}var pe=Array.prototype,Kr=Function.prototype,re=Object.prototype,he=z["__core-js_shared__"],Re=Kr.toString,St=re.hasOwnProperty,or=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),cr=re.toString,Br=RegExp("^"+Re.call(St).replace(dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=pt?z.Buffer:void 0,me=z.Symbol,ur=z.Uint8Array,ye=re.propertyIsEnumerable,ne=pe.splice,kt=me?me.toStringTag:void 0,Ie=Object.getOwnPropertySymbols,Le=xe?xe.isBuffer:void 0,ie=sr(Object.keys,Object),Fe=Ft(z,"DataView"),ae=Ft(z,"Map"),Ne=Ft(z,"Promise"),He=Ft(z,"Set"),je=Ft(z,"WeakMap"),Wt=Ft(Object,"create"),lr=ft(Fe),Lt=ft(ae),Vr=ft(Ne),Zr=ft(He),qr=ft(je),fr=me?me.prototype:void 0,ze=fr?fr.valueOf:void 0;function rt(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Jr(){this.__data__=Wt?Wt(null):{},this.size=0}function Qr(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}function tn(e){var a=this.__data__;if(Wt){var o=a[e];return o===i?void 0:o}return St.call(a,e)?a[e]:void 0}function en(e){var a=this.__data__;return Wt?a[e]!==void 0:St.call(a,e)}function rn(e,a){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Wt&&a===void 0?i:a,this}rt.prototype.clear=Jr,rt.prototype.delete=Qr,rt.prototype.get=tn,rt.prototype.has=en,rt.prototype.set=rn;function ct(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function nn(){this.__data__=[],this.size=0}function an(e){var a=this.__data__,o=be(a,e);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():ne.call(a,o,1),--this.size,!0}function sn(e){var a=this.__data__,o=be(a,e);return o<0?void 0:a[o][1]}function on(e){return be(this.__data__,e)>-1}function cn(e,a){var o=this.__data__,l=be(o,e);return l<0?(++this.size,o.push([e,a])):o[l][1]=a,this}ct.prototype.clear=nn,ct.prototype.delete=an,ct.prototype.get=sn,ct.prototype.has=on,ct.prototype.set=cn;function mt(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function un(){this.size=0,this.__data__={hash:new rt,map:new(ae||ct),string:new rt}}function ln(e){var a=wt(this,e).delete(e);return this.size-=a?1:0,a}function fn(e){return wt(this,e).get(e)}function dn(e){return wt(this,e).has(e)}function pn(e,a){var o=wt(this,e),l=o.size;return o.set(e,a),this.size+=o.size==l?0:1,this}mt.prototype.clear=un,mt.prototype.delete=ln,mt.prototype.get=fn,mt.prototype.has=dn,mt.prototype.set=pn;function _e(e){var a=-1,o=e==null?0:e.length;for(this.__data__=new mt;++a<o;)this.add(e[a])}function dr(e){return this.__data__.set(e,i),this}function ge(e){return this.__data__.has(e)}_e.prototype.add=_e.prototype.push=dr,_e.prototype.has=ge;function Ot(e){var a=this.__data__=new ct(e);this.size=a.size}function $e(){this.__data__=new ct,this.size=0}function hn(e){var a=this.__data__,o=a.delete(e);return this.size=a.size,o}function mn(e){return this.__data__.get(e)}function yn(e){return this.__data__.has(e)}function In(e,a){var o=this.__data__;if(o instanceof ct){var l=o.__data__;if(!ae||l.length<n-1)return l.push([e,a]),this.size=++o.size,this;o=this.__data__=new mt(l)}return o.set(e,a),this.size=o.size,this}Ot.prototype.clear=$e,Ot.prototype.delete=hn,Ot.prototype.get=mn,Ot.prototype.has=yn,Ot.prototype.set=In;function _n(e,a){var o=ve(e),l=!o&&Ir(e),P=!o&&!l&&Ee(e),k=!o&&!l&&!P&&br(e),$=o||l||P||k,H=$?Q(e.length,String):[],V=H.length;for(var U in e)St.call(e,U)&&!($&&(U=="length"||P&&(U=="offset"||U=="parent")||k&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||wn(U,V)))&&H.push(U);return H}function be(e,a){for(var o=e.length;o--;)if(yr(e[o][0],a))return o;return-1}function Ue(e,a,o){var l=a(e);return ve(e)?l:xt(l,o(e))}function se(e){return e==null?e===void 0?x:g:kt&&kt in Object(e)?Nt(e):mr(e)}function pr(e){return Ct(e)&&se(e)==p}function hr(e,a,o,l,P){return e===a?!0:e==null||a==null||!Ct(e)&&!Ct(a)?e!==e&&a!==a:gn(e,a,o,l,hr,P)}function gn(e,a,o,l,P,k){var $=ve(e),H=ve(a),V=$?A:Pt(e),U=H?A:Pt(a);V=V==p?y:V,U=U==p?y:U;var ut=V==y,yt=U==y,J=V==U;if(J&&Ee(e)){if(!Ee(a))return!1;$=!0,ut=!1}if(J&&!ut)return k||(k=new Ot),$||br(e)?Ye(e,a,o,l,P,k):Sn(e,a,V,o,l,P,k);if(!(o&s)){var lt=ut&&St.call(e,"__wrapped__"),nt=yt&&St.call(a,"__wrapped__");if(lt||nt){var Xt=lt?e.value():e,Ht=nt?a.value():a;return k||(k=new Ot),P(Xt,Ht,o,l,k)}}return J?(k||(k=new Ot),Tn(e,a,o,l,P,k)):!1}function bn(e){if(!gr(e)||Mn(e))return!1;var a=_r(e)?Br:K;return a.test(ft(e))}function vn(e){return Ct(e)&&We(e.length)&&!!N[se(e)]}function En(e){if(!Dn(e))return ie(e);var a=[];for(var o in Object(e))St.call(e,o)&&o!="constructor"&&a.push(o);return a}function Ye(e,a,o,l,P,k){var $=o&s,H=e.length,V=a.length;if(H!=V&&!($&&V>H))return!1;var U=k.get(e);if(U&&k.get(a))return U==a;var ut=-1,yt=!0,J=o&c?new _e:void 0;for(k.set(e,a),k.set(a,e);++ut<H;){var lt=e[ut],nt=a[ut];if(l)var Xt=$?l(nt,lt,ut,a,e,k):l(lt,nt,ut,e,a,k);if(Xt!==void 0){if(Xt)continue;yt=!1;break}if(J){if(!de(a,function(Ht,ce){if(!Mt(J,ce)&&(lt===Ht||P(lt,Ht,o,l,k)))return J.push(ce)})){yt=!1;break}}else if(!(lt===nt||P(lt,nt,o,l,k))){yt=!1;break}}return k.delete(e),k.delete(a),yt}function Sn(e,a,o,l,P,k,$){switch(o){case T:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case w:return!(e.byteLength!=a.byteLength||!k(new ur(e),new ur(a)));case S:case R:case f:return yr(+e,+a);case m:return e.name==a.name&&e.message==a.message;case v:case E:return e==a+"";case u:var H=Gt;case I:var V=l&s;if(H||(H=Dt),e.size!=a.size&&!V)return!1;var U=$.get(e);if(U)return U==a;l|=c,$.set(e,a);var ut=Ye(H(e),H(a),l,P,k,$);return $.delete(e),ut;case Y:if(ze)return ze.call(e)==ze.call(a)}return!1}function Tn(e,a,o,l,P,k){var $=o&s,H=oe(e),V=H.length,U=oe(a),ut=U.length;if(V!=ut&&!$)return!1;for(var yt=V;yt--;){var J=H[yt];if(!($?J in a:St.call(a,J)))return!1}var lt=k.get(e);if(lt&&k.get(a))return lt==a;var nt=!0;k.set(e,a),k.set(a,e);for(var Xt=$;++yt<V;){J=H[yt];var Ht=e[J],ce=a[J];if(l)var Ui=$?l(ce,Ht,J,a,e,k):l(Ht,ce,J,e,a,k);if(!(Ui===void 0?Ht===ce||P(Ht,ce,o,l,k):Ui)){nt=!1;break}Xt||(Xt=J=="constructor")}if(nt&&!Xt){var vr=e.constructor,Er=a.constructor;vr!=Er&&"constructor"in e&&"constructor"in a&&!(typeof vr=="function"&&vr instanceof vr&&typeof Er=="function"&&Er instanceof Er)&&(nt=!1)}return k.delete(e),k.delete(a),nt}function oe(e){return Ue(e,Xe,kn)}function wt(e,a){var o=e.__data__;return An(a)?o[typeof a=="string"?"string":"hash"]:o.map}function Ft(e,a){var o=ee(e,a);return bn(o)?o:void 0}function Nt(e){var a=St.call(e,kt),o=e[kt];try{e[kt]=void 0;var l=!0}catch{}var P=cr.call(e);return l&&(a?e[kt]=o:delete e[kt]),P}var kn=Ie?function(e){return e==null?[]:(e=Object(e),et(Ie(e),function(a){return ye.call(e,a)}))}:Pn,Pt=se;(Fe&&Pt(new Fe(new ArrayBuffer(1)))!=T||ae&&Pt(new ae)!=u||Ne&&Pt(Ne.resolve())!=h||He&&Pt(new He)!=I||je&&Pt(new je)!=C)&&(Pt=function(e){var a=se(e),o=a==y?e.constructor:void 0,l=o?ft(o):"";if(l)switch(l){case lr:return T;case Lt:return u;case Vr:return h;case Zr:return I;case qr:return C}return a});function wn(e,a){return a=a??d,!!a&&(typeof e=="number"||Et.test(e))&&e>-1&&e%1==0&&e<a}function An(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Mn(e){return!!or&&or in e}function Dn(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||re;return e===o}function mr(e){return cr.call(e)}function ft(e){if(e!=null){try{return Re.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e,a){return e===a||e!==e&&a!==a}var Ir=pr(function(){return arguments}())?pr:function(e){return Ct(e)&&St.call(e,"callee")&&!ye.call(e,"callee")},ve=Array.isArray;function Ge(e){return e!=null&&We(e.length)&&!_r(e)}var Ee=Le||Cn;function On(e,a){return hr(e,a)}function _r(e){if(!gr(e))return!1;var a=se(e);return a==M||a==D||a==O||a==_}function We(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=d}function gr(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}function Ct(e){return e!=null&&typeof e=="object"}var br=ht?At(ht):vn;function Xe(e){return Ge(e)?_n(e):En(e)}function Pn(){return[]}function Cn(){return!1}t.exports=On}(Ze,Ze.exports);var ta=Ze.exports;const it=Or(ta),ea="add",Xn="track",Kn="trackItems",ra=`${Xn}:changed`,na=`${Kn}:changed`,Bn="state",ia=`${Bn}:changed`,qe="design",Vn=`${qe}:load`,Zn=`${qe}:resize`,It="add",qn=`${It}:text`,Jn=`${It}:video`,Qn=`${It}:audio`,aa=`${It}:placeholder`,ti=`${It}:image`,sa=`${It}:mask`,oa=`${It}:transition`,ca=`${It}:animation`,ei=`${It}:caption`,ri=`${It}:template`,ni=`${It}:items`,zt="edit",ii=`${zt}:object`,ai=`${zt}:replaceMedia`,ua=`${zt}:text`,la=`${zt}:shape`,fa=`${zt}:templateItem`,da=`${zt}:deleteTemplateItem`,pa="enterEditMode",Kt="active",ha=`${Kt}:set`,ma=`${Kt}:delete`,si=`${Kt}:paste`,oi=`${Kt}:clone`,ci=`${Kt}:split`,at="layer",ya=`${at}:locked`,Ia=`${at}:hidden`,_a=`${at}:move`,ga=`${at}:select`,ba=`${at}:selection`,va=`${at}:sendTo`,Ea=`${at}:rename`,Sa=`${at}:editingName`,Ta=`${at}:copy`,ka=`${at}:paste`,ui=`${at}:clone`,wa=`${at}:split`,Aa=`${at}:cut`,li=`${at}:delete`,Te="history",fi=`${Te}:undo`,di=`${Te}:redo`,Ma=`${Te}:reset`,Pr="scale",pi=`${Pr}:changed`;var Je={exports:{}};Je.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,c="[object Arguments]",d="[object Array]",p="[object Boolean]",A="[object Date]",O="[object Error]",S="[object Function]",R="[object GeneratorFunction]",m="[object Map]",M="[object Number]",D="[object Object]",u="[object Promise]",f="[object RegExp]",g="[object Set]",y="[object String]",h="[object Symbol]",_="[object WeakMap]",v="[object ArrayBuffer]",I="[object DataView]",E="[object Float32Array]",Y="[object Float64Array]",x="[object Int8Array]",C="[object Int16Array]",w="[object Int32Array]",T="[object Uint8Array]",j="[object Uint8ClampedArray]",q="[object Uint16Array]",tt="[object Uint32Array]",Ut=/[\\^$.*+?()[\]{}|]/g,Yt=/\w*$/,bt=/^\[object .+?Constructor\]$/,te=/^(?:0|[1-9]\d*)$/,F={};F[c]=F[d]=F[v]=F[I]=F[p]=F[A]=F[E]=F[Y]=F[x]=F[C]=F[w]=F[m]=F[M]=F[D]=F[f]=F[g]=F[y]=F[h]=F[T]=F[j]=F[q]=F[tt]=!0,F[O]=F[S]=F[_]=!1;var W=typeof vt=="object"&&vt&&vt.Object===Object&&vt,dt=typeof self=="object"&&self&&self.Object===Object&&self,K=W||dt||Function("return this")(),Et=r&&!r.nodeType&&r,N=Et&&!0&&t&&!t.nodeType&&t,Tt=N&&N.exports===Et;function fe(e,a){return e.set(a[0],a[1]),e}function z(e,a){return e.add(a),e}function B(e,a){for(var o=-1,l=e?e.length:0;++o<l&&a(e[o],o,e)!==!1;);return e}function L(e,a){for(var o=-1,l=a.length,P=e.length;++o<l;)e[P+o]=a[o];return e}function pt(e,a,o,l){for(var P=-1,k=e?e.length:0;++P<k;)o=a(o,e[P],P,e);return o}function st(e,a){for(var o=-1,l=Array(e);++o<e;)l[o]=a(o);return l}function ot(e,a){return e==null?void 0:e[a]}function ht(e){var a=!1;if(e!=null&&typeof e.toString!="function")try{a=!!(e+"")}catch{}return a}function et(e){var a=-1,o=Array(e.size);return e.forEach(function(l,P){o[++a]=[P,l]}),o}function xt(e,a){return function(o){return e(a(o))}}function de(e){var a=-1,o=Array(e.size);return e.forEach(function(l){o[++a]=l}),o}var Q=Array.prototype,At=Function.prototype,Mt=Object.prototype,ee=K["__core-js_shared__"],Gt=function(){var e=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=At.toString,Dt=Mt.hasOwnProperty,pe=Mt.toString,Kr=RegExp("^"+sr.call(Dt).replace(Ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=Tt?K.Buffer:void 0,he=K.Symbol,Re=K.Uint8Array,St=xt(Object.getPrototypeOf,Object),or=Object.create,cr=Mt.propertyIsEnumerable,Br=Q.splice,xe=Object.getOwnPropertySymbols,me=re?re.isBuffer:void 0,ur=xt(Object.keys,Object),ye=wt(K,"DataView"),ne=wt(K,"Map"),kt=wt(K,"Promise"),Ie=wt(K,"Set"),Le=wt(K,"WeakMap"),ie=wt(Object,"create"),Fe=ft(ye),ae=ft(ne),Ne=ft(kt),He=ft(Ie),je=ft(Le),Wt=he?he.prototype:void 0,lr=Wt?Wt.valueOf:void 0;function Lt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Vr(){this.__data__=ie?ie(null):{}}function Zr(e){return this.has(e)&&delete this.__data__[e]}function qr(e){var a=this.__data__;if(ie){var o=a[e];return o===i?void 0:o}return Dt.call(a,e)?a[e]:void 0}function fr(e){var a=this.__data__;return ie?a[e]!==void 0:Dt.call(a,e)}function ze(e,a){var o=this.__data__;return o[e]=ie&&a===void 0?i:a,this}Lt.prototype.clear=Vr,Lt.prototype.delete=Zr,Lt.prototype.get=qr,Lt.prototype.has=fr,Lt.prototype.set=ze;function rt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Jr(){this.__data__=[]}function Qr(e){var a=this.__data__,o=ge(a,e);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():Br.call(a,o,1),!0}function tn(e){var a=this.__data__,o=ge(a,e);return o<0?void 0:a[o][1]}function en(e){return ge(this.__data__,e)>-1}function rn(e,a){var o=this.__data__,l=ge(o,e);return l<0?o.push([e,a]):o[l][1]=a,this}rt.prototype.clear=Jr,rt.prototype.delete=Qr,rt.prototype.get=tn,rt.prototype.has=en,rt.prototype.set=rn;function ct(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function nn(){this.__data__={hash:new Lt,map:new(ne||rt),string:new Lt}}function an(e){return oe(this,e).delete(e)}function sn(e){return oe(this,e).get(e)}function on(e){return oe(this,e).has(e)}function cn(e,a){return oe(this,e).set(e,a),this}ct.prototype.clear=nn,ct.prototype.delete=an,ct.prototype.get=sn,ct.prototype.has=on,ct.prototype.set=cn;function mt(e){this.__data__=new rt(e)}function un(){this.__data__=new rt}function ln(e){return this.__data__.delete(e)}function fn(e){return this.__data__.get(e)}function dn(e){return this.__data__.has(e)}function pn(e,a){var o=this.__data__;if(o instanceof rt){var l=o.__data__;if(!ne||l.length<n-1)return l.push([e,a]),this;o=this.__data__=new ct(l)}return o.set(e,a),this}mt.prototype.clear=un,mt.prototype.delete=ln,mt.prototype.get=fn,mt.prototype.has=dn,mt.prototype.set=pn;function _e(e,a){var o=Ge(e)||ve(e)?st(e.length,String):[],l=o.length,P=!!l;for(var k in e)Dt.call(e,k)&&!(P&&(k=="length"||An(k,l)))&&o.push(k);return o}function dr(e,a,o){var l=e[a];(!(Dt.call(e,a)&&Ir(l,o))||o===void 0&&!(a in e))&&(e[a]=o)}function ge(e,a){for(var o=e.length;o--;)if(Ir(e[o][0],a))return o;return-1}function Ot(e,a){return e&&Ye(a,Xe(a),e)}function $e(e,a,o,l,P,k,$){var H;if(l&&(H=k?l(e,P,k,$):l(e)),H!==void 0)return H;if(!Ct(e))return e;var V=Ge(e);if(V){if(H=kn(e),!a)return En(e,H)}else{var U=Nt(e),ut=U==S||U==R;if(_r(e))return be(e,a);if(U==D||U==c||ut&&!k){if(ht(e))return k?e:{};if(H=Pt(ut?{}:e),!a)return Sn(e,Ot(H,e))}else{if(!F[U])return k?e:{};H=wn(e,U,$e,a)}}$||($=new mt);var yt=$.get(e);if(yt)return yt;if($.set(e,H),!V)var J=o?Tn(e):Xe(e);return B(J||e,function(lt,nt){J&&(nt=lt,lt=e[nt]),dr(H,nt,$e(lt,a,o,l,nt,e,$))}),H}function hn(e){return Ct(e)?or(e):{}}function mn(e,a,o){var l=a(e);return Ge(e)?l:L(l,o(e))}function yn(e){return pe.call(e)}function In(e){if(!Ct(e)||Dn(e))return!1;var a=We(e)||ht(e)?Kr:bt;return a.test(ft(e))}function _n(e){if(!mr(e))return ur(e);var a=[];for(var o in Object(e))Dt.call(e,o)&&o!="constructor"&&a.push(o);return a}function be(e,a){if(a)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}function Ue(e){var a=new e.constructor(e.byteLength);return new Re(a).set(new Re(e)),a}function se(e,a){var o=a?Ue(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}function pr(e,a,o){var l=a?o(et(e),!0):et(e);return pt(l,fe,new e.constructor)}function hr(e){var a=new e.constructor(e.source,Yt.exec(e));return a.lastIndex=e.lastIndex,a}function gn(e,a,o){var l=a?o(de(e),!0):de(e);return pt(l,z,new e.constructor)}function bn(e){return lr?Object(lr.call(e)):{}}function vn(e,a){var o=a?Ue(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function En(e,a){var o=-1,l=e.length;for(a||(a=Array(l));++o<l;)a[o]=e[o];return a}function Ye(e,a,o,l){o||(o={});for(var P=-1,k=a.length;++P<k;){var $=a[P],H=void 0;dr(o,$,H===void 0?e[$]:H)}return o}function Sn(e,a){return Ye(e,Ft(e),a)}function Tn(e){return mn(e,Xe,Ft)}function oe(e,a){var o=e.__data__;return Mn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function wt(e,a){var o=ot(e,a);return In(o)?o:void 0}var Ft=xe?xt(xe,Object):Pn,Nt=yn;(ye&&Nt(new ye(new ArrayBuffer(1)))!=I||ne&&Nt(new ne)!=m||kt&&Nt(kt.resolve())!=u||Ie&&Nt(new Ie)!=g||Le&&Nt(new Le)!=_)&&(Nt=function(e){var a=pe.call(e),o=a==D?e.constructor:void 0,l=o?ft(o):void 0;if(l)switch(l){case Fe:return I;case ae:return m;case Ne:return u;case He:return g;case je:return _}return a});function kn(e){var a=e.length,o=e.constructor(a);return a&&typeof e[0]=="string"&&Dt.call(e,"index")&&(o.index=e.index,o.input=e.input),o}function Pt(e){return typeof e.constructor=="function"&&!mr(e)?hn(St(e)):{}}function wn(e,a,o,l){var P=e.constructor;switch(a){case v:return Ue(e);case p:case A:return new P(+e);case I:return se(e,l);case E:case Y:case x:case C:case w:case T:case j:case q:case tt:return vn(e,l);case m:return pr(e,l,o);case M:case y:return new P(e);case f:return hr(e);case g:return gn(e,l,o);case h:return bn(e)}}function An(e,a){return a=a??s,!!a&&(typeof e=="number"||te.test(e))&&e>-1&&e%1==0&&e<a}function Mn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Dn(e){return!!Gt&&Gt in e}function mr(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||Mt;return e===o}function ft(e){if(e!=null){try{return sr.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e){return $e(e,!0,!0)}function Ir(e,a){return e===a||e!==e&&a!==a}function ve(e){return On(e)&&Dt.call(e,"callee")&&(!cr.call(e,"callee")||pe.call(e)==c)}var Ge=Array.isArray;function Ee(e){return e!=null&&gr(e.length)&&!We(e)}function On(e){return br(e)&&Ee(e)}var _r=me||Cn;function We(e){var a=Ct(e)?pe.call(e):"";return a==S||a==R}function gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s}function Ct(e){var a=typeof e;return!!e&&(a=="object"||a=="function")}function br(e){return!!e&&typeof e=="object"}function Xe(e){return Ee(e)?_e(e):_n(e)}function Pn(){return[]}function Cn(){return!1}t.exports=yr}(Je,Je.exports);var Da=Je.exports;const X=Or(Da),hi=t=>new Promise((r,n)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const s=i.width,c=i.height;r({width:s,height:c})},i.onerror=s=>{n(s)},i.crossOrigin="anonymous",i.src=t}),Oa=t=>new Promise((r,n)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3;r({duration:s})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.crossOrigin="anonymous",i.load()}),mi=t=>new Promise((r,n)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;r({duration:s,width:c,height:d})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.load()}),yi=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(s=>{s!=="height"&&(n.style[s]=r[s])}),document.body.appendChild(n),n.textContent=t,n.style.whiteSpace="normal",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.width=r.width+"px",n.style.fontSize=r.fontSize+"px";const i=getComputedStyle(n).height;return document.body.removeChild(n),parseFloat(i)},Qe=t=>{const r=t.map(n=>new FontFace(n.fontFamily,`url(${n.url})`).load().catch(i=>i));return r.length===0?Promise.resolve(!0):new Promise((n,i)=>{Promise.all(r).then(s=>{s.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(s=>i(s))})},Pa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let tr=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=Pa[n[t]&63];return r};function le(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let i=tr(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+i}const er={color:"#000000",x:0,y:0,blur:0},ke=(t,r)=>{let n=r!=null&&r.trim?r.trim.to-r.trim.from:(r==null?void 0:r.duration)||5e3;const i={from:0,to:n};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+n};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Ii=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function rr(t,r){const n={x:t.size.width/2,y:t.size.height/2},i={x:r.width/2,y:r.height/2},s=Math.min(t.size.width/r.width,t.size.height/r.height),c=n.x-i.x;return{top:`${n.y-i.y}px`,left:`${c}px`,transform:`scale(${s})`}}const _i=async(t,r)=>{const n=t.details.src,i=await mi(n),s=rr(r,{...i}),c=Ii(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:n,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||er,top:t.details.top||s.top||"0px",left:t.details.left||s.left||"0px",transform:t.details.transform||s.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible",mediaWidth:t.details.mediaWidth||i.width||100,mediaHeight:t.details.mediaHeight||i.height||100};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:ke(t.display,{duration:i.duration,trim:c}),duration:i.duration}},gi=async t=>{const r=t.id,n=t.details,s=(await Oa(n.src)).duration,c=Ii(t.trim,{duration:s});return{id:r,name:"",type:"audio",display:ke(t.display,{duration:s,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:n.src,volume:n.volume??100},metadata:{...t.metadata},duration:s}},Ca=async(t,r)=>{var R,m,M;const n=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},s=Math.min(r.size.width/i.width,r.size.height/i.height),c=((R=t.details)==null?void 0:R.rotate)||0,d={top:((m=t.details)==null?void 0:m.top)||0,left:((M=t.details)==null?void 0:M.left)||0},p=t.display,A=t.trim||t.display;let O=1/0,S=0;return n.forEach(D=>{const u=t.trackItemsMap[D];u.display.from<O&&(O=u.display.from),u.display.to>S&&(S=u.display.to)}),{id:t.id,details:{...i,top:d.top,left:d.left,scale:s,rotate:c},trim:A,display:p||{from:O,to:S},activeEdit:!1}},bi=async(t,r)=>{const n=t.details,i=await hi(n.src),s=rr(r,i);return{id:t.id,type:"image",name:"image",display:ke(t.display),playbackRate:t.playbackRate||1,details:{src:n.src||"",width:n.width||i.width||100,height:n.height||i.height||100,opacity:n.opacity??100,transform:n.transform||s.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||er,top:n.top||s.top||"0px",left:n.left||s.left||"0px",borderWidth:n.borderWidth??0,borderColor:n.borderColor||"#000000",blur:n.blur||0,brightness:n.brightness||100,flipX:n.flipX||!1,flipY:n.flipY||!1,rotate:n.rotate||"0deg",visibility:n.visibility||"visible",mediaWidth:n.mediaWidth||n.width||i.width||100,mediaHeight:n.mediaHeight||n.height||i.height||100},metadata:t.metadata||{}}},vi=async(t,r)=>{const n=t;n.details.fontUrl&&await Qe([{fontFamily:n.details.fontFamily,url:n.details.fontUrl}]);const i=n.id,s=n.details,c=Si(s),d=yi(n.details.text,c),p=rr(r,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:ke(n.display),details:{...c,text:s.text||"",height:d,fontUrl:s.fontUrl,top:c.top||p.top,left:c.left||p.left,borderWidth:s.borderWidth||0,borderColor:s.borderColor||"#000000",boxShadow:s.boxShadow||er,words:s.words||[]},metadata:t.metadata||{}}},Ei=async(t,r)=>{t.details.fontUrl&&await Qe([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,s=Si(i),c=yi(t.details.text,s),d=rr(r,{width:s.width,height:c});return{id:n,name:"text",type:"text",display:ke(t.display),details:{...s,text:i.text||"",height:c,fontUrl:i.fontUrl,top:s.top||d.top,left:s.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||er},metadata:{}}},Si=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),Ra=async(t,r)=>{switch(t.type){case"video":return _i(t,r||{});case"audio":return gi(t);case"image":return bi(t,r||{});case"text":return Ei(t,r||{});case"caption":return vi(t,r||{});default:throw new Error("Unsupported track item")}};function xa(t,r){return r.some(n=>t.some(i=>i.id===n.id))}const La=(t=[],r=[])=>t.length===0?r.map(i=>({id:le(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(n=>({...n,items:n.items||[],accepts:["audio","video","image","text","caption","template"],type:n.type||"text",magnetic:n.magnetic||!1,static:n.static||!1,id:n.id||le()}));function Fa(t,r){return t.filter(i=>{if(r.forEach(s=>{i.items.includes(s)&&(i.items=i.items.filter(c=>c!==s))}),i.items.length!==0||i.static)return i})}const Bt=t=>Object.keys(t).reduce((r,n)=>{const{display:i,playbackRate:s}=t[n];return Math.max(r,i.to/(s||1))},0);function Cr(t,r,n){return Math.min(Math.max(t,r),n)}const Na=(t,r,n,i,s)=>{if(i===void 0&&s===void 0)return{trackId:void 0,trackIndex:void 0};const c=s!==void 0?r[Cr(s,0,r.length)]:r.find(A=>A.id===i);if(!c)return{trackId:void 0,trackIndex:s!==void 0?Cr(s,0,r.length):void 0};const d=c.items.map(A=>n[A]),p=t.map(A=>n[A]);for(const A of d){const O=A.display.from,S=A.display.to;for(const R of p){const m=R.display.from;if(!(R.display.to<=O||m>=S))return{trackId:void 0,trackIndex:r.indexOf(c)}}}return{trackId:c.id,trackIndex:r.indexOf(c)}};function Ha(t,r){let i=r.reduce((s,c)=>c.display.to>s.display.to?c:s,{display:{to:0}}).display.to;t.forEach(s=>{const c=s.display.from,p=s.display.to-c;s.display.from=i,s.display.to=s.display.from+p,i=s.display.to})}function ja(t){const r=t,n=r.tracks,i=r.trackItemsMap,s=[],c={};return n.forEach(d=>{var A;const p=d.items.map(O=>i[O]).sort((O,S)=>O.display.from-S.display.from);for(let O=0;O<p.length-1;O++){const S=p[O],R=p[O+1];if(Math.abs(S.display.to-R.display.from)<=1){const m=`${S.id}-${R.id}`;if((A=r.transitionIds)==null?void 0:A.includes(m))c[m]=r.transitionsMap[m];else{const D={id:m,duration:1500,fromId:S.id,toId:R.id,kind:"none",trackId:d.id,type:"transition"};c[m]=D}s.push(m)}}}),r.transitionIds=s,r.transitionsMap=c,{transitionIds:s,transitionsMap:c}}function za(t){const r=G.subject.pipe(G.filter(({key:u})=>u.startsWith(qe))),n=G.subject.pipe(G.filter(({key:u})=>u.startsWith(It))),i=G.subject.pipe(G.filter(({key:u})=>u.startsWith(at))),s=G.subject.pipe(G.filter(({key:u})=>u.startsWith(Te))),c=G.subject.pipe(G.filter(({key:u})=>u.startsWith(Kt))),d=G.subject.pipe(G.filter(({key:u})=>u.startsWith(zt))),p=G.subject.pipe(G.filter(({key:u})=>u.startsWith(Pr))),A=r.subscribe(async u=>{var f,g;if(u.key===Vn){const y=(f=u.value)==null?void 0:f.payload,h=y.trackItemsMap,_=y.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const I in _)if(_[I].type==="text"||_[I].type==="caption"){const E=_[I].details;await Qe([{fontFamily:E.fontFamily,url:E.fontUrl}])}const v=Bt(h);t.updateState({...y,duration:v},{kind:"design:load",updateHistory:!1})}if(u.key===Zn){const y=(g=u.value)==null?void 0:g.payload;t.updateState({size:y},{kind:"design:resize",updateHistory:!1})}}),O=s.subscribe(u=>{if(u.key===fi)return t.undo();if(u.key===di)return t.redo()}),S=p.subscribe(u=>{var f;if(u.key===pi){const g=(f=u.value)==null?void 0:f.payload.scale;t.updateState({scale:g},{kind:"update",updateHistory:!1})}}),R=i.subscribe(u=>{var g,y,h,_;const f=[];if((g=u.value)!=null&&g.payload.trackItemIds&&(f.push((y=u.value)==null?void 0:y.payload.trackItemIds),t.updateState({activeIds:f},{kind:"update",updateHistory:!1})),u.key===li){const v=(h=u.value)==null?void 0:h.payload.trackItemIds,I=X(t.getState()),E=v&&v.length?v:I.activeIds,Y=I.trackItemIds,x=I.transitionIds,C=I.trackItemDetailsMap,w=X(I.tracks),T=X(I.structure);E.forEach(W=>{var K;const dt=I.trackItemsMap[W]||I.transitionsMap[W];if(dt.type==="template"){const Et=(K=I.structure.find(Tt=>Tt.id===dt.id))==null?void 0:K.items;E.push(...Et);const N=T.findIndex(Tt=>Tt.id===dt.id);T.splice(N,1)}});const j=Y.filter(W=>!E.includes(W)),q=x.filter(W=>!E.includes(W)),tt=Object.fromEntries(Object.entries(C).filter(([W])=>!E.includes(W))),Ut=Object.fromEntries(Object.entries(I.transitionsMap).filter(([W])=>!E.includes(W))),Yt=Fa(I.tracks,E),bt=Object.fromEntries(Object.entries(I.trackItemsMap).filter(([W])=>!E.includes(W)));w.filter(W=>W.magnetic).forEach(W=>{let dt=0;W==null||W.items.forEach(K=>{if(bt[K]){const Et=bt[K].display.to-bt[K].display.from;bt[K].display={from:dt,to:dt+Et},dt+=Et}})});const F=Bt(bt);t.updateState({trackItemIds:j,trackItemDetailsMap:tt,activeIds:[],trackItemsMap:bt,tracks:Yt,duration:F,structure:T,transitionIds:q,transitionsMap:Ut},{updateHistory:!0,kind:"remove"})}if(u.key===ui){const v=X(t.getState()),I={},E=((_=u.value)==null?void 0:_.payload.trackItemIds)||v.activeIds;if(E.length===0)return;E.forEach(x=>{const C=v.trackItemsMap[x],w=v.trackItemDetailsMap[x],T=le();v.trackItemsMap[T]={...X(C),id:T},v.trackItemDetailsMap[T]={...X(w)},v.trackItemIds.push(T);const j=v.tracks.find(q=>q.items.includes(x));I[j.id]?I[j.id].items.push(T):I[j.id]={...j,id:le(),items:[T],static:!1,magnetic:!1}});const Y=Object.values(I);v.tracks=[...Y,...v.tracks],t.updateState({trackItemDetailsMap:v.trackItemDetailsMap,tracks:v.tracks,trackItemIds:v.trackItemIds,trackItemsMap:v.trackItemsMap},{updateHistory:!0,kind:"update"})}}),m=n.subscribe(async u=>{var E,Y,x,C,w,T,j,q,tt,Ut,Yt,bt,te,F,W,dt,K,Et,N,Tt,fe;const f=X(t.getState()),g=((Y=(E=u.value)==null?void 0:E.options)==null?void 0:Y.isSelected)||!1;let y=[],h="text";const _=(C=(x=u.value)==null?void 0:x.options)==null?void 0:C.trackId;let v=(T=(w=u.value)==null?void 0:w.options)==null?void 0:T.trackIndex;if(u.key===ni){const z=(j=u.value)==null?void 0:j.payload,B=z.trackItems.map(Q=>Ra(Q,{size:f.size})),L=await Promise.all(B),pt=La(z.tracks,z.trackItems),st=[],ot={},ht={};if(L.forEach(Q=>{const{details:At,...Mt}=Q;st.push(Q.id),ot[Q.id]={type:Q.type,details:At},ht[Q.id]=Mt}),xa(f.tracks,pt))f.tracks.forEach(Q=>{pt.forEach(At=>{if(Q.id===At.id){if(Q.magnetic){const Mt=At.items.map(Gt=>ht[Gt]),ee=Q.items.map(Gt=>f.trackItemsMap[Gt]);Ha(Mt,ee)}Q.items.push(...st)}})});else{const Q=((tt=(q=u.value)==null?void 0:q.options)==null?void 0:tt.trackIndex)||0,At=Cr(Q,0,f.tracks.length);f.tracks.splice(At,0,...pt)}f.trackItemDetailsMap={...f.trackItemDetailsMap,...ot},f.trackItemsMap={...f.trackItemsMap,...ht},f.trackItemIds=[...f.trackItemIds,...st],f.duration=Bt(f.trackItemsMap);const{transitionIds:xt,transitionsMap:de}=ja(f);t.updateState({trackItemIds:f.trackItemIds,trackItemDetailsMap:f.trackItemDetailsMap,trackItemsMap:f.trackItemsMap,tracks:f.tracks,duration:f.duration,transitionIds:xt,transitionsMap:de},{updateHistory:!0,kind:"add"});return}if(u.key===ei){h="caption";const z=(Ut=u.value)==null?void 0:Ut.payload,B=[];for(const st of z){const ot=vi(st,{size:f.size});B.push(ot)}const L=await Promise.all(B),pt=[];for(const st of L){const ot=st.id;pt.push(ot);const{details:ht,...et}=st;f.trackItemDetailsMap[ot]={type:h,details:ht},f.trackItemsMap[ot]=et,f.trackItemIds.push(ot)}y=pt}if(u.key===qn){h="text";const z=await Ei((Yt=u.value)==null?void 0:Yt.payload,{size:f.size}),{details:B,...L}=z;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===ri){h="template";const z=(bt=u.value)==null?void 0:bt.payload.trackItemsMap,B=(te=u.value)==null?void 0:te.payload.trackItemDetailsMap,L=(F=u.value)==null?void 0:F.payload.transitionsMap,pt=((W=u.value)==null?void 0:W.payload.transitionIds)||[],st=(dt=u.value)==null?void 0:dt.payload.trackItemIds,ot=((K=u.value)==null?void 0:K.payload.tracks)||[],{details:ht,...et}=await Ca((Et=u.value)==null?void 0:Et.payload,{size:f.size}),xt={id:et.id,items:st,transitions:pt,tracks:ot};f.trackItemDetailsMap[et.id]={type:h,details:ht},f.trackItemsMap[et.id]=et,f.trackItemIds.push(et.id),y=[et.id],f.trackItemsMap={...f.trackItemsMap,...z,[et.id]:{type:"template",...et}},f.trackItemDetailsMap={...f.trackItemDetailsMap,...B,[et.id]:{type:"template",details:ht}},f.transitionsMap={...f.transitionsMap,...L},f.structure=[...f.structure,xt]}if(u.key===ti){h="image";const z=await bi((N=u.value)==null?void 0:N.payload,{size:f.size}),{details:B,...L}=z;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===Qn){h="audio";const z=await gi((Tt=u.value)==null?void 0:Tt.payload),{details:B,...L}=z;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===Jn){h="video";const z=await _i((fe=u.value)==null?void 0:fe.payload,{size:f.size}),{details:B,...L}=z;f.trackItemDetailsMap[L.id]={type:h,details:B,metadata:L.metadata},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}const I=Na(y,f.tracks,f.trackItemsMap,_,v);if(I.trackId){const z=f.tracks.find(B=>B.id===I.trackId);z&&z.items.push(...y)}else if(I.trackIndex!==void 0){const z={id:tr(),accepts:["text","audio","helper","video","image","caption","template"],type:h,items:y,magnetic:!1,static:!1};f.tracks.splice(I.trackIndex,0,z)}else f.tracks.unshift({id:tr(),accepts:["text","audio","helper","video","image","caption","template"],type:h,items:y,magnetic:!1,static:!1});g&&(f.activeIds=y),f.duration=Bt(f.trackItemsMap),t.updateState({activeIds:f.activeIds,trackItemIds:f.trackItemIds,trackItemDetailsMap:f.trackItemDetailsMap,trackItemsMap:f.trackItemsMap,transitionsMap:f.transitionsMap,tracks:f.tracks,duration:f.duration,structure:f.structure},{updateHistory:!0,kind:"add"})}),M=c.subscribe(async u=>{var f;if(u.key===ci){const g=X(t.getState()),y=(f=u.value)==null?void 0:f.options.time;if(g.activeIds.length===1){const h=g.activeIds[0],_=X(g.trackItemsMap[h]);if(y>=_.display.to||y<=_.display.from)return;const v=X(g.trackItemDetailsMap[h]),I=le(),E=X({..._,display:{from:_.display.from,to:y}}),Y=X({..._,id:I,display:{from:y,to:_.display.to}});if(_.type==="video"||_.type==="audio"){const x=y-E.display.from;E.trim={from:_.trim.from,to:_.trim.from+x},Y.trim={from:_.trim.from+x,to:_.trim.to}}g.trackItemsMap[h]=E,g.trackItemsMap[I]=Y,g.trackItemIds.push(I),g.trackItemDetailsMap[I]=v,g.tracks.forEach(x=>{x.items.includes(h)&&x.items.push(I)}),t.updateState({trackItemDetailsMap:g.trackItemDetailsMap,tracks:g.tracks,trackItemIds:g.trackItemIds,trackItemsMap:g.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(u.key===oi){const g=X(t.getState());if(g.activeIds.length){const y=g.activeIds,h=[],_={activeIds:y,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};y.forEach(I=>{_.trackItemDetailsMap[I]=g.trackItemDetailsMap[I],_.trackItemsMap[I]=g.trackItemsMap[I],h.push(g.tracks.find(E=>E.items.includes(I)))});const v=new Set;h.filter(I=>v.has(I.id)?!1:(v.add(I),!0)),_.tracks=Array.from(v.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(_))}}if(u.key===si){const g=localStorage.getItem("DesignComboTemp");if(!g)return;const y=X(t.getState()),h=JSON.parse(g),_={},v=h.trackItemsMap,I=h.trackItemDetailsMap,E=h.tracks,Y=[],x=h.activeIds.map(async C=>{const w=I[C];(w.type==="caption"||w.type==="text")&&w.details.fontUrl&&await Qe([{fontFamily:w.details.fontFamily,url:w.details.fontUrl}]);const T=le();return _[C]=T,y.trackItemsMap[T]={...v[C],id:T},y.trackItemDetailsMap[T]=w,y.trackItemIds.push(T),!0});await Promise.all(x),E.forEach(C=>{const w=C.items.map(j=>_[j]),T={...C,items:w,id:tr()};Y.push(T)}),y.tracks=[...y.tracks,...Y],t.updateState({trackItemDetailsMap:y.trackItemDetailsMap,tracks:y.tracks,trackItemIds:y.trackItemIds,trackItemsMap:y.trackItemsMap},{updateHistory:!0,kind:"update"})}}),D=d.subscribe(async u=>{var f,g,y;if(u.key===ii){const h=X(t.getState()),_=h.trackItemDetailsMap,v=h.trackItemsMap,I=Object.keys((f=u.value)==null?void 0:f.payload);if(!I.length)return;const E=(g=u.value)==null?void 0:g.payload;I.forEach(x=>{const C=E[x];C.details?_[x].details={..._[x].details,...C.details}:E[x].playbackRate&&(v[x].playbackRate=E[x].playbackRate)});const Y=Bt(v);t.updateState({trackItemDetailsMap:{..._},trackItemsMap:{...v},duration:Y},{updateHistory:!0,kind:"update:details"})}if(u.key===ai){const h=(y=u.value)==null?void 0:y.payload,_=Object.keys(h)[0],v=Object.values(h)[0],I=X(t.getState()),E=I.trackItemDetailsMap[_];if(v.details){if(v.type==="image"&&v.details.src){const C=await hi(v.details.src),w=E.details.width||0,T=E.details.height||0;let j=C.width,q=C.height;const tt=C.width/C.height;w/T>tt?(j=w,q=w/tt):(q=T,j=T*tt),v.details.mediaWidth=j,v.details.mediaHeight=q}if(v.type==="video"&&v.details.src){const C=await mi(v.details.src),w=E.details.width||0,T=E.details.height||0;let j=C.width,q=C.height;const tt=C.width/C.height;w/T>tt?(j=w,q=w/tt):(q=T,j=T*tt),v.details.mediaWidth=j,v.details.mediaHeight=q}const x=E.details;E.details={...x,...v.details},v.details=E.details}const Y={...E,...v};I.trackItemDetailsMap[_]=Y,I.trackItemsMap[_]={...I.trackItemsMap[_],type:v.type},t.updateState({trackItemDetailsMap:{...I.trackItemDetailsMap},trackItemsMap:{...I.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{m.unsubscribe(),M.unsubscribe(),D.unsubscribe(),O.unsubscribe(),R.unsubscribe(),A.unsubscribe(),S.unsubscribe()}}}const $a={Date:!0,RegExp:!0,String:!0,Number:!0};function Ti(t,r,n={cyclesFix:!0},i=[]){var p,A;let s=[];const c=Array.isArray(t);for(const O in t){const S=t[O],R=c?+O:O;if(!(O in r)){s.push({type:"REMOVE",path:[R],oldValue:t[O]});continue}const m=r[O],M=typeof S=="object"&&typeof m=="object"&&Array.isArray(S)===Array.isArray(m);if(S&&m&&M&&!$a[(A=(p=Object.getPrototypeOf(S))==null?void 0:p.constructor)==null?void 0:A.name]&&(!n.cyclesFix||!i.includes(S))){const D=Ti(S,m,n,n.cyclesFix?i.concat([S]):[]);s.push.apply(s,D.map(u=>(u.path.unshift(R),u)))}else S!==m&&!(Number.isNaN(S)&&Number.isNaN(m))&&!(M&&(isNaN(S)?S+""==m+"":+S==+m))&&s.push({path:[R],type:"CHANGE",value:m,oldValue:S})}const d=Array.isArray(r);for(const O in r)O in t||s.push({type:"CREATE",path:[d?+O:O],value:r[O]});return s}var Rr=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state"),ki=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function Z(t,...r){if(process.env.NODE_ENV!=="production"){const n=ki[t],i=typeof n=="function"?n.apply(null,r):n;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Vt=Object.getPrototypeOf;function Zt(t){return!!t&&!!t[_t]}function $t(t){var r;return t?wi(t)||Array.isArray(t)||!!t[we]||!!((r=t.constructor)!=null&&r[we])||De(t)||Oe(t):!1}var Ua=Object.prototype.constructor.toString();function wi(t){if(!t||typeof t!="object")return!1;const r=Vt(t);if(r===null)return!0;const n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ua}function Ae(t,r){qt(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,i)=>r(i,n,t))}function qt(t){const r=t[_t];return r?r.type_:Array.isArray(t)?1:De(t)?2:Oe(t)?3:0}function Me(t,r){return qt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function xr(t,r){return qt(t)===2?t.get(r):t[r]}function Ai(t,r,n){const i=qt(t);i===2?t.set(r,n):i===3?t.add(n):t[r]=n}function Ya(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function De(t){return t instanceof Map}function Oe(t){return t instanceof Set}function Jt(t){return t.copy_||t.base_}function Lr(t,r){if(De(t))return new Map(t);if(Oe(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=wi(t);if(r===!0||r==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[_t];let s=Reflect.ownKeys(i);for(let c=0;c<s.length;c++){const d=s[c],p=i[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:t[d]})}return Object.create(Vt(t),i)}else{const i=Vt(t);if(i!==null&&n)return{...t};const s=Object.create(i);return Object.assign(s,t)}}function Fr(t,r=!1){return nr(t)||Zt(t)||!$t(t)||(qt(t)>1&&(t.set=t.add=t.clear=t.delete=Ga),Object.freeze(t),r&&Object.entries(t).forEach(([n,i])=>Fr(i,!0))),t}function Ga(){Z(2)}function nr(t){return Object.isFrozen(t)}var Nr={};function Qt(t){const r=Nr[t];return r||Z(0,t),r}function Wa(t,r){Nr[t]||(Nr[t]=r)}var Pe;function Mi(){return Pe}function Xa(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Di(t,r){r&&(Qt("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function Hr(t){jr(t),t.drafts_.forEach(Ka),t.drafts_=null}function jr(t){t===Pe&&(Pe=t.parent_)}function Oi(t){return Pe=Xa(Pe,t)}function Ka(t){const r=t[_t];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Pi(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[_t].modified_&&(Hr(r),Z(4)),$t(t)&&(t=ir(r,t),r.parent_||ar(r,t)),r.patches_&&Qt("Patches").generateReplacementPatches_(n[_t].base_,t,r.patches_,r.inversePatches_)):t=ir(r,n,[]),Hr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==Rr?t:void 0}function ir(t,r,n){if(nr(r))return r;const i=r[_t];if(!i)return Ae(r,(s,c)=>Ci(t,i,r,s,c,n)),r;if(i.scope_!==t)return r;if(!i.modified_)return ar(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let c=s,d=!1;i.type_===3&&(c=new Set(s),s.clear(),d=!0),Ae(c,(p,A)=>Ci(t,i,s,p,A,n,d)),ar(t,s,!1),n&&t.patches_&&Qt("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function Ci(t,r,n,i,s,c,d){if(process.env.NODE_ENV!=="production"&&s===n&&Z(5),Zt(s)){const p=c&&r&&r.type_!==3&&!Me(r.assigned_,i)?c.concat(i):void 0,A=ir(t,s,p);if(Ai(n,i,A),Zt(A))t.canAutoFreeze_=!1;else return}else d&&n.add(s);if($t(s)&&!nr(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;ir(t,s),(!r||!r.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&ar(t,s)}}function ar(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Fr(r,n)}function Ba(t,r){const n=Array.isArray(t),i={type_:n?1:0,scope_:r?r.scope_:Mi(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=i,c=zr;n&&(s=[i],c=Ce);const{revoke:d,proxy:p}=Proxy.revocable(s,c);return i.draft_=p,i.revoke_=d,p}var zr={get(t,r){if(r===_t)return t;const n=Jt(t);if(!Me(n,r))return Va(t,n,r);const i=n[r];return t.finalized_||!$t(i)?i:i===$r(t.base_,r)?(Yr(t),t.copy_[r]=Gr(i,t)):i},has(t,r){return r in Jt(t)},ownKeys(t){return Reflect.ownKeys(Jt(t))},set(t,r,n){const i=Ri(Jt(t),r);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const s=$r(Jt(t),r),c=s==null?void 0:s[_t];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(Ya(n,s)&&(n!==void 0||Me(t.base_,r)))return!0;Yr(t),Ur(t)}return t.copy_[r]===n&&(n!==void 0||r in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[r])||(t.copy_[r]=n,t.assigned_[r]=!0),!0},deleteProperty(t,r){return $r(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,Yr(t),Ur(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=Jt(t),i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:i.enumerable,value:n[r]}},defineProperty(){Z(11)},getPrototypeOf(t){return Vt(t.base_)},setPrototypeOf(){Z(12)}},Ce={};Ae(zr,(t,r)=>{Ce[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Ce.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&Z(13),Ce.set.call(this,t,r,void 0)},Ce.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&Z(14),zr.set.call(this,t[0],r,n,t[0])};function $r(t,r){const n=t[_t];return(n?Jt(n):t)[r]}function Va(t,r,n){var s;const i=Ri(r,n);return i?"value"in i?i.value:(s=i.get)==null?void 0:s.call(t.draft_):void 0}function Ri(t,r){if(!(r in t))return;let n=Vt(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,r);if(i)return i;n=Vt(n)}}function Ur(t){t.modified_||(t.modified_=!0,t.parent_&&Ur(t.parent_))}function Yr(t){t.copy_||(t.copy_=Lr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Za=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,n,i)=>{if(typeof r=="function"&&typeof n!="function"){const c=n;n=r;const d=this;return function(A=c,...O){return d.produce(A,S=>n.call(this,S,...O))}}typeof n!="function"&&Z(6),i!==void 0&&typeof i!="function"&&Z(7);let s;if($t(r)){const c=Oi(this),d=Gr(r,void 0);let p=!0;try{s=n(d),p=!1}finally{p?Hr(c):jr(c)}return Di(c,i),Pi(s,c)}else if(!r||typeof r!="object"){if(s=n(r),s===void 0&&(s=r),s===Rr&&(s=void 0),this.autoFreeze_&&Fr(s,!0),i){const c=[],d=[];Qt("Patches").generateReplacementPatches_(r,s,c,d),i(c,d)}return s}else Z(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(d,...p)=>this.produceWithPatches(d,A=>r(A,...p));let i,s;return[this.produce(r,n,(d,p)=>{i=d,s=p}),i,s]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){$t(t)||Z(8),Zt(t)&&(t=qa(t));const r=Oi(this),n=Gr(t,void 0);return n[_t].isManual_=!0,jr(r),n}finishDraft(t,r){const n=t&&t[_t];(!n||!n.isManual_)&&Z(9);const{scope_:i}=n;return Di(i,r),Pi(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const s=r[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(r=r.slice(n+1));const i=Qt("Patches").applyPatches_;return Zt(t)?i(t,r):this.produce(t,s=>i(s,r))}};function Gr(t,r){const n=De(t)?Qt("MapSet").proxyMap_(t,r):Oe(t)?Qt("MapSet").proxySet_(t,r):Ba(t,r);return(r?r.scope_:Mi()).drafts_.push(n),n}function qa(t){return Zt(t)||Z(10,t),xi(t)}function xi(t){if(!$t(t)||nr(t))return t;const r=t[_t];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=Lr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=Lr(t,!0);return Ae(n,(i,s)=>{Ai(n,i,xi(s))}),r&&(r.finalized_=!1),n}function Li(){process.env.NODE_ENV!=="production"&&ki.push('Sets cannot have "replace" patches.',function(m){return"Unsupported patch operation: "+m},function(m){return"Cannot apply patch, path doesn't resolve: "+m},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",i="remove";function s(m,M,D,u){switch(m.type_){case 0:case 2:return d(m,M,D,u);case 1:return c(m,M,D,u);case 3:return p(m,M,D,u)}}function c(m,M,D,u){let{base_:f,assigned_:g}=m,y=m.copy_;y.length<f.length&&([f,y]=[y,f],[D,u]=[u,D]);for(let h=0;h<f.length;h++)if(g[h]&&y[h]!==f[h]){const _=M.concat([h]);D.push({op:r,path:_,value:R(y[h])}),u.push({op:r,path:_,value:R(f[h])})}for(let h=f.length;h<y.length;h++){const _=M.concat([h]);D.push({op:n,path:_,value:R(y[h])})}for(let h=y.length-1;f.length<=h;--h){const _=M.concat([h]);u.push({op:i,path:_})}}function d(m,M,D,u){const{base_:f,copy_:g}=m;Ae(m.assigned_,(y,h)=>{const _=xr(f,y),v=xr(g,y),I=h?Me(f,y)?r:n:i;if(_===v&&I===r)return;const E=M.concat(y);D.push(I===i?{op:I,path:E}:{op:I,path:E,value:v}),u.push(I===n?{op:i,path:E}:I===i?{op:n,path:E,value:R(_)}:{op:r,path:E,value:R(_)})})}function p(m,M,D,u){let{base_:f,copy_:g}=m,y=0;f.forEach(h=>{if(!g.has(h)){const _=M.concat([y]);D.push({op:i,path:_,value:h}),u.unshift({op:n,path:_,value:h})}y++}),y=0,g.forEach(h=>{if(!f.has(h)){const _=M.concat([y]);D.push({op:n,path:_,value:h}),u.unshift({op:i,path:_,value:h})}y++})}function A(m,M,D,u){D.push({op:r,path:[],value:M===Rr?void 0:M}),u.push({op:r,path:[],value:m})}function O(m,M){return M.forEach(D=>{const{path:u,op:f}=D;let g=m;for(let v=0;v<u.length-1;v++){const I=qt(g);let E=u[v];typeof E!="string"&&typeof E!="number"&&(E=""+E),(I===0||I===1)&&(E==="__proto__"||E==="constructor")&&Z(19),typeof g=="function"&&E==="prototype"&&Z(19),g=xr(g,E),typeof g!="object"&&Z(18,u.join("/"))}const y=qt(g),h=S(D.value),_=u[u.length-1];switch(f){case r:switch(y){case 2:return g.set(_,h);case 3:Z(16);default:return g[_]=h}case n:switch(y){case 1:return _==="-"?g.push(h):g.splice(_,0,h);case 2:return g.set(_,h);case 3:return g.add(h);default:return g[_]=h}case i:switch(y){case 1:return g.splice(_,1);case 2:return g.delete(_);case 3:return g.delete(D.value);default:return delete g[_]}default:Z(17,f)}}),m}function S(m){if(!$t(m))return m;if(Array.isArray(m))return m.map(S);if(De(m))return new Map(Array.from(m.entries()).map(([D,u])=>[D,S(u)]));if(Oe(m))return new Set(Array.from(m).map(S));const M=Object.create(Vt(m));for(const D in m)M[D]=S(m[D]);return Me(m,we)&&(M[we]=m[we]),M}function R(m){return Zt(m)?S(m):m}Wa("Patches",{applyPatches_:O,generatePatches_:s,generateReplacementPatches_:A})}var gt=new Za,Ja=gt.produce;gt.produceWithPatches.bind(gt),gt.setAutoFreeze.bind(gt),gt.setUseStrictShallowCopy.bind(gt);var Qa=gt.applyPatches.bind(gt);gt.createDraft.bind(gt),gt.finishDraft.bind(gt);var ts=1/0,es=9007199254740991,rs="[object Arguments]",ns="[object Function]",is="[object GeneratorFunction]",as="[object Symbol]",ss=typeof vt=="object"&&vt&&vt.Object===Object&&vt,os=typeof self=="object"&&self&&self.Object===Object&&self,cs=ss||os||Function("return this")();function us(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function ls(t,r){for(var n=-1,i=t?t.length:0,s=Array(i);++n<i;)s[n]=r(t[n],n,t);return s}function fs(t,r){for(var n=-1,i=r.length,s=t.length;++n<i;)t[s+n]=r[n];return t}var Wr=Object.prototype,ds=Wr.hasOwnProperty,Xr=Wr.toString,Fi=cs.Symbol,ps=Wr.propertyIsEnumerable,Ni=Fi?Fi.isConcatSpreadable:void 0,Hi=Math.max;function hs(t,r,n,i,s){var c=-1,d=t.length;for(n||(n=_s),s||(s=[]);++c<d;){var p=t[c];n(p)?fs(s,p):s[s.length]=p}return s}function ms(t,r){return t=Object(t),ys(t,r,function(n,i){return i in t})}function ys(t,r,n){for(var i=-1,s=r.length,c={};++i<s;){var d=r[i],p=t[d];n(p,d)&&(c[d]=p)}return c}function Is(t,r){return r=Hi(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,s=Hi(n.length-r,0),c=Array(s);++i<s;)c[i]=n[r+i];i=-1;for(var d=Array(r+1);++i<r;)d[i]=n[i];return d[r]=c,us(t,this,d)}}function _s(t){return vs(t)||bs(t)||!!(Ni&&t&&t[Ni])}function gs(t){if(typeof t=="string"||As(t))return t;var r=t+"";return r=="0"&&1/t==-ts?"-0":r}function bs(t){return Ss(t)&&ds.call(t,"callee")&&(!ps.call(t,"callee")||Xr.call(t)==rs)}var vs=Array.isArray;function Es(t){return t!=null&&ks(t.length)&&!Ts(t)}function Ss(t){return ji(t)&&Es(t)}function Ts(t){var r=ws(t)?Xr.call(t):"";return r==ns||r==is}function ks(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=es}function ws(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function ji(t){return!!t&&typeof t=="object"}function As(t){return typeof t=="symbol"||ji(t)&&Xr.call(t)==as}var Ms=Is(function(t,r){return t==null?{}:ms(t,ls(hs(r),gs))}),Ds=Ms;const zi=Or(Ds),Os={size:{width:1080,height:1920},tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},$i=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class Ps{constructor(r){ue(this,"stateSubject");ue(this,"stateHistorySubject");ue(this,"prevState");ue(this,"undos",[]);ue(this,"redos",[]);ue(this,"listener");const n=r||Os;this.stateSubject=new Wn(n),this.stateHistorySubject=new Wn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){za(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const i=zi(r,$i),s=zi(this.getState(),$i),c=Ti(s,i);c.length&&(this.undos.push({undos:c,type:n}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(r){return this.stateHistorySubject.subscribe(r)}getState(){return this.stateSubject.getValue()}subscribe(r){return this.stateSubject.subscribe(r)}updateState(r,n={updateHistory:!1}){const i=this.getState(),s={...i,...r};it(i,s)||(n.updateHistory&&this.updateHistory(s,n.kind),this.prevState=i,this.stateSubject.next(s))}subscribeToSize(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.size,this.prevState.size)||r({size:n.size})})}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateTrackItem(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemsMap,this.prevState.trackItemsMap)||r({trackItemsMap:n.trackItemsMap})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||r({trackItemDetailsMap:n.trackItemDetailsMap})})}subscribeToDuration(r){return this.stateSubject.asObservable().subscribe(n=>{n.duration!==this.prevState.duration&&r({duration:n.duration})})}subscribeToHistory(r){return this.stateHistorySubject.asObservable().subscribe(n=>{if(n.handleRedo){const i=this.undos[this.undos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(n.handleUndo){const i=this.redos[this.redos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.tracks,this.prevState.tracks)||!it(n.transitionIds,this.prevState.transitionIds))&&r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.tracks,this.prevState.tracks)||!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.trackItemsMap,this.prevState.trackItemsMap)||!it(n.transitionIds,this.prevState.transitionIds)||!it(n.transitionsMap,this.prevState.transitionsMap)||!it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!it(n.structure,this.prevState.structure))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap,structure:n.structure})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,i=r==null?void 0:r.type;if(!n||!i)return;Li();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}=this.getState(),S=X({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}),R=[],m=[],M=[],D=[],u=[],f=[];n.forEach(w=>{let T;const j=w.path.slice(1);w.type==="CREATE"?T={path:j,op:"remove",value:w.value}:w.type==="CHANGE"?T={path:j,op:"replace",value:w.oldValue}:T={path:j,op:"add",value:w.oldValue},w.path.includes("trackItemIds")?M.push(T):w.path.includes("transitionIds")?m.push(T):w.path.includes("trackItemsMap")?u.push(T):w.path.includes("transitionsMap")?D.push(T):w.path.includes("tracks")?R.push(T):w.path.includes("trackItemDetailsMap")&&f.push(T)});const g=this.applyPatch(S.tracks,R),y=this.applyPatch(S.transitionIds,m),h=this.applyPatch(S.trackItemIds,M),_=this.applyPatch(S.transitionsMap,D),v=this.applyPatch(S.trackItemsMap,u),I=this.applyPatch(S.trackItemDetailsMap,f),E=X({tracks:g,transitionIds:y,trackItemIds:h,transitionsMap:_,trackItemsMap:v,trackItemDetailsMap:I}),Y=X(this.getState()),x={...Y,...E};this.prevState=Y,this.redos.push({redos:n,type:i});const C=Bt(x.trackItemsMap);this.stateSubject.next({...x,duration:C}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((i,s)=>Ja(i,c=>{Qa(c,[s])}),r)}redo(){const r=this.redos.pop(),n=r==null?void 0:r.redos,i=r==null?void 0:r.type;if(!n||!i)return;Li();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}=this.getState(),S=X({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}),R=[],m=[],M=[],D=[],u=[],f=[];n.forEach(w=>{let T;const j=w.path.slice(1);w.type==="CREATE"?T={path:j,op:"add",value:w.value}:w.type==="CHANGE"?T={path:j,op:"replace",value:w.value}:T={path:j,op:"remove",value:w.oldValue},w.path.includes("trackItemIds")?M.push(T):w.path.includes("transitionIds")?m.push(T):w.path.includes("trackItemsMap")?u.push(T):w.path.includes("transitionsMap")?D.push(T):w.path.includes("trackItemDetailsMap")?f.push(T):R.push(T)});const g=this.applyPatch(S.tracks,R),y=this.applyPatch(S.transitionIds,m),h=this.applyPatch(S.trackItemIds,M),_=this.applyPatch(S.transitionsMap,D),v=this.applyPatch(S.trackItemsMap,u),I=this.applyPatch(S.trackItemDetailsMap,f),E=X({tracks:g,transitionIds:y,trackItemIds:h,transitionsMap:_,trackItemsMap:v,trackItemDetailsMap:I}),Y=X(this.getState()),x={...Y,...E};this.prevState=Y,this.undos.push({undos:n,type:i});const C=Bt(x.trackItemsMap);this.stateSubject.next({...x,duration:C}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}b.ACTIVE_CLONE=oi,b.ACTIVE_DELETE=ma,b.ACTIVE_PASTE=si,b.ACTIVE_PREFIX=Kt,b.ACTIVE_SET=ha,b.ACTIVE_SPLIT=ci,b.ADD_ANIMATION=ca,b.ADD_AUDIO=Qn,b.ADD_CAPTION=ei,b.ADD_IMAGE=ti,b.ADD_ITEMS=ni,b.ADD_MASK=sa,b.ADD_PLACEHOLDER=aa,b.ADD_PREFIX=It,b.ADD_SUFFIX=ea,b.ADD_TEMPLATE=ri,b.ADD_TEXT=qn,b.ADD_TRANSITION=oa,b.ADD_VIDEO=Jn,b.DELETE_TEMPLATE_ITEM=da,b.DESIGN_LOAD=Vn,b.DESIGN_PREFIX=qe,b.DESIGN_RESIZE=Zn,b.EDIT_OBJECT=ii,b.EDIT_PREFIX=zt,b.EDIT_SHAPE=la,b.EDIT_TEMPLATE_ITEM=fa,b.EDIT_TEXT=ua,b.ENTER_EDIT_MODE=pa,b.HISTORY_PREFIX=Te,b.HISTORY_REDO=di,b.HISTORY_RESET=Ma,b.HISTORY_UNDO=fi,b.LAYER_CLONE=ui,b.LAYER_COPY=Ta,b.LAYER_CUT=Aa,b.LAYER_DELETE=li,b.LAYER_EDITING_NAME=Sa,b.LAYER_HIDDEN=Ia,b.LAYER_LOCKED=ya,b.LAYER_MOVE=_a,b.LAYER_PASTE=ka,b.LAYER_PREFIX=at,b.LAYER_RENAME=Ea,b.LAYER_SELECT=ga,b.LAYER_SELECTION=ba,b.LAYER_SEND_TO=va,b.LAYER_SPLIT=wa,b.REPLACE_MEDIA=ai,b.STATE_CHANGED=ia,b.STATE_PREFIX=Bn,b.TIMELINE_SCALE_CHANGED=pi,b.TIMELINE_SCALE_PREFIX=Pr,b.TRACKS_CHANGED=ra,b.TRACK_ITEMS_CHANGED=na,b.TRACK_ITEMS_PREFIX=Kn,b.TRACK_PREFIX=Xn,b.default=Ps,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ar(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var Be=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,n,i,s,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var p=Sr(d),A=p.next();!A.done;A=p.next()){var O=A.value;O.remove(this)}}catch(u){r={error:u}}finally{try{A&&!A.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}else d.remove(this);var S=this.initialTeardown;if(xt(S))try{S()}catch(u){c=u instanceof wr?u.errors:[u]}var R=this._finalizers;if(R){this._finalizers=null;try{for(var m=Sr(R),M=m.next();!M.done;M=m.next()){var D=M.value;try{Fn(D)}catch(u){c=c??[],u instanceof wr?c=kr(kr([],Tr(c)),Tr(u.errors)):c.push(u)}}}catch(u){i={error:u}}finally{try{M&&!M.done&&(s=m.return)&&s.call(m)}finally{if(i)throw i.error}}}if(c)throw new wr(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)Fn(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(r)}},t.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},t.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},t.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&Ar(n,r)},t.prototype.remove=function(r){var n=this._finalizers;n&&Ar(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),xn=Be.EMPTY;function Ln(t){return t instanceof Be||t&&"closed"in t&&xt(t.remove)&&xt(t.add)&&xt(t.unsubscribe)}function Fn(t){xt(t)?t():t.unsubscribe()}var Nn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Hn={setTimeout:function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,kr([t,r],Tr(n)))},clearTimeout:function(t){var r=Hn.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Yi(t){Hn.setTimeout(function(){throw t})}function jn(){}function Ve(t){t()}var zn=function(t){Te(r,t);function r(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Ln(n)&&n.add(i)):i.destination=Ki,i}return r.create=function(n,i,s){return new Dr(n,i,s)},r.prototype.next=function(n){this.isStopped||this._next(n)},r.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(Be),Gi=Function.prototype.bind;function Mr(t,r){return Gi.call(t,r)}var Wi=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var n=this.partialObserver;if(n.next)try{n.next(r)}catch(i){Ze(i)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(i){Ze(i)}else Ze(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){Ze(n)}},t}(),Dr=function(t){Te(r,t);function r(n,i,s){var c=t.call(this)||this,d;if(xt(n)||!n)d={next:n??void 0,error:i??void 0,complete:s??void 0};else{var p;c&&Nn.useDeprecatedNextContext?(p=Object.create(n),p.unsubscribe=function(){return c.unsubscribe()},d={next:n.next&&Mr(n.next,p),error:n.error&&Mr(n.error,p),complete:n.complete&&Mr(n.complete,p)}):d=n}return c.destination=new Wi(d),c}return r}(zn);function Ze(t){Yi(t)}function Xi(t){throw t}var Ki={closed:!0,next:jn,error:Xi,complete:jn},Bi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Vi(t){return t}function Zi(t){return t.length===0?Vi:t.length===1?t[0]:function(n){return t.reduce(function(i,s){return s(i)},n)}}var $n=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(r,n,i){var s=this,c=Ji(r)?r:new Dr(r,n,i);return Ve(function(){var d=s,p=d.operator,A=d.source;c.add(p?p.call(c,A):A?s._subscribe(c):s._trySubscribe(c))}),c},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},t.prototype.forEach=function(r,n){var i=this;return n=Un(n),new n(function(s,c){var d=new Dr({next:function(p){try{r(p)}catch(A){c(A),d.unsubscribe()}},error:c,complete:s});i.subscribe(d)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[Bi]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Zi(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Un(r),new r(function(i,s){var c;n.subscribe(function(d){return c=d},function(d){return s(d)},function(){return i(c)})})},t.create=function(r){return new t(r)},t}();function Un(t){var r;return(r=t??Nn.Promise)!==null&&r!==void 0?r:Promise}function qi(t){return t&&xt(t.next)&&xt(t.error)&&xt(t.complete)}function Ji(t){return t&&t instanceof zn||qi(t)&&Ln(t)}var Qi=Rn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Yn=function(t){Te(r,t);function r(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return r.prototype.lift=function(n){var i=new Gn(this,this);return i.operator=n,i},r.prototype._throwIfClosed=function(){if(this.closed)throw new Qi},r.prototype.next=function(n){var i=this;Ve(function(){var s,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Sr(i.currentObservers),p=d.next();!p.done;p=d.next()){var A=p.value;A.next(n)}}catch(O){s={error:O}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(s)throw s.error}}}})},r.prototype.error=function(n){var i=this;Ve(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var s=i.observers;s.length;)s.shift().error(n)}})},r.prototype.complete=function(){var n=this;Ve(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var i=this,s=this,c=s.hasError,d=s.isStopped,p=s.observers;return c||d?xn:(this.currentObservers=null,p.push(n),new Be(function(){i.currentObservers=null,Ar(p,n)}))},r.prototype._checkFinalizedStatuses=function(n){var i=this,s=i.hasError,c=i.thrownError,d=i.isStopped;s?n.error(c):d&&n.complete()},r.prototype.asObservable=function(){var n=new $n;return n.source=this,n},r.create=function(n,i){return new Gn(n,i)},r}($n),Gn=function(t){Te(r,t);function r(n,i){var s=t.call(this)||this;return s.destination=n,s.source=i,s}return r.prototype.next=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,n)},r.prototype.error=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,n)},r.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},r.prototype._subscribe=function(n){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&s!==void 0?s:xn},r}(Yn),Wn=function(t){Te(r,t);function r(n){var i=t.call(this)||this;return i._value=n,i}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(n){var i=t.prototype._subscribe.call(this,n);return!i.closed&&n.next(this._value),i},r.prototype.getValue=function(){var n=this,i=n.hasError,s=n.thrownError,c=n._value;if(i)throw s;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Yn),Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qe={exports:{}};qe.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=1,c=2,d=9007199254740991,p="[object Arguments]",A="[object Array]",O="[object AsyncFunction]",S="[object Boolean]",R="[object Date]",m="[object Error]",M="[object Function]",D="[object GeneratorFunction]",u="[object Map]",f="[object Number]",_="[object Null]",g="[object Object]",y="[object Promise]",h="[object Proxy]",v="[object RegExp]",I="[object Set]",E="[object String]",U="[object Symbol]",x="[object Undefined]",C="[object WeakMap]",w="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",J="[object Float64Array]",tt="[object Int8Array]",Ut="[object Int16Array]",Yt="[object Int32Array]",bt="[object Uint8Array]",ee="[object Uint8ClampedArray]",F="[object Uint16Array]",W="[object Uint32Array]",dt=/[\\^$.*+?()[\]{}|]/g,K=/^\[object .+?Constructor\]$/,St=/^(?:0|[1-9]\d*)$/,N={};N[j]=N[J]=N[tt]=N[Ut]=N[Yt]=N[bt]=N[ee]=N[F]=N[W]=!0,N[p]=N[A]=N[w]=N[S]=N[T]=N[R]=N[m]=N[M]=N[u]=N[f]=N[g]=N[v]=N[I]=N[E]=N[C]=!1;var wt=typeof Et=="object"&&Et&&Et.Object===Object&&Et,he=typeof self=="object"&&self&&self.Object===Object&&self,pt=wt||he||Function("return this")(),re=r&&!r.nodeType&&r,ne=re&&!0&&t&&!t.nodeType&&t,G=ne&&ne.exports===re,B=G&&wt.process,L=function(){try{return B&&B.binding&&B.binding("util")}catch{}}(),ht=L&&L.isTypedArray;function lt(e,a){for(var o=-1,l=e==null?0:e.length,P=0,k=[];++o<l;){var z=e[o];a(z,o,e)&&(k[P++]=z)}return k}function et(e,a){for(var o=-1,l=a.length,P=e.length;++o<l;)e[P+o]=a[o];return e}function vt(e,a){for(var o=-1,l=e==null?0:e.length;++o<l;)if(a(e[o],o,e))return!0;return!1}function st(e,a){for(var o=-1,l=Array(e);++o<e;)l[o]=a(o);return l}function ie(e){return function(a){return e(a)}}function Gt(e,a){return e.has(a)}function V(e,a){return e==null?void 0:e[a]}function At(e){var a=-1,o=Array(e.size);return e.forEach(function(l,P){o[++a]=[P,l]}),o}function Wt(e,a){return function(o){return e(a(o))}}function Tt(e){var a=-1,o=Array(e.size);return e.forEach(function(l){o[++a]=l}),o}var Ot=Array.prototype,Kr=Function.prototype,ae=Object.prototype,me=pt["__core-js_shared__"],xe=Kr.toString,kt=ae.hasOwnProperty,or=function(){var e=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),cr=ae.toString,Br=RegExp("^"+xe.call(kt).replace(dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=G?pt.Buffer:void 0,ye=pt.Symbol,ur=pt.Uint8Array,Ie=ae.propertyIsEnumerable,se=Ot.splice,Mt=ye?ye.toStringTag:void 0,_e=Object.getOwnPropertySymbols,Fe=Le?Le.isBuffer:void 0,oe=Wt(Object.keys,Object),Ne=Ft(pt,"DataView"),ce=Ft(pt,"Map"),He=Ft(pt,"Promise"),je=Ft(pt,"Set"),ze=Ft(pt,"WeakMap"),Xt=Ft(Object,"create"),lr=ft(Ne),Lt=ft(ce),Vr=ft(He),Zr=ft(je),qr=ft(ze),fr=ye?ye.prototype:void 0,$e=fr?fr.valueOf:void 0;function rt(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Jr(){this.__data__=Xt?Xt(null):{},this.size=0}function Qr(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}function tn(e){var a=this.__data__;if(Xt){var o=a[e];return o===i?void 0:o}return kt.call(a,e)?a[e]:void 0}function en(e){var a=this.__data__;return Xt?a[e]!==void 0:kt.call(a,e)}function rn(e,a){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Xt&&a===void 0?i:a,this}rt.prototype.clear=Jr,rt.prototype.delete=Qr,rt.prototype.get=tn,rt.prototype.has=en,rt.prototype.set=rn;function ot(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function nn(){this.__data__=[],this.size=0}function an(e){var a=this.__data__,o=ve(a,e);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():se.call(a,o,1),--this.size,!0}function sn(e){var a=this.__data__,o=ve(a,e);return o<0?void 0:a[o][1]}function on(e){return ve(this.__data__,e)>-1}function cn(e,a){var o=this.__data__,l=ve(o,e);return l<0?(++this.size,o.push([e,a])):o[l][1]=a,this}ot.prototype.clear=nn,ot.prototype.delete=an,ot.prototype.get=sn,ot.prototype.has=on,ot.prototype.set=cn;function mt(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function un(){this.size=0,this.__data__={hash:new rt,map:new(ce||ot),string:new rt}}function ln(e){var a=Dt(this,e).delete(e);return this.size-=a?1:0,a}function fn(e){return Dt(this,e).get(e)}function dn(e){return Dt(this,e).has(e)}function pn(e,a){var o=Dt(this,e),l=o.size;return o.set(e,a),this.size+=o.size==l?0:1,this}mt.prototype.clear=un,mt.prototype.delete=ln,mt.prototype.get=fn,mt.prototype.has=dn,mt.prototype.set=pn;function ge(e){var a=-1,o=e==null?0:e.length;for(this.__data__=new mt;++a<o;)this.add(e[a])}function dr(e){return this.__data__.set(e,i),this}function be(e){return this.__data__.has(e)}ge.prototype.add=ge.prototype.push=dr,ge.prototype.has=be;function Pt(e){var a=this.__data__=new ot(e);this.size=a.size}function Ue(){this.__data__=new ot,this.size=0}function hn(e){var a=this.__data__,o=a.delete(e);return this.size=a.size,o}function mn(e){return this.__data__.get(e)}function yn(e){return this.__data__.has(e)}function In(e,a){var o=this.__data__;if(o instanceof ot){var l=o.__data__;if(!ce||l.length<n-1)return l.push([e,a]),this.size=++o.size,this;o=this.__data__=new mt(l)}return o.set(e,a),this.size=o.size,this}Pt.prototype.clear=Ue,Pt.prototype.delete=hn,Pt.prototype.get=mn,Pt.prototype.has=yn,Pt.prototype.set=In;function _n(e,a){var o=Ee(e),l=!o&&Ir(e),P=!o&&!l&&Se(e),k=!o&&!l&&!P&&br(e),z=o||l||P||k,H=z?st(e.length,String):[],Z=H.length;for(var $ in e)kt.call(e,$)&&!(z&&($=="length"||P&&($=="offset"||$=="parent")||k&&($=="buffer"||$=="byteLength"||$=="byteOffset")||wn($,Z)))&&H.push($);return H}function ve(e,a){for(var o=e.length;o--;)if(yr(e[o][0],a))return o;return-1}function Ye(e,a,o){var l=a(e);return Ee(e)?l:et(l,o(e))}function ue(e){return e==null?e===void 0?x:_:Mt&&Mt in Object(e)?Nt(e):mr(e)}function pr(e){return Rt(e)&&ue(e)==p}function hr(e,a,o,l,P){return e===a?!0:e==null||a==null||!Rt(e)&&!Rt(a)?e!==e&&a!==a:gn(e,a,o,l,hr,P)}function gn(e,a,o,l,P,k){var z=Ee(e),H=Ee(a),Z=z?A:Ct(e),$=H?A:Ct(a);Z=Z==p?g:Z,$=$==p?g:$;var ct=Z==g,yt=$==g,Q=Z==$;if(Q&&Se(e)){if(!Se(a))return!1;z=!0,ct=!1}if(Q&&!ct)return k||(k=new Pt),z||br(e)?Ge(e,a,o,l,P,k):Sn(e,a,Z,o,l,P,k);if(!(o&s)){var ut=ct&&kt.call(e,"__wrapped__"),nt=yt&&kt.call(a,"__wrapped__");if(ut||nt){var Kt=ut?e.value():e,Ht=nt?a.value():a;return k||(k=new Pt),P(Kt,Ht,o,l,k)}}return Q?(k||(k=new Pt),Tn(e,a,o,l,P,k)):!1}function bn(e){if(!gr(e)||Mn(e))return!1;var a=_r(e)?Br:K;return a.test(ft(e))}function vn(e){return Rt(e)&&Xe(e.length)&&!!N[ue(e)]}function En(e){if(!Dn(e))return oe(e);var a=[];for(var o in Object(e))kt.call(e,o)&&o!="constructor"&&a.push(o);return a}function Ge(e,a,o,l,P,k){var z=o&s,H=e.length,Z=a.length;if(H!=Z&&!(z&&Z>H))return!1;var $=k.get(e);if($&&k.get(a))return $==a;var ct=-1,yt=!0,Q=o&c?new ge:void 0;for(k.set(e,a),k.set(a,e);++ct<H;){var ut=e[ct],nt=a[ct];if(l)var Kt=z?l(nt,ut,ct,a,e,k):l(ut,nt,ct,e,a,k);if(Kt!==void 0){if(Kt)continue;yt=!1;break}if(Q){if(!vt(a,function(Ht,fe){if(!Gt(Q,fe)&&(ut===Ht||P(ut,Ht,o,l,k)))return Q.push(fe)})){yt=!1;break}}else if(!(ut===nt||P(ut,nt,o,l,k))){yt=!1;break}}return k.delete(e),k.delete(a),yt}function Sn(e,a,o,l,P,k,z){switch(o){case T:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case w:return!(e.byteLength!=a.byteLength||!k(new ur(e),new ur(a)));case S:case R:case f:return yr(+e,+a);case m:return e.name==a.name&&e.message==a.message;case v:case E:return e==a+"";case u:var H=At;case I:var Z=l&s;if(H||(H=Tt),e.size!=a.size&&!Z)return!1;var $=z.get(e);if($)return $==a;l|=c,z.set(e,a);var ct=Ge(H(e),H(a),l,P,k,z);return z.delete(e),ct;case U:if($e)return $e.call(e)==$e.call(a)}return!1}function Tn(e,a,o,l,P,k){var z=o&s,H=le(e),Z=H.length,$=le(a),ct=$.length;if(Z!=ct&&!z)return!1;for(var yt=Z;yt--;){var Q=H[yt];if(!(z?Q in a:kt.call(a,Q)))return!1}var ut=k.get(e);if(ut&&k.get(a))return ut==a;var nt=!0;k.set(e,a),k.set(a,e);for(var Kt=z;++yt<Z;){Q=H[yt];var Ht=e[Q],fe=a[Q];if(l)var Ui=z?l(fe,Ht,Q,a,e,k):l(Ht,fe,Q,e,a,k);if(!(Ui===void 0?Ht===fe||P(Ht,fe,o,l,k):Ui)){nt=!1;break}Kt||(Kt=Q=="constructor")}if(nt&&!Kt){var vr=e.constructor,Er=a.constructor;vr!=Er&&"constructor"in e&&"constructor"in a&&!(typeof vr=="function"&&vr instanceof vr&&typeof Er=="function"&&Er instanceof Er)&&(nt=!1)}return k.delete(e),k.delete(a),nt}function le(e){return Ye(e,Ke,kn)}function Dt(e,a){var o=e.__data__;return An(a)?o[typeof a=="string"?"string":"hash"]:o.map}function Ft(e,a){var o=V(e,a);return bn(o)?o:void 0}function Nt(e){var a=kt.call(e,Mt),o=e[Mt];try{e[Mt]=void 0;var l=!0}catch{}var P=cr.call(e);return l&&(a?e[Mt]=o:delete e[Mt]),P}var kn=_e?function(e){return e==null?[]:(e=Object(e),lt(_e(e),function(a){return Ie.call(e,a)}))}:Pn,Ct=ue;(Ne&&Ct(new Ne(new ArrayBuffer(1)))!=T||ce&&Ct(new ce)!=u||He&&Ct(He.resolve())!=y||je&&Ct(new je)!=I||ze&&Ct(new ze)!=C)&&(Ct=function(e){var a=ue(e),o=a==g?e.constructor:void 0,l=o?ft(o):"";if(l)switch(l){case lr:return T;case Lt:return u;case Vr:return y;case Zr:return I;case qr:return C}return a});function wn(e,a){return a=a??d,!!a&&(typeof e=="number"||St.test(e))&&e>-1&&e%1==0&&e<a}function An(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Mn(e){return!!or&&or in e}function Dn(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||ae;return e===o}function mr(e){return cr.call(e)}function ft(e){if(e!=null){try{return xe.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e,a){return e===a||e!==e&&a!==a}var Ir=pr(function(){return arguments}())?pr:function(e){return Rt(e)&&kt.call(e,"callee")&&!Ie.call(e,"callee")},Ee=Array.isArray;function We(e){return e!=null&&Xe(e.length)&&!_r(e)}var Se=Fe||Cn;function On(e,a){return hr(e,a)}function _r(e){if(!gr(e))return!1;var a=ue(e);return a==M||a==D||a==O||a==h}function Xe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=d}function gr(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}function Rt(e){return e!=null&&typeof e=="object"}var br=ht?ie(ht):vn;function Ke(e){return We(e)?_n(e):En(e)}function Pn(){return[]}function Cn(){return!1}t.exports=On}(qe,qe.exports);var ta=qe.exports;const it=Or(ta),ea="add",Xn="track",Kn="trackItems",ra=`${Xn}:changed`,na=`${Kn}:changed`,Bn="state",ia=`${Bn}:changed`,Je="design",Vn=`${Je}:load`,Zn=`${Je}:resize`,It="add",qn=`${It}:text`,Jn=`${It}:video`,Qn=`${It}:audio`,aa=`${It}:placeholder`,ti=`${It}:image`,sa=`${It}:mask`,oa=`${It}:transition`,ca=`${It}:animation`,ei=`${It}:caption`,ri=`${It}:template`,ni=`${It}:items`,zt="edit",ii=`${zt}:object`,ai=`${zt}:replaceMedia`,ua=`${zt}:text`,la=`${zt}:shape`,fa=`${zt}:templateItem`,da=`${zt}:deleteTemplateItem`,pa="enterEditMode",Bt="active",ha=`${Bt}:set`,ma=`${Bt}:delete`,si=`${Bt}:paste`,oi=`${Bt}:clone`,ci=`${Bt}:split`,at="layer",ya=`${at}:locked`,Ia=`${at}:hidden`,_a=`${at}:move`,ga=`${at}:select`,ba=`${at}:selection`,va=`${at}:sendTo`,Ea=`${at}:rename`,Sa=`${at}:editingName`,Ta=`${at}:copy`,ka=`${at}:paste`,ui=`${at}:clone`,wa=`${at}:split`,Aa=`${at}:cut`,li=`${at}:delete`,ke="history",fi=`${ke}:undo`,di=`${ke}:redo`,Ma=`${ke}:reset`,Pr="scale",pi=`${Pr}:changed`;var Qe={exports:{}};Qe.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,c="[object Arguments]",d="[object Array]",p="[object Boolean]",A="[object Date]",O="[object Error]",S="[object Function]",R="[object GeneratorFunction]",m="[object Map]",M="[object Number]",D="[object Object]",u="[object Promise]",f="[object RegExp]",_="[object Set]",g="[object String]",y="[object Symbol]",h="[object WeakMap]",v="[object ArrayBuffer]",I="[object DataView]",E="[object Float32Array]",U="[object Float64Array]",x="[object Int8Array]",C="[object Int16Array]",w="[object Int32Array]",T="[object Uint8Array]",j="[object Uint8ClampedArray]",J="[object Uint16Array]",tt="[object Uint32Array]",Ut=/[\\^$.*+?()[\]{}|]/g,Yt=/\w*$/,bt=/^\[object .+?Constructor\]$/,ee=/^(?:0|[1-9]\d*)$/,F={};F[c]=F[d]=F[v]=F[I]=F[p]=F[A]=F[E]=F[U]=F[x]=F[C]=F[w]=F[m]=F[M]=F[D]=F[f]=F[_]=F[g]=F[y]=F[T]=F[j]=F[J]=F[tt]=!0,F[O]=F[S]=F[h]=!1;var W=typeof Et=="object"&&Et&&Et.Object===Object&&Et,dt=typeof self=="object"&&self&&self.Object===Object&&self,K=W||dt||Function("return this")(),St=r&&!r.nodeType&&r,N=St&&!0&&t&&!t.nodeType&&t,wt=N&&N.exports===St;function he(e,a){return e.set(a[0],a[1]),e}function pt(e,a){return e.add(a),e}function re(e,a){for(var o=-1,l=e?e.length:0;++o<l&&a(e[o],o,e)!==!1;);return e}function ne(e,a){for(var o=-1,l=a.length,P=e.length;++o<l;)e[P+o]=a[o];return e}function G(e,a,o,l){for(var P=-1,k=e?e.length:0;++P<k;)o=a(o,e[P],P,e);return o}function B(e,a){for(var o=-1,l=Array(e);++o<e;)l[o]=a(o);return l}function L(e,a){return e==null?void 0:e[a]}function ht(e){var a=!1;if(e!=null&&typeof e.toString!="function")try{a=!!(e+"")}catch{}return a}function lt(e){var a=-1,o=Array(e.size);return e.forEach(function(l,P){o[++a]=[P,l]}),o}function et(e,a){return function(o){return e(a(o))}}function vt(e){var a=-1,o=Array(e.size);return e.forEach(function(l){o[++a]=l}),o}var st=Array.prototype,ie=Function.prototype,Gt=Object.prototype,V=K["__core-js_shared__"],At=function(){var e=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Wt=ie.toString,Tt=Gt.hasOwnProperty,Ot=Gt.toString,Kr=RegExp("^"+Wt.call(Tt).replace(Ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ae=wt?K.Buffer:void 0,me=K.Symbol,xe=K.Uint8Array,kt=et(Object.getPrototypeOf,Object),or=Object.create,cr=Gt.propertyIsEnumerable,Br=st.splice,Le=Object.getOwnPropertySymbols,ye=ae?ae.isBuffer:void 0,ur=et(Object.keys,Object),Ie=Dt(K,"DataView"),se=Dt(K,"Map"),Mt=Dt(K,"Promise"),_e=Dt(K,"Set"),Fe=Dt(K,"WeakMap"),oe=Dt(Object,"create"),Ne=ft(Ie),ce=ft(se),He=ft(Mt),je=ft(_e),ze=ft(Fe),Xt=me?me.prototype:void 0,lr=Xt?Xt.valueOf:void 0;function Lt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Vr(){this.__data__=oe?oe(null):{}}function Zr(e){return this.has(e)&&delete this.__data__[e]}function qr(e){var a=this.__data__;if(oe){var o=a[e];return o===i?void 0:o}return Tt.call(a,e)?a[e]:void 0}function fr(e){var a=this.__data__;return oe?a[e]!==void 0:Tt.call(a,e)}function $e(e,a){var o=this.__data__;return o[e]=oe&&a===void 0?i:a,this}Lt.prototype.clear=Vr,Lt.prototype.delete=Zr,Lt.prototype.get=qr,Lt.prototype.has=fr,Lt.prototype.set=$e;function rt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function Jr(){this.__data__=[]}function Qr(e){var a=this.__data__,o=be(a,e);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():Br.call(a,o,1),!0}function tn(e){var a=this.__data__,o=be(a,e);return o<0?void 0:a[o][1]}function en(e){return be(this.__data__,e)>-1}function rn(e,a){var o=this.__data__,l=be(o,e);return l<0?o.push([e,a]):o[l][1]=a,this}rt.prototype.clear=Jr,rt.prototype.delete=Qr,rt.prototype.get=tn,rt.prototype.has=en,rt.prototype.set=rn;function ot(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var l=e[a];this.set(l[0],l[1])}}function nn(){this.__data__={hash:new Lt,map:new(se||rt),string:new Lt}}function an(e){return le(this,e).delete(e)}function sn(e){return le(this,e).get(e)}function on(e){return le(this,e).has(e)}function cn(e,a){return le(this,e).set(e,a),this}ot.prototype.clear=nn,ot.prototype.delete=an,ot.prototype.get=sn,ot.prototype.has=on,ot.prototype.set=cn;function mt(e){this.__data__=new rt(e)}function un(){this.__data__=new rt}function ln(e){return this.__data__.delete(e)}function fn(e){return this.__data__.get(e)}function dn(e){return this.__data__.has(e)}function pn(e,a){var o=this.__data__;if(o instanceof rt){var l=o.__data__;if(!se||l.length<n-1)return l.push([e,a]),this;o=this.__data__=new ot(l)}return o.set(e,a),this}mt.prototype.clear=un,mt.prototype.delete=ln,mt.prototype.get=fn,mt.prototype.has=dn,mt.prototype.set=pn;function ge(e,a){var o=We(e)||Ee(e)?B(e.length,String):[],l=o.length,P=!!l;for(var k in e)Tt.call(e,k)&&!(P&&(k=="length"||An(k,l)))&&o.push(k);return o}function dr(e,a,o){var l=e[a];(!(Tt.call(e,a)&&Ir(l,o))||o===void 0&&!(a in e))&&(e[a]=o)}function be(e,a){for(var o=e.length;o--;)if(Ir(e[o][0],a))return o;return-1}function Pt(e,a){return e&&Ge(a,Ke(a),e)}function Ue(e,a,o,l,P,k,z){var H;if(l&&(H=k?l(e,P,k,z):l(e)),H!==void 0)return H;if(!Rt(e))return e;var Z=We(e);if(Z){if(H=kn(e),!a)return En(e,H)}else{var $=Nt(e),ct=$==S||$==R;if(_r(e))return ve(e,a);if($==D||$==c||ct&&!k){if(ht(e))return k?e:{};if(H=Ct(ct?{}:e),!a)return Sn(e,Pt(H,e))}else{if(!F[$])return k?e:{};H=wn(e,$,Ue,a)}}z||(z=new mt);var yt=z.get(e);if(yt)return yt;if(z.set(e,H),!Z)var Q=o?Tn(e):Ke(e);return re(Q||e,function(ut,nt){Q&&(nt=ut,ut=e[nt]),dr(H,nt,Ue(ut,a,o,l,nt,e,z))}),H}function hn(e){return Rt(e)?or(e):{}}function mn(e,a,o){var l=a(e);return We(e)?l:ne(l,o(e))}function yn(e){return Ot.call(e)}function In(e){if(!Rt(e)||Dn(e))return!1;var a=Xe(e)||ht(e)?Kr:bt;return a.test(ft(e))}function _n(e){if(!mr(e))return ur(e);var a=[];for(var o in Object(e))Tt.call(e,o)&&o!="constructor"&&a.push(o);return a}function ve(e,a){if(a)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}function Ye(e){var a=new e.constructor(e.byteLength);return new xe(a).set(new xe(e)),a}function ue(e,a){var o=a?Ye(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}function pr(e,a,o){var l=a?o(lt(e),!0):lt(e);return G(l,he,new e.constructor)}function hr(e){var a=new e.constructor(e.source,Yt.exec(e));return a.lastIndex=e.lastIndex,a}function gn(e,a,o){var l=a?o(vt(e),!0):vt(e);return G(l,pt,new e.constructor)}function bn(e){return lr?Object(lr.call(e)):{}}function vn(e,a){var o=a?Ye(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function En(e,a){var o=-1,l=e.length;for(a||(a=Array(l));++o<l;)a[o]=e[o];return a}function Ge(e,a,o,l){o||(o={});for(var P=-1,k=a.length;++P<k;){var z=a[P],H=void 0;dr(o,z,H===void 0?e[z]:H)}return o}function Sn(e,a){return Ge(e,Ft(e),a)}function Tn(e){return mn(e,Ke,Ft)}function le(e,a){var o=e.__data__;return Mn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function Dt(e,a){var o=L(e,a);return In(o)?o:void 0}var Ft=Le?et(Le,Object):Pn,Nt=yn;(Ie&&Nt(new Ie(new ArrayBuffer(1)))!=I||se&&Nt(new se)!=m||Mt&&Nt(Mt.resolve())!=u||_e&&Nt(new _e)!=_||Fe&&Nt(new Fe)!=h)&&(Nt=function(e){var a=Ot.call(e),o=a==D?e.constructor:void 0,l=o?ft(o):void 0;if(l)switch(l){case Ne:return I;case ce:return m;case He:return u;case je:return _;case ze:return h}return a});function kn(e){var a=e.length,o=e.constructor(a);return a&&typeof e[0]=="string"&&Tt.call(e,"index")&&(o.index=e.index,o.input=e.input),o}function Ct(e){return typeof e.constructor=="function"&&!mr(e)?hn(kt(e)):{}}function wn(e,a,o,l){var P=e.constructor;switch(a){case v:return Ye(e);case p:case A:return new P(+e);case I:return ue(e,l);case E:case U:case x:case C:case w:case T:case j:case J:case tt:return vn(e,l);case m:return pr(e,l,o);case M:case g:return new P(e);case f:return hr(e);case _:return gn(e,l,o);case y:return bn(e)}}function An(e,a){return a=a??s,!!a&&(typeof e=="number"||ee.test(e))&&e>-1&&e%1==0&&e<a}function Mn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Dn(e){return!!At&&At in e}function mr(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||Gt;return e===o}function ft(e){if(e!=null){try{return Wt.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e){return Ue(e,!0,!0)}function Ir(e,a){return e===a||e!==e&&a!==a}function Ee(e){return On(e)&&Tt.call(e,"callee")&&(!cr.call(e,"callee")||Ot.call(e)==c)}var We=Array.isArray;function Se(e){return e!=null&&gr(e.length)&&!Xe(e)}function On(e){return br(e)&&Se(e)}var _r=ye||Cn;function Xe(e){var a=Rt(e)?Ot.call(e):"";return a==S||a==R}function gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s}function Rt(e){var a=typeof e;return!!e&&(a=="object"||a=="function")}function br(e){return!!e&&typeof e=="object"}function Ke(e){return Se(e)?ge(e):_n(e)}function Pn(){return[]}function Cn(){return!1}t.exports=yr}(Qe,Qe.exports);var Da=Qe.exports;const X=Or(Da),hi=t=>new Promise((r,n)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const s=i.width,c=i.height;r({width:s,height:c})},i.onerror=s=>{n(s)},i.crossOrigin="anonymous",i.src=t}),Oa=t=>new Promise((r,n)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3;r({duration:s})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.crossOrigin="anonymous",i.load()}),mi=t=>new Promise((r,n)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;r({duration:s,width:c,height:d})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.load()}),yi=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(s=>{s!=="height"&&(n.style[s]=r[s])}),document.body.appendChild(n),n.textContent=t,n.style.whiteSpace="normal",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.width=r.width+"px",n.style.fontSize=r.fontSize+"px";const i=getComputedStyle(n).height;return document.body.removeChild(n),parseFloat(i)},tr=t=>{const r=t.map(n=>new FontFace(n.fontFamily,`url(${n.url})`).load().catch(i=>i));return r.length===0?Promise.resolve(!0):new Promise((n,i)=>{Promise.all(r).then(s=>{s.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(s=>i(s))})},Pa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let er=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=Pa[n[t]&63];return r};function pe(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let i=er(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+i}const rr={color:"#000000",x:0,y:0,blur:0},we=(t,r)=>{let n=r!=null&&r.trim?r.trim.to-r.trim.from:(r==null?void 0:r.duration)||5e3;const i={from:0,to:n};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+n};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Ii=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function nr(t,r){const n=t.scaleMode,i={x:t.size.width/2,y:t.size.height/2},s={x:r.width/2,y:r.height/2};let c;n==="fill"?c=Math.max(t.size.width/r.width,t.size.height/r.height):c=Math.min(t.size.width/r.width,t.size.height/r.height);const d=i.x-s.x;return{top:`${i.y-s.y}px`,left:`${d}px`,transform:`scale(${c})`}}const _i=async(t,r)=>{const n=t.details.src,i=await mi(n),s=nr(r,{...i}),c=Ii(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:n,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||rr,top:t.details.top||s.top||"0px",left:t.details.left||s.left||"0px",transform:t.details.transform||s.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible",mediaWidth:t.details.mediaWidth||i.width||100,mediaHeight:t.details.mediaHeight||i.height||100};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:we(t.display,{duration:i.duration,trim:c}),duration:i.duration}},gi=async t=>{const r=t.id,n=t.details,s=(await Oa(n.src)).duration,c=Ii(t.trim,{duration:s});return{id:r,name:"",type:"audio",display:we(t.display,{duration:s,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:n.src,volume:n.volume??100},metadata:{...t.metadata},duration:s}},Ca=async(t,r)=>{var R,m,M;const n=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},s=Math.min(r.size.width/i.width,r.size.height/i.height),c=((R=t.details)==null?void 0:R.rotate)||0,d={top:((m=t.details)==null?void 0:m.top)||0,left:((M=t.details)==null?void 0:M.left)||0},p=t.display,A=t.trim||t.display;let O=1/0,S=0;return n.forEach(D=>{const u=t.trackItemsMap[D];u.display.from<O&&(O=u.display.from),u.display.to>S&&(S=u.display.to)}),{id:t.id,details:{...i,top:d.top,left:d.left,scale:s,rotate:c},trim:A,display:p||{from:O,to:S},activeEdit:!1}},bi=async(t,r)=>{const n=t.details,i=await hi(n.src),s=nr(r,i);return{id:t.id,type:"image",name:"image",display:we(t.display),playbackRate:t.playbackRate||1,details:{src:n.src||"",width:n.width||i.width||100,height:n.height||i.height||100,opacity:n.opacity??100,transform:n.transform||s.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||rr,top:n.top||s.top||"0px",left:n.left||s.left||"0px",borderWidth:n.borderWidth??0,borderColor:n.borderColor||"#000000",blur:n.blur||0,brightness:n.brightness||100,flipX:n.flipX||!1,flipY:n.flipY||!1,rotate:n.rotate||"0deg",visibility:n.visibility||"visible",mediaWidth:n.mediaWidth||n.width||i.width||100,mediaHeight:n.mediaHeight||n.height||i.height||100},metadata:t.metadata||{}}},vi=async(t,r)=>{const n=t;n.details.fontUrl&&await tr([{fontFamily:n.details.fontFamily,url:n.details.fontUrl}]);const i=n.id,s=n.details,c=Si(s),d=yi(n.details.text,c),p=nr(r,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:we(n.display),details:{...c,text:s.text||"",height:d,fontUrl:s.fontUrl,top:c.top||p.top,left:c.left||p.left,borderWidth:s.borderWidth||0,borderColor:s.borderColor||"#000000",boxShadow:s.boxShadow||rr,words:s.words||[]},metadata:t.metadata||{}}},Ei=async(t,r)=>{t.details.fontUrl&&await tr([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,s=Si(i),c=yi(t.details.text,s),d=nr(r,{width:s.width,height:c});return{id:n,name:"text",type:"text",display:we(t.display),details:{...s,text:i.text||"",height:c,fontUrl:i.fontUrl,top:s.top||d.top,left:s.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||rr},metadata:{}}},Si=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),Ra=async(t,r)=>{switch(t.type){case"video":return _i(t,r||{});case"audio":return gi(t);case"image":return bi(t,r||{});case"text":return Ei(t,r||{});case"caption":return vi(t,r||{});default:throw new Error("Unsupported track item")}};function xa(t,r){return r.some(n=>t.some(i=>i.id===n.id))}const La=(t=[],r=[])=>t.length===0?r.map(i=>({id:pe(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(n=>({...n,items:n.items||[],accepts:["audio","video","image","text","caption","template"],type:n.type||"text",magnetic:n.magnetic||!1,static:n.static||!1,id:n.id||pe()}));function Fa(t,r){return t.filter(i=>{if(r.forEach(s=>{i.items.includes(s)&&(i.items=i.items.filter(c=>c!==s))}),i.items.length!==0||i.static)return i})}const Vt=t=>Object.keys(t).reduce((r,n)=>{const{display:i,playbackRate:s}=t[n];return Math.max(r,i.to/(s||1))},0);function Cr(t,r,n){return Math.min(Math.max(t,r),n)}const Na=(t,r,n,i,s)=>{if(i===void 0&&s===void 0)return{trackId:void 0,trackIndex:void 0};const c=s!==void 0?r[Cr(s,0,r.length)]:r.find(A=>A.id===i);if(!c)return{trackId:void 0,trackIndex:s!==void 0?Cr(s,0,r.length):void 0};const d=c.items.map(A=>n[A]),p=t.map(A=>n[A]);for(const A of d){const O=A.display.from,S=A.display.to;for(const R of p){const m=R.display.from;if(!(R.display.to<=O||m>=S))return{trackId:void 0,trackIndex:r.indexOf(c)}}}return{trackId:c.id,trackIndex:r.indexOf(c)}};function Ha(t,r){let i=r.reduce((s,c)=>c.display.to>s.display.to?c:s,{display:{to:0}}).display.to;t.forEach(s=>{const c=s.display.from,p=s.display.to-c;s.display.from=i,s.display.to=s.display.from+p,i=s.display.to})}function ja(t){const r=t,n=r.tracks,i=r.trackItemsMap,s=[],c={};return n.forEach(d=>{var A;const p=d.items.map(O=>i[O]).sort((O,S)=>O.display.from-S.display.from);for(let O=0;O<p.length-1;O++){const S=p[O],R=p[O+1];if(Math.abs(S.display.to-R.display.from)<=1){const m=`${S.id}-${R.id}`;if((A=r.transitionIds)==null?void 0:A.includes(m))c[m]=r.transitionsMap[m];else{const D={id:m,duration:1500,fromId:S.id,toId:R.id,kind:"none",trackId:d.id,type:"transition"};c[m]=D}s.push(m)}}}),r.transitionIds=s,r.transitionsMap=c,{transitionIds:s,transitionsMap:c}}function za(t){const r=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(Je))),n=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(It))),i=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(at))),s=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(ke))),c=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(Bt))),d=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(zt))),p=Y.subject.pipe(Y.filter(({key:u})=>u.startsWith(Pr))),A=r.subscribe(async u=>{var f,_;if(u.key===Vn){const g=(f=u.value)==null?void 0:f.payload,y=g.trackItemsMap,h=g.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const I in h)if(h[I].type==="text"||h[I].type==="caption"){const E=h[I].details;await tr([{fontFamily:E.fontFamily,url:E.fontUrl}])}const v=Vt(y);t.updateState({...g,duration:v},{kind:"design:load",updateHistory:!1})}if(u.key===Zn){const g=(_=u.value)==null?void 0:_.payload;t.updateState({size:g},{kind:"design:resize",updateHistory:!1})}}),O=s.subscribe(u=>{if(u.key===fi)return t.undo();if(u.key===di)return t.redo()}),S=p.subscribe(u=>{var f;if(u.key===pi){const _=(f=u.value)==null?void 0:f.payload.scale;t.updateState({scale:_},{kind:"update",updateHistory:!1})}}),R=i.subscribe(u=>{var _,g,y,h;const f=[];if((_=u.value)!=null&&_.payload.trackItemIds&&(f.push((g=u.value)==null?void 0:g.payload.trackItemIds),t.updateState({activeIds:f},{kind:"update",updateHistory:!1})),u.key===li){const v=(y=u.value)==null?void 0:y.payload.trackItemIds,I=X(t.getState()),E=v&&v.length?v:I.activeIds,U=I.trackItemIds,x=I.transitionIds,C=I.trackItemDetailsMap,w=X(I.tracks),T=X(I.structure);E.forEach(W=>{var K;const dt=I.trackItemsMap[W]||I.transitionsMap[W];if(dt.type==="template"){const St=(K=I.structure.find(wt=>wt.id===dt.id))==null?void 0:K.items;E.push(...St);const N=T.findIndex(wt=>wt.id===dt.id);T.splice(N,1)}});const j=U.filter(W=>!E.includes(W)),J=x.filter(W=>!E.includes(W)),tt=Object.fromEntries(Object.entries(C).filter(([W])=>!E.includes(W))),Ut=Object.fromEntries(Object.entries(I.transitionsMap).filter(([W])=>!E.includes(W))),Yt=Fa(I.tracks,E),bt=Object.fromEntries(Object.entries(I.trackItemsMap).filter(([W])=>!E.includes(W)));w.filter(W=>W.magnetic).forEach(W=>{let dt=0;W==null||W.items.forEach(K=>{if(bt[K]){const St=bt[K].display.to-bt[K].display.from;bt[K].display={from:dt,to:dt+St},dt+=St}})});const F=Vt(bt);t.updateState({trackItemIds:j,trackItemDetailsMap:tt,activeIds:[],trackItemsMap:bt,tracks:Yt,duration:F,structure:T,transitionIds:J,transitionsMap:Ut},{updateHistory:!0,kind:"remove"})}if(u.key===ui){const v=X(t.getState()),I={},E=((h=u.value)==null?void 0:h.payload.trackItemIds)||v.activeIds;if(E.length===0)return;E.forEach(x=>{const C=v.trackItemsMap[x],w=v.trackItemDetailsMap[x],T=pe();v.trackItemsMap[T]={...X(C),id:T},v.trackItemDetailsMap[T]={...X(w)},v.trackItemIds.push(T);const j=v.tracks.find(J=>J.items.includes(x));I[j.id]?I[j.id].items.push(T):I[j.id]={...j,id:pe(),items:[T],static:!1,magnetic:!1}});const U=Object.values(I);v.tracks=[...U,...v.tracks],t.updateState({trackItemDetailsMap:v.trackItemDetailsMap,tracks:v.tracks,trackItemIds:v.trackItemIds,trackItemsMap:v.trackItemsMap},{updateHistory:!0,kind:"update"})}}),m=n.subscribe(async u=>{var U,x,C,w,T,j,J,tt,Ut,Yt,bt,ee,F,W,dt,K,St,N,wt,he,pt,re,ne;const f=X(t.getState()),_=((x=(U=u.value)==null?void 0:U.options)==null?void 0:x.isSelected)||!1,g=(w=(C=u.value)==null?void 0:C.options)==null?void 0:w.scaleMode;let y=[],h="text";const v=(j=(T=u.value)==null?void 0:T.options)==null?void 0:j.trackId;let I=(tt=(J=u.value)==null?void 0:J.options)==null?void 0:tt.trackIndex;if(u.key===ni){const G=(Ut=u.value)==null?void 0:Ut.payload,B=G.trackItems.map(V=>Ra(V,{size:f.size})),L=await Promise.all(B),ht=La(G.tracks,G.trackItems),lt=[],et={},vt={};if(L.forEach(V=>{const{details:At,...Wt}=V;lt.push(V.id),et[V.id]={type:V.type,details:At},vt[V.id]=Wt}),xa(f.tracks,ht))f.tracks.forEach(V=>{ht.forEach(At=>{if(V.id===At.id){if(V.magnetic){const Wt=At.items.map(Ot=>vt[Ot]),Tt=V.items.map(Ot=>f.trackItemsMap[Ot]);Ha(Wt,Tt)}V.items.push(...lt)}})});else{const V=((bt=(Yt=u.value)==null?void 0:Yt.options)==null?void 0:bt.trackIndex)||0,At=Cr(V,0,f.tracks.length);f.tracks.splice(At,0,...ht)}f.trackItemDetailsMap={...f.trackItemDetailsMap,...et},f.trackItemsMap={...f.trackItemsMap,...vt},f.trackItemIds=[...f.trackItemIds,...lt],f.duration=Vt(f.trackItemsMap);const{transitionIds:ie,transitionsMap:Gt}=ja(f);t.updateState({trackItemIds:f.trackItemIds,trackItemDetailsMap:f.trackItemDetailsMap,trackItemsMap:f.trackItemsMap,tracks:f.tracks,duration:f.duration,transitionIds:ie,transitionsMap:Gt},{updateHistory:!0,kind:"add"});return}if(u.key===ei){h="caption";const G=(ee=u.value)==null?void 0:ee.payload,B=[];for(const lt of G){const et=vi(lt,{size:f.size});B.push(et)}const L=await Promise.all(B),ht=[];for(const lt of L){const et=lt.id;ht.push(et);const{details:vt,...st}=lt;f.trackItemDetailsMap[et]={type:h,details:vt},f.trackItemsMap[et]=st,f.trackItemIds.push(et)}y=ht}if(u.key===qn){h="text";const G=await Ei((F=u.value)==null?void 0:F.payload,{size:f.size}),{details:B,...L}=G;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===ri){h="template";const G=(W=u.value)==null?void 0:W.payload.trackItemsMap,B=(dt=u.value)==null?void 0:dt.payload.trackItemDetailsMap,L=(K=u.value)==null?void 0:K.payload.transitionsMap,ht=((St=u.value)==null?void 0:St.payload.transitionIds)||[],lt=(N=u.value)==null?void 0:N.payload.trackItemIds,et=((wt=u.value)==null?void 0:wt.payload.tracks)||[],{details:vt,...st}=await Ca((he=u.value)==null?void 0:he.payload,{size:f.size}),ie={id:st.id,items:lt,transitions:ht,tracks:et};f.trackItemDetailsMap[st.id]={type:h,details:vt},f.trackItemsMap[st.id]=st,f.trackItemIds.push(st.id),y=[st.id],f.trackItemsMap={...f.trackItemsMap,...G,[st.id]:{type:"template",...st}},f.trackItemDetailsMap={...f.trackItemDetailsMap,...B,[st.id]:{type:"template",details:vt}},f.transitionsMap={...f.transitionsMap,...L},f.structure=[...f.structure,ie]}if(u.key===ti){h="image";const G=await bi((pt=u.value)==null?void 0:pt.payload,{size:f.size,scaleMode:g}),{details:B,...L}=G;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===Qn){h="audio";const G=await gi((re=u.value)==null?void 0:re.payload),{details:B,...L}=G;f.trackItemDetailsMap[L.id]={type:h,details:B},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}if(u.key===Jn){h="video";const G=await _i((ne=u.value)==null?void 0:ne.payload,{size:f.size,scaleMode:g}),{details:B,...L}=G;f.trackItemDetailsMap[L.id]={type:h,details:B,metadata:L.metadata},f.trackItemsMap[L.id]=L,f.trackItemIds.push(L.id),y=[L.id]}const E=Na(y,f.tracks,f.trackItemsMap,v,I);if(E.trackId){const G=f.tracks.find(B=>B.id===E.trackId);G&&G.items.push(...y)}else if(E.trackIndex!==void 0){const G={id:er(),accepts:["text","audio","helper","video","image","caption","template"],type:h,items:y,magnetic:!1,static:!1};f.tracks.splice(E.trackIndex,0,G)}else f.tracks.unshift({id:er(),accepts:["text","audio","helper","video","image","caption","template"],type:h,items:y,magnetic:!1,static:!1});_&&(f.activeIds=y),f.duration=Vt(f.trackItemsMap),t.updateState({activeIds:f.activeIds,trackItemIds:f.trackItemIds,trackItemDetailsMap:f.trackItemDetailsMap,trackItemsMap:f.trackItemsMap,transitionsMap:f.transitionsMap,tracks:f.tracks,duration:f.duration,structure:f.structure},{updateHistory:!0,kind:"add"})}),M=c.subscribe(async u=>{var f;if(u.key===ci){const _=X(t.getState()),g=(f=u.value)==null?void 0:f.options.time;if(_.activeIds.length===1){const y=_.activeIds[0],h=X(_.trackItemsMap[y]);if(g>=h.display.to||g<=h.display.from)return;const v=X(_.trackItemDetailsMap[y]),I=pe(),E=X({...h,display:{from:h.display.from,to:g}}),U=X({...h,id:I,display:{from:g,to:h.display.to}});if(h.type==="video"||h.type==="audio"){const x=g-E.display.from;E.trim={from:h.trim.from,to:h.trim.from+x},U.trim={from:h.trim.from+x,to:h.trim.to}}_.trackItemsMap[y]=E,_.trackItemsMap[I]=U,_.trackItemIds.push(I),_.trackItemDetailsMap[I]=v,_.tracks.forEach(x=>{x.items.includes(y)&&x.items.push(I)}),t.updateState({trackItemDetailsMap:_.trackItemDetailsMap,tracks:_.tracks,trackItemIds:_.trackItemIds,trackItemsMap:_.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(u.key===oi){const _=X(t.getState());if(_.activeIds.length){const g=_.activeIds,y=[],h={activeIds:g,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};g.forEach(I=>{h.trackItemDetailsMap[I]=_.trackItemDetailsMap[I],h.trackItemsMap[I]=_.trackItemsMap[I],y.push(_.tracks.find(E=>E.items.includes(I)))});const v=new Set;y.filter(I=>v.has(I.id)?!1:(v.add(I),!0)),h.tracks=Array.from(v.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(h))}}if(u.key===si){const _=localStorage.getItem("DesignComboTemp");if(!_)return;const g=X(t.getState()),y=JSON.parse(_),h={},v=y.trackItemsMap,I=y.trackItemDetailsMap,E=y.tracks,U=[],x=y.activeIds.map(async C=>{const w=I[C];(w.type==="caption"||w.type==="text")&&w.details.fontUrl&&await tr([{fontFamily:w.details.fontFamily,url:w.details.fontUrl}]);const T=pe();return h[C]=T,g.trackItemsMap[T]={...v[C],id:T},g.trackItemDetailsMap[T]=w,g.trackItemIds.push(T),!0});await Promise.all(x),E.forEach(C=>{const w=C.items.map(j=>h[j]),T={...C,items:w,id:er()};U.push(T)}),g.tracks=[...g.tracks,...U],t.updateState({trackItemDetailsMap:g.trackItemDetailsMap,tracks:g.tracks,trackItemIds:g.trackItemIds,trackItemsMap:g.trackItemsMap},{updateHistory:!0,kind:"update"})}}),D=d.subscribe(async u=>{var f,_,g;if(u.key===ii){const y=X(t.getState()),h=y.trackItemDetailsMap,v=y.trackItemsMap,I=Object.keys((f=u.value)==null?void 0:f.payload);if(!I.length)return;const E=(_=u.value)==null?void 0:_.payload;I.forEach(x=>{const C=E[x];C.details?h[x].details={...h[x].details,...C.details}:E[x].playbackRate&&(v[x].playbackRate=E[x].playbackRate)});const U=Vt(v);t.updateState({trackItemDetailsMap:{...h},trackItemsMap:{...v},duration:U},{updateHistory:!0,kind:"update:details"})}if(u.key===ai){const y=(g=u.value)==null?void 0:g.payload,h=Object.keys(y)[0],v=Object.values(y)[0],I=X(t.getState()),E=I.trackItemDetailsMap[h];if(v.details){if(v.type==="image"&&v.details.src){const C=await hi(v.details.src),w=E.details.width||0,T=E.details.height||0;let j=C.width,J=C.height;const tt=C.width/C.height;w/T>tt?(j=w,J=w/tt):(J=T,j=T*tt),v.details.mediaWidth=j,v.details.mediaHeight=J}if(v.type==="video"&&v.details.src){const C=await mi(v.details.src),w=E.details.width||0,T=E.details.height||0;let j=C.width,J=C.height;const tt=C.width/C.height;w/T>tt?(j=w,J=w/tt):(J=T,j=T*tt),v.details.mediaWidth=j,v.details.mediaHeight=J}const x=E.details;E.details={...x,...v.details},v.details=E.details}const U={...E,...v};I.trackItemDetailsMap[h]=U,I.trackItemsMap[h]={...I.trackItemsMap[h],type:v.type},t.updateState({trackItemDetailsMap:{...I.trackItemDetailsMap},trackItemsMap:{...I.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{m.unsubscribe(),M.unsubscribe(),D.unsubscribe(),O.unsubscribe(),R.unsubscribe(),A.unsubscribe(),S.unsubscribe()}}}const $a={Date:!0,RegExp:!0,String:!0,Number:!0};function Ti(t,r,n={cyclesFix:!0},i=[]){var p,A;let s=[];const c=Array.isArray(t);for(const O in t){const S=t[O],R=c?+O:O;if(!(O in r)){s.push({type:"REMOVE",path:[R],oldValue:t[O]});continue}const m=r[O],M=typeof S=="object"&&typeof m=="object"&&Array.isArray(S)===Array.isArray(m);if(S&&m&&M&&!$a[(A=(p=Object.getPrototypeOf(S))==null?void 0:p.constructor)==null?void 0:A.name]&&(!n.cyclesFix||!i.includes(S))){const D=Ti(S,m,n,n.cyclesFix?i.concat([S]):[]);s.push.apply(s,D.map(u=>(u.path.unshift(R),u)))}else S!==m&&!(Number.isNaN(S)&&Number.isNaN(m))&&!(M&&(isNaN(S)?S+""==m+"":+S==+m))&&s.push({path:[R],type:"CHANGE",value:m,oldValue:S})}const d=Array.isArray(r);for(const O in r)O in t||s.push({type:"CREATE",path:[d?+O:O],value:r[O]});return s}var Rr=Symbol.for("immer-nothing"),Ae=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state"),ki=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function q(t,...r){if(process.env.NODE_ENV!=="production"){const n=ki[t],i=typeof n=="function"?n.apply(null,r):n;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Zt=Object.getPrototypeOf;function qt(t){return!!t&&!!t[_t]}function $t(t){var r;return t?wi(t)||Array.isArray(t)||!!t[Ae]||!!((r=t.constructor)!=null&&r[Ae])||Oe(t)||Pe(t):!1}var Ua=Object.prototype.constructor.toString();function wi(t){if(!t||typeof t!="object")return!1;const r=Zt(t);if(r===null)return!0;const n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ua}function Me(t,r){Jt(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,i)=>r(i,n,t))}function Jt(t){const r=t[_t];return r?r.type_:Array.isArray(t)?1:Oe(t)?2:Pe(t)?3:0}function De(t,r){return Jt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function xr(t,r){return Jt(t)===2?t.get(r):t[r]}function Ai(t,r,n){const i=Jt(t);i===2?t.set(r,n):i===3?t.add(n):t[r]=n}function Ya(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function Oe(t){return t instanceof Map}function Pe(t){return t instanceof Set}function Qt(t){return t.copy_||t.base_}function Lr(t,r){if(Oe(t))return new Map(t);if(Pe(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=wi(t);if(r===!0||r==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[_t];let s=Reflect.ownKeys(i);for(let c=0;c<s.length;c++){const d=s[c],p=i[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:t[d]})}return Object.create(Zt(t),i)}else{const i=Zt(t);if(i!==null&&n)return{...t};const s=Object.create(i);return Object.assign(s,t)}}function Fr(t,r=!1){return ir(t)||qt(t)||!$t(t)||(Jt(t)>1&&(t.set=t.add=t.clear=t.delete=Ga),Object.freeze(t),r&&Object.entries(t).forEach(([n,i])=>Fr(i,!0))),t}function Ga(){q(2)}function ir(t){return Object.isFrozen(t)}var Nr={};function te(t){const r=Nr[t];return r||q(0,t),r}function Wa(t,r){Nr[t]||(Nr[t]=r)}var Ce;function Mi(){return Ce}function Xa(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Di(t,r){r&&(te("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function Hr(t){jr(t),t.drafts_.forEach(Ka),t.drafts_=null}function jr(t){t===Ce&&(Ce=t.parent_)}function Oi(t){return Ce=Xa(Ce,t)}function Ka(t){const r=t[_t];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Pi(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[_t].modified_&&(Hr(r),q(4)),$t(t)&&(t=ar(r,t),r.parent_||sr(r,t)),r.patches_&&te("Patches").generateReplacementPatches_(n[_t].base_,t,r.patches_,r.inversePatches_)):t=ar(r,n,[]),Hr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==Rr?t:void 0}function ar(t,r,n){if(ir(r))return r;const i=r[_t];if(!i)return Me(r,(s,c)=>Ci(t,i,r,s,c,n)),r;if(i.scope_!==t)return r;if(!i.modified_)return sr(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let c=s,d=!1;i.type_===3&&(c=new Set(s),s.clear(),d=!0),Me(c,(p,A)=>Ci(t,i,s,p,A,n,d)),sr(t,s,!1),n&&t.patches_&&te("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function Ci(t,r,n,i,s,c,d){if(process.env.NODE_ENV!=="production"&&s===n&&q(5),qt(s)){const p=c&&r&&r.type_!==3&&!De(r.assigned_,i)?c.concat(i):void 0,A=ar(t,s,p);if(Ai(n,i,A),qt(A))t.canAutoFreeze_=!1;else return}else d&&n.add(s);if($t(s)&&!ir(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;ar(t,s),(!r||!r.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&sr(t,s)}}function sr(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Fr(r,n)}function Ba(t,r){const n=Array.isArray(t),i={type_:n?1:0,scope_:r?r.scope_:Mi(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=i,c=zr;n&&(s=[i],c=Re);const{revoke:d,proxy:p}=Proxy.revocable(s,c);return i.draft_=p,i.revoke_=d,p}var zr={get(t,r){if(r===_t)return t;const n=Qt(t);if(!De(n,r))return Va(t,n,r);const i=n[r];return t.finalized_||!$t(i)?i:i===$r(t.base_,r)?(Yr(t),t.copy_[r]=Gr(i,t)):i},has(t,r){return r in Qt(t)},ownKeys(t){return Reflect.ownKeys(Qt(t))},set(t,r,n){const i=Ri(Qt(t),r);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const s=$r(Qt(t),r),c=s==null?void 0:s[_t];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(Ya(n,s)&&(n!==void 0||De(t.base_,r)))return!0;Yr(t),Ur(t)}return t.copy_[r]===n&&(n!==void 0||r in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[r])||(t.copy_[r]=n,t.assigned_[r]=!0),!0},deleteProperty(t,r){return $r(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,Yr(t),Ur(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=Qt(t),i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:i.enumerable,value:n[r]}},defineProperty(){q(11)},getPrototypeOf(t){return Zt(t.base_)},setPrototypeOf(){q(12)}},Re={};Me(zr,(t,r)=>{Re[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Re.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&q(13),Re.set.call(this,t,r,void 0)},Re.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&q(14),zr.set.call(this,t[0],r,n,t[0])};function $r(t,r){const n=t[_t];return(n?Qt(n):t)[r]}function Va(t,r,n){var s;const i=Ri(r,n);return i?"value"in i?i.value:(s=i.get)==null?void 0:s.call(t.draft_):void 0}function Ri(t,r){if(!(r in t))return;let n=Zt(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,r);if(i)return i;n=Zt(n)}}function Ur(t){t.modified_||(t.modified_=!0,t.parent_&&Ur(t.parent_))}function Yr(t){t.copy_||(t.copy_=Lr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Za=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,n,i)=>{if(typeof r=="function"&&typeof n!="function"){const c=n;n=r;const d=this;return function(A=c,...O){return d.produce(A,S=>n.call(this,S,...O))}}typeof n!="function"&&q(6),i!==void 0&&typeof i!="function"&&q(7);let s;if($t(r)){const c=Oi(this),d=Gr(r,void 0);let p=!0;try{s=n(d),p=!1}finally{p?Hr(c):jr(c)}return Di(c,i),Pi(s,c)}else if(!r||typeof r!="object"){if(s=n(r),s===void 0&&(s=r),s===Rr&&(s=void 0),this.autoFreeze_&&Fr(s,!0),i){const c=[],d=[];te("Patches").generateReplacementPatches_(r,s,c,d),i(c,d)}return s}else q(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(d,...p)=>this.produceWithPatches(d,A=>r(A,...p));let i,s;return[this.produce(r,n,(d,p)=>{i=d,s=p}),i,s]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){$t(t)||q(8),qt(t)&&(t=qa(t));const r=Oi(this),n=Gr(t,void 0);return n[_t].isManual_=!0,jr(r),n}finishDraft(t,r){const n=t&&t[_t];(!n||!n.isManual_)&&q(9);const{scope_:i}=n;return Di(i,r),Pi(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const s=r[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(r=r.slice(n+1));const i=te("Patches").applyPatches_;return qt(t)?i(t,r):this.produce(t,s=>i(s,r))}};function Gr(t,r){const n=Oe(t)?te("MapSet").proxyMap_(t,r):Pe(t)?te("MapSet").proxySet_(t,r):Ba(t,r);return(r?r.scope_:Mi()).drafts_.push(n),n}function qa(t){return qt(t)||q(10,t),xi(t)}function xi(t){if(!$t(t)||ir(t))return t;const r=t[_t];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=Lr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=Lr(t,!0);return Me(n,(i,s)=>{Ai(n,i,xi(s))}),r&&(r.finalized_=!1),n}function Li(){process.env.NODE_ENV!=="production"&&ki.push('Sets cannot have "replace" patches.',function(m){return"Unsupported patch operation: "+m},function(m){return"Cannot apply patch, path doesn't resolve: "+m},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",i="remove";function s(m,M,D,u){switch(m.type_){case 0:case 2:return d(m,M,D,u);case 1:return c(m,M,D,u);case 3:return p(m,M,D,u)}}function c(m,M,D,u){let{base_:f,assigned_:_}=m,g=m.copy_;g.length<f.length&&([f,g]=[g,f],[D,u]=[u,D]);for(let y=0;y<f.length;y++)if(_[y]&&g[y]!==f[y]){const h=M.concat([y]);D.push({op:r,path:h,value:R(g[y])}),u.push({op:r,path:h,value:R(f[y])})}for(let y=f.length;y<g.length;y++){const h=M.concat([y]);D.push({op:n,path:h,value:R(g[y])})}for(let y=g.length-1;f.length<=y;--y){const h=M.concat([y]);u.push({op:i,path:h})}}function d(m,M,D,u){const{base_:f,copy_:_}=m;Me(m.assigned_,(g,y)=>{const h=xr(f,g),v=xr(_,g),I=y?De(f,g)?r:n:i;if(h===v&&I===r)return;const E=M.concat(g);D.push(I===i?{op:I,path:E}:{op:I,path:E,value:v}),u.push(I===n?{op:i,path:E}:I===i?{op:n,path:E,value:R(h)}:{op:r,path:E,value:R(h)})})}function p(m,M,D,u){let{base_:f,copy_:_}=m,g=0;f.forEach(y=>{if(!_.has(y)){const h=M.concat([g]);D.push({op:i,path:h,value:y}),u.unshift({op:n,path:h,value:y})}g++}),g=0,_.forEach(y=>{if(!f.has(y)){const h=M.concat([g]);D.push({op:n,path:h,value:y}),u.unshift({op:i,path:h,value:y})}g++})}function A(m,M,D,u){D.push({op:r,path:[],value:M===Rr?void 0:M}),u.push({op:r,path:[],value:m})}function O(m,M){return M.forEach(D=>{const{path:u,op:f}=D;let _=m;for(let v=0;v<u.length-1;v++){const I=Jt(_);let E=u[v];typeof E!="string"&&typeof E!="number"&&(E=""+E),(I===0||I===1)&&(E==="__proto__"||E==="constructor")&&q(19),typeof _=="function"&&E==="prototype"&&q(19),_=xr(_,E),typeof _!="object"&&q(18,u.join("/"))}const g=Jt(_),y=S(D.value),h=u[u.length-1];switch(f){case r:switch(g){case 2:return _.set(h,y);case 3:q(16);default:return _[h]=y}case n:switch(g){case 1:return h==="-"?_.push(y):_.splice(h,0,y);case 2:return _.set(h,y);case 3:return _.add(y);default:return _[h]=y}case i:switch(g){case 1:return _.splice(h,1);case 2:return _.delete(h);case 3:return _.delete(D.value);default:return delete _[h]}default:q(17,f)}}),m}function S(m){if(!$t(m))return m;if(Array.isArray(m))return m.map(S);if(Oe(m))return new Map(Array.from(m.entries()).map(([D,u])=>[D,S(u)]));if(Pe(m))return new Set(Array.from(m).map(S));const M=Object.create(Zt(m));for(const D in m)M[D]=S(m[D]);return De(m,Ae)&&(M[Ae]=m[Ae]),M}function R(m){return qt(m)?S(m):m}Wa("Patches",{applyPatches_:O,generatePatches_:s,generateReplacementPatches_:A})}var gt=new Za,Ja=gt.produce;gt.produceWithPatches.bind(gt),gt.setAutoFreeze.bind(gt),gt.setUseStrictShallowCopy.bind(gt);var Qa=gt.applyPatches.bind(gt);gt.createDraft.bind(gt),gt.finishDraft.bind(gt);var ts=1/0,es=9007199254740991,rs="[object Arguments]",ns="[object Function]",is="[object GeneratorFunction]",as="[object Symbol]",ss=typeof Et=="object"&&Et&&Et.Object===Object&&Et,os=typeof self=="object"&&self&&self.Object===Object&&self,cs=ss||os||Function("return this")();function us(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function ls(t,r){for(var n=-1,i=t?t.length:0,s=Array(i);++n<i;)s[n]=r(t[n],n,t);return s}function fs(t,r){for(var n=-1,i=r.length,s=t.length;++n<i;)t[s+n]=r[n];return t}var Wr=Object.prototype,ds=Wr.hasOwnProperty,Xr=Wr.toString,Fi=cs.Symbol,ps=Wr.propertyIsEnumerable,Ni=Fi?Fi.isConcatSpreadable:void 0,Hi=Math.max;function hs(t,r,n,i,s){var c=-1,d=t.length;for(n||(n=_s),s||(s=[]);++c<d;){var p=t[c];n(p)?fs(s,p):s[s.length]=p}return s}function ms(t,r){return t=Object(t),ys(t,r,function(n,i){return i in t})}function ys(t,r,n){for(var i=-1,s=r.length,c={};++i<s;){var d=r[i],p=t[d];n(p,d)&&(c[d]=p)}return c}function Is(t,r){return r=Hi(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,s=Hi(n.length-r,0),c=Array(s);++i<s;)c[i]=n[r+i];i=-1;for(var d=Array(r+1);++i<r;)d[i]=n[i];return d[r]=c,us(t,this,d)}}function _s(t){return vs(t)||bs(t)||!!(Ni&&t&&t[Ni])}function gs(t){if(typeof t=="string"||As(t))return t;var r=t+"";return r=="0"&&1/t==-ts?"-0":r}function bs(t){return Ss(t)&&ds.call(t,"callee")&&(!ps.call(t,"callee")||Xr.call(t)==rs)}var vs=Array.isArray;function Es(t){return t!=null&&ks(t.length)&&!Ts(t)}function Ss(t){return ji(t)&&Es(t)}function Ts(t){var r=ws(t)?Xr.call(t):"";return r==ns||r==is}function ks(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=es}function ws(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function ji(t){return!!t&&typeof t=="object"}function As(t){return typeof t=="symbol"||ji(t)&&Xr.call(t)==as}var Ms=Is(function(t,r){return t==null?{}:ms(t,ls(hs(r),gs))}),Ds=Ms;const zi=Or(Ds),Os={size:{width:1080,height:1920},tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},$i=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class Ps{constructor(r){de(this,"stateSubject");de(this,"stateHistorySubject");de(this,"prevState");de(this,"undos",[]);de(this,"redos",[]);de(this,"listener");const n=r||Os;this.stateSubject=new Wn(n),this.stateHistorySubject=new Wn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){za(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const i=zi(r,$i),s=zi(this.getState(),$i),c=Ti(s,i);c.length&&(this.undos.push({undos:c,type:n}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(r){return this.stateHistorySubject.subscribe(r)}getState(){return this.stateSubject.getValue()}subscribe(r){return this.stateSubject.subscribe(r)}updateState(r,n={updateHistory:!1}){const i=this.getState(),s={...i,...r};it(i,s)||(n.updateHistory&&this.updateHistory(s,n.kind),this.prevState=i,this.stateSubject.next(s))}subscribeToSize(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.size,this.prevState.size)||r({size:n.size})})}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateTrackItem(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemsMap,this.prevState.trackItemsMap)||r({trackItemsMap:n.trackItemsMap})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||r({trackItemDetailsMap:n.trackItemDetailsMap})})}subscribeToDuration(r){return this.stateSubject.asObservable().subscribe(n=>{n.duration!==this.prevState.duration&&r({duration:n.duration})})}subscribeToHistory(r){return this.stateHistorySubject.asObservable().subscribe(n=>{if(n.handleRedo){const i=this.undos[this.undos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(n.handleUndo){const i=this.redos[this.redos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.tracks,this.prevState.tracks)||!it(n.transitionIds,this.prevState.transitionIds))&&r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.tracks,this.prevState.tracks)||!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.trackItemsMap,this.prevState.trackItemsMap)||!it(n.transitionIds,this.prevState.transitionIds)||!it(n.transitionsMap,this.prevState.transitionsMap)||!it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!it(n.structure,this.prevState.structure))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap,structure:n.structure})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,i=r==null?void 0:r.type;if(!n||!i)return;Li();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}=this.getState(),S=X({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}),R=[],m=[],M=[],D=[],u=[],f=[];n.forEach(w=>{let T;const j=w.path.slice(1);w.type==="CREATE"?T={path:j,op:"remove",value:w.value}:w.type==="CHANGE"?T={path:j,op:"replace",value:w.oldValue}:T={path:j,op:"add",value:w.oldValue},w.path.includes("trackItemIds")?M.push(T):w.path.includes("transitionIds")?m.push(T):w.path.includes("trackItemsMap")?u.push(T):w.path.includes("transitionsMap")?D.push(T):w.path.includes("tracks")?R.push(T):w.path.includes("trackItemDetailsMap")&&f.push(T)});const _=this.applyPatch(S.tracks,R),g=this.applyPatch(S.transitionIds,m),y=this.applyPatch(S.trackItemIds,M),h=this.applyPatch(S.transitionsMap,D),v=this.applyPatch(S.trackItemsMap,u),I=this.applyPatch(S.trackItemDetailsMap,f),E=X({tracks:_,transitionIds:g,trackItemIds:y,transitionsMap:h,trackItemsMap:v,trackItemDetailsMap:I}),U=X(this.getState()),x={...U,...E};this.prevState=U,this.redos.push({redos:n,type:i});const C=Vt(x.trackItemsMap);this.stateSubject.next({...x,duration:C}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((i,s)=>Ja(i,c=>{Qa(c,[s])}),r)}redo(){const r=this.redos.pop(),n=r==null?void 0:r.redos,i=r==null?void 0:r.type;if(!n||!i)return;Li();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}=this.getState(),S=X({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:p,transitionsMap:A,trackItemsMap:O}),R=[],m=[],M=[],D=[],u=[],f=[];n.forEach(w=>{let T;const j=w.path.slice(1);w.type==="CREATE"?T={path:j,op:"add",value:w.value}:w.type==="CHANGE"?T={path:j,op:"replace",value:w.value}:T={path:j,op:"remove",value:w.oldValue},w.path.includes("trackItemIds")?M.push(T):w.path.includes("transitionIds")?m.push(T):w.path.includes("trackItemsMap")?u.push(T):w.path.includes("transitionsMap")?D.push(T):w.path.includes("trackItemDetailsMap")?f.push(T):R.push(T)});const _=this.applyPatch(S.tracks,R),g=this.applyPatch(S.transitionIds,m),y=this.applyPatch(S.trackItemIds,M),h=this.applyPatch(S.transitionsMap,D),v=this.applyPatch(S.trackItemsMap,u),I=this.applyPatch(S.trackItemDetailsMap,f),E=X({tracks:_,transitionIds:g,trackItemIds:y,transitionsMap:h,trackItemsMap:v,trackItemDetailsMap:I}),U=X(this.getState()),x={...U,...E};this.prevState=U,this.undos.push({undos:n,type:i});const C=Vt(x.trackItemsMap);this.stateSubject.next({...x,duration:C}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}b.ACTIVE_CLONE=oi,b.ACTIVE_DELETE=ma,b.ACTIVE_PASTE=si,b.ACTIVE_PREFIX=Bt,b.ACTIVE_SET=ha,b.ACTIVE_SPLIT=ci,b.ADD_ANIMATION=ca,b.ADD_AUDIO=Qn,b.ADD_CAPTION=ei,b.ADD_IMAGE=ti,b.ADD_ITEMS=ni,b.ADD_MASK=sa,b.ADD_PLACEHOLDER=aa,b.ADD_PREFIX=It,b.ADD_SUFFIX=ea,b.ADD_TEMPLATE=ri,b.ADD_TEXT=qn,b.ADD_TRANSITION=oa,b.ADD_VIDEO=Jn,b.DELETE_TEMPLATE_ITEM=da,b.DESIGN_LOAD=Vn,b.DESIGN_PREFIX=Je,b.DESIGN_RESIZE=Zn,b.EDIT_OBJECT=ii,b.EDIT_PREFIX=zt,b.EDIT_SHAPE=la,b.EDIT_TEMPLATE_ITEM=fa,b.EDIT_TEXT=ua,b.ENTER_EDIT_MODE=pa,b.HISTORY_PREFIX=ke,b.HISTORY_REDO=di,b.HISTORY_RESET=Ma,b.HISTORY_UNDO=fi,b.LAYER_CLONE=ui,b.LAYER_COPY=Ta,b.LAYER_CUT=Aa,b.LAYER_DELETE=li,b.LAYER_EDITING_NAME=Sa,b.LAYER_HIDDEN=Ia,b.LAYER_LOCKED=ya,b.LAYER_MOVE=_a,b.LAYER_PASTE=ka,b.LAYER_PREFIX=at,b.LAYER_RENAME=Ea,b.LAYER_SELECT=ga,b.LAYER_SELECTION=ba,b.LAYER_SEND_TO=va,b.LAYER_SPLIT=wa,b.REPLACE_MEDIA=ai,b.STATE_CHANGED=ia,b.STATE_PREFIX=Bn,b.TIMELINE_SCALE_CHANGED=pi,b.TIMELINE_SCALE_PREFIX=Pr,b.TRACKS_CHANGED=ra,b.TRACK_ITEMS_CHANGED=na,b.TRACK_ITEMS_PREFIX=Kn,b.TRACK_PREFIX=Xn,b.default=Ps,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
@@ -6,6 +6,7 @@ type OptionsType = {
|
|
6
6
|
height: number;
|
7
7
|
};
|
8
8
|
origin: number;
|
9
|
+
scaleMode?: string;
|
9
10
|
};
|
10
11
|
export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partial<OptionsType>) => Promise<{
|
11
12
|
trim: ITrim;
|
@@ -63,6 +64,7 @@ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
|
|
63
64
|
width: number;
|
64
65
|
height: number;
|
65
66
|
};
|
67
|
+
scaleMode?: string;
|
66
68
|
}) => Promise<{
|
67
69
|
id: string;
|
68
70
|
type: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@designcombo/state",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.6",
|
4
4
|
"private": false,
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"typescript": "^5.3.3",
|
26
26
|
"vite": "^5.2.0",
|
27
27
|
"vite-plugin-dts": "^3.9.1",
|
28
|
-
"@designcombo/types": "1.0.
|
28
|
+
"@designcombo/types": "1.0.6",
|
29
29
|
"@designcombo/typescript-config": "0.0.0"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
@@ -39,7 +39,7 @@
|
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
41
|
"@designcombo/events": "^1.0.2",
|
42
|
-
"@designcombo/types": "1.0.
|
42
|
+
"@designcombo/types": "1.0.6"
|
43
43
|
},
|
44
44
|
"scripts": {
|
45
45
|
"dev": "vite",
|