File manager - Edit - /opt/flussonic/wwwroot/flu/webrtc/main.js
Back
/*! For license information please see main.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WRTCPlayer=e():t.WRTCPlayer=e()}(self,(()=>(()=>{var t={55:t=>{"use strict";t.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),o=0;o<r.length;o++){var s=r[o],a=t[s];(i?-1!==e.indexOf(s):e(s,a,t))&&(n[s]=a)}return n}},280:t=>{"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))},284:(t,e,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}n.d(e,{fj:()=>i,wD:()=>r}),t=n.hmd(t)},297:(t,e,n)=>{"use strict";n.d(e,{lu:()=>c});var r=n(936),i=n(284);t=n.hmd(t);var o={nowSeconds:function(){return Date.now()/1e3}};var s=(0,i.wD)()?function(){try{return(0,i.fj)(t,"perf_hooks").performance}catch(t){return}}():function(){var t=(0,r.VZ)().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),a=void 0===s?o:{nowSeconds:function(){return(s.timeOrigin+s.now())/1e3}},c=o.nowSeconds.bind(o);a.nowSeconds.bind(a),function(){var t=(0,r.VZ)().performance;if(t)t.timeOrigin?t.timeOrigin:t.timing&&t.timing.navigationStart||Date.now()}()},454:t=>{"use strict";var e="%[a-f0-9]{2}",n=new RegExp("("+e+")|([^%]+?)","gi"),r=new RegExp("("+e+")+","gi");function i(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],i(n),i(r))}function o(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(n)||[],r=1;r<e.length;r++)e=(t=i(e,r).join("")).match(n)||[];return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var i=o(n[0]);i!==n[0]&&(e[n[0]]=i)}n=r.exec(t)}e["%C2"]="�";for(var s=Object.keys(e),a=0;a<s.length;a++){var c=s[a];t=t.replace(new RegExp(c,"g"),e[c])}return t}(t)}}},528:t=>{"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}},663:(t,e,n)=>{"use strict";const r=n(280),i=n(454),o=n(528),s=n(55),a=Symbol("encodeFragmentIdentifier");function c(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function l(t,e){return e.decode?i(t):t}function d(t){return Array.isArray(t)?t.sort():"object"==typeof t?d(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function p(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function h(t){const e=(t=p(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function f(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function v(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&l(n,t).includes(t.arrayFormatSeparator);n=o?l(n,t):n;const s=i||o?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);r[e]=s};case"bracket-separator":return(e,n,r)=>{const i=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!i)return void(r[e]=n?l(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>l(e,t)));void 0!==r[e]?r[e]=[].concat(r[e],o):r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;let[t,s]=o(e.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:l(s,e),n(l(t,e),s,r)}for(const t of Object.keys(r)){const n=r[t];if("object"==typeof n&&null!==n)for(const t of Object.keys(n))n[t]=f(n[t],e);else r[t]=f(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=d(n):t[e]=n,t}),Object.create(null))}e.extract=h,e.parse=v,e.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const n=n=>e.skipNull&&null==t[n]||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[u(e,t),"[",i,"]"].join("")]:[...n,[u(e,t),"[",u(i,t),"]=",u(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[u(e,t),"[]"].join("")]:[...n,[u(e,t),"[]=",u(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[u(e,t),":list="].join("")]:[...n,[u(e,t),":list=",u(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[u(n,t),e,u(i,t)].join("")]:[[r,u(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,u(e,t)]:[...n,[u(e,t),"=",u(r,t)].join("")]}}(e),i={};for(const e of Object.keys(t))n(e)||(i[e]=t[e]);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?u(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?u(n,e)+"[]":i.reduce(r(n),[]).join("&"):u(n,e)+"="+u(i,e)})).filter((t=>t.length>0)).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[n,r]=o(t,"#");return Object.assign({url:n.split("?")[0]||"",query:v(h(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:l(r,e)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);const r=p(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),s=Object.assign(o,t.query);let c=e.stringify(s,n);c&&(c=`?${c}`);let l=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);return t.fragmentIdentifier&&(l=`#${n[a]?u(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${c}${l}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);const{url:i,query:o,fragmentIdentifier:c}=e.parseUrl(t,r);return e.stringifyUrl({url:i,query:s(o,n),fragmentIdentifier:c},r)},e.exclude=(t,n,r)=>{const i=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return e.pick(t,i,r)}},936:(t,e,n)=>{"use strict";n.d(e,{$N:()=>p,$X:()=>c,Dl:()=>a,FA:()=>f,M6:()=>d,VZ:()=>o,eJ:()=>s,gO:()=>l,pq:()=>u});var r=n(284),i={};function o(){return(0,r.wD)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function s(){var t=o(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function a(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function c(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function u(t){var e=o();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)}));var i=t();return Object.keys(r).forEach((function(t){n[t]=r[t]})),i}function l(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function d(t,e){void 0===e&&(e={});try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(e).forEach((function(n){t.exception.values[0].mechanism[n]=e[n]}))}catch(t){}}function p(){try{return document.location.href}catch(t){return""}}var h=6e4;function f(t,e){if(!e)return h;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?h:r-t}},942:t=>{t.exports=function(t){t.events={}}},974:t=>{(t.exports=function(){this.events={}}).prototype={emit:function(t){var e=[].slice.call(arguments,1);[].slice.call(this.events[t]||[]).filter((function(t){t.apply(this,e)}))},on:function(t,e){return(this.events[t]=this.events[t]||[]).push(e),function(){this.events[t]=this.events[t].filter((function(t){return t!==e}))}.bind(this)}}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r](o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function e(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.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)?t(e,n):void 0}}(e,n)||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.")}()}n.r(r),n.d(r,{WRTCPlayerLoad:()=>Tn,WRTCPublisherLoad:()=>In,getOptions:()=>xn,getUrl:()=>kn});var i=n(663);function o(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function a(t){o(s,r,i,a,c,"next",t)}function c(t){o(s,r,i,a,c,"throw",t)}a(void 0)}))}}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}function u(t,e,n){return(e=c(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach((function(e){u(t,e,n[e])}))}return t}var d=function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},d.apply(this,arguments)};function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},v.apply(this,arguments)};function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function g(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return C(t,Error)}}function _(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function b(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function S(t){return"[object String]"===Object.prototype.toString.call(t)}function w(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function x(t){return"undefined"!=typeof Event&&C(t,Event)}function k(t){return"undefined"!=typeof Element&&C(t,Element)}function T(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function C(t,e){try{return t instanceof e}catch(t){return!1}}var O,j,P=n(297);(j=O||(O={})).PENDING="PENDING",j.RESOLVED="RESOLVED",j.REJECTED="REJECTED";var R=function(){function t(t){var e=this;this._state=O.PENDING,this._handlers=[],this._resolve=function(t){e._setResult(O.RESOLVED,t)},this._reject=function(t){e._setResult(O.REJECTED,t)},this._setResult=function(t,n){e._state===O.PENDING&&(T(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==O.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||(e._state===O.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._value),e._state===O.REJECTED&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var i=e.length,o=[];e.forEach((function(e,s){t.resolve(e).then((function(t){o[s]=t,0===(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,i){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void i(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void i(t)}else i(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var i,o;return n.then((function(t){o=!1,i=t,e&&e()}),(function(t){o=!0,i=t,e&&e()})).then((function(){o?r(i):t(i)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}(),I=n(936),D=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return t.clone=function(e){var n=new t;return e&&(n._breadcrumbs=m(e._breadcrumbs),n._tags=v({},e._tags),n._extra=v({},e._extra),n._contexts=v({},e._contexts),n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=m(e._eventProcessors)),n},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.setTags=function(t){return this._tags=v(v({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var n;return this._tags=v(v({},this._tags),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=v(v({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var n;return this._extra=v(v({},this._extra),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this._contexts[t]:this._contexts=v(v({},this._contexts),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t,e,n,r,i=this.getSpan();return(null===(t=i)||void 0===t?void 0:t.transaction)?null===(e=i)||void 0===e?void 0:e.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags=v(v({},this._tags),e._tags),this._extra=v(v({},this._extra),e._extra),this._contexts=v(v({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint)):E(e)&&(this._tags=v(v({},this._tags),e.tags),this._extra=v(v({},this._extra),e.extra),this._contexts=v(v({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var n=v({timestamp:(0,P.lu)()},t);return this._breadcrumbs=void 0!==e&&e>=0?m(this._breadcrumbs,[n]).slice(-e):m(this._breadcrumbs,[n]),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){var n;if(this._extra&&Object.keys(this._extra).length&&(t.extra=v(v({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=v(v({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=v(v({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=v(v({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=v({trace:this._span.getTraceContext()},t.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(t.tags=v({transaction:r},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=m(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(m(L(),this._eventProcessors),t,e)},t.prototype._notifyEventProcessors=function(t,e,n,r){var i=this;return void 0===r&&(r=0),new R((function(o,s){var a=t[r];if(null===e||"function"!=typeof a)o(e);else{var c=a(v({},e),n);T(c)?c.then((function(e){return i._notifyEventProcessors(t,e,n,r+1).then(o)})).then(null,s):i._notifyEventProcessors(t,c,n,r+1).then(o).then(null,s)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function L(){var t=(0,I.VZ)();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function N(t){L().push(t)}var A=(0,I.VZ)(),M="Sentry Logger ",U=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,I.pq)((function(){A.console.log(M+"[Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,I.pq)((function(){A.console.warn(M+"[Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,I.pq)((function(){A.console.error(M+"[Error]: "+t.join(" "))}))},t}();A.__SENTRY__=A.__SENTRY__||{};var F,$,V=A.__SENTRY__.logger||(A.__SENTRY__.logger=new U),B=n(284);($=F||(F={})).Ok="ok",$.Exited="exited",$.Crashed="crashed",$.Abnormal="abnormal";var q=function(t,e){return q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},q(t,e)};var W=function(){return W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},W.apply(this,arguments)};function H(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function J(t){try{for(var e=t,n=[],r=0,i=0,o=void 0;e&&r++<5&&!("html"===(o=Y(e))||r>1&&i+3*n.length+o.length>=80);)n.push(o),i+=o.length,e=e.parentNode;return n.reverse().join(" > ")}catch(t){return"<unknown>"}}function Y(t){var e,n,r,i,o,s=t,a=[];if(!s||!s.tagName)return"";if(a.push(s.tagName.toLowerCase()),s.id&&a.push("#"+s.id),(e=s.className)&&S(e))for(n=e.split(/\s+/),o=0;o<n.length;o++)a.push("."+n[o]);var c=["type","name","title","alt"];for(o=0;o<c.length;o++)r=c[o],(i=s.getAttribute(r))&&a.push("["+r+'="'+i+'"]');return a.join("")}var X=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e<this._inner.length;e++){if(this._inner[e]===t)return!0}return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t){this._inner.splice(e,1);break}},t}(),z="<anonymous>";function Z(t){try{return t&&"function"==typeof t&&t.name||z}catch(t){return z}}function K(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function Q(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var i=t[r];try{n.push(String(i))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function tt(t,e){return!!S(t)&&(n=e,"[object RegExp]"===Object.prototype.toString.call(n)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e));var n}function et(t,e,n){if(e in t){var r=t[e],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=i}}function nt(t){if(g(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(x(t)){var i=t,o={};o.type=i.type;try{o.target=k(i.target)?J(i.target):Object.prototype.toString.call(i.target)}catch(t){o.target="<unknown>"}try{o.currentTarget=k(i.currentTarget)?J(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch(t){o.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&C(t,CustomEvent)&&(o.detail=i.detail),i)Object.prototype.hasOwnProperty.call(i,r)&&(o[r]=i);return o}return t}function rt(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function it(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r=at(t,e);return rt(r)>n?it(t,e-1,n):r}function ot(t,e){return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==n.g&&t===n.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":E(r=t)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+Z(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var r}function st(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new X),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=ot(t);return w(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var i=ot(e,t);if(w(i))return i;var o=nt(e),s=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(s[a]=st(a,o[a],n-1,r));return r.unmemoize(e),s}function at(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return st(t,n,e)})))}catch(t){return"**non-serializable**"}}function ct(t,e){void 0===e&&(e=40);var n=Object.keys(nt(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return K(n[0],e);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:K(i,e)}return""}function ut(t){var e,n;if(E(t)){var r=t,i={};try{for(var o=H(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;void 0!==r[a]&&(i[a]=ut(r[a]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}return Array.isArray(t)?t.map(ut):t}var lt=function(){function t(t){this.errors=0,this.sid=(0,I.eJ)(),this.timestamp=Date.now(),this.started=Date.now(),this.duration=0,this.status=F.Ok,t&&this.update(t)}return t.prototype.update=function(t){void 0===t&&(t={}),t.user&&(t.user.ip_address&&(this.ipAddress=t.user.ip_address),t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Date.now(),t.sid&&(this.sid=32===t.sid.length?t.sid:(0,I.eJ)()),t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),"number"==typeof t.duration?this.duration=t.duration:this.duration=this.timestamp-this.started,t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),t.ipAddress&&(this.ipAddress=t.ipAddress),t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===F.Ok?this.update({status:F.Exited}):this.update()},t.prototype.toJSON=function(){return ut({sid:""+this.sid,init:!0,started:new Date(this.started).toISOString(),timestamp:new Date(this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:ut({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),dt=function(){function t(t,e,n){void 0===e&&(e=new D),void 0===n&&(n=3),this._version=n,this._stack=[{}],this.getStackTop().scope=e,this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=D.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var n=this._lastEventId=(0,I.eJ)(),r=e;if(!e){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(t){i=t}r={originalException:t,syntheticException:i}}return this._invokeClient("captureException",t,v(v({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this._lastEventId=(0,I.eJ)(),i=n;if(!n){var o=void 0;try{throw new Error(t)}catch(t){o=t}i={originalException:t,syntheticException:o}}return this._invokeClient("captureMessage",t,e,v(v({},i),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=this._lastEventId=(0,I.eJ)();return this._invokeClient("captureEvent",t,v(v({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,i=n.client;if(r&&i){var o=i.getOptions&&i.getOptions()||{},s=o.beforeBreadcrumb,a=void 0===s?null:s,c=o.maxBreadcrumbs,u=void 0===c?100:c;if(!(u<=0)){var l=(0,P.lu)(),d=v({timestamp:l},t),p=a?(0,I.pq)((function(){return a(d,e)})):d;null!==p&&r.addBreadcrumb(p,Math.min(u,100))}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=ht(this);try{t(this)}finally{ht(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return V.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.startSession=function(t){this.endSession();var e=this.getStackTop(),n=e.scope,r=e.client,i=r&&r.getOptions()||{},o=i.release,s=i.environment,a=new lt(v(v({release:o,environment:s},n&&{user:n.getUser()}),t));return n&&n.setSession(a),a},t.prototype.endSession=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&(r.close(),n&&n.captureSession&&n.captureSession(r),e.setSession())}},t.prototype._invokeClient=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.getStackTop(),o=i.scope,s=i.client;s&&s[t]&&(e=s)[t].apply(e,m(n,[o]))},t.prototype._callExtensionMethod=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=pt().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[t])return r.extensions[t].apply(this,e);V.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function pt(){var t=(0,I.VZ)();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function ht(t){var e=pt(),n=yt(e);return mt(e,t),n}function ft(){var t=pt();return vt(t)&&!yt(t).isOlderThan(3)||mt(t,new dt),(0,B.wD)()?function(t){try{var e=(r=pt().__SENTRY__)&&r.extensions&&r.extensions.domain&&r.extensions.domain.active;if(!e)return yt(t);if(!vt(e)||yt(e).isOlderThan(3)){var n=yt(t).getStackTop();mt(e,new dt(n.client,D.clone(n.scope)))}return yt(e)}catch(e){return yt(t)}var r}(t):yt(t)}function vt(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function yt(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new dt),t.__SENTRY__.hub}function mt(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}var gt,_t=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],bt=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(){N((function(e){var n=ft();if(!n)return e;var r=n.getIntegration(t);if(r){var i=n.getClient(),o=i?i.getOptions():{},s=r._mergeOptions(o);if(r._shouldDropEvent(e,s))return null}return e}))},t.prototype._shouldDropEvent=function(t,e){return this._isSentryError(t,e)?(V.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,I.$X)(t)),!0):this._isIgnoredError(t,e)?(V.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,I.$X)(t)),!0):this._isDeniedUrl(t,e)?(V.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,I.$X)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0):!this._isAllowedUrl(t,e)&&(V.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,I.$X)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0)},t.prototype._isSentryError=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype._isIgnoredError=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this._getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return tt(t,e)}))}))},t.prototype._isDeniedUrl=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return!!n&&e.denyUrls.some((function(t){return tt(n,t)}))},t.prototype._isAllowedUrl=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return!n||e.allowUrls.some((function(t){return tt(n,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:f(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:f(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:f(this._options.ignoreErrors||[],t.ignoreErrors||[],_t),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},t.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,i=e.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(e){return V.error("Cannot extract message for event "+(0,I.$X)(t)),[]}return[]},t.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return e&&e[e.length-1].filename||null}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch(e){return V.error("Cannot extract url for event "+(0,I.$X)(t)),null}},t.id="InboundFilters",t}(),St=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){gt=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.__sentry_original__||this;return gt.apply(n,t)}},t.id="FunctionToString",t}();var wt=function(t,e){return wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},wt(t,e)};function Et(t,e){function n(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var xt=function(){return xt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},xt.apply(this,arguments)};function kt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Ct(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Tt(arguments[e]));return t}var Ot=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t});var jt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,Ot(r,n.prototype),r}return function(t,e){function n(){this.constructor=t}q(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(Error),Pt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,Rt="Invalid Dsn",It=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,i=e.pass,o=e.port,s=e.projectId;return e.protocol+"://"+e.user+(t&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+s},t.prototype._fromString=function(t){var e=Pt.exec(t);if(!e)throw new jt(Rt);var n=G(e.slice(1),6),r=n[0],i=n[1],o=n[2],s=void 0===o?"":o,a=n[3],c=n[4],u=void 0===c?"":c,l="",d=n[5],p=d.split("/");if(p.length>1&&(l=p.slice(0,-1).join("/"),d=p.pop()),d){var h=d.match(/^\d+/);h&&(d=h[0])}this._fromComponents({host:a,pass:s,path:l,projectId:d,port:u,protocol:r,user:i})},t.prototype._fromComponents=function(t){this.protocol=t.protocol,this.user=t.user,this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","user","host","projectId"].forEach((function(e){if(!t[e])throw new jt(Rt+": "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new jt(Rt+": Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new jt(Rt+": Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new jt(Rt+": Invalid port "+this.port)},t}(),Dt=[];function Lt(t){var e={};return function(t){var e=t.defaultIntegrations&&f(t.defaultIntegrations)||[],n=t.integrations,r=[];if(Array.isArray(n)){var i=n.map((function(t){return t.name})),o=[];e.forEach((function(t){-1===i.indexOf(t.name)&&-1===o.indexOf(t.name)&&(r.push(t),o.push(t.name))})),n.forEach((function(t){-1===o.indexOf(t.name)&&(r.push(t),o.push(t.name))}))}else"function"==typeof n?(r=n(e),r=Array.isArray(r)?r:[r]):r=f(e);var s=r.map((function(t){return t.name})),a="Debug";return-1!==s.indexOf(a)&&r.push.apply(r,f(r.splice(s.indexOf(a),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===Dt.indexOf(t.name)&&(t.setupOnce(N,ft),Dt.push(t.name),V.log("Integration installed: "+t.name))}(t)})),e}var Nt,At,Mt=function(){function t(t,e){this._integrations={},this._processing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=new It(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this,i=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return r._captureEvent(t,e,n)})).then((function(t){i=t}))),i},t.prototype.captureMessage=function(t,e,n,r){var i=this,o=n&&n.event_id,s=w(t)?this._getBackend().eventFromMessage(String(t),e,n):this._getBackend().eventFromException(t,n);return this._process(s.then((function(t){return i._captureEvent(t,n,r)})).then((function(t){o=t}))),o},t.prototype.captureEvent=function(t,e,n){var r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((function(t){r=t}))),r},t.prototype.captureSession=function(t){t.release?this._sendSession(t):V.warn("Discarded session because of missing release")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.flush=function(t){var e=this;return this._isClientProcessing(t).then((function(n){return e._getBackend().getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=Lt(this._options))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return V.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var n,r,i,o=!1,s=!1,a=e.exception&&e.exception.values;if(a){s=!0;try{for(var c=p(a),u=c.next();!u.done;u=c.next()){var l=u.value.mechanism;if(l&&!1===l.handled){o=!0;break}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}var h=e.user;if(!t.userAgent){var f=e.request?e.request.headers:{};for(var v in f)if("user-agent"===v.toLowerCase()){i=f[v];break}}t.update(d(d({},o&&{status:F.Crashed}),{user:h,userAgent:i,errors:t.errors+Number(s||o)}))},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientProcessing=function(t){var e=this;return new R((function(n){var r=0,i=setInterval((function(){0==e._processing?(clearInterval(i),n(!0)):(r+=1,t&&r>=t&&(clearInterval(i),n(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,s=d(d({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:(0,I.eJ)()),timestamp:t.timestamp||(0,P.lu)()});this._applyClientOptions(s),this._applyIntegrationsMetadata(s);var a=e;n&&n.captureContext&&(a=D.clone(a).update(n.captureContext));var c=R.resolve(s);return a&&(c=a.applyToEvent(s,n)),c.then((function(t){return"number"==typeof o&&o>0?r._normalizeEvent(t,o):t}))},t.prototype._normalizeEvent=function(t,e){if(!t)return null;var n=d(d(d(d(d({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return d(d({},t),t.data&&{data:at(t.data,e)})}))}),t.user&&{user:at(t.user,e)}),t.contexts&&{contexts:at(t.contexts,e)}),t.extra&&{extra:at(t.extra,e)});return t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace),n},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),n=e.environment,r=e.release,i=e.dist,o=e.maxValueLength,s=void 0===o?250:o;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=K(t.message,s));var a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=K(a.value,s));var c=t.request;c&&c.url&&(c.url=K(c.url,s))},t.prototype._applyIntegrationsMetadata=function(t){var e=t.sdk,n=Object.keys(this._integrations);e&&n.length>0&&(e.integrations=n)},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,n){return this._processEvent(t,e,n).then((function(t){return t.event_id}),(function(t){V.error(t)}))},t.prototype._processEvent=function(t,e,n){var r=this,i=this.getOptions(),o=i.beforeSend,s=i.sampleRate;if(!this._isEnabled())return R.reject(new jt("SDK not enabled, will not send event."));var a="transaction"===t.type;return!a&&"number"==typeof s&&Math.random()>s?R.reject(new jt("Discarding event because it's not included in the random sample (sampling rate = "+s+")")):this._prepareEvent(t,n,e).then((function(t){if(null===t)throw new jt("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||a||!o)return t;var n=o(t,e);if(void 0===n)throw new jt("`beforeSend` method has to return `null` or a valid event.");return T(n)?n.then((function(t){return t}),(function(t){throw new jt("beforeSend rejected with "+t)})):n})).then((function(t){if(null===t)throw new jt("`beforeSend` returned `null`, will not send event.");var e=n&&n.getSession&&n.getSession();return!a&&e&&r._updateSessionFromEvent(e,t),r._sendEvent(t),t})).then(null,(function(t){if(t instanceof jt)throw t;throw r.captureException(t,{data:{__sentry__:!0},originalException:t}),new jt("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._processing+=1,t.then((function(t){return e._processing-=1,t}),(function(t){return e._processing-=1,t}))},t}();(At=Nt||(Nt={})).Unknown="unknown",At.Skipped="skipped",At.Success="success",At.RateLimit="rate_limit",At.Invalid="invalid",At.Failed="failed",function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(Nt||(Nt={}));var Ut,Ft,$t=function(){function t(){}return t.prototype.sendEvent=function(t){return R.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:Nt.Skipped})},t.prototype.close=function(t){return R.resolve(!0)},t}(),Vt=function(){function t(t){this._options=t,this._options.dsn||V.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new jt("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new jt("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,(function(t){V.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this._transport.sendSession?this._transport.sendSession(t).then(null,(function(t){V.error("Error while sending session: "+t)})):V.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new $t},t}();function Bt(){if(!("fetch"in(0,I.VZ)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function qt(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Wt(){if(!Bt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}(Ft=Ut||(Ut={})).Fatal="fatal",Ft.Error="error",Ft.Warning="warning",Ft.Log="log",Ft.Info="info",Ft.Debug="debug",Ft.Critical="critical",function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;default:return t.Log}}}(Ut||(Ut={}));var Ht="?",Gt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Yt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Xt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zt=/Minified React error #\d+;/i;function Kt(t){var e=null,n=0;t&&("number"==typeof t.framesToPop?n=t.framesToPop:Zt.test(t.message)&&(n=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=t.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),s=[],a=0;a<o.length;a+=2){var c=null;(e=r.exec(o[a]))?c={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=i.exec(o[a]))&&(c={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),c&&(!c.func&&c.line&&(c.func=Ht),s.push(c))}if(!s.length)return null;return{message:te(t),name:t.name,stack:s}}(t),e)return Qt(e,n)}catch(t){}try{if(e=function(t){if(!t||!t.stack)return null;for(var e,n,r,i=[],o=t.stack.split("\n"),s=0;s<o.length;++s){if(n=Gt.exec(o[s])){var a=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(e=zt.exec(n[2]))&&(n[2]=e[1],n[3]=e[2],n[4]=e[3]),r={url:n[2]&&0===n[2].indexOf("address at ")?n[2].substr(11):n[2],func:n[1]||Ht,args:a?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=Yt.exec(o[s]))r={url:n[2],func:n[1]||Ht,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Jt.exec(o[s])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(e=Xt.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=e[1],n[4]=e[2],n[5]=""):0!==s||n[5]||void 0===t.columnNumber||(i[0].column=t.columnNumber+1),r={url:n[3],func:n[1]||Ht,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=Ht),i.push(r)}if(!i.length)return null;return{message:te(t),name:t.name,stack:i}}(t),e)return Qt(e,n)}catch(t){}return{message:te(t),name:t&&t.name,stack:[],failed:!0}}function Qt(t,e){try{return xt(xt({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function te(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function ee(t){var e=re(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function ne(t){return{exception:{values:[ee(t)]}}}function re(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function ie(t,e,n){var r,i;if(void 0===n&&(n={}),_(t)&&t.error)return r=ne(Kt(t=t.error));if(b(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){var o=t,s=o.name||(b(o)?"DOMError":"DOMException"),a=o.message?s+": "+o.message:s;return r=oe(a,e,n),(0,I.gO)(r,a),"code"in o&&(r.tags=xt(xt({},r.tags),{"DOMException.code":""+o.code})),r}return g(t)?r=ne(Kt(t)):E(t)||x(t)?(r=function(t,e,n){var r={exception:{values:[{type:x(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+ct(t)}]},extra:{__serialized__:it(t)}};if(e){var i=re(Kt(e).stack);r.stacktrace={frames:i}}return r}(t,e,n.rejection),(0,I.M6)(r,{synthetic:!0}),r):(r=oe(t,e,n),(0,I.gO)(r,""+t,void 0),(0,I.M6)(r,{synthetic:!0}),r)}function oe(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var i=re(Kt(e).stack);r.stacktrace={frames:i}}return r}function se(t,e){return{body:JSON.stringify({sent_at:(new Date).toISOString()})+"\n"+JSON.stringify({type:"session"})+"\n"+JSON.stringify(t),type:"session",url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function ae(t,e){var n=t.tags||{},r=n.__sentry_samplingMethod,i=n.__sentry_sampleRate,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(n,["__sentry_samplingMethod","__sentry_sampleRate"]);t.tags=o;var s="transaction"===t.type,a={body:JSON.stringify(t),type:t.type||"event",url:s?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(s){var c=JSON.stringify({event_id:t.event_id,sent_at:(new Date).toISOString()})+"\n"+JSON.stringify({type:t.type,sample_rates:[{id:r,rate:i}]})+"\n"+a.body;a.body=c}return a}var ce=function(){function t(t){this.dsn=t,this._dsnObject=new It(t)}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.getBaseApiEndpoint=function(){var t=this._dsnObject,e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},t.prototype.getStoreEndpointPath=function(){var t=this._dsnObject;return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var n=this._dsnObject,r=["Sentry sentry_version=7"];return r.push("sentry_client="+t+"/"+e),r.push("sentry_key="+n.user),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this._dsnObject,n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+e.toString()),t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&r.push("name="+encodeURIComponent(t.user.name)),t.user.email&&r.push("email="+encodeURIComponent(t.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r.length?n+"?"+r.join("&"):n},t.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},t.prototype._getIngestEndpoint=function(t){return""+this.getBaseApiEndpoint()+this._dsnObject.projectId+"/"+t+"/"},t.prototype._encodedAuth=function(){var t,e={sentry_key:this._dsnObject.user,sentry_version:"7"};return t=e,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},t}(),ue=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},t.prototype.add=function(t){var e=this;return this.isReady()?(-1===this._buffer.indexOf(t)&&this._buffer.push(t),t.then((function(){return e.remove(t)})).then(null,(function(){return e.remove(t).then(null,(function(){}))})),t):R.reject(new jt("Not adding Promise due to buffer limit reached."))},t.prototype.remove=function(t){return this._buffer.splice(this._buffer.indexOf(t),1)[0]},t.prototype.length=function(){return this._buffer.length},t.prototype.drain=function(t){var e=this;return new R((function(n){var r=setTimeout((function(){t&&t>0&&n(!1)}),t);R.all(e._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}(),le=function(){function t(t){this.options=t,this._buffer=new ue(30),this._rateLimits={},this._api=new ce(this.options.dsn),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return t.prototype.sendEvent=function(t){throw new jt("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t.prototype._handleResponse=function(t){var e=t.requestType,n=t.response,r=t.headers,i=t.resolve,o=t.reject,s=Nt.fromHttpCode(n.status);this._handleRateLimit(r)&&V.warn("Too many requests, backing off until: "+this._disabledUntil(e)),s!==Nt.Success?o(n):i({status:s})},t.prototype._disabledUntil=function(t){return this._rateLimits[t]||this._rateLimits.all},t.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},t.prototype._handleRateLimit=function(t){var e,n,r,i,o=Date.now(),s=t["x-sentry-rate-limits"],a=t["retry-after"];if(s){try{for(var c=kt(s.trim().split(",")),u=c.next();!u.done;u=c.next()){var l=u.value.split(":",2),d=parseInt(l[0],10),p=1e3*(isNaN(d)?60:d);try{for(var h=(r=void 0,kt(l[1].split(";"))),f=h.next();!f.done;f=h.next()){var v=f.value;this._rateLimits[v||"all"]=new Date(o+p)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return!0}return!!a&&(this._rateLimits.all=new Date(o+(0,I.FA)(o,a)),!0)},t}(),de=(0,I.VZ)(),pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Et(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(ae(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(se(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;if(this._isRateLimited(t.type))return Promise.reject({event:e,type:t.type,reason:"Transport locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429});var r={body:t.body,method:"POST",referrerPolicy:Wt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add(new R((function(e,i){de.fetch(t.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:t.type,response:r,headers:o,resolve:e,reject:i})})).catch(i)})))},e}(le),he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Et(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(ae(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(se(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;return this._isRateLimited(t.type)?Promise.reject({event:e,type:t.type,reason:"Transport locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429}):this._buffer.add(new R((function(e,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:t.type,response:i,headers:o,resolve:e,reject:r})}},i.open("POST",t.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(t.body)})))},e}(le),fe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Et(e,t),e.prototype.eventFromException=function(t,e){return function(t,e,n){var r=ie(e,n&&n.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return(0,I.M6)(r,{handled:!0,type:"generic"}),r.level=Ut.Error,n&&n.event_id&&(r.event_id=n.event_id),R.resolve(r)}(this._options,t,e)},e.prototype.eventFromMessage=function(t,e,n){return void 0===e&&(e=Ut.Info),function(t,e,n,r){void 0===n&&(n=Ut.Info);var i=oe(e,r&&r.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),R.resolve(i)}(this._options,t,e,n)},e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=xt(xt({},this._options.transportOptions),{dsn:this._options.dsn});return this._options.transport?new this._options.transport(e):Bt()?new pe(e):new he(e)},e}(Vt);function ve(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ye(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=ft();if(r&&r[t])return r[t].apply(r,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ve(arguments[e]));return t}(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function me(t,e){var n;try{throw new Error("Sentry syntheticException")}catch(t){n=t}return ye("captureException",t,{captureContext:e,originalException:t,syntheticException:n})}var ge=0;function _e(){return ge>0}function be(t,e,n){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map((function(t){return be(t,e)}));return t.handleEvent?t.handleEvent.apply(this,i):t.apply(this,i)}catch(t){throw ge+=1,setTimeout((function(){ge-=1})),ye("withScope",(function(n){n.addEventProcessor((function(t){var n=xt({},t);return e.mechanism&&((0,I.gO)(n,void 0,void 0),(0,I.M6)(n,e.mechanism)),n.extra=xt(xt({},n.extra),{arguments:r}),n})),me(t)})),t}};try{for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}function Se(t){if(void 0===t&&(t={}),t.eventId)if(t.dsn){var e=document.createElement("script");e.async=!0,e.src=new ce(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad),(document.head||document.body).appendChild(e)}else V.error("Missing dsn option in showReportDialog call");else V.error("Missing eventId option in showReportDialog call")}var we,Ee=(0,I.VZ)(),xe={},ke={};function Te(t){if(!ke[t])switch(ke[t]=!0,t){case"console":!function(){if(!("console"in Ee))return;["debug","info","warn","error","log","assert"].forEach((function(t){t in Ee.console&&et(Ee.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Oe("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,Ee.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in Ee))return;Ee.document.addEventListener("click",Ne("click",Oe.bind(null,"dom")),!1),Ee.document.addEventListener("keypress",Ae(Oe.bind(null,"dom")),!1),["EventTarget","Node"].forEach((function(t){var e=Ee[t]&&Ee[t].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(et(e,"addEventListener",(function(t){return function(e,n,r){return n&&n.handleEvent?("click"===e&&et(n,"handleEvent",(function(t){return function(e){return Ne("click",Oe.bind(null,"dom"))(e),t.call(this,e)}})),"keypress"===e&&et(n,"handleEvent",(function(t){return function(e){return Ae(Oe.bind(null,"dom"))(e),t.call(this,e)}}))):("click"===e&&Ne("click",Oe.bind(null,"dom"),!0)(this),"keypress"===e&&Ae(Oe.bind(null,"dom"))(this)),t.call(this,e,n,r)}})),et(e,"removeEventListener",(function(t){return function(e,n,r){try{t.call(this,e,n.__sentry_wrapped__,r)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in Ee))return;var t=[],e=[],n=XMLHttpRequest.prototype;et(n,"open",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=this,s=r[1];o.__sentry_xhr__={method:S(r[0])?r[0].toUpperCase():r[0],url:r[1]},S(s)&&"POST"===o.__sentry_xhr__.method&&s.match(/sentry_key/)&&(o.__sentry_own_request__=!0);var a=function(){if(4===o.readyState){try{o.__sentry_xhr__&&(o.__sentry_xhr__.status_code=o.status)}catch(t){}try{var n=t.indexOf(o);if(-1!==n){t.splice(n);var i=e.splice(n)[0];o.__sentry_xhr__&&void 0!==i[0]&&(o.__sentry_xhr__.body=i[0])}}catch(t){}Oe("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:o})}};return"onreadystatechange"in o&&"function"==typeof o.onreadystatechange?et(o,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a(),t.apply(o,e)}})):o.addEventListener("readystatechange",a),n.apply(o,r)}})),et(n,"send",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.push(this),e.push(r),Oe("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}();break;case"fetch":!function(){if(!function(){if(!Bt())return!1;var t=(0,I.VZ)();if(qt(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=qt(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){V.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}())return;et(Ee,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:je(e),url:Pe(e)},startTimestamp:Date.now()};return Oe("fetch",W({},r)),t.apply(Ee,e).then((function(t){return Oe("fetch",W(W({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw Oe("fetch",W(W({},r),{endTimestamp:Date.now(),error:t})),t}))}}))}();break;case"history":!function(){if(t=(0,I.VZ)(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState,n||!r)return;var t,e,n,r;var i=Ee.onpopstate;function o(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var i=we,o=String(r);we=o,Oe("history",{from:i,to:o})}return t.apply(this,e)}}Ee.onpopstate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ee.location.href,r=we;if(we=n,Oe("history",{from:r,to:n}),i)return i.apply(this,t)},et(Ee.history,"pushState",o),et(Ee.history,"replaceState",o)}();break;case"error":Me=Ee.onerror,Ee.onerror=function(t,e,n,r,i){return Oe("error",{column:r,error:i,line:n,msg:t,url:e}),!!Me&&Me.apply(this,arguments)};break;case"unhandledrejection":Ue=Ee.onunhandledrejection,Ee.onunhandledrejection=function(t){return Oe("unhandledrejection",t),!Ue||Ue.apply(this,arguments)};break;default:V.warn("unknown instrumentation type:",t)}}function Ce(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(xe[t.type]=xe[t.type]||[],xe[t.type].push(t.callback),Te(t.type))}function Oe(t,e){var n,r;if(t&&xe[t])try{for(var i=H(xe[t]||[]),o=i.next();!o.done;o=i.next()){var s=o.value;try{s(e)}catch(e){V.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+Z(s)+"\nError: "+e)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function je(t){return void 0===t&&(t=[]),"Request"in Ee&&C(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function Pe(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in Ee&&C(t[0],Request)?t[0].url:String(t[0])}var Re,Ie,De=1e3,Le=0;function Ne(t,e,n){return void 0===n&&(n=!1),function(r){Re=void 0,r&&Ie!==r&&(Ie=r,Le&&clearTimeout(Le),n?Le=setTimeout((function(){e({event:r,name:t})})):e({event:r,name:t}))}}function Ae(t){return function(e){var n;try{n=e.target}catch(t){return}var r=n&&n.tagName;r&&("INPUT"===r||"TEXTAREA"===r||n.isContentEditable)&&(Re||Ne("input",t)(e),clearTimeout(Re),Re=setTimeout((function(){Re=void 0}),De))}}var Me=null;var Ue=null;var Fe=function(){function t(e){this.name=t.id,this._options=xt({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return t.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&ft().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,I.$X)(t)},{event:t})},t.prototype.setupOnce=function(){var t=this;this._options.console&&Ce({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._consoleBreadcrumb.apply(t,Ct(e))},type:"console"}),this._options.dom&&Ce({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._domBreadcrumb.apply(t,Ct(e))},type:"dom"}),this._options.xhr&&Ce({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._xhrBreadcrumb.apply(t,Ct(e))},type:"xhr"}),this._options.fetch&&Ce({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._fetchBreadcrumb.apply(t,Ct(e))},type:"fetch"}),this._options.history&&Ce({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._historyBreadcrumb.apply(t,Ct(e))},type:"history"})},t.prototype._consoleBreadcrumb=function(t){var e={category:"console",data:{arguments:t.args,logger:"console"},level:Ut.fromString(t.level),message:Q(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message="Assertion failed: "+(Q(t.args.slice(1)," ")||"console.assert"),e.data.arguments=t.args.slice(1)}ft().addBreadcrumb(e,{input:t.args,level:t.level})},t.prototype._domBreadcrumb=function(t){var e;try{e=t.event.target?J(t.event.target):J(t.event)}catch(t){e="<unknown>"}0!==e.length&&ft().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name})},t.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},n=e.method,r=e.url,i=e.status_code,o=e.body;ft().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:t.xhr,input:o})}else;},t.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method||(t.error?ft().addBreadcrumb({category:"fetch",data:t.fetchData,level:Ut.Error,type:"http"},{data:t.error,input:t.args}):ft().addBreadcrumb({category:"fetch",data:xt(xt({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},t.prototype._historyBreadcrumb=function(t){var e=(0,I.VZ)(),n=t.from,r=t.to,i=(0,I.Dl)(e.location.href),o=(0,I.Dl)(n),s=(0,I.Dl)(r);o.path||(o=i),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),ft().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},t.id="Breadcrumbs",t}(),$e="5.30.0",Ve=function(t){function e(e){return void 0===e&&(e={}),t.call(this,fe,e)||this}return Et(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),(0,I.VZ)().document&&(this._isEnabled()?Se(xt(xt({},t),{dsn:t.dsn||this.getDsn()})):V.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype._prepareEvent=function(e,n,r){return e.platform=e.platform||"javascript",e.sdk=xt(xt({},e.sdk),{name:"sentry.javascript.browser",packages:Ct(e.sdk&&e.sdk.packages||[],[{name:"npm:@sentry/browser",version:$e}]),version:$e}),t.prototype._prepareEvent.call(this,e,n,r)},e.prototype._sendEvent=function(e){var n=this.getIntegration(Fe);n&&n.addSentryBreadcrumb(e),t.prototype._sendEvent.call(this,e)},e}(Mt),Be=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],qe=function(){function t(e){this.name=t.id,this._options=xt({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=(0,I.VZ)();(this._options.setTimeout&&et(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&et(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&et(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&et(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:Be).forEach(this._wrapEventTarget.bind(this))},t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=be(r,{mechanism:{data:{function:Z(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t.call(this,be(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Z(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=(0,I.VZ)(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(et(n,"addEventListener",(function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=be(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:Z(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,be(r,{mechanism:{data:{function:"addEventListener",handler:Z(r),target:t},handled:!0,type:"instrument"}}),i)}})),et(n,"removeEventListener",(function(t){return function(e,n,r){var i,o=n;try{var s=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;s&&t.call(this,e,s,r)}catch(t){}return t.call(this,e,o,r)}})))},t.prototype._wrapXHR=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((function(t){t in r&&"function"==typeof r[t]&&et(r,t,(function(e){var n={mechanism:{data:{function:t,handler:Z(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=Z(e.__sentry_original__)),be(e,n)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),We=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=xt({onerror:!0,onunhandledrejection:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(V.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(V.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},t.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(Ce({callback:function(n){var r=n.error,i=ft(),o=i.getIntegration(t),s=r&&!0===r.__sentry_own_request__;if(o&&!_e()&&!s){var a=i.getClient(),c=w(r)?e._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):e._enhanceEventWithInitialFrame(ie(r,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);(0,I.M6)(c,{handled:!1,type:"onerror"}),i.captureEvent(c,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(Ce({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(t){}var i=ft(),o=i.getIntegration(t),s=r&&!0===r.__sentry_own_request__;if(!o||_e()||s)return!0;var a=i.getClient(),c=w(r)?e._eventFromRejectionWithPrimitive(r):ie(r,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!0});c.level=Ut.Error,(0,I.M6)(c,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(c,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},t.prototype._eventFromIncompleteOnError=function(t,e,n,r){var i,o=_(t)?t.message:t;if(S(o)){var s=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);s&&(i=s[1],o=s[2])}var a={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(a,e,n,r)},t.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},t.prototype._enhanceEventWithInitialFrame=function(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(r,10))?void 0:r,o=isNaN(parseInt(n,10))?void 0:n,s=S(e)&&e.length>0?e:(0,I.$N)();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:i,filename:s,function:"?",in_app:!0,lineno:o}),t},t.id="GlobalHandlers",t}(),He=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){N((function(e,n){var r=ft().getIntegration(t);return r?r._handler(e,n):e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&C(e.originalException,Error)))return t;var n=this._walkErrorTree(e.originalException,this._key);return t.exception.values=Ct(n,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,n){if(void 0===n&&(n=[]),!C(t[e],Error)||n.length+1>=this._limit)return n;var r=ee(Kt(t[e]));return this._walkErrorTree(t[e],e,Ct([r],n))},t.id="LinkedErrors",t}(),Ge=(0,I.VZ)(),Je=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){N((function(e){var n,r,i;if(ft().getIntegration(t)){if(!Ge.navigator&&!Ge.location&&!Ge.document)return e;var o=(null===(n=e.request)||void 0===n?void 0:n.url)||(null===(r=Ge.location)||void 0===r?void 0:r.href),s=(Ge.document||{}).referrer,a=(Ge.navigator||{}).userAgent,c=xt(xt(xt({},null===(i=e.request)||void 0===i?void 0:i.headers),s&&{Referer:s}),a&&{"User-Agent":a}),u=xt(xt({},o&&{url:o}),{headers:c});return xt(xt({},e),{request:u})}return e}))},t.id="UserAgent",t}(),Ye=[new bt,new St,new qe,new Fe,new We,new He,new Je];function Xe(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Ye),void 0===t.release){var e=(0,I.VZ)();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!1),function(t,e){!0===e.debug&&V.enable();var n=ft(),r=new t(e);n.bindClient(r)}(Ve,t),t.autoSessionTracking&&function(){var t=(0,I.VZ)(),e=ft(),n="complete"===document.readyState,r=!1,i=function(){r&&n&&e.endSession()},o=function(){n=!0,i(),t.removeEventListener("load",o)};e.startSession(),n||t.addEventListener("load",o);try{var s=new PerformanceObserver((function(t,e){t.getEntries().forEach((function(t){"first-contentful-paint"===t.name&&t.startTime<a&&(e.disconnect(),r=!0,i())}))})),a="hidden"===document.visibilityState?0:1/0;document.addEventListener("visibilitychange",(function(t){a=Math.min(a,t.timeStamp)}),{once:!0}),s.observe({type:"paint",buffered:!0})}catch(t){r=!0,i()}}()}const ze="fail",Ze="play",Ke="debug",Qe="streaming",tn="initializing",en="stopped",nn="pause",rn="stalled",on="waiting",sn="playing",an="undefined"!=typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection),cn=("undefined"!=typeof window&&(window.RTCIceCandidate||window.mozRTCIceCandidate||window.RTCIceCandidate),"undefined"!=typeof window&&(window.RTCSessionDescription||window.mozRTCSessionDescription||window.RTCSessionDescription));var un=n(974),ln=n.n(un),dn=n(942),pn=n.n(dn);let hn="";const fn=(...t)=>(console.log(...t),hn+=`${JSON.stringify(t)}\n`,hn),vn=()=>{};class yn{constructor(t,e={},n=!1){this.url=t,this.emitter=new(ln()),this.notify=this.emitter.emit.bind(this.emitter),this.log=n?fn:vn,this.isFirstMsgReceived=!1,this.retryMax=e.retryMax||1,this.retryDelay=e.retryDelay||3e3,this.retryCounter=this.retryMax,this.stopRetryTimeout=null,this.connectionTimeout=null}static get version(){try{return"24.7.1"}catch(t){return""}}destroy(){clearTimeout(this.stopRetryTimeout),clearTimeout(this.connectionTimeout),pn()(this.emitter),"function"==typeof this.onDestroy&&this.onDestroy()}stopRetry(t){this.isFirstMsgReceived=!1,this.retryCounter-=1,this.retryCounter>0?(clearTimeout(this.stopRetryTimeout),this.stopRetryTimeout=setTimeout(t.bind(this),this.retryDelay)):this.stop()}stop(){this.shouldImplementError("stop")}retryCounterReset(){this.retryCounter=this.retryMax}on(...t){return this.emitter.on.apply(this.emitter,t)}shouldImplementError(t){return()=>{throw new Error(`Custom ${t} method should be implemented for WebRTCBase descendants`)}}getVideoCardInfo(){const t="undefined"!=typeof document&&document.createElement("canvas").getContext("webgl");if(!t)return"";const e=t.getExtension("WEBGL_debug_renderer_info");return e?t.getParameter(e.UNMASKED_RENDERER_WEBGL):"no WEBGL_debug_renderer_info"}}function mn(){let t=(new Date).getTime(),e="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(n=>{let r=16*Math.random();return t>0?(r=(t+r)%16|0,t=Math.floor(t/16)):(r=(e+r)%16|0,e=Math.floor(e/16)),("x"===n?r:3&r|8).toString(16)}))}function gn(t,e,n={},r){console.debug(">onnegotiationneeded");const i=t.target;return new Promise(((t,o)=>{i.createOffer(n).then((n=>{i.setLocalDescription(n).then((()=>{(function(t,e){const n=performance.now(),r=new Promise((e=>{setTimeout((()=>{e(t.localDescription)}),250),t.onicegatheringstatechange=n=>"complete"===t.iceGatheringState&&e(t.localDescription)}));!0===e&&r.then((()=>{console.debug("ice gather blocked for N ms:",Math.ceil(performance.now()-n))}));return r})(i,!0).then((n=>{const s=performance.now();console.debug("sending N line offer:",n.sdp.split(/\r\n|\r|\n/).length);const a={method:"POST",headers:{"Content-Type":"application/sdp"}};"string"==typeof r&&(a.headers.Authorization=`Bearer ${r}`),a.body=n.sdp;fetch(e,a).then((e=>{201===e.status&&e.text().then((n=>{console.debug("got N line answer:",n.split(/\r\n|\r|\n/).length),i.signalingState&&"closed"!==i.signalingState&&i.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n})).then((()=>{const n=e.headers;t(n.get("X-Sid"))})).catch((t=>{o(t)}))}))})).catch((t=>{o(t)}));const c=(performance.now()-s)/1e3,u=new CustomEvent("downtime-msg",{detail:{status:-1,numsec:c}});i.dispatchEvent(u)}))}))}))}))}function _n(t){const e=t.target;console.debug(">iceconnectionstatechange",e.iceConnectionState),"failed"===e.iceConnectionState&&(console.debug("*** restarting ice"),e.restartIce())}const bn=["sdp"];class Sn extends yn{constructor(t,e,n={},r=!1){if(super(e,n,r),!(t instanceof HTMLMediaElement))throw new Error("First argument must be html5 video tag");if(this.remoteVideo=t,this.remoteVideo.addEventListener("play",this.onVideoPlay.bind(this)),this.opts=n,"start_track"in n){if("string"!=typeof n.start_track)throw new Error("start_track must be string");this.start_track=n.start_track}if("videoDisabled"in n&&n.videoDisabled?this.opts.videoDisabled=!0:this.opts.videoDisabled=!1,"audioDisabled"in n&&n.audioDisabled){if(this.opts.videoDisabled)throw new Error("You must enable at least one transceiver");this.opts.audioDisabled=!0}else this.opts.audioDisabled=!1;n.autoplay&&this.play(),n.sentryConfig&&n.sentryConfig.length&&(this.sentryConfig=n.sentryConfig),n.onMediaInfo&&(this.onMediaInfo=n.onMediaInfo),n.onTrackInfo&&(this.onTrackInfo=n.onTrackInfo),this.abr=!1,this.onEventCallback=n.onEvent,this.statsSendEnable=n.statsSendEnable||!0,this.statsSendTime=1e3*n.statsSendTime||6e4}resetStats(){this.playerStatsObject={proto:"webrtc",user_agent:navigator.userAgent,bytes:0,application:{application_name:"webrtc_player",application_version:yn.version?yn.version:null,stall_count:0,pause_count:0,error_count:0,reconnect_count:0,bitrate_change_count:0,live_duration:0,stall_duration:0,pause_duration:0,total_video_frames:0,dropped_video_frames:0,corrupted_video_frames:0}},(this.statsSendEnable||this.opts.statsSendEnable)&&this.startSendStats()}onDestroy(){this.stop(),this.remoteVideo.removeEventListener("play",this.onVideoPlay)}createPeerConnection(t={},e=""){this.log("Player::createPeerConnection"),this.remotePc=new an(t),this.remotePc.stream_id="remote1",this.opts.videoDisabled||this.remotePc.addTransceiver("video",{direction:"sendrecv"}),this.opts.audioDisabled||this.remotePc.addTransceiver("audio",{direction:"sendrecv"}),this.remotePc.addEventListener("iceconnectionstatechange",_n),this.remotePc.addEventListener("negotiationneeded",(t=>{gn(t,e,{offerToReceiveAudio:!this.opts.audioDisabled,offerToReceiveVideo:!this.opts.videoDisabled}).then((t=>{this.xsid=t})).catch((t=>{this.log("handleNegotiationNeeded",t),this.addPlayerStat("error_count"),this.addPlayerStat("reconnect_count"),this.stopRetry(this.play)}))})),this.remotePc.ontrack=this.gotRemoteTrack.bind(this),this.remotePc.onconnectionstatechange=()=>{this.remotePc&&(this.log("Player::peer connection state:",this.remotePc.connectionState),"closed"===this.remotePc.connectionState||"disconnected"===this.remotePc.connectionState?(this.stop(),this.notify(ze,"peer_connection_closed")):"failed"===this.remotePc.connectionState&&this.stopRetry(this.play))},this.remotePc.ondatachannel=t=>{console.debug("!!! ice candidate on data channel:",t)},this.remotePc.oniceconnectionstatechange=t=>{this.remotePc&&(this.log("Player::ice connection change:",t,{iceConnectionState:this.remotePc.iceConnectionState}),"failed"===this.remotePc.iceConnectionState?(this.stopRetry(this.play),this.notify(ze,"ice_connection_fail")):"closed"!==this.remotePc.iceConnectionState&&"disconnected"!==this.remotePc.iceConnectionState&&void 0!==this.remotePc.iceConnectionState||(this.notify(ze,"ice_connection_closed"),this.stopRetry(this.play)),this.notify(Ke,["ICE connection state",this.remotePc&&this.remotePc.iceConnectionState]))},this.remotePc.onicegatheringstatechange=t=>{this.log("Player::ice gathering state",this.remotePc.iceGatheringState,t)},this.progressListener||this.startProgressListener()}getUrl(){const t=new URL(this.url);return t.pathname=`${t.pathname}/whep`,t.search=this.opts.authTokenName&&this.opts.tokenValue?`?${this.opts.authTokenName}=${this.opts.tokenValue}`:"",this.start_track&&(t.search+=`${this.opts.authTokenName&&this.opts.tokenValue?"&":"?"}start_track=${this.start_track}`),t.toString()}play(){this.log("Player::play"),this.remotePc&&this.stop(),this.resetStats(),this.uuid=mn(),this.playerStatsObject.id=this.uuid,this.playerStatsObject.opened_at=Date.now(),this.stopRetryTimeout&&clearTimeout(this.stopRetryTimeout),this.addListeners();const t=this.getUrl();this.createPeerConnection({bundlePolicy:"max-bundle"},t),this.getMediaInfo(),this.sentryConfig&&(Xe({dsn:this.sentryConfig,environment:"production",release:"FlussonicWebrtcPlayer"+(yn.version?`@${yn.version}`:""),tracesSampleRate:1}),this.sentryEnabled=!0)}stop(){if(this.isFirstMsgReceived=!1,this.retryCounterReset(),this.remotePc&&(this.remotePc.onconnectionstatechange=null,this.remotePc.ondatachannel=null,this.remotePc.onicecandidate=null,this.remotePc.onicecandidateerror=null,this.remotePc.oniceconnectionstatechange=null,this.remotePc.onicegatheringstatechange=null,this.remotePc.onremovestream=null,this.remotePc.ontrack=null,this.remotePc.close(),delete this.remotePc),this.stallingStarted){clearTimeout(this.probablyStalled);const t=this.playerStatsObject.application;if(t){let e=t.stall_duration;e+=Date.now()-this.stallingStarted,this.addPlayerStat("stall_duration",!1,e),delete this.stallingStarted}}delete this.frameWidth,this.playerStatsObject.closed_at=Date.now(),this.stopSendStats(),this.removeListeners(),this.progressListener&&(clearInterval(this.progressListener),delete this.progressListener);try{this.remoteVideo.srcObject=null}catch(t){this.remoteVideo.src=null}}gotRemoteTrack(t){if(this.log("remote track",t),"video"===t.track.kind||"audio"===t.track.kind)try{if(this.remoteVideo.srcObject!==t.streams[0]){const n=t.streams,r=e(n,1)[0];this.remoteVideo.srcObject=r}}catch(e){this.sentryEnabled&&me(e),this.addPlayerStat("error_count"),"undefined"!=typeof window&&(this.remoteVideo.src=window.URL.createObjectURL(t.streams[0]))}}getSessionDescription(t){let e=t.sdp,n=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,bn);return new cn(l({},n,{sdp:e.replace(/profile-level-id=(\d|A|B|C|D|E|F)+;/,"profile-level-id=42E01F;")}))}remoteCreateAnswer(){return this.log("Player::success adding offer"),this.remotePc.createAnswer()}remoteSetLocalDescription(t){var e=this;return s((function*(){e.log("Player::now have answer",t.sdp);return yield e.remotePc.setLocalDescription(t)}))()}onDescriptionError(t){this.sentryEnabled&&me(t),this.notify(Ke,["failed to set remote answer",t]),this.notify(ze,"set_remote_description_failed")}onVideoPlay(){this.notify(Ze)}onGetMediaInfo(){if(this.onMediaInfo&&this.onMediaInfo(this.mediaInfoTracks,this.abr),this.mediaInfoTracks.length){let t=!1,e=!1;if(this.mediaInfoTracks.forEach((n=>{if(t&&e)return;const r=n.content;"video"===r&&(t=!0),"audio"===r&&(e=!0)})),t||(this.opts.videoDisabled=!0),!e){if(this.opts.videoDisabled)throw this.stop(),new Error("You have got no video and no audio transceiver");this.opts.audioDisabled=!0}}return this.mediaInfoTracks}onPlayingInfo(t){this.onTrackInfo&&(this.addPlayerStat("bitrate_change_count"),this.onTrackInfo(t))}changeTracks(t){Array.isArray(t)?("auto"===t[0]?this.trackSwitch([]):this.trackSwitch(t),this.addPlayerStat("bitrate_change_count")):console.error("tracks must be an array")}getMediaInfo(){fetch(`${this.url}/media_info.json${this.getAuthToken()}`,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then((t=>t.json())).then((t=>{this.mediaInfoTracks=t.tracks,this.onGetMediaInfo()})).catch((t=>{this.log("get MediaInfo error:",t),this.addPlayerStat("error_count"),this.addPlayerStat("reconnect_count"),this.stopRetry(this.play)}))}trackSwitch(t){fetch(`${this.url}/sessions/${this.xsid?this.xsid:""}/request_tracks${this.getAuthToken()}`,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"PUT",body:JSON.stringify({tracks:t})}).then((t=>{this.log("trackSwitch",t)})).catch((t=>{this.log("track switch error:",t)}))}onEvent(t){const e=t.type,n=this.playerStatsObject.application;switch(e){case"playing":if(this.playerStatsObject.started_at||(this.playerStatsObject.started_at=Date.now(),this.playerStatsObject.updated_at=Date.now()),this.playbackSegmentStart=Date.now(),this.pauseStarted&&n){let t=n.pause_duration;t+=Date.now()-this.pauseStarted,this.addPlayerStat("pause_duration",!1,t),delete this.pauseStarted}this.progressListener||this.startProgressListener();break;case"pause":this.playerStatsObject.started_at&&(this.addPlayerStat("pause_count"),this.pauseStarted=Date.now()),this.progressListener&&(clearInterval(this.progressListener),delete this.progressListener);break;case"stalled":this.playerStatsObject.started_at&&(this.addPlayerStat("stall_count"),this.stallingStarted=Date.now()),this.progressListener&&(clearInterval(this.progressListener),delete this.progressListener)}this.onEventCallback&&this.onEventCallback(t)}startProgressListener(){this.progressListener=setInterval((()=>{this.remotePc&&this.remotePc.getStats(null).then((t=>{t.forEach((t=>{if("transport"===t.type){const e=t.bytesReceived,n=t.timestamp;if(this.playerStatsObject.bytes=e,this.playerStatsObject.updated_at=Math.round(n),this.playbackSegmentStart){const t=this.playerStatsObject.application;if(t){let e=t.live_duration;e+=Date.now()-this.playbackSegmentStart,this.addPlayerStat("live_duration",!1,e),delete this.playbackSegmentStart}}this.playbackSegmentStart=n}else if("track"===t.type&&"kind"in t&&"video"===t.kind){if(t.frameWidth&&t.frameWidth>0&&(this.frameWidth?this.frameWidth!==t.frameWidth&&(this.addPlayerStat("bitrate_change_count"),this.frameWidth=t.frameWidth):this.frameWidth=t.frameWidth),t.framesReceived===this.playerStatsObject.application.total_video_frames){const t=()=>{this.stallingStarted||(this.addPlayerStat("stall_count"),this.stallingStarted=Date.now())};this.probablyStalled=setTimeout(t,500)}else{clearTimeout(this.probablyStalled);const t=this.playerStatsObject.application;if(this.stallingStarted&&t){let e=t.stall_duration;e+=Date.now()-this.stallingStarted,this.addPlayerStat("stall_duration",!1,e),delete this.stallingStarted}}const e=this.remoteVideo.getVideoPlaybackQuality().corruptedVideoFrames;this.addPlayerStat("total_video_frames",!1,t.framesReceived),this.addPlayerStat("dropped_video_frames",!1,t.framesDropped),this.addPlayerStat("corrupted_video_frames",!1,e)}}))}))}),1e3)}addListeners(){this.remoteVideo.addEventListener(rn,this.onEvent.bind(this),!0),this.remoteVideo.addEventListener(sn,this.onEvent.bind(this),!0),this.remoteVideo.addEventListener(on,this.onEvent.bind(this),!0),this.remoteVideo.addEventListener(nn,this.onEvent.bind(this),!0)}removeListeners(){this.remoteVideo.removeEventListener(rn,this.onEvent,!0),this.remoteVideo.removeEventListener(sn,this.onEvent,!0),this.remoteVideo.removeEventListener(on,this.onEvent,!0),this.remoteVideo.removeEventListener(nn,this.onEvent,!0)}addPlayerStat(t,e=!0,n=null){const r=this.playerStatsObject.application;r&&(n?r[t]=Math.round(n):e&&(r[t]+=1),this.playerStatsObject.application=r)}getStats(){return this.xsid&&(this.playerStatsObject.source_id=this.xsid),l({},this.playerStatsObject,{id:this.uuid})}startSendStats(){this.sendingInterval=setInterval((()=>{this.postStats()}),this.statsSendTime||6e4)}stopSendStats(){this.sendingInterval&&(clearInterval(this.sendingInterval),this.postStats())}getStatsUrl(){return`${this.url}/sessions/${this.xsid?this.xsid:""}${this.getAuthToken()}`}getAuthToken(){return this.opts.authTokenName&&this.opts.tokenValue?`?${this.opts.authTokenName}=${this.opts.tokenValue}`:""}postStats(){this.playerStatsObject.started_at&&fetch(this.getStatsUrl(),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"PUT",body:JSON.stringify(this.getStats())}).then((()=>{})).catch((t=>{this.log("Stat send error:",t)}))}}"undefined"!=typeof window&&(window._isGetUserMediaCalled=!!window._isGetUserMediaCalled);class wn extends yn{constructor(t,e={},n=!1){super(t,e,n);const r=this;this.status=tn,this.opts=e,e.preview&&e.preview instanceof HTMLMediaElement&&(this.videoContainer=e.preview,e.previewOptions&&(this.videoContainer.autoplay=!1!==e.previewOptions.autoplay,this.videoContainer.controls=e.previewOptions.controls||!1,this.videoContainer.muted=!1!==e.previewOptions.muted),this.videoContainer.addEventListener("loadedmetadata",(function(){r.log(`Local video videoWidth: ${this.videoWidth}px, videoHeight: ${this.videoHeight}px`)}))),"maxBitrate"in e&&(this.maxBitrate=e.maxBitrate),"canvasCallback"in e&&"function"==typeof e.canvasCallback&&(this.canvasCallback=e.canvasCallback,this.forCanvasCallback="undefined"!=typeof document&&document.createElement("canvas"),this.forCanvasCallback.id="forCanvasCallback",this.forCanvasCallback.style.width="320px",this.videoContainer?(this.videoContainer.after(this.forCanvasCallback),this.videoContainer.style.display="none"):"undefined"!=typeof document&&document.body.appendChild(this.forCanvasCallback),this.canvasCallback(this.forCanvasCallback),this.publishStreamFromCanvas=this.forCanvasCallback.captureStream()),e.sentryConfig&&e.sentryConfig.length&&(this.sentryConfig=e.sentryConfig),this.opts.radeonCheck=!("radeonCheck"in e)||e.radeonCheck,this.trackStats=e.trackStats,this.statsContainer=e.statsContainer,this.password=e.password,this.constraints=e.constraints,this.returnCapabilities=e.returnCapabilities;const i=("undefined"!=typeof window&&window.navigator).userAgent;this.onEventCallback=e.onEvent,this.statsSendEnable=e.statsSendEnable||!0,this.statsSendTime=1e3*e.statsSendTime||6e4;const o="undefined"!=typeof window&&window.RTCRtpTransceiver&&"setCodecPreferences"in window.RTCRtpTransceiver.prototype;if(this.prefferedCodec=-1,i.includes("Chrome/95")&&RTCRtpSender&&o){RTCRtpSender.getCapabilities("video").codecs.forEach(((t,e)=>{"video/H264"===t.mimeType&&t.sdpFmtpLine&&(t.sdpFmtpLine.includes("profile-level-id=42e01f")&&t.sdpFmtpLine.includes("level-asymmetry-allowed=1")?(t.sdpFmtpLine.includes("packetization-mode=0")||t.sdpFmtpLine.includes("packetization-mode=1")&&-1===this.prefferedCodec)&&(this.prefferedCodec=e):t.sdpFmtpLine.includes("profile-level-id=42001f")&&t.sdpFmtpLine.includes("level-asymmetry-allowed=1")&&t.sdpFmtpLine.includes("packetization-mode=0")&&-1===this.prefferedCodec&&(this.prefferedCodec=e))}))}if(this.opts.radeonCheck){const t=this.getVideoCardInfo();this.log("Checking for GPU model:",t),t.length&&t.includes("AMD Radeon(TM) Graphics")&&RTCRtpSender&&o&&(this.log("Detected AMD Radeon(TM) Graphics"),this.prefferedCodec=5)}}resetStats(){this.playerStatsObject={proto:"webrtc",user_agent:navigator.userAgent,bytes:0,application:{application_name:"webrtc_publisher",application_version:yn.version?yn.version:null,stall_count:0,pause_count:0,error_count:0,reconnect_count:0,bitrate_change_count:0,live_duration:0,stall_duration:0,pause_duration:0,total_video_frames:0,dropped_video_frames:0,corrupted_video_frames:0}},this.statsSendEnable&&this.startSendStats()}getUrl(){const t=new URL(this.url);return t.protocol="https",t.pathname+="/whip",this.opts.authTokenName&&this.opts.tokenValue?this.password?t.search=`?${this.opts.authTokenName}=${this.opts.tokenValue}&password=${this.password}`:t.search=`?${this.opts.authTokenName}=${this.opts.tokenValue}`:this.password&&(t.search=`?password=${this.password}`),t.toString()}start(){this.resetStats(),this.uuid=mn(),this.playerStatsObject.opened_at=Date.now();const t=this.getUrl();this.peerConnection=new an,this.peerConnection.addEventListener("iceconnectionstatechange",_n),this.peerConnection.addEventListener("negotiationneeded",(e=>{const n=new Headers;n.append("X-Sid",this.uuid),gn(e,t,{},n).then((t=>{if(this.xsid=t,this.playerStatsObject.started_at=Date.now(),this.onEventCallback&&this.onEventCallback({type:"started",started_at:Date.now()}),this.playerStatsObject.updated_at=Date.now(),this.emitter.emit(Qe),this.videoSender){const t=this.videoSender.sender,e=t.getParameters();this.log("Publisher::maxBitrate is set to:",this.maxBitrate||1e8),e.encodings[0].maxBitrate=this.maxBitrate||1e8,e.encodings[0].priority="medium",e.encodings[0].networkPriority="medium",t.setParameters(e)}this.progressListener||this.startProgressListener()}))})),this.getMedia(this.opts?this.opts.getMediaOptions:null),this.startTrackStats(),this.createSilentAudio(10,44100),this.sentryConfig&&(Xe({dsn:this.sentryConfig,environment:"production",release:"FlussonicWebrtcPublisher"+(yn.version?`@${yn.version}`:""),tracesSampleRate:1}),this.sentryEnabled=!0)}stop(){this.isFirstMsgReceived=!1,this.clearLocalStreamSource(),this.forCanvasCallback&&(this.forCanvasCallback.remove(),this.videoContainer&&(this.videoContainer.style.display="block")),this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null),this.status=en,this.playerStatsObject.closed_at=Date.now(),this.onEventCallback&&this.onEventCallback({type:"closed",closed_at:Date.now()}),this.stopSendStats(),this.progressListener&&(clearInterval(this.progressListener),delete this.progressListener),this.restartTimeout&&(clearInterval(this.restartTimeout),delete this.restartTimeout),this.trackStatsInterval&&(clearInterval(this.trackStatsInterval),delete this.trackStatsInterval),this.sharingStream&&(this.sharingStream.getTracks().forEach((t=>t.stop())),this.sharingStream=null)}startTrackStats(){this.trackStats&&(this.trackStatsInterval=window.setInterval((()=>{this.peerConnection&&this.peerConnection.getStats(null).then((t=>{let e="";if(t.forEach((t=>{e+=`<h2>Report: ${t.type}</h3>\n<strong>ID:</strong> ${t.id}<br>\n<strong>Timestamp:</strong> ${t.timestamp}<br>\n`,Object.keys(t).forEach((n=>{"id"!==n&&"timestamp"!==n&&"type"!==n&&(e+=`<strong>${n}:</strong> ${t[n]}<br>\n`)}))})),this.statsContainer){const t=this.statsContainer;t instanceof HTMLElement&&(t.innerHTML=e)}}))}),1e3))}clearLocalStreamSource(){this.stream&&this.stream.getTracks().forEach((t=>{t.stop()}))}getMedia(t,e){let n=l({},this.constraints);"video"in n||(n=l({},n,{video:!0})),this.opts.inputStreams?this.gotMedia(this.opts.inputStreams):this.getDevices().then((t=>{this.activeDeviceList=t;this.activeDeviceList.filter((t=>"audioinput"===t.kind)).length||(n.audio=!1),navigator.mediaDevices.getUserMedia(n).then((t=>{"undefined"!=typeof window&&(window._isGetUserMediaCalled=!0),this.log("Publisher::mediaDevices.getUserMedia success."),"function"==typeof e?e((()=>{this.log("Publisher::getMedia::cb"),this.gotMedia(t)})):this.gotMedia(t),this.videoContainer&&(this.videoContainer.srcObject=this.stream)})).catch((t=>{this.log("Publisher::mediaDevices.getUserMedia exception occured.",t),this.opts&&this.opts.onGetUserMediaError&&this.opts.onGetUserMediaError(t),this.sendErrorLog()}))}));const r=()=>{this.dummyVideo=this.createDummyVideo("dummyVideo"),this.dummyVideo.srcObject=this.stream,this.dummyVideo.addEventListener("loadedmetadata",this.updateCanvasSize.bind(this),!1),this.dummyVideo.addEventListener("play",(()=>{requestAnimationFrame(this.updateCanvas.bind(this))}),!1)};this.forCanvasCallback&&(r(),this.canvasCallbackContext=this.forCanvasCallback.getContext("2d")),navigator.mediaDevices.ondevicechange=this.onDeviceChange.bind(this)}updateCanvasSize(){this.forCanvasCallback.width=this.dummyVideo.videoWidth,this.forCanvasCallback.height=this.dummyVideo.videoHeight}updateCanvas(){this.dummyVideo.ended||this.dummyVideo.paused||(this.forCanvasCallback&&this.canvasCallbackContext&&this.canvasCallbackContext.drawImage(this.dummyVideo,0,0,this.dummyVideo.videoWidth,this.dummyVideo.videoHeight),requestAnimationFrame(this.updateCanvas.bind(this)))}getDevices(){var t=this;return s((function*(){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return void t.log("enumerateDevices() not supported.");let e=[];yield navigator.mediaDevices.enumerateDevices().then((t=>(e=t,e))).catch((e=>{t.log("Publisher::mediaDevices.getUserMedia exception occured.",e),t.opts&&t.opts.onGetUserMediaError&&t.opts.onGetUserMediaError(e),t.sendErrorLog()}));const n=e.filter((t=>"audioinput"===t.kind||"videoinput"===t.kind));return t.log("Publisher:: Devices list ",n),e}))()}onDeviceChange(t){this.addPlayerStat("bitrate_change_count"),this.log("Publisher::Device configuration changed",t);let e=[];this.getDevices.bind(this),this.getDevices().then((t=>{if(e=t.filter((t=>"audioinput"===t.kind)),this.audioSender&&this.audioSender.sender){if(e.length)0!==e.length&&(this.log("Publisher::New audio input device discovered"),navigator.mediaDevices.getUserMedia({audio:!0}).then((t=>{const e=t.getAudioTracks();e.length>0&&(this.log(`Using audio device: ${e[0].label}`),this.audioSender.sender.replaceTrack(e[0]))})));else{this.log("Publisher::Audio input devices lost");const t=this.destination.stream.getAudioTracks();this.audioSender.sender.replaceTrack(t[0])}this.activeDeviceList=t}}))}gotMedia(t){this.stream=t,this.log("Publisher::got",this.stream),this.log("Publisher::gotMedia::peerConnection",this.peerConnection);let n=!1;if("video"in this.constraints&&(n=this.constraints.video),this.publishStreamFromCanvas){const t=e(this.publishStreamFromCanvas.getVideoTracks(),1)[0];this.videoTrack=t,this.videoSender=this.peerConnection.addTransceiver(this.videoTrack,{direction:"sendonly"})}else if(n){const n=e(t.getVideoTracks(),1)[0];this.videoTrack=n,this.videoTrack.contentHint="detail",this.videoTrack.applyConstraints({frameRate:{min:0,max:30}}),this.videoSender=this.peerConnection.addTransceiver(this.videoTrack,{direction:"sendonly"})}let r=t.getAudioTracks();if(r&&r.length>0&&(this.audioSender=this.peerConnection.addTransceiver(t.getAudioTracks()[0],{direction:"sendonly"})),-1!==this.prefferedCodec){let t=RTCRtpSender.getCapabilities("video").codecs;const e=t[this.prefferedCodec];this.log("Publisher preffered codec:",this.prefferedCodec,e),t=[e];this.peerConnection.getTransceivers().find((t=>t.sender&&t.sender.track===this.videoTrack)).setCodecPreferences(t)}this.peerConnection.onconnectionstatechange=t=>{this.log("Publisher::peer connection state",this.peerConnection.connectionState,t),this.onEventCallback&&this.onEventCallback({type:"connection state",connection:this.peerConnection.connectionState})}}restart(){this.addPlayerStat("reconnect_count"),this.stop(),this.restartTimeout=setTimeout(this.start.bind(this),1e3)}mute(){this.stream.getTracks().forEach((t=>{"audio"===t.kind&&(t.enabled=!t.enabled)}))}switchTrack(t){if(t instanceof MediaStreamTrack){if("video"===t.kind){if(!this.videoSender||!this.videoSender.sender)return;this.videoSender.sender.replaceTrack(t)}else{if(!this.audioSender||!this.audioSender.sender)return;this.audioSender.sender.replaceTrack(t)}}else console.info("Publisher only get stream tracks to switch RTCRtpTransceiver sender")}shareScreen(){if(this.sharingStream){if(!this.videoSender||!this.videoSender.sender)return;this.videoSender.sender.replaceTrack(this.videoTrack),this.videoContainer.srcObject=this.stream,this.sharingStream.getTracks().forEach((t=>t.stop())),this.sharingStream=null}else{const t={video:{cursor:"always"},audio:!1};navigator.mediaDevices.getDisplayMedia(t).then((t=>{this.log("Publisher:: screen sharing stream acquired"),this.sharingStream=t,this.videoContainer.srcObject=t;const n=e(this.sharingStream.getVideoTracks(),1)[0];this.sharingScreen=n})).catch((t=>{this.log("Publisher:: screen sharing error",t)}))}}createSilentAudio(t,e=44100){const n=t*e,r="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext||window.mozAudioContext);r||this.log("No Audio Context");const i=new r,o=i.createBuffer(1,n,e);this.destination=i.createMediaStreamDestination(),this.silentSource=i.createBufferSource(),this.silentSource.buffer=o,this.silentSource.connect(i.destination),this.silentSource.loop=!0,this.silentSource.start(),this.silentSource.connect(this.destination)}sendErrorLog(t){this.sentryEnabled&&me(t)}createDummyVideo(t){const e="undefined"!=typeof document&&document.createElement("video");return"undefined"!=typeof document&&document.querySelector("body").appendChild(e),e.setAttribute("id",t),e.setAttribute("autoplay",!0),e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex="-1",e.style.opacity=0,e.style.width="1px",e.style.height="1px",e.style.overflow="hidden",e.muted=!0,e}startProgressListener(){this.progressListener=setInterval((()=>{this.peerConnection&&this.peerConnection.getStats(null).then((t=>{const e=[];t.forEach((t=>{if(e.push({type:t.type,id:t.id,timestamp:t.timestamp}),"transport"===t.type){const e=t.timestamp,n=t.bytesSent;if(this.playerStatsObject.bytes=n,this.playerStatsObject.updated_at=Math.round(e),this.playbackSegmentStart){const t=this.playerStatsObject.application;if(t){let n=t.live_duration;n+=e-this.playbackSegmentStart,this.addPlayerStat("live_duration",Math.round(n)),delete this.playbackSegmentStart}}this.playbackSegmentStart=e}}))}))}),1e3)}addPlayerStat(t,e=null){const n=this.playerStatsObject.application;n&&(e?n[t]=Math.round(e):n[t]+=1,this.playerStatsObject.application=n)}getStats(){return l({},this.playerStatsObject,{id:this.uuid})}startSendStats(){this.sendingInterval=setInterval((()=>{this.postStats()}),this.statsSendTime)}stopSendStats(){this.sendingInterval&&(clearInterval(this.sendingInterval),this.postStats())}getStatsUrl(){const t=this.opts.authTokenName&&this.opts.tokenValue?`?${this.opts.authTokenName}=${this.opts.tokenValue}`:"";return`${this.url}/sessions/${this.xsid?this.xsid:""}${t}`}postStats(){this.playerStatsObject.started_at&&fetch(this.getStatsUrl(),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"PUT",body:JSON.stringify(this.getStats())})}userIsChangingTracks(t,e){console.log("userIsChangingTracks",{e:t,data:e})}on(...t){return this.emitter.on.apply(this.emitter,t)}}function En(t){try{return JSON.parse(t)}catch(t){return{}}}const xn=(t,e,n,r)=>{const i=En(e),o=t.authTokenName||i.authTokenName||"token",s=t[o]||i[o]||"",a=Number(t.statsSendTime)||Number(i.statsSendTime)||60;return{retryMax:100,retryDelay:3e3,sentryConfig:t.sentryConfig||i.statsSendTime,onMediaInfo:n,onTrackInfo:r,statsSendEnable:!0,statsSendTime:a,autoplay:!0,authTokenName:o,tokenValue:s,radeonCheck:!0,inputStreams:window.stream||null,constraints:{video:!0,audio:!0}}},kn=(t,e)=>{const n=En(e),r=t.host||window.location.hostname,i=t.name||n.streamName;if(!i||i.length<1||"string"!=typeof i){const t=window.location;return`${t.origin}${t.pathname.replace("/embed.html","")}`}return`${r.includes("https")||r.includes("http")?"":`${window.location.protocol}//`}${r}${window.location.port&&!t.ignorePort?`:${window.location.port}`:""}/${i}`},Tn=(t="")=>{const e=i.parse(window.location.search),n=document.getElementById("abrInfo");let r={},o={};const s=document.getElementById("webrtc_player");s.muted=!(e.mute&&"false"===e.mute),window.webrtcPlayer=new Sn(s,kn(e,t),xn(e,t,(t=>{r={},o={},t.forEach((t=>{const e=t.content;if(e&&e.length)if("audio"===e){const e=t.track_id,n=t.sample_rate;r[e]=`${n} kbps`}else if("video"===e){const e=t.track_id,n=t.params;if(n){const t=n.width,r=void 0===t?"":t,i=n.height,s=void 0===i?"":i;o[e]=`${r} x ${s}`}else o[e]="0 x 0"}}))}),(t=>{const e=t.audio_track_id,i=t.video_track_id;let s="",a="";i&&(s=o[i]||""),e&&(a=r[e]||""),n.innerText=`Auto bitrate set on ${s}${a?` with ${a} audio`:""}`,n.style.opacity="1",setTimeout((()=>{n.style.opacity="0"}),3e3)})),!0)},Cn=()=>{document.getElementById("publish_button").disabled=!0},On=(t="")=>{const e=i.parse(window.location.search),n=new wn(kn(e,t),xn(e,t),!0);n.on(Qe,Cn),window.webrtcPublisher=n,n.start()};function jn(t){return window.stream=t,document.getElementById("webrtc_player").srcObject=t,navigator.mediaDevices.enumerateDevices()}function Pn(t){console.log("navigator.MediaDevices.getUserMedia error: ",t.message,t.name)}const Rn=(t=!0)=>{const n=()=>document.getElementById("cam_button"),r=()=>document.getElementById("mic_button");if("stream"in window){const i=window.stream;let o=e(i.getVideoTracks(),1)[0];if(!t)o=e(i.getAudioTracks(),1)[0];o.enabled?(o.enabled=!1,t?n().classList.add("off"):r().classList.add("off")):(o.enabled=!0,t?n().classList.remove("off"):r().classList.remove("off"))}},In=()=>{const t=e(document.getElementsByClassName("app"),1)[0],n=document.createElement("div");n.id="webrtc_publish_button_wrapper",t.appendChild(n);const r=document.createElement("button");r.id="publish_button",r.classList.add("webrtc_btn"),r.innerText="Publish",n.appendChild(r);const i=document.createElement("button");i.id="cam_button",i.classList.add("webrtc_btn"),i.innerText="Cam",n.appendChild(i);const o=document.createElement("button");o.id="mic_button",o.classList.add("webrtc_btn"),o.innerText="Mic",n.appendChild(o),navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(jn).catch(Pn),r.addEventListener("click",On),i.addEventListener("click",Rn),o.addEventListener("click",(()=>{Rn(!1)}))}})(),r})())); //# sourceMappingURL=main.js.map
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings