@designcombo/state 0.1.8 → 0.1.10

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.umd.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(E,X){typeof exports=="object"&&typeof module<"u"?module.exports=X(require("@designcombo/events")):typeof define=="function"&&define.amd?define(["@designcombo/events"],X):(E=typeof globalThis<"u"?globalThis:E||self,E.events=X(E.events))})(this,function(E){"use strict";var va=Object.defineProperty;var Ia=(E,X,ct)=>X in E?va(E,X,{enumerable:!0,configurable:!0,writable:!0,value:ct}):E[X]=ct;var jt=(E,X,ct)=>Ia(E,typeof X!="symbol"?X+"":X,ct);var X=function(t,r){return X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},X(t,r)};function ct(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");X(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}function er(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],a=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&a>=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function rr(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var a=n.call(t),o,c=[],l;try{for(;(r===void 0||r-- >0)&&!(o=a.next()).done;)c.push(o.value)}catch(d){l={error:d}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(l)throw l.error}}return c}function nr(t,r,n){if(n||arguments.length===2)for(var a=0,o=r.length,c;a<o;a++)(c||!(a in r))&&(c||(c=Array.prototype.slice.call(r,0,a)),c[a]=r[a]);return t.concat(c||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;function ht(t){return typeof t=="function"}function wn(t){var r=function(a){Error.call(a),a.stack=new Error().stack},n=t(r);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ir=wn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
2
- `+n.map(function(a,o){return o+1+") "+a.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 _e=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,n,a,o,c;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var d=er(l),k=d.next();!k.done;k=d.next()){var C=k.value;C.remove(this)}}catch(f){r={error:f}}finally{try{k&&!k.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}else l.remove(this);var S=this.initialTeardown;if(ht(S))try{S()}catch(f){c=f instanceof ir?f.errors:[f]}var z=this._finalizers;if(z){this._finalizers=null;try{for(var h=er(z),p=h.next();!p.done;p=h.next()){var v=p.value;try{En(v)}catch(f){c=c??[],f instanceof ir?c=nr(nr([],rr(c)),rr(f.errors)):c.push(f)}}}catch(f){a={error:f}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}if(c)throw new ir(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)En(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}(),Tn=_e.EMPTY;function An(t){return t instanceof _e||t&&"closed"in t&&ht(t.remove)&&ht(t.add)&&ht(t.unsubscribe)}function En(t){ht(t)?t():t.unsubscribe()}var kn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},On={setTimeout:function(t,r){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];return setTimeout.apply(void 0,nr([t,r],rr(n)))},clearTimeout:function(t){var r=On.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ii(t){On.setTimeout(function(){throw t})}function xn(){}function ge(t){t()}var Mn=function(t){ct(r,t);function r(n){var a=t.call(this)||this;return a.isStopped=!1,n?(a.destination=n,An(n)&&n.add(a)):a.destination=ci,a}return r.create=function(n,a,o){return new or(n,a,o)},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}(_e),ai=Function.prototype.bind;function sr(t,r){return ai.call(t,r)}var si=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(a){ve(a)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(a){ve(a)}else ve(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){ve(n)}},t}(),or=function(t){ct(r,t);function r(n,a,o){var c=t.call(this)||this,l;if(ht(n)||!n)l={next:n??void 0,error:a??void 0,complete:o??void 0};else{var d;c&&kn.useDeprecatedNextContext?(d=Object.create(n),d.unsubscribe=function(){return c.unsubscribe()},l={next:n.next&&sr(n.next,d),error:n.error&&sr(n.error,d),complete:n.complete&&sr(n.complete,d)}):l=n}return c.destination=new si(l),c}return r}(Mn);function ve(t){ii(t)}function oi(t){throw t}var ci={closed:!0,next:xn,error:oi,complete:xn},ui=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function fi(t){return t}function li(t){return t.length===0?fi:t.length===1?t[0]:function(n){return t.reduce(function(a,o){return o(a)},n)}}var Pn=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,a){var o=this,c=di(r)?r:new or(r,n,a);return ge(function(){var l=o,d=l.operator,k=l.source;c.add(d?d.call(c,k):k?o._subscribe(c):o._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 a=this;return n=Dn(n),new n(function(o,c){var l=new or({next:function(d){try{r(d)}catch(k){c(k),l.unsubscribe()}},error:c,complete:o});a.subscribe(l)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[ui]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return li(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Dn(r),new r(function(a,o){var c;n.subscribe(function(l){return c=l},function(l){return o(l)},function(){return a(c)})})},t.create=function(r){return new t(r)},t}();function Dn(t){var r;return(r=t??kn.Promise)!==null&&r!==void 0?r:Promise}function pi(t){return t&&ht(t.next)&&ht(t.error)&&ht(t.complete)}function di(t){return t&&t instanceof Mn||pi(t)&&An(t)}var hi=wn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Cn=function(t){ct(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 a=new jn(this,this);return a.operator=n,a},r.prototype._throwIfClosed=function(){if(this.closed)throw new hi},r.prototype.next=function(n){var a=this;ge(function(){var o,c;if(a._throwIfClosed(),!a.isStopped){a.currentObservers||(a.currentObservers=Array.from(a.observers));try{for(var l=er(a.currentObservers),d=l.next();!d.done;d=l.next()){var k=d.value;k.next(n)}}catch(C){o={error:C}}finally{try{d&&!d.done&&(c=l.return)&&c.call(l)}finally{if(o)throw o.error}}}})},r.prototype.error=function(n){var a=this;ge(function(){if(a._throwIfClosed(),!a.isStopped){a.hasError=a.isStopped=!0,a.thrownError=n;for(var o=a.observers;o.length;)o.shift().error(n)}})},r.prototype.complete=function(){var n=this;ge(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var a=n.observers;a.length;)a.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 a=this,o=this,c=o.hasError,l=o.isStopped,d=o.observers;return c||l?Tn:(this.currentObservers=null,d.push(n),new _e(function(){a.currentObservers=null,ar(d,n)}))},r.prototype._checkFinalizedStatuses=function(n){var a=this,o=a.hasError,c=a.thrownError,l=a.isStopped;o?n.error(c):l&&n.complete()},r.prototype.asObservable=function(){var n=new Pn;return n.source=this,n},r.create=function(n,a){return new jn(n,a)},r}(Pn),jn=function(t){ct(r,t);function r(n,a){var o=t.call(this)||this;return o.destination=n,o.source=a,o}return r.prototype.next=function(n){var a,o;(o=(a=this.destination)===null||a===void 0?void 0:a.next)===null||o===void 0||o.call(a,n)},r.prototype.error=function(n){var a,o;(o=(a=this.destination)===null||a===void 0?void 0:a.error)===null||o===void 0||o.call(a,n)},r.prototype.complete=function(){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||a===void 0||a.call(n)},r.prototype._subscribe=function(n){var a,o;return(o=(a=this.source)===null||a===void 0?void 0:a.subscribe(n))!==null&&o!==void 0?o:Tn},r}(Cn),Fn=function(t){ct(r,t);function r(n){var a=t.call(this)||this;return a._value=n,a}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(n){var a=t.prototype._subscribe.call(this,n);return!a.closed&&n.next(this._value),a},r.prototype.getValue=function(){var n=this,a=n.hasError,o=n.thrownError,c=n._value;if(a)throw o;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Cn),et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ie={exports:{}};Ie.exports,function(t,r){var n=200,a="__lodash_hash_undefined__",o=1,c=2,l=9007199254740991,d="[object Arguments]",k="[object Array]",C="[object AsyncFunction]",S="[object Boolean]",z="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",f="[object Map]",_="[object Number]",m="[object Null]",g="[object Object]",b="[object Promise]",y="[object Proxy]",R="[object RegExp]",O="[object Set]",x="[object String]",H="[object Symbol]",N="[object Undefined]",w="[object WeakMap]",T="[object ArrayBuffer]",U="[object DataView]",ke="[object Float32Array]",Oe="[object Float64Array]",xe="[object Int8Array]",Or="[object Int16Array]",xr="[object Int32Array]",Mr="[object Uint8Array]",Pr="[object Uint8ClampedArray]",j="[object Uint16Array]",Dr="[object Uint32Array]",Cr=/[\\^$.*+?()[\]{}|]/g,it=/^\[object .+?Constructor\]$/,Me=/^(?:0|[1-9]\d*)$/,F={};F[ke]=F[Oe]=F[xe]=F[Or]=F[xr]=F[Mr]=F[Pr]=F[j]=F[Dr]=!0,F[d]=F[k]=F[T]=F[S]=F[U]=F[z]=F[h]=F[p]=F[f]=F[_]=F[g]=F[R]=F[O]=F[x]=F[w]=!1;var Pe=typeof et=="object"&&et&&et.Object===Object&&et,jr=typeof self=="object"&&self&&self.Object===Object&&self,at=Pe||jr||Function("return this")(),De=r&&!r.nodeType&&r,Ce=De&&!0&&t&&!t.nodeType&&t,Qt=Ce&&Ce.exports===De,te=Qt&&Pe.process,je=function(){try{return te&&te.binding&&te.binding("util")}catch{}}(),ee=je&&je.isTypedArray;function Fe(e,i){for(var s=-1,u=e==null?0:e.length,A=0,I=[];++s<u;){var P=e[s];i(P,s,e)&&(I[A++]=P)}return I}function re(e,i){for(var s=-1,u=i.length,A=e.length;++s<u;)e[A+s]=i[s];return e}function Re(e,i){for(var s=-1,u=e==null?0:e.length;++s<u;)if(i(e[s],s,e))return!0;return!1}function Fr(e,i){for(var s=-1,u=Array(e);++s<e;)u[s]=i(s);return u}function Rr(e){return function(i){return e(i)}}function Ft(e,i){return e.has(i)}function ne(e,i){return e==null?void 0:e[i]}function ze(e){var i=-1,s=Array(e.size);return e.forEach(function(u,A){s[++i]=[A,u]}),s}function Ne(e,i){return function(s){return e(i(s))}}function ft(e){var i=-1,s=Array(e.size);return e.forEach(function(u){s[++i]=u}),s}var Rt=Array.prototype,zr=Function.prototype,kt=Object.prototype,zt=at["__core-js_shared__"],ie=zr.toString,nt=kt.hasOwnProperty,He=function(){var e=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ue=kt.toString,Nr=RegExp("^"+ie.call(nt).replace(Cr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ae=Qt?at.Buffer:void 0,Nt=at.Symbol,Le=at.Uint8Array,Ht=kt.propertyIsEnumerable,Ot=Rt.splice,st=Nt?Nt.toStringTag:void 0,Ut=Object.getOwnPropertySymbols,se=ae?ae.isBuffer:void 0,xt=Ne(Object.keys,Object),oe=mt(at,"DataView"),Mt=mt(at,"Map"),ce=mt(at,"Promise"),ue=mt(at,"Set"),fe=mt(at,"WeakMap"),vt=mt(Object,"create"),Ge=q(oe),yt=q(Mt),Hr=q(ce),Ur=q(ue),Lr=q(fe),Be=Nt?Nt.prototype:void 0,le=Be?Be.valueOf:void 0;function W(e){var i=-1,s=e==null?0:e.length;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Gr(){this.__data__=vt?vt(null):{},this.size=0}function Br(e){var i=this.has(e)&&delete this.__data__[e];return this.size-=i?1:0,i}function Wr(e){var i=this.__data__;if(vt){var s=i[e];return s===a?void 0:s}return nt.call(i,e)?i[e]:void 0}function $r(e){var i=this.__data__;return vt?i[e]!==void 0:nt.call(i,e)}function Kr(e,i){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=vt&&i===void 0?a:i,this}W.prototype.clear=Gr,W.prototype.delete=Br,W.prototype.get=Wr,W.prototype.has=$r,W.prototype.set=Kr;function K(e){var i=-1,s=e==null?0:e.length;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Vr(){this.__data__=[],this.size=0}function Yr(e){var i=this.__data__,s=Bt(i,e);if(s<0)return!1;var u=i.length-1;return s==u?i.pop():Ot.call(i,s,1),--this.size,!0}function Xr(e){var i=this.__data__,s=Bt(i,e);return s<0?void 0:i[s][1]}function qr(e){return Bt(this.__data__,e)>-1}function Jr(e,i){var s=this.__data__,u=Bt(s,e);return u<0?(++this.size,s.push([e,i])):s[u][1]=i,this}K.prototype.clear=Vr,K.prototype.delete=Yr,K.prototype.get=Xr,K.prototype.has=qr,K.prototype.set=Jr;function J(e){var i=-1,s=e==null?0:e.length;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Zr(){this.size=0,this.__data__={hash:new W,map:new(Mt||K),string:new W}}function Qr(e){var i=ot(this,e).delete(e);return this.size-=i?1:0,i}function tn(e){return ot(this,e).get(e)}function en(e){return ot(this,e).has(e)}function rn(e,i){var s=ot(this,e),u=s.size;return s.set(e,i),this.size+=s.size==u?0:1,this}J.prototype.clear=Zr,J.prototype.delete=Qr,J.prototype.get=tn,J.prototype.has=en,J.prototype.set=rn;function Lt(e){var i=-1,s=e==null?0:e.length;for(this.__data__=new J;++i<s;)this.add(e[i])}function We(e){return this.__data__.set(e,a),this}function Gt(e){return this.__data__.has(e)}Lt.prototype.add=Lt.prototype.push=We,Lt.prototype.has=Gt;function lt(e){var i=this.__data__=new K(e);this.size=i.size}function pe(){this.__data__=new K,this.size=0}function nn(e){var i=this.__data__,s=i.delete(e);return this.size=i.size,s}function an(e){return this.__data__.get(e)}function sn(e){return this.__data__.has(e)}function on(e,i){var s=this.__data__;if(s instanceof K){var u=s.__data__;if(!Mt||u.length<n-1)return u.push([e,i]),this.size=++s.size,this;s=this.__data__=new J(u)}return s.set(e,i),this.size=s.size,this}lt.prototype.clear=pe,lt.prototype.delete=nn,lt.prototype.get=an,lt.prototype.has=sn,lt.prototype.set=on;function cn(e,i){var s=Wt(e),u=!s&&Xe(e),A=!s&&!u&&$t(e),I=!s&&!u&&!A&&Ze(e),P=s||u||A||I,M=P?Fr(e.length,String):[],L=M.length;for(var D in e)nt.call(e,D)&&!(P&&(D=="length"||A&&(D=="offset"||D=="parent")||I&&(D=="buffer"||D=="byteLength"||D=="byteOffset")||mn(D,L)))&&M.push(D);return M}function Bt(e,i){for(var s=e.length;s--;)if(Ye(e[s][0],i))return s;return-1}function de(e,i,s){var u=i(e);return Wt(e)?u:re(u,s(e))}function Pt(e){return e==null?e===void 0?N:m:st&&st in Object(e)?bt(e):Ve(e)}function $e(e){return dt(e)&&Pt(e)==d}function Ke(e,i,s,u,A){return e===i?!0:e==null||i==null||!dt(e)&&!dt(i)?e!==e&&i!==i:un(e,i,s,u,Ke,A)}function un(e,i,s,u,A,I){var P=Wt(e),M=Wt(i),L=P?k:pt(e),D=M?k:pt(i);L=L==d?g:L,D=D==d?g:D;var V=L==g,Z=D==g,B=L==D;if(B&&$t(e)){if(!$t(i))return!1;P=!0,V=!1}if(B&&!V)return I||(I=new lt),P||Ze(e)?he(e,i,s,u,A,I):dn(e,i,L,s,u,A,I);if(!(s&o)){var Y=V&&nt.call(e,"__wrapped__"),$=Z&&nt.call(i,"__wrapped__");if(Y||$){var It=Y?e.value():e,_t=$?i.value():i;return I||(I=new lt),A(It,_t,s,u,I)}}return B?(I||(I=new lt),hn(e,i,s,u,A,I)):!1}function fn(e){if(!Je(e)||_n(e))return!1;var i=qe(e)?Nr:it;return i.test(q(e))}function ln(e){return dt(e)&&me(e.length)&&!!F[Pt(e)]}function pn(e){if(!gn(e))return xt(e);var i=[];for(var s in Object(e))nt.call(e,s)&&s!="constructor"&&i.push(s);return i}function he(e,i,s,u,A,I){var P=s&o,M=e.length,L=i.length;if(M!=L&&!(P&&L>M))return!1;var D=I.get(e);if(D&&I.get(i))return D==i;var V=-1,Z=!0,B=s&c?new Lt:void 0;for(I.set(e,i),I.set(i,e);++V<M;){var Y=e[V],$=i[V];if(u)var It=P?u($,Y,V,i,e,I):u(Y,$,V,e,i,I);if(It!==void 0){if(It)continue;Z=!1;break}if(B){if(!Re(i,function(_t,Ct){if(!Ft(B,Ct)&&(Y===_t||A(Y,_t,s,u,I)))return B.push(Ct)})){Z=!1;break}}else if(!(Y===$||A(Y,$,s,u,I))){Z=!1;break}}return I.delete(e),I.delete(i),Z}function dn(e,i,s,u,A,I,P){switch(s){case U:if(e.byteLength!=i.byteLength||e.byteOffset!=i.byteOffset)return!1;e=e.buffer,i=i.buffer;case T:return!(e.byteLength!=i.byteLength||!I(new Le(e),new Le(i)));case S:case z:case _:return Ye(+e,+i);case h:return e.name==i.name&&e.message==i.message;case R:case x:return e==i+"";case f:var M=ze;case O:var L=u&o;if(M||(M=ft),e.size!=i.size&&!L)return!1;var D=P.get(e);if(D)return D==i;u|=c,P.set(e,i);var V=he(M(e),M(i),u,A,I,P);return P.delete(e),V;case H:if(le)return le.call(e)==le.call(i)}return!1}function hn(e,i,s,u,A,I){var P=s&o,M=Dt(e),L=M.length,D=Dt(i),V=D.length;if(L!=V&&!P)return!1;for(var Z=L;Z--;){var B=M[Z];if(!(P?B in i:nt.call(i,B)))return!1}var Y=I.get(e);if(Y&&I.get(i))return Y==i;var $=!0;I.set(e,i),I.set(i,e);for(var It=P;++Z<L;){B=M[Z];var _t=e[B],Ct=i[B];if(u)var ni=P?u(Ct,_t,B,i,e,I):u(_t,Ct,B,e,i,I);if(!(ni===void 0?_t===Ct||A(_t,Ct,s,u,I):ni)){$=!1;break}It||(It=B=="constructor")}if($&&!It){var Qe=e.constructor,tr=i.constructor;Qe!=tr&&"constructor"in e&&"constructor"in i&&!(typeof Qe=="function"&&Qe instanceof Qe&&typeof tr=="function"&&tr instanceof tr)&&($=!1)}return I.delete(e),I.delete(i),$}function Dt(e){return de(e,be,yn)}function ot(e,i){var s=e.__data__;return bn(i)?s[typeof i=="string"?"string":"hash"]:s.map}function mt(e,i){var s=ne(e,i);return fn(s)?s:void 0}function bt(e){var i=nt.call(e,st),s=e[st];try{e[st]=void 0;var u=!0}catch{}var A=Ue.call(e);return u&&(i?e[st]=s:delete e[st]),A}var yn=Ut?function(e){return e==null?[]:(e=Object(e),Fe(Ut(e),function(i){return Ht.call(e,i)}))}:In,pt=Pt;(oe&&pt(new oe(new ArrayBuffer(1)))!=U||Mt&&pt(new Mt)!=f||ce&&pt(ce.resolve())!=b||ue&&pt(new ue)!=O||fe&&pt(new fe)!=w)&&(pt=function(e){var i=Pt(e),s=i==g?e.constructor:void 0,u=s?q(s):"";if(u)switch(u){case Ge:return U;case yt:return f;case Hr:return b;case Ur:return O;case Lr:return w}return i});function mn(e,i){return i=i??l,!!i&&(typeof e=="number"||Me.test(e))&&e>-1&&e%1==0&&e<i}function bn(e){var i=typeof e;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?e!=="__proto__":e===null}function _n(e){return!!He&&He in e}function gn(e){var i=e&&e.constructor,s=typeof i=="function"&&i.prototype||kt;return e===s}function Ve(e){return Ue.call(e)}function q(e){if(e!=null){try{return ie.call(e)}catch{}try{return e+""}catch{}}return""}function Ye(e,i){return e===i||e!==e&&i!==i}var Xe=$e(function(){return arguments}())?$e:function(e){return dt(e)&&nt.call(e,"callee")&&!Ht.call(e,"callee")},Wt=Array.isArray;function ye(e){return e!=null&&me(e.length)&&!qe(e)}var $t=se||Sn;function vn(e,i){return Ke(e,i)}function qe(e){if(!Je(e))return!1;var i=Pt(e);return i==p||i==v||i==C||i==y}function me(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=l}function Je(e){var i=typeof e;return e!=null&&(i=="object"||i=="function")}function dt(e){return e!=null&&typeof e=="object"}var Ze=ee?Rr(ee):ln;function be(e){return ye(e)?cn(e):pn(e)}function In(){return[]}function Sn(){return!1}t.exports=vn}(Ie,Ie.exports);var yi=Ie.exports;const ut=cr(yi);var Se={exports:{}};Se.exports,function(t,r){var n=200,a="__lodash_hash_undefined__",o=9007199254740991,c="[object Arguments]",l="[object Array]",d="[object Boolean]",k="[object Date]",C="[object Error]",S="[object Function]",z="[object GeneratorFunction]",h="[object Map]",p="[object Number]",v="[object Object]",f="[object Promise]",_="[object RegExp]",m="[object Set]",g="[object String]",b="[object Symbol]",y="[object WeakMap]",R="[object ArrayBuffer]",O="[object DataView]",x="[object Float32Array]",H="[object Float64Array]",N="[object Int8Array]",w="[object Int16Array]",T="[object Int32Array]",U="[object Uint8Array]",ke="[object Uint8ClampedArray]",Oe="[object Uint16Array]",xe="[object Uint32Array]",Or=/[\\^$.*+?()[\]{}|]/g,xr=/\w*$/,Mr=/^\[object .+?Constructor\]$/,Pr=/^(?:0|[1-9]\d*)$/,j={};j[c]=j[l]=j[R]=j[O]=j[d]=j[k]=j[x]=j[H]=j[N]=j[w]=j[T]=j[h]=j[p]=j[v]=j[_]=j[m]=j[g]=j[b]=j[U]=j[ke]=j[Oe]=j[xe]=!0,j[C]=j[S]=j[y]=!1;var Dr=typeof et=="object"&&et&&et.Object===Object&&et,Cr=typeof self=="object"&&self&&self.Object===Object&&self,it=Dr||Cr||Function("return this")(),Me=r&&!r.nodeType&&r,F=Me&&!0&&t&&!t.nodeType&&t,Pe=F&&F.exports===Me;function jr(e,i){return e.set(i[0],i[1]),e}function at(e,i){return e.add(i),e}function De(e,i){for(var s=-1,u=e?e.length:0;++s<u&&i(e[s],s,e)!==!1;);return e}function Ce(e,i){for(var s=-1,u=i.length,A=e.length;++s<u;)e[A+s]=i[s];return e}function Qt(e,i,s,u){for(var A=-1,I=e?e.length:0;++A<I;)s=i(s,e[A],A,e);return s}function te(e,i){for(var s=-1,u=Array(e);++s<e;)u[s]=i(s);return u}function je(e,i){return e==null?void 0:e[i]}function ee(e){var i=!1;if(e!=null&&typeof e.toString!="function")try{i=!!(e+"")}catch{}return i}function Fe(e){var i=-1,s=Array(e.size);return e.forEach(function(u,A){s[++i]=[A,u]}),s}function re(e,i){return function(s){return e(i(s))}}function Re(e){var i=-1,s=Array(e.size);return e.forEach(function(u){s[++i]=u}),s}var Fr=Array.prototype,Rr=Function.prototype,Ft=Object.prototype,ne=it["__core-js_shared__"],ze=function(){var e=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=Rr.toString,ft=Ft.hasOwnProperty,Rt=Ft.toString,zr=RegExp("^"+Ne.call(ft).replace(Or,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kt=Pe?it.Buffer:void 0,zt=it.Symbol,ie=it.Uint8Array,nt=re(Object.getPrototypeOf,Object),He=Object.create,Ue=Ft.propertyIsEnumerable,Nr=Fr.splice,ae=Object.getOwnPropertySymbols,Nt=kt?kt.isBuffer:void 0,Le=re(Object.keys,Object),Ht=ot(it,"DataView"),Ot=ot(it,"Map"),st=ot(it,"Promise"),Ut=ot(it,"Set"),se=ot(it,"WeakMap"),xt=ot(Object,"create"),oe=q(Ht),Mt=q(Ot),ce=q(st),ue=q(Ut),fe=q(se),vt=zt?zt.prototype:void 0,Ge=vt?vt.valueOf:void 0;function yt(e){var i=-1,s=e?e.length:0;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Hr(){this.__data__=xt?xt(null):{}}function Ur(e){return this.has(e)&&delete this.__data__[e]}function Lr(e){var i=this.__data__;if(xt){var s=i[e];return s===a?void 0:s}return ft.call(i,e)?i[e]:void 0}function Be(e){var i=this.__data__;return xt?i[e]!==void 0:ft.call(i,e)}function le(e,i){var s=this.__data__;return s[e]=xt&&i===void 0?a:i,this}yt.prototype.clear=Hr,yt.prototype.delete=Ur,yt.prototype.get=Lr,yt.prototype.has=Be,yt.prototype.set=le;function W(e){var i=-1,s=e?e.length:0;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Gr(){this.__data__=[]}function Br(e){var i=this.__data__,s=Gt(i,e);if(s<0)return!1;var u=i.length-1;return s==u?i.pop():Nr.call(i,s,1),!0}function Wr(e){var i=this.__data__,s=Gt(i,e);return s<0?void 0:i[s][1]}function $r(e){return Gt(this.__data__,e)>-1}function Kr(e,i){var s=this.__data__,u=Gt(s,e);return u<0?s.push([e,i]):s[u][1]=i,this}W.prototype.clear=Gr,W.prototype.delete=Br,W.prototype.get=Wr,W.prototype.has=$r,W.prototype.set=Kr;function K(e){var i=-1,s=e?e.length:0;for(this.clear();++i<s;){var u=e[i];this.set(u[0],u[1])}}function Vr(){this.__data__={hash:new yt,map:new(Ot||W),string:new yt}}function Yr(e){return Dt(this,e).delete(e)}function Xr(e){return Dt(this,e).get(e)}function qr(e){return Dt(this,e).has(e)}function Jr(e,i){return Dt(this,e).set(e,i),this}K.prototype.clear=Vr,K.prototype.delete=Yr,K.prototype.get=Xr,K.prototype.has=qr,K.prototype.set=Jr;function J(e){this.__data__=new W(e)}function Zr(){this.__data__=new W}function Qr(e){return this.__data__.delete(e)}function tn(e){return this.__data__.get(e)}function en(e){return this.__data__.has(e)}function rn(e,i){var s=this.__data__;if(s instanceof W){var u=s.__data__;if(!Ot||u.length<n-1)return u.push([e,i]),this;s=this.__data__=new K(u)}return s.set(e,i),this}J.prototype.clear=Zr,J.prototype.delete=Qr,J.prototype.get=tn,J.prototype.has=en,J.prototype.set=rn;function Lt(e,i){var s=ye(e)||Wt(e)?te(e.length,String):[],u=s.length,A=!!u;for(var I in e)ft.call(e,I)&&!(A&&(I=="length"||bn(I,u)))&&s.push(I);return s}function We(e,i,s){var u=e[i];(!(ft.call(e,i)&&Xe(u,s))||s===void 0&&!(i in e))&&(e[i]=s)}function Gt(e,i){for(var s=e.length;s--;)if(Xe(e[s][0],i))return s;return-1}function lt(e,i){return e&&he(i,be(i),e)}function pe(e,i,s,u,A,I,P){var M;if(u&&(M=I?u(e,A,I,P):u(e)),M!==void 0)return M;if(!dt(e))return e;var L=ye(e);if(L){if(M=yn(e),!i)return pn(e,M)}else{var D=bt(e),V=D==S||D==z;if(qe(e))return Bt(e,i);if(D==v||D==c||V&&!I){if(ee(e))return I?e:{};if(M=pt(V?{}:e),!i)return dn(e,lt(M,e))}else{if(!j[D])return I?e:{};M=mn(e,D,pe,i)}}P||(P=new J);var Z=P.get(e);if(Z)return Z;if(P.set(e,M),!L)var B=s?hn(e):be(e);return De(B||e,function(Y,$){B&&($=Y,Y=e[$]),We(M,$,pe(Y,i,s,u,$,e,P))}),M}function nn(e){return dt(e)?He(e):{}}function an(e,i,s){var u=i(e);return ye(e)?u:Ce(u,s(e))}function sn(e){return Rt.call(e)}function on(e){if(!dt(e)||gn(e))return!1;var i=me(e)||ee(e)?zr:Mr;return i.test(q(e))}function cn(e){if(!Ve(e))return Le(e);var i=[];for(var s in Object(e))ft.call(e,s)&&s!="constructor"&&i.push(s);return i}function Bt(e,i){if(i)return e.slice();var s=new e.constructor(e.length);return e.copy(s),s}function de(e){var i=new e.constructor(e.byteLength);return new ie(i).set(new ie(e)),i}function Pt(e,i){var s=i?de(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function $e(e,i,s){var u=i?s(Fe(e),!0):Fe(e);return Qt(u,jr,new e.constructor)}function Ke(e){var i=new e.constructor(e.source,xr.exec(e));return i.lastIndex=e.lastIndex,i}function un(e,i,s){var u=i?s(Re(e),!0):Re(e);return Qt(u,at,new e.constructor)}function fn(e){return Ge?Object(Ge.call(e)):{}}function ln(e,i){var s=i?de(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function pn(e,i){var s=-1,u=e.length;for(i||(i=Array(u));++s<u;)i[s]=e[s];return i}function he(e,i,s,u){s||(s={});for(var A=-1,I=i.length;++A<I;){var P=i[A],M=void 0;We(s,P,M===void 0?e[P]:M)}return s}function dn(e,i){return he(e,mt(e),i)}function hn(e){return an(e,be,mt)}function Dt(e,i){var s=e.__data__;return _n(i)?s[typeof i=="string"?"string":"hash"]:s.map}function ot(e,i){var s=je(e,i);return on(s)?s:void 0}var mt=ae?re(ae,Object):In,bt=sn;(Ht&&bt(new Ht(new ArrayBuffer(1)))!=O||Ot&&bt(new Ot)!=h||st&&bt(st.resolve())!=f||Ut&&bt(new Ut)!=m||se&&bt(new se)!=y)&&(bt=function(e){var i=Rt.call(e),s=i==v?e.constructor:void 0,u=s?q(s):void 0;if(u)switch(u){case oe:return O;case Mt:return h;case ce:return f;case ue:return m;case fe:return y}return i});function yn(e){var i=e.length,s=e.constructor(i);return i&&typeof e[0]=="string"&&ft.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function pt(e){return typeof e.constructor=="function"&&!Ve(e)?nn(nt(e)):{}}function mn(e,i,s,u){var A=e.constructor;switch(i){case R:return de(e);case d:case k:return new A(+e);case O:return Pt(e,u);case x:case H:case N:case w:case T:case U:case ke:case Oe:case xe:return ln(e,u);case h:return $e(e,u,s);case p:case g:return new A(e);case _:return Ke(e);case m:return un(e,u,s);case b:return fn(e)}}function bn(e,i){return i=i??o,!!i&&(typeof e=="number"||Pr.test(e))&&e>-1&&e%1==0&&e<i}function _n(e){var i=typeof e;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?e!=="__proto__":e===null}function gn(e){return!!ze&&ze in e}function Ve(e){var i=e&&e.constructor,s=typeof i=="function"&&i.prototype||Ft;return e===s}function q(e){if(e!=null){try{return Ne.call(e)}catch{}try{return e+""}catch{}}return""}function Ye(e){return pe(e,!0,!0)}function Xe(e,i){return e===i||e!==e&&i!==i}function Wt(e){return vn(e)&&ft.call(e,"callee")&&(!Ue.call(e,"callee")||Rt.call(e)==c)}var ye=Array.isArray;function $t(e){return e!=null&&Je(e.length)&&!me(e)}function vn(e){return Ze(e)&&$t(e)}var qe=Nt||Sn;function me(e){var i=dt(e)?Rt.call(e):"";return i==S||i==z}function Je(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o}function dt(e){var i=typeof e;return!!e&&(i=="object"||i=="function")}function Ze(e){return!!e&&typeof e=="object"}function be(e){return $t(e)?Lt(e):cn(e)}function In(){return[]}function Sn(){return!1}t.exports=Ye}(Se,Se.exports);var mi=Se.exports;const rt=cr(mi),ur=t=>{const r=t.map(n=>new FontFace(n.fontFamily,`url(${n.url})`).load().catch(a=>a));return r.length===0?Promise.resolve(!0):new Promise((n,a)=>{Promise.all(r).then(o=>{o.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(o=>a(o))})},bi=t=>new Promise((r,n)=>{const a=new Image;console.warn("update cdn config for cors?"),a.onload=()=>{const o=a.width,c=a.height;r({width:o,height:c})},a.onerror=o=>{n(o)},a.crossOrigin="anonymous",a.src=t}),_i=t=>new Promise((r,n)=>{const a=new Audio;a.preload="auto",a.addEventListener("loadedmetadata",()=>{const o=a.duration*1e3;r({duration:o})}),a.addEventListener("error",o=>{n(o)}),a.src=t,a.crossOrigin="anonymous",a.load()}),gi=t=>new Promise((r,n)=>{const a=document.createElement("video");a.preload="auto",a.addEventListener("loadedmetadata",()=>{const o=a.duration*1e3,c=a.videoWidth,l=a.videoHeight;r({duration:o,width:c,height:l})}),a.addEventListener("error",o=>{n(o)}),a.src=t,a.load()}),vi=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(o=>{o!=="height"&&(n.style[o]=r[o])}),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 a=getComputedStyle(n).height;return document.body.removeChild(n),parseFloat(a)},fr={color:"#000000",x:0,y:0,blur:0},we=(t,r)=>{const n=(r==null?void 0:r.duration)||5e3,a={from:0,to:n};if(!t)return a;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),a;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."),a;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),a}return t},Rn=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function lr(t,r){const n={x:t.size.width/2,y:t.size.height/2},a={x:r.width/2,y:r.height/2},o=Math.min(t.size.width/r.width,t.size.height/r.height),c=n.x-a.x;return{top:`${n.y-a.y}px`,left:`${c}px`,transform:`scale(${o})`}}const Ii=async(t,r)=>{const n=t.details.src,a=await gi(n),o=lr(r,{...a}),c={width:a.width,height:a.height,duration:a.duration,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||fr,top:o.top||"0px",left:o.left||"0px",transform:o.transform};return{...t,trim:Rn(t.trim,{duration:a.duration}),type:"video",name:"video",details:c,display:we(t.display,{duration:a.duration})}},Si=async t=>{const r=t.id,n=t.details,o=(await _i(n.src)).duration;return{id:r,name:"",type:"audio",display:we(t.display,{duration:o}),trim:Rn(t.trim,{duration:o}),details:{src:n.src,duration:o,volume:n.volume??100},metadata:{...t.metadata}}},wi=async(t,r)=>{const n=t.details,a=await bi(n.src),o=lr(r,a);return{id:t.id,type:"image",name:"image",display:we(t.display),details:{src:n.src||"",width:n.width||a.width||100,height:n.height||a.height||100,opacity:n.opacity??100,transform:o.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||fr,top:o.top||"0px",left:o.left||"0px",borderWidth:n.borderWidth??0,borderColor:n.borderColor||"#000000"},metadata:t.metadata||{}}},Ti=async(t,r,n=!0)=>{const a=t.id;n&&await ur([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const o=t.details,c=Ai(o),l=vi(t.details.text,c),d=lr(r,{width:c.width,height:l});return{id:a,name:r.type,type:r.type,display:we(t.display),details:{...c,text:o.text||"",height:l,fontUrl:o.fontUrl,top:d.top,left:d.left,borderWidth:o.borderWidth||0,borderColor:o.borderColor||"#000000",boxShadow:o.boxShadow||fr},metadata:{}}},Ai=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||"0px",left:t.left||"0px"}),Ei="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let pr=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=Ei[n[t]&63];return r};function ki(t,r){return t.map(n=>({...n,items:n.items.filter(a=>!r.includes(a))}))}function dr(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let a=pr(t-1);return a=a.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+a}const zn=t=>Object.keys(t).reduce((r,n)=>{const{display:a}=t[n];return Math.max(r,a.to)},0),Nn=async(t,r,n)=>{const a=await Ti(t,{size:{width:1080,height:1920},type:n}),{details:o,...c}=a;return r.trackItemDetailsMap[c.id]={type:n,details:o},r.trackItemsMap[c.id]=c,c.id};function Oi(t){const r=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.DESIGN_PREFIX))),n=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.ADD_PREFIX))),a=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.LAYER_PREFIX))),o=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.HISTORY_PREFIX))),c=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.ACTIVE_PREFIX))),l=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.EDIT_PREFIX))),d=r.subscribe(async p=>{var v;if(p.key===E.DESIGN_LOAD){const f=(v=p.value)==null?void 0:v.payload,_=f.trackItemIds,m=f.trackItemDetailsMap,g=_.map(async b=>{const y=m[b];return(y.type==="caption"||y.type==="text")&&await ur([{fontFamily:y.details.fontFamily,url:y.details.fontUrl}]),!0});await Promise.all(g),t.updateState({...f})}}),k=o.subscribe(p=>{if(p.key===E.HISTORY_UNDO)return t.undo();if(p.key===E.HISTORY_REDO)return t.redo()}),C=a.subscribe(p=>{var f,_;const v=[];(f=p.value)!=null&&f.payload.trackItemIds&&v.push((_=p.value)==null?void 0:_.payload.trackItemIds),t.updateState({activeIds:v})}),S=n.subscribe(async p=>{var b,y,R,O,x,H;const v=[],f=rt(t.getState()),_=((b=p.value)==null?void 0:b.payload.id)??dr();if(v.push(_),p.key===E.ADD_CAPTION){const w=((y=p.value)==null?void 0:y.payload).map(async U=>await Nn(U,f,"caption")),T=await Promise.all(w);v.splice(0,v.length),T.forEach(U=>{v.push(U),f.trackItemIds.push(U)})}if(p.key===E.ADD_TEXT){const N=await Nn((R=p.value)==null?void 0:R.payload,f,"text");f.trackItemIds.push(N)}let m="text";if(p.key===E.ADD_IMAGE){m="image";const N=await wi((O=p.value)==null?void 0:O.payload,{size:{width:1080,height:1920}}),{details:w,...T}=N;f.trackItemDetailsMap[T.id]={type:m,details:w},f.trackItemsMap[T.id]=T,f.trackItemIds.push(T.id)}if(p.key===E.ADD_AUDIO){m="audio";const N=await Si((x=p.value)==null?void 0:x.payload),{details:w,...T}=N;f.trackItemDetailsMap[T.id]={type:m,details:w},f.trackItemsMap[T.id]=T,f.trackItemIds.push(T.id)}if(p.key===E.ADD_VIDEO){m="video";const N=await Ii((H=p.value)==null?void 0:H.payload,{size:{width:1080,height:1920}}),{details:w,...T}=N;f.trackItemDetailsMap[T.id]={type:m,details:w},f.trackItemsMap[T.id]=T,f.trackItemIds.push(T.id)}f.tracks.unshift({id:pr(),accepts:["text","audio","helper","video","image","caption"],type:m,items:v,magnetic:!1,static:!1});const g=zn(f.trackItemsMap);t.updateState({trackItemIds:f.trackItemIds,trackItemDetailsMap:f.trackItemDetailsMap,trackItemsMap:f.trackItemsMap,tracks:f.tracks,duration:g},{updateHistory:!0,kind:"add"})}),z=c.subscribe(async p=>{var v;if(p.key===E.ACTIVE_DELETE){const f=rt(t.getState()),_=f.activeIds,m=f.trackItemIds,g=f.trackItemDetailsMap,b=m.filter(x=>!_.includes(x)),y=Object.fromEntries(Object.entries(g).filter(([x])=>!_.includes(x))),R=ki(f.tracks,_),O=zn(f.trackItemsMap);t.updateState({trackItemIds:b,trackItemDetailsMap:y,activeIds:[],tracks:R,duration:O},{updateHistory:!0,kind:"remove"})}if(p.key===E.ACTIVE_SPLIT){const f=rt(t.getState()),_=(v=p.value)==null?void 0:v.options.time;if(f.activeIds.length===1){const m=f.activeIds[0],g=f.trackItemsMap[m];if(_>=g.display.to||_<=g.display.from)return;const b=f.trackItemDetailsMap[m],y=dr(),R={...g,id:y,display:{from:_,to:g.display.to}};f.trackItemsMap[m].display.to=_,f.trackItemsMap[y]=R,f.trackItemIds.push(y),f.trackItemDetailsMap[y]=b,f.tracks.forEach(O=>{O.items.includes(m)&&O.items.push(y)}),t.updateState({trackItemDetailsMap:f.trackItemDetailsMap,tracks:f.tracks,trackItemIds:f.trackItemIds,trackItemsMap:f.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(p.key===E.ACTIVE_CLONE){const f=rt(t.getState());if(f.activeIds.length){const _=f.activeIds,m=[],g={activeIds:_,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};_.forEach(y=>{g.trackItemDetailsMap[y]=f.trackItemDetailsMap[y],g.trackItemsMap[y]=f.trackItemsMap[y],m.push(f.tracks.find(R=>R.items.includes(y)))});const b=new Set;m.filter(y=>b.has(y.id)?!1:(b.add(y),!0)),g.tracks=Array.from(b.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(g))}}if(p.key===E.ACTIVE_PASTE){const f=localStorage.getItem("DesignComboTemp");if(!f)return;const _=rt(t.getState()),m=JSON.parse(f),g={},b=m.trackItemsMap,y=m.trackItemDetailsMap,R=m.tracks,O=[],x=m.activeIds.map(async H=>{const N=y[H];(N.type==="caption"||N.type==="text")&&await ur([{fontFamily:N.details.fontFamily,url:N.details.fontUrl}]);const w=dr();return g[H]=w,_.trackItemsMap[w]={...b[H],id:w},_.trackItemDetailsMap[w]=N,_.trackItemIds.push(w),!0});await Promise.all(x),R.forEach(H=>{const N=H.items.map(T=>g[T]),w={...H,items:N,id:pr()};O.push(w)}),_.tracks=[..._.tracks,...O],t.updateState({trackItemDetailsMap:_.trackItemDetailsMap,tracks:_.tracks,trackItemIds:_.trackItemIds,trackItemsMap:_.trackItemsMap},{updateHistory:!0,kind:"update"})}}),h=l.subscribe(p=>{var v,f;if(p.key===E.EDIT_OBJECT){const _=t.getState(),m=rt(_.trackItemDetailsMap),g=Object.keys((v=p.value)==null?void 0:v.payload);if(!g.length)return;const b=(f=p.value)==null?void 0:f.payload;g.forEach(y=>{m[y].details={...m[y].details,...b[y].details}}),t.updateState({trackItemDetailsMap:{...m}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{S.unsubscribe(),z.unsubscribe(),h.unsubscribe(),k.unsubscribe(),C.unsubscribe(),d.unsubscribe()}}}const xi={Date:!0,RegExp:!0,String:!0,Number:!0};function Hn(t,r,n={cyclesFix:!0},a=[]){var d,k;let o=[];const c=Array.isArray(t);for(const C in t){const S=t[C],z=c?+C:C;if(!(C in r)){o.push({type:"REMOVE",path:[z],oldValue:t[C]});continue}const h=r[C],p=typeof S=="object"&&typeof h=="object"&&Array.isArray(S)===Array.isArray(h);if(S&&h&&p&&!xi[(k=(d=Object.getPrototypeOf(S))==null?void 0:d.constructor)==null?void 0:k.name]&&(!n.cyclesFix||!a.includes(S))){const v=Hn(S,h,n,n.cyclesFix?a.concat([S]):[]);o.push.apply(o,v.map(f=>(f.path.unshift(z),f)))}else S!==h&&!(Number.isNaN(S)&&Number.isNaN(h))&&!(p&&(isNaN(S)?S+""==h+"":+S==+h))&&o.push({path:[z],type:"CHANGE",value:h,oldValue:S})}const l=Array.isArray(r);for(const C in r)C in t||o.push({type:"CREATE",path:[l?+C:C],value:r[C]});return o}var hr=Symbol.for("immer-nothing"),Kt=Symbol.for("immer-draftable"),Q=Symbol.for("immer-state"),Un=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 G(t,...r){if(process.env.NODE_ENV!=="production"){const n=Un[t],a=typeof n=="function"?n.apply(null,r):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var St=Object.getPrototypeOf;function wt(t){return!!t&&!!t[Q]}function gt(t){var r;return t?Ln(t)||Array.isArray(t)||!!t[Kt]||!!((r=t.constructor)!=null&&r[Kt])||Xt(t)||qt(t):!1}var Mi=Object.prototype.constructor.toString();function Ln(t){if(!t||typeof t!="object")return!1;const r=St(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)===Mi}function Vt(t,r){Tt(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,a)=>r(a,n,t))}function Tt(t){const r=t[Q];return r?r.type_:Array.isArray(t)?1:Xt(t)?2:qt(t)?3:0}function Yt(t,r){return Tt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function yr(t,r){return Tt(t)===2?t.get(r):t[r]}function Gn(t,r,n){const a=Tt(t);a===2?t.set(r,n):a===3?t.add(n):t[r]=n}function Pi(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function Xt(t){return t instanceof Map}function qt(t){return t instanceof Set}function At(t){return t.copy_||t.base_}function mr(t,r){if(Xt(t))return new Map(t);if(qt(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=Ln(t);if(r===!0||r==="class_only"&&!n){const a=Object.getOwnPropertyDescriptors(t);delete a[Q];let o=Reflect.ownKeys(a);for(let c=0;c<o.length;c++){const l=o[c],d=a[l];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(a[l]={configurable:!0,writable:!0,enumerable:d.enumerable,value:t[l]})}return Object.create(St(t),a)}else{const a=St(t);if(a!==null&&n)return{...t};const o=Object.create(a);return Object.assign(o,t)}}function br(t,r=!1){return Te(t)||wt(t)||!gt(t)||(Tt(t)>1&&(t.set=t.add=t.clear=t.delete=Di),Object.freeze(t),r&&Object.entries(t).forEach(([n,a])=>br(a,!0))),t}function Di(){G(2)}function Te(t){return Object.isFrozen(t)}var _r={};function Et(t){const r=_r[t];return r||G(0,t),r}function Ci(t,r){_r[t]||(_r[t]=r)}var Jt;function Bn(){return Jt}function ji(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Wn(t,r){r&&(Et("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function gr(t){vr(t),t.drafts_.forEach(Fi),t.drafts_=null}function vr(t){t===Jt&&(Jt=t.parent_)}function $n(t){return Jt=ji(Jt,t)}function Fi(t){const r=t[Q];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Kn(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[Q].modified_&&(gr(r),G(4)),gt(t)&&(t=Ae(r,t),r.parent_||Ee(r,t)),r.patches_&&Et("Patches").generateReplacementPatches_(n[Q].base_,t,r.patches_,r.inversePatches_)):t=Ae(r,n,[]),gr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==hr?t:void 0}function Ae(t,r,n){if(Te(r))return r;const a=r[Q];if(!a)return Vt(r,(o,c)=>Vn(t,a,r,o,c,n)),r;if(a.scope_!==t)return r;if(!a.modified_)return Ee(t,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const o=a.copy_;let c=o,l=!1;a.type_===3&&(c=new Set(o),o.clear(),l=!0),Vt(c,(d,k)=>Vn(t,a,o,d,k,n,l)),Ee(t,o,!1),n&&t.patches_&&Et("Patches").generatePatches_(a,n,t.patches_,t.inversePatches_)}return a.copy_}function Vn(t,r,n,a,o,c,l){if(process.env.NODE_ENV!=="production"&&o===n&&G(5),wt(o)){const d=c&&r&&r.type_!==3&&!Yt(r.assigned_,a)?c.concat(a):void 0,k=Ae(t,o,d);if(Gn(n,a,k),wt(k))t.canAutoFreeze_=!1;else return}else l&&n.add(o);if(gt(o)&&!Te(o)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;Ae(t,o),(!r||!r.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&Ee(t,o)}}function Ee(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&br(r,n)}function Ri(t,r){const n=Array.isArray(t),a={type_:n?1:0,scope_:r?r.scope_:Bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=a,c=Ir;n&&(o=[a],c=Zt);const{revoke:l,proxy:d}=Proxy.revocable(o,c);return a.draft_=d,a.revoke_=l,d}var Ir={get(t,r){if(r===Q)return t;const n=At(t);if(!Yt(n,r))return zi(t,n,r);const a=n[r];return t.finalized_||!gt(a)?a:a===Sr(t.base_,r)?(Tr(t),t.copy_[r]=Ar(a,t)):a},has(t,r){return r in At(t)},ownKeys(t){return Reflect.ownKeys(At(t))},set(t,r,n){const a=Yn(At(t),r);if(a!=null&&a.set)return a.set.call(t.draft_,n),!0;if(!t.modified_){const o=Sr(At(t),r),c=o==null?void 0:o[Q];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(Pi(n,o)&&(n!==void 0||Yt(t.base_,r)))return!0;Tr(t),wr(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 Sr(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,Tr(t),wr(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=At(t),a=Reflect.getOwnPropertyDescriptor(n,r);return a&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:a.enumerable,value:n[r]}},defineProperty(){G(11)},getPrototypeOf(t){return St(t.base_)},setPrototypeOf(){G(12)}},Zt={};Vt(Ir,(t,r)=>{Zt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Zt.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&G(13),Zt.set.call(this,t,r,void 0)},Zt.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&G(14),Ir.set.call(this,t[0],r,n,t[0])};function Sr(t,r){const n=t[Q];return(n?At(n):t)[r]}function zi(t,r,n){var o;const a=Yn(r,n);return a?"value"in a?a.value:(o=a.get)==null?void 0:o.call(t.draft_):void 0}function Yn(t,r){if(!(r in t))return;let n=St(t);for(;n;){const a=Object.getOwnPropertyDescriptor(n,r);if(a)return a;n=St(n)}}function wr(t){t.modified_||(t.modified_=!0,t.parent_&&wr(t.parent_))}function Tr(t){t.copy_||(t.copy_=mr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Ni=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,n,a)=>{if(typeof r=="function"&&typeof n!="function"){const c=n;n=r;const l=this;return function(k=c,...C){return l.produce(k,S=>n.call(this,S,...C))}}typeof n!="function"&&G(6),a!==void 0&&typeof a!="function"&&G(7);let o;if(gt(r)){const c=$n(this),l=Ar(r,void 0);let d=!0;try{o=n(l),d=!1}finally{d?gr(c):vr(c)}return Wn(c,a),Kn(o,c)}else if(!r||typeof r!="object"){if(o=n(r),o===void 0&&(o=r),o===hr&&(o=void 0),this.autoFreeze_&&br(o,!0),a){const c=[],l=[];Et("Patches").generateReplacementPatches_(r,o,c,l),a(c,l)}return o}else G(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(l,...d)=>this.produceWithPatches(l,k=>r(k,...d));let a,o;return[this.produce(r,n,(l,d)=>{a=l,o=d}),a,o]},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){gt(t)||G(8),wt(t)&&(t=Hi(t));const r=$n(this),n=Ar(t,void 0);return n[Q].isManual_=!0,vr(r),n}finishDraft(t,r){const n=t&&t[Q];(!n||!n.isManual_)&&G(9);const{scope_:a}=n;return Wn(a,r),Kn(void 0,a)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const a=Et("Patches").applyPatches_;return wt(t)?a(t,r):this.produce(t,o=>a(o,r))}};function Ar(t,r){const n=Xt(t)?Et("MapSet").proxyMap_(t,r):qt(t)?Et("MapSet").proxySet_(t,r):Ri(t,r);return(r?r.scope_:Bn()).drafts_.push(n),n}function Hi(t){return wt(t)||G(10,t),Xn(t)}function Xn(t){if(!gt(t)||Te(t))return t;const r=t[Q];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=mr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=mr(t,!0);return Vt(n,(a,o)=>{Gn(n,a,Xn(o))}),r&&(r.finalized_=!1),n}function qn(){process.env.NODE_ENV!=="production"&&Un.push('Sets cannot have "replace" patches.',function(h){return"Unsupported patch operation: "+h},function(h){return"Cannot apply patch, path doesn't resolve: "+h},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",a="remove";function o(h,p,v,f){switch(h.type_){case 0:case 2:return l(h,p,v,f);case 1:return c(h,p,v,f);case 3:return d(h,p,v,f)}}function c(h,p,v,f){let{base_:_,assigned_:m}=h,g=h.copy_;g.length<_.length&&([_,g]=[g,_],[v,f]=[f,v]);for(let b=0;b<_.length;b++)if(m[b]&&g[b]!==_[b]){const y=p.concat([b]);v.push({op:r,path:y,value:z(g[b])}),f.push({op:r,path:y,value:z(_[b])})}for(let b=_.length;b<g.length;b++){const y=p.concat([b]);v.push({op:n,path:y,value:z(g[b])})}for(let b=g.length-1;_.length<=b;--b){const y=p.concat([b]);f.push({op:a,path:y})}}function l(h,p,v,f){const{base_:_,copy_:m}=h;Vt(h.assigned_,(g,b)=>{const y=yr(_,g),R=yr(m,g),O=b?Yt(_,g)?r:n:a;if(y===R&&O===r)return;const x=p.concat(g);v.push(O===a?{op:O,path:x}:{op:O,path:x,value:R}),f.push(O===n?{op:a,path:x}:O===a?{op:n,path:x,value:z(y)}:{op:r,path:x,value:z(y)})})}function d(h,p,v,f){let{base_:_,copy_:m}=h,g=0;_.forEach(b=>{if(!m.has(b)){const y=p.concat([g]);v.push({op:a,path:y,value:b}),f.unshift({op:n,path:y,value:b})}g++}),g=0,m.forEach(b=>{if(!_.has(b)){const y=p.concat([g]);v.push({op:n,path:y,value:b}),f.unshift({op:a,path:y,value:b})}g++})}function k(h,p,v,f){v.push({op:r,path:[],value:p===hr?void 0:p}),f.push({op:r,path:[],value:h})}function C(h,p){return p.forEach(v=>{const{path:f,op:_}=v;let m=h;for(let R=0;R<f.length-1;R++){const O=Tt(m);let x=f[R];typeof x!="string"&&typeof x!="number"&&(x=""+x),(O===0||O===1)&&(x==="__proto__"||x==="constructor")&&G(19),typeof m=="function"&&x==="prototype"&&G(19),m=yr(m,x),typeof m!="object"&&G(18,f.join("/"))}const g=Tt(m),b=S(v.value),y=f[f.length-1];switch(_){case r:switch(g){case 2:return m.set(y,b);case 3:G(16);default:return m[y]=b}case n:switch(g){case 1:return y==="-"?m.push(b):m.splice(y,0,b);case 2:return m.set(y,b);case 3:return m.add(b);default:return m[y]=b}case a:switch(g){case 1:return m.splice(y,1);case 2:return m.delete(y);case 3:return m.delete(v.value);default:return delete m[y]}default:G(17,_)}}),h}function S(h){if(!gt(h))return h;if(Array.isArray(h))return h.map(S);if(Xt(h))return new Map(Array.from(h.entries()).map(([v,f])=>[v,S(f)]));if(qt(h))return new Set(Array.from(h).map(S));const p=Object.create(St(h));for(const v in h)p[v]=S(h[v]);return Yt(h,Kt)&&(p[Kt]=h[Kt]),p}function z(h){return wt(h)?S(h):h}Ci("Patches",{applyPatches_:C,generatePatches_:o,generateReplacementPatches_:k})}var tt=new Ni,Ui=tt.produce;tt.produceWithPatches.bind(tt),tt.setAutoFreeze.bind(tt),tt.setUseStrictShallowCopy.bind(tt);var Li=tt.applyPatches.bind(tt);tt.createDraft.bind(tt),tt.finishDraft.bind(tt);var Gi=1/0,Bi=9007199254740991,Wi="[object Arguments]",$i="[object Function]",Ki="[object GeneratorFunction]",Vi="[object Symbol]",Yi=typeof et=="object"&&et&&et.Object===Object&&et,Xi=typeof self=="object"&&self&&self.Object===Object&&self,qi=Yi||Xi||Function("return this")();function Ji(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 Zi(t,r){for(var n=-1,a=t?t.length:0,o=Array(a);++n<a;)o[n]=r(t[n],n,t);return o}function Qi(t,r){for(var n=-1,a=r.length,o=t.length;++n<a;)t[o+n]=r[n];return t}var Er=Object.prototype,ta=Er.hasOwnProperty,kr=Er.toString,Jn=qi.Symbol,ea=Er.propertyIsEnumerable,Zn=Jn?Jn.isConcatSpreadable:void 0,Qn=Math.max;function ra(t,r,n,a,o){var c=-1,l=t.length;for(n||(n=sa),o||(o=[]);++c<l;){var d=t[c];n(d)?Qi(o,d):o[o.length]=d}return o}function na(t,r){return t=Object(t),ia(t,r,function(n,a){return a in t})}function ia(t,r,n){for(var a=-1,o=r.length,c={};++a<o;){var l=r[a],d=t[l];n(d,l)&&(c[l]=d)}return c}function aa(t,r){return r=Qn(r===void 0?t.length-1:r,0),function(){for(var n=arguments,a=-1,o=Qn(n.length-r,0),c=Array(o);++a<o;)c[a]=n[r+a];a=-1;for(var l=Array(r+1);++a<r;)l[a]=n[a];return l[r]=c,Ji(t,this,l)}}function sa(t){return ua(t)||ca(t)||!!(Zn&&t&&t[Zn])}function oa(t){if(typeof t=="string"||ya(t))return t;var r=t+"";return r=="0"&&1/t==-Gi?"-0":r}function ca(t){return la(t)&&ta.call(t,"callee")&&(!ea.call(t,"callee")||kr.call(t)==Wi)}var ua=Array.isArray;function fa(t){return t!=null&&da(t.length)&&!pa(t)}function la(t){return ti(t)&&fa(t)}function pa(t){var r=ha(t)?kr.call(t):"";return r==$i||r==Ki}function da(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Bi}function ha(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function ti(t){return!!t&&typeof t=="object"}function ya(t){return typeof t=="symbol"||ti(t)&&kr.call(t)==Vi}var ma=aa(function(t,r){return t==null?{}:na(t,Zi(ra(r),oa))}),ba=ma;const ei=cr(ba),_a={tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1},duration:0,activeIds:[],trackItemDetailsMap:{}},ri=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class ga{constructor(r){jt(this,"stateSubject");jt(this,"stateHistorySubject");jt(this,"prevState");jt(this,"undos",[]);jt(this,"redos",[]);jt(this,"listener");const n=r||_a;this.stateSubject=new Fn(n),this.stateHistorySubject=new Fn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){Oi(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const a=ei(r,ri),o=ei(this.getState(),ri),c=Hn(o,a);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 a=this.getState(),o={...a,...r};ut(a,o)||(n.updateHistory&&this.updateHistory(o,n.kind),this.prevState=a,this.stateSubject.next(o))}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{ut(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{ut(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 a=this.undos[this.undos.length-1].type;a==="update"&&r({...this.getState(),type:a}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(n.handleUndo){const a=this.redos[this.redos.length-1].type;a==="update"&&r({...this.getState(),type:a}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(r){return this.stateSubject.asObservable().subscribe(n=>{ut(n.trackItemIds,this.prevState.trackItemIds)||r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{ut(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!ut(n.tracks,this.prevState.tracks)||!ut(n.trackItemIds,this.prevState.trackItemIds)||!ut(n.trackItemsMap,this.prevState.trackItemsMap)||!ut(n.transitionIds,this.prevState.transitionIds)||!ut(n.transitionsMap,this.prevState.transitionsMap))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,a=r==null?void 0:r.type;if(!n||!a)return;qn();const{trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:C}=this.getState(),S=rt({trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:C}),z=[],h=[],p=[],v=[],f=[],_=[];n.forEach(w=>{let T;const U=w.path.slice(1);w.type==="CREATE"?T={path:U,op:"remove",value:w.value}:w.type==="CHANGE"?T={path:U,op:"replace",value:w.oldValue}:T={path:U,op:"add",value:w.oldValue},w.path.includes("trackItemIds")?p.push(T):w.path.includes("transitionIds")?h.push(T):w.path.includes("trackItemsMap")?f.push(T):w.path.includes("transitionsMap")?v.push(T):w.path.includes("tracks")?z.push(T):w.path.includes("trackItemDetailsMap")&&_.push(T)});const m=this.applyPatch(S.tracks,z),g=this.applyPatch(S.transitionIds,h),b=this.applyPatch(S.trackItemIds,p),y=this.applyPatch(S.transitionsMap,v),R=this.applyPatch(S.trackItemsMap,f),O=this.applyPatch(S.trackItemDetailsMap,_),x=rt({tracks:m,transitionIds:g,trackItemIds:b,transitionsMap:y,trackItemsMap:R,trackItemDetailsMap:O}),H=rt(this.getState()),N={...H,...x};this.prevState=H,this.redos.push({redos:n,type:a}),this.stateSubject.next(N),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((a,o)=>Ui(a,c=>{Li(c,[o])}),r)}redo(){const r=this.redos.pop(),n=r==null?void 0:r.redos,a=r==null?void 0:r.type;if(!n||!a)return;qn();const{trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:C}=this.getState(),S=rt({trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:C}),z=[],h=[],p=[],v=[],f=[],_=[];n.forEach(w=>{let T;const U=w.path.slice(1);w.type==="CREATE"?T={path:U,op:"add",value:w.value}:w.type==="CHANGE"?T={path:U,op:"replace",value:w.value}:T={path:U,op:"remove",value:w.oldValue},w.path.includes("trackItemIds")?p.push(T):w.path.includes("transitionIds")?h.push(T):w.path.includes("trackItemsMap")?f.push(T):w.path.includes("transitionsMap")?v.push(T):w.path.includes("trackItemDetailsMap")?_.push(T):z.push(T)});const m=this.applyPatch(S.tracks,z),g=this.applyPatch(S.transitionIds,h),b=this.applyPatch(S.trackItemIds,p),y=this.applyPatch(S.transitionsMap,v),R=this.applyPatch(S.trackItemsMap,f),O=this.applyPatch(S.trackItemDetailsMap,_),x=rt({tracks:m,transitionIds:g,trackItemIds:b,transitionsMap:y,trackItemsMap:R,trackItemDetailsMap:O}),H=rt(this.getState()),N={...H,...x};this.prevState=H,this.undos.push({undos:n,type:a}),this.stateSubject.next(N),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}return ga});
1
+ (function(E,X){typeof exports=="object"&&typeof module<"u"?module.exports=X(require("@designcombo/events")):typeof define=="function"&&define.amd?define(["@designcombo/events"],X):(E=typeof globalThis<"u"?globalThis:E||self,E.events=X(E.events))})(this,function(E){"use strict";var va=Object.defineProperty;var Ia=(E,X,ct)=>X in E?va(E,X,{enumerable:!0,configurable:!0,writable:!0,value:ct}):E[X]=ct;var jt=(E,X,ct)=>Ia(E,typeof X!="symbol"?X+"":X,ct);var X=function(t,r){return X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},X(t,r)};function ct(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");X(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}function ir(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 ar(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),o,c=[],l;try{for(;(r===void 0||r-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(d){l={error:d}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(l)throw l.error}}return c}function sr(t,r,n){if(n||arguments.length===2)for(var i=0,o=r.length,c;i<o;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 ht(t){return typeof t=="function"}function Sn(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 or=Sn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
2
+ `+n.map(function(i,o){return o+1+") "+i.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function cr(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var Ie=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,o,c;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var d=ir(l),k=d.next();!k.done;k=d.next()){var F=k.value;F.remove(this)}}catch(f){r={error:f}}finally{try{k&&!k.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}else l.remove(this);var S=this.initialTeardown;if(ht(S))try{S()}catch(f){c=f instanceof or?f.errors:[f]}var U=this._finalizers;if(U){this._finalizers=null;try{for(var y=ir(U),p=y.next();!p.done;p=y.next()){var h=p.value;try{An(h)}catch(f){c=c??[],f instanceof or?c=sr(sr([],ar(c)),ar(f.errors)):c.push(f)}}}catch(f){i={error:f}}finally{try{p&&!p.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}if(c)throw new or(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)An(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)&&cr(n,r)},t.prototype.remove=function(r){var n=this._finalizers;n&&cr(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),wn=Ie.EMPTY;function Tn(t){return t instanceof Ie||t&&"closed"in t&&ht(t.remove)&&ht(t.add)&&ht(t.unsubscribe)}function An(t){ht(t)?t():t.unsubscribe()}var En={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},kn={setTimeout:function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,sr([t,r],ar(n)))},clearTimeout:function(t){var r=kn.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ai(t){kn.setTimeout(function(){throw t})}function On(){}function Se(t){t()}var xn=function(t){ct(r,t);function r(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Tn(n)&&n.add(i)):i.destination=ui,i}return r.create=function(n,i,o){return new fr(n,i,o)},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}(Ie),si=Function.prototype.bind;function ur(t,r){return si.call(t,r)}var oi=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){we(i)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(i){we(i)}else we(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){we(n)}},t}(),fr=function(t){ct(r,t);function r(n,i,o){var c=t.call(this)||this,l;if(ht(n)||!n)l={next:n??void 0,error:i??void 0,complete:o??void 0};else{var d;c&&En.useDeprecatedNextContext?(d=Object.create(n),d.unsubscribe=function(){return c.unsubscribe()},l={next:n.next&&ur(n.next,d),error:n.error&&ur(n.error,d),complete:n.complete&&ur(n.complete,d)}):l=n}return c.destination=new oi(l),c}return r}(xn);function we(t){ai(t)}function ci(t){throw t}var ui={closed:!0,next:On,error:ci,complete:On},fi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function li(t){return t}function pi(t){return t.length===0?li:t.length===1?t[0]:function(n){return t.reduce(function(i,o){return o(i)},n)}}var Mn=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 o=this,c=hi(r)?r:new fr(r,n,i);return Se(function(){var l=o,d=l.operator,k=l.source;c.add(d?d.call(c,k):k?o._subscribe(c):o._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=Pn(n),new n(function(o,c){var l=new fr({next:function(d){try{r(d)}catch(k){c(k),l.unsubscribe()}},error:c,complete:o});i.subscribe(l)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[fi]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return pi(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Pn(r),new r(function(i,o){var c;n.subscribe(function(l){return c=l},function(l){return o(l)},function(){return i(c)})})},t.create=function(r){return new t(r)},t}();function Pn(t){var r;return(r=t??En.Promise)!==null&&r!==void 0?r:Promise}function di(t){return t&&ht(t.next)&&ht(t.error)&&ht(t.complete)}function hi(t){return t&&t instanceof xn||di(t)&&Tn(t)}var yi=Sn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Dn=function(t){ct(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 Cn(this,this);return i.operator=n,i},r.prototype._throwIfClosed=function(){if(this.closed)throw new yi},r.prototype.next=function(n){var i=this;Se(function(){var o,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var l=ir(i.currentObservers),d=l.next();!d.done;d=l.next()){var k=d.value;k.next(n)}}catch(F){o={error:F}}finally{try{d&&!d.done&&(c=l.return)&&c.call(l)}finally{if(o)throw o.error}}}})},r.prototype.error=function(n){var i=this;Se(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var o=i.observers;o.length;)o.shift().error(n)}})},r.prototype.complete=function(){var n=this;Se(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,o=this,c=o.hasError,l=o.isStopped,d=o.observers;return c||l?wn:(this.currentObservers=null,d.push(n),new Ie(function(){i.currentObservers=null,cr(d,n)}))},r.prototype._checkFinalizedStatuses=function(n){var i=this,o=i.hasError,c=i.thrownError,l=i.isStopped;o?n.error(c):l&&n.complete()},r.prototype.asObservable=function(){var n=new Mn;return n.source=this,n},r.create=function(n,i){return new Cn(n,i)},r}(Mn),Cn=function(t){ct(r,t);function r(n,i){var o=t.call(this)||this;return o.destination=n,o.source=i,o}return r.prototype.next=function(n){var i,o;(o=(i=this.destination)===null||i===void 0?void 0:i.next)===null||o===void 0||o.call(i,n)},r.prototype.error=function(n){var i,o;(o=(i=this.destination)===null||i===void 0?void 0:i.error)===null||o===void 0||o.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,o;return(o=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&o!==void 0?o:wn},r}(Dn),jn=function(t){ct(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,o=n.thrownError,c=n._value;if(i)throw o;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Dn),et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Te={exports:{}};Te.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",o=1,c=2,l=9007199254740991,d="[object Arguments]",k="[object Array]",F="[object AsyncFunction]",S="[object Boolean]",U="[object Date]",y="[object Error]",p="[object Function]",h="[object GeneratorFunction]",f="[object Map]",g="[object Number]",v="[object Null]",_="[object Object]",b="[object Promise]",m="[object Proxy]",N="[object RegExp]",x="[object Set]",O="[object String]",C="[object Symbol]",w="[object Undefined]",T="[object WeakMap]",M="[object ArrayBuffer]",R="[object DataView]",Ft="[object Float32Array]",Rt="[object Float64Array]",De="[object Int8Array]",kr="[object Int16Array]",Or="[object Int32Array]",xr="[object Uint8Array]",Mr="[object Uint8ClampedArray]",z="[object Uint16Array]",Pr="[object Uint32Array]",Dr=/[\\^$.*+?()[\]{}|]/g,it=/^\[object .+?Constructor\]$/,Ce=/^(?:0|[1-9]\d*)$/,H={};H[Ft]=H[Rt]=H[De]=H[kr]=H[Or]=H[xr]=H[Mr]=H[z]=H[Pr]=!0,H[d]=H[k]=H[M]=H[S]=H[R]=H[U]=H[y]=H[p]=H[f]=H[g]=H[_]=H[N]=H[x]=H[O]=H[T]=!1;var je=typeof et=="object"&&et&&et.Object===Object&&et,Cr=typeof self=="object"&&self&&self.Object===Object&&self,at=je||Cr||Function("return this")(),Fe=r&&!r.nodeType&&r,Re=Fe&&!0&&t&&!t.nodeType&&t,re=Re&&Re.exports===Fe,ne=re&&je.process,ze=function(){try{return ne&&ne.binding&&ne.binding("util")}catch{}}(),ie=ze&&ze.isTypedArray;function He(e,a){for(var s=-1,u=e==null?0:e.length,A=0,I=[];++s<u;){var D=e[s];a(D,s,e)&&(I[A++]=D)}return I}function ae(e,a){for(var s=-1,u=a.length,A=e.length;++s<u;)e[A+s]=a[s];return e}function Ne(e,a){for(var s=-1,u=e==null?0:e.length;++s<u;)if(a(e[s],s,e))return!0;return!1}function jr(e,a){for(var s=-1,u=Array(e);++s<e;)u[s]=a(s);return u}function Fr(e){return function(a){return e(a)}}function zt(e,a){return e.has(a)}function se(e,a){return e==null?void 0:e[a]}function Ue(e){var a=-1,s=Array(e.size);return e.forEach(function(u,A){s[++a]=[A,u]}),s}function Le(e,a){return function(s){return e(a(s))}}function ft(e){var a=-1,s=Array(e.size);return e.forEach(function(u){s[++a]=u}),s}var Ht=Array.prototype,Rr=Function.prototype,kt=Object.prototype,Nt=at["__core-js_shared__"],oe=Rr.toString,nt=kt.hasOwnProperty,Ge=function(){var e=/[^.]+$/.exec(Nt&&Nt.keys&&Nt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),We=kt.toString,zr=RegExp("^"+oe.call(nt).replace(Dr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ce=re?at.Buffer:void 0,Ut=at.Symbol,Be=at.Uint8Array,Lt=kt.propertyIsEnumerable,Ot=Ht.splice,st=Ut?Ut.toStringTag:void 0,Gt=Object.getOwnPropertySymbols,ue=ce?ce.isBuffer:void 0,xt=Le(Object.keys,Object),fe=mt(at,"DataView"),Mt=mt(at,"Map"),le=mt(at,"Promise"),pe=mt(at,"Set"),de=mt(at,"WeakMap"),vt=mt(Object,"create"),$e=q(fe),yt=q(Mt),Hr=q(le),Nr=q(pe),Ur=q(de),Ke=Ut?Ut.prototype:void 0,he=Ke?Ke.valueOf:void 0;function B(e){var a=-1,s=e==null?0:e.length;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Lr(){this.__data__=vt?vt(null):{},this.size=0}function Gr(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}function Wr(e){var a=this.__data__;if(vt){var s=a[e];return s===i?void 0:s}return nt.call(a,e)?a[e]:void 0}function Br(e){var a=this.__data__;return vt?a[e]!==void 0:nt.call(a,e)}function $r(e,a){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=vt&&a===void 0?i:a,this}B.prototype.clear=Lr,B.prototype.delete=Gr,B.prototype.get=Wr,B.prototype.has=Br,B.prototype.set=$r;function K(e){var a=-1,s=e==null?0:e.length;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Kr(){this.__data__=[],this.size=0}function Yr(e){var a=this.__data__,s=$t(a,e);if(s<0)return!1;var u=a.length-1;return s==u?a.pop():Ot.call(a,s,1),--this.size,!0}function Vr(e){var a=this.__data__,s=$t(a,e);return s<0?void 0:a[s][1]}function Xr(e){return $t(this.__data__,e)>-1}function qr(e,a){var s=this.__data__,u=$t(s,e);return u<0?(++this.size,s.push([e,a])):s[u][1]=a,this}K.prototype.clear=Kr,K.prototype.delete=Yr,K.prototype.get=Vr,K.prototype.has=Xr,K.prototype.set=qr;function J(e){var a=-1,s=e==null?0:e.length;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Jr(){this.size=0,this.__data__={hash:new B,map:new(Mt||K),string:new B}}function Zr(e){var a=ot(this,e).delete(e);return this.size-=a?1:0,a}function Qr(e){return ot(this,e).get(e)}function tn(e){return ot(this,e).has(e)}function en(e,a){var s=ot(this,e),u=s.size;return s.set(e,a),this.size+=s.size==u?0:1,this}J.prototype.clear=Jr,J.prototype.delete=Zr,J.prototype.get=Qr,J.prototype.has=tn,J.prototype.set=en;function Wt(e){var a=-1,s=e==null?0:e.length;for(this.__data__=new J;++a<s;)this.add(e[a])}function Ye(e){return this.__data__.set(e,i),this}function Bt(e){return this.__data__.has(e)}Wt.prototype.add=Wt.prototype.push=Ye,Wt.prototype.has=Bt;function lt(e){var a=this.__data__=new K(e);this.size=a.size}function ye(){this.__data__=new K,this.size=0}function rn(e){var a=this.__data__,s=a.delete(e);return this.size=a.size,s}function nn(e){return this.__data__.get(e)}function an(e){return this.__data__.has(e)}function sn(e,a){var s=this.__data__;if(s instanceof K){var u=s.__data__;if(!Mt||u.length<n-1)return u.push([e,a]),this.size=++s.size,this;s=this.__data__=new J(u)}return s.set(e,a),this.size=s.size,this}lt.prototype.clear=ye,lt.prototype.delete=rn,lt.prototype.get=nn,lt.prototype.has=an,lt.prototype.set=sn;function on(e,a){var s=Kt(e),u=!s&&Ze(e),A=!s&&!u&&Yt(e),I=!s&&!u&&!A&&er(e),D=s||u||A||I,P=D?jr(e.length,String):[],L=P.length;for(var j in e)nt.call(e,j)&&!(D&&(j=="length"||A&&(j=="offset"||j=="parent")||I&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||yn(j,L)))&&P.push(j);return P}function $t(e,a){for(var s=e.length;s--;)if(Je(e[s][0],a))return s;return-1}function me(e,a,s){var u=a(e);return Kt(e)?u:ae(u,s(e))}function Pt(e){return e==null?e===void 0?w:v:st&&st in Object(e)?bt(e):qe(e)}function Ve(e){return dt(e)&&Pt(e)==d}function Xe(e,a,s,u,A){return e===a?!0:e==null||a==null||!dt(e)&&!dt(a)?e!==e&&a!==a:cn(e,a,s,u,Xe,A)}function cn(e,a,s,u,A,I){var D=Kt(e),P=Kt(a),L=D?k:pt(e),j=P?k:pt(a);L=L==d?_:L,j=j==d?_:j;var Y=L==_,Z=j==_,W=L==j;if(W&&Yt(e)){if(!Yt(a))return!1;D=!0,Y=!1}if(W&&!Y)return I||(I=new lt),D||er(e)?be(e,a,s,u,A,I):pn(e,a,L,s,u,A,I);if(!(s&o)){var V=Y&&nt.call(e,"__wrapped__"),$=Z&&nt.call(a,"__wrapped__");if(V||$){var It=V?e.value():e,gt=$?a.value():a;return I||(I=new lt),A(It,gt,s,u,I)}}return W?(I||(I=new lt),dn(e,a,s,u,A,I)):!1}function un(e){if(!tr(e)||bn(e))return!1;var a=Qe(e)?zr:it;return a.test(q(e))}function fn(e){return dt(e)&&_e(e.length)&&!!H[Pt(e)]}function ln(e){if(!gn(e))return xt(e);var a=[];for(var s in Object(e))nt.call(e,s)&&s!="constructor"&&a.push(s);return a}function be(e,a,s,u,A,I){var D=s&o,P=e.length,L=a.length;if(P!=L&&!(D&&L>P))return!1;var j=I.get(e);if(j&&I.get(a))return j==a;var Y=-1,Z=!0,W=s&c?new Wt:void 0;for(I.set(e,a),I.set(a,e);++Y<P;){var V=e[Y],$=a[Y];if(u)var It=D?u($,V,Y,a,e,I):u(V,$,Y,e,a,I);if(It!==void 0){if(It)continue;Z=!1;break}if(W){if(!Ne(a,function(gt,Ct){if(!zt(W,Ct)&&(V===gt||A(V,gt,s,u,I)))return W.push(Ct)})){Z=!1;break}}else if(!(V===$||A(V,$,s,u,I))){Z=!1;break}}return I.delete(e),I.delete(a),Z}function pn(e,a,s,u,A,I,D){switch(s){case R:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case M:return!(e.byteLength!=a.byteLength||!I(new Be(e),new Be(a)));case S:case U:case g:return Je(+e,+a);case y:return e.name==a.name&&e.message==a.message;case N:case O:return e==a+"";case f:var P=Ue;case x:var L=u&o;if(P||(P=ft),e.size!=a.size&&!L)return!1;var j=D.get(e);if(j)return j==a;u|=c,D.set(e,a);var Y=be(P(e),P(a),u,A,I,D);return D.delete(e),Y;case C:if(he)return he.call(e)==he.call(a)}return!1}function dn(e,a,s,u,A,I){var D=s&o,P=Dt(e),L=P.length,j=Dt(a),Y=j.length;if(L!=Y&&!D)return!1;for(var Z=L;Z--;){var W=P[Z];if(!(D?W in a:nt.call(a,W)))return!1}var V=I.get(e);if(V&&I.get(a))return V==a;var $=!0;I.set(e,a),I.set(a,e);for(var It=D;++Z<L;){W=P[Z];var gt=e[W],Ct=a[W];if(u)var ii=D?u(Ct,gt,W,a,e,I):u(gt,Ct,W,e,a,I);if(!(ii===void 0?gt===Ct||A(gt,Ct,s,u,I):ii)){$=!1;break}It||(It=W=="constructor")}if($&&!It){var rr=e.constructor,nr=a.constructor;rr!=nr&&"constructor"in e&&"constructor"in a&&!(typeof rr=="function"&&rr instanceof rr&&typeof nr=="function"&&nr instanceof nr)&&($=!1)}return I.delete(e),I.delete(a),$}function Dt(e){return me(e,ve,hn)}function ot(e,a){var s=e.__data__;return mn(a)?s[typeof a=="string"?"string":"hash"]:s.map}function mt(e,a){var s=se(e,a);return un(s)?s:void 0}function bt(e){var a=nt.call(e,st),s=e[st];try{e[st]=void 0;var u=!0}catch{}var A=We.call(e);return u&&(a?e[st]=s:delete e[st]),A}var hn=Gt?function(e){return e==null?[]:(e=Object(e),He(Gt(e),function(a){return Lt.call(e,a)}))}:vn,pt=Pt;(fe&&pt(new fe(new ArrayBuffer(1)))!=R||Mt&&pt(new Mt)!=f||le&&pt(le.resolve())!=b||pe&&pt(new pe)!=x||de&&pt(new de)!=T)&&(pt=function(e){var a=Pt(e),s=a==_?e.constructor:void 0,u=s?q(s):"";if(u)switch(u){case $e:return R;case yt:return f;case Hr:return b;case Nr:return x;case Ur:return T}return a});function yn(e,a){return a=a??l,!!a&&(typeof e=="number"||Ce.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 bn(e){return!!Ge&&Ge in e}function gn(e){var a=e&&e.constructor,s=typeof a=="function"&&a.prototype||kt;return e===s}function qe(e){return We.call(e)}function q(e){if(e!=null){try{return oe.call(e)}catch{}try{return e+""}catch{}}return""}function Je(e,a){return e===a||e!==e&&a!==a}var Ze=Ve(function(){return arguments}())?Ve:function(e){return dt(e)&&nt.call(e,"callee")&&!Lt.call(e,"callee")},Kt=Array.isArray;function ge(e){return e!=null&&_e(e.length)&&!Qe(e)}var Yt=ue||In;function _n(e,a){return Xe(e,a)}function Qe(e){if(!tr(e))return!1;var a=Pt(e);return a==p||a==h||a==F||a==m}function _e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=l}function tr(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}function dt(e){return e!=null&&typeof e=="object"}var er=ie?Fr(ie):fn;function ve(e){return ge(e)?on(e):ln(e)}function vn(){return[]}function In(){return!1}t.exports=_n}(Te,Te.exports);var mi=Te.exports;const ut=lr(mi);var Ae={exports:{}};Ae.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",o=9007199254740991,c="[object Arguments]",l="[object Array]",d="[object Boolean]",k="[object Date]",F="[object Error]",S="[object Function]",U="[object GeneratorFunction]",y="[object Map]",p="[object Number]",h="[object Object]",f="[object Promise]",g="[object RegExp]",v="[object Set]",_="[object String]",b="[object Symbol]",m="[object WeakMap]",N="[object ArrayBuffer]",x="[object DataView]",O="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",T="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",Ft="[object Uint8ClampedArray]",Rt="[object Uint16Array]",De="[object Uint32Array]",kr=/[\\^$.*+?()[\]{}|]/g,Or=/\w*$/,xr=/^\[object .+?Constructor\]$/,Mr=/^(?:0|[1-9]\d*)$/,z={};z[c]=z[l]=z[N]=z[x]=z[d]=z[k]=z[O]=z[C]=z[w]=z[T]=z[M]=z[y]=z[p]=z[h]=z[g]=z[v]=z[_]=z[b]=z[R]=z[Ft]=z[Rt]=z[De]=!0,z[F]=z[S]=z[m]=!1;var Pr=typeof et=="object"&&et&&et.Object===Object&&et,Dr=typeof self=="object"&&self&&self.Object===Object&&self,it=Pr||Dr||Function("return this")(),Ce=r&&!r.nodeType&&r,H=Ce&&!0&&t&&!t.nodeType&&t,je=H&&H.exports===Ce;function Cr(e,a){return e.set(a[0],a[1]),e}function at(e,a){return e.add(a),e}function Fe(e,a){for(var s=-1,u=e?e.length:0;++s<u&&a(e[s],s,e)!==!1;);return e}function Re(e,a){for(var s=-1,u=a.length,A=e.length;++s<u;)e[A+s]=a[s];return e}function re(e,a,s,u){for(var A=-1,I=e?e.length:0;++A<I;)s=a(s,e[A],A,e);return s}function ne(e,a){for(var s=-1,u=Array(e);++s<e;)u[s]=a(s);return u}function ze(e,a){return e==null?void 0:e[a]}function ie(e){var a=!1;if(e!=null&&typeof e.toString!="function")try{a=!!(e+"")}catch{}return a}function He(e){var a=-1,s=Array(e.size);return e.forEach(function(u,A){s[++a]=[A,u]}),s}function ae(e,a){return function(s){return e(a(s))}}function Ne(e){var a=-1,s=Array(e.size);return e.forEach(function(u){s[++a]=u}),s}var jr=Array.prototype,Fr=Function.prototype,zt=Object.prototype,se=it["__core-js_shared__"],Ue=function(){var e=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Le=Fr.toString,ft=zt.hasOwnProperty,Ht=zt.toString,Rr=RegExp("^"+Le.call(ft).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kt=je?it.Buffer:void 0,Nt=it.Symbol,oe=it.Uint8Array,nt=ae(Object.getPrototypeOf,Object),Ge=Object.create,We=zt.propertyIsEnumerable,zr=jr.splice,ce=Object.getOwnPropertySymbols,Ut=kt?kt.isBuffer:void 0,Be=ae(Object.keys,Object),Lt=ot(it,"DataView"),Ot=ot(it,"Map"),st=ot(it,"Promise"),Gt=ot(it,"Set"),ue=ot(it,"WeakMap"),xt=ot(Object,"create"),fe=q(Lt),Mt=q(Ot),le=q(st),pe=q(Gt),de=q(ue),vt=Nt?Nt.prototype:void 0,$e=vt?vt.valueOf:void 0;function yt(e){var a=-1,s=e?e.length:0;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Hr(){this.__data__=xt?xt(null):{}}function Nr(e){return this.has(e)&&delete this.__data__[e]}function Ur(e){var a=this.__data__;if(xt){var s=a[e];return s===i?void 0:s}return ft.call(a,e)?a[e]:void 0}function Ke(e){var a=this.__data__;return xt?a[e]!==void 0:ft.call(a,e)}function he(e,a){var s=this.__data__;return s[e]=xt&&a===void 0?i:a,this}yt.prototype.clear=Hr,yt.prototype.delete=Nr,yt.prototype.get=Ur,yt.prototype.has=Ke,yt.prototype.set=he;function B(e){var a=-1,s=e?e.length:0;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Lr(){this.__data__=[]}function Gr(e){var a=this.__data__,s=Bt(a,e);if(s<0)return!1;var u=a.length-1;return s==u?a.pop():zr.call(a,s,1),!0}function Wr(e){var a=this.__data__,s=Bt(a,e);return s<0?void 0:a[s][1]}function Br(e){return Bt(this.__data__,e)>-1}function $r(e,a){var s=this.__data__,u=Bt(s,e);return u<0?s.push([e,a]):s[u][1]=a,this}B.prototype.clear=Lr,B.prototype.delete=Gr,B.prototype.get=Wr,B.prototype.has=Br,B.prototype.set=$r;function K(e){var a=-1,s=e?e.length:0;for(this.clear();++a<s;){var u=e[a];this.set(u[0],u[1])}}function Kr(){this.__data__={hash:new yt,map:new(Ot||B),string:new yt}}function Yr(e){return Dt(this,e).delete(e)}function Vr(e){return Dt(this,e).get(e)}function Xr(e){return Dt(this,e).has(e)}function qr(e,a){return Dt(this,e).set(e,a),this}K.prototype.clear=Kr,K.prototype.delete=Yr,K.prototype.get=Vr,K.prototype.has=Xr,K.prototype.set=qr;function J(e){this.__data__=new B(e)}function Jr(){this.__data__=new B}function Zr(e){return this.__data__.delete(e)}function Qr(e){return this.__data__.get(e)}function tn(e){return this.__data__.has(e)}function en(e,a){var s=this.__data__;if(s instanceof B){var u=s.__data__;if(!Ot||u.length<n-1)return u.push([e,a]),this;s=this.__data__=new K(u)}return s.set(e,a),this}J.prototype.clear=Jr,J.prototype.delete=Zr,J.prototype.get=Qr,J.prototype.has=tn,J.prototype.set=en;function Wt(e,a){var s=ge(e)||Kt(e)?ne(e.length,String):[],u=s.length,A=!!u;for(var I in e)ft.call(e,I)&&!(A&&(I=="length"||mn(I,u)))&&s.push(I);return s}function Ye(e,a,s){var u=e[a];(!(ft.call(e,a)&&Ze(u,s))||s===void 0&&!(a in e))&&(e[a]=s)}function Bt(e,a){for(var s=e.length;s--;)if(Ze(e[s][0],a))return s;return-1}function lt(e,a){return e&&be(a,ve(a),e)}function ye(e,a,s,u,A,I,D){var P;if(u&&(P=I?u(e,A,I,D):u(e)),P!==void 0)return P;if(!dt(e))return e;var L=ge(e);if(L){if(P=hn(e),!a)return ln(e,P)}else{var j=bt(e),Y=j==S||j==U;if(Qe(e))return $t(e,a);if(j==h||j==c||Y&&!I){if(ie(e))return I?e:{};if(P=pt(Y?{}:e),!a)return pn(e,lt(P,e))}else{if(!z[j])return I?e:{};P=yn(e,j,ye,a)}}D||(D=new J);var Z=D.get(e);if(Z)return Z;if(D.set(e,P),!L)var W=s?dn(e):ve(e);return Fe(W||e,function(V,$){W&&($=V,V=e[$]),Ye(P,$,ye(V,a,s,u,$,e,D))}),P}function rn(e){return dt(e)?Ge(e):{}}function nn(e,a,s){var u=a(e);return ge(e)?u:Re(u,s(e))}function an(e){return Ht.call(e)}function sn(e){if(!dt(e)||gn(e))return!1;var a=_e(e)||ie(e)?Rr:xr;return a.test(q(e))}function on(e){if(!qe(e))return Be(e);var a=[];for(var s in Object(e))ft.call(e,s)&&s!="constructor"&&a.push(s);return a}function $t(e,a){if(a)return e.slice();var s=new e.constructor(e.length);return e.copy(s),s}function me(e){var a=new e.constructor(e.byteLength);return new oe(a).set(new oe(e)),a}function Pt(e,a){var s=a?me(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Ve(e,a,s){var u=a?s(He(e),!0):He(e);return re(u,Cr,new e.constructor)}function Xe(e){var a=new e.constructor(e.source,Or.exec(e));return a.lastIndex=e.lastIndex,a}function cn(e,a,s){var u=a?s(Ne(e),!0):Ne(e);return re(u,at,new e.constructor)}function un(e){return $e?Object($e.call(e)):{}}function fn(e,a){var s=a?me(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ln(e,a){var s=-1,u=e.length;for(a||(a=Array(u));++s<u;)a[s]=e[s];return a}function be(e,a,s,u){s||(s={});for(var A=-1,I=a.length;++A<I;){var D=a[A],P=void 0;Ye(s,D,P===void 0?e[D]:P)}return s}function pn(e,a){return be(e,mt(e),a)}function dn(e){return nn(e,ve,mt)}function Dt(e,a){var s=e.__data__;return bn(a)?s[typeof a=="string"?"string":"hash"]:s.map}function ot(e,a){var s=ze(e,a);return sn(s)?s:void 0}var mt=ce?ae(ce,Object):vn,bt=an;(Lt&&bt(new Lt(new ArrayBuffer(1)))!=x||Ot&&bt(new Ot)!=y||st&&bt(st.resolve())!=f||Gt&&bt(new Gt)!=v||ue&&bt(new ue)!=m)&&(bt=function(e){var a=Ht.call(e),s=a==h?e.constructor:void 0,u=s?q(s):void 0;if(u)switch(u){case fe:return x;case Mt:return y;case le:return f;case pe:return v;case de:return m}return a});function hn(e){var a=e.length,s=e.constructor(a);return a&&typeof e[0]=="string"&&ft.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function pt(e){return typeof e.constructor=="function"&&!qe(e)?rn(nt(e)):{}}function yn(e,a,s,u){var A=e.constructor;switch(a){case N:return me(e);case d:case k:return new A(+e);case x:return Pt(e,u);case O:case C:case w:case T:case M:case R:case Ft:case Rt:case De:return fn(e,u);case y:return Ve(e,u,s);case p:case _:return new A(e);case g:return Xe(e);case v:return cn(e,u,s);case b:return un(e)}}function mn(e,a){return a=a??o,!!a&&(typeof e=="number"||Mr.test(e))&&e>-1&&e%1==0&&e<a}function bn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function gn(e){return!!Ue&&Ue in e}function qe(e){var a=e&&e.constructor,s=typeof a=="function"&&a.prototype||zt;return e===s}function q(e){if(e!=null){try{return Le.call(e)}catch{}try{return e+""}catch{}}return""}function Je(e){return ye(e,!0,!0)}function Ze(e,a){return e===a||e!==e&&a!==a}function Kt(e){return _n(e)&&ft.call(e,"callee")&&(!We.call(e,"callee")||Ht.call(e)==c)}var ge=Array.isArray;function Yt(e){return e!=null&&tr(e.length)&&!_e(e)}function _n(e){return er(e)&&Yt(e)}var Qe=Ut||In;function _e(e){var a=dt(e)?Ht.call(e):"";return a==S||a==U}function tr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o}function dt(e){var a=typeof e;return!!e&&(a=="object"||a=="function")}function er(e){return!!e&&typeof e=="object"}function ve(e){return Yt(e)?Wt(e):on(e)}function vn(){return[]}function In(){return!1}t.exports=Je}(Ae,Ae.exports);var bi=Ae.exports;const rt=lr(bi),gi=t=>new Promise((r,n)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const o=i.width,c=i.height;r({width:o,height:c})},i.onerror=o=>{n(o)},i.crossOrigin="anonymous",i.src=t}),_i=t=>new Promise((r,n)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const o=i.duration*1e3;r({duration:o})}),i.addEventListener("error",o=>{n(o)}),i.src=t,i.crossOrigin="anonymous",i.load()}),vi=t=>new Promise((r,n)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const o=i.duration*1e3,c=i.videoWidth,l=i.videoHeight;r({duration:o,width:c,height:l})}),i.addEventListener("error",o=>{n(o)}),i.src=t,i.load()}),Fn=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(o=>{o!=="height"&&(n.style[o]=r[o])}),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)},Ee=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(o=>{o.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(o=>i(o))})},ke={color:"#000000",x:0,y:0,blur:0},Vt=(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},Rn=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function Oe(t,r){const n={x:t.size.width/2,y:t.size.height/2},i={x:r.width/2,y:r.height/2},o=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(${o})`}}const Ii=async(t,r)=>{const n=t.details.src,i=await vi(n),o=Oe(r,{...i}),c=Rn(t.trim,{duration:i.duration}),l={width:i.width,height:i.height,duration:i.duration,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||ke,top:o.top||"0px",left:o.left||"0px",transform:o.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1};return{...t,trim:c,type:"video",name:"video",details:l,display:Vt(t.display,{duration:i.duration,trim:c})}},Si=async t=>{const r=t.id,n=t.details,o=(await _i(n.src)).duration,c=Rn(t.trim,{duration:o});return{id:r,name:"",type:"audio",display:Vt(t.display,{duration:o,trim:c}),trim:c,details:{src:n.src,duration:o,volume:n.volume??100},metadata:{...t.metadata}}},wi=async(t,r)=>{const n=t.details,i=await gi(n.src),o=Oe(r,i);return{id:t.id,type:"image",name:"image",display:Vt(t.display),details:{src:n.src||"",width:n.width||i.width||100,height:n.height||i.height||100,opacity:n.opacity??100,transform:o.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||ke,top:o.top||"0px",left:o.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},metadata:t.metadata||{}}},Ti=async(t,r)=>{await Ee([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,o=zn(i),c=Fn(t.details.text,o),l=Oe(r,{width:o.width,height:c});return{id:n,name:"caption",type:"caption",display:Vt(t.display),details:{...o,text:i.text||"",height:c,fontUrl:i.fontUrl,top:l.top,left:l.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||ke},metadata:{}}},Ai=async(t,r)=>{await Ee([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,o=zn(i),c=Fn(t.details.text,o),l=Oe(r,{width:o.width,height:c});return{id:n,name:"text",type:"text",display:Vt(t.display),details:{...o,text:i.text||"",height:c,fontUrl:i.fontUrl,top:l.top,left:l.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||ke},metadata:{}}},zn=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||"0px",left:t.left||"0px",textTransform:t.textTransform||"none"}),Ei="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let pr=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=Ei[n[t]&63];return r};function ki(t,r){return t.filter(i=>({...i,items:i.items.filter(o=>!r.includes(o))})).filter(i=>!i.items.length)}function Hn(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let i=pr(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+i}const Nn=t=>Object.keys(t).reduce((r,n)=>{const{display:i}=t[n];return Math.max(r,i.to)},0);function Oi(t){const r=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.DESIGN_PREFIX))),n=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.ADD_PREFIX))),i=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.LAYER_PREFIX))),o=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.HISTORY_PREFIX))),c=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.ACTIVE_PREFIX))),l=E.subject.pipe(E.filter(({key:p})=>p.startsWith(E.EDIT_PREFIX))),d=r.subscribe(async p=>{var h;if(p.key===E.DESIGN_LOAD){const f=(h=p.value)==null?void 0:h.payload,g=f.trackItemIds,v=f.trackItemDetailsMap,_=g.map(async b=>{const m=v[b];return(m.type==="caption"||m.type==="text")&&await Ee([{fontFamily:m.details.fontFamily,url:m.details.fontUrl}]),!0});await Promise.all(_),t.updateState({...f})}}),k=o.subscribe(p=>{if(p.key===E.HISTORY_UNDO)return t.undo();if(p.key===E.HISTORY_REDO)return t.redo()}),F=i.subscribe(p=>{var f,g,v;const h=[];if((f=p.value)!=null&&f.payload.trackItemIds&&(h.push((g=p.value)==null?void 0:g.payload.trackItemIds),t.updateState({activeIds:h})),p.key===E.LAYER_DELETE){const _=(v=p.value)==null?void 0:v.payload.trackItemIds,b=rt(t.getState()),m=_&&_.length?_:b.activeIds,N=b.trackItemIds,x=b.trackItemDetailsMap,O=N.filter(R=>!m.includes(R)),C=Object.fromEntries(Object.entries(x).filter(([R])=>!m.includes(R))),w=ki(b.tracks,m),T=Object.fromEntries(Object.entries(b.trackItemsMap).filter(([R])=>!m.includes(R))),M=Nn(b.trackItemsMap);t.updateState({trackItemIds:O,trackItemDetailsMap:C,activeIds:[],trackItemsMap:T,tracks:w,duration:M},{updateHistory:!0,kind:"remove"})}}),S=n.subscribe(async p=>{var _,b,m,N,x;const h=rt(t.getState());let f=[],g="text";if(p.key===E.ADD_CAPTION){const O=(_=p.value)==null?void 0:_.payload,C=[];for(const M of O){const R=Ti(M,{size:{width:1080,height:1920}});C.push(R)}const w=await Promise.all(C),T=[];for(const M of w){const R=M.id;T.push(R);const{details:Ft,...Rt}=M;h.trackItemDetailsMap[R]={type:g,details:Ft},h.trackItemsMap[R]=Rt,h.trackItemIds.push(R)}f=T}if(p.key===E.ADD_TEXT){g="text";const O=await Ai((b=p.value)==null?void 0:b.payload,{size:{width:1080,height:1920}}),{details:C,...w}=O;h.trackItemDetailsMap[w.id]={type:g,details:C},h.trackItemsMap[w.id]=w,h.trackItemIds.push(w.id),f=[w.id]}if(p.key===E.ADD_IMAGE){g="image";const O=await wi((m=p.value)==null?void 0:m.payload,{size:{width:1080,height:1920}}),{details:C,...w}=O;h.trackItemDetailsMap[w.id]={type:g,details:C},h.trackItemsMap[w.id]=w,h.trackItemIds.push(w.id),f=[w.id]}if(p.key===E.ADD_AUDIO){g="audio";const O=await Si((N=p.value)==null?void 0:N.payload),{details:C,...w}=O;h.trackItemDetailsMap[w.id]={type:g,details:C},h.trackItemsMap[w.id]=w,h.trackItemIds.push(w.id),f=[w.id]}if(p.key===E.ADD_VIDEO){g="video";const O=await Ii((x=p.value)==null?void 0:x.payload,{size:{width:1080,height:1920}}),{details:C,...w}=O;h.trackItemDetailsMap[w.id]={type:g,details:C},h.trackItemsMap[w.id]=w,h.trackItemIds.push(w.id),f=[w.id]}h.tracks.unshift({id:pr(),accepts:["text","audio","helper","video","image","caption"],type:g,items:f,magnetic:!1,static:!1});const v=Nn(h.trackItemsMap);t.updateState({trackItemIds:h.trackItemIds,trackItemDetailsMap:h.trackItemDetailsMap,trackItemsMap:h.trackItemsMap,tracks:h.tracks,duration:v},{updateHistory:!0,kind:"add"})}),U=c.subscribe(async p=>{var h;if(p.key===E.ACTIVE_SPLIT){const f=rt(t.getState()),g=(h=p.value)==null?void 0:h.options.time;if(f.activeIds.length===1){const v=f.activeIds[0],_=f.trackItemsMap[v];if(g>=_.display.to||g<=_.display.from)return;const b=f.trackItemDetailsMap[v],m=Hn(),N={..._,id:m,display:{from:g,to:_.display.to}};f.trackItemsMap[v].display.to=g,f.trackItemsMap[m]=N,f.trackItemIds.push(m),f.trackItemDetailsMap[m]=b,f.tracks.forEach(x=>{x.items.includes(v)&&x.items.push(m)}),t.updateState({trackItemDetailsMap:f.trackItemDetailsMap,tracks:f.tracks,trackItemIds:f.trackItemIds,trackItemsMap:f.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(p.key===E.ACTIVE_CLONE){const f=rt(t.getState());if(f.activeIds.length){const g=f.activeIds,v=[],_={activeIds:g,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};g.forEach(m=>{_.trackItemDetailsMap[m]=f.trackItemDetailsMap[m],_.trackItemsMap[m]=f.trackItemsMap[m],v.push(f.tracks.find(N=>N.items.includes(m)))});const b=new Set;v.filter(m=>b.has(m.id)?!1:(b.add(m),!0)),_.tracks=Array.from(b.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(_))}}if(p.key===E.ACTIVE_PASTE){const f=localStorage.getItem("DesignComboTemp");if(!f)return;const g=rt(t.getState()),v=JSON.parse(f),_={},b=v.trackItemsMap,m=v.trackItemDetailsMap,N=v.tracks,x=[],O=v.activeIds.map(async C=>{const w=m[C];(w.type==="caption"||w.type==="text")&&await Ee([{fontFamily:w.details.fontFamily,url:w.details.fontUrl}]);const T=Hn();return _[C]=T,g.trackItemsMap[T]={...b[C],id:T},g.trackItemDetailsMap[T]=w,g.trackItemIds.push(T),!0});await Promise.all(O),N.forEach(C=>{const w=C.items.map(M=>_[M]),T={...C,items:w,id:pr()};x.push(T)}),g.tracks=[...g.tracks,...x],t.updateState({trackItemDetailsMap:g.trackItemDetailsMap,tracks:g.tracks,trackItemIds:g.trackItemIds,trackItemsMap:g.trackItemsMap},{updateHistory:!0,kind:"update"})}}),y=l.subscribe(p=>{var h,f;if(p.key===E.EDIT_OBJECT){const g=t.getState(),v=rt(g.trackItemDetailsMap),_=Object.keys((h=p.value)==null?void 0:h.payload);if(!_.length)return;const b=(f=p.value)==null?void 0:f.payload;_.forEach(m=>{v[m].details={...v[m].details,...b[m].details}}),t.updateState({trackItemDetailsMap:{...v}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{S.unsubscribe(),U.unsubscribe(),y.unsubscribe(),k.unsubscribe(),F.unsubscribe(),d.unsubscribe()}}}const xi={Date:!0,RegExp:!0,String:!0,Number:!0};function Un(t,r,n={cyclesFix:!0},i=[]){var d,k;let o=[];const c=Array.isArray(t);for(const F in t){const S=t[F],U=c?+F:F;if(!(F in r)){o.push({type:"REMOVE",path:[U],oldValue:t[F]});continue}const y=r[F],p=typeof S=="object"&&typeof y=="object"&&Array.isArray(S)===Array.isArray(y);if(S&&y&&p&&!xi[(k=(d=Object.getPrototypeOf(S))==null?void 0:d.constructor)==null?void 0:k.name]&&(!n.cyclesFix||!i.includes(S))){const h=Un(S,y,n,n.cyclesFix?i.concat([S]):[]);o.push.apply(o,h.map(f=>(f.path.unshift(U),f)))}else S!==y&&!(Number.isNaN(S)&&Number.isNaN(y))&&!(p&&(isNaN(S)?S+""==y+"":+S==+y))&&o.push({path:[U],type:"CHANGE",value:y,oldValue:S})}const l=Array.isArray(r);for(const F in r)F in t||o.push({type:"CREATE",path:[l?+F:F],value:r[F]});return o}var dr=Symbol.for("immer-nothing"),Xt=Symbol.for("immer-draftable"),Q=Symbol.for("immer-state"),Ln=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 G(t,...r){if(process.env.NODE_ENV!=="production"){const n=Ln[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 St=Object.getPrototypeOf;function wt(t){return!!t&&!!t[Q]}function _t(t){var r;return t?Gn(t)||Array.isArray(t)||!!t[Xt]||!!((r=t.constructor)!=null&&r[Xt])||Zt(t)||Qt(t):!1}var Mi=Object.prototype.constructor.toString();function Gn(t){if(!t||typeof t!="object")return!1;const r=St(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)===Mi}function qt(t,r){Tt(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,i)=>r(i,n,t))}function Tt(t){const r=t[Q];return r?r.type_:Array.isArray(t)?1:Zt(t)?2:Qt(t)?3:0}function Jt(t,r){return Tt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function hr(t,r){return Tt(t)===2?t.get(r):t[r]}function Wn(t,r,n){const i=Tt(t);i===2?t.set(r,n):i===3?t.add(n):t[r]=n}function Pi(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function Zt(t){return t instanceof Map}function Qt(t){return t instanceof Set}function At(t){return t.copy_||t.base_}function yr(t,r){if(Zt(t))return new Map(t);if(Qt(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=Gn(t);if(r===!0||r==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[Q];let o=Reflect.ownKeys(i);for(let c=0;c<o.length;c++){const l=o[c],d=i[l];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(i[l]={configurable:!0,writable:!0,enumerable:d.enumerable,value:t[l]})}return Object.create(St(t),i)}else{const i=St(t);if(i!==null&&n)return{...t};const o=Object.create(i);return Object.assign(o,t)}}function mr(t,r=!1){return xe(t)||wt(t)||!_t(t)||(Tt(t)>1&&(t.set=t.add=t.clear=t.delete=Di),Object.freeze(t),r&&Object.entries(t).forEach(([n,i])=>mr(i,!0))),t}function Di(){G(2)}function xe(t){return Object.isFrozen(t)}var br={};function Et(t){const r=br[t];return r||G(0,t),r}function Ci(t,r){br[t]||(br[t]=r)}var te;function Bn(){return te}function ji(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $n(t,r){r&&(Et("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function gr(t){_r(t),t.drafts_.forEach(Fi),t.drafts_=null}function _r(t){t===te&&(te=t.parent_)}function Kn(t){return te=ji(te,t)}function Fi(t){const r=t[Q];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Yn(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[Q].modified_&&(gr(r),G(4)),_t(t)&&(t=Me(r,t),r.parent_||Pe(r,t)),r.patches_&&Et("Patches").generateReplacementPatches_(n[Q].base_,t,r.patches_,r.inversePatches_)):t=Me(r,n,[]),gr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==dr?t:void 0}function Me(t,r,n){if(xe(r))return r;const i=r[Q];if(!i)return qt(r,(o,c)=>Vn(t,i,r,o,c,n)),r;if(i.scope_!==t)return r;if(!i.modified_)return Pe(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let c=o,l=!1;i.type_===3&&(c=new Set(o),o.clear(),l=!0),qt(c,(d,k)=>Vn(t,i,o,d,k,n,l)),Pe(t,o,!1),n&&t.patches_&&Et("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function Vn(t,r,n,i,o,c,l){if(process.env.NODE_ENV!=="production"&&o===n&&G(5),wt(o)){const d=c&&r&&r.type_!==3&&!Jt(r.assigned_,i)?c.concat(i):void 0,k=Me(t,o,d);if(Wn(n,i,k),wt(k))t.canAutoFreeze_=!1;else return}else l&&n.add(o);if(_t(o)&&!xe(o)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;Me(t,o),(!r||!r.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&Pe(t,o)}}function Pe(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&mr(r,n)}function Ri(t,r){const n=Array.isArray(t),i={type_:n?1:0,scope_:r?r.scope_:Bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=i,c=vr;n&&(o=[i],c=ee);const{revoke:l,proxy:d}=Proxy.revocable(o,c);return i.draft_=d,i.revoke_=l,d}var vr={get(t,r){if(r===Q)return t;const n=At(t);if(!Jt(n,r))return zi(t,n,r);const i=n[r];return t.finalized_||!_t(i)?i:i===Ir(t.base_,r)?(wr(t),t.copy_[r]=Tr(i,t)):i},has(t,r){return r in At(t)},ownKeys(t){return Reflect.ownKeys(At(t))},set(t,r,n){const i=Xn(At(t),r);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const o=Ir(At(t),r),c=o==null?void 0:o[Q];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(Pi(n,o)&&(n!==void 0||Jt(t.base_,r)))return!0;wr(t),Sr(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 Ir(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,wr(t),Sr(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=At(t),i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:i.enumerable,value:n[r]}},defineProperty(){G(11)},getPrototypeOf(t){return St(t.base_)},setPrototypeOf(){G(12)}},ee={};qt(vr,(t,r)=>{ee[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),ee.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&G(13),ee.set.call(this,t,r,void 0)},ee.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&G(14),vr.set.call(this,t[0],r,n,t[0])};function Ir(t,r){const n=t[Q];return(n?At(n):t)[r]}function zi(t,r,n){var o;const i=Xn(r,n);return i?"value"in i?i.value:(o=i.get)==null?void 0:o.call(t.draft_):void 0}function Xn(t,r){if(!(r in t))return;let n=St(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,r);if(i)return i;n=St(n)}}function Sr(t){t.modified_||(t.modified_=!0,t.parent_&&Sr(t.parent_))}function wr(t){t.copy_||(t.copy_=yr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Hi=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 l=this;return function(k=c,...F){return l.produce(k,S=>n.call(this,S,...F))}}typeof n!="function"&&G(6),i!==void 0&&typeof i!="function"&&G(7);let o;if(_t(r)){const c=Kn(this),l=Tr(r,void 0);let d=!0;try{o=n(l),d=!1}finally{d?gr(c):_r(c)}return $n(c,i),Yn(o,c)}else if(!r||typeof r!="object"){if(o=n(r),o===void 0&&(o=r),o===dr&&(o=void 0),this.autoFreeze_&&mr(o,!0),i){const c=[],l=[];Et("Patches").generateReplacementPatches_(r,o,c,l),i(c,l)}return o}else G(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(l,...d)=>this.produceWithPatches(l,k=>r(k,...d));let i,o;return[this.produce(r,n,(l,d)=>{i=l,o=d}),i,o]},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)||G(8),wt(t)&&(t=Ni(t));const r=Kn(this),n=Tr(t,void 0);return n[Q].isManual_=!0,_r(r),n}finishDraft(t,r){const n=t&&t[Q];(!n||!n.isManual_)&&G(9);const{scope_:i}=n;return $n(i,r),Yn(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 o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const i=Et("Patches").applyPatches_;return wt(t)?i(t,r):this.produce(t,o=>i(o,r))}};function Tr(t,r){const n=Zt(t)?Et("MapSet").proxyMap_(t,r):Qt(t)?Et("MapSet").proxySet_(t,r):Ri(t,r);return(r?r.scope_:Bn()).drafts_.push(n),n}function Ni(t){return wt(t)||G(10,t),qn(t)}function qn(t){if(!_t(t)||xe(t))return t;const r=t[Q];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=yr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=yr(t,!0);return qt(n,(i,o)=>{Wn(n,i,qn(o))}),r&&(r.finalized_=!1),n}function Jn(){process.env.NODE_ENV!=="production"&&Ln.push('Sets cannot have "replace" patches.',function(y){return"Unsupported patch operation: "+y},function(y){return"Cannot apply patch, path doesn't resolve: "+y},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",i="remove";function o(y,p,h,f){switch(y.type_){case 0:case 2:return l(y,p,h,f);case 1:return c(y,p,h,f);case 3:return d(y,p,h,f)}}function c(y,p,h,f){let{base_:g,assigned_:v}=y,_=y.copy_;_.length<g.length&&([g,_]=[_,g],[h,f]=[f,h]);for(let b=0;b<g.length;b++)if(v[b]&&_[b]!==g[b]){const m=p.concat([b]);h.push({op:r,path:m,value:U(_[b])}),f.push({op:r,path:m,value:U(g[b])})}for(let b=g.length;b<_.length;b++){const m=p.concat([b]);h.push({op:n,path:m,value:U(_[b])})}for(let b=_.length-1;g.length<=b;--b){const m=p.concat([b]);f.push({op:i,path:m})}}function l(y,p,h,f){const{base_:g,copy_:v}=y;qt(y.assigned_,(_,b)=>{const m=hr(g,_),N=hr(v,_),x=b?Jt(g,_)?r:n:i;if(m===N&&x===r)return;const O=p.concat(_);h.push(x===i?{op:x,path:O}:{op:x,path:O,value:N}),f.push(x===n?{op:i,path:O}:x===i?{op:n,path:O,value:U(m)}:{op:r,path:O,value:U(m)})})}function d(y,p,h,f){let{base_:g,copy_:v}=y,_=0;g.forEach(b=>{if(!v.has(b)){const m=p.concat([_]);h.push({op:i,path:m,value:b}),f.unshift({op:n,path:m,value:b})}_++}),_=0,v.forEach(b=>{if(!g.has(b)){const m=p.concat([_]);h.push({op:n,path:m,value:b}),f.unshift({op:i,path:m,value:b})}_++})}function k(y,p,h,f){h.push({op:r,path:[],value:p===dr?void 0:p}),f.push({op:r,path:[],value:y})}function F(y,p){return p.forEach(h=>{const{path:f,op:g}=h;let v=y;for(let N=0;N<f.length-1;N++){const x=Tt(v);let O=f[N];typeof O!="string"&&typeof O!="number"&&(O=""+O),(x===0||x===1)&&(O==="__proto__"||O==="constructor")&&G(19),typeof v=="function"&&O==="prototype"&&G(19),v=hr(v,O),typeof v!="object"&&G(18,f.join("/"))}const _=Tt(v),b=S(h.value),m=f[f.length-1];switch(g){case r:switch(_){case 2:return v.set(m,b);case 3:G(16);default:return v[m]=b}case n:switch(_){case 1:return m==="-"?v.push(b):v.splice(m,0,b);case 2:return v.set(m,b);case 3:return v.add(b);default:return v[m]=b}case i:switch(_){case 1:return v.splice(m,1);case 2:return v.delete(m);case 3:return v.delete(h.value);default:return delete v[m]}default:G(17,g)}}),y}function S(y){if(!_t(y))return y;if(Array.isArray(y))return y.map(S);if(Zt(y))return new Map(Array.from(y.entries()).map(([h,f])=>[h,S(f)]));if(Qt(y))return new Set(Array.from(y).map(S));const p=Object.create(St(y));for(const h in y)p[h]=S(y[h]);return Jt(y,Xt)&&(p[Xt]=y[Xt]),p}function U(y){return wt(y)?S(y):y}Ci("Patches",{applyPatches_:F,generatePatches_:o,generateReplacementPatches_:k})}var tt=new Hi,Ui=tt.produce;tt.produceWithPatches.bind(tt),tt.setAutoFreeze.bind(tt),tt.setUseStrictShallowCopy.bind(tt);var Li=tt.applyPatches.bind(tt);tt.createDraft.bind(tt),tt.finishDraft.bind(tt);var Gi=1/0,Wi=9007199254740991,Bi="[object Arguments]",$i="[object Function]",Ki="[object GeneratorFunction]",Yi="[object Symbol]",Vi=typeof et=="object"&&et&&et.Object===Object&&et,Xi=typeof self=="object"&&self&&self.Object===Object&&self,qi=Vi||Xi||Function("return this")();function Ji(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 Zi(t,r){for(var n=-1,i=t?t.length:0,o=Array(i);++n<i;)o[n]=r(t[n],n,t);return o}function Qi(t,r){for(var n=-1,i=r.length,o=t.length;++n<i;)t[o+n]=r[n];return t}var Ar=Object.prototype,ta=Ar.hasOwnProperty,Er=Ar.toString,Zn=qi.Symbol,ea=Ar.propertyIsEnumerable,Qn=Zn?Zn.isConcatSpreadable:void 0,ti=Math.max;function ra(t,r,n,i,o){var c=-1,l=t.length;for(n||(n=sa),o||(o=[]);++c<l;){var d=t[c];n(d)?Qi(o,d):o[o.length]=d}return o}function na(t,r){return t=Object(t),ia(t,r,function(n,i){return i in t})}function ia(t,r,n){for(var i=-1,o=r.length,c={};++i<o;){var l=r[i],d=t[l];n(d,l)&&(c[l]=d)}return c}function aa(t,r){return r=ti(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,o=ti(n.length-r,0),c=Array(o);++i<o;)c[i]=n[r+i];i=-1;for(var l=Array(r+1);++i<r;)l[i]=n[i];return l[r]=c,Ji(t,this,l)}}function sa(t){return ua(t)||ca(t)||!!(Qn&&t&&t[Qn])}function oa(t){if(typeof t=="string"||ya(t))return t;var r=t+"";return r=="0"&&1/t==-Gi?"-0":r}function ca(t){return la(t)&&ta.call(t,"callee")&&(!ea.call(t,"callee")||Er.call(t)==Bi)}var ua=Array.isArray;function fa(t){return t!=null&&da(t.length)&&!pa(t)}function la(t){return ei(t)&&fa(t)}function pa(t){var r=ha(t)?Er.call(t):"";return r==$i||r==Ki}function da(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wi}function ha(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function ei(t){return!!t&&typeof t=="object"}function ya(t){return typeof t=="symbol"||ei(t)&&Er.call(t)==Yi}var ma=aa(function(t,r){return t==null?{}:na(t,Zi(ra(r),oa))}),ba=ma;const ri=lr(ba),ga={tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1},duration:0,activeIds:[],trackItemDetailsMap:{}},ni=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class _a{constructor(r){jt(this,"stateSubject");jt(this,"stateHistorySubject");jt(this,"prevState");jt(this,"undos",[]);jt(this,"redos",[]);jt(this,"listener");const n=r||ga;this.stateSubject=new jn(n),this.stateHistorySubject=new jn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){Oi(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const i=ri(r,ni),o=ri(this.getState(),ni),c=Un(o,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(),o={...i,...r};ut(i,o)||(n.updateHistory&&this.updateHistory(o,n.kind),this.prevState=i,this.stateSubject.next(o))}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{ut(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{ut(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=>{ut(n.trackItemIds,this.prevState.trackItemIds)||r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{ut(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!ut(n.tracks,this.prevState.tracks)||!ut(n.trackItemIds,this.prevState.trackItemIds)||!ut(n.trackItemsMap,this.prevState.trackItemsMap)||!ut(n.transitionIds,this.prevState.transitionIds)||!ut(n.transitionsMap,this.prevState.transitionsMap))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,i=r==null?void 0:r.type;if(!n||!i)return;Jn();const{trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:F}=this.getState(),S=rt({trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:F}),U=[],y=[],p=[],h=[],f=[],g=[];n.forEach(T=>{let M;const R=T.path.slice(1);T.type==="CREATE"?M={path:R,op:"remove",value:T.value}:T.type==="CHANGE"?M={path:R,op:"replace",value:T.oldValue}:M={path:R,op:"add",value:T.oldValue},T.path.includes("trackItemIds")?p.push(M):T.path.includes("transitionIds")?y.push(M):T.path.includes("trackItemsMap")?f.push(M):T.path.includes("transitionsMap")?h.push(M):T.path.includes("tracks")?U.push(M):T.path.includes("trackItemDetailsMap")&&g.push(M)});const v=this.applyPatch(S.tracks,U),_=this.applyPatch(S.transitionIds,y),b=this.applyPatch(S.trackItemIds,p),m=this.applyPatch(S.transitionsMap,h),N=this.applyPatch(S.trackItemsMap,f),x=this.applyPatch(S.trackItemDetailsMap,g),O=rt({tracks:v,transitionIds:_,trackItemIds:b,transitionsMap:m,trackItemsMap:N,trackItemDetailsMap:x}),C=rt(this.getState()),w={...C,...O};this.prevState=C,this.redos.push({redos:n,type:i}),this.stateSubject.next(w),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((i,o)=>Ui(i,c=>{Li(c,[o])}),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;Jn();const{trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:F}=this.getState(),S=rt({trackItemDetailsMap:o,trackItemIds:c,tracks:l,transitionIds:d,transitionsMap:k,trackItemsMap:F}),U=[],y=[],p=[],h=[],f=[],g=[];n.forEach(T=>{let M;const R=T.path.slice(1);T.type==="CREATE"?M={path:R,op:"add",value:T.value}:T.type==="CHANGE"?M={path:R,op:"replace",value:T.value}:M={path:R,op:"remove",value:T.oldValue},T.path.includes("trackItemIds")?p.push(M):T.path.includes("transitionIds")?y.push(M):T.path.includes("trackItemsMap")?f.push(M):T.path.includes("transitionsMap")?h.push(M):T.path.includes("trackItemDetailsMap")?g.push(M):U.push(M)});const v=this.applyPatch(S.tracks,U),_=this.applyPatch(S.transitionIds,y),b=this.applyPatch(S.trackItemIds,p),m=this.applyPatch(S.transitionsMap,h),N=this.applyPatch(S.trackItemsMap,f),x=this.applyPatch(S.trackItemDetailsMap,g),O=rt({tracks:v,transitionIds:_,trackItemIds:b,transitionsMap:m,trackItemsMap:N,trackItemDetailsMap:x}),C=rt(this.getState()),w={...C,...O};this.prevState=C,this.undos.push({undos:n,type:i}),this.stateSubject.next(w),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}return _a});
@@ -1,4 +1,4 @@
1
- import { IAudio, ICaption, IImage, IText, IVideo } from '@designcombo/types';
1
+ import { IAudio, IBoxShadow, ICaption, IDisplay, IImage, IText, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
2
2
 
3
3
  type OptionsType = {
4
4
  size: {
@@ -7,21 +7,163 @@ type OptionsType = {
7
7
  };
8
8
  origin: number;
9
9
  };
10
- export declare const loadVideoItem: (layer: IVideo, options: Partial<OptionsType>) => Promise<IVideo>;
11
- export declare const loadAudioItem: (payload: IAudio) => Promise<IAudio>;
12
- export declare const loadImageItem: (payload: IImage, options: {
10
+ export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partial<OptionsType>) => Promise<{
11
+ trim: ITrim;
12
+ type: string;
13
+ name: string;
14
+ details: IVideoDetails;
15
+ display: IDisplay;
16
+ id: string;
17
+ preview?: string;
18
+ position?: import('@designcombo/types').IPosition | null;
19
+ metadata: Record<string, any>;
20
+ isMain?: boolean;
21
+ animation?: any;
22
+ }>;
23
+ export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
24
+ id: string;
25
+ name: string;
26
+ type: string;
27
+ display: IDisplay;
28
+ trim: ITrim;
29
+ details: {
30
+ src: string;
31
+ duration: number;
32
+ volume: number;
33
+ };
34
+ metadata: {
35
+ [x: string]: any;
36
+ };
37
+ }>;
38
+ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
39
+ origin?: number;
40
+ size?: {
41
+ width: number;
42
+ height: number;
43
+ };
44
+ }) => Promise<{
45
+ id: string;
46
+ type: string;
47
+ name: string;
48
+ display: IDisplay;
49
+ details: {
50
+ src: string;
51
+ width: number;
52
+ height: number;
53
+ opacity: number;
54
+ transform: string;
55
+ border: string;
56
+ borderRadius: number;
57
+ boxShadow: IBoxShadow;
58
+ top: string;
59
+ left: string;
60
+ borderWidth: number;
61
+ borderColor: string;
62
+ blur: number;
63
+ brightness: number;
64
+ flipX: boolean;
65
+ flipY: boolean;
66
+ };
67
+ metadata: Record<string, any>;
68
+ }>;
69
+ export declare const loadCaptionItem: (payload: ITrackItem & ICaption, options: {
13
70
  origin?: number;
14
71
  size?: {
15
72
  width: number;
16
73
  height: number;
17
74
  };
18
- }) => Promise<IImage>;
19
- export declare const loadTextItem: (payload: IText | ICaption, options: {
75
+ }) => Promise<{
76
+ id: string;
77
+ name: string;
78
+ type: string;
79
+ display: IDisplay;
80
+ details: {
81
+ text: string;
82
+ height: number;
83
+ fontUrl: string;
84
+ top: string;
85
+ left: string;
86
+ borderWidth: number;
87
+ borderColor: string;
88
+ boxShadow: {
89
+ color: string;
90
+ x: number;
91
+ y: number;
92
+ blur: number;
93
+ };
94
+ fontSize: number;
95
+ fontFamily: string;
96
+ color: string;
97
+ lineHeight: number | string;
98
+ letterSpacing: number | string;
99
+ fontWeight: number;
100
+ fontStyle: string;
101
+ textDecoration: string;
102
+ textAlign: "center" | "left" | "right";
103
+ wordSpacing: number | string;
104
+ textShadow: string;
105
+ backgroundColor: string;
106
+ opacity: number;
107
+ width: number;
108
+ textTransform: "capitalize" | "uppercase" | "lowercase";
109
+ border: string;
110
+ wordWrap: "normal" | "break-word";
111
+ wordBreak: "normal" | "break-word" | "break-all";
112
+ WebkitTextStrokeColor: string;
113
+ WebkitTextStrokeWidth: string;
114
+ transform?: string;
115
+ borderRadius?: number;
116
+ };
117
+ metadata: {};
118
+ }>;
119
+ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
20
120
  origin?: number;
21
121
  size?: {
22
122
  width: number;
23
123
  height: number;
24
124
  };
25
- type: "text" | "caption";
26
- }, loadFont?: boolean) => Promise<IText | ICaption>;
125
+ }) => Promise<{
126
+ id: string;
127
+ name: string;
128
+ type: string;
129
+ display: IDisplay;
130
+ details: {
131
+ text: string;
132
+ height: number;
133
+ fontUrl: string;
134
+ top: string;
135
+ left: string;
136
+ borderWidth: number;
137
+ borderColor: string;
138
+ boxShadow: {
139
+ color: string;
140
+ x: number;
141
+ y: number;
142
+ blur: number;
143
+ };
144
+ fontSize: number;
145
+ fontFamily: string;
146
+ color: string;
147
+ lineHeight: number | string;
148
+ letterSpacing: number | string;
149
+ fontWeight: number;
150
+ fontStyle: string;
151
+ textDecoration: string;
152
+ textAlign: "center" | "left" | "right";
153
+ wordSpacing: number | string;
154
+ textShadow: string;
155
+ backgroundColor: string;
156
+ opacity: number;
157
+ width: number;
158
+ textTransform: "capitalize" | "uppercase" | "lowercase";
159
+ border: string;
160
+ wordWrap: "normal" | "break-word";
161
+ wordBreak: "normal" | "break-word" | "break-all";
162
+ WebkitTextStrokeColor: string;
163
+ WebkitTextStrokeWidth: string;
164
+ transform?: string;
165
+ borderRadius?: number;
166
+ };
167
+ metadata: {};
168
+ }>;
27
169
  export {};
package/package.json CHANGED
@@ -1,20 +1,13 @@
1
1
  {
2
2
  "name": "@designcombo/state",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
- "main": "dist/index.umd.js",
9
- "module": "dist/index.es.js",
10
- "types": "dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.es.js",
14
- "require": "./dist/index.umd.js",
15
- "types": "./dist/index.d.ts"
16
- }
17
- },
8
+ "main": "src/index.ts",
9
+ "module": "src/index.ts",
10
+ "types": "src/index.ts",
18
11
  "devDependencies": {
19
12
  "@types/lodash.clonedeep": "^4.5.9",
20
13
  "@types/lodash.isequal": "^4.5.8",
@@ -24,9 +17,9 @@
24
17
  "typescript": "^5.3.3",
25
18
  "vite": "^5.2.0",
26
19
  "vite-plugin-dts": "^3.9.1",
27
- "@designcombo/events": "0.1.8",
28
- "@designcombo/typescript-config": "0.0.0",
29
- "@designcombo/types": "0.1.8"
20
+ "@designcombo/events": "0.1.10",
21
+ "@designcombo/types": "0.1.10",
22
+ "@designcombo/typescript-config": "0.0.0"
30
23
  },
31
24
  "dependencies": {
32
25
  "immer": "^10.1.1",
@@ -38,8 +31,8 @@
38
31
  "nanoid": "^5.0.7"
39
32
  },
40
33
  "peerDependencies": {
41
- "@designcombo/events": "0.1.8",
42
- "@designcombo/types": "0.1.8"
34
+ "@designcombo/events": "0.1.10",
35
+ "@designcombo/types": "0.1.10"
43
36
  },
44
37
  "scripts": {
45
38
  "dev": "vite",
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default } from "./state";