UNPKG

@byomakase/omakase-player

Version:

## Omakase Player - Open source JavaScript framework for building frame accurate video experiences

3 lines • 1.09 MB
(function(Qe,st){typeof exports=="object"&&typeof module<"u"?st(exports,require("hls.js")):typeof define=="function"&&define.amd?define(["exports","hls.js"],st):(Qe=typeof globalThis<"u"?globalThis:Qe||self,st(Qe.omakase={},Qe.Hls))})(this,function(Qe,st){"use strict";var gd=function(A,e){return gd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])},gd(A,e)};function BA(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");gd(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function VE(A,e,t,i){function r(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(d){try{l(i.next(d))}catch(h){n(h)}}function o(d){try{l(i.throw(d))}catch(h){n(h)}}function l(d){d.done?s(d.value):r(d.value).then(a,o)}l((i=i.apply(A,e||[])).next())})}function $c(A,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(l){return function(d){return o([l,d])}}function o(l){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(t=0)),t;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,r=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(A,t)}catch(d){l=[6,d],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function ts(A){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&A[e],i=0;if(t)return t.call(A);if(A&&typeof A.length=="number")return{next:function(){return A&&i>=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vr(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),r,s=[],n;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){n={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return s}function is(A,e,t){if(t||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return A.concat(s||Array.prototype.slice.call(e))}function As(A){return this instanceof As?(this.v=A,this):new As(A)}function YE(A,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(A,e||[]),r,s=[];return r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r;function n(c){i[c]&&(r[c]=function(m){return new Promise(function(g,u){s.push([c,m,g,u])>1||a(c,m)})})}function a(c,m){try{o(i[c](m))}catch(g){h(s[0][3],g)}}function o(c){c.value instanceof As?Promise.resolve(c.value.v).then(l,d):h(s[0][2],c)}function l(c){a("next",c)}function d(c){a("throw",c)}function h(c,m){c(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function WE(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=A[Symbol.asyncIterator],t;return e?e.call(A):(A=typeof ts=="function"?ts(A):A[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=A[s]&&function(n){return new Promise(function(a,o){n=A[s](n),r(a,o,n.done,n.value)})}}function r(s,n,a,o){Promise.resolve(o).then(function(l){s({value:l,done:a})},n)}}typeof SuppressedError=="function"&&SuppressedError;function ze(A){return typeof A=="function"}function Pa(A){var e=function(i){Error.call(i),i.stack=new Error().stack},t=A(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var md=Pa(function(A){return function(t){A(this),this.message=t?t.length+` errors occurred during unsubscription: `+t.map(function(i,r){return r+1+") "+i.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=t}});function Ma(A,e){if(A){var t=A.indexOf(e);0<=t&&A.splice(t,1)}}var on=function(){function A(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return A.prototype.unsubscribe=function(){var e,t,i,r,s;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var a=ts(n),o=a.next();!o.done;o=a.next()){var l=o.value;l.remove(this)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else n.remove(this);var d=this.initialTeardown;if(ze(d))try{d()}catch(u){s=u instanceof md?u.errors:[u]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var c=ts(h),m=c.next();!m.done;m=c.next()){var g=m.value;try{Yc(g)}catch(u){s=s??[],u instanceof md?s=is(is([],vr(s)),vr(u.errors)):s.push(u)}}}catch(u){i={error:u}}finally{try{m&&!m.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}if(s)throw new md(s)}},A.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Yc(e);else{if(e instanceof A){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},A.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},A.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},A.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ma(t,e)},A.prototype.remove=function(e){var t=this._finalizers;t&&Ma(t,e),e instanceof A&&e._removeParent(this)},A.EMPTY=function(){var e=new A;return e.closed=!0,e}(),A}(),Uc=on.EMPTY;function Vc(A){return A instanceof on||A&&"closed"in A&&ze(A.remove)&&ze(A.add)&&ze(A.unsubscribe)}function Yc(A){ze(A)?A():A.unsubscribe()}var Wc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},zc={setTimeout:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,is([A,e],vr(t)))},clearTimeout:function(A){var e=zc.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(A)},delegate:void 0};function Kc(A){zc.setTimeout(function(){throw A})}function Ra(){}function xa(A){A()}var fd=function(A){BA(e,A);function e(t){var i=A.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Vc(t)&&t.add(i)):i.destination=qE,i}return e.create=function(t,i,r){return new La(t,i,r)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(on),zE=Function.prototype.bind;function pd(A,e){return zE.call(A,e)}var KE=function(){function A(e){this.partialObserver=e}return A.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){Na(i)}},A.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Na(i)}else Na(e)},A.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Na(t)}},A}(),La=function(A){BA(e,A);function e(t,i,r){var s=A.call(this)||this,n;if(ze(t)||!t)n={next:t??void 0,error:i??void 0,complete:r??void 0};else{var a;s&&Wc.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return s.unsubscribe()},n={next:t.next&&pd(t.next,a),error:t.error&&pd(t.error,a),complete:t.complete&&pd(t.complete,a)}):n=t}return s.destination=new KE(n),s}return e}(fd);function Na(A){Kc(A)}function JE(A){throw A}var qE={closed:!0,next:Ra,error:JE,complete:Ra},Ed=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ir(A){return A}function XE(A){return A.length===0?Ir:A.length===1?A[0]:function(t){return A.reduce(function(i,r){return r(i)},t)}}var le=function(){function A(e){e&&(this._subscribe=e)}return A.prototype.lift=function(e){var t=new A;return t.source=this,t.operator=e,t},A.prototype.subscribe=function(e,t,i){var r=this,s=jE(e)?e:new La(e,t,i);return xa(function(){var n=r,a=n.operator,o=n.source;s.add(a?a.call(s,o):o?r._subscribe(s):r._trySubscribe(s))}),s},A.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},A.prototype.forEach=function(e,t){var i=this;return t=Jc(t),new t(function(r,s){var n=new La({next:function(a){try{e(a)}catch(o){s(o),n.unsubscribe()}},error:s,complete:r});i.subscribe(n)})},A.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},A.prototype[Ed]=function(){return this},A.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return XE(e)(this)},A.prototype.toPromise=function(e){var t=this;return e=Jc(e),new e(function(i,r){var s;t.subscribe(function(n){return s=n},function(n){return r(n)},function(){return i(s)})})},A.create=function(e){return new A(e)},A}();function Jc(A){var e;return(e=A??Wc.Promise)!==null&&e!==void 0?e:Promise}function ZE(A){return A&&ze(A.next)&&ze(A.error)&&ze(A.complete)}function jE(A){return A&&A instanceof fd||ZE(A)&&Vc(A)}function eC(A){return ze(A==null?void 0:A.lift)}function Rt(A){return function(e){if(eC(e))return e.lift(function(t){try{return A(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function ht(A,e,t,i,r){return new tC(A,e,t,i,r)}var tC=function(A){BA(e,A);function e(t,i,r,s,n,a){var o=A.call(this,t)||this;return o.onFinalize=n,o.shouldUnsubscribe=a,o._next=i?function(l){try{i(l)}catch(d){t.error(d)}}:A.prototype._next,o._error=s?function(l){try{s(l)}catch(d){t.error(d)}finally{this.unsubscribe()}}:A.prototype._error,o._complete=r?function(){try{r()}catch(l){t.error(l)}finally{this.unsubscribe()}}:A.prototype._complete,o}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;A.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(fd),iC=Pa(function(A){return function(){A(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),y=function(A){BA(e,A);function e(){var t=A.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new qc(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new iC},e.prototype.next=function(t){var i=this;xa(function(){var r,s;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var n=ts(i.currentObservers),a=n.next();!a.done;a=n.next()){var o=a.value;o.next(t)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var i=this;xa(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var r=i.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;xa(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),A.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,r=this,s=r.hasError,n=r.isStopped,a=r.observers;return s||n?Uc:(this.currentObservers=null,a.push(t),new on(function(){i.currentObservers=null,Ma(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,r=i.hasError,s=i.thrownError,n=i.isStopped;r?t.error(s):n&&t.complete()},e.prototype.asObservable=function(){var t=new le;return t.source=this,t},e.create=function(t,i){return new qc(t,i)},e}(le),qc=function(A){BA(e,A);function e(t,i){var r=A.call(this)||this;return r.destination=t,r.source=i,r}return e.prototype.next=function(t){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,t)},e.prototype.error=function(t){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&r!==void 0?r:Uc},e}(y),nt=function(A){BA(e,A);function e(t){var i=A.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=A.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,r=t.thrownError,s=t._value;if(i)throw r;return this._throwIfClosed(),s},e.prototype.next=function(t){A.prototype.next.call(this,this._value=t)},e}(y),AC={now:function(){return Date.now()},delegate:void 0},rC=function(A){BA(e,A);function e(t,i){return A.call(this)||this}return e.prototype.schedule=function(t,i){return this},e}(on),Xc={setInterval:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,is([A,e],vr(t)))},clearInterval:function(A){return clearInterval(A)},delegate:void 0},sC=function(A){BA(e,A);function e(t,i){var r=A.call(this,t,i)||this;return r.scheduler=t,r.work=i,r.pending=!1,r}return e.prototype.schedule=function(t,i){var r;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var s=this.id,n=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(n,s,i)),this.pending=!0,this.delay=i,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(n,this.id,i),this},e.prototype.requestAsyncId=function(t,i,r){return r===void 0&&(r=0),Xc.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,i,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return i;i!=null&&Xc.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,i);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var r=!1,s;try{this.work(t)}catch(n){r=!0,s=n||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,r=t.scheduler,s=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ma(s,this),i!=null&&(this.id=this.recycleAsyncId(r,i,null)),this.delay=null,A.prototype.unsubscribe.call(this)}},e}(rC),Zc=function(){function A(e,t){t===void 0&&(t=A.now),this.schedulerActionCtor=e,this.now=t}return A.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},A.now=AC.now,A}(),nC=function(A){BA(e,A);function e(t,i){i===void 0&&(i=Zc.now);var r=A.call(this,t,i)||this;return r.actions=[],r._active=!1,r}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var r;this._active=!0;do if(r=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,r){for(;t=i.shift();)t.unsubscribe();throw r}},e}(Zc),rs=new nC(sC),aC=rs,Cd=new le(function(A){return A.complete()});function jc(A){return A&&ze(A.schedule)}function vd(A){return A[A.length-1]}function Id(A){return ze(vd(A))?A.pop():void 0}function Fa(A){return jc(vd(A))?A.pop():void 0}function oC(A,e){return typeof vd(A)=="number"?A.pop():e}var _d=function(A){return A&&typeof A.length=="number"&&typeof A!="function"};function eu(A){return ze(A==null?void 0:A.then)}function tu(A){return ze(A[Ed])}function iu(A){return Symbol.asyncIterator&&ze(A==null?void 0:A[Symbol.asyncIterator])}function Au(A){return new TypeError("You provided "+(A!==null&&typeof A=="object"?"an invalid object":"'"+A+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function lC(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ru=lC();function su(A){return ze(A==null?void 0:A[ru])}function nu(A){return YE(this,arguments,function(){var t,i,r,s;return $c(this,function(n){switch(n.label){case 0:t=A.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,As(t.read())];case 3:return i=n.sent(),r=i.value,s=i.done,s?[4,As(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,As(r)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function au(A){return ze(A==null?void 0:A.getReader)}function xt(A){if(A instanceof le)return A;if(A!=null){if(tu(A))return dC(A);if(_d(A))return hC(A);if(eu(A))return ue(A);if(iu(A))return ou(A);if(su(A))return cC(A);if(au(A))return uC(A)}throw Au(A)}function dC(A){return new le(function(e){var t=A[Ed]();if(ze(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function hC(A){return new le(function(e){for(var t=0;t<A.length&&!e.closed;t++)e.next(A[t]);e.complete()})}function ue(A){return new le(function(e){A.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Kc)})}function cC(A){return new le(function(e){var t,i;try{for(var r=ts(A),s=r.next();!s.done;s=r.next()){var n=s.value;if(e.next(n),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}e.complete()})}function ou(A){return new le(function(e){gC(A,e).catch(function(t){return e.error(t)})})}function uC(A){return ou(nu(A))}function gC(A,e){var t,i,r,s;return VE(this,void 0,void 0,function(){var n,a;return $c(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),t=WE(A),o.label=1;case 1:return[4,t.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(n=i.value,e.next(n),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=o.sent(),r={error:a},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function wA(A,e,t,i,r){i===void 0&&(i=0),r===void 0&&(r=!1);var s=e.schedule(function(){t(),r?A.add(this.schedule(null,i)):this.unsubscribe()},i);if(A.add(s),!r)return s}function lu(A,e){return e===void 0&&(e=0),Rt(function(t,i){t.subscribe(ht(i,function(r){return wA(i,A,function(){return i.next(r)},e)},function(){return wA(i,A,function(){return i.complete()},e)},function(r){return wA(i,A,function(){return i.error(r)},e)}))})}function du(A,e){return e===void 0&&(e=0),Rt(function(t,i){i.add(A.schedule(function(){return t.subscribe(i)},e))})}function mC(A,e){return xt(A).pipe(du(e),lu(e))}function fC(A,e){return xt(A).pipe(du(e),lu(e))}function pC(A,e){return new le(function(t){var i=0;return e.schedule(function(){i===A.length?t.complete():(t.next(A[i++]),t.closed||this.schedule())})})}function EC(A,e){return new le(function(t){var i;return wA(t,e,function(){i=A[ru](),wA(t,e,function(){var r,s,n;try{r=i.next(),s=r.value,n=r.done}catch(a){t.error(a);return}n?t.complete():t.next(s)},0,!0)}),function(){return ze(i==null?void 0:i.return)&&i.return()}})}function hu(A,e){if(!A)throw new Error("Iterable cannot be null");return new le(function(t){wA(t,e,function(){var i=A[Symbol.asyncIterator]();wA(t,e,function(){i.next().then(function(r){r.done?t.complete():t.next(r.value)})},0,!0)})})}function CC(A,e){return hu(nu(A),e)}function vC(A,e){if(A!=null){if(tu(A))return mC(A,e);if(_d(A))return pC(A,e);if(eu(A))return fC(A,e);if(iu(A))return hu(A,e);if(su(A))return EC(A,e);if(au(A))return CC(A,e)}throw Au(A)}function Kt(A,e){return e?vC(A,e):xt(A)}function Jt(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fa(A);return Kt(A,t)}var Bd=Pa(function(A){return function(){A(this),this.name="EmptyError",this.message="no elements in sequence"}});function me(A,e){return new Promise(function(t,i){var r=new La({next:function(s){t(s),r.unsubscribe()},error:i,complete:function(){i(new Bd)}});A.subscribe(r)})}function cu(A){return A instanceof Date&&!isNaN(A)}var IC=Pa(function(A){return function(t){t===void 0&&(t=null),A(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function _r(A,e){var t=cu(A)?{first:A}:typeof A=="number"?{each:A}:A,i=t.first,r=t.each,s=t.with,n=s===void 0?_C:s,a=t.scheduler,o=a===void 0?rs:a,l=t.meta,d=l===void 0?null:l;if(i==null&&r==null)throw new TypeError("No timeout provided.");return Rt(function(h,c){var m,g,u=null,f=0,I=function(v){g=wA(c,o,function(){try{m.unsubscribe(),xt(n({meta:d,lastValue:u,seen:f})).subscribe(c)}catch(_){c.error(_)}},v)};m=h.subscribe(ht(c,function(v){g==null||g.unsubscribe(),f++,c.next(u=v),r>0&&I(r)},void 0,void 0,function(){g!=null&&g.closed||g==null||g.unsubscribe(),u=null})),!f&&I(i!=null?typeof i=="number"?i:+i-o.now():r)})}function _C(A){throw new IC(A)}function _e(A,e){return Rt(function(t,i){var r=0;t.subscribe(ht(i,function(s){i.next(A.call(e,s,r++))}))})}var BC=Array.isArray;function wC(A,e){return BC(e)?A.apply(void 0,is([],vr(e))):A(e)}function wd(A){return _e(function(e){return wC(A,e)})}var bC=Array.isArray,yC=Object.getPrototypeOf,QC=Object.prototype,DC=Object.keys;function uu(A){if(A.length===1){var e=A[0];if(bC(e))return{args:e,keys:null};if(SC(e)){var t=DC(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:A,keys:null}}function SC(A){return A&&typeof A=="object"&&yC(A)===QC}function gu(A,e){return A.reduce(function(t,i,r){return t[i]=e[r],t},{})}function Ga(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fa(A),i=Id(A),r=uu(A),s=r.args,n=r.keys;if(s.length===0)return Kt([],t);var a=new le(TC(s,t,n?function(o){return gu(n,o)}:Ir));return i?a.pipe(wd(i)):a}function TC(A,e,t){return t===void 0&&(t=Ir),function(i){mu(e,function(){for(var r=A.length,s=new Array(r),n=r,a=r,o=function(d){mu(e,function(){var h=Kt(A[d],e),c=!1;h.subscribe(ht(i,function(m){s[d]=m,c||(c=!0,a--),a||i.next(t(s.slice()))},function(){--n||i.complete()}))},i)},l=0;l<r;l++)o(l)},i)}}function mu(A,e,t){A?wA(t,A,e):e()}function kC(A,e,t,i,r,s,n,a){var o=[],l=0,d=0,h=!1,c=function(){h&&!o.length&&!l&&e.complete()},m=function(u){return l<i?g(u):o.push(u)},g=function(u){l++;var f=!1;xt(t(u,d++)).subscribe(ht(e,function(I){e.next(I)},function(){f=!0},void 0,function(){if(f)try{l--;for(var I=function(){var v=o.shift();n||g(v)};o.length&&l<i;)I();c()}catch(v){e.error(v)}}))};return A.subscribe(ht(e,m,function(){h=!0,c()})),function(){}}function $A(A,e,t){return t===void 0&&(t=1/0),ze(e)?$A(function(i,r){return _e(function(s,n){return e(i,s,r,n)})(xt(A(i,r)))},t):(typeof e=="number"&&(t=e),Rt(function(i,r){return kC(i,r,A,t)}))}function bd(A){return A===void 0&&(A=1/0),$A(Ir,A)}function PC(){return bd(1)}function MC(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return PC()(Kt(A,Fa(A)))}function RC(A){return new le(function(e){xt(A()).subscribe(e)})}function ci(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Id(A),i=uu(A),r=i.args,s=i.keys,n=new le(function(a){var o=r.length;if(!o){a.complete();return}for(var l=new Array(o),d=o,h=o,c=function(g){var u=!1;xt(r[g]).subscribe(ht(a,function(f){u||(u=!0,h--),l[g]=f},function(){return d--},void 0,function(){(!d||!u)&&(h||a.next(s?gu(s,l):l),a.complete())}))},m=0;m<o;m++)c(m)});return t?n.pipe(wd(t)):n}var xC=["addListener","removeListener"],LC=["addEventListener","removeEventListener"],NC=["on","off"];function Le(A,e,t,i){if(ze(t)&&(i=t,t=void 0),i)return Le(A,e,t).pipe(wd(i));var r=vr(OC(A)?LC.map(function(a){return function(o){return A[a](e,o,t)}}):FC(A)?xC.map(fu(A,e)):GC(A)?NC.map(fu(A,e)):[],2),s=r[0],n=r[1];if(!s&&_d(A))return $A(function(a){return Le(a,e,t)})(xt(A));if(!s)throw new TypeError("Invalid event target");return new le(function(a){var o=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return a.next(1<l.length?l:l[0])};return s(o),function(){return n(o)}})}function fu(A,e){return function(t){return function(i){return A[t](e,i)}}}function FC(A){return ze(A.addListener)&&ze(A.removeListener)}function GC(A){return ze(A.on)&&ze(A.off)}function OC(A){return ze(A.addEventListener)&&ze(A.removeEventListener)}function ln(A,e,t){A===void 0&&(A=0),t===void 0&&(t=aC);var i=-1;return e!=null&&(jc(e)?t=e:i=e),new le(function(r){var s=cu(A)?+A-t.now():A;s<0&&(s=0);var n=0;return t.schedule(function(){r.closed||(r.next(n++),0<=i?this.schedule(void 0,i):r.complete())},s)})}function yd(A,e){return A===void 0&&(A=0),e===void 0&&(e=rs),A<0&&(A=0),ln(A,A,e)}function Xi(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fa(A),i=oC(A,1/0),r=A;return r.length?r.length===1?xt(r[0]):bd(i)(Kt(r,t)):Cd}var HC=Array.isArray;function pu(A){return A.length===1&&HC(A[0])?A[0]:A}function ce(A,e){return Rt(function(t,i){var r=0;t.subscribe(ht(i,function(s){return A.call(e,s,r++)&&i.next(s)}))})}function $C(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return A=pu(A),A.length===1?xt(A[0]):new le(UC(A))}function UC(A){return function(e){for(var t=[],i=function(s){t.push(xt(A[s]).subscribe(ht(e,function(n){if(t){for(var a=0;a<t.length;a++)a!==s&&t[a].unsubscribe();t=null}e.next(n)})))},r=0;t&&!e.closed&&r<A.length;r++)i(r)}}function Br(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Id(A),i=pu(A);return i.length?new le(function(r){var s=i.map(function(){return[]}),n=i.map(function(){return!1});r.add(function(){s=n=null});for(var a=function(l){xt(i[l]).subscribe(ht(r,function(d){if(s[l].push(d),s.every(function(c){return c.length})){var h=s.map(function(c){return c.shift()});r.next(t?t.apply(void 0,is([],vr(h))):h),s.some(function(c,m){return!c.length&&n[m]})&&r.complete()}},function(){n[l]=!0,!s[l].length&&r.complete()}))},o=0;!r.closed&&o<i.length;o++)a(o);return function(){s=n=null}}):Cd}function wr(A){return Rt(function(e,t){var i=null,r=!1,s;i=e.subscribe(ht(t,void 0,void 0,function(n){s=xt(A(n,wr(A)(e))),i?(i.unsubscribe(),i=null,s.subscribe(t)):r=!0})),r&&(i.unsubscribe(),i=null,s.subscribe(t))})}function VC(A,e,t,i,r){return function(s,n){var a=t,o=e,l=0;s.subscribe(ht(n,function(d){var h=l++;o=a?A(o,d,h):(a=!0,d)},function(){a&&n.next(o),n.complete()}))}}function YC(A,e){return Rt(VC(A,e,arguments.length>=2,!1,!0))}var WC=function(A,e){return A.push(e),A};function Qd(){return Rt(function(A,e){YC(WC,[])(A).subscribe(e)})}function Dd(A,e){return ze(e)?$A(A,e,1):$A(A,1)}function yi(A,e){return e===void 0&&(e=rs),Rt(function(t,i){var r=null,s=null,n=null,a=function(){if(r){r.unsubscribe(),r=null;var l=s;s=null,i.next(l)}};function o(){var l=n+A,d=e.now();if(d<l){r=this.schedule(void 0,l-d),i.add(r);return}a()}t.subscribe(ht(i,function(l){s=l,n=e.now(),r||(r=e.schedule(o,A),i.add(r))},function(){a(),i.complete()},void 0,function(){s=r=null}))})}function zC(A){return Rt(function(e,t){var i=!1;e.subscribe(ht(t,function(r){i=!0,t.next(r)},function(){i||t.next(A),t.complete()}))})}function At(A){return A<=0?function(){return Cd}:Rt(function(e,t){var i=0;e.subscribe(ht(t,function(r){++i<=A&&(t.next(r),A<=i&&t.complete())}))})}function KC(A){return _e(function(){return A})}function JC(A,e){return $A(function(t,i){return xt(A(t,i)).pipe(At(1),KC(t))})}function qC(A,e){e===void 0&&(e=rs);var t=ln(A,e);return JC(function(){return t})}function Sd(A,e){return e===void 0&&(e=Ir),A=A??XC,Rt(function(t,i){var r,s=!0;t.subscribe(ht(i,function(n){var a=e(n);(s||!A(r,a))&&(s=!1,r=a,i.next(n))}))})}function XC(A,e){return A===e}function ZC(A){return A===void 0&&(A=jC),Rt(function(e,t){var i=!1;e.subscribe(ht(t,function(r){i=!0,t.next(r)},function(){return i?t.complete():t.error(A())}))})}function jC(){return new Bd}function ss(A,e){var t=arguments.length>=2;return function(i){return i.pipe(Ir,At(1),t?zC(e):ZC(function(){return new Bd}))}}function ev(A){return Rt(function(e,t){var i=!1,r=null;e.subscribe(ht(t,function(s){i=!0,r=s})),xt(A).subscribe(ht(t,function(){if(i){i=!1;var s=r;r=null,t.next(s)}},Ra))})}function Eu(A,e){return e===void 0&&(e=rs),ev(yd(A,e))}function Cu(A){return ce(function(e,t){return A<=t})}function Oa(A,e){return Rt(function(t,i){var r=null,s=0,n=!1,a=function(){return n&&!r&&i.complete()};t.subscribe(ht(i,function(o){r==null||r.unsubscribe();var l=0,d=s++;xt(A(o,d)).subscribe(r=ht(i,function(h){return i.next(e?e(o,h,d,l++):h)},function(){r=null,a()}))},function(){n=!0,a()}))})}function E(A){return Rt(function(e,t){xt(A).subscribe(ht(t,function(){return t.complete()},Ra)),!t.closed&&e.subscribe(t)})}function vu(A,e,t){var i=ze(A)||e||t?{next:A,error:e,complete:t}:A;return i?Rt(function(r,s){var n;(n=i.subscribe)===null||n===void 0||n.call(i);var a=!0;r.subscribe(ht(s,function(o){var l;(l=i.next)===null||l===void 0||l.call(i,o),s.next(o)},function(){var o;a=!1,(o=i.complete)===null||o===void 0||o.call(i),s.complete()},function(o){var l;a=!1,(l=i.error)===null||l===void 0||l.call(i,o),s.error(o)},function(){var o,l;a&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):Ir}class Ha{constructor(e){this.onChange$=new y,this.style={...e}}get style(){return this._style}set style(e){let t=JSON.stringify(this._style);this._style={...this._style,...e},t!==JSON.stringify(this._style)&&this.onChange$.next(this._style)}}class Ut{static isNullUndefinedOrWhitespace(e){return typeof e===void 0||e==null?!0:`${e}`.replace(/\s/g,"").length<1}static isNonEmpty(e){return!this.isNullUndefinedOrWhitespace(e)}static isEmpty(e){return!this.isNonEmpty(e)}static toArrayBuffer(e){return new TextEncoder().encode(e).buffer}}class Ci extends Error{constructor(e,t){super(e),this.name=Ut.isNullUndefinedOrWhitespace(t)?"OmpError":t}}class Iu extends Ci{constructor(e){super(e,"OmpBroadcastChannelError")}}class _u extends Ci{constructor(e){super(e,"OmpBroadcastChannelTimeoutError")}}class qt extends Ci{constructor(e){super(e,"OmpVideoWindowPlaybackError")}}var Fe;(function(A){A.assertEqual=r=>r;function e(r){}A.assertIs=e;function t(r){throw new Error}A.assertNever=t,A.arrayToEnum=r=>{const s={};for(const n of r)s[n]=n;return s},A.getValidEnumValues=r=>{const s=A.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),n={};for(const a of s)n[a]=r[a];return A.objectValues(n)},A.objectValues=r=>A.objectKeys(r).map(function(s){return r[s]}),A.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&s.push(n);return s},A.find=(r,s)=>{for(const n of r)if(s(n))return n},A.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(n=>typeof n=="string"?`'${n}'`:n).join(s)}A.joinValues=i,A.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Fe||(Fe={}));var Td;(function(A){A.mergeShapes=(e,t)=>({...e,...t})})(Td||(Td={}));const Ae=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),UA=A=>{switch(typeof A){case"undefined":return Ae.undefined;case"string":return Ae.string;case"number":return isNaN(A)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"symbol":return Ae.symbol;case"object":return Array.isArray(A)?Ae.array:A===null?Ae.null:A.then&&typeof A.then=="function"&&A.catch&&typeof A.catch=="function"?Ae.promise:typeof Map<"u"&&A instanceof Map?Ae.map:typeof Set<"u"&&A instanceof Set?Ae.set:typeof Date<"u"&&A instanceof Date?Ae.date:Ae.object;default:return Ae.unknown}},U=Fe.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"]),tv=A=>JSON.stringify(A,null,2).replace(/"([^"]+)":/g,"$1:");class ui extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const n of s.issues)if(n.code==="invalid_union")n.unionErrors.map(r);else if(n.code==="invalid_return_type")r(n.returnTypeError);else if(n.code==="invalid_arguments")r(n.argumentsError);else if(n.path.length===0)i._errors.push(t(n));else{let a=i,o=0;for(;o<n.path.length;){const l=n.path[o];o===n.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(n))):a[l]=a[l]||{_errors:[]},a=a[l],o++}}};return r(this),i}static assert(e){if(!(e instanceof ui))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}ui.create=A=>new ui(A);const ns=(A,e)=>{let t;switch(A.code){case U.invalid_type:A.received===Ae.undefined?t="Required":t=`Expected ${A.expected}, received ${A.received}`;break;case U.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(A.expected,Fe.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:t=`Unrecognized key(s) in object: ${Fe.joinValues(A.keys,", ")}`;break;case U.invalid_union:t="Invalid input";break;case U.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Fe.joinValues(A.options)}`;break;case U.invalid_enum_value:t=`Invalid enum value. Expected ${Fe.joinValues(A.options)}, received '${A.received}'`;break;case U.invalid_arguments:t="Invalid function arguments";break;case U.invalid_return_type:t="Invalid function return type";break;case U.invalid_date:t="Invalid date";break;case U.invalid_string:typeof A.validation=="object"?"includes"in A.validation?(t=`Invalid input: must include "${A.validation.includes}"`,typeof A.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${A.validation.position}`)):"startsWith"in A.validation?t=`Invalid input: must start with "${A.validation.startsWith}"`:"endsWith"in A.validation?t=`Invalid input: must end with "${A.validation.endsWith}"`:Fe.assertNever(A.validation):A.validation!=="regex"?t=`Invalid ${A.validation}`:t="Invalid";break;case U.too_small:A.type==="array"?t=`Array must contain ${A.exact?"exactly":A.inclusive?"at least":"more than"} ${A.minimum} element(s)`:A.type==="string"?t=`String must contain ${A.exact?"exactly":A.inclusive?"at least":"over"} ${A.minimum} character(s)`:A.type==="number"?t=`Number must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${A.minimum}`:A.type==="date"?t=`Date must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(A.minimum))}`:t="Invalid input";break;case U.too_big:A.type==="array"?t=`Array must contain ${A.exact?"exactly":A.inclusive?"at most":"less than"} ${A.maximum} element(s)`:A.type==="string"?t=`String must contain ${A.exact?"exactly":A.inclusive?"at most":"under"} ${A.maximum} character(s)`:A.type==="number"?t=`Number must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:A.type==="bigint"?t=`BigInt must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:A.type==="date"?t=`Date must be ${A.exact?"exactly":A.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(A.maximum))}`:t="Invalid input";break;case U.custom:t="Invalid input";break;case U.invalid_intersection_types:t="Intersection results could not be merged";break;case U.not_multiple_of:t=`Number must be a multiple of ${A.multipleOf}`;break;case U.not_finite:t="Number must be finite";break;default:t=e.defaultError,Fe.assertNever(A)}return{message:t}};let Bu=ns;function iv(A){Bu=A}function $a(){return Bu}const Ua=A=>{const{data:e,path:t,errorMaps:i,issueData:r}=A,s=[...t,...r.path||[]],n={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const o=i.filter(l=>!!l).slice().reverse();for(const l of o)a=l(n,{data:e,defaultError:a}).message;return{...r,path:s,message:a}},Av=[];function ee(A,e){const t=$a(),i=Ua({issueData:e,data:A.data,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,t,t===ns?void 0:ns].filter(r=>!!r)});A.common.issues.push(i)}class Xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return Ce;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const s=await r.key,n=await r.value;i.push({key:s,value:n})}return Xt.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:n}=r;if(s.status==="aborted"||n.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),n.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof n.value<"u"||r.alwaysSet)&&(i[s.value]=n.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),as=A=>({status:"dirty",value:A}),ri=A=>({status:"valid",value:A}),kd=A=>A.status==="aborted",Pd=A=>A.status==="dirty",dn=A=>A.status==="valid",hn=A=>typeof Promise<"u"&&A instanceof Promise;function Va(A,e,t,i){if(typeof e=="function"?A!==e||!i:!e.has(A))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(A)}function wu(A,e,t,i,r){if(typeof e=="function"?A!==e||!r:!e.has(A))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(A,t),t}typeof SuppressedError=="function"&&SuppressedError;var de;(function(A){A.errToObj=e=>typeof e=="string"?{message:e}:e||{},A.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var cn,un;class Zi{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}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 bu=(A,e)=>{if(dn(e))return{success:!0,data:e.value};if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ui(A.common.issues);return this._error=t,this._error}}};function we(A){if(!A)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=A;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(n,a)=>{var o,l;const{message:d}=A;return n.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(o=d??i)!==null&&o!==void 0?o:a.defaultError}:n.code!=="invalid_type"?{message:a.defaultError}:{message:(l=d??t)!==null&&l!==void 0?l:a.defaultError}},description:r}}class Se{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return UA(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:UA(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xt,ctx:{common:e.parent.common,data:e.data,parsedType:UA(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:UA(e)},s=this._parseSync({data:e,path:r.path,parent:r});return bu(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:UA(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(hn(r)?r:Promise.resolve(r));return bu(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const n=e(r),a=()=>s.addIssue({code:U.custom,...i(r)});return typeof Promise<"u"&&n instanceof Promise?n.then(o=>o?!0:(a(),!1)):n?!0:(a(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new Ni({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return eA.create(this,this._def)}nullable(){return zA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Li.create(this,this._def)}promise(){return hs.create(this,this._def)}or(e){return pn.create([this,e],this._def)}and(e){return En.create(this,e,this._def)}transform(e){return new Ni({...we(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Bn({...we(this._def),innerType:this,defaultValue:t,typeName:Ee.ZodDefault})}brand(){return new xd({typeName:Ee.ZodBranded,type:this,...we(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new wn({...we(this._def),innerType:this,catchValue:t,typeName:Ee.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return bn.create(this,e)}readonly(){return yn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rv=/^c[^\s-]{8,}$/i,sv=/^[0-9a-z]+$/,nv=/^[0-9A-HJKMNP-TV-Z]{26}$/,av=/^[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,ov=/^[a-z0-9_-]{21}$/i,lv=/^[-+]?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)?)??$/,dv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Md;const cv=/^(?:(?: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])$/,uv=/^(([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})))$/,gv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yu="((\\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])))",mv=new RegExp(`^${yu}$`);function Qu(A){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return A.precision?e=`${e}\\.\\d{${A.precision}}`:A.precision==null&&(e=`${e}(\\.\\d+)?`),e}function fv(A){return new RegExp(`^${Qu(A)}$`)}function Du(A){let e=`${yu}T${Qu(A)}`;const t=[];return t.push(A.local?"Z?":"Z"),A.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function pv(A,e){return!!((e==="v4"||!e)&&cv.test(A)||(e==="v6"||!e)&&uv.test(A))}class xi extends Se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ae.string){const s=this._getOrReturnCtx(e);return ee(s,{code:U.invalid_type,expected:Ae.string,received:s.parsedType}),Ce}const i=new Xt;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),ee(r,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),ee(r,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const n=e.data.length>s.value,a=e.data.length<s.value;(n||a)&&(r=this._getOrReturnCtx(e,r),n?ee(r,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ee(r,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")dv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"email",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Md||(Md=new RegExp(hv,"u")),Md.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"emoji",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")av.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"uuid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")ov.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"nanoid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")rv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"cuid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")sv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"cuid2",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")nv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"ulid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ee(r,{validation:"url",code:U.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"regex",code:U.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Du(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?mv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:"date",message:s.message}),i.dirty()):s.