@byomakase/omakase-player
Version:
## Omakase Player - Open source JavaScript framework for building frame accurate video experiences
3 lines • 4.6 MB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mB=require("hls.js");var kC=typeof document<"u"?document.currentScript:null,_s=function(g,A){return _s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Q){B.__proto__=Q}||function(B,Q){for(var I in Q)Object.prototype.hasOwnProperty.call(Q,I)&&(B[I]=Q[I])},_s(g,A)};function bI(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");_s(g,A);function B(){this.constructor=g}g.prototype=A===null?Object.create(A):(B.prototype=A.prototype,new B)}function yd(g,A,B,Q){function I(E){return E instanceof B?E:new B(function(C){C(E)})}return new(B||(B=Promise))(function(E,C){function i(o){try{e(Q.next(o))}catch(s){C(s)}}function t(o){try{e(Q.throw(o))}catch(s){C(s)}}function e(o){o.done?E(o.value):I(o.value).then(i,t)}e((Q=Q.apply(g,A||[])).next())})}function xc(g,A){var B={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},Q,I,E,C=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return C.next=i(0),C.throw=i(1),C.return=i(2),typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function i(e){return function(o){return t([e,o])}}function t(e){if(Q)throw new TypeError("Generator is already executing.");for(;C&&(C=0,e[0]&&(B=0)),B;)try{if(Q=1,I&&(E=e[0]&2?I.return:e[0]?I.throw||((E=I.return)&&E.call(I),0):I.next)&&!(E=E.call(I,e[1])).done)return E;switch(I=0,E&&(e=[e[0]&2,E.value]),e[0]){case 0:case 1:E=e;break;case 4:return B.label++,{value:e[1],done:!1};case 5:B.label++,I=e[1],e=[0];continue;case 7:e=B.ops.pop(),B.trys.pop();continue;default:if(E=B.trys,!(E=E.length>0&&E[E.length-1])&&(e[0]===6||e[0]===2)){B=0;continue}if(e[0]===3&&(!E||e[1]>E[0]&&e[1]<E[3])){B.label=e[1];break}if(e[0]===6&&B.label<E[1]){B.label=E[1],E=e;break}if(E&&B.label<E[2]){B.label=E[2],B.ops.push(e);break}E[2]&&B.ops.pop(),B.trys.pop();continue}e=A.call(g,B)}catch(o){e=[6,o],I=0}finally{Q=E=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}function ri(g){var A=typeof Symbol=="function"&&Symbol.iterator,B=A&&g[A],Q=0;if(B)return B.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&Q>=g.length&&(g=void 0),{value:g&&g[Q++],done:!g}}};throw new TypeError(A?"Object is not iterable.":"Symbol.iterator is not defined.")}function $E(g,A){var B=typeof Symbol=="function"&&g[Symbol.iterator];if(!B)return g;var Q=B.call(g),I,E=[],C;try{for(;(A===void 0||A-- >0)&&!(I=Q.next()).done;)E.push(I.value)}catch(i){C={error:i}}finally{try{I&&!I.done&&(B=Q.return)&&B.call(Q)}finally{if(C)throw C.error}}return E}function ni(g,A,B){if(B||arguments.length===2)for(var Q=0,I=A.length,E;Q<I;Q++)(E||!(Q in A))&&(E||(E=Array.prototype.slice.call(A,0,Q)),E[Q]=A[Q]);return g.concat(E||Array.prototype.slice.call(A))}function gi(g){return this instanceof gi?(this.v=g,this):new gi(g)}function Md(g,A,B){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Q=B.apply(g,A||[]),I,E=[];return I=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",C),I[Symbol.asyncIterator]=function(){return this},I;function C(D){return function(r){return Promise.resolve(r).then(D,s)}}function i(D,r){Q[D]&&(I[D]=function(n){return new Promise(function(h,G){E.push([D,n,h,G])>1||t(D,n)})},r&&(I[D]=r(I[D])))}function t(D,r){try{e(Q[D](r))}catch(n){a(E[0][3],n)}}function e(D){D.value instanceof gi?Promise.resolve(D.value.v).then(o,s):a(E[0][2],D)}function o(D){t("next",D)}function s(D){t("throw",D)}function a(D,r){D(r),E.shift(),E.length&&t(E[0][0],E[0][1])}}function Sd(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var A=g[Symbol.asyncIterator],B;return A?A.call(g):(g=typeof ri=="function"?ri(g):g[Symbol.iterator](),B={},Q("next"),Q("throw"),Q("return"),B[Symbol.asyncIterator]=function(){return this},B);function Q(E){B[E]=g[E]&&function(C){return new Promise(function(i,t){C=g[E](C),I(i,t,C.done,C.value)})}}function I(E,C,i,t){Promise.resolve(t).then(function(e){E({value:e,done:i})},C)}}function lB(g){return typeof g=="function"}function La(g){var A=function(Q){Error.call(Q),Q.stack=new Error().stack},B=g(A);return B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B}var ks=La(function(g){return function(B){g(this),this.message=B?B.length+` errors occurred during unsubscription:
`+B.map(function(Q,I){return I+1+") "+Q.toString()}).join(`
`):"",this.name="UnsubscriptionError",this.errors=B}});function vo(g,A){if(g){var B=g.indexOf(A);0<=B&&g.splice(B,1)}}var ge=function(){function g(A){this.initialTeardown=A,this.closed=!1,this._parentage=null,this._finalizers=null}return g.prototype.unsubscribe=function(){var A,B,Q,I,E;if(!this.closed){this.closed=!0;var C=this._parentage;if(C)if(this._parentage=null,Array.isArray(C))try{for(var i=ri(C),t=i.next();!t.done;t=i.next()){var e=t.value;e.remove(this)}}catch(n){A={error:n}}finally{try{t&&!t.done&&(B=i.return)&&B.call(i)}finally{if(A)throw A.error}}else C.remove(this);var o=this.initialTeardown;if(lB(o))try{o()}catch(n){E=n instanceof ks?n.errors:[n]}var s=this._finalizers;if(s){this._finalizers=null;try{for(var a=ri(s),D=a.next();!D.done;D=a.next()){var r=D.value;try{Rn(r)}catch(n){E=E??[],n instanceof ks?E=ni(ni([],$E(E)),$E(n.errors)):E.push(n)}}}catch(n){Q={error:n}}finally{try{D&&!D.done&&(I=a.return)&&I.call(a)}finally{if(Q)throw Q.error}}}if(E)throw new ks(E)}},g.prototype.add=function(A){var B;if(A&&A!==this)if(this.closed)Rn(A);else{if(A instanceof g){if(A.closed||A._hasParent(this))return;A._addParent(this)}(this._finalizers=(B=this._finalizers)!==null&&B!==void 0?B:[]).push(A)}},g.prototype._hasParent=function(A){var B=this._parentage;return B===A||Array.isArray(B)&&B.includes(A)},g.prototype._addParent=function(A){var B=this._parentage;this._parentage=Array.isArray(B)?(B.push(A),B):B?[B,A]:A},g.prototype._removeParent=function(A){var B=this._parentage;B===A?this._parentage=null:Array.isArray(B)&&vo(B,A)},g.prototype.remove=function(A){var B=this._finalizers;B&&vo(B,A),A instanceof g&&A._removeParent(this)},g.EMPTY=function(){var A=new g;return A.closed=!0,A}(),g}(),Zc=ge.EMPTY;function Tc(g){return g instanceof ge||g&&"closed"in g&&lB(g.remove)&&lB(g.add)&&lB(g.unsubscribe)}function Rn(g){lB(g)?g():g.unsubscribe()}var Oc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},vc={setTimeout:function(g,A){for(var B=[],Q=2;Q<arguments.length;Q++)B[Q-2]=arguments[Q];return setTimeout.apply(void 0,ni([g,A],$E(B)))},clearTimeout:function(g){var A=vc.delegate;return((A==null?void 0:A.clearTimeout)||clearTimeout)(g)},delegate:void 0};function qc(g){vc.setTimeout(function(){throw g})}function qo(){}function _e(g){g()}var Cr=function(g){bI(A,g);function A(B){var Q=g.call(this)||this;return Q.isStopped=!1,B?(Q.destination=B,Tc(B)&&B.add(Q)):Q.destination=Jd,Q}return A.create=function(B,Q,I){return new Xo(B,Q,I)},A.prototype.next=function(B){this.isStopped||this._next(B)},A.prototype.error=function(B){this.isStopped||(this.isStopped=!0,this._error(B))},A.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},A.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,g.prototype.unsubscribe.call(this),this.destination=null)},A.prototype._next=function(B){this.destination.next(B)},A.prototype._error=function(B){try{this.destination.error(B)}finally{this.unsubscribe()}},A.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},A}(ge),Nd=Function.prototype.bind;function ys(g,A){return Nd.call(g,A)}var Ld=function(){function g(A){this.partialObserver=A}return g.prototype.next=function(A){var B=this.partialObserver;if(B.next)try{B.next(A)}catch(Q){de(Q)}},g.prototype.error=function(A){var B=this.partialObserver;if(B.error)try{B.error(A)}catch(Q){de(Q)}else de(A)},g.prototype.complete=function(){var A=this.partialObserver;if(A.complete)try{A.complete()}catch(B){de(B)}},g}(),Xo=function(g){bI(A,g);function A(B,Q,I){var E=g.call(this)||this,C;if(lB(B)||!B)C={next:B??void 0,error:Q??void 0,complete:I??void 0};else{var i;E&&Oc.useDeprecatedNextContext?(i=Object.create(B),i.unsubscribe=function(){return E.unsubscribe()},C={next:B.next&&ys(B.next,i),error:B.error&&ys(B.error,i),complete:B.complete&&ys(B.complete,i)}):C=B}return E.destination=new Ld(C),E}return A}(Cr);function de(g){qc(g)}function ud(g){throw g}var Jd={closed:!0,next:qo,error:ud,complete:qo},ir=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function CC(g){return g}function Hd(g){return g.length===0?CC:g.length===1?g[0]:function(B){return g.reduce(function(Q,I){return I(Q)},B)}}var wA=function(){function g(A){A&&(this._subscribe=A)}return g.prototype.lift=function(A){var B=new g;return B.source=this,B.operator=A,B},g.prototype.subscribe=function(A,B,Q){var I=this,E=md(A)?A:new Xo(A,B,Q);return _e(function(){var C=I,i=C.operator,t=C.source;E.add(i?i.call(E,t):t?I._subscribe(E):I._trySubscribe(E))}),E},g.prototype._trySubscribe=function(A){try{return this._subscribe(A)}catch(B){A.error(B)}},g.prototype.forEach=function(A,B){var Q=this;return B=Un(B),new B(function(I,E){var C=new Xo({next:function(i){try{A(i)}catch(t){E(t),C.unsubscribe()}},error:E,complete:I});Q.subscribe(C)})},g.prototype._subscribe=function(A){var B;return(B=this.source)===null||B===void 0?void 0:B.subscribe(A)},g.prototype[ir]=function(){return this},g.prototype.pipe=function(){for(var A=[],B=0;B<arguments.length;B++)A[B]=arguments[B];return Hd(A)(this)},g.prototype.toPromise=function(A){var B=this;return A=Un(A),new A(function(Q,I){var E;B.subscribe(function(C){return E=C},function(C){return I(C)},function(){return Q(E)})})},g.create=function(A){return new g(A)},g}();function Un(g){var A;return(A=g??Oc.Promise)!==null&&A!==void 0?A:Promise}function pd(g){return g&&lB(g.next)&&lB(g.error)&&lB(g.complete)}function md(g){return g&&g instanceof Cr||pd(g)&&Tc(g)}function Yd(g){return lB(g==null?void 0:g.lift)}function dQ(g){return function(A){if(Yd(A))return A.lift(function(B){try{return g(B,this)}catch(Q){this.error(Q)}});throw new TypeError("Unable to lift unknown Observable type")}}function bB(g,A,B,Q,I){return new Kd(g,A,B,Q,I)}var Kd=function(g){bI(A,g);function A(B,Q,I,E,C,i){var t=g.call(this,B)||this;return t.onFinalize=C,t.shouldUnsubscribe=i,t._next=Q?function(e){try{Q(e)}catch(o){B.error(o)}}:g.prototype._next,t._error=E?function(e){try{E(e)}catch(o){B.error(o)}finally{this.unsubscribe()}}:g.prototype._error,t._complete=I?function(){try{I()}catch(e){B.error(e)}finally{this.unsubscribe()}}:g.prototype._complete,t}return A.prototype.unsubscribe=function(){var B;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var Q=this.closed;g.prototype.unsubscribe.call(this),!Q&&((B=this.onFinalize)===null||B===void 0||B.call(this))}},A}(Cr),bd=La(function(g){return function(){g(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),y=function(g){bI(A,g);function A(){var B=g.call(this)||this;return B.closed=!1,B.currentObservers=null,B.observers=[],B.isStopped=!1,B.hasError=!1,B.thrownError=null,B}return A.prototype.lift=function(B){var Q=new kn(this,this);return Q.operator=B,Q},A.prototype._throwIfClosed=function(){if(this.closed)throw new bd},A.prototype.next=function(B){var Q=this;_e(function(){var I,E;if(Q._throwIfClosed(),!Q.isStopped){Q.currentObservers||(Q.currentObservers=Array.from(Q.observers));try{for(var C=ri(Q.currentObservers),i=C.next();!i.done;i=C.next()){var t=i.value;t.next(B)}}catch(e){I={error:e}}finally{try{i&&!i.done&&(E=C.return)&&E.call(C)}finally{if(I)throw I.error}}}})},A.prototype.error=function(B){var Q=this;_e(function(){if(Q._throwIfClosed(),!Q.isStopped){Q.hasError=Q.isStopped=!0,Q.thrownError=B;for(var I=Q.observers;I.length;)I.shift().error(B)}})},A.prototype.complete=function(){var B=this;_e(function(){if(B._throwIfClosed(),!B.isStopped){B.isStopped=!0;for(var Q=B.observers;Q.length;)Q.shift().complete()}})},A.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(A.prototype,"observed",{get:function(){var B;return((B=this.observers)===null||B===void 0?void 0:B.length)>0},enumerable:!1,configurable:!0}),A.prototype._trySubscribe=function(B){return this._throwIfClosed(),g.prototype._trySubscribe.call(this,B)},A.prototype._subscribe=function(B){return this._throwIfClosed(),this._checkFinalizedStatuses(B),this._innerSubscribe(B)},A.prototype._innerSubscribe=function(B){var Q=this,I=this,E=I.hasError,C=I.isStopped,i=I.observers;return E||C?Zc:(this.currentObservers=null,i.push(B),new ge(function(){Q.currentObservers=null,vo(i,B)}))},A.prototype._checkFinalizedStatuses=function(B){var Q=this,I=Q.hasError,E=Q.thrownError,C=Q.isStopped;I?B.error(E):C&&B.complete()},A.prototype.asObservable=function(){var B=new wA;return B.source=this,B},A.create=function(B,Q){return new kn(B,Q)},A}(wA),kn=function(g){bI(A,g);function A(B,Q){var I=g.call(this)||this;return I.destination=B,I.source=Q,I}return A.prototype.next=function(B){var Q,I;(I=(Q=this.destination)===null||Q===void 0?void 0:Q.next)===null||I===void 0||I.call(Q,B)},A.prototype.error=function(B){var Q,I;(I=(Q=this.destination)===null||Q===void 0?void 0:Q.error)===null||I===void 0||I.call(Q,B)},A.prototype.complete=function(){var B,Q;(Q=(B=this.destination)===null||B===void 0?void 0:B.complete)===null||Q===void 0||Q.call(B)},A.prototype._subscribe=function(B){var Q,I;return(I=(Q=this.source)===null||Q===void 0?void 0:Q.subscribe(B))!==null&&I!==void 0?I:Zc},A}(y),iB=function(g){bI(A,g);function A(B){var Q=g.call(this)||this;return Q._value=B,Q}return Object.defineProperty(A.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),A.prototype._subscribe=function(B){var Q=g.prototype._subscribe.call(this,B);return!Q.closed&&B.next(this._value),Q},A.prototype.getValue=function(){var B=this,Q=B.hasError,I=B.thrownError,E=B._value;if(Q)throw I;return this._throwIfClosed(),E},A.prototype.next=function(B){g.prototype.next.call(this,this._value=B)},A}(y),fd={now:function(){return Date.now()},delegate:void 0},Vd=function(g){bI(A,g);function A(B,Q){return g.call(this)||this}return A.prototype.schedule=function(B,Q){return this},A}(ge),yn={setInterval:function(g,A){for(var B=[],Q=2;Q<arguments.length;Q++)B[Q-2]=arguments[Q];return setInterval.apply(void 0,ni([g,A],$E(B)))},clearInterval:function(g){return clearInterval(g)},delegate:void 0},Wd=function(g){bI(A,g);function A(B,Q){var I=g.call(this,B,Q)||this;return I.scheduler=B,I.work=Q,I.pending=!1,I}return A.prototype.schedule=function(B,Q){var I;if(Q===void 0&&(Q=0),this.closed)return this;this.state=B;var E=this.id,C=this.scheduler;return E!=null&&(this.id=this.recycleAsyncId(C,E,Q)),this.pending=!0,this.delay=Q,this.id=(I=this.id)!==null&&I!==void 0?I:this.requestAsyncId(C,this.id,Q),this},A.prototype.requestAsyncId=function(B,Q,I){return I===void 0&&(I=0),yn.setInterval(B.flush.bind(B,this),I)},A.prototype.recycleAsyncId=function(B,Q,I){if(I===void 0&&(I=0),I!=null&&this.delay===I&&this.pending===!1)return Q;Q!=null&&yn.clearInterval(Q)},A.prototype.execute=function(B,Q){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var I=this._execute(B,Q);if(I)return I;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},A.prototype._execute=function(B,Q){var I=!1,E;try{this.work(B)}catch(C){I=!0,E=C||new Error("Scheduled action threw falsy error")}if(I)return this.unsubscribe(),E},A.prototype.unsubscribe=function(){if(!this.closed){var B=this,Q=B.id,I=B.scheduler,E=I.actions;this.work=this.state=this.scheduler=null,this.pending=!1,vo(E,this),Q!=null&&(this.id=this.recycleAsyncId(I,Q,null)),this.delay=null,g.prototype.unsubscribe.call(this)}},A}(Vd),Mn=function(){function g(A,B){B===void 0&&(B=g.now),this.schedulerActionCtor=A,this.now=B}return g.prototype.schedule=function(A,B,Q){return B===void 0&&(B=0),new this.schedulerActionCtor(this,A).schedule(Q,B)},g.now=fd.now,g}(),xd=function(g){bI(A,g);function A(B,Q){Q===void 0&&(Q=Mn.now);var I=g.call(this,B,Q)||this;return I.actions=[],I._active=!1,I}return A.prototype.flush=function(B){var Q=this.actions;if(this._active){Q.push(B);return}var I;this._active=!0;do if(I=B.execute(B.state,B.delay))break;while(B=Q.shift());if(this._active=!1,I){for(;B=Q.shift();)B.unsubscribe();throw I}},A}(Mn),yi=new xd(Wd),Zd=yi,tr=new wA(function(g){return g.complete()});function Xc(g){return g&&lB(g.schedule)}function er(g){return g[g.length-1]}function or(g){return lB(er(g))?g.pop():void 0}function ua(g){return Xc(er(g))?g.pop():void 0}function Td(g,A){return typeof er(g)=="number"?g.pop():A}var ar=function(g){return g&&typeof g.length=="number"&&typeof g!="function"};function zc(g){return lB(g==null?void 0:g.then)}function Pc(g){return lB(g[ir])}function jc(g){return Symbol.asyncIterator&&lB(g==null?void 0:g[Symbol.asyncIterator])}function _c(g){return new TypeError("You provided "+(g!==null&&typeof g=="object"?"an invalid object":"'"+g+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Od(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var $c=Od();function Aw(g){return lB(g==null?void 0:g[$c])}function Bw(g){return Md(this,arguments,function(){var B,Q,I,E;return xc(this,function(C){switch(C.label){case 0:B=g.getReader(),C.label=1;case 1:C.trys.push([1,,9,10]),C.label=2;case 2:return[4,gi(B.read())];case 3:return Q=C.sent(),I=Q.value,E=Q.done,E?[4,gi(void 0)]:[3,5];case 4:return[2,C.sent()];case 5:return[4,gi(I)];case 6:return[4,C.sent()];case 7:return C.sent(),[3,2];case 8:return[3,10];case 9:return B.releaseLock(),[7];case 10:return[2]}})})}function Qw(g){return lB(g==null?void 0:g.getReader)}function RQ(g){if(g instanceof wA)return g;if(g!=null){if(Pc(g))return vd(g);if(ar(g))return qd(g);if(zc(g))return hA(g);if(jc(g))return gw(g);if(Aw(g))return Xd(g);if(Qw(g))return zd(g)}throw _c(g)}function vd(g){return new wA(function(A){var B=g[ir]();if(lB(B.subscribe))return B.subscribe(A);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function qd(g){return new wA(function(A){for(var B=0;B<g.length&&!A.closed;B++)A.next(g[B]);A.complete()})}function hA(g){return new wA(function(A){g.then(function(B){A.closed||(A.next(B),A.complete())},function(B){return A.error(B)}).then(null,qc)})}function Xd(g){return new wA(function(A){var B,Q;try{for(var I=ri(g),E=I.next();!E.done;E=I.next()){var C=E.value;if(A.next(C),A.closed)return}}catch(i){B={error:i}}finally{try{E&&!E.done&&(Q=I.return)&&Q.call(I)}finally{if(B)throw B.error}}A.complete()})}function gw(g){return new wA(function(A){Pd(g,A).catch(function(B){return A.error(B)})})}function zd(g){return gw(Bw(g))}function Pd(g,A){var B,Q,I,E;return yd(this,void 0,void 0,function(){var C,i;return xc(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,11]),B=Sd(g),t.label=1;case 1:return[4,B.next()];case 2:if(Q=t.sent(),!!Q.done)return[3,4];if(C=Q.value,A.next(C),A.closed)return[2];t.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=t.sent(),I={error:i},[3,11];case 6:return t.trys.push([6,,9,10]),Q&&!Q.done&&(E=B.return)?[4,E.call(B)]:[3,8];case 7:t.sent(),t.label=8;case 8:return[3,10];case 9:if(I)throw I.error;return[7];case 10:return[7];case 11:return A.complete(),[2]}})})}function pI(g,A,B,Q,I){Q===void 0&&(Q=0),I===void 0&&(I=!1);var E=A.schedule(function(){B(),I?g.add(this.schedule(null,Q)):this.unsubscribe()},Q);if(g.add(E),!I)return E}function Iw(g,A){return A===void 0&&(A=0),dQ(function(B,Q){B.subscribe(bB(Q,function(I){return pI(Q,g,function(){return Q.next(I)},A)},function(){return pI(Q,g,function(){return Q.complete()},A)},function(I){return pI(Q,g,function(){return Q.error(I)},A)}))})}function Ew(g,A){return A===void 0&&(A=0),dQ(function(B,Q){Q.add(g.schedule(function(){return B.subscribe(Q)},A))})}function jd(g,A){return RQ(g).pipe(Ew(A),Iw(A))}function _d(g,A){return RQ(g).pipe(Ew(A),Iw(A))}function $d(g,A){return new wA(function(B){var Q=0;return A.schedule(function(){Q===g.length?B.complete():(B.next(g[Q++]),B.closed||this.schedule())})})}function AR(g,A){return new wA(function(B){var Q;return pI(B,A,function(){Q=g[$c](),pI(B,A,function(){var I,E,C;try{I=Q.next(),E=I.value,C=I.done}catch(i){B.error(i);return}C?B.complete():B.next(E)},0,!0)}),function(){return lB(Q==null?void 0:Q.return)&&Q.return()}})}function Cw(g,A){if(!g)throw new Error("Iterable cannot be null");return new wA(function(B){pI(B,A,function(){var Q=g[Symbol.asyncIterator]();pI(B,A,function(){Q.next().then(function(I){I.done?B.complete():B.next(I.value)})},0,!0)})})}function BR(g,A){return Cw(Bw(g),A)}function QR(g,A){if(g!=null){if(Pc(g))return jd(g,A);if(ar(g))return $d(g,A);if(zc(g))return _d(g,A);if(jc(g))return Cw(g,A);if(Aw(g))return AR(g,A);if(Qw(g))return BR(g,A)}throw _c(g)}function qB(g,A){return A?QR(g,A):RQ(g)}function _B(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=ua(g);return qB(g,B)}var sr=La(function(g){return function(){g(this),this.name="EmptyError",this.message="no elements in sequence"}});function cA(g,A){return new Promise(function(B,Q){var I=new Xo({next:function(E){B(E),I.unsubscribe()},error:Q,complete:function(){Q(new sr)}});g.subscribe(I)})}function iw(g){return g instanceof Date&&!isNaN(g)}var gR=La(function(g){return function(B){B===void 0&&(B=null),g(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=B}});function wg(g,A){var B=iw(g)?{first:g}:typeof g=="number"?{each:g}:g,Q=B.first,I=B.each,E=B.with,C=E===void 0?IR:E,i=B.scheduler,t=i===void 0?yi:i,e=B.meta,o=e===void 0?null:e;if(Q==null&&I==null)throw new TypeError("No timeout provided.");return dQ(function(s,a){var D,r,n=null,h=0,G=function(w){r=pI(a,t,function(){try{D.unsubscribe(),RQ(C({meta:o,lastValue:n,seen:h})).subscribe(a)}catch(d){a.error(d)}},w)};D=s.subscribe(bB(a,function(w){r==null||r.unsubscribe(),h++,a.next(n=w),I>0&&G(I)},void 0,void 0,function(){r!=null&&r.closed||r==null||r.unsubscribe(),n=null})),!h&&G(Q!=null?typeof Q=="number"?Q:+Q-t.now():I)})}function IR(g){throw new gR(g)}function VA(g,A){return dQ(function(B,Q){var I=0;B.subscribe(bB(Q,function(E){Q.next(g.call(A,E,I++))}))})}var ER=Array.isArray;function CR(g,A){return ER(A)?g.apply(void 0,ni([],$E(A))):g(A)}function Dr(g){return VA(function(A){return CR(g,A)})}var iR=Array.isArray,tR=Object.getPrototypeOf,eR=Object.prototype,oR=Object.keys;function tw(g){if(g.length===1){var A=g[0];if(iR(A))return{args:A,keys:null};if(aR(A)){var B=oR(A);return{args:B.map(function(Q){return A[Q]}),keys:B}}}return{args:g,keys:null}}function aR(g){return g&&typeof g=="object"&&tR(g)===eR}function ew(g,A){return g.reduce(function(B,Q,I){return B[Q]=A[I],B},{})}function mI(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=ua(g),Q=or(g),I=tw(g),E=I.args,C=I.keys;if(E.length===0)return qB([],B);var i=new wA(sR(E,B,C?function(t){return ew(C,t)}:CC));return Q?i.pipe(Dr(Q)):i}function sR(g,A,B){return B===void 0&&(B=CC),function(Q){Sn(A,function(){for(var I=g.length,E=new Array(I),C=I,i=I,t=function(o){Sn(A,function(){var s=qB(g[o],A),a=!1;s.subscribe(bB(Q,function(D){E[o]=D,a||(a=!0,i--),i||Q.next(B(E.slice()))},function(){--C||Q.complete()}))},Q)},e=0;e<I;e++)t(e)},Q)}}function Sn(g,A,B){g?pI(B,g,A):A()}function DR(g,A,B,Q,I,E,C,i){var t=[],e=0,o=0,s=!1,a=function(){s&&!t.length&&!e&&A.complete()},D=function(n){return e<Q?r(n):t.push(n)},r=function(n){e++;var h=!1;RQ(B(n,o++)).subscribe(bB(A,function(G){A.next(G)},function(){h=!0},void 0,function(){if(h)try{e--;for(var G=function(){var w=t.shift();C||r(w)};t.length&&e<Q;)G();a()}catch(w){A.error(w)}}))};return g.subscribe(bB(A,D,function(){s=!0,a()})),function(){}}function sE(g,A,B){return B===void 0&&(B=1/0),lB(A)?sE(function(Q,I){return VA(function(E,C){return A(Q,E,I,C)})(RQ(g(Q,I)))},B):(typeof A=="number"&&(B=A),dQ(function(Q,I){return DR(Q,I,g,B)}))}function rr(g){return g===void 0&&(g=1/0),sE(CC,g)}function rR(){return rr(1)}function Nn(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];return rR()(qB(g,ua(g)))}function nR(g){return new wA(function(A){RQ(g()).subscribe(A)})}function gQ(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=or(g),Q=tw(g),I=Q.args,E=Q.keys,C=new wA(function(i){var t=I.length;if(!t){i.complete();return}for(var e=new Array(t),o=t,s=t,a=function(r){var n=!1;RQ(I[r]).subscribe(bB(i,function(h){n||(n=!0,s--),e[r]=h},function(){return o--},void 0,function(){(!o||!n)&&(s||i.next(E?ew(E,e):e),i.complete())}))},D=0;D<t;D++)a(D)});return B?C.pipe(Dr(B)):C}var hR=["addListener","removeListener"],cR=["addEventListener","removeEventListener"],wR=["on","off"];function OA(g,A,B,Q){if(lB(B)&&(Q=B,B=void 0),Q)return OA(g,A,B).pipe(Dr(Q));var I=$E(lR(g)?cR.map(function(i){return function(t){return g[i](A,t,B)}}):GR(g)?hR.map(Ln(g,A)):FR(g)?wR.map(Ln(g,A)):[],2),E=I[0],C=I[1];if(!E&&ar(g))return sE(function(i){return OA(i,A,B)})(RQ(g));if(!E)throw new TypeError("Invalid event target");return new wA(function(i){var t=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return i.next(1<e.length?e:e[0])};return E(t),function(){return C(t)}})}function Ln(g,A){return function(B){return function(Q){return g[B](A,Q)}}}function GR(g){return lB(g.addListener)&&lB(g.removeListener)}function FR(g){return lB(g.on)&&lB(g.off)}function lR(g){return lB(g.addEventListener)&&lB(g.removeEventListener)}function vE(g,A,B){g===void 0&&(g=0),B===void 0&&(B=Zd);var Q=-1;return A!=null&&(Xc(A)?B=A:Q=A),new wA(function(I){var E=iw(g)?+g-B.now():g;E<0&&(E=0);var C=0;return B.schedule(function(){I.closed||(I.next(C++),0<=Q?this.schedule(void 0,Q):I.complete())},E)})}function nr(g,A){return g===void 0&&(g=0),A===void 0&&(A=yi),g<0&&(g=0),vE(g,g,A)}function MQ(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=ua(g),Q=Td(g,1/0),I=g;return I.length?I.length===1?RQ(I[0]):rr(Q)(qB(I,B)):tr}var dR=Array.isArray;function ow(g){return g.length===1&&dR(g[0])?g[0]:g}function lA(g,A){return dQ(function(B,Q){var I=0;B.subscribe(bB(Q,function(E){return g.call(A,E,I++)&&Q.next(E)}))})}function RR(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];return g=ow(g),g.length===1?RQ(g[0]):new wA(UR(g))}function UR(g){return function(A){for(var B=[],Q=function(E){B.push(RQ(g[E]).subscribe(bB(A,function(C){if(B){for(var i=0;i<B.length;i++)i!==E&&B[i].unsubscribe();B=null}A.next(C)})))},I=0;B&&!A.closed&&I<g.length;I++)Q(I)}}function iC(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=or(g),Q=ow(g);return Q.length?new wA(function(I){var E=Q.map(function(){return[]}),C=Q.map(function(){return!1});I.add(function(){E=C=null});for(var i=function(e){RQ(Q[e]).subscribe(bB(I,function(o){if(E[e].push(o),E.every(function(a){return a.length})){var s=E.map(function(a){return a.shift()});I.next(B?B.apply(void 0,ni([],$E(s))):s),E.some(function(a,D){return!a.length&&C[D]})&&I.complete()}},function(){C[e]=!0,!E[e].length&&I.complete()}))},t=0;!I.closed&&t<Q.length;t++)i(t);return function(){E=C=null}}):tr}function sI(g){return dQ(function(A,B){var Q=null,I=!1,E;Q=A.subscribe(bB(B,void 0,void 0,function(C){E=RQ(g(C,sI(g)(A))),Q?(Q.unsubscribe(),Q=null,E.subscribe(B)):I=!0})),I&&(Q.unsubscribe(),Q=null,E.subscribe(B))})}function kR(g,A,B,Q,I){return function(E,C){var i=B,t=A,e=0;E.subscribe(bB(C,function(o){var s=e++;t=i?g(t,o,s):(i=!0,o)},function(){i&&C.next(t),C.complete()}))}}function yR(g,A){return dQ(kR(g,A,arguments.length>=2,!1,!0))}var MR=function(g,A){return g.push(A),g};function $s(){return dQ(function(g,A){yR(MR,[])(g).subscribe(A)})}function AD(g,A){return lB(A)?sE(g,A,1):sE(g,1)}function Fg(g,A){return A===void 0&&(A=yi),dQ(function(B,Q){var I=null,E=null,C=null,i=function(){if(I){I.unsubscribe(),I=null;var e=E;E=null,Q.next(e)}};function t(){var e=C+g,o=A.now();if(o<e){I=this.schedule(void 0,e-o),Q.add(I);return}i()}B.subscribe(bB(Q,function(e){E=e,C=A.now(),I||(I=A.schedule(t,g),Q.add(I))},function(){i(),Q.complete()},void 0,function(){E=I=null}))})}function SR(g){return dQ(function(A,B){var Q=!1;A.subscribe(bB(B,function(I){Q=!0,B.next(I)},function(){Q||B.next(g),B.complete()}))})}function vA(g){return g<=0?function(){return tr}:dQ(function(A,B){var Q=0;A.subscribe(bB(B,function(I){++Q<=g&&(B.next(I),g<=Q&&B.complete())}))})}function NR(g){return VA(function(){return g})}function LR(g,A){return sE(function(B,Q){return RQ(g(B,Q)).pipe(vA(1),NR(B))})}function uR(g,A){A===void 0&&(A=yi);var B=vE(g,A);return LR(function(){return B})}function hr(g,A){return A===void 0&&(A=CC),g=g??JR,dQ(function(B,Q){var I,E=!0;B.subscribe(bB(Q,function(C){var i=A(C);(E||!g(I,i))&&(E=!1,I=i,Q.next(C))}))})}function JR(g,A){return g===A}function HR(g){return g===void 0&&(g=pR),dQ(function(A,B){var Q=!1;A.subscribe(bB(B,function(I){Q=!0,B.next(I)},function(){return Q?B.complete():B.error(g())}))})}function pR(){return new sr}function aI(g,A){var B=arguments.length>=2;return function(Q){return Q.pipe(CC,vA(1),B?SR(A):HR(function(){return new sr}))}}function mR(g){return dQ(function(A,B){var Q=!1,I=null;A.subscribe(bB(B,function(E){Q=!0,I=E})),RQ(g).subscribe(bB(B,function(){if(Q){Q=!1;var E=I;I=null,B.next(E)}},qo))})}function cr(g,A){return A===void 0&&(A=yi),mR(nr(g,A))}function un(g){return lA(function(A,B){return g<=B})}function hi(g,A){return dQ(function(B,Q){var I=null,E=0,C=!1,i=function(){return C&&!I&&Q.complete()};B.subscribe(bB(Q,function(t){I==null||I.unsubscribe();var e=0,o=E++;RQ(g(t,o)).subscribe(I=bB(Q,function(s){return Q.next(A?A(t,s,o,e++):s)},function(){I=null,i()}))},function(){C=!0,i()}))})}function c(g){return dQ(function(A,B){RQ(g).subscribe(bB(B,function(){return B.complete()},qo)),!B.closed&&A.subscribe(B)})}function qE(g,A,B){var Q=lB(g)||A||B?{next:g,error:A,complete:B}:g;return Q?dQ(function(I,E){var C;(C=Q.subscribe)===null||C===void 0||C.call(Q);var i=!0;I.subscribe(bB(E,function(t){var e;(e=Q.next)===null||e===void 0||e.call(Q,t),E.next(t)},function(){var t;i=!1,(t=Q.complete)===null||t===void 0||t.call(Q),E.complete()},function(t){var e;i=!1,(e=Q.error)===null||e===void 0||e.call(Q,t),E.error(t)},function(){var t,e;i&&((t=Q.unsubscribe)===null||t===void 0||t.call(Q)),(e=Q.finalize)===null||e===void 0||e.call(Q)}))}):CC}class Ja{constructor(A){this.onChange$=new y,this.style={...A}}get style(){return this._style}set style(A){let B=JSON.stringify(this._style);this._style={...this._style,...A},B!==JSON.stringify(this._style)&&this.onChange$.next(this._style)}}class $B{static isNullUndefinedOrWhitespace(A){return typeof A===void 0||A==null?!0:`${A}`.replace(/\s/g,"").length<1}static isNonEmpty(A){return!this.isNullUndefinedOrWhitespace(A)}static isEmpty(A){return!this.isNonEmpty(A)}static toArrayBuffer(A){return new TextEncoder().encode(A).buffer}}class UB extends Error{constructor(A,B){super(A),this.name=$B.isNullUndefinedOrWhitespace(B)?"OmpError":B}}class aw extends UB{constructor(A){super(A,"OmpBroadcastChannelError")}}class sw extends UB{constructor(A){super(A,"OmpBroadcastChannelTimeoutError")}}class cQ extends UB{constructor(A){super(A,"OmpVideoWindowPlaybackError")}}var sB;(function(g){g.assertEqual=I=>I;function A(I){}g.assertIs=A;function B(I){throw new Error}g.assertNever=B,g.arrayToEnum=I=>{const E={};for(const C of I)E[C]=C;return E},g.getValidEnumValues=I=>{const E=g.objectKeys(I).filter(i=>typeof I[I[i]]!="number"),C={};for(const i of E)C[i]=I[i];return g.objectValues(C)},g.objectValues=I=>g.objectKeys(I).map(function(E){return I[E]}),g.objectKeys=typeof Object.keys=="function"?I=>Object.keys(I):I=>{const E=[];for(const C in I)Object.prototype.hasOwnProperty.call(I,C)&&E.push(C);return E},g.find=(I,E)=>{for(const C of I)if(E(C))return C},g.isInteger=typeof Number.isInteger=="function"?I=>Number.isInteger(I):I=>typeof I=="number"&&isFinite(I)&&Math.floor(I)===I;function Q(I,E=" | "){return I.map(C=>typeof C=="string"?`'${C}'`:C).join(E)}g.joinValues=Q,g.jsonStringifyReplacer=(I,E)=>typeof E=="bigint"?E.toString():E})(sB||(sB={}));var BD;(function(g){g.mergeShapes=(A,B)=>({...A,...B})})(BD||(BD={}));const UA=sB.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),EE=g=>{switch(typeof g){case"undefined":return UA.undefined;case"string":return UA.string;case"number":return isNaN(g)?UA.nan:UA.number;case"boolean":return UA.boolean;case"function":return UA.function;case"bigint":return UA.bigint;case"symbol":return UA.symbol;case"object":return Array.isArray(g)?UA.array:g===null?UA.null:g.then&&typeof g.then=="function"&&g.catch&&typeof g.catch=="function"?UA.promise:typeof Map<"u"&&g instanceof Map?UA.map:typeof Set<"u"&&g instanceof Set?UA.set:typeof Date<"u"&&g instanceof Date?UA.date:UA.object;default:return UA.unknown}},EA=sB.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),YR=g=>JSON.stringify(g,null,2).replace(/"([^"]+)":/g,"$1:");class _Q extends Error{constructor(A){super(),this.issues=[],this.addIssue=Q=>{this.issues=[...this.issues,Q]},this.addIssues=(Q=[])=>{this.issues=[...this.issues,...Q]};const B=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,B):this.__proto__=B,this.name="ZodError",this.issues=A}get errors(){return this.issues}format(A){const B=A||function(E){return E.message},Q={_errors:[]},I=E=>{for(const C of E.issues)if(C.code==="invalid_union")C.unionErrors.map(I);else if(C.code==="invalid_return_type")I(C.returnTypeError);else if(C.code==="invalid_arguments")I(C.argumentsError);else if(C.path.length===0)Q._errors.push(B(C));else{let i=Q,t=0;for(;t<C.path.length;){const e=C.path[t];t===C.path.length-1?(i[e]=i[e]||{_errors:[]},i[e]._errors.push(B(C))):i[e]=i[e]||{_errors:[]},i=i[e],t++}}};return I(this),Q}static assert(A){if(!(A instanceof _Q))throw new Error(`Not a ZodError: ${A}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,sB.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(A=B=>B.message){const B={},Q=[];for(const I of this.issues)I.path.length>0?(B[I.path[0]]=B[I.path[0]]||[],B[I.path[0]].push(A(I))):Q.push(A(I));return{formErrors:Q,fieldErrors:B}}get formErrors(){return this.flatten()}}_Q.create=g=>new _Q(g);const ci=(g,A)=>{let B;switch(g.code){case EA.invalid_type:g.received===UA.undefined?B="Required":B=`Expected ${g.expected}, received ${g.received}`;break;case EA.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(g.expected,sB.jsonStringifyReplacer)}`;break;case EA.unrecognized_keys:B=`Unrecognized key(s) in object: ${sB.joinValues(g.keys,", ")}`;break;case EA.invalid_union:B="Invalid input";break;case EA.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${sB.joinValues(g.options)}`;break;case EA.invalid_enum_value:B=`Invalid enum value. Expected ${sB.joinValues(g.options)}, received '${g.received}'`;break;case EA.invalid_arguments:B="Invalid function arguments";break;case EA.invalid_return_type:B="Invalid function return type";break;case EA.invalid_date:B="Invalid date";break;case EA.invalid_string:typeof g.validation=="object"?"includes"in g.validation?(B=`Invalid input: must include "${g.validation.includes}"`,typeof g.validation.position=="number"&&(B=`${B} at one or more positions greater than or equal to ${g.validation.position}`)):"startsWith"in g.validation?B=`Invalid input: must start with "${g.validation.startsWith}"`:"endsWith"in g.validation?B=`Invalid input: must end with "${g.validation.endsWith}"`:sB.assertNever(g.validation):g.validation!=="regex"?B=`Invalid ${g.validation}`:B="Invalid";break;case EA.too_small:g.type==="array"?B=`Array must contain ${g.exact?"exactly":g.inclusive?"at least":"more than"} ${g.minimum} element(s)`:g.type==="string"?B=`String must contain ${g.exact?"exactly":g.inclusive?"at least":"over"} ${g.minimum} character(s)`:g.type==="number"?B=`Number must be ${g.exact?"exactly equal to ":g.inclusive?"greater than or equal to ":"greater than "}${g.minimum}`:g.type==="date"?B=`Date must be ${g.exact?"exactly equal to ":g.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(g.minimum))}`:B="Invalid input";break;case EA.too_big:g.type==="array"?B=`Array must contain ${g.exact?"exactly":g.inclusive?"at most":"less than"} ${g.maximum} element(s)`:g.type==="string"?B=`String must contain ${g.exact?"exactly":g.inclusive?"at most":"under"} ${g.maximum} character(s)`:g.type==="number"?B=`Number must be ${g.exact?"exactly":g.inclusive?"less than or equal to":"less than"} ${g.maximum}`:g.type==="bigint"?B=`BigInt must be ${g.exact?"exactly":g.inclusive?"less than or equal to":"less than"} ${g.maximum}`:g.type==="date"?B=`Date must be ${g.exact?"exactly":g.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(g.maximum))}`:B="Invalid input";break;case EA.custom:B="Invalid input";break;case EA.invalid_intersection_types:B="Intersection results could not be merged";break;case EA.not_multiple_of:B=`Number must be a multiple of ${g.multipleOf}`;break;case EA.not_finite:B="Number must be finite";break;default:B=A.defaultError,sB.assertNever(g)}return{message:B}};let Dw=ci;function KR(g){Dw=g}function zo(){return Dw}const Po=g=>{const{data:A,path:B,errorMaps:Q,issueData:I}=g,E=[...B,...I.path||[]],C={...I,path:E};if(I.message!==void 0)return{...I,path:E,message:I.message};let i="";const t=Q.filter(e=>!!e).slice().reverse();for(const e of t)i=e(C,{data:A,defaultError:i}).message;return{...I,path:E,message:i}},bR=[];function FA(g,A){const B=zo(),Q=Po({issueData:A,data:g.data,path:g.path,errorMaps:[g.common.contextualErrorMap,g.schemaErrorMap,B,B===ci?void 0:ci].filter(I=>!!I)});g.common.issues.push(Q)}class HQ{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(A,B){const Q=[];for(const I of B){if(I.status==="aborted")return WA;I.status==="dirty"&&A.dirty(),Q.push(I.value)}return{status:A.value,value:Q}}static async mergeObjectAsync(A,B){const Q=[];for(const I of B){const E=await I.key,C=await I.value;Q.push({key:E,value:C})}return HQ.mergeObjectSync(A,Q)}static mergeObjectSync(A,B){const Q={};for(const I of B){const{key:E,value:C}=I;if(E.status==="aborted"||C.status==="aborted")return WA;E.status==="dirty"&&A.dirty(),C.status==="dirty"&&A.dirty(),E.value!=="__proto__"&&(typeof C.value<"u"||I.alwaysSet)&&(Q[E.value]=C.value)}return{status:A.value,value:Q}}}const WA=Object.freeze({status:"aborted"}),PC=g=>({status:"dirty",value:g}),xQ=g=>({status:"valid",value:g}),QD=g=>g.status==="aborted",gD=g=>g.status==="dirty",Nt=g=>g.status==="valid",Lt=g=>typeof Promise<"u"&&g instanceof Promise;function jo(g,A,B,Q){if(typeof A=="function"?g!==A||!Q:!A.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return A.get(g)}function rw(g,A,B,Q,I){if(typeof A=="function"?g!==A||!I:!A.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return A.set(g,B),B}var JA;(function(g){g.errToObj=A=>typeof A=="string"?{message:A}:A||{},g.toString=A=>typeof A=="string"?A:A==null?void 0:A.message})(JA||(JA={}));var At,Bt;class nI{constructor(A,B,Q,I){this._cachedPath=[],this.parent=A,this.data=B,this._path=Q,this._key=I}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Jn=(g,A)=>{if(Nt(A))return{success:!0,data:A.value};if(!g.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const B=new _Q(g.common.issues);return this._error=B,this._error}}};function PA(g){if(!g)return{};const{errorMap:A,invalid_type_error:B,required_error:Q,description:I}=g;if(A&&(B||Q))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return A?{errorMap:A,description:I}:{errorMap:(C,i)=>{var t,e;const{message:o}=g;return C.code==="invalid_enum_value"?{message:o??i.defaultError}:typeof i.data>"u"?{message:(t=o??Q)!==null&&t!==void 0?t:i.defaultError}:C.code!=="invalid_type"?{message:i.defaultError}:{message:(e=o??B)!==null&&e!==void 0?e:i.defaultError}},description:I}}class AB{constructor(A){this.spa=this.safeParseAsync,this._def=A,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(A){return EE(A.data)}_getOrReturnCtx(A,B){return B||{common:A.parent.common,data:A.data,parsedType:EE(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new HQ,ctx:{common:A.parent.common,data:A.data,parsedType:EE(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){const B=this._parse(A);if(Lt(B))throw new Error("Synchronous parse encountered promise.");return B}_parseAsync(A){const B=this._parse(A);return Promise.resolve(B)}parse(A,B){const Q=this.safeParse(A,B);if(Q.success)return Q.data;throw Q.error}safeParse(A,B){var Q;const I={common:{issues:[],async:(Q=B==null?void 0:B.async)!==null&&Q!==void 0?Q:!1,contextualErrorMap:B==null?void 0:B.errorMap},path:(B==null?void 0:B.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:EE(A)},E=this._parseSync({data:A,path:I.path,parent:I});return Jn(I,E)}async parseAsync(A,B){const Q=await this.safeParseAsync(A,B);if(Q.success)return Q.data;throw Q.error}async safeParseAsync(A,B){const Q={common:{issues:[],contextualErrorMap:B==null?void 0:B.errorMap,async:!0},path:(B==null?void 0:B.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:EE(A)},I=this._parse({data:A,path:Q.path,parent:Q}),E=await(Lt(I)?I:Promise.resolve(I));return Jn(Q,E)}refine(A,B){const Q=I=>typeof B=="string"||typeof B>"u"?{message:B}:typeof B=="function"?B(I):B;return this._refinement((I,E)=>{const C=A(I),i=()=>E.addIssue({code:EA.custom,...Q(I)});return typeof Promise<"u"&&C instanceof Promise?C.then(t=>t?!0:(i(),!1)):C?!0:(i(),!1)})}refinement(A,B){return this._refinement((Q,I)=>A(Q)?!0:(I.addIssue(typeof B=="function"?B(Q,I):B),!1))}_refinement(A){return new bg({schema:this,typeName:fA.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}optional(){return DI.create(this,this._def)}nullable(){return hE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yg.create(this,this._def)}promise(){return Gi.create(this,this._def)}or(A){return pt.create([this,A],this._def)}and(A){return mt.create(this,A,this._def)}transform(A){return new bg({...PA(this._def),schema:this,typeName:fA.ZodEffects,effect:{type:"transform",transform:A}})}default(A){const B=typeof A=="function"?A:()=>A;return new Vt({...PA(this._def),innerType:this,defaultValue:B,typeName:fA.ZodDefault})}brand(){return new wr({typeName:fA.ZodBranded,type:this,...PA(this._def)})}catch(A){const B=typeof A=="function"?A:()=>A;return new Wt({...PA(this._def),innerType:this,catchValue:B,typeName:fA.ZodCatch})}describe(A){const B=this.constructor;return new B({...this._def,description:A})}pipe(A){return Ie.create(this,A)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const fR=/^c[^\s-]{8,}$/i,VR=/^[0-9a-z]+$/,WR=/^[0-9A-HJKMNP-TV-Z]{26}$/,xR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ZR=/^[a-z0-9_-]{21}$/i,TR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ms;const qR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,XR=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,zR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nw="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",PR=new RegExp(`^${nw}$`);function hw(g){let A="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return g.precision?A=`${A}\\.\\d{${g.precision}}`:g.precision==null&&(A=`${A}(\\.\\d+)?`),A}function jR(g){return new RegExp(`^${hw(g)}$`)}function cw(g){let A=`${nw}T${hw(g)}`;const B=[];return B.push(g.local?"Z?":"Z"),g.offset&&B.push("([+-]\\d{2}:?\\d{2})"),A=`${A}(${B.join("|")})`,new RegExp(`^${A}$`)}function _R(g,A){return!!((A==="v4"||!A)&&qR.test(g)||(A==="v6"||!A)&&XR.test(g))}class Jg extends AB{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==UA.string){const E=this._getOrReturnCtx(A);return FA(E,{code:EA.invalid_type,expected:UA.string,received:E.parsedType}),WA}const Q=new HQ;let I;for(const E of this._def.checks)if(E.kind==="min")A.data.length<E.value&&(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.too_small,minimum:E.value,type:"string",inclusive:!0,exact:!1,message:E.message}),Q.dirty());else if(E.kind==="max")A.data.length>E.value&&(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.too_big,maximum:E.value,type:"string",inclusive:!0,exact:!1,message:E.message}),Q.dirty());else if(E.kind==="length"){const C=A.data.length>E.value,i=A.data.length<E.value;(C||i)&&(I=this._getOrReturnCtx(A,I),C?FA(I,{code:EA.too_big,maximum:E.value,type:"string",inclusive:!0,exact:!0,message:E.message}):i&&FA(I,{code:EA.too_small,minimum:E.value,type:"string",inclusive:!0,exact:!0,message:E.message}),Q.dirty())}else if(E.kind==="email")OR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"email",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="emoji")Ms||(Ms=new RegExp(vR,"u")),Ms.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"emoji",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="uuid")xR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"uuid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="nanoid")ZR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"nanoid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="cuid")fR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"cuid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="cuid2")VR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"cuid2",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="ulid")WR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"ulid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="url")try{new URL(A.data)}catch{I=this._getOrReturnCtx(A,I),FA(I,{validation:"url",code:EA.invalid_string,message:E.message}),Q.dirty()}else E.kind==="regex"?(E.regex.lastIndex=0,E.regex.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"regex",code:EA.invalid_string,message:E.message}),Q.dirty())):E.kind==="trim"?A.data=A.data.trim():E.kind==="includes"?A.data.includes(E.value,E.position)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{includes:E.value,position:E.position},message:E.message}),Q.dirty()):E.kind==="toLowerCase"?A.data=A.data.toLowerCase():E.kind==="toUpperCase"?A.data=A.data.toUpperCase():E.kind==="startsWith"?A.data.startsWith(E.value)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{startsWith:E.value},message:E.message}),Q.dirty()):E.kind==="endsWith"?A.data.endsWith(E.value)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{endsWith:E.value},message:E.message}),Q.dirty()):E.kind==="datetime"?cw(E).test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:"datetime",message:E.message}),Q.dirty()):E.kind==="date"?PR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.i