@daily-co/daily-js
Version:
**🚨Our docs have moved! 🚨**
1 lines • 128 kB
JavaScript
import e,{EventEmitter as t}from"events";var r=function(e){if(Array.isArray(e))return e};var n=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}};var i=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var a=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}};var o=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var s=function(e,t){return r(e)||n(e,t)||a(e,t)||o()};var c=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i};var u=function(e,t){if(null==e)return{};var r,n,i=c(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t){return e(t={exports:{}},t.exports),t.exports}var p=d(function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),o=new O(n||[]);return a._invoke=function(e,t,r){var n=d;return function(i,a){if(n===h)throw new Error("Generator is already running");if(n===f){if("throw"===i)throw a;return x()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=T(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?f:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=f,r.method="throw",r.arg=c.arg)}}}(e,r,o),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",h="executing",f="completed",v={};function g(){}function m(){}function y(){}var b={};b[a]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w(P([])));k&&k!==r&&n.call(k,a)&&(b=k);var _=y.prototype=g.prototype=Object.create(b);function M(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var r;this._invoke=function(i,a){function o(){return new t(function(r,o){!function r(i,a,o,s){var c=l(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):t.resolve(d).then(function(e){u.value=e,o(u)},function(e){return r("throw",e,o,s)})}s(c.arg)}(i,a,r,o)})}return r=r?r.then(o,o):o()}}function T(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function P(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:x}}function x(){return{value:t,done:!0}}return m.prototype=_.constructor=y,y.constructor=m,m.displayName=c(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},M(S.prototype),S.prototype[o]=function(){return this},e.AsyncIterator=S,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new S(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},M(_),c(_,s,"Generator"),_[a]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=P,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}});function h(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}var f=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){h(a,n,i,o,s,"next",e)}function s(e){h(a,n,i,o,s,"throw",e)}o(void 0)})}};var v=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};var g=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var y=function(e,t,r){return t&&m(e.prototype,t),r&&m(e,r),e},b=d(function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(r,n)}e.exports=t});var w=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)},k=d(function(e){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t});var _=function(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?g(e):t},M=d(function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(r)}e.exports=t});var S=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},T="function"==typeof Map,j="function"==typeof Set,C="function"==typeof WeakSet,O=Object.keys,P=function(e,t){return e&&"object"==typeof e&&t.add(e)},x=function(e,t,r,n){for(var i,a=0;a<e.length;a++)if(r((i=e[a])[0],t[0],n)&&r(i[1],t[1],n))return!0;return!1},A=function(e,t,r,n){for(var i=0;i<e.length;i++)if(r(e[i],t,n))return!0;return!1},F=function(e,t){return e===t||e!=e&&t!=t},E=function(e){return e.constructor===Object},L=function(e){return"function"==typeof e.then},I=function(e){return!(!e.$$typeof||!e._store)},B=function(e){return function(t){var r=e||t;return function(e,t,n){void 0===n&&(n=C?new WeakSet:Object.create({_values:[],add:function(e){this._values.push(e)},has:function(e){return!!~this._values.indexOf(e)}}));var i=n.has(e),a=n.has(t);return i||a?i&&a:(P(e,n),P(t,n),r(e,t,n))}}},N=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},R=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},D=function(e,t,r,n){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!r(e[i],t[i],n))return!1;return!0},V=function(e,t,r,n){if(e.size!==t.size)return!1;for(var i=N(e),a=N(t),o=0;o<i.length;o++)if(!x(a,i[o],r,n)||!x(i,a[o],r,n))return!1;return!0},U=function(e,t,r,n){var i,a=O(e),o=O(t);if(a.length!==o.length)return!1;for(var s=0;s<a.length;s++){if(i=a[s],!A(o,i,F))return!1;if(("_owner"!==i||!I(e)||!I(t))&&!r(e[i],t[i],n))return!1}return!0},z=function(e,t){return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.sticky===t.sticky&&e.lastIndex===t.lastIndex},q=function(e,t,r,n){if(e.size!==t.size)return!1;for(var i=R(e),a=R(t),o=0;o<i.length;o++)if(!A(a,i[o],r,n)||!A(i,a[o],r,n))return!1;return!0},W=Array.isArray,J=function(e){var t="function"==typeof e?e(r):r;function r(e,r,n){if(F(e,r))return!0;var i=typeof e;if(i!==typeof r||"object"!==i||!e||!r)return!1;if(E(e)&&E(r))return U(e,r,t,n);var a=W(e),o=W(r);if(a||o)return a===o&&D(e,r,t,n);var s=e instanceof Date,c=r instanceof Date;if(s||c)return s===c&&F(e.getTime(),r.getTime());var u=e instanceof RegExp,l=r instanceof RegExp;if(u||l)return u===l&&z(e,r);if(L(e)||L(r))return e===r;if(T){var d=e instanceof Map,p=r instanceof Map;if(d||p)return d===p&&V(e,r,t,n)}if(j){var h=e instanceof Set,f=r instanceof Set;if(h||f)return h===f&&q(e,r,t,n)}return U(e,r,t,n)}return r},G=(J(B()),J(B(F)),J());J(function(){return F});const H={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},K={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Q={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},$={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Y={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Z{static getFirstMatch(e,t){const r=t.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,t){const r=t.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,t,r){if(e.test(t))return r}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,r=!1){const n=Z.getVersionPrecision(e),i=Z.getVersionPrecision(t);let a=Math.max(n,i),o=0;const s=Z.map([e,t],e=>{const t=a-Z.getVersionPrecision(e),r=e+new Array(t+1).join(".0");return Z.map(r.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(r&&(o=a-Math.min(n,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const r=[];let n;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r}static find(e,t){let r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){const n=e[r];if(t(n,r))return n}}static assign(e,...t){const r=e;let n,i;if(Object.assign)return Object.assign(e,...t);for(n=0,i=t.length;n<i;n+=1){const e=t[n];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{r[t]=e[t]})}}return e}static getBrowserAlias(e){return H[e]}static getBrowserTypeByAlias(e){return K[e]||""}}const X=/version\/(\d+(\.?_?\d+)+)/i,ee=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=Z.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=Z.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=Z.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=Z.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=Z.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=Z.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=Z.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=Z.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=Z.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=Z.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=Z.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=Z.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=Z.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=Z.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=Z.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=Z.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=Z.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=Z.getFirstMatch(X,e)||Z.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=Z.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=Z.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=Z.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=Z.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=Z.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=Z.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=Z.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=Z.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=Z.getFirstMatch(X,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Z.getFirstMatch(t,e),version:Z.getSecondMatch(t,e)}}}];var te=[{test:[/Roku\/DVP/],describe(e){const t=Z.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:$.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Z.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:$.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Z.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=Z.getWindowsVersionName(t);return{name:$.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe(e){const t=Z.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return{name:$.iOS,version:t}}},{test:[/macintosh/i],describe(e){const t=Z.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=Z.getMacOSVersionName(t),n={name:$.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Z.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:$.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=Z.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=Z.getAndroidVersionName(t),n={name:$.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Z.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:$.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Z.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Z.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Z.getFirstMatch(/\bbb(\d+)/i,e);return{name:$.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Z.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:$.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Z.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:$.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:$.Linux})},{test:[/CrOS/],describe:()=>({name:$.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Z.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:$.PlayStation4,version:t}}}],re=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=Z.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:Q.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Q.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Q.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:()=>({type:Q.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Q.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Q.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Q.tablet})},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=Z.getFirstMatch(/(ipod|iphone)/i,e);return{type:Q.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Q.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Q.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Q.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Q.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Q.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Q.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Q.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Q.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Q.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Q.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Q.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Q.tv})}],ne=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Y.Blink};const t=Z.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Y.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Y.Trident},r=Z.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Y.Presto},r=Z.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:Y.Gecko},r=Z.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Y.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Y.WebKit},r=Z.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class ie{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Z.find(ee,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Z.find(te,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Z.find(re,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Z.find(ne,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Z.assign({},this.parsedResult)}satisfies(e){const t={};let r=0;const n={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(n[a]=o,i+=1):"object"==typeof o&&(t[a]=o,r+=1)}),r>0){const e=Object.keys(t),r=Z.find(e,e=>this.isOS(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}const n=Z.find(e,e=>this.isPlatform(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(n),t=Z.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(n[t])}}isBrowser(e,t=!1){const r=this.getBrowserName().toLowerCase();let n=e.toLowerCase();const i=Z.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r}compareVersion(e){let t=[0],r=e,n=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(Z.compareVersions(i,r,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}var ae="new",oe="loading",se="joining-meeting",ce="joined-meeting",ue="left-meeting",le="error",de="blocked",pe="off",he="sendable",fe="loading",ve="interrupted",ge="playable",me="unknown",ye="full",be="lobby",we="none",ke="base",_e="*",Me="ejected",Se="nbf-room",Te="nbf-token",je="exp-room",Ce="exp-token",Oe="cam-in-use",Pe="mic-in-use",xe="cam-mic-in-use",Ae="iframe-ready-for-launch-config",Fe="iframe-launch-config",Ee="theme-updated",Le="loading",Ie="load-attempt-failed",Be="loaded",Ne="started-camera",Re="camera-error",De="joining-meeting",Ve="joined-meeting",Ue="left-meeting",ze="participant-joined",qe="participant-updated",We="participant-left",Je="access-state-updated",Ge="meeting-session-updated",He="waiting-participant-added",Ke="waiting-participant-updated",Qe="waiting-participant-removed",$e="track-started",Ye="track-stopped",Ze="transcription-started",Xe="transcription-stopped",et="transcription-error",tt="recording-started",rt="recording-stopped",nt="recording-stats",it="recording-error",at="recording-upload-completed",ot="recording-data",st="app-message",ct="input-event",ut="local-screen-share-started",lt="local-screen-share-stopped",dt="active-speaker-change",pt="active-speaker-mode-change",ht="network-quality-change",ft="network-connection",vt="fullscreen",gt="exited-fullscreen",mt="live-streaming-started",yt="live-streaming-stopped",bt="live-streaming-error",wt="lang-updated",kt="receive-settings-updated",_t="input-settings-updated",Mt="nonfatal-error",St="error",Tt="daily-custom-track",jt={NONE:"none",BGBLUR:"background-blur"};function Ct(){return!Ot()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function Ot(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function Pt(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function xt(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&function(e,t){if(!e||!t)return!1;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!1}(It(),function(){switch(It()){case"Chrome":return Bt();case"Safari":return Rt();case"Firefox":return Dt();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var r=Ct(),n=r.match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(e){}}return{major:e,minor:t}}()}}())}var At=["Chrome","Firefox"];function Ft(){return!Ot()&&(!function(){var e=Ct();if(e.match(/Mobi/)||e.match(/Android/))return!0;if(Ct().match(/DailyAnd\//))return!0}()&&At.includes(It()))}function Et(){return!!Ot()||Lt()}function Lt(){return Pt()&&!function(){var e,t=It();if(!Ct())return!0;switch(t){case"Chrome":return(e=Bt()).major&&e.major>0&&e.major<61;case"Firefox":return(e=Dt()).major<78;case"Safari":return(e=Rt()).major<12;default:return!0}}()}function It(){if("undefined"!=typeof window){var e=Ct();return Nt()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function Bt(){var e=0,t=0,r=0,n=0,i=!1;if("undefined"!=typeof window){var a=Ct(),o=a.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(o)try{e=parseInt(o[1]),t=parseInt(o[2]),r=parseInt(o[3]),n=parseInt(o[4]),i=a.indexOf("OPR/")>-1}catch(e){}}return{major:e,minor:t,build:r,patch:n,opera:i}}function Nt(){return!!Ct().match(/iPad|iPhone|iPod/i)&&Pt()}function Rt(){var e=0,t=0,r=0;if("undefined"!=typeof window){var n=Ct().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2]),r=parseInt(n[4])}catch(e){}else Nt()&&(e=14,t=0,r=3)}return{major:e,minor:t,point:r}}function Dt(){var e=0,t=0;if("undefined"!=typeof window){var r=Ct().match(/Firefox\/(\d+).(\d+)/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2])}catch(e){}}return{major:e,minor:t}}function Vt(){return Date.now()+Math.random().toString()}function Ut(){throw new Error("Method must be implemented in subclass")}function zt(e){var t=e?new URL(e).origin:null;return!t||t.match(/https:\/\/[^.]+\.daily\.co/)?Et()?"https://c.daily.co/static/call-machine-object-bundle.js":"https://c.daily.co/static/call-machine-object-nosfu-bundle.js":(t||(console.warn("No baseUrl provided for call object bundle. Defaulting to production CDN..."),t="https://c.daily.co"),Et()?"".concat(t,"/static/call-machine-object-bundle.js"):"".concat(t,"/static/call-machine-object-nosfu-bundle.js"))}var qt=function(){function e(){v(this,e)}return y(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){Ut()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){Ut()}},{key:"sendMessageToCallMachine",value:function(e,t,r,n){Ut()}},{key:"sendMessageToDailyJs",value:function(e,t,r){Ut()}},{key:"removeListener",value:function(e){Ut()}}]),e}();function Wt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Gt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=M(e);if(t){var i=M(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _(this,r)}}var Ht=function(e){w(r,qt);var t=Gt(r);function r(){var e;return v(this,r),(e=t.call(this))._wrappedListeners={},e._messageCallbacks={},e}return y(r,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){var n=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callFrameId||i.data.callFrameId===t)&&(!i.data.from||"module"!==i.data.from)){var a=Jt({},i.data);if(delete a.from,a.callbackStamp&&n._messageCallbacks[a.callbackStamp]){var o=a.callbackStamp;n._messageCallbacks[o].call(r,a),delete n._messageCallbacks[o]}delete a.what,delete a.callbackStamp,e.call(r,a)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){var n=function(n){if(!(!n.data||"iframe-call-message"!==n.data.what||!n.data.action||n.data.from&&"module"!==n.data.from||n.data.callFrameId&&t&&n.data.callFrameId!==t)){var i=n.data;e.call(r,i)}};this._wrappedListeners[e]=n,window.addEventListener("message",n)}},{key:"sendMessageToCallMachine",value:function(e,t,r,n){var i=Jt({},e);if(i.what="iframe-call-message",i.from="module",i.callFrameId=n,t){var a=Vt();this._messageCallbacks[a]=t,i.callbackStamp=a}(r?r.contentWindow:window).postMessage(i,"*")}},{key:"sendMessageToDailyJs",value:function(e,t,r){e.what="iframe-call-message",e.callFrameId=r,e.from="embedded",(t?window:window.parent).postMessage(e,"*")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,r){var n=Jt({},e);n.callFrameId=r,(t?t.contentWindow:window).postMessage(n,"*")}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var r=function(r){if(r.data&&"iframe-call-message"===r.data.what&&(!r.data.callFrameId||r.data.callFrameId===t)&&(!r.data.from||"module"!==r.data.from)){var n=r.data;e(n)}};return this._wrappedListeners[e]=r,window.addEventListener("message",r),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}}]),r}();function Kt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=M(e);if(t){var i=M(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _(this,r)}}global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new t,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new t;var Qt=function(e){w(r,qt);var t=Kt(r);function r(){var e;return v(this,r),(e=t.call(this))._wrappedListeners={},e._messageCallbacks={},e}return y(r,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){this._addListener(e,global.callMachineToDailyJsEmitter,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){this._addListener(e,global.dailyJsToCallMachineEmitter,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t){this._sendMessage(e,global.dailyJsToCallMachineEmitter,"sending message to call machine",t)}},{key:"sendMessageToDailyJs",value:function(e){this._sendMessage(e,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(global.callMachineToDailyJsEmitter.removeListener("message",t),global.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,r,n){var i=this,a=function(t){if(t.callbackStamp&&i._messageCallbacks[t.callbackStamp]){var n=t.callbackStamp;i._messageCallbacks[n].call(r,t),delete i._messageCallbacks[n]}e.call(r,t)};this._wrappedListeners[e]=a,t.addListener("message",a)}},{key:"_sendMessage",value:function(e,t,r,n){if(n){var i=Vt();this._messageCallbacks[i]=n,e.callbackStamp=i}t.emit("message",e)}}]),r}();var $t=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")};var Yt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}},Zt=d(function(e){function t(r,n,i){return Yt()?e.exports=t=Reflect.construct:e.exports=t=function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&b(i,r.prototype),i},t.apply(null,arguments)}e.exports=t}),Xt=d(function(e){function t(r){var n="function"==typeof Map?new Map:void 0;return e.exports=t=function(e){if(null===e||!$t(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return Zt(e,arguments,M(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),b(t,e)},t(r)}e.exports=t});function er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=M(e);if(t){var i=M(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _(this,r)}}var tr=function(){function e(){v(this,e),this._currentLoad=null}return y(e,[{key:"load",value:function(e,t,r,n){if(this.loaded)return window._dailyCallObjectSetup(t),void r(!0);!function(e){window._dailyConfig||(window._dailyConfig={}),window._dailyConfig.callFrameId=e}(t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new nr(e,t,function(){r(!1)},n),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel()}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),e}(),rr=3,nr=function(){function e(t,r,n,i){v(this,e),this._attemptsRemaining=rr,this._currentAttempt=null,this._meetingOrBaseUrl=t,this._callFrameId=r,this._successCallback=n,this._failureCallback=i}return y(e,[{key:"start",value:function(){var e=this;if(!this._currentAttempt){this._currentAttempt=new ar(this._meetingOrBaseUrl,this._callFrameId,this._successCallback,function t(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new ar(e._meetingOrBaseUrl,e._callFrameId,e._successCallback,t),e._currentAttempt.start())},3e3))}),this._currentAttempt.start()}}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),e}(),ir=function(e){w(r,e);var t=er(r);function r(){return v(this,r),t.apply(this,arguments)}return r}(Xt(Error)),ar=function(){function e(t,r,n,i){v(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._meetingOrBaseUrl=t,this._callFrameId=r,this._successCallback=n,this._failureCallback=i}return y(e,[{key:"start",value:function(){var e=f(p.mark(function e(){var t;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=zt(this._meetingOrBaseUrl),e.next=3,this._tryLoadFromIOSCache(t);case 3:!e.sent&&this._loadFromNetwork(t);case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:function(){var e=f(p.mark(function e(t){var r;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._iosCache){e.next=2;break}return e.abrupt("return",!1);case 2:return e.prev=2,e.next=5,this._iosCache.get(t);case 5:if(r=e.sent,!this.cancelled){e.next=8;break}return e.abrupt("return",!0);case 8:if(r){e.next=10;break}return e.abrupt("return",!1);case 10:if(r.code){e.next=13;break}return this._refetchHeaders=r.refetchHeaders,e.abrupt("return",!1);case 13:return Function('"use strict";'+r.code)(),this.succeeded=!0,this._successCallback(),e.abrupt("return",!0);case 19:return e.prev=19,e.t0=e.catch(2),e.abrupt("return",!1);case 22:case"end":return e.stop()}},e,this,[[2,19]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_loadFromNetwork",value:function(){var e=f(p.mark(function e(t){var r,n,i,a=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback("Timed out (>".concat(2e4," ms) when loading call object bundle ").concat(t))},2e4),e.prev=1,r=this._refetchHeaders?{headers:this._refetchHeaders}:{},e.next=5,fetch(t,r);case 5:if(n=e.sent,clearTimeout(this._networkTimeout),!this.cancelled&&!this._networkTimedOut){e.next=9;break}throw new ir;case 9:return e.next=11,this._getBundleCodeFromResponse(t,n);case 11:if(i=e.sent,!this.cancelled){e.next=14;break}throw new ir;case 14:Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(t,i,n.headers),this.succeeded=!0,this._successCallback(),e.next=26;break;case 20:if(e.prev=20,e.t0=e.catch(1),clearTimeout(this._networkTimeout),!(e.t0 instanceof ir||this.cancelled||this._networkTimedOut)){e.next=25;break}return e.abrupt("return");case 25:this._failureCallback("Failed to load call object bundle ".concat(t,": ").concat(e.t0));case 26:case"end":return e.stop()}},e,this,[[1,20]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_getBundleCodeFromResponse",value:function(){var e=f(p.mark(function e(t,r){var n;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.ok){e.next=4;break}return e.next=3,r.text();case 3:return e.abrupt("return",e.sent);case 4:if(!this._iosCache||304!==r.status){e.next=9;break}return e.next=7,this._iosCache.renew(t,r.headers);case 7:return n=e.sent,e.abrupt("return",n.code);case 9:throw new Error("Received ".concat(r.status," response"));case 10:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()}]),e}();var or=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a};var sr=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===r(a[c],c,a))break}return t}}();var cr=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},ur="object"==typeof l&&l&&l.Object===Object&&l,lr="object"==typeof self&&self&&self.Object===Object&&self,dr=ur||lr||Function("return this")(),pr=dr.Symbol,hr=Object.prototype,fr=hr.hasOwnProperty,vr=hr.toString,gr=pr?pr.toStringTag:void 0;var mr=function(e){var t=fr.call(e,gr),r=e[gr];try{e[gr]=void 0;var n=!0}catch(e){}var i=vr.call(e);return n&&(t?e[gr]=r:delete e[gr]),i},yr=Object.prototype.toString;var br=function(e){return yr.call(e)},wr="[object Null]",kr="[object Undefined]",_r=pr?pr.toStringTag:void 0;var Mr=function(e){return null==e?void 0===e?kr:wr:_r&&_r in Object(e)?mr(e):br(e)};var Sr=function(e){return null!=e&&"object"==typeof e},Tr="[object Arguments]";var jr=function(e){return Sr(e)&&Mr(e)==Tr},Cr=Object.prototype,Or=Cr.hasOwnProperty,Pr=Cr.propertyIsEnumerable,xr=jr(function(){return arguments}())?jr:function(e){return Sr(e)&&Or.call(e,"callee")&&!Pr.call(e,"callee")},Ar=Array.isArray;var Fr=function(){return!1},Er=d(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?dr.Buffer:void 0,a=(i?i.isBuffer:void 0)||Fr;e.exports=a}),Lr=9007199254740991,Ir=/^(?:0|[1-9]\d*)$/;var Br=function(e,t){var r=typeof e;return!!(t=null==t?Lr:t)&&("number"==r||"symbol"!=r&&Ir.test(e))&&e>-1&&e%1==0&&e<t},Nr=9007199254740991;var Rr=function(e){return"number"==typeof e&&e>-1&&e%1