UNPKG

128 kBJavaScriptView Raw
1import 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==0&&e<=Nr},Dr={};Dr["[object Float32Array]"]=Dr["[object Float64Array]"]=Dr["[object Int8Array]"]=Dr["[object Int16Array]"]=Dr["[object Int32Array]"]=Dr["[object Uint8Array]"]=Dr["[object Uint8ClampedArray]"]=Dr["[object Uint16Array]"]=Dr["[object Uint32Array]"]=!0,Dr["[object Arguments]"]=Dr["[object Array]"]=Dr["[object ArrayBuffer]"]=Dr["[object Boolean]"]=Dr["[object DataView]"]=Dr["[object Date]"]=Dr["[object Error]"]=Dr["[object Function]"]=Dr["[object Map]"]=Dr["[object Number]"]=Dr["[object Object]"]=Dr["[object RegExp]"]=Dr["[object Set]"]=Dr["[object String]"]=Dr["[object WeakMap]"]=!1;var Vr=function(e){return Sr(e)&&Rr(e.length)&&!!Dr[Mr(e)]};var Ur=function(e){return function(t){return e(t)}},zr=d(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&ur.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}),qr=zr&&zr.isTypedArray,Wr=qr?Ur(qr):Vr,Jr=Object.prototype.hasOwnProperty;var Gr=function(e,t){var r=Ar(e),n=!r&&xr(e),i=!r&&!n&&Er(e),a=!r&&!n&&!i&&Wr(e),o=r||n||i||a,s=o?cr(e.length,String):[],c=s.length;for(var u in e)!t&&!Jr.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Br(u,c))||s.push(u);return s},Hr=Object.prototype;var Kr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Hr)};var Qr=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),$r=Object.prototype.hasOwnProperty;var Yr=function(e){if(!Kr(e))return Qr(e);var t=[];for(var r in Object(e))$r.call(e,r)&&"constructor"!=r&&t.push(r);return t};var Zr=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Xr="[object AsyncFunction]",en="[object Function]",tn="[object GeneratorFunction]",rn="[object Proxy]";var nn=function(e){if(!Zr(e))return!1;var t=Mr(e);return t==en||t==tn||t==Xr||t==rn};var an=function(e){return null!=e&&Rr(e.length)&&!nn(e)};var on=function(e){return an(e)?Gr(e):Yr(e)};var sn=function(e,t){return function(r,n){if(null==r)return r;if(!an(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&!1!==n(o[a],a,o););return r}}(function(e,t){return e&&sr(e,t,on)});var cn=function(e,t){var r=[];return sn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r};var un=function(){this.__data__=[],this.size=0};var ln=function(e,t){return e===t||e!=e&&t!=t};var dn=function(e,t){for(var r=e.length;r--;)if(ln(e[r][0],t))return r;return-1},pn=Array.prototype.splice;var hn=function(e){var t=this.__data__,r=dn(t,e);return!(r<0||(r==t.length-1?t.pop():pn.call(t,r,1),--this.size,0))};var fn=function(e){var t=this.__data__,r=dn(t,e);return r<0?void 0:t[r][1]};var vn=function(e){return dn(this.__data__,e)>-1};var gn=function(e,t){var r=this.__data__,n=dn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function mn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mn.prototype.clear=un,mn.prototype.delete=hn,mn.prototype.get=fn,mn.prototype.has=vn,mn.prototype.set=gn;var yn=mn;var bn=function(){this.__data__=new yn,this.size=0};var wn=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var kn=function(e){return this.__data__.get(e)};var _n,Mn=function(e){return this.__data__.has(e)},Sn=dr["__core-js_shared__"],Tn=(_n=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||""))?"Symbol(src)_1."+_n:"";var jn=function(e){return!!Tn&&Tn in e},Cn=Function.prototype.toString;var On=function(e){if(null!=e){try{return Cn.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Pn=/^\[object .+?Constructor\]$/,xn=Function.prototype,An=Object.prototype,Fn=xn.toString,En=An.hasOwnProperty,Ln=RegExp("^"+Fn.call(En).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var In=function(e){return!(!Zr(e)||jn(e))&&(nn(e)?Ln:Pn).test(On(e))};var Bn=function(e,t){return null==e?void 0:e[t]};var Nn=function(e,t){var r=Bn(e,t);return In(r)?r:void 0},Rn=Nn(dr,"Map"),Dn=Nn(Object,"create");var Vn=function(){this.__data__=Dn?Dn(null):{},this.size=0};var Un=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},zn="__lodash_hash_undefined__",qn=Object.prototype.hasOwnProperty;var Wn=function(e){var t=this.__data__;if(Dn){var r=t[e];return r===zn?void 0:r}return qn.call(t,e)?t[e]:void 0},Jn=Object.prototype.hasOwnProperty;var Gn=function(e){var t=this.__data__;return Dn?void 0!==t[e]:Jn.call(t,e)},Hn="__lodash_hash_undefined__";var Kn=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Dn&&void 0===t?Hn:t,this};function Qn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=Vn,Qn.prototype.delete=Un,Qn.prototype.get=Wn,Qn.prototype.has=Gn,Qn.prototype.set=Kn;var $n=Qn;var Yn=function(){this.size=0,this.__data__={hash:new $n,map:new(Rn||yn),string:new $n}};var Zn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Xn=function(e,t){var r=e.__data__;return Zn(t)?r["string"==typeof t?"string":"hash"]:r.map};var ei=function(e){var t=Xn(this,e).delete(e);return this.size-=t?1:0,t};var ti=function(e){return Xn(this,e).get(e)};var ri=function(e){return Xn(this,e).has(e)};var ni=function(e,t){var r=Xn(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function ii(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ii.prototype.clear=Yn,ii.prototype.delete=ei,ii.prototype.get=ti,ii.prototype.has=ri,ii.prototype.set=ni;var ai=ii,oi=200;var si=function(e,t){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!Rn||n.length<oi-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ai(n)}return r.set(e,t),this.size=r.size,this};function ci(e){var t=this.__data__=new yn(e);this.size=t.size}ci.prototype.clear=bn,ci.prototype.delete=wn,ci.prototype.get=kn,ci.prototype.has=Mn,ci.prototype.set=si;var ui=ci,li="__lodash_hash_undefined__";var di=function(e){return this.__data__.set(e,li),this};var pi=function(e){return this.__data__.has(e)};function hi(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ai;++t<r;)this.add(e[t])}hi.prototype.add=hi.prototype.push=di,hi.prototype.has=pi;var fi=hi;var vi=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var gi=function(e,t){return e.has(t)},mi=1,yi=2;var bi=function(e,t,r,n,i,a){var o=r&mi,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var l=-1,d=!0,p=r&yi?new fi:void 0;for(a.set(e,t),a.set(t,e);++l<s;){var h=e[l],f=t[l];if(n)var v=o?n(f,h,l,t,e,a):n(h,f,l,e,t,a);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!vi(t,function(e,t){if(!gi(p,t)&&(h===e||i(h,e,r,n,a)))return p.push(t)})){d=!1;break}}else if(h!==f&&!i(h,f,r,n,a)){d=!1;break}}return a.delete(e),a.delete(t),d},wi=dr.Uint8Array;var ki=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var _i=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Mi=1,Si=2,Ti="[object Boolean]",ji="[object Date]",Ci="[object Error]",Oi="[object Map]",Pi="[object Number]",xi="[object RegExp]",Ai="[object Set]",Fi="[object String]",Ei="[object Symbol]",Li="[object ArrayBuffer]",Ii="[object DataView]",Bi=pr?pr.prototype:void 0,Ni=Bi?Bi.valueOf:void 0;var Ri=function(e,t,r,n,i,a,o){switch(r){case Ii:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Li:return!(e.byteLength!=t.byteLength||!a(new wi(e),new wi(t)));case Ti:case ji:case Pi:return ln(+e,+t);case Ci:return e.name==t.name&&e.message==t.message;case xi:case Fi:return e==t+"";case Oi:var s=ki;case Ai:var c=n&Mi;if(s||(s=_i),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=Si,o.set(e,t);var l=bi(s(e),s(t),n,i,a,o);return o.delete(e),l;case Ei:if(Ni)return Ni.call(e)==Ni.call(t)}return!1};var Di=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e};var Vi=function(e,t,r){var n=t(e);return Ar(e)?n:Di(n,r(e))};var Ui=function(){return[]},zi=Object.prototype.propertyIsEnumerable,qi=Object.getOwnPropertySymbols,Wi=qi?function(e){return null==e?[]:(e=Object(e),or(qi(e),function(t){return zi.call(e,t)}))}:Ui;var Ji=function(e){return Vi(e,on,Wi)},Gi=1,Hi=Object.prototype.hasOwnProperty;var Ki=function(e,t,r,n,i,a){var o=r&Gi,s=Ji(e),c=s.length;if(c!=Ji(t).length&&!o)return!1;for(var u=c;u--;){var l=s[u];if(!(o?l in t:Hi.call(t,l)))return!1}var d=a.get(e);if(d&&a.get(t))return d==t;var p=!0;a.set(e,t),a.set(t,e);for(var h=o;++u<c;){var f=e[l=s[u]],v=t[l];if(n)var g=o?n(v,f,l,t,e,a):n(f,v,l,e,t,a);if(!(void 0===g?f===v||i(f,v,r,n,a):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=e.constructor,y=t.constructor;m!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p},Qi=Nn(dr,"DataView"),$i=Nn(dr,"Promise"),Yi=Nn(dr,"Set"),Zi=Nn(dr,"WeakMap"),Xi=On(Qi),ea=On(Rn),ta=On($i),ra=On(Yi),na=On(Zi),ia=Mr;(Qi&&"[object DataView]"!=ia(new Qi(new ArrayBuffer(1)))||Rn&&"[object Map]"!=ia(new Rn)||$i&&"[object Promise]"!=ia($i.resolve())||Yi&&"[object Set]"!=ia(new Yi)||Zi&&"[object WeakMap]"!=ia(new Zi))&&(ia=function(e){var t=Mr(e),r="[object Object]"==t?e.constructor:void 0,n=r?On(r):"";if(n)switch(n){case Xi:return"[object DataView]";case ea:return"[object Map]";case ta:return"[object Promise]";case ra:return"[object Set]";case na:return"[object WeakMap]"}return t});var aa=ia,oa=1,sa="[object Arguments]",ca="[object Array]",ua="[object Object]",la=Object.prototype.hasOwnProperty;var da=function(e,t,r,n,i,a){var o=Ar(e),s=Ar(t),c=o?ca:aa(e),u=s?ca:aa(t),l=(c=c==sa?ua:c)==ua,d=(u=u==sa?ua:u)==ua,p=c==u;if(p&&Er(e)){if(!Er(t))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||Wr(e)?bi(e,t,r,n,i,a):Ri(e,t,c,r,n,i,a);if(!(r&oa)){var h=l&&la.call(e,"__wrapped__"),f=d&&la.call(t,"__wrapped__");if(h||f){var v=h?e.value():e,g=f?t.value():t;return a||(a=new ui),i(v,g,r,n,a)}}return!!p&&(a||(a=new ui),Ki(e,t,r,n,i,a))};var pa=function e(t,r,n,i,a){return t===r||(null==t||null==r||!Sr(t)&&!Sr(r)?t!=t&&r!=r:da(t,r,n,i,e,a))},ha=1,fa=2;var va=function(e,t,r,n){var i=r.length,a=i,o=!n;if(null==e)return!a;for(e=Object(e);i--;){var s=r[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=r[i])[0],u=e[c],l=s[1];if(o&&s[2]){if(void 0===u&&!(c in e))return!1}else{var d=new ui;if(n)var p=n(u,l,c,e,t,d);if(!(void 0===p?pa(l,u,ha|fa,n,d):p))return!1}}return!0};var ga=function(e){return e==e&&!Zr(e)};var ma=function(e){for(var t=on(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,ga(i)]}return t};var ya=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var ba=function(e){var t=ma(e);return 1==t.length&&t[0][2]?ya(t[0][0],t[0][1]):function(r){return r===e||va(r,e,t)}},wa="[object Symbol]";var ka=function(e){return"symbol"==typeof e||Sr(e)&&Mr(e)==wa},_a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ma=/^\w*$/;var Sa=function(e,t){if(Ar(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ka(e))||Ma.test(e)||!_a.test(e)||null!=t&&e in Object(t)},Ta="Expected a function";function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Ta);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(ja.Cache||ai),r}ja.Cache=ai;var Ca=ja,Oa=500;var Pa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xa=/\\(\\)?/g,Aa=function(e){var t=Ca(e,function(e){return r.size===Oa&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Pa,function(e,r,n,i){t.push(n?i.replace(xa,"$1"):r||e)}),t});var Fa=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},Ea=1/0,La=pr?pr.prototype:void 0,Ia=La?La.toString:void 0;var Ba=function e(t){if("string"==typeof t)return t;if(Ar(t))return Fa(t,e)+"";if(ka(t))return Ia?Ia.call(t):"";var r=t+"";return"0"==r&&1/t==-Ea?"-0":r};var Na=function(e){return null==e?"":Ba(e)};var Ra=function(e,t){return Ar(e)?e:Sa(e,t)?[e]:Aa(Na(e))},Da=1/0;var Va=function(e){if("string"==typeof e||ka(e))return e;var t=e+"";return"0"==t&&1/e==-Da?"-0":t};var Ua=function(e,t){for(var r=0,n=(t=Ra(t,e)).length;null!=e&&r<n;)e=e[Va(t[r++])];return r&&r==n?e:void 0};var za=function(e,t,r){var n=null==e?void 0:Ua(e,t);return void 0===n?r:n};var qa=function(e,t){return null!=e&&t in Object(e)};var Wa=function(e,t,r){for(var n=-1,i=(t=Ra(t,e)).length,a=!1;++n<i;){var o=Va(t[n]);if(!(a=null!=e&&r(e,o)))break;e=e[o]}return a||++n!=i?a:!!(i=null==e?0:e.length)&&Rr(i)&&Br(o,i)&&(Ar(e)||xr(e))};var Ja=function(e,t){return null!=e&&Wa(e,t,qa)},Ga=1,Ha=2;var Ka=function(e,t){return Sa(e)&&ga(t)?ya(Va(e),t):function(r){var n=za(r,e);return void 0===n&&n===t?Ja(r,e):pa(t,n,Ga|Ha)}};var Qa=function(e){return e};var $a=function(e){return function(t){return null==t?void 0:t[e]}};var Ya=function(e){return function(t){return Ua(t,e)}};var Za=function(e){return Sa(e)?$a(Va(e)):Ya(e)};var Xa=function(e){return"function"==typeof e?e:null==e?Qa:"object"==typeof e?Ar(e)?Ka(e[0],e[1]):ba(e):Za(e)};var eo=function(e,t){return(Ar(e)?or:cn)(e,Xa(t))};var to=function(e,t){var r=-1,n=an(e)?Array(e.length):[];return sn(e,function(e,i,a){n[++r]=t(e,i,a)}),n};var ro=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e};var no=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,a=ka(e),o=void 0!==t,s=null===t,c=t==t,u=ka(t);if(!s&&!u&&!a&&e>t||a&&o&&c&&!s&&!u||n&&o&&c||!r&&c||!i)return 1;if(!n&&!a&&!u&&e<t||u&&r&&i&&!n&&!a||s&&r&&i||!o&&i||!c)return-1}return 0};var io=function(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,s=r.length;++n<o;){var c=no(i[n],a[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index};var ao=function(e,t,r){var n=-1;t=Fa(t.length?t:[Qa],Ur(Xa));var i=to(e,function(e,r,i){return{criteria:Fa(t,function(t){return t(e)}),index:++n,value:e}});return ro(i,function(e,t){return io(e,t,r)})};var oo=function(e,t,r,n){return null==e?[]:(Ar(t)||(t=null==t?[]:[t]),Ar(r=n?void 0:r)||(r=null==r?[]:[r]),ao(e,t,r))},so=function(e,t,r){return!0===lo(e.local,t,r)},co=function(e,t,r){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===r?"Video":"Audio","Tracks")]()[0]},uo=function(e,t,r,n){var i=po(e,t,r,n);return i&&i.pendingTrack},lo=function(e,t,r){if(!e)return!1;var n=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?n(i[t][r]):!i||n(i.ALL)},po=function(e,t,r,n){var i=oo(eo(e.streams,function(e){return e.participantId===t&&e.type===r&&e.pendingTrack&&e.pendingTrack.kind===n}),"starttime","desc");return i&&i[0]},ho=function(e,t){var r=e.local.public.customTracks;if(r&&r[t])return r[t].track},fo=function(e,t,r,n){var i="soup-"+r,a=oo(eo(e.streams,function(e){return e.participantId===t&&e.streamId===i&&e.pendingTrack&&e.pendingTrack.kind===n}),"starttime","desc");return a&&a[0]&&a[0].pendingTrack};function vo(e){for(var t=store.getState(),r=0,n=["cam","screen"];r<n.length;r++)for(var i=n[r],a=0,o=["video","audio"];a<o.length;a++){var s=o[a],c="cam"===i?s:"screen".concat(s.charAt(0).toUpperCase()+s.slice(1)),u=e.tracks[c];if(u){var l=e.local?co(t,i,s):uo(t,e.session_id,i,s);"playable"===u.state&&(u.track=l),u.persistentTrack=l}}}function go(e){try{var t=store.getState();for(var r in e.tracks)if(!mo(r)){var n=e.tracks[r].kind;if(n){var i=e.local?ho(t,r,n):fo(t,e.session_id,r,n),a=e.tracks[r];i&&a&&"playable"===a.state&&(e.tracks[r].track=i)}else console.error("unknown type for custom track")}}catch(e){console.error(e)}}function mo(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function yo(e,t){var r=store.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(e){}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(e){}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){}}else{var n=!0;try{var i=r.participants[e.session_id];i&&i.public&&i.public.rtcType&&"peer-to-peer"===i.public.rtcType.impl&&i.private&&!["connected","completed"].includes(i.private.peeringState)&&(n=!1)}catch(e){console.error(e)}if(!n)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{r.streams;if(e.audio&&so(r,e.session_id,"cam-audio")){var a=uo(r,e.session_id,"cam","audio");a&&(t&&t.audioTrack&&t.audioTrack.id===a.id?e.audioTrack=a:a.muted||(e.audioTrack=a)),e.audioTrack||(e.audio=!1)}if(e.video&&so(r,e.session_id,"cam-video")){var o=uo(r,e.session_id,"cam","video");o&&(t&&t.videoTrack&&t.videoTrack.id===o.id?e.videoTrack=o:o.muted||(e.videoTrack=o)),e.videoTrack||(e.video=!1)}if(e.screen&&so(r,e.session_id,"screen-audio")){var s=uo(r,e.session_id,"screen","audio");s&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===s.id?e.screenAudioTrack=s:s.muted||(e.screenAudioTrack=s))}if(e.screen&&so(r,e.session_id,"screen-video")){var c=uo(r,e.session_id,"screen","video");c&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===c.id?e.screenVideoTrack=c:c.muted||(e.screenVideoTrack=c))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){console.error("unexpected error matching up tracks",e)}}}function bo(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 wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ko(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 _o="video",Mo="voice",So={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},To={url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e){return window._dailyConfig||(window._dailyConfig={}),window._dailyConfig.experimentalGetUserMediaConstraintsModify=e.experimentalGetUserMediaConstraintsModify,delete e.experimentalGetUserMediaConstraintsModify,!0}},reactNativeConfig:{validate:function(e){return function e(t,r){if(void 0===r)return!1;switch(k(r)){case"string":return k(t)===r;case"object":if("object"!==k(t))return!1;for(var n in t)if(!e(t[n],r[n]))return!1;return!0;default:return!1}}(e,So)},help:"reactNativeConfig should look like ".concat(JSON.stringify(So),", all fields optional")},lang:{validate:function(e){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, ru, sv, tr, user"},userName:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){return t._preloadCache.videoDeviceId=e,!0}},audioSource:{validate:function(e,t){return t._preloadCache.audioDeviceId=e,!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],r=function(e){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===k(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?r(e.light.colors)&&r(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):r(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(e){return xo(e,{allowAllParticipantsKey:!1})},help:Eo({allowAllParticipantsKey:!1})},inputSettings:{validate:function(e){return Ao(e)},help:Fo()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"}},jo={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var t in e.cam)if("div"!==t&&"video"!==t)return!1;if(e.screen)for(var t in e.screen)if("div"!==t&&"video"!==t)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t,r){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!Ot()&&"avatar"===e)return!0;for(var i in e)if(!["audio","video","screenAudio","screenVideo"].includes(i)||!n.includes(e[i]))return!1;return!0},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(Ot()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,eject:!0};function Co(e){var t={};for(var r in e)e[r]instanceof MediaStreamTrack?t[r]=Tt:"dailyConfig"===r?(e[r].modifyLocalSdpHook&&(window._dailyConfig&&(window._dailyConfig.modifyLocalSdpHook=e[r].modifyLocalSdpHook),delete e[r].modifyLocalSdpHook),e[r].modifyRemoteSdpHook&&(window._dailyConfig&&(window._dailyConfig.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook),delete e[r].modifyRemoteSdpHook),t[r]=e[r]):t[r]=e[r];return t}function Oo(){if(Ot())throw new Error("This daily-js method is not currently supported in React Native")}function Po(){if(!Ot())throw new Error("This daily-js method is only supported in React Native")}function xo(e,t){for(var r=t.allowAllParticipantsKey,n=function(e){var t=["local"];return r||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},a=function(e){return!!e&&(!(e.video&&!i(e.video))&&!(e.screenVideo&&!i(e.screenVideo)))},o=0,c=Object.entries(e);o<c.length;o++){var u=s(c[o],2),l=u[0],d=u[1];if(!n(l)||!a(d))return!1}return!0}function Ao(e){return"object"===k(e)&&(!(!e.video||"object"!==k(e.video))&&!!function(e){if(!e)return!1;if("object"!==k(e))return!1;if(0===Object.keys(e).length)return!1;if(e.type&&(t=e.type,"string"!=typeof t||!Object.values(jt).includes(t)))return!1;var t;if(void 0!==e.publish&&"boolean"!=typeof e.publish)return!1;if(e.config){if("object"!==k(e.config))return!1;if(!function(e,t){var r=Object.keys(t);if(0===r.length)return!0;var n="invalid object in inputSettings -> video -> processor -> config";switch(e){case jt.BGBLUR:if(r.length>1||"strength"!==r[0])throw new Error(n);if("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))throw new Error("".concat(n,"; expected: {0 < strength <= 1}, got: ").concat(t.strength));default:return!0}}(e.type,e.config))return!1}return!0}(e.video.processor))}function Fo(){var e=Object.values(jt).join(" | ");return"inputSettings must be of the form: { video: { processor: [ ".concat(e," ] }, publish?: boolean, config?: {} }")}function Eo(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(ke).concat(t?' | "'.concat(_e,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}export default(function(t){w(n,e);var r=ko(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(v(this,n),t=r.call(this),S(g(t),"handleNativeAppActiveStateChange",function(e){t.disableReactNativeAutoDeviceManagement("video")||(e?t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!0):(t.camUnmutedBeforeLosingNativeActiveState=t.localVideo(),t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!1)))}),S(g(t),"handleNativeAudioFocusChange",function(e){t.disableReactNativeAutoDeviceManagement("audio")||(t._hasNativeAudioFocus=e,t.toggleParticipantAudioBasedOnNativeAudioFocus(),t._hasNativeAudioFocus?t.micUnmutedBeforeLosingNativeAudioFocus&&t.setLocalAudio(!0):(t.micUnmutedBeforeLosingNativeAudioFocus=t.localAudio(),t.setLocalAudio(!1)))}),i.dailyJsVersion="0.21.0",t._iframe=e,t._callObjectMode="none"===i.layout&&!t._iframe,t._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null},t._callObjectMode&&(window._dailyPreloadCache=t._preloadCache),void 0!==i.showLocalVideo?t._callObjectMode?console.error("showLocalVideo is not available in call object mode"):t._showLocalVideo=!!i.showLocalVideo:t._showLocalVideo=!0,void 0!==i.showParticipantsBar?t._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):t._showParticipantsBar=!!i.showParticipantsBar:t._showParticipantsBar=!0,void 0!==i.activeSpeakerMode?t._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):t._activeSpeakerMode=!!i.activeSpeakerMode:t._activeSpeakerMode=!1,i.receiveSettings?t._callObjectMode?t._receiveSettings=i.receiveSettings:console.error("receiveSettings is only available in call object mode"):t._receiveSettings={},t._inputSettings={},i.inputSettings&&(t._inputSettings=i.inputSettings),t.validateProperties(i),t.properties=wo({},i),t._callObjectLoader=t._callObjectMode?new tr:null,t._meetingState=ae,t._isPreparingToJoin=!1,t._accessState={access:me},t._nativeInCallAudioMode=_o,t._participants={},t._waitingParticipants={},t._inputEventsOn={},t._network={threshold:"good",quality:100},t._activeSpeaker={},t._callFrameId=Vt(),t._messageChannel=Ot()?new Qt:new Ht,t._iframe&&(t._iframe.requestFullscreen?t._iframe.addEventListener("fullscreenchange",function(e){document.fullscreenElement===t._iframe?(t.emit(vt,{action:vt}),t.sendMessageToCallMachine({action:vt})):(t.emit(gt,{action:gt}),t.sendMessageToCallMachine({action:gt}))}):t._iframe.webkitRequestFullscreen&&t._iframe.addEventListener("webkitfullscreenchange",function(e){document.webkitFullscreenElement===t._iframe?(t.emit(vt,{action:vt}),t.sendMessageToCallMachine({action:vt})):(t.emit(gt,{action:gt}),t.sendMessageToCallMachine({action:gt}))})),Ot()){var a=t.nativeUtils();a.addAudioFocusChangeListener&&a.removeAudioFocusChangeListener&&a.addAppActiveStateChangeListener&&a.removeAppActiveStateChangeListener||console.warn("expected (add|remove)(AudioFocus|AppActiveState)ChangeListener to be available in React Native"),t._hasNativeAudioFocus=!0,a.addAudioFocusChangeListener(t.handleNativeAudioFocusChange),a.addAppActiveStateChangeListener(t.handleNativeAppActiveStateChange)}return t._messageChannel.addListenerForMessagesFromCallMachine(t.handleMessageFromCallMachine,t._callFrameId,g(t)),t}return y(n,null,[{key:"supportedBrowser",value:function(){if(Ot())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!1,supportsSfu:!0,supportsVideoProcessing:!1};var e=class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new ie(e,t)}static parse(e){return new ie(e).getResult()}static get BROWSER_MAP(){return K}static get ENGINE_MAP(){return Y}static get OS_MAP(){return $}static get PLATFORMS_MAP(){return Q}}.getParser(Ct());return{supported:!!Lt(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsScreenShare:!!xt(),supportsSfu:!!Et(),supportsVideoProcessing:Ft()}}},{key:"version",value:function(){return"0.21.0"}},{key:"createCallObject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.layout="none",new n(null,e)}},{key:"wrap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Oo(),!e||!e.contentWindow||"string"!=typeof e.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return t.layout||(t.customLayout?t.layout="custom-v1":t.layout="browser"),new n(e,t)}},{key:"createFrame",value:function(e,t){var r,i;Oo(),e&&t?(r=e,i=t):e&&e.append?(r=e,i={}):(r=document.body,i=e||{});var a=i.iframeStyle;a||(a=r===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture",o.style.visibility="hidden",r.appendChild(o),o.style.visibility=null,Object.keys(a).forEach(function(e){return o.style[e]=a[e]}),i.layout||(i.customLayout?i.layout="custom-v1":i.layout="browser");try{return new n(o,i)}catch(e){throw r.removeChild(o),e}}},{key:"createTransparentFrame",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Oo();var t=document.createElement("iframe");return t.allow="microphone; camera; autoplay",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(t),e.layout||(e.layout="custom-v1"),n.wrap(t,e)}}]),y(n,[{key:"destroy",value:function(){var e=f(p.mark(function e(){var t,r,n;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,![ce,oe].includes(this._meetingState)){e.next=4;break}return e.next=4,this.leave();case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(0);case 8:(t=this._iframe)&&(r=t.parentElement)&&r.removeChild(t),this._messageChannel.removeListener(this.handleMessageFromCallMachine),Ot()&&((n=this.nativeUtils()).removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),n.removeAppActiveStateChangeListener(this.handleNativeAppActiveStateChange)),this.resetMeetingDependentVars();case 13:case"end":return e.stop()}},e,this,[[0,6]])}));return function(){return e.apply(this,arguments)}}()},{key:"loadCss",value:function(e){var t=e.bodyClass,r=e.cssFile,n=e.cssText;return Oo(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(r),bodyClass:t,cssText:n}),this}},{key:"iframe",value:function(){return Oo(),this._iframe}},{key:"meetingState",value:function(){return this._meetingState}},{key:"accessState",value:function(){if(!this._callObjectMode)throw new Error("accessState() currently only supported in call object mode");return this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"waitingParticipants",value:function(){if(!this._callObjectMode)throw new Error("waitingParticipants() currently only supported in call object mode");return this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var r in t){if(!jo[r])throw new Error("unrecognized updateParticipant property ".concat(r));if(jo[r].validate&&!jo[r].validate(t[r],this,this._participants[e]))throw new Error(jo[r].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&this._participants[e]&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var r in e)r===t&&(r="local"),r&&e[r]&&(this._participants[r]||"*"===r)?this.validateParticipantProperties(r,e[r]):(console.warn("unrecognized participant in updateParticipants: ".concat(r)),delete e[r]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:function(){var e=f(p.mark(function e(){var t,r,n=this,i=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:"",r=i.length>1&&void 0!==i[1]?i[1]:{},this._callObjectMode){e.next=4;break}throw new Error("updateWaitingParticipant() currently only supported in call object mode");case 4:if(this._meetingState===ce){e.next=6;break}throw new Error("updateWaitingParticipant() only supported for joined meetings");case 6:if("string"==typeof t&&"object"===k(r)){e.next=8;break}throw new Error("updateWaitingParticipant() must take an id string and a updates object");case 8:return e.abrupt("return",new Promise(function(e,i){n.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:r},function(t){t.error&&i(t.error),t.id||i(new Error("unknown error in updateWaitingParticipant()")),e({id:t.id})})}));case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"updateWaitingParticipants",value:function(){var e=f(p.mark(function e(){var t,r=this,n=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:{},this._callObjectMode){e.next=3;break}throw new Error("updateWaitingParticipants() currently only supported in call object mode");case 3:if(this._meetingState===ce){e.next=5;break}throw new Error("updateWaitingParticipants() only supported for joined meetings");case 5:if("object"===k(t)){e.next=7;break}throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");case 7:return e.abrupt("return",new Promise(function(e,n){r.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},function(t){t.error&&n(t.error),t.ids||n(new Error("unknown error in updateWaitingParticipants()")),e({ids:t.ids})})}));case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"requestAccess",value:function(){var e=f(p.mark(function e(){var t,r,n,i,a,o=this,s=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.access,n=void 0===r?{level:"full"}:r,i=t.name,a=void 0===i?"":i,this._callObjectMode){e.next=3;break}throw new Error("requestAccess() currently only supported in call object mode");case 3:if(this._meetingState===ce){e.next=5;break}throw new Error("requestAccess() only supported for joined meetings");case 5:return e.abrupt("return",new Promise(function(e,t){o.sendMessageToCallMachine({action:"daily-method-request-access",access:n,name:a},function(r){r.error&&t(r.error),r.access||t(new Error("unknown error in requestAccess()")),e({access:r.access,granted:r.granted})})}));case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"localAudio",value:function(){return this._participants.local?this._participants.local.audio:null}},{key:"localVideo",value:function(){return this._participants.local?this._participants.local.video:null}},{key:"setLocalAudio",value:function(e){return this.sendMessageToCallMachine({action:"local-audio",state:e}),this}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"getReceiveSettings",value:function(){var e=f(p.mark(function e(t){var r,n,i,a=this,o=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:{},n=r.showInheritedValues,i=void 0!==n&&n,this._callObjectMode){e.next=3;break}throw new Error("getReceiveSettings() only supported in call object mode");case 3:e.t0=k(t),e.next="string"===e.t0?6:"undefined"===e.t0?7:8;break;case 6:return e.abrupt("return",new Promise(function(e){a.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:t,showInheritedValues:i},function(t){e(t.receiveSettings)})}));case 7:return e.abrupt("return",this._receiveSettings);case 8:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments');case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateReceiveSettings",value:function(){var e=f(p.mark(function e(t){var r=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._callObjectMode){e.next=2;break}throw new Error("updateReceiveSettings() only supported in call object mode");case 2:if(xo(t,{allowAllParticipantsKey:!0})){e.next=4;break}throw new Error(Eo({allowAllParticipantsKey:!0}));case 4:if(this._meetingState===ce){e.next=6;break}throw new Error("updateReceiveSettings() is only allowed when joined. To specify receive settings earlier, use the receiveSettings config property.");case 6:return e.abrupt("return",new Promise(function(e){r.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:t},function(t){e({receiveSettings:t.receiveSettings})})}));case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getInputSettings",value:function(){return this._inputSettings}},{key:"updateInputSettings",value:function(){var e=f(p.mark(function e(t){var r=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ao(t)){e.next=2;break}throw new Error(Fo());case 2:return e.abrupt("return",new Promise(function(e){r.sendMessageToCallMachine({action:"update-input-settings",inputSettings:t},function(t){e({inputSettings:t.inputSettings})})}));case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"setBandwidth",value:function(e){var t=e.kbs,r=e.trackConstraints;return Oo(),this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:r}),this}},{key:"getDailyLang",value:function(){var e=this;return Oo(),new Promise(function(){var t=f(p.mark(function t(r){var n;return p.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=function(e){delete e.action,delete e.callbackStamp,r(e)},e.sendMessageToCallMachine({action:"get-daily-lang"},n);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"setDailyLang",value:function(e){return Oo(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"getMeetingSession",value:function(){var e=f(p.mark(function e(){var t=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._meetingState===ce){e.next=2;break}throw new Error("getMeetingSession() is only allowed when joined");case 2:return e.abrupt("return",new Promise(function(){var e=f(p.mark(function e(r){var n;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){delete e.action,delete e.callbackStamp,delete e.callFrameId,r(e)},t.sendMessageToCallMachine({action:"get-meeting-session"},n);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"setUserName",value:function(e,t){var r=this;return this.properties.userName=e,new Promise(function(){var n=f(p.mark(function n(i){var a;return p.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:a=function(e){delete e.action,delete e.callbackStamp,i(e)},r.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:Ot()||!!t&&!!t.thisMeetingOnly},a);case 2:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}())}},{key:"startCamera",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var r=f(p.mark(function r(n,i){var a;return p.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(e){delete e.action,delete e.callbackStamp,n(e)},!e.needsLoad()){r.next=10;break}return r.prev=2,r.next=5,e.load(t);case 5:r.next=10;break;case 7:r.prev=7,r.t0=r.catch(2),i(r.t0);case 10:e.sendMessageToCallMachine({action:"start-camera",properties:Co(e.properties),preloadCache:Co(e._preloadCache)},a);case 11:case"end":return r.stop()}},r,null,[[2,7]])}));return function(e,t){return r.apply(this,arguments)}}())}},{key:"cycleCamera",value:function(){var e=this;return new Promise(function(t,r){e.sendMessageToCallMachine({action:"cycle-camera"},function(e){t({device:e.device})})})}},{key:"cycleMic",value:function(){var e=this;return Oo(),new Promise(function(t,r){e.sendMessageToCallMachine({action:"cycle-mic"},function(e){t({device:e.device})})})}},{key:"getCameraFacingMode",value:function(){var e=this;return Po(),new Promise(function(t,r){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(e){t(e.facingMode)})})}},{key:"setInputDevices",value:function(e){var t=e.audioDeviceId,r=e.videoDeviceId,n=e.audioSource,i=e.videoSource;return console.warn("setInputDevices() is deprecated: instead use setInputDevicesAsync(), which returns a Promise"),this.setInputDevicesAsync({audioDeviceId:t,videoDeviceId:r,audioSource:n,videoSource:i}),this}},{key:"setInputDevicesAsync",value:function(){var e=f(p.mark(function e(t){var r,n,i,a,o=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.audioDeviceId,n=t.videoDeviceId,i=t.audioSource,a=t.videoSource,Oo(),void 0!==i&&(r=i),void 0!==a&&(n=a),r&&(this._preloadCache.audioDeviceId=r),n&&(this._preloadCache.videoDeviceId=n),!this._callObjectMode||!this.needsLoad()){e.next=8;break}return e.abrupt("return",{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}});case 8:return r instanceof MediaStreamTrack&&(r=Tt),n instanceof MediaStreamTrack&&(n=Tt),e.abrupt("return",new Promise(function(e){o.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:r,videoDeviceId:n},function(t){delete t.action,delete t.callbackStamp,t.returnPreloadCache?e({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):e(t)})}));case 11:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setOutputDevice",value:function(e){var t=e.outputDeviceId;return Oo(),t&&(this._preloadCache.outputDeviceId=t),this._callObjectMode&&this._meetingState!==ce?this:(this.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:t}),this)}},{key:"getInputDevices",value:function(){var e=f(p.mark(function e(){var t=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Oo(),!this._callObjectMode||!this.needsLoad()){e.next=3;break}return e.abrupt("return",{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}});case 3:return e.abrupt("return",new Promise(function(e,r){t.sendMessageToCallMachine({action:"get-input-devices"},function(r){delete r.action,delete r.callbackStamp,r.returnPreloadCache?e({camera:{deviceId:t._preloadCache.videoDeviceId},mic:{deviceId:t._preloadCache.audioDeviceId},speaker:{deviceId:t._preloadCache.outputDeviceId}}):e(r)})}));case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"nativeInCallAudioMode",value:function(){return Po(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(Po(),[_o,Mo].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&this.isMeetingPendingOrOngoing(this._meetingState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:function(){var e=f(p.mark(function e(){var t,r,n,i=this,a=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},this._callObjectMode){e.next=3;break}throw new Error("preAuth() currently only supported in call object mode");case 3:if(![se,ce].includes(this._meetingState)){e.next=5;break}throw new Error("preAuth() not supported after joining a meeting");case 5:if(!this.needsLoad()){e.next=8;break}return e.next=8,this.load(t);case 8:if(t.url){e.next=10;break}throw new Error("preAuth() requires at least a url to be provided");case 10:if(r=zt(t.url),n=zt(this.properties.url||this.properties.baseUrl),r===n){e.next=14;break}throw new Error("url in preAuth() has a different bundle url than the one loaded (".concat(n," -> ").concat(r,")"));case 14:return this.validateProperties(t),this.properties=wo(wo({},this.properties),t),e.abrupt("return",new Promise(function(e,t){i.sendMessageToCallMachine({action:"daily-method-preauth",properties:Co(i.properties)},function(r){return r.error?t(r.error):r.access?(i._didPreAuth=!0,void e({access:r.access})):t(new Error("unknown error in preAuth()"))})}));case 17:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=f(p.mark(function e(t){var r=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.needsLoad()){e.next=2;break}return e.abrupt("return");case 2:if(t&&(this.validateProperties(t),this.properties=wo(wo({},this.properties),t)),this._callObjectMode||this.properties.url){e.next=5;break}throw new Error("can't load iframe meeting because url property isn't set");case 5:this.updateMeetingState(oe);try{this.emit("loading",{action:"loading"})}catch(e){console.log("could not emit 'loading'",e)}if(!this._callObjectMode){e.next=11;break}return e.abrupt("return",new Promise(function(e,t){r._callObjectLoader.cancel(),r._callObjectLoader.load(r.properties.url||r.properties.baseUrl,r._callFrameId,function(t){r.updateMeetingState("loaded"),t&&r.emit("loaded",{action:"loaded"}),e()},function(e,n){r.emit("load-attempt-failed",{action:"load-attempt-failed",errorMsg:e}),n||(r.updateMeetingState(le),r.resetMeetingDependentVars(),r.emit("error",{action:"error",errorMsg:e}),t(e))})}));case 11:return this._iframe.src=this.assembleMeetingUrl(),e.abrupt("return",new Promise(function(e,t){r._loadedCallback=function(n){if(r._meetingState!==le){for(var i in r.updateMeetingState("loaded"),(r.properties.cssFile||r.properties.cssText)&&r.loadCss(r.properties),r._inputEventsOn)r.sendMessageToCallMachine({action:"register-input-handler",on:i});e()}else t(n)}}));case 13:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"join",value:function(){var e=f(p.mark(function e(){var t,r,n,i,a=this,o=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:{},r=!1,!this.needsLoad()){e.next=15;break}return this.updateIsPreparingToJoin(!0),e.prev=4,e.next=7,this.load(t);case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),this.updateIsPreparingToJoin(!1),e.abrupt("return",Promise.reject(e.t0));case 13:e.next=42;break;case 15:if(r=!(!this.properties.cssFile&&!this.properties.cssText),!this._didPreAuth){e.next=25;break}if(!t.url||t.url===this.properties.url){e.next=21;break}return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),e.abrupt("return",Promise.reject());case 21:if(!t.token||t.token===this.properties.token){e.next=25;break}return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),e.abrupt("return",Promise.reject());case 25:if(!t.url){e.next=40;break}if(!this._callObjectMode){e.next=36;break}if(n=zt(t.url),i=zt(this.properties.url||this.properties.baseUrl),n===i){e.next=33;break}return console.error("url in join() has a different bundle url than the one loaded (".concat(i," -> ").concat(n,")")),this.updateIsPreparingToJoin(!1),e.abrupt("return",Promise.reject());case 33:this.properties.url=t.url,e.next=40;break;case 36:if(!t.url||t.url===this.properties.url){e.next=40;break}return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),e.abrupt("return",Promise.reject());case 40:this.validateProperties(t),this.properties=wo(wo({},this.properties),t);case 42:if(void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._meetingState!==ce&&this._meetingState!==se){e.next=48;break}return console.warn("already joined meeting, call leave() before joining again"),this.updateIsPreparingToJoin(!1),e.abrupt("return");case 48:this.updateMeetingState(se,!1);try{this.emit("joining-meeting",{action:"joining-meeting"})}catch(e){console.log("could not emit 'joining-meeting'",e)}return this.sendMessageToCallMachine({action:"join-meeting",properties:Co(this.properties),preloadCache:Co(this._preloadCache)}),e.abrupt("return",new Promise(function(e,t){a._joinedCallback=function(n,i){if(a._meetingState!==le){if(a.updateMeetingState(ce),n)for(var o in n)a._callObjectMode&&(vo(n[o]),go(n[o]),yo(n[o],a._participants[o])),a._participants[o]=wo({},n[o]),a.toggleParticipantAudioBasedOnNativeAudioFocus();r&&a.loadCss(a.properties),e(n)}else t(i)}}));case 52:case"end":return e.stop()}},e,this,[[4,9]])}));return function(){return e.apply(this,arguments)}}()},{key:"leave",value:function(){var e=f(p.mark(function e(){var t=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){if(t._callObjectLoader&&!t._callObjectLoader.loaded){t._callObjectLoader.cancel(),t.updateMeetingState(ue),t.resetMeetingDependentVars();try{t.emit(ue,{action:ue})}catch(e){console.log("could not emit 'left-meeting'",e)}e()}else t._meetingState===ue||t._meetingState===le?e():t.sendMessageToCallMachine({action:"leave-meeting"},function(){e()})}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"startScreenShare",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Oo(),e.mediaStream&&(this._preloadCache.screenMediaStream=e.mediaStream,e.mediaStream=Tt),this.sendMessageToCallMachine({action:"local-screen-start",captureOptions:e})}},{key:"stopScreenShare",value:function(){Oo(),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Oo(),this.sendMessageToCallMachine(wo({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,r=void 0===t?{preset:"default"}:t;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:r})}},{key:"stopRecording",value:function(){Oo(),this.sendMessageToCallMachine({action:"local-recording-stop"})}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(wo({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,r=void 0===t?{preset:"default"}:t;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:r})}},{key:"stopLiveStreaming",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-live-streaming"})}},{key:"startTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-start-transcription"})}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"getNetworkStats",value:function(){var e=this;if(this._meetingState!==ce){return{stats:{latest:{}}}}return new Promise(function(t,r){e.sendMessageToCallMachine({action:"get-calc-stats"},function(r){t(wo({stats:r.stats},e._network))})})}},{key:"getActiveSpeaker",value:function(){return Oo(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return Oo(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return Oo(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){if(this._meetingState!==ce)throw new Error("setSubscribeToTracksAutomatically() is only allowed when joined");return this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:function(){var e=f(p.mark(function e(){var t,r=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Oo(),!this._callObjectMode){e.next=6;break}return e.next=4,navigator.mediaDevices.enumerateDevices();case 4:return t=e.sent,e.abrupt("return",{devices:t.map(function(e){return JSON.parse(JSON.stringify(e))})});case 6:return e.abrupt("return",new Promise(function(e,t){r.sendMessageToCallMachine({action:"enumerate-devices"},function(t){e({devices:t.devices})})}));case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(JSON.stringify(e).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return Oo(),this.sendMessageToCallMachine(wo({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return Oo(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Oo(),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):this._callObjectMode?(console.error("setShowLocalVideo is not available in callObject mode"),this):this._meetingState!==ce?(console.error("the meeting must be joined before calling setShowLocalVideo"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return Oo(),this._callObjectMode?(console.error("showLocalVideo is not available in callObject mode"),this):this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Oo(),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):this._callObjectMode?(console.error("setShowParticipantsBar is not available in callObject mode"),this):this._meetingState!==ce?(console.error("the meeting must be joined before calling setShowParticipantsBar"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return Oo(),this._callObjectMode?(console.error("showParticipantsBar is not available in callObject mode"),this):this._showParticipantsBar}},{key:"theme",value:function(){return this._callObjectMode?(console.error("theme is not available in callObject mode"),this):this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return new Promise(function(r,n){if(t._callObjectMode)n("setTheme is not available in callObject mode");else try{t.validateProperties({theme:e}),t.properties.theme=wo({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emit("theme-updated",{action:"theme-updated",theme:t.properties.theme})}catch(e){console.log("could not emit 'theme-updated'",e)}r(t.properties.theme)}catch(e){n(e)}})}},{key:"detectAllFaces",value:function(){var e=this;return Oo(),new Promise(function(t,r){e.sendMessageToCallMachine({action:"detect-all-faces"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}},{key:"requestFullscreen",value:function(){var e=f(p.mark(function e(){return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Oo(),this._iframe&&!document.fullscreenElement){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,this._iframe.requestFullscreen;case 6:if(!e.sent){e.next=10;break}this._iframe.requestFullscreen(),e.next=11;break;case 10:this._iframe.webkitRequestFullscreen();case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),console.log("could not make video call fullscreen",e.t0);case 16:case"end":return e.stop()}},e,this,[[3,13]])}));return function(){return e.apply(this,arguments)}}()},{key:"exitFullscreen",value:function(){Oo(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"room",value:function(){var e=f(p.mark(function e(){var t,r,n,i=this,a=arguments;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},r=t.includeRoomConfigDefaults,n=void 0===r||r,this._meetingState!==ce&&!this._didPreAuth){e.next=5;break}return e.abrupt("return",new Promise(function(e,t){i.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},function(t){delete t.action,delete t.callbackStamp,e(t)})}));case 5:if(!this.properties.url){e.next=7;break}return e.abrupt("return",{roomUrlPendingJoin:this.properties.url});case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"geo",value:function(){var e=f(p.mark(function e(){return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=f(p.mark(function e(t,r){var n,i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,"https://gs.daily.co/_ks_/x-swsl/:",e.next=4,fetch("https://gs.daily.co/_ks_/x-swsl/:");case 4:return n=e.sent,e.next=7,n.json();case 7:i=e.sent,t({current:i.geo}),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.error("geo lookup failed",e.t0),t({current:""});case 15:case"end":return e.stop()}},e,null,[[0,11]])}));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"setNetworkTopology",value:function(){var e=f(p.mark(function e(t){var r=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Oo(),e.abrupt("return",new Promise(function(){var e=f(p.mark(function e(n,i){var a;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=function(e){e.error?i({error:e.error}):n({workerId:e.workerId})},r.sendMessageToCallMachine({action:"set-network-topology",opts:t},a);case 2:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getNetworkTopology",value:function(){var e=f(p.mark(function e(){var t=this;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=f(p.mark(function e(r,n){var i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=function(e){e.error?n({error:e.error}):r({topology:e.topology})},t.sendMessageToCallMachine({action:"get-network-topology"},i);case 2:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"setPlayNewParticipantSound",value:function(e){if(Oo(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(t,r){return this._inputEventsOn[t]={},this.sendMessageToCallMachine({action:"register-input-handler",on:t}),e.prototype.on.call(this,t,r)}},{key:"once",value:function(t,r){return this._inputEventsOn[t]={},this.sendMessageToCallMachine({action:"register-input-handler",on:t}),e.prototype.once.call(this,t,r)}},{key:"off",value:function(t,r){return delete this._inputEventsOn[t],this.sendMessageToCallMachine({action:"register-input-handler",off:t}),e.prototype.off.call(this,t,r)}},{key:"validateProperties",value:function(e){for(var t in e){if(!To[t])throw new Error("unrecognized property '".concat(t,"'"));if(To[t].validate&&!To[t].validate(e[t],this))throw new Error("property '".concat(t,"': ").concat(To[t].help))}}},{key:"assembleMeetingUrl",value:function(){var e=wo(wo({},this.properties),{},{emb:this._callFrameId,embHref:encodeURIComponent(window.location.href)}),t=e.url.match(/\?/)?"&":"?";return e.url+t+Object.keys(To).filter(function(t){return To[t].queryString&&void 0!==e[t]}).map(function(t){return"".concat(To[t].queryString,"=").concat(e[t])}).join("&")}},{key:"needsLoad",value:function(){return[ae,oe,ue,le].includes(this._meetingState)}},{key:"sendMessageToCallMachine",value:function(e,t){this._messageChannel.sendMessageToCallMachine(e,t,this._iframe,this._callFrameId)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this._callFrameId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this._callFrameId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case"iframe-ready-for-launch-config":this.sendMessageToCallMachine(wo({action:"iframe-launch-config"},this.properties));break;case"loaded":this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"joined-meeting":this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"participant-joined":case"participant-updated":if(this._meetingState===ue)return;if(e.participant&&e.participant.session_id){var t=e.participant.local?"local":e.participant.session_id;this._callObjectMode&&(vo(e.participant),go(e.participant),yo(e.participant,this._participants[t]));try{this.maybeEventTrackStopped(this._participants[t],e.participant,"audioTrack"),this.maybeEventTrackStopped(this._participants[t],e.participant,"videoTrack"),this.maybeEventTrackStopped(this._participants[t],e.participant,"screenVideoTrack"),this.maybeEventTrackStopped(this._participants[t],e.participant,"screenAudioTrack"),this.maybeEventTrackStarted(this._participants[t],e.participant,"audioTrack"),this.maybeEventTrackStarted(this._participants[t],e.participant,"videoTrack"),this.maybeEventTrackStarted(this._participants[t],e.participant,"screenVideoTrack"),this.maybeEventTrackStarted(this._participants[t],e.participant,"screenAudioTrack"),this.maybeEventTrackStoppedForCustomTracks(this._participants[t],e.participant),this.maybeEventTrackStartedForCustomTracks(this._participants[t],e.participant),this.maybeEventRecordingStopped(this._participants[t],e.participant),this.maybeEventRecordingStarted(this._participants[t],e.participant)}catch(e){console.error("track events error",e)}if(!this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[t])){this._participants[t]=wo({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus();try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}}break;case"participant-left":if(e.participant&&e.participant.session_id){var r=this._participants[e.participant.session_id];r&&(this.maybeEventTrackStopped(r,null,"audioTrack"),this.maybeEventTrackStopped(r,null,"videoTrack"),this.maybeEventTrackStopped(r,null,"screenVideoTrack"),this.maybeEventTrackStopped(r,null,"screenAudioTrack"),this.maybeEventTrackStoppedForCustomTracks(r,null)),delete this._participants[e.participant.session_id];try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case"access-state-updated":var n={access:e.access};if(e.awaitingAccess&&(n.awaitingAccess=e.awaitingAccess),!G(this._accessState,n)){this._accessState=n;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case"meeting-session-updated":if(e.meetingSession)try{delete e.callFrameId,this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"error":this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this.updateMeetingState(le),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),this._joinedCallback&&(this._joinedCallback(null,e.errorMsg),this._joinedCallback=null);try{e.preserveIframe;var i=u(e,["preserveIframe"]);this.emit(e.action,i)}catch(t){console.log("could not emit",e,t)}break;case"left-meeting":this._meetingState!==le&&this.updateMeetingState(ue),this.resetMeetingDependentVars();try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"input-event":var a=this._participants[e.session_id];a||(a=e.session_id===this._participants.local.session_id?this._participants.local:{});try{this.emit(e.event.type,{action:e.event.type,event:e.event,participant:wo({},a)})}catch(t){console.log("could not emit",e,t)}break;case"network-quality-change":var o=e.threshold,s=e.quality;if(o!==this._network.threshold||s!==this._network.quality){this._network.quality=s,this._network.threshold=o;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case"active-speaker-change":var c=e.activeSpeaker;if(this._activeSpeaker.peerId!==c.peerId){this._activeSpeaker.peerId=c.peerId;try{this.emit(e.action,{action:e.action,activeSpeaker:this._activeSpeaker})}catch(t){console.log("could not emit",e,t)}}break;case"show-local-video-changed":if(this._callObjectMode)return;var l=e.show;this._showLocalVideo=l;try{this.emit(e.action,{action:e.action,show:l})}catch(t){console.log("could not emit",e,t)}break;case"active-speaker-mode-change":var d=e.enabled;if(this._activeSpeakerMode!==d){this._activeSpeakerMode=d;try{this.emit(e.action,{action:e.action,enabled:this._activeSpeakerMode})}catch(t){console.log("could not emit",e,t)}}break;case"waiting-participant-added":case"waiting-participant-updated":case"waiting-participant-removed":this._waitingParticipants=e.allWaitingParticipants;try{this.emit(e.action,{action:e.action,participant:e.participant})}catch(t){console.log("could not emit",e,t)}break;case"receive-settings-updated":if(!G(this._receiveSettings,e.receiveSettings)){this._receiveSettings=e.receiveSettings;try{this.emit(e.action,{action:e.action,receiveSettings:e.receiveSettings})}catch(t){console.log("could not emit",e,t)}}break;case"input-settings-updated":if(!G(this._inputSettings,e.inputSettings)){this._inputSettings=e.inputSettings;try{this.emit(e.action,{action:e.action,inputSettings:e.inputSettings})}catch(t){console.log("could not emit",e,t)}}break;case"recording-started":case"recording-stopped":case"recording-stats":case"recording-error":case"recording-upload-completed":case"transcription-started":case"transcription-stopped":case"transcription-error":case"started-camera":case"camera-error":case"app-message":case"local-screen-share-started":case"local-screen-share-stopped":case"network-connection":case"recording-data":case"live-streaming-started":case"live-streaming-stopped":case"live-streaming-error":case"nonfatal-error":case"lang-updated":case"media-ingest-error":try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var r="record";if(e&&!t.local&&!1===t[r]&&e[r]!==t[r])try{this.emit("recording-stopped",{action:"recording-stopped"})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventRecordingStarted",value:function(e,t){var r="record";if(e&&!t.local&&!0===t[r]&&e[r]!==t[r])try{this.emit("recording-started",{action:"recording-started"})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventTrackStopped",value:function(e,t,r){if(e&&(e[r]&&"ended"===e[r].readyState||e[r]&&(!t||!t[r])||e[r]&&e[r].id!==t[r].id))try{this.emit("track-stopped",{action:"track-stopped",track:e[r],participant:t})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventTrackStarted",value:function(e,t,r){if(t[r]&&(!e||!e[r])||t[r]&&"ended"===e[r].readyState||t[r]&&t[r].id!==e[r].id)try{this.emit("track-started",{action:"track-started",track:t[r],participant:t})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventTrackStoppedForCustomTracks",value:function(e,t){if(e)for(var r in e.tracks)mo(r)||this.maybeEventTrackStopped(e.tracks[r],t?t.tracks[r]:null,"track")}},{key:"maybeEventTrackStartedForCustomTracks",value:function(e,t){if(t)for(var r in t.tracks)mo(r)||this.maybeEventTrackStarted(e?e.tracks[r]:null,t.tracks[r],"track")}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!!G(e,t)&&((!e.videoTrack||!t.videoTrack||e.videoTrack.id===t.videoTrack.id&&e.videoTrack.muted===t.videoTrack.muted&&e.videoTrack.enabled===t.videoTrack.enabled)&&(!e.audioTrack||!t.audioTrack||e.audioTrack.id===t.audioTrack.id&&e.audioTrack.muted===t.audioTrack.muted&&e.audioTrack.enabled===t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return Ot()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this.updateMeetingState(this._meetingState,e)}},{key:"updateMeetingState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._meetingState||t!==this._isPreparingToJoin){var r=this._meetingState,n=this._isPreparingToJoin;this._meetingState=e,this._isPreparingToJoin=t;var i=this.isMeetingPendingOrOngoing(r,n),a=this.isMeetingPendingOrOngoing(this._meetingState,this._isPreparingToJoin);i!==a&&(this.updateKeepDeviceAwake(a),this.updateDeviceAudioMode(a),this.updateShowAndroidOngoingMeetingNotification(a),this.updateNoOpRecordingEnsuringBackgroundContinuity(a))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:me},this._receiveSettings={},this._inputSettings={},this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){Ot()&&this.nativeUtils().setKeepDeviceAwake(e,this._callFrameId)}},{key:"updateDeviceAudioMode",value:function(e){if(Ot()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(Ot()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,r,n,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var a=this.properties.reactNativeConfig.androidInCallNotification;t=a.title,r=a.subtitle,n=a.iconName,i=a.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,r,n,this._callFrameId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){Ot()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"isMeetingPendingOrOngoing",value:function(e,t){return[se,ce].includes(e)||t}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){if(Ot()){var e=store.getState();for(var t in e.streams){var r=e.streams[t];r&&r.pendingTrack&&"audio"===r.pendingTrack.kind&&(r.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}}]),n}());export{ye as DAILY_ACCESS_LEVEL_FULL,be as DAILY_ACCESS_LEVEL_LOBBY,we as DAILY_ACCESS_LEVEL_NONE,me as DAILY_ACCESS_UNKNOWN,xe as DAILY_CAMERA_ERROR_CAM_AND_MIC_IN_USE,Oe as DAILY_CAMERA_ERROR_CAM_IN_USE,Pe as DAILY_CAMERA_ERROR_MIC_IN_USE,Je as DAILY_EVENT_ACCESS_STATE_UPDATED,dt as DAILY_EVENT_ACTIVE_SPEAKER_CHANGE,pt as DAILY_EVENT_ACTIVE_SPEAKER_MODE_CHANGE,st as DAILY_EVENT_APP_MSG,Re as DAILY_EVENT_CAMERA_ERROR,St as DAILY_EVENT_ERROR,gt as DAILY_EVENT_EXIT_FULLSCREEN,vt as DAILY_EVENT_FULLSCREEN,Fe as DAILY_EVENT_IFRAME_LAUNCH_CONFIG,Ae as DAILY_EVENT_IFRAME_READY_FOR_LAUNCH_CONFIG,ct as DAILY_EVENT_INPUT_EVENT,_t as DAILY_EVENT_INPUT_SETTINGS_UPDATED,Ve as DAILY_EVENT_JOINED_MEETING,De as DAILY_EVENT_JOINING_MEETING,wt as DAILY_EVENT_LANG_UPDATED,Ue as DAILY_EVENT_LEFT_MEETING,bt as DAILY_EVENT_LIVE_STREAMING_ERROR,mt as DAILY_EVENT_LIVE_STREAMING_STARTED,yt as DAILY_EVENT_LIVE_STREAMING_STOPPED,Be as DAILY_EVENT_LOADED,Le as DAILY_EVENT_LOADING,Ie as DAILY_EVENT_LOAD_ATTEMPT_FAILED,ut as DAILY_EVENT_LOCAL_SCREEN_SHARE_STARTED,lt as DAILY_EVENT_LOCAL_SCREEN_SHARE_STOPPED,Ge as DAILY_EVENT_MEETING_SESSION_UPDATED,ft as DAILY_EVENT_NETWORK_CONNECTION,ht as DAILY_EVENT_NETWORK_QUALITY_CHANGE,Mt as DAILY_EVENT_NONFATAL_ERROR,ze as DAILY_EVENT_PARTICIPANT_JOINED,We as DAILY_EVENT_PARTICIPANT_LEFT,qe as DAILY_EVENT_PARTICIPANT_UPDATED,kt as DAILY_EVENT_RECEIVE_SETTINGS_UPDATED,ot as DAILY_EVENT_RECORDING_DATA,it as DAILY_EVENT_RECORDING_ERROR,tt as DAILY_EVENT_RECORDING_STARTED,nt as DAILY_EVENT_RECORDING_STATS,rt as DAILY_EVENT_RECORDING_STOPPED,at as DAILY_EVENT_RECORDING_UPLOAD_COMPLETED,Ne as DAILY_EVENT_STARTED_CAMERA,Ee as DAILY_EVENT_THEME_UPDATED,$e as DAILY_EVENT_TRACK_STARTED,Ye as DAILY_EVENT_TRACK_STOPPED,et as DAILY_EVENT_TRANSCRIPTION_ERROR,Ze as DAILY_EVENT_TRANSCRIPTION_STARTED,Xe as DAILY_EVENT_TRANSCRIPTION_STOPPED,He as DAILY_EVENT_WAITING_PARTICIPANT_ADDED,Qe as DAILY_EVENT_WAITING_PARTICIPANT_REMOVED,Ke as DAILY_EVENT_WAITING_PARTICIPANT_UPDATED,Me as DAILY_FATAL_ERROR_EJECTED,je as DAILY_FATAL_ERROR_EXP_ROOM,Ce as DAILY_FATAL_ERROR_EXP_TOKEN,Se as DAILY_FATAL_ERROR_NBF_ROOM,Te as DAILY_FATAL_ERROR_NBF_TOKEN,_e as DAILY_RECEIVE_SETTINGS_ALL_PARTICIPANTS_KEY,ke as DAILY_RECEIVE_SETTINGS_BASE_KEY,le as DAILY_STATE_ERROR,ce as DAILY_STATE_JOINED,se as DAILY_STATE_JOINING,ue as DAILY_STATE_LEFT,ae as DAILY_STATE_NEW,de as DAILY_TRACK_STATE_BLOCKED,ve as DAILY_TRACK_STATE_INTERRUPTED,fe as DAILY_TRACK_STATE_LOADING,pe as DAILY_TRACK_STATE_OFF,ge as DAILY_TRACK_STATE_PLAYABLE,he as DAILY_TRACK_STATE_SENDABLE};