UNPKG

lib-jitsi-meet-dist

Version:

It's the library of [Jitsi Meet API](https://github.com/jitsi/lib-jitsi-meet) that contains two core file: `external_api.min.js`、`lib-jitsi-meet.min.js`

2 lines (1 loc) 29.2 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JitsiMeetExternalAPI=t():e.JitsiMeetExternalAPI=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/libs/",n(n.s=9)}([function(e,t,n){var r=n(3),i=n(11),o={},a=[],s=r.levels.TRACE;e.exports={addGlobalTransport:function(e){r.addGlobalTransport(e)},removeGlobalTransport:function(e){r.removeGlobalTransport(e)},getLogger:function(e,t,n){var i=new r(s,e,t,n);return e?(o[e]=o[e]||[],o[e].push(i)):a.push(i),i},setLogLevelById:function(e,t){for(var n=t?o[t]||[]:a,r=0;r<n.length;r++)n[r].setLevel(e)},setLogLevel:function(e){s=e;for(var t=0;t<a.length;t++)a[t].setLevel(e);for(var n in o){var r=o[n]||[];for(t=0;t<r.length;t++)r[t].setLevel(e)}},levels:r.levels,LogCollector:i}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return f});var r=n(0).getLogger(e),i="org.jitsi.meet:",o="(//[^/?#]+)",a="([^?#]*)",s="^([a-z][a-z0-9\\.\\+-]*:)";function c(e){var t=new RegExp("".concat(s,"+"),"gi"),n=t.exec(e);if(n){var r=n[n.length-1].toLowerCase();"http:"!==r&&"https:"!==r&&(r="https:"),(e=e.substring(t.lastIndex)).startsWith("//")&&(e=r+e)}return e}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];for(var n in e)try{t.push("".concat(n,"=").concat(encodeURIComponent(JSON.stringify(e[n]))))}catch(e){r.warn("Error encoding ".concat(n,": ").concat(e))}return t}function u(e){var t,n,r,i={toString:h};if(e=e.replace(/\s/g,""),(n=(t=new RegExp(s,"gi")).exec(e))&&(i.protocol=n[1].toLowerCase(),e=e.substring(t.lastIndex)),n=(t=new RegExp("^".concat(o),"gi")).exec(e)){var c=n[1].substring(2);e=e.substring(t.lastIndex);var l=c.indexOf("@");-1!==l&&(c=c.substring(l+1)),i.host=c;var u=c.lastIndexOf(":");-1!==u&&(i.port=c.substring(u+1),c=c.substring(0,u)),i.hostname=c}if((n=(t=new RegExp("^".concat(a),"gi")).exec(e))&&(r=n[1],e=e.substring(t.lastIndex)),r?r.startsWith("/")||(r="/".concat(r)):r="/",i.pathname=r,e.startsWith("?")){var f=e.indexOf("#",1);-1===f&&(f=e.length),i.search=e.substring(0,f),e=e.substring(f)}else i.search="";return i.hash=e.startsWith("#")?e:"",i}function h(e){var t=e||this,n=t.hash,r=t.host,i=t.pathname,o=t.protocol,a=t.search,s="";return o&&(s+=o),r&&(s+="//".concat(r)),s+=i||"/",a&&(s+=a),n&&(s+=n),s}function f(e){var t=u(c(e.serverURL&&e.room?new URL(e.room,e.serverURL).toString():e.room?e.room:e.url||""));if(!t.protocol){var n=e.protocol||e.scheme;n&&(n.endsWith(":")||(n+=":"),t.protocol=n)}var r=t.pathname;if(!t.host){var o=e.domain||e.host||e.hostname;if(o){var a=u(c("".concat(i,"//").concat(o))),s=a.host,h=a.hostname,f=a.pathname,d=a.port;s&&(t.host=s,t.hostname=h,t.port=d),"/"===r&&"/"!==f&&(r=f)}}var p=e.roomName||e.room;!p||!t.pathname.endsWith("/")&&t.pathname.endsWith("/".concat(p))||(r.endsWith("/")||(r+="/"),r+=p),t.pathname=r;var v=e.jwt;if(v){var g=t.search;-1===g.indexOf("?jwt=")&&-1===g.indexOf("&jwt=")&&(g.startsWith("?")||(g="?".concat(g)),1===g.length||(g+="&"),g+="jwt=".concat(v),t.search=g)}for(var m=t.hash,y=["config","interfaceConfig"],b=0;b<y.length;b++){var _=y[b],w=l(e["".concat(_,"Overwrite")]||e[_]||e["".concat(_,"Override")]);if(w.length){var L="".concat(_,".").concat(w.join("&".concat(_,".")));m.length?L="&".concat(L):m="#",m+=L}}return t.hash=m,t.toString()||void 0}}).call(this,"react/features/base/util/uri.js")},function(e,t,n){"use strict";var r=n(4);n(5);n(1);var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hash",i="search"===n?e.search:e.hash,o={},a=i&&i.substr(1).split("&")||[];if("hash"===n&&1===a.length){var s=a[0];if(s.startsWith("/")&&1===s.split("&").length)return o}return a.forEach(function(e){var n=e.split("="),i=n[0];if(i){var a;try{a=n[1],t||(a=JSON.parse(decodeURIComponent(a).replace(/\\&/,"&")))}catch(e){return void Object(r.b)(e,"Failed to parse URL parameter value: ".concat(String(a)))}o[i]=a}}),o}(window.location).jitsi_meet_external_api_id,o=n(7),a=n.n(o);function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u={window:window.opener||window.parent},h=["avatar-url","display-name","email","toggle-audio","toggle-chat","toggle-film-strip","toggle-share-screen","toggle-video","video-hangup"],f=["display-name-change","incoming-message","outgoing-message","participant-joined","participant-left","video-conference-joined","video-conference-left","video-ready-to-close"],d="message",p=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.enableLegacyFormat,i=n.postisOptions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.postis=a()(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){c(e,t,n[t])})}return e}({},u,i)),this._enableLegacyFormat=r,this._enableLegacyFormat&&h.forEach(function(e){return t.postis.listen(e,function(n){return t._legacyMessageReceivedCallback(e,n)})}),this._receiveCallback=function(){},this.postis.listen(d,function(e){return t._receiveCallback(e)})}var t,n,r;return t=e,(n=[{key:"_legacyMessageReceivedCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._receiveCallback({data:{name:e,data:t}})}},{key:"_sendLegacyMessage",value:function(e){var t=e.name,n=s(e,["name"]);t&&-1!==f.indexOf(t)&&this.postis.send({method:t,params:n})}},{key:"dispose",value:function(){this.postis.destroy()}},{key:"send",value:function(e){this.postis.send({method:d,params:e}),this._enableLegacyFormat&&this._sendLegacyMessage(e.data||{})}},{key:"setReceiveCallback",value:function(e){this._receiveCallback=e}}])&&l(t.prototype,n),r&&l(t,r),e}();function v(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var m=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).backend;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners=new Map,this._requestID=0,this._responseHandlers=new Map,this._unprocessedMessages=new Set,this.addListener=this.on,t&&this.setBackend(t)}var t,n,r;return t=e,(n=[{key:"_disposeBackend",value:function(){this._backend&&(this._backend.dispose(),this._backend=null)}},{key:"_onMessageReceived",value:function(e){var t=this;if("response"===e.type){var n=this._responseHandlers.get(e.id);n&&(n(e),this._responseHandlers.delete(e.id))}else"request"===e.type?this.emit("request",e.data,function(n,r){t._backend.send({type:"response",error:r,id:e.id,result:n})}):this.emit("event",e.data)}},{key:"dispose",value:function(){this._responseHandlers.clear(),this._unprocessedMessages.clear(),this.removeAllListeners(),this._disposeBackend()}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=this._listeners.get(e),o=!1;return i&&i.size&&i.forEach(function(e){o=e.apply(void 0,n)||o}),o||this._unprocessedMessages.add(n),o}},{key:"on",value:function(e,t){var n=this,r=this._listeners.get(e);return r||(r=new Set,this._listeners.set(e,r)),r.add(t),this._unprocessedMessages.forEach(function(e){t.apply(void 0,v(e))&&n._unprocessedMessages.delete(e)}),this}},{key:"removeAllListeners",value:function(e){return e?this._listeners.delete(e):this._listeners.clear(),this}},{key:"removeListener",value:function(e,t){var n=this._listeners.get(e);return n&&n.delete(t),this}},{key:"sendEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._backend&&this._backend.send({type:"event",data:e})}},{key:"sendRequest",value:function(e){var t=this;if(!this._backend)return Promise.reject(new Error("No transport backend defined!"));this._requestID++;var n=this._requestID;return new Promise(function(r,i){t._responseHandlers.set(n,function(e){var t=e.error,n=e.result;void 0!==n?r(n):i(void 0!==t?t:new Error("Unexpected response format!"))}),t._backend.send({type:"request",data:e,id:n})})}},{key:"setBackend",value:function(e){this._disposeBackend(),this._backend=e,this._backend.setReceiveCallback(this._onMessageReceived.bind(this))}}])&&g(t.prototype,n),r&&g(t,r),e}();n.d(t,"a",function(){return p}),n.d(t,"b",function(){return m});var y,b={};"number"==typeof i&&(b.scope="jitsi_meet_external_api_".concat(i)),Object(r.a)().setExternalTransportBackend=function(e){return y.setBackend(e)}},function(e,t){var n={trace:0,debug:1,info:2,log:3,warn:4,error:5};o.consoleTransport=console;var r=[o.consoleTransport];function i(){var e=arguments[0],t=arguments[1],i=Array.prototype.slice.call(arguments,2);if(!(n[t]<e.level))for(var o=function(){var e={methodName:"",fileLocation:"",line:null,column:null},t=new Error,n=t.stack?t.stack.split("\n"):[];if(!n||n.length<1)return e;var r=null;return n[3]&&(r=n[3].match(/\s*at\s*(.+?)\s*\((\S*)\s*:(\d*)\s*:(\d*)\)/)),!r||r.length<=4?(0===n[2].indexOf("log@")?e.methodName=n[3].substr(0,n[3].indexOf("@")):e.methodName=n[2].substr(0,n[2].indexOf("@")),e):(e.methodName=r[1],e.fileLocation=r[2],e.line=r[3],e.column=r[4],e)}(),a=r.concat(e.transports),s=0;s<a.length;s++){var c=a[s],l=c[t];l&&"function"==typeof l&&l.bind(c,e.id?"["+e.id+"]":"","<"+o.methodName+">: ").apply(c,i)}}function o(e,t,r,o){this.id=t,this.format=o,this.transports=r,this.transports||(this.transports=[]),this.level=n[e];for(var a=Object.keys(n),s=0;s<a.length;s++)this[a[s]]=i.bind(null,this,a[s])}o.addGlobalTransport=function(e){-1===r.indexOf(e)&&r.push(e)},o.removeGlobalTransport=function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)},o.prototype.setLevel=function(e){this.level=n[e]},e.exports=o,o.levels={TRACE:"trace",DEBUG:"debug",INFO:"info",LOG:"log",WARN:"warn",ERROR:"error"}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n(0).getLogger(e);function i(){return window.JitsiMeetJS||(window.JitsiMeetJS={}),window.JitsiMeetJS.app||(window.JitsiMeetJS.app={}),window.JitsiMeetJS.app}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";r.error(t,e),window.onerror&&window.onerror(t,null,null,null,e)}}).call(this,"react/features/base/util/helpers.js")},function(e,t,n){"use strict";(function(e){n(0).getLogger(e)}).call(this,"react/features/base/util/httpUtils.js")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,a,s,c,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(o(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(i(n))for(s=Array.prototype.slice.call(arguments,1),a=(l=n.slice()).length,c=0;c<a;c++)l[c].apply(this,s);return!0},n.prototype.addListener=function(e,t){var a;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(a=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t){e.exports=function(e){var t,n=e.scope,r=e.window,i=e.windowForEventListening||window,o={},a=[],s={},c=!1,l=function(e){var t;try{t=JSON.parse(e.data)}catch(e){return}if(t.postis&&t.scope===n){var r=o[t.method];if(r)for(var i=0;i<r.length;i++)r[i].call(null,t.params);else s[t.method]=s[t.method]||[],s[t.method].push(t.params)}};i.addEventListener("message",l,!1);var u={listen:function(e,t){o[e]=o[e]||[],o[e].push(t);var n=s[e];if(n)for(var r=o[e],i=0;i<r.length;i++)for(var a=0;a<n.length;a++)r[i].call(null,n[a]);delete s[e]},send:function(e){var t=e.method;(c||"__ready__"===e.method)&&r&&"function"==typeof r.postMessage?r.postMessage(JSON.stringify({postis:!0,scope:n,method:t,params:e.params}),"*"):a.push(e)},ready:function(e){c?e():setTimeout(function(){u.ready(e)},50)},destroy:function(e){clearInterval(t),c=!1,i&&"function"==typeof i.removeEventListener&&i.removeEventListener("message",l),e&&e()}},h=+new Date+Math.random()+"";return t=setInterval(function(){u.send({method:"__ready__",params:h})},50),u.listen("__ready__",function(e){if(e===h){clearInterval(t),c=!0;for(var n=0;n<a.length;n++)u.send(a[n]);a=[]}else u.send({method:"__ready__",params:e})}),u}},function(e){e.exports={"google-auth":{matchPatterns:{url:"accounts.google.com"},target:"electron"},"dropbox-auth":{matchPatterns:{url:"dropbox.com/oauth2/authorize"},target:"electron"}}},function(e,t,n){e.exports=n(10).default},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"default",function(){return O});var r=n(6),i=n.n(r),o=n(1),a=n(2),s=n(8);function c(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=n(0).getLogger(e),m=["css/all.css","libs/alwaysontop.min.js"],y={avatarUrl:"avatar-url",displayName:"display-name",email:"email",hangup:"video-hangup",subject:"subject",submitFeedback:"submit-feedback",toggleAudio:"toggle-audio",toggleChat:"toggle-chat",toggleFilmStrip:"toggle-film-strip",toggleShareScreen:"toggle-share-screen",toggleVideo:"toggle-video"},b={"avatar-changed":"avatarChanged","audio-availability-changed":"audioAvailabilityChanged","audio-mute-status-changed":"audioMuteStatusChanged","display-name-change":"displayNameChange","email-change":"emailChange","feedback-submitted":"feedbackSubmitted","feedback-prompt-displayed":"feedbackPromptDisplayed","filmstrip-display-changed":"filmstripDisplayChanged","incoming-message":"incomingMessage","outgoing-message":"outgoingMessage","participant-joined":"participantJoined","participant-left":"participantLeft","proxy-connection-event":"proxyConnectionEvent","video-ready-to-close":"readyToClose","video-conference-joined":"videoConferenceJoined","video-conference-left":"videoConferenceLeft","video-availability-changed":"videoAvailabilityChanged","video-mute-status-changed":"videoMuteStatusChanged","screen-sharing-status-changed":"screenSharingStatusChanged","subject-change":"subjectChange"},_=0;function w(e,t){e._numberOfParticipants+=t}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){v(e,t,n[t])})}return e}({},t,{url:"".concat(t.noSSL?"http":"https","://").concat(e,"/#jitsi_meet_external_api_id=").concat(_)}))}function k(e){var t;return"string"==typeof e&&null!==String(e).match(/([0-9]*\.?[0-9]+)(em|pt|px|%)$/)?t=e:"number"==typeof e&&(t="".concat(e,"px")),t}var O=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=u(this,h(t).call(this));for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var s=function(e){if(!e.length)return{};switch(p(e[0])){case"string":case void 0:var t=d(e,9);return{roomName:t[0],width:t[1],height:t[2],parentNode:t[3],configOverwrite:t[4],interfaceConfigOverwrite:t[5],noSSL:t[6],jwt:t[7],onload:t[8]};case"object":return e[0];default:throw new Error("Can't parse the arguments!")}}(i),c=s.roomName,l=void 0===c?"":c,f=s.width,v=void 0===f?"100%":f,g=s.height,m=void 0===g?"100%":g,y=s.parentNode,b=void 0===y?document.body:y,w=s.configOverwrite,k=void 0===w?{}:w,O=s.interfaceConfigOverwrite,j=void 0===O?{}:O,x=s.noSSL,E=void 0!==x&&x,S=s.jwt,C=void 0===S?void 0:S,I=s.onload,P=void 0===I?void 0:I,R=s.invitees;return n._parentNode=b,n._url=L(e,{configOverwrite:k,interfaceConfigOverwrite:j,jwt:C,noSSL:E,roomName:l}),n._createIFrame(m,v,P),n._transport=new a.b({backend:new a.a({postisOptions:{scope:"jitsi_meet_external_api_".concat(_),window:n._frame.contentWindow}})}),Array.isArray(R)&&R.length>0&&n.invite(R),n._isLargeVideoVisible=!0,n._numberOfParticipants=0,n._participants={},n._myUserID=void 0,n._onStageParticipant=void 0,n._setupListeners(),_++,n}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(t,i.a),n=t,(r=[{key:"_createIFrame",value:function(e,t,n){var r="jitsiConferenceFrame".concat(_);this._frame=document.createElement("iframe"),this._frame.allow="camera; microphone",this._frame.src=this._url,this._frame.name=r,this._frame.id=r,this._setSize(e,t),this._frame.setAttribute("allowFullScreen","true"),this._frame.style.border=0,n&&(this._frame.onload=n),this._frame=this._parentNode.appendChild(this._frame)}},{key:"_getAlwaysOnTopResources",value:function(){var e=this._frame.contentWindow,t=e.document,n="",r=t.querySelector("base");if(r&&r.href)n=r.href;else{var i=e.location,o=i.protocol,a=i.host;n="".concat(o,"//").concat(a)}return m.map(function(e){return new URL(e,n).href})}},{key:"_getOnStageParticipant",value:function(){return this._onStageParticipant}},{key:"_getLargeVideo",value:function(){var e=this.getIFrame();if(this._isLargeVideoVisible&&e&&e.contentWindow&&e.contentWindow.document)return e.contentWindow.document.getElementById("largeVideo")}},{key:"_setSize",value:function(e,t){var n=k(e),r=k(t);void 0!==n&&(this._frame.style.height=n),void 0!==r&&(this._frame.style.width=r)}},{key:"_setupListeners",value:function(){var e=this;this._transport.on("event",function(t){var n=t.name,r=c(t,["name"]),i=r.id;switch(n){case"video-conference-joined":e._myUserID=i,e._participants[i]={avatarURL:r.avatarURL};case"participant-joined":e._participants[i]=e._participants[i]||{},e._participants[i].displayName=r.displayName,e._participants[i].formattedDisplayName=r.formattedDisplayName,w(e,1);break;case"participant-left":w(e,-1),delete e._participants[i];break;case"display-name-change":var o=e._participants[i];o&&(o.displayName=r.displayname,o.formattedDisplayName=r.formattedDisplayName);break;case"email-change":var a=e._participants[i];a&&(a.email=r.email);break;case"avatar-changed":var s=e._participants[i];s&&(s.avatarURL=r.avatarURL);break;case"on-stage-participant-changed":e._onStageParticipant=i,e.emit("largeVideoChanged");break;case"large-video-visibility-changed":e._isLargeVideoVisible=r.isVisible,e.emit("largeVideoChanged");break;case"video-conference-left":w(e,-1),delete e._participants[e._myUserID]}var l=b[n];return!!l&&(e.emit(l,r),!0)})}},{key:"addEventListener",value:function(e,t){this.on(e,t)}},{key:"addEventListeners",value:function(e){for(var t in e)this.addEventListener(t,e[t])}},{key:"dispose",value:function(){this.emit("_willDispose"),this._transport.dispose(),this.removeAllListeners(),this._frame&&this._frame.parentNode.removeChild(this._frame)}},{key:"executeCommand",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e in y?this._transport.sendEvent({data:n,name:y[e]}):g.error("Not supported command name.")}},{key:"executeCommands",value:function(e){for(var t in e)this.executeCommand(t,e[t])}},{key:"isAudioAvailable",value:function(){return this._transport.sendRequest({name:"is-audio-available"})}},{key:"invite",value:function(e){return Array.isArray(e)&&0!==e.length?this._transport.sendRequest({name:"invite",invitees:e}):Promise.reject(new TypeError("Invalid Argument"))}},{key:"isAudioMuted",value:function(){return this._transport.sendRequest({name:"is-audio-muted"})}},{key:"getAvatarURL",value:function(e){return(this._participants[e]||{}).avatarURL}},{key:"getDisplayName",value:function(e){return(this._participants[e]||{}).displayName}},{key:"getEmail",value:function(e){return(this._participants[e]||{}).email}},{key:"_getFormattedDisplayName",value:function(e){return(this._participants[e]||{}).formattedDisplayName}},{key:"getIFrame",value:function(){return this._frame}},{key:"getNumberOfParticipants",value:function(){return this._numberOfParticipants}},{key:"isVideoAvailable",value:function(){return this._transport.sendRequest({name:"is-video-available"})}},{key:"isVideoMuted",value:function(){return this._transport.sendRequest({name:"is-video-muted"})}},{key:"removeEventListener",value:function(e){this.removeAllListeners(e)}},{key:"removeEventListeners",value:function(e){var t=this;e.forEach(function(e){return t.removeEventListener(e)})}},{key:"sendProxyConnectionEvent",value:function(e){this._transport.sendEvent({data:[e],name:"proxy-connection-event"})}},{key:"_getElectronPopupsConfig",value:function(){return Promise.resolve(s)}}])&&l(n.prototype,r),o&&l(n,o),t}()}.call(this,"modules/API/external/external_api.js")},function(e,t,n){var r=n(3);function i(e,t){this.logStorage=e,this.stringifyObjects=!(!t||!t.stringifyObjects)&&t.stringifyObjects,this.storeInterval=t&&t.storeInterval?t.storeInterval:3e4,this.maxEntryLength=t&&t.maxEntryLength?t.maxEntryLength:1e4,Object.keys(r.levels).forEach(function(e){this[r.levels[e]]=function(e){this._log.apply(this,arguments)}.bind(this,e)}.bind(this)),this.storeLogsIntervalID=null,this.queue=[],this.totalLen=0,this.outputCache=[]}i.prototype.stringify=function(e){try{return JSON.stringify(e)}catch(e){return"[object with circular refs?]"}},i.prototype.formatLogMessage=function(e){for(var t="",n=1,i=arguments.length;n<i;n++){var o=arguments[n];!this.stringifyObjects&&e!==r.levels.ERROR||"object"!=typeof o||(o=this.stringify(o)),t+=o,n!=i-1&&(t+=" ")}return t.length?t:null},i.prototype._log=function(){var e=this.formatLogMessage.apply(this,arguments);if(e){var t=this.queue.length?this.queue[this.queue.length-1]:void 0;("object"==typeof t?t.text:t)==e?"object"==typeof t?t.count+=1:this.queue[this.queue.length-1]={text:e,count:2}:(this.queue.push(e),this.totalLen+=e.length)}this.totalLen>=this.maxEntryLength&&this._flush(!0,!0)},i.prototype.start=function(){this._reschedulePublishInterval()},i.prototype._reschedulePublishInterval=function(){this.storeLogsIntervalID&&(window.clearTimeout(this.storeLogsIntervalID),this.storeLogsIntervalID=null),this.storeLogsIntervalID=window.setTimeout(this._flush.bind(this,!1,!0),this.storeInterval)},i.prototype.flush=function(){this._flush(!1,!0)},i.prototype._flush=function(e,t){this.totalLen>0&&(this.logStorage.isReady()||e)&&(this.logStorage.isReady()?(this.outputCache.length&&(this.outputCache.forEach(function(e){this.logStorage.storeLogs(e)}.bind(this)),this.outputCache=[]),this.logStorage.storeLogs(this.queue)):this.outputCache.push(this.queue),this.queue=[],this.totalLen=0),t&&this._reschedulePublishInterval()},i.prototype.stop=function(){this._flush(!1,!1)},e.exports=i}])});