@ohos-ports/genesys-cloud-streaming-client 20.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +47 -0
  2. package/dist/cjs/alerting-leader.d.ts +29 -0
  3. package/dist/cjs/alerting-leader.js +163 -0
  4. package/dist/cjs/client.d.ts +84 -0
  5. package/dist/cjs/client.js +680 -0
  6. package/dist/cjs/connection-manager.d.ts +18 -0
  7. package/dist/cjs/connection-manager.js +120 -0
  8. package/dist/cjs/connection-transfer.d.ts +7 -0
  9. package/dist/cjs/connection-transfer.js +20 -0
  10. package/dist/cjs/http-client.d.ts +18 -0
  11. package/dist/cjs/http-client.js +230 -0
  12. package/dist/cjs/index.d.ts +10 -0
  13. package/dist/cjs/index.js +31 -0
  14. package/dist/cjs/messenger.d.ts +37 -0
  15. package/dist/cjs/messenger.js +54 -0
  16. package/dist/cjs/notifications.d.ts +94 -0
  17. package/dist/cjs/notifications.js +495 -0
  18. package/dist/cjs/ping.d.ts +21 -0
  19. package/dist/cjs/ping.js +60 -0
  20. package/dist/cjs/polyfills.d.ts +0 -0
  21. package/dist/cjs/polyfills.js +6 -0
  22. package/dist/cjs/server-monitor.d.ts +16 -0
  23. package/dist/cjs/server-monitor.js +44 -0
  24. package/dist/cjs/stanza-definitions/webrtc-signaling.d.ts +29 -0
  25. package/dist/cjs/stanza-definitions/webrtc-signaling.js +113 -0
  26. package/dist/cjs/stanza-definitions/xep0051.d.ts +19 -0
  27. package/dist/cjs/stanza-definitions/xep0051.js +28 -0
  28. package/dist/cjs/stats-formatter.d.ts +6 -0
  29. package/dist/cjs/stats-formatter.js +63 -0
  30. package/dist/cjs/types/genesys-cloud-media-session.d.ts +64 -0
  31. package/dist/cjs/types/genesys-cloud-media-session.js +353 -0
  32. package/dist/cjs/types/interfaces.d.ts +310 -0
  33. package/dist/cjs/types/interfaces.js +22 -0
  34. package/dist/cjs/types/libs.d.ts +32 -0
  35. package/dist/cjs/types/libs.js +1 -0
  36. package/dist/cjs/types/media-session.d.ts +76 -0
  37. package/dist/cjs/types/media-session.js +2 -0
  38. package/dist/cjs/types/named-agent.d.ts +13 -0
  39. package/dist/cjs/types/named-agent.js +2 -0
  40. package/dist/cjs/types/offline-error.d.ts +2 -0
  41. package/dist/cjs/types/offline-error.js +5 -0
  42. package/dist/cjs/types/sasl-error.d.ts +8 -0
  43. package/dist/cjs/types/sasl-error.js +12 -0
  44. package/dist/cjs/types/stanza-media-session.d.ts +56 -0
  45. package/dist/cjs/types/stanza-media-session.js +255 -0
  46. package/dist/cjs/types/streaming-client-extension.d.ts +14 -0
  47. package/dist/cjs/types/streaming-client-extension.js +2 -0
  48. package/dist/cjs/types/timeout-error.d.ts +3 -0
  49. package/dist/cjs/types/timeout-error.js +9 -0
  50. package/dist/cjs/types/user-cancelled-error.d.ts +2 -0
  51. package/dist/cjs/types/user-cancelled-error.js +5 -0
  52. package/dist/cjs/utils.d.ts +34 -0
  53. package/dist/cjs/utils.js +202 -0
  54. package/dist/cjs/webrtc.d.ts +126 -0
  55. package/dist/cjs/webrtc.js +891 -0
  56. package/dist/deploy-info.json +21 -0
  57. package/dist/es/alerting-leader.d.ts +29 -0
  58. package/dist/es/alerting-leader.js +177 -0
  59. package/dist/es/client.d.ts +84 -0
  60. package/dist/es/client.js +699 -0
  61. package/dist/es/connection-manager.d.ts +18 -0
  62. package/dist/es/connection-manager.js +124 -0
  63. package/dist/es/connection-transfer.d.ts +7 -0
  64. package/dist/es/connection-transfer.js +16 -0
  65. package/dist/es/http-client.d.ts +18 -0
  66. package/dist/es/http-client.js +194 -0
  67. package/dist/es/index.bundle.js +39629 -0
  68. package/dist/es/index.d.ts +10 -0
  69. package/dist/es/index.js +10 -0
  70. package/dist/es/messenger.d.ts +37 -0
  71. package/dist/es/messenger.js +62 -0
  72. package/dist/es/notifications.d.ts +94 -0
  73. package/dist/es/notifications.js +507 -0
  74. package/dist/es/ping.d.ts +21 -0
  75. package/dist/es/ping.js +68 -0
  76. package/dist/es/polyfills.d.ts +0 -0
  77. package/dist/es/polyfills.js +6 -0
  78. package/dist/es/server-monitor.d.ts +16 -0
  79. package/dist/es/server-monitor.js +41 -0
  80. package/dist/es/stanza-definitions/webrtc-signaling.d.ts +29 -0
  81. package/dist/es/stanza-definitions/webrtc-signaling.js +110 -0
  82. package/dist/es/stanza-definitions/xep0051.d.ts +19 -0
  83. package/dist/es/stanza-definitions/xep0051.js +25 -0
  84. package/dist/es/stats-formatter.d.ts +6 -0
  85. package/dist/es/stats-formatter.js +54 -0
  86. package/dist/es/types/genesys-cloud-media-session.d.ts +64 -0
  87. package/dist/es/types/genesys-cloud-media-session.js +379 -0
  88. package/dist/es/types/interfaces.d.ts +310 -0
  89. package/dist/es/types/interfaces.js +19 -0
  90. package/dist/es/types/libs.d.ts +32 -0
  91. package/dist/es/types/libs.js +1 -0
  92. package/dist/es/types/media-session.d.ts +76 -0
  93. package/dist/es/types/media-session.js +1 -0
  94. package/dist/es/types/named-agent.d.ts +13 -0
  95. package/dist/es/types/named-agent.js +1 -0
  96. package/dist/es/types/offline-error.d.ts +2 -0
  97. package/dist/es/types/offline-error.js +2 -0
  98. package/dist/es/types/sasl-error.d.ts +8 -0
  99. package/dist/es/types/sasl-error.js +9 -0
  100. package/dist/es/types/stanza-media-session.d.ts +56 -0
  101. package/dist/es/types/stanza-media-session.js +264 -0
  102. package/dist/es/types/streaming-client-extension.d.ts +14 -0
  103. package/dist/es/types/streaming-client-extension.js +1 -0
  104. package/dist/es/types/timeout-error.d.ts +3 -0
  105. package/dist/es/types/timeout-error.js +5 -0
  106. package/dist/es/types/user-cancelled-error.d.ts +2 -0
  107. package/dist/es/types/user-cancelled-error.js +2 -0
  108. package/dist/es/utils.d.ts +34 -0
  109. package/dist/es/utils.js +192 -0
  110. package/dist/es/webrtc.d.ts +126 -0
  111. package/dist/es/webrtc.js +917 -0
  112. package/dist/manifest.json +19 -0
  113. package/dist/npm/CHANGELOG.md +637 -0
  114. package/dist/npm/README.md +47 -0
  115. package/dist/npm/alerting-leader.d.ts +29 -0
  116. package/dist/npm/alerting-leader.js +163 -0
  117. package/dist/npm/client.d.ts +84 -0
  118. package/dist/npm/client.js +680 -0
  119. package/dist/npm/connection-manager.d.ts +18 -0
  120. package/dist/npm/connection-manager.js +120 -0
  121. package/dist/npm/connection-transfer.d.ts +7 -0
  122. package/dist/npm/connection-transfer.js +20 -0
  123. package/dist/npm/http-client.d.ts +18 -0
  124. package/dist/npm/http-client.js +230 -0
  125. package/dist/npm/index.d.ts +10 -0
  126. package/dist/npm/index.js +31 -0
  127. package/dist/npm/messenger.d.ts +37 -0
  128. package/dist/npm/messenger.js +54 -0
  129. package/dist/npm/module.js +10 -0
  130. package/dist/npm/notifications.d.ts +94 -0
  131. package/dist/npm/notifications.js +495 -0
  132. package/dist/npm/ping.d.ts +21 -0
  133. package/dist/npm/ping.js +60 -0
  134. package/dist/npm/polyfills.d.ts +0 -0
  135. package/dist/npm/polyfills.js +6 -0
  136. package/dist/npm/server-monitor.d.ts +16 -0
  137. package/dist/npm/server-monitor.js +44 -0
  138. package/dist/npm/stanza-definitions/webrtc-signaling.d.ts +29 -0
  139. package/dist/npm/stanza-definitions/webrtc-signaling.js +113 -0
  140. package/dist/npm/stanza-definitions/xep0051.d.ts +19 -0
  141. package/dist/npm/stanza-definitions/xep0051.js +28 -0
  142. package/dist/npm/stats-formatter.d.ts +6 -0
  143. package/dist/npm/stats-formatter.js +63 -0
  144. package/dist/npm/types/genesys-cloud-media-session.d.ts +64 -0
  145. package/dist/npm/types/genesys-cloud-media-session.js +353 -0
  146. package/dist/npm/types/interfaces.d.ts +310 -0
  147. package/dist/npm/types/interfaces.js +22 -0
  148. package/dist/npm/types/libs.d.ts +32 -0
  149. package/dist/npm/types/libs.js +1 -0
  150. package/dist/npm/types/media-session.d.ts +76 -0
  151. package/dist/npm/types/media-session.js +2 -0
  152. package/dist/npm/types/named-agent.d.ts +13 -0
  153. package/dist/npm/types/named-agent.js +2 -0
  154. package/dist/npm/types/offline-error.d.ts +2 -0
  155. package/dist/npm/types/offline-error.js +5 -0
  156. package/dist/npm/types/sasl-error.d.ts +8 -0
  157. package/dist/npm/types/sasl-error.js +12 -0
  158. package/dist/npm/types/stanza-media-session.d.ts +56 -0
  159. package/dist/npm/types/stanza-media-session.js +255 -0
  160. package/dist/npm/types/streaming-client-extension.d.ts +14 -0
  161. package/dist/npm/types/streaming-client-extension.js +2 -0
  162. package/dist/npm/types/timeout-error.d.ts +3 -0
  163. package/dist/npm/types/timeout-error.js +9 -0
  164. package/dist/npm/types/user-cancelled-error.d.ts +2 -0
  165. package/dist/npm/types/user-cancelled-error.js +5 -0
  166. package/dist/npm/utils.d.ts +34 -0
  167. package/dist/npm/utils.js +207 -0
  168. package/dist/npm/webrtc.d.ts +126 -0
  169. package/dist/npm/webrtc.js +893 -0
  170. package/dist/streaming-client.browser.js +2 -0
  171. package/dist/streaming-client.browser.js.LICENSE.txt +12 -0
  172. package/dist/v20/streaming-client.browser.js +2 -0
  173. package/dist/v20/streaming-client.browser.js.LICENSE.txt +12 -0
  174. package/dist/v20.1.0/streaming-client.browser.js +2 -0
  175. package/dist/v20.1.0/streaming-client.browser.js.LICENSE.txt +12 -0
  176. package/package.json +132 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see streaming-client.browser.js.LICENSE.txt */
2
+ (()=>{var e={5065(e,t,n){"use strict";var r=n(4579),i=n(7383);Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionTransfer=void 0;var a=n(1491),o=r(function e(t,n){i(this,e),this.client=t,this.stanzaInstance=n,n.stanzas.define(a.connectionTransfer),n.on("iq:set:connectionTransfer",function(e){t.logger.warn("connection transfer (socket_closing) event received",{stanzaInstanceId:n.id,channelId:n.channelId}),t.disconnect(),t.emit("disconnected",{reconnecting:!0}),t.connect({keepTryingOnFailure:!0})})});t.ConnectionTransfer=o},3761(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579);Object.defineProperty(t,"__esModule",{value:!0}),t.Ping=void 0;var s=function(){return o(function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a(this,e),this.client=t,this.stanzaInstance=n,this.options=r,this.pingInterval=r.pingInterval||14e3,this.failedPingsBeforeDisconnect=r.failedPingsBeforeDisconnect||1,this.numberOfFailedPings=0,this.nextPingTimeoutId=void 0,this.start()},[{key:"start",value:function(){this.nextPingTimeoutId||(this.nextPingTimeoutId=-1,this.queueNextPing())}},{key:"stop",value:function(){clearTimeout(this.nextPingTimeoutId),this.nextPingTimeoutId=void 0,this.numberOfFailedPings=0}},{key:"performPing",value:(e=i(r.mark(function e(){var t,n,i;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,this.stanzaInstance.ping(this.options.jid);case 1:this.numberOfFailedPings=0,this.queueNextPing(),e.next=3;break;case 2:e.prev=2,i=e.catch(0),n={channelId:this.client.config.channelId,jid:this.stanzaInstance.jid,stanzaInstanceId:this.stanzaInstance.id},this.client.logger.warn("Missed a ping.",Object.assign({error:i},n)),++this.numberOfFailedPings>this.failedPingsBeforeDisconnect?(this.client.logger.error("Missed too many pings, disconnecting",Object.assign({numberOfFailedPings:this.numberOfFailedPings},n)),this.stanzaInstance.sendStreamError({text:"too many missed pongs",condition:"connection-timeout"}),this.stop(),null===(t=this.stanzaInstance.transport)||void 0===t||t.disconnect(!1)):this.queueNextPing();case 3:case"end":return e.stop()}},e,this,[[0,2]])})),function(){return e.apply(this,arguments)})},{key:"queueNextPing",value:function(){this.nextPingTimeoutId&&(this.nextPingTimeoutId=setTimeout(this.performPing.bind(this),this.pingInterval))}}]);var e}();t.Ping=s},925(e,t,n){"use strict";var r=n(7383),i=n(4579);Object.defineProperty(t,"__esModule",{value:!0}),t.ServerMonitor=void 0;var a=function(){return i(function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),this.client=t,this.stanzaInstance=n,this.stanzaTimeout=i.stanzaTimeout||35e3,this.timeoutId=void 0,this.start()},[{key:"start",value:function(){this.boundSetupStanzaTimeout=this.setupStanzaTimeout.bind(this),this.client.on("connected",this.boundSetupStanzaTimeout),this.stanzaInstance.on("raw:incoming",this.boundSetupStanzaTimeout)}},{key:"stop",value:function(){clearTimeout(this.timeoutId),this.timeoutId=void 0,this.boundSetupStanzaTimeout&&(this.client.off("connected",this.boundSetupStanzaTimeout),this.stanzaInstance.off("raw:incoming",this.boundSetupStanzaTimeout),this.boundSetupStanzaTimeout=void 0)}},{key:"setupStanzaTimeout",value:function(){var e=this;clearTimeout(this.timeoutId),this.timeoutId=setTimeout(function(){var t,n={channelId:e.client.config.channelId,jid:e.stanzaInstance.jid,stanzaInstanceId:e.stanzaInstance.id,timeout:e.stanzaTimeout};e.client.logger.error("Time between XMPP stanzas exceeded timeout, disconnecting",n),e.stanzaInstance.sendStreamError({text:"time between stanzas exceeded timeout",condition:"connection-timeout"}),e.stop(),null===(t=e.stanzaInstance.transport)||void 0===t||t.disconnect(!1)},this.stanzaTimeout)}}])}();t.ServerMonitor=a},8710(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitions=void 0;var r=n(7930),i=n(6519),a="urn:xmpp:jingle-message:0",o={aliases:["message.propose"],element:"propose",fields:{conversationId:(0,r.attribute)("inin-cid"),persistentConversationId:(0,r.attribute)("inin-persistent-cid"),sdpOverXmpp:(0,r.booleanAttribute)("inin-sdp-over-xmpp"),privAnswerMode:(0,r.attribute)("inin-priv-answer-mode"),originalRoomJid:(0,r.attribute)("inin-ofrom"),autoAnswer:(0,r.booleanAttribute)("inin-autoanswer"),fromUserId:(0,r.attribute)("inin-user-id"),sessionId:(0,r.attribute)("id"),meetingId:(0,r.attribute)("inin-meeting-id")},namespace:a},s={aliases:["message.proceed"],element:"proceed",fields:{sessionId:(0,r.attribute)("id")},namespace:a},u={aliases:["message.accept"],element:"accept",fields:{sessionId:(0,r.attribute)("id")},namespace:a},c={aliases:["message.reject"],element:"reject",fields:{sessionId:(0,r.attribute)("id")},namespace:a},l={aliases:["message.retract"],element:"retract",fields:{sessionId:(0,r.attribute)("id")},namespace:a},f={aliases:["iq.jingle.screenstart"],element:"screen-start",namespace:i.NS_JINGLE_RTP_INFO_1},d={aliases:["iq.jingle.screenstop"],element:"screen-stop",namespace:i.NS_JINGLE_RTP_INFO_1},p={path:"iq",namespace:i.NS_CLIENT,element:"iq",fields:{genesysWebrtc:(0,r.childJSON)("genesys","genesys-webrtc")}},h={path:"message",namespace:i.NS_CLIENT,element:"message",fields:{mediaMessage:(0,r.childJSON)("genesys","media-message")}},v={aliases:["presence.media"],element:"x",fields:{conversationId:(0,r.attribute)("conversationId"),sourceCommunicationId:(0,r.attribute)("sourceCommunicationId"),screenShare:(0,r.childAttribute)(null,"mediastream","screenShare"),video:(0,r.childAttribute)(null,"mediastream","video"),audio:(0,r.childAttribute)(null,"mediastream","audio"),listener:(0,r.childAttribute)(null,"mediastream","listener"),screenRecording:(0,r.childAttribute)(null,"mediastream","screenRecording"),videoGuest:(0,r.childAttribute)(null,"mediastream","videoGuest")},namespace:"orgspan:mediastream"};t.definitions=[o,s,u,c,l,f,d,v,p,h]},1491(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectionTransfer=void 0;var r=n(7930);t.connectionTransfer={path:"iq.query",aliases:["iq.connectionTransfer"],namespace:"urn:xmpp:cxfr",element:"query",fields:{domain:(0,r.childText)(null,"domain"),server:(0,r.childText)(null,"server")}}},4313(e,t,n){"use strict";var r=n(3738),i=n(3693);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={};if(Array.isArray(e))for(var i=0;i<e.length;i++)Object.assign(n,o(e[i],"".concat(t,"_[").concat(i,"]")));else"object"!==r(e)?n[t]=e:Object.keys(e).filter(function(e){return!["ip","address","relatedaddress"].includes(e.toLowerCase())}).forEach(function(i){var a=e[i],s=t?"".concat(t,"_").concat(i):i;"object"===r(a)||Array.isArray(a)?Object.assign(n,o(a,s)):n[s]=a});return n}Object.defineProperty(t,"__esModule",{value:!0}),t.deepFlatten=t.formatStatsEvent=void 0,t.formatStatsEvent=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({_eventType:e.name,_eventTimestamp:(new Date).getTime()},t);return function(e){return"getStats"===e.name}(e)&&Object.assign(n,function(e){var t={};return Object.assign(t,o(e.tracks,"localTrack")),delete e.tracks,Object.assign(t,o(e.remoteTracks,"remoteTrack")),delete e.remoteTracks,t}(e)),Object.assign(n,o(e)),delete n.name,{actionName:"WebrtcStats",details:n}},t.deepFlatten=o},9399(e,t,n){"use strict";var r=n(4579),i=n(7383),a=n(8452),o=n(3072),s=n(9511),u=n(1837);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var f=function(e){function t(e,n,r){var a;return i(this,t),(a=c(this,t)).condition=e,a.channelId=n,a.stanzaInstanceId=r,a.name="SaslError",a}return s(t,e),r(t)}(u(Error));t.default=f},4641(e,t,n){"use strict";var r=n(4579),i=n(7383),a=n(8452),o=n(3072),s=n(9511),u=n(1837);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var f=function(e){function t(){return i(this,t),c(this,t,arguments)}return s(t,e),r(t)}(u(Error));t.default=f},7833(e,t,n){var r,i,a;a=function(){"use strict";var e="undefined"==typeof window,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,u=!1,c=!1,l=!1;return e||(t="undefined"!=typeof InstallTrigger,n=!!window.chrome,r=!!window.chrome,i=n&&!window.chrome.webstore&&!window.chrome.runtime,a=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||window.safari&&window.safari.pushNotification,o=!!window.opr&&!!window.opr.addons||!!window.opera,s=!!window.StyleMedia,u=n&&!!navigator.userAgent.match(/edg/i),c=(r||o)&&!!window.CSS,l=!(n||a||t||o||!document.documentMode)),{get isChrome(){return r},get isChromeOrChromium(){return n},get isChromium(){return i},get isFirefox(){return t},get isSafari(){return a},get isOpera(){return o},get isEdge(){return s},get isEdgeChromium(){return u},get isIE(){return l},get isBlink(){return c}}},"object"==n(3738)(t)?e.exports=a():void 0===(i="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=i)},6646(e){"use strict";e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=void 0,i=void 0,a=void 0,o=[];return function(){var u=function(e){return"function"==typeof e?e():e}(t),c=(new Date).getTime(),l=!r||c-r>u;r=c;for(var f=arguments.length,d=Array(f),p=0;p<f;p++)d[p]=arguments[p];if(l&&n.leading)return n.accumulate?Promise.resolve(e.call(this,[d])).then(function(e){return e[0]}):Promise.resolve(e.call.apply(e,[this].concat(d)));if(i?clearTimeout(a):i=function(){var e={};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}(),o.push(d),a=setTimeout(s.bind(this),u),n.accumulate){var h=o.length-1;return i.promise.then(function(e){return e[h]})}return i.promise};function s(){var t=i;clearTimeout(a),Promise.resolve(n.accumulate?e.call(this,o):e.apply(this,o[o.length-1])).then(t.resolve,t.reject),o=[],i=null}}},3550(e,t,n){"use strict";var r,i=n(3738),a="object"===("undefined"==typeof Reflect?"undefined":i(Reflect))?Reflect:null,o=a&&"function"==typeof a.apply?a.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+i(e))}function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=f(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=p.bind(r);return i.listener=n,r.wrapFn=i,i}function v(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+i(e));e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n<c;++n)o(l[n],this,t)}return!0},u.prototype.addListener=function(e,t){return d(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return d(this,e,t,!0)},u.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return v(this,e,!0)},u.prototype.rawListeners=function(e){return v(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},8529(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(2059),o=n(3782);t.backOff=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return n=a.getSanitizedOptions(t),[4,new s(e,n).execute()];case 1:return[2,r.sent()]}})})};var s=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,o.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}})})},e}()},631(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(3751).Delay);t.AlwaysDelay=a},3751(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9536),i=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise(function(t){return setTimeout(t,e.jitteredDelay)})},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return r.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,n=this.numOfDelayedAttempts,r=e*Math.pow(t,n);return Math.min(r,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=i},3782(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2145),i=n(631);t.DelayFactory=function(e,t){var n=function(e){return e.delayFirstAttempt?new i.AlwaysDelay(e):new r.SkipFirstDelay(e)}(e);return n.setAttemptNumber(t),n}},2145(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.apply=function(){return a(this,void 0,void 0,function(){return o(this,function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(n(3751).Delay);t.SkipFirstDelay=s},399(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}},9536(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(399),i=n(7155);t.JitterFactory=function(e){return"full"===e.jitter?r.fullJitter:i.noJitter}},7155(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},2059(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=n(n({},r),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},8031(e,t,n){"use strict";n.r(t),n.d(t,{Logger:()=>vr,default:()=>mr});var r={};function i(e){if(Array.isArray(e))return e}n.r(r),n.d(r,{hasBrowserEnv:()=>bt,hasStandardBrowserEnv:()=>_t,hasStandardBrowserWebWorkerEnv:()=>wt,navigator:()=>St,origin:()=>Ot});var a=n(3893),o=n(7800);function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=n(436);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e){return l="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},l(e)}function f(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function d(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,f(r.key),r)}}function p(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function g(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}var y=n(3550),b=n(80),S=n.n(b);function _(e,t){return i(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||(0,o.A)(e,t)||s()}var w=n(4756),O=n.n(w),x=function(e){var t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},k=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(0===n)return null;if(t){if(Array.isArray(t)){for(var r=[],i=0;i<t.length;i++)r[i]=e(t[i],n-1);return r}if("object"===l(t)){var a=Object.assign({},t);for(var o in t)try{a[o]=e(t[o],n-1)}catch(e){console.debug("WARN: Failed cloning key on object, ignoring",{key:o,object:t})}return a}}return t};function T(e,t){return function(){return e.apply(t,arguments)}}var A=n(440);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return I(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var N,j,R=Object.prototype.toString,P=Object.getPrototypeOf,C=Symbol.iterator,M=Symbol.toStringTag,D=(N=Object.prototype.hasOwnProperty,function(e,t){return N.call(e,t)}),L=function(e){return"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e)},B=function(e,t,n){return e===Object.prototype||!n&&null===t},F=function(e,t){for(var n=e,r=[];null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);var i=P(n);if(B(n,i,n===e))return!1;if(D(n,t))return!0;n=i}return!1},q=(j=Object.create(null),function(e){var t=R.call(e);return j[t]||(j[t]=t.slice(8,-1).toLowerCase())}),U=function(e){return e=e.toLowerCase(),function(t){return q(t)===e}},z=function(e){return function(t){return l(t)===e}},J=Array.isArray,G=z("undefined");function H(e){return null!==e&&!G(e)&&null!==e.constructor&&!G(e.constructor)&&Q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var W=U("ArrayBuffer"),V=z("string"),Q=z("function"),K=z("number"),X=function(e){return null!==e&&"object"===l(e)},Y=function(e){if(!X(e))return!1;var t=P(e);return!(null!==t&&t!==Object.prototype&&null!==P(t)||F(e,M)||F(e,C))},$=U("Date"),Z=U("File"),ee=U("Blob"),te=U("FileList"),ne=U("Set"),re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ie=void 0!==re.FormData?re.FormData:void 0,ae=U("URLSearchParams"),oe=_(["ReadableStream","Request","Response","Headers"].map(U),4),se=oe[0],ue=oe[1],ce=oe[2],le=oe[3];function fe(e,t){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==l(e)&&(e=[e]),J(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(H(e))return;var o,s=a?Object.getOwnPropertyNames(e):Object.keys(e),u=s.length;for(n=0;n<u;n++)o=s[n],t.call(null,e[o],o,e)}}function de(e,t){if(H(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),i=r.length;i-- >0;)if(t===(n=r[i]).toLowerCase())return n;return null}var pe,he,ve,me,ge,ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,be=function(e){return!G(e)&&e!==ye},Se=(pe="undefined"!=typeof Uint8Array&&P(Uint8Array),function(e){return pe&&e instanceof pe}),_e=U("HTMLFormElement"),we=Object.prototype.propertyIsEnumerable,Oe=U("RegExp"),xe=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};fe(n,function(n,i){var a;!1!==(a=t(n,i,e))&&(r[i]=a||n)}),Object.defineProperties(e,r)},ke=U("AsyncFunction"),Te=(he="function"==typeof setImmediate,ve=Q(ye.postMessage),he?setImmediate:ve?(me="axios@".concat(Math.random()),ge=[],ye.addEventListener("message",function(e){var t=e.source,n=e.data;t===ye&&n===me&&ge.length&&ge.shift()()},!1),function(e){ge.push(e),ye.postMessage(me,"*")}):function(e){return setTimeout(e)}),Ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ye):void 0!==A&&A.nextTick||Te,Ee=function(e){return null!=e&&Q(e[C])};const Ie={isArray:J,isArrayBuffer:W,isBuffer:H,isFormData:function(e){if(!e)return!1;if(ie&&e instanceof ie)return!0;var t=P(e);if(!t||t===Object.prototype)return!1;if(!Q(e.append))return!1;var n=q(e);return"formdata"===n||"object"===n&&Q(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&W(e.buffer)},isString:V,isNumber:K,isBoolean:function(e){return!0===e||!1===e},isObject:X,isPlainObject:Y,isEmptyObject:function(e){if(!X(e)||H(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:se,isRequest:ue,isResponse:ce,isHeaders:le,isUndefined:G,isDate:$,isFile:Z,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:ee,isRegExp:Oe,isFunction:Q,isStream:function(e){return X(e)&&Q(e.pipe)},isURLSearchParams:ae,isTypedArray:Se,isFileList:te,forEach:fe,merge:function e(){for(var t=be(this)&&this||{},n=t.caseless,r=t.skipUndefined,i={},a=function(t,a){if("__proto__"!==a&&"constructor"!==a&&"prototype"!==a){var o=n&&"string"==typeof a&&de(i,a)||a,s=D(i,o)?i[o]:void 0;Y(s)&&Y(t)?i[o]=e(s,t):Y(t)?i[o]=e({},t):J(t)?i[o]=t.slice():r&&G(t)||(i[o]=t)}},o=0,s=arguments.length;o<s;o++){var u=o<0||arguments.length<=o?void 0:arguments[o];if(u&&!H(u)&&(fe(u,a),"object"===l(u)&&!J(u)))for(var c=Object.getOwnPropertySymbols(u),f=0;f<c.length;f++){var d=c[f];we.call(u,d)&&a(u[d],d)}}return i},extend:function(e,t,n){return fe(t,function(t,r){n&&Q(t)?Object.defineProperty(e,r,{__proto__:null,value:T(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,a,o,s={};if(t=t||{},null==e)return t;do{for(a=(i=Object.getOwnPropertyNames(e)).length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&P(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:q,kindOfTest:U,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(J(e))return e;var t=e.length;if(!K(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[C]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_e,hasOwnProperty:D,hasOwnProp:D,hasOwnInPrototypeChain:F,getSafeProp:function(e,t){return null!=e&&F(e,t)?e[t]:void 0},toSafeFlatObject:function(e){if(null==e||"object"!==l(e)&&"function"!=typeof e)return e;var t=P(e);if(null===t&&function(e){if(!Object.isExtensible(e))return!1;var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push.apply(t,(0,u.A)(Object.getOwnPropertySymbols(e))),t.every(function(t){if(L(t))return!1;var n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})}(e))return e;for(var n=Object.create(null),r=Object.create(null),i=[],a=e;null!=a&&-1===i.indexOf(a);){i.push(a);var o=a===e?t:P(a);if(B(a,o,a===e))break;var s=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&s.push.apply(s,(0,u.A)(Object.getOwnPropertySymbols(a)));var c,f=E(s);try{for(f.s();!(c=f.n()).done;){var d=c.value;L(d)||D(r,d)||(n[d]=e[d],r[d]=!0)}}catch(e){f.e(e)}finally{f.f()}a=o}return n},reduceDescriptors:xe,freezeMethods:function(e){xe(e,function(t,n){if(Q(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Q(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:function(e,t){var n={},r=function(e){e.forEach(function(e){n[e]=!0})};return J(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:de,global:ye,isContextDefined:be,isSpecCompliantForm:function(e){return!!(e&&Q(e.append)&&"FormData"===e[M]&&e[C])},toJSONObject:function(e){var t=new WeakSet,n=function(e){if(X(e)){if(t.has(e))return;if(H(e))return e;if(!("toJSON"in e)){var r;if(t.add(e),ne(e)){r=[];var i,a=E(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=n(o);!G(s)&&r.push(s)}}catch(e){a.e(e)}finally{a.f()}}else r=J(e)?[]:{},fe(e,function(e,t){var i=n(e);!G(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:ke,isThenable:function(e){return e&&(X(e)||Q(e))&&Q(e.then)&&Q(e.catch)},setImmediate:Te,asap:Ae,isIterable:Ee,isSafeIterable:function(e){return null!=e&&F(e,C)&&Ee(e)}};function Ne(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function je(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Ne(a,r,i,o,s,"next",e)}function s(e){Ne(a,r,i,o,s,"throw",e)}o(void 0)})}}function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Re=function(){return!!e})()}function Pe(e){var t="function"==typeof Map?new Map:void 0;return Pe=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Re())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&m(i,n.prototype),i}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)},Pe(e)}var Ce=Ie.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),De=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Le(e,t){return Ie.isArray(e)?e.map(function(e){return Le(e,t)}):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var i=e.charCodeAt(n-1);if(9!==i&&32!==i)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Be(e){var t=Object.create(null);return Ie.forEach(e.toJSON(),function(e,n){t[n]=function(e){return Le(e,De)}(e)}),t}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var qe=Symbol("internals");function Ue(e){return e&&String(e).trim().toLowerCase()}function ze(e){return!1===e||null==e?e:Ie.isArray(e)?e.map(ze):function(e){return Le(e,Me)}(String(e))}var Je=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Ge(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var i=e.charCodeAt(n-1);if(9!==i&&32!==i)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function He(e,t,n,r,i){return Ie.isFunction(r)?r.call(this,t,n):(i&&(t=n),Ie.isString(t)?Ie.isString(r)?-1!==t.indexOf(r):Ie.isRegExp(r)?r.test(t):void 0:void 0)}var We=function(){return p(function e(t){c(this,e),t&&this.set(t)},[{key:"set",value:function(e,t,n){var r=this;function i(e,t,n){var i=Ue(t);if(i){var a=Ie.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=ze(e))}}var a=function(e,t){return Ie.forEach(e,function(e,n){return i(e,n,t)})};if(Ie.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Ie.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a(function(e){var t,n,r,i={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim();var a=Ie.hasOwnProp(i,t);!t||a&&Ie.hasOwnProp(Ce,t)||("set-cookie"===t?a?i[t].push(n):i[t]=[n]:i[t]=a?i[t]+", "+n:n)}),i}(e),t);else if(Ie.isObject(e)&&Ie.isSafeIterable(e)){var o,s,c,l=Object.create(null),f=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(e);try{for(f.s();!(c=f.n()).done;){var d=c.value;if(!Ie.isArray(d))throw new TypeError("Object iterator must return a key-value pair");s=d[0],Ie.hasOwnProp(l,s)?(o=l[s],l[s]=Ie.isArray(o)?[].concat((0,u.A)(o),[d[1]]):[o,d[1]]):l[s]=d[1]}}catch(e){f.e(e)}finally{f.f()}a(l,t)}else null!=e&&i(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Ue(e)){var n=Ie.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Ie.isFunction(t))return t.call(this,r,n);if(Ie.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Ue(e)){var n=Ie.findKey(this,e);return!(!n||void 0===this[n]||t&&!He(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function i(e){if(e=Ue(e)){var i=Ie.findKey(n,e);!i||t&&!He(0,n[i],i,t)||(delete n[i],r=!0)}}return Ie.isArray(e)?e.forEach(i):i(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var i=t[n];e&&!He(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Ie.forEach(this,function(r,i){var a=Ie.findKey(n,i);if(a)return t[a]=ze(r),void delete t[i];var o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})}(i):String(i).trim();o!==i&&delete t[i],t[o]=ze(r),n[o]=!0}),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Ie.forEach(this,function(n,r){null!=n&&!1!==n&&(t[r]=e&&Ie.isArray(n)?n.join(", "):n)}),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map(function(e){var t=_(e,2);return t[0]+": "+t[1]}).join("\n")}},{key:"getSetCookie",value:function(){var e=this.get("set-cookie");return Ie.isArray(e)?e:null==e||!1===e?[]:[e]}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"parseParameters",value:function(e){return function(e){var t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){var i=Ge(n.slice(r,e)),a=i.indexOf("=");if(!(a<1)){var o=Ge(i.slice(0,a));if(Je.test(o)){var s=o.toLowerCase();if("__proto__"!==s&&"constructor"!==s&&"prototype"!==s){var u=Ge(i.slice(a+1));t[s]=function(e){var t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;for(var n="",r=1;r<t;r++){var i=e.charCodeAt(r);if(34===i)return e;if(92===i&&(r+=1)>=t)return e;n+=e[r]}return n}(u)}}}}for(var s=0;s<n.length;s++){var u=n.charCodeAt(s);i?a?a=!1:92===u?a=!0:34===u&&(i=!1):34===u?i=!0:44!==u&&59!==u||(o(s),r=s+1)}return o(n.length),t}(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach(function(e){return t.set(e)}),t}},{key:"accessor",value:function(e){var t=(this[qe]=this[qe]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Ue(e);t[r]||(function(e,t){var n=Ie.toCamelCase(" "+t);["get","set","has"].forEach(function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return Ie.isArray(e)?e.forEach(r):r(e),this}}])}();We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ie.reduceDescriptors(We.prototype,function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}}),Ie.freezeMethods(We);const Ve=We;function Qe(e,t,n){return t=v(t),h(e,Ke()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ke=function(){return!!e})()}var Xe="[REDACTED ****]";function Ye(e){try{return String(e)}catch(e){return""}}var $e=function(e){function t(e,n,r,i,a){var o;return c(this,t),o=Qe(this,t,[e]),Object.defineProperty(o,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),o.name="AxiosError",o.isAxiosError=!0,n&&(o.code=n),r&&(o.config=r),i&&(o.request=i),a&&(o.response=a,o.status=a.status),o}return g(t,e),p(t,[{key:"toJSON",value:function(){var e=this.config,t=e&&Ie.hasOwnProp(e,"redact")?e.redact:void 0,n=Ie.isArray(t)&&t.length>0?function(e,t){var n=new Set(t.map(function(e){return String(e).toLowerCase()})),r=[],i=function(e){if(null===e||"object"!==l(e))return e;if(Ie.isBuffer(e))return e;if(-1===r.indexOf(e)){var t;if(e instanceof Ve&&(e=e.toJSON()),r.push(e),Ie.isArray(e))t=[],e.forEach(function(e,n){var r=i(e);Ie.isUndefined(r)||(t[n]=r)});else{if(!Ie.isPlainObject(e)&&function(e){if(Ie.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Ie.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(var a=0,o=Object.entries(e);a<o.length;a++){var s=_(o[a],2),u=s[0],c=s[1],f=n.has(u.toLowerCase())?Xe:i(c);Ie.isUndefined(f)||(t[u]=f)}}return r.pop(),t}};return i(e)}(e,t):Ie.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,n,r,i,a,o){var s=e.message;!s&&Ie.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(function(e){try{return e&&e.message?Ye(e.message):Ye(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));var u=new t(s,n||e.code,r,i,a);return Object.defineProperty(u,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),u.name=e.name,null!=e.status&&null==u.status&&(u.status=e.status),o&&Object.assign(u,o),u}}])}(Pe(Error));$e.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",$e.ERR_BAD_OPTION="ERR_BAD_OPTION",$e.ECONNABORTED="ECONNABORTED",$e.ETIMEDOUT="ETIMEDOUT",$e.ECONNREFUSED="ECONNREFUSED",$e.ERR_NETWORK="ERR_NETWORK",$e.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",$e.ERR_DEPRECATED="ERR_DEPRECATED",$e.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",$e.ERR_BAD_REQUEST="ERR_BAD_REQUEST",$e.ERR_CANCELED="ERR_CANCELED",$e.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",$e.ERR_INVALID_URL="ERR_INVALID_URL",$e.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ze=$e;function et(e){return Ie.isPlainObject(e)||Ie.isArray(e)}function tt(e){return Ie.endsWith(e,"[]")?e.slice(0,-2):e}function nt(e,t,n){return e?e.concat(t).map(function(e,t){return e=tt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}var rt=Ie.toFlatObject(Ie,{},null,function(e){return/^is[A-Z]/.test(e)});const it=function(e,t,n){if(!Ie.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=function(e,t){var r=Ie.getSafeProp(n,e);return Ie.isUndefined(r)?t:r},i=r("metaTokens",!0),a=r("visitor")||v,o=r("dots",!1),s=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),f=u&&Ie.isSpecCompliantForm(t),d=[];if(!Ie.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(Ie.isDate(e))return e.toISOString();if(Ie.isBoolean(e))return e.toString();if(!f&&Ie.isBlob(e))throw new Ze("Blob is not supported. Use a Buffer instead.");if(Ie.isArrayBuffer(e)||Ie.isTypedArray(e)){if(f&&"function"==typeof u)return new u([e]);throw new Ze("Blob is not supported. Use a Buffer instead.",Ze.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new Ze("Object is too deeply nested ("+e+" levels). Max depth: "+c,Ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(e,n,r){var a=e;if(Ie.isReactNative(t)&&Ie.isReactNativeBlob(e))return t.append(nt(r,n,o),p(e)),!1;if(e&&!r&&"object"===l(e))if(Ie.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e){if(c===1/0)return JSON.stringify(e);var t=[];return JSON.stringify(e,function(e,n){if(!Ie.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),h(1+t.length-1),n})}(e);else if(Ie.isArray(e)&&function(e){return Ie.isArray(e)&&!e.some(et)}(e)||(Ie.isFileList(e)||Ie.endsWith(n,"[]"))&&(a=Ie.toArray(e)))return n=tt(n),a.forEach(function(e,r){!Ie.isUndefined(e)&&null!==e&&t.append(!0===s?nt([n],r,o):null===s?n:n+"[]",p(e))}),!1;return!!et(e)||(t.append(nt(r,n,o),p(e)),!1)}var m=Object.assign(rt,{defaultVisitor:v,convertValue:p,isVisitable:et});if(!Ie.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Ie.isUndefined(n)){if(h(i),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));d.push(n),Ie.forEach(n,function(n,o){!0===(!(Ie.isUndefined(n)||null===n)&&a.call(t,n,Ie.isString(o)?o.trim():o,r,m))&&e(n,r?r.concat(o):[o],i+1)}),d.pop()}}(e),t};function at(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ot(e,t){this._pairs=[],e&&it(e,this,t)}var st=ot.prototype;st.append=function(e,t){this._pairs.push([e,t])},st.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,at)}:at;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};const ut=ot;function ct(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function lt(e,t,n){if(!t)return e;e=e||"";var r,i=Ie.isFunction(n)?{serialize:n}:n,a=Ie.getSafeProp(i,"encode")||ct,o=Ie.getSafeProp(i,"serialize");if(r=o?o(t,i):Ie.isURLSearchParams(t)?t.toString():new ut(t,i).toString(a)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var ft=Symbol("internals");function dt(e){return e?e.length:0}function pt(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function ht(e,t){var n=e.handlers,r=dt(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const vt=function(){return p(function e(){c(this,e),this.handlers=[],this[ft]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}},[{key:"use",value:function(e,t,n){var r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[ft];null==this.handlers&&(this.handlers=[]),ht(this,i);var a=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(a,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,a}},{key:"eject",value:function(e){var t=this[ft];ht(this,t);var n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(pt(this.handlers),t.handlersLength=this.handlers.length)}}},{key:"clear",value:function(){this.handlers&&(this.handlers=[],ht(this,this[ft]))}},{key:"forEach",value:function(e){var t=this[ft];ht(this,t),t.iterationDepth++;try{Ie.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(ht(this,t),pt(this.handlers),t.handlersLength=dt(this.handlers))}}}])}(),mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};function gt(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};var bt="undefined"!=typeof window&&"undefined"!=typeof document,St="object"===("undefined"==typeof navigator?"undefined":l(navigator))&&navigator||void 0,_t=bt&&(!St||["ReactNative","NativeScript","NS"].indexOf(St.product)<0),wt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ot=bt&&window.location.href||"http://localhost";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Tt=kt(kt({},r),yt);function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Et(e){if(e>100)throw new Ze("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}const It=function(e){function t(e,n,r,i){Et(i);var a=e[i++];if("__proto__"===a)return!0;var o=Number.isFinite(+a),s=i>=e.length;return a=!a&&Ie.isArray(r)?r.length:a,s?(Ie.hasOwnProp(r,a)?r[a]=Ie.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):(Ie.hasOwnProp(r,a)&&Ie.isObject(r[a])||(r[a]=[]),t(e,n,r[a],i)&&Ie.isArray(r[a])&&(r[a]=function(e){var t,n,r={},i=Object.keys(e),a=i.length;for(t=0;t<a;t++)r[n=i[t]]=e[n];return r}(r[a])),!o)}if(Ie.isFormData(e)&&Ie.isFunction(e.entries)){var n={};return Ie.forEachEntry(e,function(e,r){t(function(e){for(var t,n=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;null!==(t=r.exec(e));)Et(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)}),n}return null},Nt=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]);var jt=function(e,t){return null!=e&&Ie.hasOwnProp(e,t)?e[t]:void 0},Rt={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",i=r.indexOf("application/json")>-1,a=Ie.isObject(e);if(a&&Ie.isHTMLForm(e)&&(e=new FormData(e)),Ie.isFormData(e))return i?JSON.stringify(It(e)):e;if(Ie.isArrayBuffer(e)||Ie.isBuffer(e)||Ie.isStream(e)||Ie.isFile(e)||Ie.isBlob(e)||Ie.isReadableStream(e))return e;if(Ie.isArrayBufferView(e))return e.buffer;if(Ie.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(a){var o=jt(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return it(e,new Tt.classes.URLSearchParams,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({visitor:function(e,t,n,r){return Tt.isNode&&Ie.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,o).toString();if((n=Ie.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=jt(this,"env"),u=s&&s.FormData;return it(n?{"files[]":e}:e,u&&new u,o)}}return a||i?(t.setContentType("application/json",!1),function(e){if(Ie.isString(e))try{return(0,JSON.parse)(e),Ie.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=jt(this,"transitional")||Rt.transitional,n=t&&t.forcedJSONParsing,r=jt(this,"responseType"),i="json"===r;if(Ie.isResponse(e)||Ie.isReadableStream(e))return e;if(e&&Ie.isString(e)&&(n&&!r||i)){var a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,jt(this,"parseReviver"))}catch(e){if(a){if("SyntaxError"===e.name)throw Ze.from(e,Ze.ERR_BAD_RESPONSE,this,null,jt(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ie.forEach(Nt,function(e){Rt.headers[e]={}});const Pt=Rt;function Ct(e,t){var n=this||Pt,r=t||n,i=Ve.from(r.headers),a=r.data;return Ie.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Mt(e){return!(!e||!e.__CANCEL__)}function Dt(e,t,n){return t=v(t),h(e,Lt()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lt=function(){return!!e})()}const Bt=function(e){function t(e,n,r){var i;return c(this,t),(i=Dt(this,t,[e??"canceled",Ze.ERR_CANCELED,n,r])).name="CanceledError",i.__CANCEL__=!0,i}return g(t,e),p(t)}(Ze);function Ft(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ze("Request failed with status code "+n.status,n.status>=400&&n.status<500?Ze.ERR_BAD_REQUEST:Ze.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var qt=/[\t\n\r]/g;function Ut(e){if("string"!=typeof e)return e;for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(qt,"")}function zt(e){var t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var Jt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(e,t){e=e||10;var n,r=new Array(e),i=new Array(e),a=0,o=0;return t=void 0!==t?t:1e3,function(s){var u=Date.now(),c=i[o];n||(n=u),r[a]=s,i[a]=u;for(var l=o,f=0;l!==a;)f+=r[l++],l%=e;if((a=(a+1)%e)===o&&(o=(o+1)%e),!(u-n<t)){var d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}}(50,250);return function(e,t){var n,r,i=0,a=1e3/t,o=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=a,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,(0,u.A)(t))};return[function(){for(var e=Date.now(),t=e-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];t>=a?o(u,e):(n=u,r||(r=setTimeout(function(){r=null,o(n)},a-t)))},function(){return n&&o(n)},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(t)}]}(function(n){if(n&&Ie.isNumber(n.loaded)){var a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=o?Math.min(a,o):a),u=Math.max(0,s-r),c=i(u);r=Math.max(r,s);var l=gt({loaded:s,total:o,progress:o?s/o:void 0,bytes:u,rate:c||void 0,estimated:c&&o?(o-s)/c:void 0,event:n,lengthComputable:null!=o},t?"download":"upload",!0);e(l)}},n)},Gt=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Ht=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ie.asap;return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t(function(){return e.apply(void 0,r)})}};const Wt=Tt.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,Tt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):function(){return!0},Vt=Tt.hasStandardBrowserEnv?{write:function(e,t,n,r,i,a,o){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Ie.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Ie.isString(r)&&s.push("path=".concat(r)),Ie.isString(i)&&s.push("domain=".concat(i)),!0===a&&s.push("secure"),Ie.isString(o)&&s.push("SameSite=".concat(o)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch(e){return r.slice(i+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Qt=/^https?:(?!\/\/)/i;function Kt(e,t){if("string"==typeof e){var n=Ut(e);if(Qt.test(n))throw new Ze("Invalid URL ".concat(JSON.stringify(function(e){var t,n=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,"$1".concat(Xe,"@")),r=n.indexOf("#"),i=(-1===r?n:n.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,"$1".concat(Xe));return-1===r?i:"".concat(i,"#").concat((t=n.slice(r+1))?t.replace(/(^|&)([^=&]*=)?[^&]+/g,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"".concat(t).concat(n).concat(Xe)}):t)}(n)),': missing "//" after protocol'),Ze.ERR_INVALID_URL,t)}}function Xt(e,t,n,r){Kt(t,r);var i,a=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));return e&&(a||!1===n)?(Kt(e,r),function(e,t){if(!t)return e;for(var n=e.length;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zt=function(e){return e instanceof Ve?$t({},e):e};function en(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Ie.isPlainObject(e)&&Ie.isPlainObject(t)?Ie.merge.call({caseless:r},e,t):Ie.isPlainObject(t)?Ie.merge({},t):Ie.isArray(t)?t.slice():t}function i(e,t,n,i){return Ie.isUndefined(t)?Ie.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!Ie.isUndefined(t))return r(void 0,t)}function o(e,t){return Ie.isUndefined(t)?Ie.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return Ie.hasOwnProp(t,a)?r(n,i):Ie.hasOwnProp(e,a)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var u,c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:function(e,t,n){return i(Zt(e),Zt(t),0,!0)}};return Ie.forEach((u=$t($t({},e),t),Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(u).concat(Object.getOwnPropertySymbols(u).filter(function(e){return Object.getOwnPropertyDescriptor(u,e).enumerable})):Object.keys(u)),function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var a=Ie.hasOwnProp(c,r)?c[r]:i,o=a(Ie.hasOwnProp(e,r)?e[r]:void 0,Ie.hasOwnProp(t,r)?t[r]:void 0,r);Ie.isUndefined(o)&&a!==s||(n[r]=o)}}),Ie.hasOwnProp(t,"validateStatus")&&Ie.isUndefined(t.validateStatus)&&!1===function(n){var r=Ie.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Ie.isUndefined(r)){if(!Ie.isPlainObject(r))return;if(Ie.hasOwnProp(r,n))return r[n]}var i=Ie.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Ie.isPlainObject(i)&&Ie.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Ie.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var tn=["content-type","content-length"];const nn=function(e){var t=en({},e),n=function(e){return Ie.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),i=n("withXSRFToken"),a=n("xsrfHeaderName"),o=n("xsrfCookieName"),s=n("headers"),u=n("auth"),c=n("baseURL"),l=n("allowAbsoluteUrls"),f=n("url");if(t.headers=s=Ve.from(s),t.url=lt(Xt(c,f,l,t),n("params"),n("paramsSerializer")),u){var d=Ie.getSafeProp(u,"username")||"",p=Ie.getSafeProp(u,"password")||"";try{s.set("Authorization","Basic "+btoa(d+":"+(p?encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}):"")))}catch(t){throw Ze.from(t,Ze.ERR_BAD_OPTION_VALUE,e)}}if(Ie.isFormData(r)){var h=Ie.getSafeProp(r,"getHeaders");Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv||Ie.isReactNative(r)?s.setContentType(void 0):Ie.isFunction(h)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(function(t){var n=_(t,2),r=n[0],i=n[1];tn.includes(r.toLowerCase())&&e.set(r,i)}):e.set(t)}(s,h.call(r),n("formDataHeaderPolicy"))}if(Tt.hasStandardBrowserEnv&&(Ie.isFunction(i)&&(i=i(t)),!0===i||null==i&&Wt(t.url))){var v=a&&o&&Vt.read(o);v&&s.set(a,v)}return t},rn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r,i,a,o,s,u,c=nn(e),l=c.data,f=Ve.from(c.headers).normalize(),d=c.responseType,p=c.onUploadProgress,h=c.onDownloadProgress;function v(){o&&o(),s&&s(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}var m=new XMLHttpRequest;function g(r){if(m){if(!(0!==m.status||"file"===(zt(Ut(c.url))||zt(Tt.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new Ze("Request aborted",Ze.ECONNABORTED,e,m)),v(),void(m=null);try{r?u&&u(r):s&&s()}catch(e){setTimeout(function(){throw e})}if(m){var i=Ve.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ft(function(e){t(e),v()},function(e){n(e),v()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:i,config:e,request:m}),m=null}}}if(m.open(c.method.toUpperCase(),c.url,!0),m.timeout=c.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ze("Request aborted",Ze.ECONNABORTED,e,m)),v(),m=null)},m.onerror=function(t){var r=t&&t.message?t.message:"Network Error",i=new Ze(r,Ze.ERR_NETWORK,e,m);i.event=t||null,n(i),v(),m=null},m.ontimeout=function(){var t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||mt;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new Ze(t,r.clarifyTimeoutError?Ze.ETIMEDOUT:Ze.ECONNABORTED,e,m)),v(),m=null},void 0===l&&f.setContentType(null),"setRequestHeader"in m&&Ie.forEach(Be(f),function(e,t){m.setRequestHeader(t,e)}),Ie.isUndefined(c.withCredentials)||(m.withCredentials=!!c.withCredentials),d&&"json"!==d&&(m.responseType=c.responseType),h){var y=_(Jt(h,!0),3);a=y[0],s=y[1],u=y[2],m.addEventListener("progress",a)}if(p&&m.upload){var b=_(Jt(p),2);i=b[0],o=b[1],m.upload.addEventListener("progress",i),m.upload.addEventListener("loadend",o)}(c.cancelToken||c.signal)&&(r=function(t){m&&(n(!t||t.type?new Bt(null,e,m):t),m.abort(),v(),m=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));var S=zt(c.url);if(S&&!Tt.protocols.includes(S))return n(new Ze("Unsupported protocol "+S+":",Ze.ERR_BAD_REQUEST,e)),void v();m.send(l||null)})},an=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Ze?t:new Bt(t instanceof Error?t.message:t))}},a=t&&setTimeout(function(){a=null,i(new Ze("timeout of ".concat(t,"ms exceeded"),Ze.ETIMEDOUT))},t),o=function(){e&&(a&&clearTimeout(a),a=null,e.forEach(function(e){e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(function(e){r||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});var s=n.signal;return s.unsubscribe=function(){return Ie.asap(o)},s}};function on(e,t){this.v=e,this.k=t}function sn(e){return function(){return new un(e.apply(this,arguments))}}function un(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof on;Promise.resolve(s?o.v:o).then(function(n){if(s){var u="return"===t&&o.k?t:"next";if(!o.k||n.done)return r(u,n);n=e[u](n).value}i(!!a.done,n)},function(e){r("throw",e)})}catch(e){i(2,e)}}function i(e,i){2===e?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}function cn(e){return new on(e,0)}function ln(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new on(r,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):r("return",e)}),t}function fn(e){var t,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new dn(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function dn(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return dn=function(e){this.s=e,this.n=e.next},dn.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new dn(e)}un.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},un.prototype.next=function(e){return this._invoke("next",e)},un.prototype.throw=function(e){return this._invoke("throw",e)},un.prototype.return=function(e){return this._invoke("return",e)};var pn=w.mark(function e(t,n){var r,i,a;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=2;break}return e.next=1,t;case 1:return e.abrupt("return");case 2:i=0;case 3:if(!(i<r)){e.next=5;break}return a=i+n,e.next=4,t.slice(i,a);case 4:i=a,e.next=3;break;case 5:case"end":return e.stop()}},e)}),hn=function(){var e=sn(w.mark(function e(t,n){var r,i,a,o,s,u,c;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=1,o=fn(vn(t));case 2:return e.next=3,cn(o.next());case 3:if(!(r=!(s=e.sent).done)){e.next=5;break}return u=s.value,e.delegateYield(ln(fn(pn(u,n))),"t0",4);case 4:r=!1,e.next=2;break;case 5:e.next=7;break;case 6:e.prev=6,c=e.catch(1),i=!0,a=c;case 7:if(e.prev=7,e.prev=8,!r||null==o.return){e.next=9;break}return e.next=9,cn(o.return());case 9:if(e.prev=9,!i){e.next=10;break}throw a;case 10:return e.finish(9);case 11:return e.finish(7);case 12:case"end":return e.stop()}},e,null,[[1,6,7,12],[8,,9,11]])}));return function(t,n){return e.apply(this,arguments)}}(),vn=function(){var e=sn(w.mark(function e(t){var n,r,i,a;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=2;break}return e.delegateYield(ln(fn(t)),"t0",1);case 1:return e.abrupt("return");case 2:n=t.getReader(),e.prev=3;case 4:return e.next=5,cn(n.read());case 5:if(r=e.sent,i=r.done,a=r.value,!i){e.next=6;break}return e.abrupt("continue",8);case 6:return e.next=7,a;case 7:e.next=4;break;case 8:return e.prev=8,e.next=9,cn(n.cancel());case 9:return e.finish(8);case 10:case"end":return e.stop()}},e,null,[[3,,8,10]])}));return function(t){return e.apply(this,arguments)}}(),mn=function(e,t,n,r){var i,a=hn(e,t),o=0,s=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return je(w.mark(function t(){var r,i,u,c,l,f;return w.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=1,a.next();case 1:if(r=t.sent,i=r.done,u=r.value,!i){t.next=2;break}return s(),e.close(),t.abrupt("return");case 2:c=u.byteLength,n&&(l=o+=c,n(l)),e.enqueue(new Uint8Array(u)),t.next=4;break;case 3:throw t.prev=3,f=t.catch(0),s(f),f;case 4:case"end":return t.stop()}},t,null,[[0,3]])}))()},cancel:function(e){return s(e),a.return()}},{highWaterMark:2})},gn=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},yn=function(e,t,n){return t+2<n&&gn(e.charCodeAt(t+1))&&gn(e.charCodeAt(t+2))},bn=function(e){return e<=57?e-48:(223&e)-55},Sn=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e},_n=function(e){return 9===e||10===e||12===e||13===e||32===e},wn=function(e){for(var t=e.length,n=0,r=0,i=!1,a=0;a<t;a++){var o=e.charCodeAt(a);37===o&&yn(e,a,t)&&(o=16*bn(e.charCodeAt(a+1))+bn(e.charCodeAt(a+2)),a+=2),_n(o)||(61!==o?!Sn(o)||r>0?i=!0:n++:r++)}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?function(e){var t=e.length,n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)}(e):function(e){var t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)}(n)};function On(e){var t="string"==typeof e?e.indexOf("#"):-1;return function(e,t){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var n=e.indexOf(",");if(n<0)return 0;var r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);for(var a=0,o=0,s=i.length;o<s;o++){var u=i.charCodeAt(o);if(37===u&&yn(i,o,s))a+=1,o+=2;else if(u<128)a+=1;else if(u<2048)a+=2;else if(u>=55296&&u<=56319&&o+1<s){var c=i.charCodeAt(o+1);c>=56320&&c<=57343?(a+=4,o++):a+=3}else a+=3}return a}(-1===t?e:e.slice(0,t),wn)}var xn="1.20.0",kn={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},Tn=Ie.isFunction,An=function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},En=function(e){if(!Ie.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},In=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},Nn=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},jn=function(e){var t=void 0!==Ie.global&&null!==Ie.global?Ie.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Ie.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),a=i.fetch,o=i.Request,s=i.Response,u=a?Tn(a):"function"==typeof fetch,c=Tn(o),l=Tn(s);if(!u)return!1;var f,d=u&&Tn(n),p=u&&("function"==typeof r?(f=new r,function(e){return f.encode(e)}):function(){var e=je(w.mark(function e(t){var n,r;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=Uint8Array,e.next=1,new o(t).arrayBuffer();case 1:return r=e.sent,e.abrupt("return",new n(r));case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),h=c&&d&&In(function(){var e=!1,t=new o(Tt.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),v=l&&d&&In(function(){return Ie.isReadableStream(new s("").body)}),m={stream:v&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach(function(e){!m[e]&&(m[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Ze("Response type '".concat(e,"' is not supported"),Ze.ERR_NOT_SUPPORT,n)})});var g=function(){var e=je(w.mark(function e(t){var n;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=1;break}return e.abrupt("return",0);case 1:if(!Ie.isBlob(t)){e.next=2;break}return e.abrupt("return",t.size);case 2:if(!Ie.isSpecCompliantForm(t)){e.next=4;break}return n=new o(Tt.origin,{method:"POST",body:t}),e.next=3,n.arrayBuffer();case 3:case 6:return e.abrupt("return",e.sent.byteLength);case 4:if(!Ie.isArrayBufferView(t)&&!Ie.isArrayBuffer(t)){e.next=5;break}return e.abrupt("return",t.byteLength);case 5:if(Ie.isURLSearchParams(t)&&(t+=""),!Ie.isString(t)){e.next=7;break}return e.next=6,p(t);case 7:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),y=function(){var e=je(w.mark(function e(t,n){var r;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ie.toFiniteNumber(t.getContentLength()),e.abrupt("return",r??g(n));case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=je(w.mark(function e(t){var n,i,u,l,f,p,b,S,O,x,k,T,A,E,I,N,j,R,P,C,M,D,L,B,F,q,U,z,J,G,H,W,V,Q,K,X,Y,$,Z,ee,te,ne,re,ie,ae,oe,se,ue,ce,le,fe,de,pe,he,ve,me,ge,ye,be,Se,_e,we,Oe,xe;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=nn(t),i=n.url,u=n.method,l=n.data,f=n.signal,p=n.cancelToken,b=n.timeout,S=n.onDownloadProgress,O=n.onUploadProgress,x=n.responseType,k=n.headers,T=n.withCredentials,A=void 0===T?"same-origin":T,E=n.fetchOptions,I=n.maxContentLength,N=n.maxBodyLength,j=n.maxRedirects,R=Ie.isNumber(I)&&I>-1,P=Ie.isNumber(N)&&N>-1,C=function(e){return Ie.hasOwnProp(t,e)?t[e]:void 0},M=a||fetch,x=x?(x+"").toLowerCase():"text",D=an([f,p&&p.toAbortSignal()],b),L=null,B=D&&D.unsubscribe&&function(){D.unsubscribe()},q=null,U=function(){return new Ze("Request body larger than maxBodyLength limit",Ze.ERR_BAD_REQUEST,t,L)},e.prev=1,z=void 0,(J=C("auth"))&&(G=Ie.getSafeProp(J,"username")||"",H=Ie.getSafeProp(J,"password")||"",z={username:G,password:H}),Nn(i)&&(W=new URL(i,Tt.origin),z||!W.username&&!W.password||(V=En(W.username),Q=En(W.password),z={username:V,password:Q}),(W.username||W.password)&&(W.username="",W.password="",i=W.href)),z&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(An((z.username||"")+":"+(z.password||""))))),!R||"string"!=typeof i||!i.startsWith("data:")){e.next=2;break}if(!(On(i)>I)){e.next=2;break}throw new Ze("maxContentLength size of "+I+" exceeded",Ze.ERR_BAD_RESPONSE,t,L);case 2:if(!P||"get"===u||"head"===u){e.next=4;break}return e.next=3,g(l);case 3:if("number"!=typeof(K=e.sent)||!isFinite(K)){e.next=4;break}if(F=K,!(K>N)){e.next=4;break}throw U();case 4:if(X=P&&(Ie.isReadableStream(l)||Ie.isStream(l)),Y=function(e,t,n){return mn(e,65536,function(e){if(P&&e>N)throw q=U();t&&t(e)},n)},!h||"get"===u||"head"===u||!O&&!X){e.next=8;break}if(null!=F){e.next=6;break}return e.next=5,y(k,l);case 5:Oe=e.sent,e.next=7;break;case 6:Oe=F;case 7:(0!==(F=Oe)||X)&&($=new o(i,{method:"POST",body:l,duplex:"half"}),Ie.isFormData(l)&&(Z=$.headers.get("content-type"))&&k.setContentType(Z),$.body&&(ee=O&&Gt(F,Jt(Ht(O)))||[],te=_(ee,2),ne=te[0],re=te[1],l=Y($.body,ne,re))),e.next=10;break;case 8:if(!X||c||!d||"get"===u||"head"===u){e.next=9;break}l=Y(l),e.next=10;break;case 9:if(!X||!c||h||"get"===u||"head"===u){e.next=10;break}throw new Ze("Stream request bodies are not supported by the current fetch implementation",Ze.ERR_NOT_SUPPORT,t,L);case 10:return Ie.isString(A)||(A=A?"include":"omit"),ie=c&&"credentials"in o.prototype,Ie.isFormData(l)&&(ae=k.getContentType())&&/^multipart\/form-data/i.test(ae)&&!/boundary=/i.test(ae)&&k.delete("content-type"),k.set("User-Agent","axios/"+xn,!1),(oe=null==E?E:Object.assign(Object.create(null),E))&&(delete oe.body,delete oe.headers,delete oe.method,delete oe.signal,delete oe.duplex,delete oe.credentials),se=Object.assign(Object.create(null),oe,{signal:D,method:u.toUpperCase(),headers:Be(k.normalize()),body:l,duplex:"half",credentials:ie?A:void 0}),c&&(Ie.forEach(kn,function(e,t){void 0===se[t]&&(se[t]=e)}),void 0===se.signal&&(se.signal=null),void 0===se.body&&(se.body=null)),0===j&&(se.redirect="manual",oe&&(oe.redirect="manual")),L=c&&new o(i,se),e.next=11,c?M(L,oe):M(i,se);case 11:if(ue=e.sent,ce=Ve.from(ue.headers),!R){e.next=12;break}if(!(null!=(le=Ie.toFiniteNumber(ce.getContentLength()))&&le>I)){e.next=12;break}throw new Ze("maxContentLength size of "+I+" exceeded",Ze.ERR_BAD_RESPONSE,t,L);case 12:return fe=v&&("stream"===x||"response"===x),v&&ue.body&&(S||R||fe&&B)&&(de={},["status","statusText","headers"].forEach(function(e){de[e]=ue[e]}),pe=Ie.toFiniteNumber(ce.getContentLength()),he=S&&Gt(pe,Jt(Ht(S),!0))||[],ve=_(he,2),me=ve[0],ge=ve[1],ye=function(e){if(R&&e>I)throw new Ze("maxContentLength size of "+I+" exceeded",Ze.ERR_BAD_RESPONSE,t,L);me&&me(e)},ue=new s(mn(ue.body,65536,ye,function(){ge&&ge(),B&&B()}),de)),x=x||"text",e.next=13,m[Ie.findKey(m,x)||"text"](ue,t);case 13:if(be=e.sent,!R||v||fe){e.next=14;break}if(null!=be&&("number"==typeof be.byteLength?Se=be.byteLength:"number"==typeof be.size?Se=be.size:"string"==typeof be&&(Se="function"==typeof r?(new r).encode(be).byteLength:be.length)),!("number"==typeof Se&&Se>I)){e.next=14;break}throw new Ze("maxContentLength size of "+I+" exceeded",Ze.ERR_BAD_RESPONSE,t,L);case 14:return!fe&&B&&B(),e.next=15,new Promise(function(e,n){Ft(e,n,{data:be,headers:Ve.from(ue.headers),status:ue.status,statusText:ue.statusText,config:t,request:L})});case 15:return e.abrupt("return",e.sent);case 16:if(e.prev=16,xe=e.catch(1),B&&B(),!(D&&D.aborted&&D.reason instanceof Ze)){e.next=17;break}throw(_e=D.reason).config=t,L&&(_e.request=L),xe!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:xe,writable:!0,enumerable:!1,configurable:!0}),_e;case 17:if(!q){e.next=18;break}throw L&&!q.request&&(q.request=L),q;case 18:if(!(xe instanceof Ze)){e.next=19;break}throw L&&!xe.request&&(xe.request=L),xe;case 19:if(!xe||"TypeError"!==xe.name||!/Load failed|fetch/i.test(xe.message)){e.next=20;break}throw we=new Ze("Network Error",Ze.ERR_NETWORK,t,L,xe&&xe.response),Object.defineProperty(we,"cause",{__proto__:null,value:xe.cause||xe,writable:!0,enumerable:!1,configurable:!0}),we;case 20:throw Ze.from(xe,xe&&xe.code,t,L,xe&&xe.response);case 21:case"end":return e.stop()}},e,null,[[1,16]])}));return function(t){return e.apply(this,arguments)}}()},Rn=new Map,Pn=function(e){for(var t,n,r=e&&e.env||{},i=r.fetch,a=[r.Request,r.Response,i],o=a.length,s=Rn;o--;)t=a[o],void 0===(n=s.get(t))&&s.set(t,n=o?new Map:jn(r)),s=n;return n};Pn();var Cn={http:null,xhr:rn,fetch:{get:Pn}};Ie.forEach(Cn,function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Mn=function(e){return"- ".concat(e)},Dn=function(e){return Ie.isFunction(e)||null===e||!1===e};const Ln=function(e,t){for(var n,r,i=(e=Ie.isArray(e)?e:[e]).length,a={},o=0;o<i;o++){var s=void 0;if(r=n=e[o],!Dn(n)&&void 0===(r=Cn[(s=String(n)).toLowerCase()]))throw new Ze("Unknown adapter '".concat(s,"'"));if(r&&(Ie.isFunction(r)||(r=r.get(t))))break;a[s||"#"+o]=r}if(!r){var u=Object.entries(a).map(function(e){var t=_(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}),c=i?u.length>1?"since :\n"+u.map(Mn).join("\n"):" "+Mn(u[0]):"as no adapter specified";throw new Ze("There is no suitable adapter to dispatch the request "+c,Ze.ERR_NOT_SUPPORT)}return r};function Bn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bt(null,e)}function Fn(e){var t=Ie.toSafeFlatObject(e);return Bn(t),t.headers=Ve.from(Ie.getSafeProp(t,"headers")),t.data=Ct.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ln(t.adapter||Pt.adapter,t)(t).then(function(e){Bn(t),t.response=e;try{e.data=Ct.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Ve.from(e.headers),e},function(e){if(!Mt(e)&&(Bn(t),e&&e.response)){t.response=e.response;try{e.response.data=Ct.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Ve.from(e.response.headers)}return Promise.reject(e)})}var qn={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){qn[e]=function(n){return l(n)===e||"a"+(t<1?"n ":" ")+e}});var Un={};qn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+xn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Ze(r(i," has been removed"+(t?" in "+t:"")),Ze.ERR_DEPRECATED);return t&&!Un[i]&&(Un[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}},qn.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};const zn={assertOptions:function(e,t,n){if("object"!==l(e)||null===e)throw new Ze("options must be an object",Ze.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){var s=e[a],u=void 0===s||o(s,a,e);if(!0!==u)throw new Ze("option "+a+" must be "+u,Ze.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ze("Unknown option "+a,Ze.ERR_BAD_OPTION)}},validators:qn};var Jn=zn.validators,Gn=function(){return p(function e(t){c(this,e),this.defaults=t||{},this.interceptors={request:new vt,response:new vt}},[{key:"request",value:(e=je(w.mark(function e(t,n){var r,i,a,o,s,u,c,l;return w.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,this._request(t,n);case 1:return e.abrupt("return",e.sent);case 2:if(e.prev=2,(l=e.catch(0))instanceof Error)try{r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack,a="","string"==typeof i&&(o=i.indexOf("\n"),a=-1===o?"":i.slice(o+1)),l.stack?a&&(s=a.indexOf("\n"),u=-1===s?-1:a.indexOf("\n",s+1),c=-1===u?"":a.slice(u+1),String(l.stack).endsWith(c)||(l.stack+="\n"+a)):l.stack=a}catch(e){}throw l;case 3:case"end":return e.stop()}},e,this,[[0,2]])})),function(t,n){return e.apply(this,arguments)})},{key:"_request",value:function(e,t){var n=this;"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=en(this.defaults,t),i=r.transitional,a=r.paramsSerializer,o=r.headers;void 0!==i&&zn.assertOptions(i,{silentJSONParsing:Jn.transitional(Jn.boolean),forcedJSONParsing:Jn.transitional(Jn.boolean),clarifyTimeoutError:Jn.transitional(Jn.boolean),legacyInterceptorReqResOrdering:Jn.transitional(Jn.boolean),advertiseZstdAcceptEncoding:Jn.transitional(Jn.boolean),validateStatusUndefinedResolves:Jn.transitional(Jn.boolean)},!1),null!=a&&(Ie.isFunction(a)?t.paramsSerializer={serialize:a}:zn.assertOptions(a,{encode:Jn.function,serialize:Jn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),zn.assertOptions(t,{baseUrl:Jn.spelling("baseURL"),withXsrfToken:Jn.spelling("withXSRFToken")},!0),t.method=(Ie.getSafeProp(t,"method")||Ie.getSafeProp(this.defaults,"method")||"get").toLowerCase();var s=o&&Ie.merge(o.common,o[t.method]);o&&Ie.forEach(Nt.concat("common"),function(e){delete o[e]}),t.headers=Ve.concat(s,o);var u=[],c=!0;this.interceptors.request.forEach(function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){c=c&&e.synchronous;var n=t.transitional||mt;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)}});var l,f=[];this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)});var d,p=0;if(!c){var h=[Fn.bind(this),void 0];for(h.unshift.apply(h,u),h.push.apply(h,f),d=h.length,l=Promise.resolve(t);p<d;)l=l.then(h[p++],h[p++]);return l}d=u.length;for(var v=t;p<d;){var m=u[p++],g=u[p++];try{v=m?m(v):v}catch(e){if(!g){l=Promise.reject(e);break}try{var y=g.call(this,e);Ie.isThenable(y)&&(l=Promise.resolve(y).then(function(){return Fn.call(n,v)}))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Fn.call(this,v)}catch(e){l=Promise.reject(e)}for(p=0,d=f.length;p<d;)l=l.then(f[p++],f[p++]);return l}},{key:"getUri",value:function(e){return lt(Xt((e=en(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]);var e}();Ie.forEach(["delete","get","head","options"],function(e){Gn.prototype[e]=function(t,n){return this.request(en(n||{},{method:e,url:t,data:n&&Ie.hasOwnProp(n,"data")?n.data:void 0}))}}),Ie.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,i){return this.request(en(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gn.prototype[e]=t(),"query"!==e&&(Gn.prototype[e+"Form"]=t(!0))});const Hn=Gn;var Wn=function(){function e(t){if(c(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t(function(e,t,i){r.reason||(r.reason=new Bt(e,t,i),n(r.reason))})}return p(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e(function(e){t=e}),cancel:t}}}])}();const Vn=Wn;var Qn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Qn).forEach(function(e){var t=_(e,2),n=t[0],r=t[1];void 0===Qn[r]&&(Qn[r]=n)});const Kn=Qn;var Xn=function e(t){var n=new Hn(t),r=T(Hn.prototype.request,n);return Ie.extend(r,Hn.prototype,n,{allOwnKeys:!0}),Ie.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(en(t,n))},r}(Pt);Xn.Axios=Hn,Xn.CanceledError=Bt,Xn.CancelToken=Vn,Xn.isCancel=Mt,Xn.VERSION=xn,Xn.toFormData=it,Xn.AxiosError=Ze,Xn.Cancel=Xn.CanceledError,Xn.all=function(e){return Promise.all(e)},Xn.spread=function(e){return function(t){return e.apply(null,t)}},Xn.isAxiosError=function(e){return Ie.isObject(e)&&!0===e.isAxiosError},Xn.mergeConfig=en,Xn.AxiosHeaders=Ve,Xn.formToJSON=function(e){return It(Ie.isHTMLForm(e)?new FormData(e):e)},Xn.getAdapter=Ln,Xn.HttpStatusCode=Kn,Xn.default=Xn;const Yn=Xn;var $n=n(8529);function Zn(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function er(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function tr(e){er(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===l(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function nr(e,t){if(er(2,arguments),!t||"object"!==l(t))return new Date(NaN);var n=t.years?Zn(t.years):0,r=t.months?Zn(t.months):0,i=t.weeks?Zn(t.weeks):0,a=t.days?Zn(t.days):0,o=t.hours?Zn(t.hours):0,s=t.minutes?Zn(t.minutes):0,u=t.seconds?Zn(t.seconds):0,c=tr(e),f=r||n?function(e,t){er(2,arguments);var n=tr(e),r=Zn(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),a=new Date(n.getTime());return a.setMonth(n.getMonth()+r+1,0),i>=a.getDate()?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}(c,r+12*n):c,d=a||i?function(e,t){er(2,arguments);var n=tr(e),r=Zn(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}(f,a+7*i):f,p=1e3*(u+60*(s+60*o));return new Date(d.getTime()+p)}function rr(e,t){er(2,arguments);var n=tr(e),r=tr(t);return n.getTime()>r.getTime()}function ir(e,t){return er(2,arguments),tr(e).getTime()-tr(t).getTime()}var ar=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},or="gc_logger_requests",sr=[408,429,500,503,504],ur=[401],cr=new Map,lr=function(){return p(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;c(this,e),this.url=t,this.debugMode=n,this.customHeaders=r,this.sendQueue=[]},[{key:"postLogsToEndpoint",value:function(e){var t,n,r={promise:new Promise(function(e,r){t=e,n=r}),resolve:t,reject:n};return this.sendQueue.push({requestParams:e,deferred:r}),this.sendNextQueuedLogToServer(),this.debug("adding requestParams to sendQueue",{requestParams:e,updatedSendQueue:this.sendQueue.map(function(e){return e.requestParams}),hasPendingRequest:!!this.pendingRequest}),r.promise}},{key:"postLogsToEndpointInstantly",value:function(e,t){return ar(this,void 0,void 0,O().mark(function n(){var r;return O().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.debug("sending request instantly",{requestParams:e,sendQueue:this.sendQueue.map(function(e){return e.requestParams})}),navigator.onLine){n.next=1;break}return n.abrupt("return",this.saveRequestForLater(e));case 1:return n.prev=1,n.next=2,this.sendPostRequest(e);case 2:n.next=4;break;case 3:throw n.prev=3,r=n.catch(1),(null==t?void 0:t.saveOnFailure)&&this.saveRequestForLater(e),r;case 4:case"end":return n.stop()}},n,this,[[1,3]])}))}},{key:"saveRequestForLater",value:function(e){var t=this.getSavedRequests()||[],n=Object.assign({},e);delete n.accessToken,t.push(n),window.localStorage.setItem(or,JSON.stringify(t))}},{key:"getSavedRequests",value:function(){var e=window.localStorage.getItem(or);if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse saved messages, ignoring",{savedMessagesStr:e})}}},{key:"sendEntireQueue",value:function(){this.debug("sending all queued requests instantly to clear out sendQueue",{sendQueue:this.sendQueue.map(function(e){return e.requestParams})});for(var e,t=[];e=this.sendQueue.shift();)t.push(this.postLogsToEndpointInstantly(e.requestParams,{saveOnFailure:!0}));return t}},{key:"resetSendQueue",value:function(){this.debug("reseting send queue without sending currently queued data",{queueLength:this.sendQueue.length}),this.sendQueue=[]}},{key:"sendNextQueuedLogToServer",value:function(){return ar(this,void 0,void 0,O().mark(function e(){var t,n=this;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.pendingRequest&&0!==this.sendQueue.length){e.next=1;break}return this.debug("sendNextQueuedLogToServer() but not sending request",{hasPendingRequest:!!this.pendingRequest,sendQueueLength:this.sendQueue.length}),e.abrupt("return");case 1:return(t=this.sendQueue.shift()).deferred.promise.finally(function(){n.debug("queue item completed. removing from queue and resetting send queue",{queueItemRequestParams:t.requestParams,updatedSendQueue:n.sendQueue.map(function(e){return e.requestParams})}),n.pendingRequest=void 0,n.sendNextQueuedLogToServer()}),this.pendingRequest=t,this.debug("sending logs to server",{queueItem:t.requestParams,sendQueue:this.sendQueue.map(function(e){return e.requestParams})}),e.abrupt("return",(0,$n.backOff)(function(){return n.backoffFn(t.requestParams)},{retry:function(e){var t,r,i,a,o,s=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status,u=null==e?void 0:e.code,c=(null===(i=null===(r=e.response)||void 0===r?void 0:r.headers)||void 0===i?void 0:i["retry-after"])||(null===(o=null===(a=e.response)||void 0===a?void 0:a.getResponseHeader)||void 0===o?void 0:o.call(a,"retry-after"));if(c){var l=nr(new Date,{seconds:parseInt(c,10)});n.retryAfter&&!rr(l,n.retryAfter)||(n.retryAfter=l)}return navigator.onLine&&(s&&sr.includes(s)||"ERR_NETWORK"===u)},numOfAttempts:10,startingDelay:0,delayFirstAttempt:!1,maxDelay:15e3}).then(function(e){n.debug("successfully sent logs to server",{requestParams:t.requestParams,response:e}),t.deferred.resolve(e)}).catch(this.handleBackoffError.bind(this,t)));case 2:case"end":return e.stop()}},e,this)}))}},{key:"handleBackoffError",value:function(e,t){var n,r=null===(n=t.response)||void 0===n?void 0:n.status;r&&sr.includes(r)||ur.includes(r)||"ERR_NETWORK"===t.code?(this.debug("Failed to sends logs to the server, moving request to the end of the queue",{requestParams:e.requestParams,error:t}),this.saveRequestForLater(e.requestParams)):this.debug("ERROR sending logs to server",{requestParams:e.requestParams,error:t}),e.deferred.reject(Object.assign(Object.assign({},t),{id:"rejectionSpot1"}))}},{key:"retryAfterTimerCheck",value:function(){return ar(this,void 0,void 0,O().mark(function e(){var t;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.retryAfter){e.next=1;break}return e.abrupt("return");case 1:if(!rr(Date.now(),this.retryAfter)){e.next=2;break}return this.retryAfter=void 0,e.abrupt("return");case 2:return t=ir(this.retryAfter,Date.now()),this.debug('Respecting "retry-after" response header, waiting to send request',{millisecondsToWait:t}),e.next=3,new Promise(function(e){setTimeout(function(){e(null)},t)});case 3:return e.abrupt("return",this.retryAfterTimerCheck());case 4:case"end":return e.stop()}},e,this)}))}},{key:"backoffFn",value:function(e){return ar(this,void 0,void 0,O().mark(function t(){var n,r,i,a=this;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.retryAfterTimerCheck();case 1:return n=e.accessToken,t.next=2,this.sendPostRequest(e);case 2:return r=t.sent,(i=this.getSavedRequests())&&(window.localStorage.removeItem(or),i.map(function(e){var t=Object.assign({accessToken:n},e);a.postLogsToEndpoint(t)})),t.abrupt("return",r);case 3:case"end":return t.stop()}},t,this)}))}},{key:"sendPostRequest",value:function(e){this.debug("issuing POST request",{requestParams:e});var t=Object.assign({},e);delete t.accessToken;var n=Object.assign({authorization:"Bearer ".concat(e.accessToken),"content-type":"application/json; charset=UTF-8"},this.customHeaders||{});return Yn({method:"post",url:this.url,responseType:"text",data:t,headers:n})}},{key:"debug",value:function(e,t){this.debugMode&&console.log("%c [DEBUG:log-uploader] ".concat(e),"color: #32a0a8",k(t))}}])}(),fr=14500,dr=function(){return p(function e(t){var n=this;if(c(this,e),this.isInitialized=!1,this.logBuffer=[],this.debounceTimer=null,this.logger=t,!t.config.url||!t.config.appVersion){var r="Missing `url` and/or `appVersion` config options to set up server logging. Not sending logs to server for this logger instance";throw this.logger.error(r,{providedConfig:t.config},{skipServer:!0}),new Error(r)}this.isInitialized=!0,this.debounceLogUploadTime=t.config.uploadDebounceTime||4e3,this.logUploader=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>3?arguments[3]:void 0;if(arguments.length>2?arguments[2]:void 0)return new lr(e,t,n);var r=cr.get(e);return r||(r=new lr(e,t,n),cr.set(e,r)),r}(t.config.url,t.config.debugMode,t.config.useUniqueLogUploader,t.config.customHeaders),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&n.sendAllLogsInstantly()}),this.logger.on("onStop",function(e){n.debug("`onStop` received. Clearing logBuffer and sendQueue",{logBuffer:n.logBuffer,sendQueue:n.logUploader.sendQueue}),n.logBuffer=[],n.logUploader.resetSendQueue()})},[{key:"addLogToSend",value:function(e,t,n){if(this.isInitialized){var r=this.convertToLogMessage(t,n),i=this.convertToTrace(e,r),a=x(i);if(a>fr){var o=this.truncateLog(e,r);if(null===o)return void this.logger.error("truncated message is too large to send to server. not sending message",{originalTrace:i,originalTraceSize:x(i),truncatedTrace:o,truncatedTraceSize:x(o)},{skipServer:!0});a=x(o),i=o}var s,u=!this.logBuffer.length;if((s=u?{size:0,traces:[]}:this.logBuffer[this.logBuffer.length-1]).size+a>fr)return this.debug("`exceedsMaxLogSize` was `true`",{logBuffer:this.logBuffer,bufferItem:s,incomingTrace:i,incomingTraceSize:a,maxAllowedTraceSize:fr}),this.logBuffer.push({size:a,traces:[i]}),this.debug("calling sendLogsToServer(true)",{logBuffer:this.logBuffer}),void this.sendLogsToServer(!0);s.size+=a,s.traces.push(i),u&&(this.debug("`this.logBuffer` was empty. pushing new buffer item",{logBuffer:this.logBuffer,bufferItem:s}),this.logBuffer.push(s)),this.debug("calling sendLogsToServer()",{logBuffer:this.logBuffer}),this.sendLogsToServer()}}},{key:"sendAllLogsInstantly",value:function(){var e=this;return this.logUploader.sendEntireQueue().concat(this.logBuffer.map(function(t){return e.logUploader.postLogsToEndpointInstantly(e.convertToRequestParams(t.traces.reverse()),{saveOnFailure:!0})}))}},{key:"sendLogsToServer",value:function(){var e,t,n,r,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=this,n=void 0,r=void 0,i=O().mark(function t(){var n,r,i,o,s,u=this;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logBuffer.length){t.next=1;break}return clearTimeout(this.debounceTimer),this.debounceTimer=null,this.debug("buffer empty, not sending http request"),t.abrupt("return");case 1:if(a){t.next=2;break}return this.debounceTimer?this.debug("sendLogsToServer() 'immediate' is false. 'debounceTimer' is already running"):(this.debug("sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to ".concat(this.debounceLogUploadTime,"ms")),this.debounceTimer=setTimeout(function(){return u.sendLogsToServer(!0)},this.debounceLogUploadTime)),t.abrupt("return");case 2:return clearTimeout(this.debounceTimer),this.debounceTimer=null,n=this.logBuffer.splice(0,1),r=_(n,1),i=r[0],t.prev=3,this.debug("calling logUploader.postLogsToEndpoint() with",{bufferItem:i,newLogBuffer:this.logBuffer}),t.next=4,this.logUploader.postLogsToEndpoint(this.convertToRequestParams(i.traces.reverse()));case 4:t.next=6;break;case 5:t.prev=5,s=t.catch(3),this.logger.emit("onError",s),this.logger.error("Error sending logs to server",s,{skipServer:!0}),o=(null==s?void 0:s.status)?parseInt(s.status,10):parseInt(null===(e=null==s?void 0:s.response)||void 0===e?void 0:e.status,10),[401,403,404].includes(o)&&(this.logger.warn("received a ".concat(o," from logUploader. stopping logging to server")),this.logger.stopServerLogging());case 6:return t.prev=6,this.sendLogsToServer(),t.finish(6);case 7:case"end":return t.stop()}},t,this,[[3,5,6,7]])}),new(r||(r=Promise))(function(e,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(o,s)}u((i=i.apply(t,n||[])).next())})}},{key:"truncateLog",value:function(e,t){var n,r,i=x(this.convertToTrace(e,t)),a=k(t),o="[[TRUNCATED]]";return a?(a.details=o,n=this.convertToTrace(e,a),(r=x(n))<=fr?(this.logger.warn("message too large to send to server. truncated log details",{originalLog:t,truncatedLog:a,originalTraceSize:i,truncatedTraceSize:r,maxAllowedTraceSize:fr},{skipServer:!0}),n):(a.message="".concat(a.message.substr(0,150),"... ").concat(o),n=this.convertToTrace(e,a),(r=x(n))<=fr?(this.logger.warn("message too large to send to server. truncated log details & log message",{originalLog:t,truncatedLog:a,originalTraceSize:i,truncatedTraceSize:r,maxAllowedTraceSize:fr},{skipServer:!0}),n):null)):null}},{key:"convertToLogMessage",value:function(e,t){var n={clientTime:(new Date).toISOString(),clientId:this.logger.clientId,message:e,details:t},r=this.logger.config,i=r.originAppName,a=r.originAppVersion,o=r.originAppId;return i&&(n.originAppName=i,n.originAppVersion=a,n.originAppId=o),n}},{key:"convertToTrace",value:function(e,t){return{topic:this.logger.config.appName,level:e.toUpperCase(),message:S()(t)}}},{key:"convertToRequestParams",value:function(e){return{accessToken:this.logger.config.accessToken,app:{appId:this.logger.config.appName,appVersion:this.logger.config.appVersion},traces:e}}},{key:"debug",value:function(e,t){this.logger.config.debugMode&&console.log("%c [DEBUG:".concat(this.logger.config.appName,"] ").concat(e),"color: #32a852",k(t))}}])}();function pr(e,t,n){return t=v(t),h(e,hr()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function hr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hr=function(){return!!e})()}var vr=function(e){function t(e){var n;return c(this,t),(n=pr(this,t)).defaultFormatter=function(e,t,r,i,a){if(i.skipDefaultFormatter)return a();t instanceof Error&&(r=r||t,t=t.message);var o=n.config.appName?"[".concat(n.config.appName,"] "):"";a(e,t="".concat(o).concat(t),r,i)},n.logMessage=function(e,t,r,i){if(!i.skipSecondaryLogger)try{var a=[t];void 0!==r&&a.push(n.config.stringify?S()(r):r),n.secondaryLogger[e].apply(n.secondaryLogger,a)}catch(e){console.error("Error logging using custom logger passed into `genesys-cloud-client-logger`",{error:e,secondaryLogger:n.secondaryLogger,message:t,details:r,messageOptions:i})}!i.skipServer&&!n.stopReason&&n.serverLogger&&n.logRank(e)>=n.logRank(n.config.logLevel)&&n.serverLogger.addLogToSend(e,t,r)},Object.defineProperty(n,"clientId",{value:globalThis.crypto.randomUUID(),writable:!1}),n.config=Object.assign({},e),n.secondaryLogger=n.config.logger||console,delete n.config.logger,-1===n.logRank(n.config.logLevel)&&(e.logLevel&&n.warn('Invalid log level: "'.concat(e.logLevel,'". Default "info" will be used instead.'),null,{skipServer:!0}),n.config.logLevel="info"),!e.appName&&e.logTopic&&(n.warn("`logTopic` has been renamed to `appName`. Please use `appName`",null,{skipServer:!0}),n.config.appName=e.logTopic),!1!==n.config.initializeServerLogging&&(n.serverLogger=new dr(n)),n.config.startServerLoggingPaused&&n.stopServerLogging(),n}return g(t,e),p(t,[{key:"VERSION",get:function(){return t.VERSION}},{key:"setAccessToken",value:function(e){this.config.accessToken=e,401==this.stopReason&&this.startServerLogging()}},{key:"log",value:function(e,t,n){this.formatMessage("log",e,t,n)}},{key:"debug",value:function(e,t,n){this.formatMessage("debug",e,t,n)}},{key:"info",value:function(e,t,n){this.formatMessage("info",e,t,n)}},{key:"warn",value:function(e,t,n){this.formatMessage("warn",e,t,n)}},{key:"error",value:function(e,t,n){this.formatMessage("error",e,t,n)}},{key:"startServerLogging",value:function(){if(this.stopReason=void 0,!this.serverLogger)return this.warn("`startServerLogging` called but the logger instance is not configured to send logs to the server. Ignoring call to start sending logs to server.",void 0,{skipServer:!0});this.emit("onStart")}},{key:"stopServerLogging",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"force";"force"===this.stopReason&&"force"!==e||(this.stopReason=e,this.emit("onStop",e))}},{key:"sendAllLogsInstantly",value:function(){var e;return(null===(e=this.serverLogger)||void 0===e?void 0:e.sendAllLogsInstantly())||[]}},{key:"formatMessage",value:function(e,t,n,r){var i=[this.defaultFormatter.bind(this)];this.config.formatters&&(i=[].concat((0,u.A)(this.config.formatters),[this.defaultFormatter.bind(this)])),this.callNextFormatter(i,e,t,n,r)}},{key:"callNextFormatter",value:function(e,t,n,r){var u,c=this,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},f=i(u=e)||(0,a.A)(u)||(0,o.A)(u)||s(),d=f[0],p=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(f).slice(1);if(!d)return this.logMessage(t,n,r,l);d(t,n,r,l,function(e,i,a,o){void 0!==e?c.callNextFormatter(p,e,i,a,o):c.callNextFormatter(p,t,n,r,l)})}},{key:"logRank",value:function(e){switch(e){case"log":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;default:return-1}}}])}(y.EventEmitter);vr.VERSION="5.0.0";const mr=vr},3394(e,t,n){t.RateLimiter=n(9040),t.TokenBucket=n(2157)},8280(e,t,n){var r=n(440);e.exports=function(){if(void 0!==r&&r.hrtime){var e=r.hrtime(),t=e[0],n=e[1];return 1e3*t+Math.floor(n/1e6)}return(new Date).getTime()}},9040(e,t,n){var r=n(440),i=n(2157),a=n(8280),o=function(e,t,n){this.tokenBucket=new i(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=a(),this.tokensThisInterval=0,this.fireImmediately=n};o.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return r.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var n=this,i=a();if((i<this.curIntervalStart||i-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=i,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)r.nextTick(t.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-i);setTimeout(function(){n.tokenBucket.removeTokens(e,s)},o)}return!1}return this.tokenBucket.removeTokens(e,s);function s(r,i){if(r)return t(r,null);n.tokensThisInterval+=e,t(null,i)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=a();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},e.exports=o},2157(e,t,n){var r=n(440),i=function(e,t,n,r){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=r,this.content=0,this.lastDrip=+new Date};i.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var n=this;return this.bucketSize?e>this.bucketSize?(r.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),e>this.content?i():this.parentBucket?this.parentBucket.removeTokens(e,function(r,a){return r?t(r,null):e>n.content?i():(n.content-=e,void t(null,Math.min(a,n.content)))}):(this.content-=e,r.nextTick(t.bind(null,null,this.content)),!0)):(r.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0);function i(){var r=Math.ceil((e-n.content)*(n.interval/n.tokensPerInterval));return setTimeout(function(){n.removeTokens(e,t)},r),!1}},tryRemoveTokens:function(e){return!(this.bucketSize&&(e>this.bucketSize||(this.drip(),e>this.content||this.parentBucket&&!this.parentBucket.tryRemoveTokens(e)||(this.content-=e,0))))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},e.exports=i},5039(e,t,n){var r=n(3738),i="Expected a function",a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,l="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,f="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=l||f||Function("return this")(),p=Object.prototype.toString,h=Math.max,v=Math.min,m=function(){return d.Date.now()};function g(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(i);return g(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),function(e,t,n){var r,a,o,s,u,c,l=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(i);function b(t){var n=r,i=a;return r=a=void 0,l=t,s=e.apply(i,n)}function S(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function _(){var e=m();if(S(e))return w(e);u=setTimeout(_,function(e){var n=t-(e-c);return d?v(n,o-(e-l)):n}(e))}function w(e){return u=void 0,p&&r?b(e):(r=a=void 0,s)}function O(){var e=m(),n=S(e);if(r=arguments,a=this,c=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(_,t),f?b(e):s}(c);if(d)return u=setTimeout(_,t),b(c)}return void 0===u&&(u=setTimeout(_,t)),s}return t=y(t)||0,g(n)&&(f=!!n.leading,o=(d="maxWait"in n)?h(y(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),O.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=c=a=u=void 0},O.flush=function(){return void 0===u?s:w(m())},O}(e,t,{leading:r,maxWait:t,trailing:a})}},440(e){var t=e.exports={};function n(){}t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=n,t.addListener=n,t.once=n,t.off=n,t.removeListener=n,t.removeAllListeners=n,t.emit=n,t.prependListener=n,t.prependOnceListener=n,t.nextTick=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];return window.queueMicrotask(function(){return e.apply(void 0,n)})},t.listeners=function(e){return[]},t.cwd=function(){return"/"},t.umask=function(){return 0},t.binding=function(e){throw new Error("process.binding is not supported")},t.chdir=function(e){throw new Error("process.chdir is not supported")}},6218(e,t,n){"use strict";n.r(t),n.d(t,{decode:()=>_,encode:()=>w,toASCII:()=>x,toUnicode:()=>O,ucs2decode:()=>m,ucs2encode:()=>g});var r=n(436);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var o=2147483647,s=36,u=/^xn--/,c=/[^\0-\x7F]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function h(e){throw new RangeError(f[e])}function v(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]);var i=function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(l,".")).split("."),t).join(".");return r+i}function m(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}var g=function(e){return String.fromCodePoint.apply(String,(0,r.A)(e))},y=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:s},b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},S=function(e,t,n){var r=0;for(e=n?d(e/700):e>>1,e+=d(e/t);e>455;r+=s)e=d(e/35);return d(r+36*e/(e+38))},_=function(e){var t=[],n=e.length,r=0,i=128,a=72,u=e.lastIndexOf("-");u<0&&(u=0);for(var c=0;c<u;++c)e.charCodeAt(c)>=128&&h("not-basic"),t.push(e.charCodeAt(c));for(var l=u>0?u+1:0;l<n;){for(var f=r,p=1,v=s;;v+=s){l>=n&&h("invalid-input");var m=y(e.charCodeAt(l++));m>=s&&h("invalid-input"),m>d((o-r)/p)&&h("overflow"),r+=m*p;var g=v<=a?1:v>=a+26?26:v-a;if(m<g)break;var b=s-g;p>d(o/b)&&h("overflow"),p*=b}var _=t.length+1;a=S(r-f,_,0==f),d(r/_)>o-i&&h("overflow"),i+=d(r/_),r%=_,t.splice(r++,0,i)}return String.fromCodePoint.apply(String,t)},w=function(e){var t,n=[],r=(e=m(e)).length,a=128,u=0,c=72,l=i(e);try{for(l.s();!(t=l.n()).done;){var f=t.value;f<128&&n.push(p(f))}}catch(e){l.e(e)}finally{l.f()}var v=n.length,g=v;for(v&&n.push("-");g<r;){var y,_=o,w=i(e);try{for(w.s();!(y=w.n()).done;){var O=y.value;O>=a&&O<_&&(_=O)}}catch(e){w.e(e)}finally{w.f()}var x=g+1;_-a>d((o-u)/x)&&h("overflow"),u+=(_-a)*x,a=_;var k,T=i(e);try{for(T.s();!(k=T.n()).done;){var A=k.value;if(A<a&&++u>o&&h("overflow"),A===a){for(var E=u,I=s;;I+=s){var N=I<=c?1:I>=c+26?26:I-c;if(E<N)break;var j=E-N,R=s-N;n.push(p(b(N+j%R,0))),E=d(j/R)}n.push(p(b(E,0))),c=S(u,x,g===v),u=0,++g}}}catch(e){T.e(e)}finally{T.f()}++u,++a}return n.join("")},O=function(e){return v(e,function(e){return u.test(e)?_(e.slice(4).toLowerCase()):e})},x=function(e){return v(e,function(e){return c.test(e)?"xn--"+w(e):e})};const k={version:"2.3.1",ucs2:{decode:m,encode:g},decode:_,encode:w,toASCII:x,toUnicode:O};n.d(t,["default",0,k])},80(e,t,n){var r=n(3738),i=Object.prototype.hasOwnProperty;function a(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(n){if(null===n||"object"!==r(n))return n;if(-1!==t.indexOf(n))return"[Circular]";if(t.push(n),"function"==typeof n.toJSON)try{var o=e(n.toJSON());return t.pop(),o}catch(e){return a(e)}if(Array.isArray(n)){var s=n.map(e);return t.pop(),s}var u=Object.keys(n).reduce(function(t,r){return t[r]=e(function(e,t){if(i.call(e,t))try{return e[t]}catch(e){return a(e)}return e[t]}(n,r)),t},{});return t.pop(),u}(e)}e.exports=function(e,t,n){return JSON.stringify(o(e),t,n)},e.exports.ensureProperties=o},722(e,t,n){"use strict";e=n.nmd(e);var r=n(3738),i={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},i.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},i.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:void 0===n[t[r]]&&(n[t[r]]=t[r+1])}return n},i.writeCandidate=function(e){var t=[];t.push(e.foundation);var n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&void 0!==e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},i.parseIceOptions=function(e){return e.substring(14).split(" ")},i.parseRtpMap=function(e){var t=e.substring(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.parseExtmap=function(e){var t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},i.parseFmtp=function(e){for(var t,n={},r=e.substring(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},i.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){var t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},i.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},i.parseSsrcGroup=function(e){var t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(function(e){return parseInt(e,10)})}},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substring(6)},i.parseFingerprint=function(e){var t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},i.parseCryptoLine=function(e){var t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},i.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===r(e.keyParams)?i.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},i.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},i.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},i.getCryptoParameters=function(e,t){return i.matchPrefix(e+t,"a=crypto:").map(i.parseCryptoLine)},i.getIceParameters=function(e,t){var n=i.matchPrefix(e+t,"a=ice-ufrag:")[0],r=i.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&r?{usernameFragment:n.substring(12),password:r.substring(10)}:null},i.writeIceParameters=function(e){var t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},i.parseRtpParameters=function(e){var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" ");t.profile=n[2];for(var r=3;r<n.length;r++){var a=n[r],o=i.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(o){var s=i.parseRtpMap(o),u=i.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=u.length?i.parseFmtp(u[0]):{},s.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(i.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}i.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(i.parseExtmap(e))});var c=i.matchPrefix(e,"a=rtcp-fb:* ").map(i.parseRtcpFb);return t.codecs.forEach(function(e){c.forEach(function(t){e.rtcpFeedback.find(function(e){return e.type===t.type&&e.parameter===t.parameter})||e.rtcpFeedback.push(t)})}),t},i.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" "+(t.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)});var r=0;return t.codecs.forEach(function(e){e.maxptime>r&&(r=e.maxptime)}),r>0&&(n+="a=maxptime:"+r+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=i.writeExtmap(e)}),n},i.parseRtpEncodingParameters=function(e){var t,n=[],r=i.parseRtpParameters(e),a=-1!==r.fecMechanisms.indexOf("RED"),o=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),u=s.length>0&&s[0].ssrc,c=i.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substring(17).split(" ").map(function(e){return parseInt(e,10)})});c.length>0&&c[0].length>1&&c[0][0]===u&&(t=c[0][1]),r.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10)};u&&t&&(r.rtx={ssrc:t}),n.push(r),a&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:u,mechanism:o?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&u&&n.push({ssrc:u});var l=i.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=l})),n},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var r=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=r.length>0,t.compound=0===r.length;var a=i.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},i.writeRtcpParameters=function(e){var t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},i.parseMsid=function(e){var t,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substring(7).split(" "))[0],track:t[1]};var r=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return r.length>0?{stream:(t=r[0].value.split(" "))[0],track:t[1]}:void 0},i.parseSctpDescription=function(e){var t,n=i.parseMLine(e),r=i.matchPrefix(e,"a=max-message-size:");r.length>0&&(t=parseInt(r[0].substring(19),10)),isNaN(t)&&(t=65536);var a=i.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:n.fmt,maxMessageSize:t};var o=i.matchPrefix(e,"a=sctpmap:");if(o.length>0){var s=o[0].substring(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},i.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,22)},i.writeSessionBoilerplate=function(e,t,n){var r=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||i.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.getDirection=function(e,t){for(var n=i.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substring(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substring(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){var t=i.splitLines(e)[0].substring(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){var t=i.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},i.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=i.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===r(e)&&(e.exports=i)},2354(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JINGLE_INFO_RECEIVED_5=t.JINGLE_INFO_CHECKSUM_5=t.JINGLE_INFO_RINGING=t.JINGLE_INFO_ACTIVE=t.JINGLE_INFO_UNHOLD=t.JINGLE_INFO_HOLD=t.JINGLE_INFO_UNMUTE=t.JINGLE_INFO_MUTE=t.JINGLE_INFO=t.USER_ACTIVITY_SPECIFIC=t.USER_ACTIVITY_GENERAL=t.USER_MOODS=t.JingleReasonCondition=t.JingleErrorCondition=t.JingleAction=t.JingleContentSenders=t.JingleApplicationDirection=t.JingleSessionRole=t.ChatState=t.PubsubErrorCondition=t.MUCStatusCode=t.MUCRole=t.MUCAffiliation=t.DataFormFieldType=t.DataFormType=t.RosterSubscription=t.PresenceShow=t.IQType=t.PresenceType=t.MessageType=t.StanzaErrorCondition=t.StreamErrorCondition=t.SASLFailureCondition=t.StreamType=t.VERSION=void 0,t.sendersToDirection=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.JingleContentSenders.Both,r=e===t.JingleSessionRole.Initiator;switch(n){case t.JingleContentSenders.Initiator:return r?t.JingleApplicationDirection.Send:t.JingleApplicationDirection.Receive;case t.JingleContentSenders.Responder:return r?t.JingleApplicationDirection.Receive:t.JingleApplicationDirection.Send;case t.JingleContentSenders.Both:return t.JingleApplicationDirection.SendReceive}return t.JingleApplicationDirection.Inactive},t.directionToSenders=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.JingleApplicationDirection.SendReceive,r=e===t.JingleSessionRole.Initiator;switch(n){case t.JingleApplicationDirection.Send:return r?t.JingleContentSenders.Initiator:t.JingleContentSenders.Responder;case t.JingleApplicationDirection.Receive:return r?t.JingleContentSenders.Responder:t.JingleContentSenders.Initiator;case t.JingleApplicationDirection.SendReceive:return t.JingleContentSenders.Both}return t.JingleContentSenders.None};var r=n(6519);t.VERSION="12.22.1";var i="not-authorized";t.StreamType={Bosh:r.NS_BOSH,Client:r.NS_CLIENT,Component:r.NS_COMPONENT,Server:r.NS_SERVER},t.SASLFailureCondition={AccountDisabled:"account-disabled",CredentialsExpired:"credentials-expired",EncryptionRequired:"encryption-required",IncorrectEncoding:"incorrect-encoding",InvalidAuthzid:"invalid-authzid",InvalidMechanism:"invalid-mechanism",MalformedRequest:"malformed-request",MechanismTooWeak:"mechanism-too-weak",NotAuthorized:i,TemporaryAuthFailure:"temporary-auth-failure"},t.StreamErrorCondition={BadFormat:"bad-format",BadNamespacePrefix:"bad-namespace-prefix",Conflict:"conflict",ConnectionTimeout:"connection-timeout",HostGone:"host-gone",HostUnknown:"host-unknown",ImproperAddressing:"improper-addressing",InternalServerError:"internal-server-error",InvalidFrom:"invalid-from",InvalidId:"invalid-id",InvalidNamespace:"invalid-namespace",InvalidXML:"invalid-xml",NotAuthorized:i,NotWellFormed:"not-well-formed",PolicyViolation:"policy-violation",RemoteConnectionFailed:"remote-connection-failed",Reset:"reset",ResourceConstraint:"resource-constraint",RestrictedXML:"restricted-xml",SeeOtherHost:"see-other-host",SystemShutdown:"system-shutdown",UndefinedCondition:"undefined-condition",UnsupportedEncoding:"unsupported-encoding",UnsupportedStanzaType:"unsupported-stanza-type",UnsupportedVersion:"unsupported-version"},t.StanzaErrorCondition={BadRequest:"bad-request",Conflict:"conflict",FeatureNotImplemented:"feature-not-implemented",Forbidden:"forbidden",Gone:"gone",InternalServerError:"internal-server-error",ItemNotFound:"item-not-found",JIDMalformed:"jid-malformed",NotAcceptable:"not-acceptable",NotAllowed:"not-allowed",NotAuthorized:i,PolicyViolation:"policy-violation",RecipientUnavailable:"recipient-unavailable",Redirect:"redirect",RegistrationRequired:"registration-required",RemoteServerNotFound:"remote-server-not-found",RemoteServerTimeout:"remote-server-timeout",ResourceConstraint:"resource-constraint",ServiceUnavailable:"service-unavailable",SubscriptionRequired:"subscription-required",UndefinedCondition:"undefined-condition",UnexpectedRequest:"unexpected-request"},t.MessageType={Chat:"chat",Error:"error",GroupChat:"groupchat",Headline:"headline",Normal:"normal"},t.PresenceType={Available:void 0,Error:"error",Probe:"probe",Subscribe:"subscribe",Subscribed:"subscribed",Unavailable:"unavailable",Unsubscribe:"unsubscribe",Unsubscribed:"unsubscribed"},t.IQType={Error:"error",Get:"get",Result:"result",Set:"set"},t.PresenceShow={Away:"away",Chat:"chat",DoNotDisturb:"dnd",ExtendedAway:"xa"},t.RosterSubscription={Both:"both",From:"from",None:"none",ReceivePresenceOnly:"to",Remove:"remove",SendAndReceivePresence:"both",SendPresenceOnly:"from",To:"to"},t.DataFormType={Cancel:"cancel",Form:"form",Result:"result",Submit:"submit"},t.DataFormFieldType={Boolean:"boolean",Fixed:"fixed",Hidden:"hidden",JID:"jid-single",JIDMultiple:"jid-multi",List:"list-single",ListMultiple:"list-multi",Password:"text-private",Text:"text-single",TextMultiple:"text-multi",TextPrivate:"text-private"},t.MUCAffiliation={Admin:"admin",Banned:"outcast",Member:"member",None:"none",Outcast:"outcast",Owner:"owner"},t.MUCRole={Moderator:"moderator",None:"none",Participant:"participant",Visitor:"visitor"},t.MUCStatusCode={AffiliationChanged:"101",AffiliationLost:"321",Banned:"301",Error:"333",Kicked:"307",LoggingDisabled:"171",LoggingEnabled:"170",MembershipLost:"322",NickChanged:"303",NickChangedByService:"210",NonAnonymous:"172",NonAnonymousRoom:"100",NonPrivacyConfigurationChange:"104",RoomCreated:"201",SelfPresence:"110",SemiAnonymous:"173",Shutdown:"332",UnavailableMembersListed:"102",UnavailableMembersNotListed:"103"},t.PubsubErrorCondition={ClosedNode:"closed-node",ConfigurationRequired:"configuration-required",InvalidJID:"invalid-jid",InvalidOptions:"invalid-options",InvalidPayload:"invalid-payload",InvalidSubscriptionId:"invalid-subid",ItemForbidden:"item-forbidden",ItemRequired:"item-required",JIDRequired:"jid-required",MaxItemsExceeded:"max-items-exceeded",MaxNodesExceeded:"max-nodes-exceeded",NodeIdRequired:"nodeid-required",NotInRosterGroup:"not-in-roster-group",NotSubscribed:"not-subscribed",PayloadRequired:"payload-required",PayloadTooBig:"payload-too-big",PendingSubscription:"pending-subscription",PresenceSubscriptionRequired:"presence-subscription-required",SubscriptionIdRequired:"subid-required",TooManySubscriptions:"too-many-subscriptions",Unsupported:"unsupported",UnsupportedAccessModel:"unsupported-access-model"},t.ChatState={Active:"active",Composing:"composing",Gone:"gone",Inactive:"inactive",Paused:"paused"},t.JingleSessionRole={Initiator:"initiator",Responder:"responder"},t.JingleApplicationDirection={Inactive:"inactive",Receive:"recvonly",Send:"sendonly",SendReceive:"sendrecv"},t.JingleContentSenders={Both:"both",Initiator:"initiator",None:"none",Responder:"responder"},t.JingleAction={ContentAccept:"content-accept",ContentAdd:"content-add",ContentModify:"content-modify",ContentReject:"content-reject",ContentRemove:"content-remove",DescriptionInfo:"description-info",SecurityInfo:"security-info",SessionAccept:"session-accept",SessionInfo:"session-info",SessionInitiate:"session-initiate",SessionTerminate:"session-terminate",TransportAccept:"transport-accept",TransportInfo:"transport-info",TransportReject:"transport-reject",TransportReplace:"transport-replace"},t.JingleErrorCondition={OutOfOrder:"out-of-order",TieBreak:"tie-break",UnknownContent:"unknown-content",UnknownSession:"unknown-session",UnsupportedInfo:"unsupported-info"},t.JingleReasonCondition={AlternativeSession:"alternative-session",Busy:"busy",Cancel:"cancel",ConnectivityError:"connectivity-error",Decline:"decline",Expired:"expired",FailedApplication:"failed-application",FailedTransport:"failed-transport",GeneralError:"general-error",Gone:"gone",IncompatibleParameters:"incompatible-parameters",MediaError:"media-error",SecurityError:"security-error",Success:"success",Timeout:"timeout",UnsupportedApplications:"unsupported-applications",UnsupportedTransports:"unsupported-transports"},t.USER_MOODS=["afraid","amazed","amorous","angry","annoyed","anxious","aroused","ashamed","bored","brave","calm","cautious","cold","confident","confused","contemplative","contented","cranky","crazy","creative","curious","dejected","depressed","disappointed","disgusted","dismayed","distracted","embarrassed","envious","excited","flirtatious","frustrated","grateful","grieving","grumpy","guilty","happy","hopeful","hot","humbled","humiliated","hungry","hurt","impressed","in_awe","in_love","indignant","interested","intoxicated","invincible","jealous","lonely","lost","lucky","mean","moody","nervous","neutral","offended","outraged","playful","proud","relaxed","relieved","remorseful","restless","sad","sarcastic","satisfied","serious","shocked","shy","sick","sleepy","spontaneous","stressed","strong","surprised","thankful","thirsty","tired","undefined","weak","worried"],t.USER_ACTIVITY_GENERAL=["doing_chores","drinking","eating","exercising","grooming","having_appointment","inactive","relaxing","talking","traveling","undefined","working"],t.USER_ACTIVITY_SPECIFIC=["at_the_spa","brushing_teeth","buying_groceries","cleaning","coding","commuting","cooking","cycling","cycling","dancing","day_off","doing_maintenance","doing_the_dishes","doing_the_laundry","driving","fishing","gaming","gardening","getting_a_haircut","going_out","hanging_out","having_a_beer","having_a_snack","having_breakfast","having_coffee","having_dinner","having_lunch","having_tea","hiding","hiking","in_a_car","in_a_meeting","in_real_life","jogging","on_a_bus","on_a_plane","on_a_train","on_a_trip","on_the_phone","on_vacation","on_video_phone","other","partying","playing_sports","praying","reading","rehearsing","running","running_an_errand","scheduled_holiday","shaving","shopping","skiing","sleeping","smoking","socializing","studying","sunbathing","swimming","taking_a_bath","taking_a_shower","thinking","walking","walking_the_dog","watching_a_movie","watching_tv","working_out","writing"],t.JINGLE_INFO=function(e,t){return"{".concat(e,"}").concat(t)},t.JINGLE_INFO_MUTE=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"mute"),t.JINGLE_INFO_UNMUTE=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"unmute"),t.JINGLE_INFO_HOLD=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"hold"),t.JINGLE_INFO_UNHOLD=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"unhold"),t.JINGLE_INFO_ACTIVE=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"active"),t.JINGLE_INFO_RINGING=(0,t.JINGLE_INFO)(r.NS_JINGLE_RTP_INFO_1,"ringing"),t.JINGLE_INFO_CHECKSUM_5=(0,t.JINGLE_INFO)(r.NS_JINGLE_FILE_TRANSFER_5,"checksum"),t.JINGLE_INFO_RECEIVED_5=(0,t.JINGLE_INFO)(r.NS_JINGLE_FILE_TRANSFER_5,"received")},6519(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NS_AVATAR_METADATA=t.NS_AVATAR_DATA=t.NS_ROSTER_DELIMITER=t.NS_GEOLOC=t.NS_AMP=t.NS_INBAND_REGISTRATION=t.NS_REGISTER=t.NS_XHTML_IM=t.NS_XHTML=t.NS_HTTP_AUTH=t.NS_OOB_TRANSFER=t.NS_OOB=t.NS_SOCKS5=t.NS_PUBSUB_OWNER=t.NS_PUBSUB_EVENT=t.NS_PUBSUB_ERRORS=t.NS_PUBSUB=t.NS_RSM=t.NS_SEARCH=t.NS_VCARD_TEMP=t.NS_ADHOC_COMMANDS=t.NS_PRIVATE=t.NS_BOOKMARKS=t.NS_IBB=t.NS_MUC_USER=t.NS_MUC_OWNER=t.NS_MUC_ADMIN=t.NS_MUC=t.NS_ADDRESS=t.NS_DISCO_ITEMS=t.NS_DISCO_INFO=t.NS_LEGACY_CHAT_EVENTS=t.NS_PRIVACY=t.NS_LAST_ACTIVITY=t.NS_RPC=t.NS_DATAFORM=t.NS_FRAMING=t.NS_SUBSCRIPTION_PREAPPROVAL=t.NS_ROSTER_VERSIONING=t.NS_ROSTER=t.NS_STARTTLS=t.NS_STREAMS=t.NS_STREAM=t.NS_STANZAS=t.NS_SESSION=t.NS_SERVER=t.NS_SASL=t.NS_CLIENT=t.NS_BIND=t.NS_ATOM=void 0,t.NS_JINGLE_FILE_TRANSFER_4=t.NS_JINGLE_FILE_TRANSFER_3=t.NS_SOFTWARE_INFO=t.NS_BOB=t.NS_ATTENTION_0=t.NS_DATAFORM_MEDIA=t.NS_DISCO_EXTERNAL_2=t.NS_DISCO_EXTERNAL_1=t.NS_BOSH_XMPP=t.NS_DELAY=t.NS_TIME=t.NS_PING=t.NS_SMACKS_3=t.NS_BLOCKING_ERRORS=t.NS_BLOCKING=t.NS_INVISIBLE_0=t.NS_RECEIPTS=t.NS_JINGLE_RAW_UDP_1=t.NS_JINGLE_ICE_UDP_1=t.NS_NICK=t.NS_LANG_TRANS_ITEMS=t.NS_LANG_TRANS=t.NS_JINGLE_RTP_VIDEO=t.NS_JINGLE_RTP_AUDIO=t.NS_JINGLE_RTP_INFO_1=t.NS_JINGLE_RTP_ERRORS_1=t.NS_JINGLE_RTP_1=t.NS_JINGLE_ERRORS_1=t.NS_JINGLE_1=t.NS_PEP_NOTIFY=t.NS_CAPTCHA=t.NS_ALT_CONNECTIONS_XBOSH=t.NS_ALT_CONNECTIONS_WEBSOCKET=t.NS_VCARD_TEMP_UPDATE=t.NS_REACH_0=t.NS_ROSTER_NOTES=t.NS_ROSTER_EXCHANGE=t.NS_DATAFORM_LAYOUT=t.NS_COMPRESSION=t.NS_COMPRESSION_FEATURE=t.NS_SHIM=t.NS_BOSH=t.NS_DATAFORM_VALIDATION=t.NS_TUNE=t.NS_DISCO_LEGACY_CAPS=t.NS_COMPONENT=t.NS_ACTIVITY=t.NS_MOOD=t.NS_VERSION=t.NS_CHAT_STATES=void 0,t.NS_OMEMO_AXOLOTL=t.NS_SPOILER_0=t.NS_EME_0=t.NS_REFERENCE_0=t.NS_JINGLE_ICE_0=t.NS_JINGLE_HTTP_UPLOAD_0=t.NS_JINGLE_HTTP_0=t.NS_HTTP_UPLOAD_0=t.NS_SID_0=t.NS_JINGLE_PUB_1=t.NS_PUSH_0=t.NS_DELEGATION_1=t.NS_JINGLE_MSG_INITIATE_0=t.NS_CSI_0=t.NS_JINGLE_DTLS_SCTP_1=t.NS_JINGLE_RTP_SSMA_0=t.NS_JINGLE_GROUPING_0=t.NS_JSON_0=t.NS_HINTS=t.NS_CHAT_MARKERS_0=t.NS_JINGLE_DTLS_0=t.NS_IDLE_1=t.NS_HATS_0=t.NS_MAM_2=t.NS_MAM_1=t.NS_MAM_0=t.NS_MAM_TMP=t.NS_PSA=t.NS_CORRECTION_0=t.NS_MUC_UNIQUE=t.NS_RTT_0=t.NS_HASH_NAME=t.NS_HASHES_2=t.NS_HASHES_1=t.NS_FORWARD_0=t.NS_JINGLE_RTP_HDREXT_0=t.NS_JINGLE_RTP_RTCP_FB_0=t.NS_CARBONS_2=t.NS_DECLOAKING_0=t.NS_THUMBS_1=t.NS_THUMBS_0=t.NS_JINGLE_RTP_ZRTP_1=t.NS_JINGLE_IBB_1=t.NS_JINGLE_SOCKS5_1=t.NS_SEC_LABEL_ESS_0=t.NS_SEC_LABEL_CATALOG_2=t.NS_SEC_LABEL_0=t.NS_MUC_DIRECT_INVITE=t.NS_JINGLE_XML_0=t.NS_JINGLE_FILE_TRANSFER_5=void 0,t.NS_JINGLE_RTP_MSID_0=t.NS_XRD=t.NS_JSON_MESSAGE_0=t.NS_OCCUPANT_0=t.NS_OMEMO_AXOLOTL_BUNDLE=t.NS_OMEMO_AXOLOTL_BUNDLES=t.NS_OMEMO_AXOLOTL_DEVICELIST=void 0,t.NS_ATOM="http://www.w3.org/2005/Atom",t.NS_BIND="urn:ietf:params:xml:ns:xmpp-bind",t.NS_CLIENT="jabber:client",t.NS_SASL="urn:ietf:params:xml:ns:xmpp-sasl",t.NS_SERVER="jabber:server",t.NS_SESSION="urn:ietf:params:xml:ns:xmpp-session",t.NS_STANZAS="urn:ietf:params:xml:ns:xmpp-stanzas",t.NS_STREAM="http://etherx.jabber.org/streams",t.NS_STREAMS="urn:ietf:params:xml:ns:xmpp-streams",t.NS_STARTTLS="urn:ietf:params:xml:ns:xmpp-tls",t.NS_ROSTER="jabber:iq:roster",t.NS_ROSTER_VERSIONING="urn:xmpp:features:rosterver",t.NS_SUBSCRIPTION_PREAPPROVAL="urn:xmpp:features:pre-approval",t.NS_FRAMING="urn:ietf:params:xml:ns:xmpp-framing",t.NS_DATAFORM="jabber:x:data",t.NS_RPC="jabber:iq:rpc",t.NS_LAST_ACTIVITY="jabber:iq:last",t.NS_PRIVACY="jabber:iq:privacy",t.NS_LEGACY_CHAT_EVENTS="jabber:x:event",t.NS_DISCO_INFO="http://jabber.org/protocol/disco#info",t.NS_DISCO_ITEMS="http://jabber.org/protocol/disco#items",t.NS_ADDRESS="http://jabber.org/protocol/address",t.NS_MUC="http://jabber.org/protocol/muc",t.NS_MUC_ADMIN="http://jabber.org/protocol/muc#admin",t.NS_MUC_OWNER="http://jabber.org/protocol/muc#owner",t.NS_MUC_USER="http://jabber.org/protocol/muc#user",t.NS_IBB="http://jabber.org/protocol/ibb",t.NS_BOOKMARKS="storage:bookmarks",t.NS_PRIVATE="jabber:iq:private",t.NS_ADHOC_COMMANDS="http://jabber.org/protocol/commands",t.NS_VCARD_TEMP="vcard-temp",t.NS_SEARCH="jabber:iq:search",t.NS_RSM="http://jabber.org/protocol/rsm",t.NS_PUBSUB="http://jabber.org/protocol/pubsub",t.NS_PUBSUB_ERRORS="http://jabber.org/protocol/pubsub#errors",t.NS_PUBSUB_EVENT="http://jabber.org/protocol/pubsub#event",t.NS_PUBSUB_OWNER="http://jabber.org/protocol/pubsub#owner",t.NS_SOCKS5="http://jabber.org/protocol/bytestreams",t.NS_OOB="jabber:x:oob",t.NS_OOB_TRANSFER="jabber:iq:oob",t.NS_HTTP_AUTH="http://jabber.org/protocol/http-auth",t.NS_XHTML="http://www.w3.org/1999/xhtml",t.NS_XHTML_IM="http://jabber.org/protocol/xhtml-im",t.NS_REGISTER="jabber:iq:register",t.NS_INBAND_REGISTRATION="http://jabber.org/features/iq-register",t.NS_AMP="http://jabber.org/protocol/amp",t.NS_GEOLOC="http://jabber.org/protocol/geoloc",t.NS_ROSTER_DELIMITER="roster:delimiter",t.NS_AVATAR_DATA="urn:xmpp:avatar:data",t.NS_AVATAR_METADATA="urn:xmpp:avatar:metadata",t.NS_CHAT_STATES="http://jabber.org/protocol/chatstates",t.NS_VERSION="jabber:iq:version",t.NS_MOOD="http://jabber.org/protocol/mood",t.NS_ACTIVITY="http://jabber.org/protocol/activity",t.NS_COMPONENT="jabber:component:accept",t.NS_DISCO_LEGACY_CAPS="http://jabber.org/protocol/caps",t.NS_TUNE="http://jabber.org/protocol/tune",t.NS_DATAFORM_VALIDATION="http://jabber.org/protocol/xdata-validate",t.NS_BOSH="http://jabber.org/protocol/httpbind",t.NS_SHIM="http://jabber.org/protocol/shim",t.NS_COMPRESSION_FEATURE="http://jabber.org/features/compress",t.NS_COMPRESSION="http://jabber.org/protocol/compress",t.NS_DATAFORM_LAYOUT="http://jabber.org/protocol/xdata-layout",t.NS_ROSTER_EXCHANGE="http://jabber.org/protocol/rosterx",t.NS_ROSTER_NOTES="storage:rosternotes",t.NS_REACH_0="urn:xmpp:reach:0",t.NS_VCARD_TEMP_UPDATE="vcard-temp:x:update",t.NS_ALT_CONNECTIONS_WEBSOCKET="urn:xmpp:alt-connections:websocket",t.NS_ALT_CONNECTIONS_XBOSH="urn:xmpp:alt-connections:xbosh",t.NS_CAPTCHA="urn:xmpp:captcha",t.NS_PEP_NOTIFY=function(e){return"".concat(e,"+notify")},t.NS_JINGLE_1="urn:xmpp:jingle:1",t.NS_JINGLE_ERRORS_1="urn:xmpp:jingle:errors:1",t.NS_JINGLE_RTP_1="urn:xmpp:jingle:apps:rtp:1",t.NS_JINGLE_RTP_ERRORS_1="urn:xmpp:jingle:apps:rtp:errors:1",t.NS_JINGLE_RTP_INFO_1="urn:xmpp:jingle:apps:rtp:info:1",t.NS_JINGLE_RTP_AUDIO="urn:xmpp:jingle:apps:rtp:audio",t.NS_JINGLE_RTP_VIDEO="urn:xmpp:jingle:apps:rtp:video",t.NS_LANG_TRANS="urn:xmpp:langtrans",t.NS_LANG_TRANS_ITEMS="urn:xmpp:langtrans:items",t.NS_NICK="http://jabber.org/protocol/nick",t.NS_JINGLE_ICE_UDP_1="urn:xmpp:jingle:transports:ice-udp:1",t.NS_JINGLE_RAW_UDP_1="urn:xmpp:jingle:transports:raw-udp:1",t.NS_RECEIPTS="urn:xmpp:receipts",t.NS_INVISIBLE_0="urn:xmpp:invisible:0",t.NS_BLOCKING="urn:xmpp:blocking",t.NS_BLOCKING_ERRORS="urn:xmpp:blocking:errors",t.NS_SMACKS_3="urn:xmpp:sm:3",t.NS_PING="urn:xmpp:ping",t.NS_TIME="urn:xmpp:time",t.NS_DELAY="urn:xmpp:delay",t.NS_BOSH_XMPP="urn:xmpp:xbosh",t.NS_DISCO_EXTERNAL_1="urn:xmpp:extdisco:1",t.NS_DISCO_EXTERNAL_2="urn:xmpp:extdisco:2",t.NS_DATAFORM_MEDIA="urn:xmpp:media-element",t.NS_ATTENTION_0="urn:xmpp:attention:0",t.NS_BOB="urn:xmpp:bob",t.NS_SOFTWARE_INFO="urn:xmpp:dataforms:softwareinfo",t.NS_JINGLE_FILE_TRANSFER_3="urn:xmpp:jingle:apps:file-transfer:3",t.NS_JINGLE_FILE_TRANSFER_4="urn:xmpp:jingle:apps:file-transfer:4",t.NS_JINGLE_FILE_TRANSFER_5="urn:xmpp:jingle:apps:file-transfer:5",t.NS_JINGLE_XML_0="urn:xmpp:jingle:apps:xmlstream:0",t.NS_MUC_DIRECT_INVITE="jabber:x:conference",t.NS_SEC_LABEL_0="urn:xmpp:sec-label:0",t.NS_SEC_LABEL_CATALOG_2="urn:xmpp:sec-label:catalog:2",t.NS_SEC_LABEL_ESS_0="urn:xmpp:sec-label:ess:0",t.NS_JINGLE_SOCKS5_1="urn:xmpp:jingle:transports:s5b:1",t.NS_JINGLE_IBB_1="urn:xmpp:jingle:transports:ibb:1",t.NS_JINGLE_RTP_ZRTP_1="urn:xmpp:jingle:apps:rtp:zrtp:1",t.NS_THUMBS_0="urn:xmpp:thumbs:0",t.NS_THUMBS_1="urn:xmpp:thumbs:1",t.NS_DECLOAKING_0="urn:xmpp:decloaking:0",t.NS_CARBONS_2="urn:xmpp:carbons:2",t.NS_JINGLE_RTP_RTCP_FB_0="urn:xmpp:jingle:apps:rtp:rtcp-fb:0",t.NS_JINGLE_RTP_HDREXT_0="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0",t.NS_FORWARD_0="urn:xmpp:forward:0",t.NS_HASHES_1="urn:xmpp:hashes:1",t.NS_HASHES_2="urn:xmpp:hashes:2",t.NS_HASH_NAME=function(e){return"urn:xmpp:hash-function-text-names:".concat(e)},t.NS_RTT_0="urn:xmpp:rtt:0",t.NS_MUC_UNIQUE="http://jabber.org/protocol/muc#unique",t.NS_CORRECTION_0="urn:xmpp:message-correct:0",t.NS_PSA="urn:xmpp:psa",t.NS_MAM_TMP="urn:xmpp:mam:tmp",t.NS_MAM_0="urn:xmpp:mam:0",t.NS_MAM_1="urn:xmpp:mam:1",t.NS_MAM_2="urn:xmpp:mam:2",t.NS_HATS_0="urn:xmpp:hats:0",t.NS_IDLE_1="urn:xmpp:idle:1",t.NS_JINGLE_DTLS_0="urn:xmpp:jingle:apps:dtls:0",t.NS_CHAT_MARKERS_0="urn:xmpp:chat-markers:0",t.NS_HINTS="urn:xmpp:hints",t.NS_JSON_0="urn:xmpp:json:0",t.NS_JINGLE_GROUPING_0="urn:xmpp:jingle:apps:grouping:0",t.NS_JINGLE_RTP_SSMA_0="urn:xmpp:jingle:apps:rtp:ssma:0",t.NS_JINGLE_DTLS_SCTP_1="urn:xmpp:jingle:transports:dtls-sctp:1",t.NS_CSI_0="urn:xmpp:csi:0",t.NS_JINGLE_MSG_INITIATE_0="urn:xmpp:jingle:jingle-message:0",t.NS_DELEGATION_1="urn:xmpp:delegation:1",t.NS_PUSH_0="urn:xmpp:push:0",t.NS_JINGLE_PUB_1="urn:xmpp:jinglepub:1",t.NS_SID_0="urn:xmpp:sid:0",t.NS_HTTP_UPLOAD_0="urn:xmpp:http:upload:0",t.NS_JINGLE_HTTP_0="urn:xmpp:jingle:transports:http:0",t.NS_JINGLE_HTTP_UPLOAD_0="urn:xmpp:jingle:transports:http:upload:0",t.NS_JINGLE_ICE_0="urn:xmpp:jingle:transports:ice:0",t.NS_REFERENCE_0="urn:xmpp:reference:0",t.NS_EME_0="urn:xmpp:eme:0",t.NS_SPOILER_0="urn:xmpp:spoiler:0",t.NS_OMEMO_AXOLOTL="eu.siacs.conversations.axolotl",t.NS_OMEMO_AXOLOTL_DEVICELIST="eu.siacs.conversations.axolotl.devicelist",t.NS_OMEMO_AXOLOTL_BUNDLES="eu.siacs.conversations.axolotl.bundles",t.NS_OMEMO_AXOLOTL_BUNDLE=function(e){return"".concat(t.NS_OMEMO_AXOLOTL_BUNDLES,":").concat(e)},t.NS_OCCUPANT_0="urn:xmpp:occupant-id:0",t.NS_JSON_MESSAGE_0="urn:xmpp:json-msg:0",t.NS_XRD="http://docs.oasis-open.org/ns/xri/xrd-1.0",t.NS_JINGLE_RTP_MSID_0="urn:xmpp:jingle:apps:rtp:msid:0"},9978(e,t,n){"use strict";var r=n(4756),i=n(3738),a=n(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutPromise=function(e,t){return c.apply(this,arguments)},t.promiseAny=function(e){return l.apply(this,arguments)},t.shuffle=function(e){for(var t=e.length;t>0;){var n=Math.floor(Math.random()*t),r=e[t-=1];e[t]=e[n],e[n]=r}return e},t.sleep=function(e){return f.apply(this,arguments)},t.octetCompare=function(e,t){var n="string"==typeof e?o.Buffer.from(e,"utf8"):e,r="string"==typeof t?o.Buffer.from(t,"utf8"):t;return n.compare(r)},t.uuid=function(){var e=(0,o.randomBytes)(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=0;return[s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[15]]].join("")},t.reviveData=function(e,t){return d.has(e)&&t&&"string"==typeof t&&p.test(t)?new Date(t):t&&"object"===i(t)&&"Buffer"===t.type&&Array.isArray(t.data)?o.Buffer.from(t):t};for(var o=n(2208),s=[],u=0;u<256;++u)s[u]=(u+256).toString(16).substr(1);function c(){return c=a(r.mark(function e(t,n){var i,a,o,s=arguments;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>2&&void 0!==s[2]?s[2]:function(){},e.next=1,Promise.race([t,new Promise(function(e,t){a=setTimeout(function(){return t(i())},n)})]);case 1:return o=e.sent,clearTimeout(a),e.abrupt("return",o);case 2:case"end":return e.stop()}},e)})),c.apply(this,arguments)}function l(){return(l=a(r.mark(function e(t){var n,i;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Promise.all(t.map(function(e){return e.then(function(e){return Promise.reject(e)},function(e){return Promise.resolve(e)})}));case 1:return n=e.sent,e.abrupt("return",Promise.reject(n));case 2:return e.prev=2,i=e.catch(0),e.abrupt("return",Promise.resolve(i));case 3:case"end":return e.stop()}},e,null,[[0,2]])}))).apply(this,arguments)}function f(){return(f=a(r.mark(function e(t){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){return e()},t)}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}var d=new Set(["date","expires","httpUploadRetry","idleSince","published","since","stamp","timestamp","updated","utc"]),p=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:Z|((\+|-)([\d|:]*)))?$/},98(e,t,n){"use strict";var r=n(3693);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.mergeFields=function(e,t){var n,r=[],i=new Map,s=o(t);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.name&&i.set(u.name,u)}}catch(e){s.e(e)}finally{s.f()}var c,l=new Set,f=o(e);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.name&&i.has(d.name)?(r.push(a(a({},d),i.get(d.name))),l.add(d.name)):r.push(a({},d))}}catch(e){f.e(e)}finally{f.f()}var p,h=o(t);try{for(h.s();!(p=h.n()).done;){var v=p.value;(!v.name||v.name&&!l.has(v.name))&&r.push(a({},v))}}catch(e){h.e(e)}finally{h.f()}return r}},3032(e,t,n){"use strict";var r=n(1132),i=n(7383),a=n(4579),o=n(3693);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c,l=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),f=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=this&&this.__importStar||(c=function(e){return c=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},c(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=c(e),r=0;r<n.length;r++)"default"!==n[r]&&l(t,e,n[r]);return f(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});var p=d(n(1672)),h=function(){return a(function e(){i(this,e),o(this,"features",void 0),o(this,"identities",void 0),o(this,"extensions",void 0),o(this,"items",void 0),o(this,"caps",void 0),o(this,"capsAlgorithms",["sha-1"]),this.features=new Map,this.identities=new Map,this.extensions=new Map,this.items=new Map,this.caps=new Map,this.features.set("",new Set),this.identities.set("",[]),this.extensions.set("",[])},[{key:"getNodeInfo",value:function(e){return{extensions:r(this.extensions.get(e)||[]),features:r(this.features.get(e)||[]),identities:r(this.identities.get(e)||[])}}},{key:"addFeature",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.features.has(t)||this.features.set(t,new Set),this.features.get(t).add(e)}},{key:"addIdentity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.identities.has(t)||this.identities.set(t,[]),this.identities.get(t).push(e)}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.items.has(t)||this.items.set(t,[]),this.items.get(t).push(e)}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.extensions.has(t)||this.extensions.set(t,[]),this.extensions.get(t).push(e)}},{key:"updateCaps",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.capsAlgorithms,i={extensions:r(this.extensions.get("")),features:r(this.features.get("")),identities:r(this.identities.get("")),type:"info"},a=s(n);try{for(a.s();!(t=a.n()).done;){var o=t.value,u=p.generate(i,o);if(u){this.caps.set(o,{algorithm:o,node:e,value:u});var c,l="".concat(e,"#").concat(u),f=s(i.features);try{for(f.s();!(c=f.n()).done;){var d=c.value;this.addFeature(d,l)}}catch(e){f.e(e)}finally{f.f()}var h,v=s(i.identities);try{for(v.s();!(h=v.n()).done;){var m=h.value;this.addIdentity(m,l)}}catch(e){v.e(e)}finally{v.f()}var g,y=s(i.extensions);try{for(y.s();!(g=y.n()).done;){var b=g.value;this.addExtension(b,l)}}catch(e){y.e(e)}finally{y.f()}this.identities.set(l,i.identities),this.features.set(l,new Set(i.features)),this.extensions.set(l,i.extensions)}else this.caps.delete(o)}}catch(e){a.e(e)}finally{a.f()}return r(this.caps.values())}},{key:"getCaps",value:function(){return r(this.caps.values())}}])}();t.default=h},1672(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.generate=c,t.verify=function(e,t,n){var r=c(e,t);return!!r&&r===n};var a=n(2208),o=n(9978);function s(e){return a.Buffer.from(e.replace(/</g,"&lt;"),"utf-8")}function u(){var e,t=[],n=r(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(n.s();!(e=n.n()).done;){var i=e.value;"FORM_TYPE"!==i.name&&(i.rawValues?t.push({name:s(i.name),values:i.rawValues.map(function(e){return s(e)}).sort(o.octetCompare)}):Array.isArray(i.value)?t.push({name:s(i.name),values:i.value.map(function(e){return s(e)}).sort(o.octetCompare)}):!0===i.value||!1===i.value?t.push({name:s(i.name),values:[s(i.value?"1":"0")]}):t.push({name:s(i.name),values:[s(i.value||"")]}))}}catch(e){n.e(e)}finally{n.f()}t.sort(function(e,t){return(0,o.octetCompare)(e.name,t.name)});for(var a=[],u=0,c=t;u<c.length;u++){var l=c[u];a.push(l.name);var f,d=r(l.values);try{for(d.s();!(f=d.n()).done;){var p=f.value;a.push(p)}}catch(e){d.e(e)}finally{d.f()}}return a}function c(e,t){var n=[],i=a.Buffer.from("<","utf8"),c=function(e){n.push(e),n.push(i)},l=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var u=e.value,c=u.category,l=u.type,f=u.lang,d=u.name,p="".concat(c,"/").concat(l,"/").concat(f||"","/").concat(d||"");if(i.has(p))return null;i.add(p),n.push(s(p))}}catch(e){a.e(e)}finally{a.f()}return n.sort(o.octetCompare),n}(e.identities),f=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var u=e.value;if(i.has(u))return null;i.add(u),n.push(s(u))}}catch(e){a.e(e)}finally{a.f()}return n.sort(o.octetCompare),n}(e.features),d=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var c,l=e.value,f=void 0,d=r(l.fields||[]);try{for(d.s();!(c=d.n()).done;){var p=c.value;if("FORM_TYPE"===p.name&&"hidden"===p.type){if(p.rawValues&&1===p.rawValues.length){f=s(p.rawValues[0]);break}if(p.value&&"string"==typeof p.value){f=s(p.value);break}}}}catch(e){d.e(e)}finally{d.f()}if(f){if(i.has(f.toString()))return null;i.add(f.toString()),n.push({type:f,form:l})}}}catch(e){a.e(e)}finally{a.f()}n.sort(function(e,t){return(0,o.octetCompare)(e.type,t.type)});for(var h=[],v=0,m=n;v<m.length;v++){var g=m[v];h.push(g.type);var y,b=r(u(g.form.fields));try{for(b.s();!(y=b.n()).done;){var S=y.value;h.push(S)}}catch(e){b.e(e)}finally{b.f()}}return h}(e.extensions);if(!l||!f||!d)return null;var p,h=r(l);try{for(h.s();!(p=h.n()).done;)c(p.value)}catch(e){h.e(e)}finally{h.f()}var v,m=r(f);try{for(m.s();!(v=m.n()).done;)c(v.value)}catch(e){m.e(e)}finally{m.f()}var g,y=r(d);try{for(y.s();!(g=y.n()).done;)c(g.value)}catch(e){y.e(e)}finally{y.f()}return(0,a.createHash)(t).update(a.Buffer.concat(n)).digest("base64")}},5937(e,t,n){"use strict";var r=n(1132),i=n(5715),a=n(4756),o=n(9293),s=n(7383),u=n(4579),c=n(3693);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var v=n(2208),m=n(9978),g=n(7930),y=h(n(4218)),b=function(){return u(function e(){s(this,e),c(this,"resolver",void 0),c(this,"registry",void 0),c(this,"hostMetaCache",new Map),c(this,"hostMetaTTL",3e4),this.resolver=(0,v.createResolver)(),this.registry=new g.Registry,this.registry.define(y.default)},[{key:"getHostMeta",value:(p=o(a.mark(function e(t){var n,r,i=this;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.hostMetaCache.get(t))){e.next=2;break}if(!(n.created+this.hostMetaTTL<Date.now())){e.next=1;break}return e.abrupt("return",n.hostmeta);case 1:this.hostMetaCache.delete(t);case 2:return r=(0,m.promiseAny)([(0,v.fetch)("https://".concat(t,"/.well-known/host-meta.json")).then(function(){var e=o(a.mark(function e(t){return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=1;break}throw new Error("could-not-fetch-json");case 1:return e.abrupt("return",t.json());case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),(0,v.fetch)("https://".concat(t,"/.well-known/host-meta")).then(function(){var e=o(a.mark(function e(t){var n,r;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=1;break}throw new Error("could-not-fetch-xml");case 1:return e.next=2,t.text();case 2:if(n=e.sent,!(r=(0,g.parse)(n))){e.next=3;break}return e.abrupt("return",i.registry.import(r));case 3:throw new Error("could-not-import-xml");case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())]),this.hostMetaCache.set(t,{created:Date.now(),hostmeta:r}),r.catch(function(){i.hostMetaCache.delete(t)}),e.abrupt("return",r);case 3:case"end":return e.stop()}},e,this)})),function(e){return p.apply(this,arguments)})},{key:"resolveTXT",value:(l=o(a.mark(function e(t){var n,r;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null!==(n=null===(r=this.resolver)||void 0===r?void 0:r.resolveTxt(t))&&void 0!==n?n:[]);case 1:case"end":return e.stop()}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"resolve",value:(n=o(a.mark(function e(t,n){var r,i,o,s,u=arguments;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>2&&void 0!==u[2]?u[2]:{},this.resolver){e.next=1;break}return e.abrupt("return",[]);case 1:if(i=[],o=!0,!r.srvType){e.next=3;break}return e.next=2,this.resolveWeightedSRV(t,r.srvType,r.srvTypeSecure);case 2:s=e.sent,o=s.allowFallback,i=s.records.map(function(e){return{host:e.name,port:e.port,secure:e.secure}});case 3:return o&&i.push({host:t,port:n}),e.abrupt("return",i);case 4:case"end":return e.stop()}},e,this)})),function(e,t){return n.apply(this,arguments)})},{key:"resolveWeightedSRV",value:(t=o(a.mark(function e(t,n,o){var s,u,c,l,f,p,h,v,g,y,b,S,_,w,O,x;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Promise.all([this.resolveSRV(t,n),o?this.resolveSRV(t,o,!0):Promise.resolve({records:[],allowFallback:!1})]);case 1:s=e.sent,u=i(s,2),c=u[0],l=u[1],f=[].concat(r(c.records),r(l.records)),p=new Map,h=0,v=d(f);try{for(v.s();!(g=v.n()).done;)(y=g.value).id=h++,y.runningSum=0,p.has(y.priority)||p.set(y.priority,[]),p.get(y.priority).push(y)}catch(e){v.e(e)}finally{v.f()}b=function(e){for(var t=[];t.length<e.length;){var n,r=(0,m.shuffle)(e.filter(function(e){return 0===e.weight&&!e.used})),i=(0,m.shuffle)(e.filter(function(e){return 0!==e.weight&&!e.used})),a=0,o=d(i);try{for(o.s();!(n=o.n()).done;){var s=n.value;a+=s.weight,s.runningSum=a,r.push(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=Math.floor(Math.random()*(a+1)),l=d(r);try{for(l.s();!(u=l.n()).done;){var f=u.value;if(f.runningSum>=c){f.used=!0,t.push(f);break}}}catch(e){l.e(e)}finally{l.f()}}return t},S=[],_=d(Array.from(p.keys()).sort(function(e,t){return e<t?-1:e>t?1:0}));try{for(_.s();!(w=_.n()).done;)O=w.value,x=p.get(O),S=S.concat(b(x))}catch(e){_.e(e)}finally{_.f()}return e.abrupt("return",{records:S,allowFallback:c.allowFallback});case 2:case"end":return e.stop()}},e,this)})),function(e,n,r){return t.apply(this,arguments)})},{key:"resolveSRV",value:(e=o(a.mark(function e(t,n,r){var i,o,s,u,c,l;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,null===(o=this.resolver)||void 0===o?void 0:o.resolveSrv("".concat(n,".").concat(t));case 1:if(c=i=e.sent,!(u=null!==c)){e.next=2;break}u=void 0!==i;case 2:if(!u){e.next=3;break}l=i,e.next=4;break;case 3:l=[];case 4:if(1!==(s=l).length||"."!==s[0].name&&""!==s[0].name){e.next=5;break}return e.abrupt("return",{records:[],allowFallback:!1});case 5:return e.abrupt("return",{records:s.map(function(e){return f({secure:r},e)}).filter(function(e){return""!==e.name&&"."!==e.name}),allowFallback:!1});case 6:return e.prev=6,e.catch(0),e.abrupt("return",{records:[],allowFallback:!0});case 7:case"end":return e.stop()}},e,this,[[0,6]])})),function(t,n,r){return e.apply(this,arguments)})}]);var e,t,n,l,p}();t.default=b},895(e,t,n){"use strict";var r=n(9293),i=n(4756),a=n(7383),o=n(4579),s=n(3693),u=n(3344),c=n(2958);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.ResultSetPager=void 0,t.createPager=function(e){return new d(e)};var d=function(){return o(function e(t){var n,r,i;a(this,e),s(this,"query",void 0),s(this,"cursor",void 0),s(this,"direction",void 0),s(this,"reverse",void 0),s(this,"pageSize",void 0),s(this,"resultCount",void 0),s(this,"resultComplete",!1),s(this,"fetchedCount",0),s(this,"yieldedCount",0),this.cursor={first:t.before,last:t.after},this.query=t.query,this.direction=null!==(n=t.direction)&&void 0!==n?n:"forward",this.reverse=null!==(r=t.reverse)&&void 0!==r?r:"backward"===this.direction,this.pageSize=null!==(i=t.pageSize)&&void 0!==i?i:20},[{key:Symbol.asyncIterator,value:function(){var e=this;return c(i.mark(function t(){var n,r,a,o,s;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=[];case 1:return t.next=2,u(e.fetchPage());case 2:n=t.sent,r=l(n),t.prev=3,r.s();case 4:if((a=r.n()).done){t.next=6;break}return o=a.value,e.yieldedCount+=1,t.next=5,o;case 5:t.next=4;break;case 6:t.next=8;break;case 7:t.prev=7,s=t.catch(3),r.e(s);case 8:return t.prev=8,r.f(),t.finish(8);case 9:if(n.length>0){t.next=1;break}case 10:case"end":return t.stop()}},t,null,[[3,7,8,9]])}))()}},{key:"size",value:(t=r(i.mark(function e(){var t,n;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===this.resultCount){e.next=1;break}return e.abrupt("return",this.resultCount);case 1:return e.next=2,this.query({max:0});case 2:return t=e.sent,n=t.paging,this.resultCount=n.count,e.abrupt("return",n.count);case 3:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"queryCompleted",value:function(){return this.resultComplete}},{key:"finished",value:function(){return this.resultComplete&&this.yieldedCount===this.fetchedCount}},{key:"fetchPage",value:(e=r(i.mark(function e(){var t,n,r,a;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,this.query({before:"backward"===this.direction?null!==(t=this.cursor.first)&&void 0!==t?t:"":void 0,after:"forward"===this.direction?this.cursor.last:void 0,max:this.pageSize});case 1:return n=e.sent,r=n.results,a=n.paging,this.cursor=a,this.resultCount=a.count,this.fetchedCount+=r.length,(this.pageSize&&r.length<this.pageSize||this.resultCount&&this.fetchedCount===this.resultCount)&&(this.resultComplete=!0),this.reverse&&r.reverse(),e.abrupt("return",r);case 2:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();t.ResultSetPager=d},4755(e,t,n){"use strict";var r=n(1132),i=n(7383),a=n(4579),o=n(3693);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputBuffer=t.DisplayBuffer=void 0,t.diff=p;var f=n(1060),d=l(n(6218));function p(e,t){var n=e.length,r=t.length,i=Math.min(n,r),a=0;for(a=0;a<i&&e[a]===t[a];a++);var o=0;for(o=0;o<i-a&&e[n-o-1]===t[r-o-1];o++);var s=a+o,u=[];if(s<n&&u.push({length:n-s,position:n-o,type:"erase"}),s<r){var c=t.slice(a,a+r-s);u.push({position:a,text:d.default.ucs2.encode(c),type:"insert"})}return u}var h=function(){return a(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i(this,e),o(this,"synced",!1),o(this,"onStateChange",void 0),o(this,"cursorPosition",0),o(this,"ignoreWaits",!1),o(this,"buffer",void 0),o(this,"timeDeficit",0),o(this,"sequenceNumber",0),o(this,"actionQueue",void 0),this.onStateChange=t||function(){},this.ignoreWaits=n,this.buffer=[],this.resetActionQueue()},[{key:"text",get:function(){return d.default.ucs2.encode(this.buffer.slice())}},{key:"commit",value:function(){this.resetActionQueue()}},{key:"process",value:function(e){if("cancel"!==e.event&&"init"!==e.event){if("reset"===e.event||"new"===e.event?(this.resetActionQueue(),void 0!==e.seq&&(this.sequenceNumber=e.seq)):e.seq!==this.sequenceNumber&&(this.synced=!1),e.actions){var t,n=Date.now(),r=0,i=u(e.actions);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.baseTime=n+r,"wait"===a.type&&(r+=a.duration),this.actionQueue.push(a,0)}}catch(e){i.e(e)}finally{i.f()}}this.sequenceNumber=this.sequenceNumber+1}else this.resetActionQueue()}},{key:"insert",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.buffer.length;t=t.normalize("NFC");var i=d.default.ucs2.decode(t);(e=this.buffer).splice.apply(e,[n,0].concat(r(i))),this.cursorPosition=n+i.length,this.emitState()}},{key:"erase",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.buffer.length;t=Math.max(Math.min(t,this.buffer.length),0),e=Math.max(Math.min(e,this.text.length),0),this.buffer.splice(Math.max(t-e,0),e),this.cursorPosition=Math.max(t-e,0),this.emitState()}},{key:"emitState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.onStateChange(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({cursorPosition:this.cursorPosition,synced:this.synced,text:this.text},e))}},{key:"resetActionQueue",value:function(){var e=this;this.actionQueue&&this.actionQueue.kill(),this.sequenceNumber=0,this.synced=!0,this.buffer=[],this.timeDeficit=0,this.actionQueue=(0,f.priorityQueue)(function(t,n){var r=Date.now();if("insert"===t.type)return e.insert(t.text,t.position),n();if("erase"===t.type)return e.erase(t.length,t.position),n();if("wait"!==t.type)return n();if(e.ignoreWaits)return n();t.duration>700&&(t.duration=700);var i=t.duration-(r-t.baseTime)+e.timeDeficit;if(i<=0)return e.timeDeficit=i,n();e.timeDeficit=0,setTimeout(function(){return n()},i)},1),this.emitState()}}])}();t.DisplayBuffer=h;var v=function(){return a(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i(this,e),o(this,"onStateChange",void 0),o(this,"resetInterval",1e4),o(this,"ignoreWaits",!1),o(this,"sequenceNumber",void 0),o(this,"isStarting",!1),o(this,"isReset",!1),o(this,"buffer",void 0),o(this,"actionQueue",void 0),o(this,"lastActionTime",void 0),o(this,"lastResetTime",void 0),o(this,"changedBetweenResets",!1),this.onStateChange=t||function(){},this.ignoreWaits=n,this.buffer=[],this.actionQueue=[],this.sequenceNumber=0},[{key:"text",get:function(){return d.default.ucs2.encode(this.buffer.slice())}},{key:"update",value:function(e){var t=[];if(void 0!==e){e=e.normalize("NFC");var n=d.default.ucs2.decode(e);t=p(this.buffer,n.slice()),this.buffer=n,this.emitState()}var r=Date.now();if(this.changedBetweenResets&&r-this.lastResetTime>this.resetInterval)this.actionQueue=[],this.actionQueue.push({position:0,text:this.text,type:"insert"}),this.isReset=!0,this.lastActionTime=r,this.lastResetTime=r,this.changedBetweenResets=!1;else if(t.length){var i=r-(this.lastActionTime||r);i>0&&!this.ignoreWaits&&this.actionQueue.push({duration:i,type:"wait"});var a,o=u(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;this.actionQueue.push(s)}}catch(e){o.e(e)}finally{o.f()}this.lastActionTime=r,this.changedBetweenResets=!0}else this.lastActionTime=r}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.resetInterval;return this.commit(),this.isStarting=!0,this.resetInterval=e,this.sequenceNumber=Math.floor(1e4*Math.random()+1),{event:"init"}}},{key:"stop",value:function(){return this.commit(),{event:"cancel"}}},{key:"diff",value:function(){if(this.update(),!this.actionQueue.length)return null;var e={actions:this.actionQueue,seq:this.sequenceNumber++};return this.isStarting?(e.event="new",this.isStarting=!1,this.lastResetTime=Date.now()):this.isReset&&(e.event="reset",this.isReset=!1),this.actionQueue=[],e}},{key:"commit",value:function(){this.sequenceNumber=0,this.lastActionTime=0,this.actionQueue=[],this.buffer=[]}},{key:"emitState",value:function(){this.onStateChange({text:this.text})}}])}();t.InputBuffer=v},1990(e,t,n){"use strict";var r=n(5715),i=n(4756),a=n(9293),o=n(7383),s=n(4579),u=n(8452),c=n(3072),l=n(9511),f=n(3693);function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n){return t=c(t),u(e,v()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var m=n(3550),g=Math.pow(2,32),y=function(e,t){return(e%t+t)%t},b=function(e){function t(){var e;return o(this,t),e=h(this,t),f(e,"id",void 0),f(e,"jid",void 0),f(e,"allowResume",!0),f(e,"lastAck",0),f(e,"handled",0),f(e,"unacked",[]),f(e,"inboundStarted",!1),f(e,"outboundStarted",!1),f(e,"cacheHandler",void 0),e.id=void 0,e.jid=void 0,e.allowResume=!0,e.started=!1,e.cacheHandler=function(){},e._reset(),e}return l(t,e),s(t,[{key:"started",get:function(){return this.outboundStarted&&this.inboundStarted},set:function(e){e||(this.outboundStarted=!1,this.inboundStarted=!1)}},{key:"resumable",get:function(){return this.started&&this.allowResume}},{key:"load",value:function(e){var t;this.id=e.id,this.allowResume=null===(t=e.allowResume)||void 0===t||t,this.handled=e.handled,this.lastAck=e.lastAck,this.unacked=e.unacked,this.emit("prebound",e.jid)}},{key:"cache",value:function(e){this.cacheHandler=e}},{key:"bind",value:(x=a(i.mark(function e(t){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.jid=t,e.next=1,this._cache();case 1:case"end":return e.stop()}},e,this)})),function(e){return x.apply(this,arguments)})},{key:"enable",value:(O=a(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{allowResumption:this.allowResume,type:"enable"});case 1:case"end":return e.stop()}},e,this)})),function(){return O.apply(this,arguments)})},{key:"resume",value:(w=a(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{handled:this.handled,previousSession:this.id,type:"resume"});case 1:case"end":return e.stop()}},e,this)})),function(){return w.apply(this,arguments)})},{key:"enabled",value:(_=a(i.mark(function e(t){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.id,this.allowResume=t.resume||!1,this.handled=0,this.inboundStarted=!0,e.next=1,this._cache();case 1:case"end":return e.stop()}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"resumed",value:(S=a(i.mark(function e(t){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.previousSession,this.inboundStarted=!0,e.next=1,this.process(t,!0);case 1:return e.next=2,this._cache();case 2:case"end":return e.stop()}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"failed",value:(b=a(i.mark(function e(t){var n,a,o,s,u;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,this.process(t);case 1:n=d(this.unacked);try{for(n.s();!(a=n.n()).done;)o=r(a.value,2),s=o[0],u=o[1],this.emit("failed",{kind:s,stanza:u})}catch(e){n.e(e)}finally{n.f()}return this._reset(),e.next=2,this._cache();case 2:case"end":return e.stop()}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"ack",value:function(){this.emit("send",{handled:this.handled,type:"ack"})}},{key:"request",value:function(){this.emit("send",{type:"request"})}},{key:"process",value:(m=a(i.mark(function e(t){var n,a,o,s,u,c,l,f,p,h,v,m,b,S=arguments;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=S.length>1&&void 0!==S[1]&&S[1],void 0!==t.handled){e.next=1;break}return e.abrupt("return");case 1:for(a=y(t.handled-this.lastAck,g),o=0;o<a&&this.unacked.length>0;o++)s=this.unacked.shift(),u=r(s,2),c=u[0],l=u[1],this.emit("acked",{kind:c,stanza:l});if(this.lastAck=t.handled,n&&(f=this.unacked,this.unacked=[],f.length)){this.emit("begin-resend"),p=d(f);try{for(p.s();!(h=p.n()).done;)v=r(h.value,2),m=v[0],b=v[1],this.emit("resend",{kind:m,stanza:b})}catch(e){p.e(e)}finally{p.f()}this.emit("end-resend")}return e.next=2,this._cache();case 2:case"end":return e.stop()}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"track",value:(v=a(i.mark(function e(t,n){var r;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r="enable"===n.type,"sm"!==t||!r&&"resume"!==n.type){e.next=2;break}return r&&(this.handled=0),this.outboundStarted=!0,e.next=1,this._cache();case 1:return e.abrupt("return",!1);case 2:if(this.outboundStarted){e.next=3;break}return e.abrupt("return",!1);case 3:if("message"===t||"presence"===t||"iq"===t){e.next=4;break}return e.abrupt("return",!1);case 4:return this.unacked.push([t,n]),e.next=5,this._cache();case 5:return e.abrupt("return",!0);case 6:case"end":return e.stop()}},e,this)})),function(e,t){return v.apply(this,arguments)})},{key:"handle",value:(p=a(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.inboundStarted){e.next=1;break}return this.handled=y(this.handled+1,g),e.next=1,this._cache();case 1:case"end":return e.stop()}},e,this)})),function(){return p.apply(this,arguments)})},{key:"hibernate",value:(c=a(i.mark(function e(){var t,n,a,o,s;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resumable){e.next=1;break}return e.abrupt("return",this.shutdown());case 1:t=d(this.unacked);try{for(t.s();!(n=t.n()).done;)a=r(n.value,2),o=a[0],s=a[1],this.emit("hibernated",{kind:o,stanza:s})}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}},e,this)})),function(){return c.apply(this,arguments)})},{key:"shutdown",value:(u=a(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.failed({type:"failed"}));case 1:case"end":return e.stop()}},e,this)})),function(){return u.apply(this,arguments)})},{key:"_cache",value:(n=a(i.mark(function e(){var t;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,this.cacheHandler({allowResume:this.allowResume,handled:this.handled,id:this.id,jid:this.jid,lastAck:this.lastAck,unacked:this.unacked});case 1:e.next=3;break;case 2:e.prev=2,t=e.catch(0),console.error("Failed to cache stream state",t);case 3:case"end":return e.stop()}},e,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"_reset",value:function(){this.id="",this.inboundStarted=!1,this.outboundStarted=!1,this.lastAck=0,this.handled=0,this.unacked=[]}}]);var n,u,c,p,v,m,b,S,_,w,O,x}(m.EventEmitter);t.default=b},7642(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579),s=n(8452),u=n(3072),c=n(9511),l=n(3693);function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t,n){return t=u(t),s(e,m()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}var g,y=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=this&&this.__importStar||(g=function(e){return g=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},g(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=g(e),r=0;r<n.length;r++)"default"!==n[r]&&y(t,e,n[r]);return b(t,e),t}),_=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Receiver=t.Sender=void 0;var w=n(3550),O=S(n(2208)),x=n(2354),k=n(6519),T=_(n(7608)),A=n(4118),E=n(4635),I=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),e=v(this,t),l(e,"file",void 0),l(e,"channel",void 0),l(e,"hash",void 0),l(e,"config",void 0),e.config=h({chunkSize:16384,hash:"sha-1"},n),e.file=void 0,e.channel=void 0,e.hash=O.createHash(e.config.hash),e}return c(t,e),o(t,[{key:"send",value:function(e,t){var n=this;if(!this.file||!this.channel){this.file=e,this.channel=t,this.channel.binaryType="arraybuffer";var r=new FileReader,i=0,a=!1,o=function(){if(!(a||i>=e.size)){a=!0;var t=e.slice(i,i+n.config.chunkSize);r.readAsArrayBuffer(t)}};t.bufferedAmountLowThreshold=8*this.config.chunkSize,t.onbufferedamountlow=function(){o()},r.addEventListener("load",function(t){var r=t.target.result;a=!1,i+=r.byteLength,n.channel.send(r),n.hash.update(new Uint8Array(r)),n.emit("progress",i,e.size,r),i<e.size?n.channel.bufferedAmount<=n.channel.bufferedAmountLowThreshold&&o():(n.emit("progress",e.size,e.size,null),n.emit("sentFile",{algorithm:n.config.hash,name:e.name,size:e.size,value:n.hash.digest()}))}),o()}}}])}(w.EventEmitter);t.Sender=I;var N=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),e=v(this,t),l(e,"metadata",void 0),l(e,"config",void 0),l(e,"receiveBuffer",void 0),l(e,"received",void 0),l(e,"channel",void 0),l(e,"hash",void 0),e.config=h({hash:"sha-1"},n),e.receiveBuffer=[],e.received=0,e.channel=void 0,e.hash=O.createHash(e.config.hash),e}return c(t,e),o(t,[{key:"receive",value:function(e,t){var n=this;this.metadata=e,this.channel=t,this.channel.binaryType="arraybuffer",this.channel.onmessage=function(e){var t=e.data.byteLength;n.received+=t,n.receiveBuffer.push(e.data),e.data&&n.hash.update(new Uint8Array(e.data)),n.emit("progress",n.received,n.metadata.size,e.data),n.received===n.metadata.size?(n.metadata.actualhash=n.hash.digest("hex"),n.emit("receivedFile",new Blob(n.receiveBuffer),n.metadata),n.receiveBuffer=[]):n.received>n.metadata.size&&(console.error("received more than expected, discarding..."),n.receiveBuffer=[])}}}])}(w.EventEmitter);t.Receiver=N;var j=function(e){function t(e){var n;return a(this,t),n=v(this,t,[e]),l(n,"sender",void 0),l(n,"receiver",void 0),l(n,"file",void 0),l(n,"receivedFile",void 0),l(n,"channel",void 0),l(n,"contentName",void 0),n.sender=void 0,n.receiver=void 0,n.file=void 0,n}return c(t,e),o(t,[{key:"start",value:(u=i(r.mark(function e(t,n){var a,o=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=n||function(){},t&&"function"!=typeof t){e.next=1;break}throw new Error("File object required");case 1:return this.state="pending",this.role="initiator",this.file=t,this.sender=new I,this.sender.on("progress",function(e,t){o._log("info","Send progress "+e+"/"+t)}),this.sender.on("sentFile",function(e){o._log("info","Sent file",e.name),o.send(x.JingleAction.SessionInfo,{info:{creator:x.JingleSessionRole.Initiator,file:{hashes:[{algorithm:e.algorithm,value:e.value}]},infoType:x.JINGLE_INFO_CHECKSUM_5,name:o.contentName}}),o.parent.emit("sentFile",o,e)}),this.channel=this.pc.createDataChannel("filetransfer",{ordered:!0}),this.channel.onopen=function(){o.sender.send(o.file,o.channel)},e.prev=2,e.next=3,this.processLocal(x.JingleAction.SessionInitiate,i(r.mark(function e(){var n,i,a;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,o.pc.createOffer({offerToReceiveAudio:!1,offerToReceiveVideo:!1});case 1:return n=e.sent,i=(0,A.importFromSDP)(n.sdp),a=(0,E.convertIntermediateToRequest)(i,o.role,o.transportType),o.contentName=a.contents[0].name,a.sid=o.sid,a.action=x.JingleAction.SessionInitiate,a.contents[0].application={applicationType:k.NS_JINGLE_FILE_TRANSFER_5,file:{date:t.lastModified?new Date(t.lastModified):void 0,hashesUsed:[{algorithm:"sha-1"}],name:t.name,size:t.size}},o.send("session-initiate",a),e.next=2,o.pc.setLocalDescription(n);case 2:case"end":return e.stop()}},e)})));case 3:n(),e.next=5;break;case 4:return e.prev=4,a=e.catch(2),this._log("error","Could not create WebRTC offer",a),e.abrupt("return",this.end("failed-application",!0));case 5:case"end":return e.stop()}},e,this,[[2,4]])})),function(e,t){return u.apply(this,arguments)})},{key:"accept",value:(s=i(r.mark(function e(t){var n,a=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Accepted incoming session"),this.role="responder",this.state="active",t=t||function(){},e.prev=1,e.next=2,this.processLocal(x.JingleAction.SessionAccept,i(r.mark(function e(){var t,n,i,o,s;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,a.pc.createAnswer();case 1:t=e.sent,n=(0,A.importFromSDP)(t.sdp),(i=(0,E.convertIntermediateToRequest)(n,a.role,a.transportType)).sid=a.sid,i.action="session-accept",o=f(i.contents);try{for(o.s();!(s=o.n()).done;)s.value.creator="initiator"}catch(e){o.e(e)}finally{o.f()}return a.contentName=i.contents[0].name,a.send("session-accept",i),e.next=2,a.pc.setLocalDescription(t);case 2:return e.next=3,a.processBufferedCandidates();case 3:case"end":return e.stop()}},e)})));case 2:t(),e.next=4;break;case 3:e.prev=3,n=e.catch(1),this._log("error","Could not create WebRTC answer",n),this.end("failed-application");case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(e){return s.apply(this,arguments)})},{key:"onSessionInitiate",value:(n=i(r.mark(function e(t,n){var i,a,o,s,u,c=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Initiating incoming session"),this.role="responder",this.state="pending",this.transportType=t.contents[0].transport.transportType,i=(0,E.convertRequestToIntermediate)(t,this.peerRole),a=(0,A.exportToSDP)(i),o=t.contents[0].application,s=o.file.hashesUsed?o.file.hashesUsed:o.file.hashes||[],this.receiver=new N({hash:s[0]&&s[0].algorithm}),this.receiver.on("progress",function(e,t){c._log("info","Receive progress "+e+"/"+t)}),this.receiver.on("receivedFile",function(e){c.receivedFile=e,c._maybeReceivedFile()}),this.receiver.metadata=o.file,this.pc.addEventListener("datachannel",function(e){c.channel=e.channel,c.receiver.receive(c.receiver.metadata,e.channel)}),e.prev=1,e.next=2,this.pc.setRemoteDescription({type:"offer",sdp:a});case 2:return e.next=3,this.processBufferedCandidates();case 3:n(),e.next=5;break;case 4:e.prev=4,u=e.catch(1),this._log("error","Could not create WebRTC answer",u),n({condition:"general-error"});case 5:case"end":return e.stop()}},e,this,[[1,4]])})),function(e,t){return n.apply(this,arguments)})},{key:"onSessionInfo",value:function(e,t){var n=e.info;n&&n.file&&n.file.hashes&&(this.receiver.metadata.hashes=n.file.hashes,this.receiver.metadata.actualhash&&this._maybeReceivedFile(),t())}},{key:"_maybeReceivedFile",value:function(){if(this.receiver.metadata.hashes&&this.receiver.metadata.hashes.length){var e,t=f(this.receiver.metadata.hashes||[]);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.value&&n.value.toString("hex")===this.receiver.metadata.actualhash)return this._log("info","File hash matches"),this.parent.emit("receivedFile",this,this.receivedFile,this.receiver.metadata),void this.end("success")}}catch(e){t.e(e)}finally{t.f()}this._log("error","File hash does not match"),this.end("media-error")}}}]);var n,s,u}(T.default);t.default=j},7608(e,t,n){"use strict";var r=n(5715),i=n(4756),a=n(9293),o=n(7383),s=n(4579),u=n(8452),c=n(3072),l=n(2395),f=n(9511),d=n(3693);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g(e,t,n){return t=c(t),u(e,y()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function b(e,t,n,r){var i=l(c(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var S,_=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),w=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),O=this&&this.__importStar||(S=function(e){return S=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},S(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=S(e),r=0;r<n.length;r++)"default"!==n[r]&&_(t,e,n[r]);return w(t,e),t}),x=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var k=O(n(722)),T=n(2354),A=n(6519),E=n(4118),I=n(4635),N=function(e){function t(e){var n;return o(this,t),n=g(this,t,[e]),d(n,"pc",void 0),d(n,"bitrateLimit",0),d(n,"maximumBitrate",void 0),d(n,"currentBitrate",void 0),d(n,"maxRelayBandwidth",void 0),d(n,"candidateBuffer",[]),d(n,"transportType",A.NS_JINGLE_ICE_UDP_1),d(n,"restartingIce",!1),d(n,"usingRelay",!1),d(n,"_maybeRestartingIce",void 0),n.maxRelayBandwidth=e.maxRelayBandwidth,n.pc=n.parent.createPeerConnection(n,m(m({},e.config),{},{iceServers:e.iceServers})),n.pc.oniceconnectionstatechange=function(){n.onIceStateChange()},n.pc.onicecandidate=function(e){e.candidate?n.onIceCandidate(e):n.onIceEndOfCandidates()},n.restrictRelayBandwidth(),n}return f(t,e),s(t,[{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.pc.close(),b(t,"end",this,3)([e,n])}},{key:"restartIce",value:(h=a(i.mark(function e(){var t,n=this;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isInitiator){e.next=1;break}return e.abrupt("return");case 1:return void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this.restartingIce=!0,e.prev=2,e.next=3,this.processLocal("restart-ice",a(i.mark(function e(){var t,r;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,n.pc.createOffer({iceRestart:!0});case 1:return t=e.sent,r=(0,E.importFromSDP)(t.sdp),n.send(T.JingleAction.TransportInfo,{contents:r.media.map(function(e){return{creator:T.JingleSessionRole.Initiator,name:e.mid,transport:(0,I.convertIntermediateToTransport)(e,n.transportType)}}),sid:n.sid}),e.next=2,n.pc.setLocalDescription(t);case 2:case"end":return e.stop()}},e)})));case 3:e.next=5;break;case 4:e.prev=4,t=e.catch(2),this._log("error","Could not create WebRTC offer",t),this.end(T.JingleReasonCondition.FailedTransport,!0);case 5:case"end":return e.stop()}},e,this,[[2,4]])})),function(){return h.apply(this,arguments)})},{key:"setMaximumBitrate",value:(l=a(i.mark(function e(t){var n,r;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.maximumBitrate&&(t=Math.min(t,this.maximumBitrate)),this.currentBitrate=t,(n=this.pc.getSenders().find(function(e){return!!e.track&&"video"===e.track.kind}))&&n.getParameters){e.next=1;break}return e.abrupt("return");case 1:return e.prev=1,e.next=2,this.processLocal("set-bitrate",a(i.mark(function e(){var r;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(r=n.getParameters()).encodings&&r.encodings.length||(r.encodings=[{}]),0===t?delete r.encodings[0].maxBitrate:r.encodings[0].maxBitrate=t,e.next=1,n.setParameters(r);case 1:case"end":return e.stop()}},e)})));case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(1),this._log("error","Set maximumBitrate failed",r);case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(e){return l.apply(this,arguments)})},{key:"onTransportInfo",value:(c=a(i.mark(function e(t,n){var o,s,u,c,l,f,d,h,v,m,g,y,b,S,_,w,O,x=this;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.contents&&t.contents[0]&&t.contents[0].transport.gatheringComplete)){e.next=8;break}if(o={sdpMid:t.contents[0].name,candidate:""},e.prev=1,"stable"!==this.pc.signalingState){e.next=3;break}return e.next=2,this.pc.addIceCandidate(o);case 2:e.next=4;break;case 3:this.candidateBuffer.push(o);case 4:e.next=6;break;case 5:e.prev=5,e.catch(1),this._log("debug","Could not add null end-of-candidate");case 6:return e.prev=6,n(),e.finish(6);case 7:return e.abrupt("return");case 8:if(!this.pc.remoteDescription){e.next=17;break}if(s=this.pc.remoteDescription,u=(0,E.importFromSDP)(s.sdp),c=u.media.find(function(e){return e.mid===t.contents[0].name}),l=c.iceParameters.usernameFragment,!(f=t.contents[0].transport.usernameFragment)||l===f){e.next=17;break}d=p(t.contents.entries());try{for(d.s();!(h=d.n()).done;)v=r(h.value,2),m=v[0],g=v[1],y=g.transport,u.media[m].iceParameters={password:y.password,usernameFragment:y.usernameFragment},u.media[m].candidates=[]}catch(e){d.e(e)}finally{d.f()}return e.prev=9,e.next=10,this.pc.setRemoteDescription({type:s.type,sdp:(0,E.exportToSDP)(u)});case 10:return e.next=11,this.processBufferedCandidates();case 11:if("offer"!==s.type){e.next=14;break}return e.next=12,this.pc.createAnswer();case 12:return b=e.sent,e.next=13,this.pc.setLocalDescription(b);case 13:S=(0,E.importFromSDP)(b.sdp),this.send(T.JingleAction.TransportInfo,{contents:S.media.map(function(e){return{creator:T.JingleSessionRole.Initiator,name:e.mid,transport:(0,I.convertIntermediateToTransport)(e,x.transportType)}}),sid:this.sid}),e.next=15;break;case 14:this.restartingIce=!1;case 15:e.next=17;break;case 16:return e.prev=16,w=e.catch(9),this._log("error","Could not do remote ICE restart",w),n(w),this.end(T.JingleReasonCondition.FailedTransport),e.abrupt("return");case 17:return _=(t.contents||[]).map(function(e){var t=e.name,n=(e.transport.candidates||[]).map(function(){var e=a(i.mark(function e(n){var r,a;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=k.writeCandidate((0,I.convertCandidateToIntermediate)(n)),!x.pc.remoteDescription||"stable"!==x.pc.signalingState){e.next=5;break}return e.prev=1,e.next=2,x.pc.addIceCandidate({sdpMid:t,candidate:r});case 2:e.next=4;break;case 3:e.prev=3,a=e.catch(1),x._log("error","Could not add ICE candidate",a);case 4:e.next=6;break;case 5:x.candidateBuffer.push({sdpMid:t,candidate:r});case 6:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}());return Promise.all(n)}),e.prev=18,e.next=19,Promise.all(_);case 19:n(),e.next=21;break;case 20:e.prev=20,O=e.catch(18),this._log("error","Could not process transport-info: ".concat(O)),n(O);case 21:case"end":return e.stop()}},e,this,[[1,5,6,7],[9,16],[18,20]])})),function(e,t){return c.apply(this,arguments)})},{key:"onSessionAccept",value:(u=a(i.mark(function e(t,n){var r,a,o;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",r=(0,I.convertRequestToIntermediate)(t,this.peerRole),a=(0,E.exportToSDP)(r),e.prev=1,e.next=2,this.pc.setRemoteDescription({type:"answer",sdp:a});case 2:return e.next=3,this.processBufferedCandidates();case 3:this.parent.emit("accepted",this,void 0),n(),e.next=5;break;case 4:e.prev=4,o=e.catch(1),this._log("error","Could not process WebRTC answer: ".concat(o)),n({condition:"general-error"});case 5:case"end":return e.stop()}},e,this,[[1,4]])})),function(e,t){return u.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,n){this._log("info","Terminating session"),this.pc.close(),b(t,"end",this,3)([e.reason,!0]),n()}},{key:"onIceCandidate",value:function(e){if(e.candidate&&e.candidate.candidate){var t=k.parseCandidate(e.candidate.candidate),n={contents:[{creator:T.JingleSessionRole.Initiator,name:e.candidate.sdpMid,transport:{candidates:[(0,I.convertIntermediateToCandidate)(t)],transportType:this.transportType,usernameFragment:t.usernameFragment}}]};this._log("info","Discovered new ICE candidate",n),this.send(T.JingleAction.TransportInfo,n)}}},{key:"onIceEndOfCandidates",value:function(){this._log("info","ICE end of candidates");var e=(0,E.importFromSDP)(this.pc.localDescription.sdp).media[0];this.send(T.JingleAction.TransportInfo,{contents:[{creator:T.JingleSessionRole.Initiator,name:e.mid,transport:{gatheringComplete:!0,transportType:this.transportType,usernameFragment:e.iceParameters.usernameFragment}}]})}},{key:"onIceStateChange",value:function(){switch(this.pc.iceConnectionState){case"checking":this.connectionState="connecting";break;case"completed":case"connected":this.connectionState="connected";break;case"disconnected":if("stable"===this.pc.signalingState?this.connectionState="interrupted":this.connectionState="disconnected",this.restartingIce)return void this.end(T.JingleReasonCondition.FailedTransport);this.maybeRestartIce();break;case"failed":if("failed"===this.connectionState||this.restartingIce)return void this.end(T.JingleReasonCondition.FailedTransport);this.connectionState="failed",this.restartIce();break;case"closed":this.connectionState="disconnected",this.restartingIce?this.end(T.JingleReasonCondition.FailedTransport):this.end()}}},{key:"processBufferedCandidates",value:(n=a(i.mark(function e(){var t,n,r,a,o;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=p(this.candidateBuffer),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=7;break}return r=n.value,e.prev=3,e.next=4,this.pc.addIceCandidate(r);case 4:e.next=6;break;case 5:e.prev=5,a=e.catch(3),this._log("error","Could not add ICE candidate",a);case 6:e.next=2;break;case 7:e.next=9;break;case 8:e.prev=8,o=e.catch(1),t.e(o);case 9:return e.prev=9,t.f(),e.finish(9);case 10:this.candidateBuffer=[];case 11:case"end":return e.stop()}},e,this,[[1,8,9,10],[3,5]])})),function(){return n.apply(this,arguments)})},{key:"restrictRelayBandwidth",value:function(){var e=this;this.pc.addEventListener("iceconnectionstatechange",a(i.mark(function t(){var n,r,a,o,s,u,c;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("completed"===e.pc.iceConnectionState||"connected"===e.pc.iceConnectionState){t.next=1;break}return t.abrupt("return");case 1:return t.next=2,e.pc.getStats();case 2:if((n=t.sent).forEach(function(e){"transport"===e.type&&(r=n.get(e.selectedCandidatePairId))}),r||n.forEach(function(e){"candidate-pair"===e.type&&e.selected&&(r=e)}),r){t.next=3;break}return t.abrupt("return");case 3:a=!1,o="",s="",r.remoteCandidateId&&(u=n.get(r.remoteCandidateId))&&(s=u.candidateType),r.localCandidateId&&(c=n.get(r.localCandidateId))&&(o=c.candidateType),"relay"!==o&&"relay"!==s||(a=!0),e.usingRelay=a,e.parent.emit("iceConnectionType",e,{localCandidateType:o,relayed:a,remoteCandidateType:s}),a&&void 0!==e.maxRelayBandwidth&&(e.maximumBitrate=e.maxRelayBandwidth,e.currentBitrate?e.setMaximumBitrate(Math.min(e.currentBitrate,e.maximumBitrate)):e.setMaximumBitrate(e.maximumBitrate));case 4:case"end":return t.stop()}},t)})))}},{key:"maybeRestartIce",value:function(){var e=this;this.isInitiator&&(void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this._maybeRestartingIce=setTimeout(function(){e._maybeRestartingIce=void 0,"disconnected"===e.pc.iceConnectionState&&e.restartIce()},2e3))}}]);var n,u,c,l,h}(x(n(1897)).default);t.default=N},7385(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579),s=n(8452),u=n(3072),c=n(2395),l=n(9511),f=n(3693);function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n){return t=u(t),s(e,v()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}function m(e,t,n,r){var i=c(u(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var g=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var y=n(2354),b=g(n(7608)),S=n(4118),_=n(4635);function w(e){var t=e.application;if(t.streams&&t.streams.length&&t.sources&&t.sources.length){var n=t.streams[0];t.sources[0].parameters.msid="".concat(n.id," ").concat(n.track),t.sourceGroups&&t.sourceGroups.length>0&&t.sources.push({parameters:{cname:t.sources[0].parameters.cname,msid:"".concat(n.id," ").concat(n.track)},ssrc:t.sourceGroups[0].sources[1]})}}var O=function(e){function t(e){var n;if(a(this,t),n=h(this,t,[e]),f(n,"offerOptions",void 0),f(n,"includesAudio",!1),f(n,"includesVideo",!1),f(n,"_ringing",!1),n.pc.addEventListener("track",function(e){n.onAddTrack(e.track,e.streams[0])}),e.stream){var r,i=d(e.stream.getTracks());try{for(i.s();!(r=i.n()).done;){var o=r.value;n.addTrack(o,e.stream)}}catch(e){i.e(e)}finally{i.f()}}return n}return l(t,e),o(t,[{key:"ringing",get:function(){return this._ringing},set:function(e){e!==this._ringing&&(this._ringing=e)}},{key:"streams",get:function(){return"closed"!==this.pc.signalingState?this.pc.getRemoteStreams():[]}},{key:"start",value:(c=i(r.mark(function e(t,n){var a,o=this,s=arguments;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="pending",1===s.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this.role="initiator",this.offerOptions=t,e.prev=1,e.next=2,this.processLocal(y.JingleAction.SessionInitiate,i(r.mark(function e(){var n,i,a,s,u,c;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,o.pc.createOffer(t);case 1:n=e.sent,i=(0,S.importFromSDP)(n.sdp),(a=(0,_.convertIntermediateToRequest)(i,o.role,o.transportType)).sid=o.sid,a.action=y.JingleAction.SessionInitiate,s=d(a.contents||[]);try{for(s.s();!(u=s.n()).done;)(c=u.value).creator="initiator",w(c)}catch(e){s.e(e)}finally{s.f()}return e.next=2,o.pc.setLocalDescription(n);case 2:o.send("session-initiate",a);case 3:case"end":return e.stop()}},e)})));case 2:n(),e.next=4;break;case 3:e.prev=3,a=e.catch(1),this._log("error","Could not create WebRTC offer",a),this.end("failed-application",!0);case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(e,t){return c.apply(this,arguments)})},{key:"accept",value:(u=i(r.mark(function e(t,n){var a,o=this,s=arguments;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return 1===s.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this._log("info","Accepted incoming session"),this.state="active",this.role="responder",e.prev=1,e.next=2,this.processLocal(y.JingleAction.SessionAccept,i(r.mark(function e(){var n,i,a,s,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,o.pc.createAnswer(t);case 1:n=e.sent,i=(0,S.importFromSDP)(n.sdp),(a=(0,_.convertIntermediateToRequest)(i,o.role,o.transportType)).sid=o.sid,a.action=y.JingleAction.SessionAccept,s=d(a.contents||[]);try{for(s.s();!(u=s.n()).done;)u.value.creator="initiator"}catch(e){s.e(e)}finally{s.f()}return e.next=2,o.pc.setLocalDescription(n);case 2:return e.next=3,o.processBufferedCandidates();case 3:o.send("session-accept",a);case 4:case"end":return e.stop()}},e)})));case 2:n(),e.next=4;break;case 3:e.prev=3,a=e.catch(1),this._log("error","Could not create WebRTC answer",a),this.end("failed-application");case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(e,t){return u.apply(this,arguments)})},{key:"end",value:function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=d(this.pc.getReceivers());try{for(i.s();!(e=i.n()).done;){var a=e.value;this.onRemoveTrack(a.track)}}catch(e){i.e(e)}finally{i.f()}m(t,"end",this,3)([n,r])}},{key:"ring",value:function(){var e=this;return this.processLocal("ring",i(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Ringing on incoming session"),e.ringing=!0,e.send(y.JingleAction.SessionInfo,{info:{infoType:y.JINGLE_INFO_RINGING}});case 1:case"end":return t.stop()}},t)})))}},{key:"mute",value:function(e,t){var n=this;return this.processLocal("mute",i(r.mark(function i(){return r.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Muting",t),n.send(y.JingleAction.SessionInfo,{info:{creator:e,infoType:y.JINGLE_INFO_MUTE,name:t}});case 1:case"end":return r.stop()}},i)})))}},{key:"unmute",value:function(e,t){var n=this;return this.processLocal("unmute",i(r.mark(function i(){return r.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Unmuting",t),n.send(y.JingleAction.SessionInfo,{info:{creator:e,infoType:y.JINGLE_INFO_UNMUTE,name:t}});case 1:case"end":return r.stop()}},i)})))}},{key:"hold",value:function(){var e=this;return this.processLocal("hold",i(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Placing on hold"),e.send("session-info",{info:{infoType:y.JINGLE_INFO_HOLD}});case 1:case"end":return t.stop()}},t)})))}},{key:"resume",value:function(){var e=this;return this.processLocal("resume",i(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Resuming from hold"),e.send("session-info",{info:{infoType:y.JINGLE_INFO_ACTIVE}});case 1:case"end":return t.stop()}},t)})))}},{key:"addTrack",value:function(e,t,n){var a=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",i(r.mark(function i(){return r.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.pc.addTrack?a.pc.addTrack(e,t):a.pc.addStream(t),n&&n();case 1:case"end":return r.stop()}},i)})))}},{key:"removeTrack",value:(s=i(r.mark(function e(t,n){var a=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.processLocal("removetrack",i(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.pc.removeTrack(t),!n){e.next=1;break}return e.abrupt("return",n());case 1:case"end":return e.stop()}},e)}))));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return s.apply(this,arguments)})},{key:"onAddTrack",value:function(e,t){this._log("info","Track added"),this.parent.emit("peerTrackAdded",this,e,t)}},{key:"onRemoveTrack",value:function(e){this._log("info","Track removed"),this.parent.emit("peerTrackRemoved",this,e)}},{key:"onSessionInitiate",value:(n=i(r.mark(function e(t,n){var i,a,o,s,u,c;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._log("info","Initiating incoming session"),this.state="pending",this.role="responder",this.transportType=t.contents[0].transport.transportType,i=(0,_.convertRequestToIntermediate)(t,this.peerRole),a=d(i.media);try{for(a.s();!(o=a.n()).done;)"audio"===(s=o.value).kind&&(this.includesAudio=!0),"video"===s.kind&&(this.includesVideo=!0),s.streams||(s.streams=[{stream:"legacy",track:s.kind}])}catch(e){a.e(e)}finally{a.f()}return u=(0,S.exportToSDP)(i),e.prev=1,e.next=2,this.pc.setRemoteDescription({type:"offer",sdp:u});case 2:return e.next=3,this.processBufferedCandidates();case 3:return e.abrupt("return",n());case 4:return e.prev=4,c=e.catch(1),this._log("error","Could not create WebRTC answer",c),e.abrupt("return",n({condition:"general-error"}));case 5:case"end":return e.stop()}},e,this,[[1,4]])})),function(e,t){return n.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,n){var r,i=d(this.pc.getReceivers());try{for(i.s();!(r=i.n()).done;){var a=r.value;this.onRemoveTrack(a.track)}}catch(e){i.e(e)}finally{i.f()}m(t,"onSessionTerminate",this,3)([e,n])}},{key:"onSessionInfo",value:function(e,t){var n=e.info||{infoType:""};switch(n.infoType){case y.JINGLE_INFO_RINGING:return this._log("info","Outgoing session is ringing"),this.ringing=!0,this.parent.emit("ringing",this),t();case y.JINGLE_INFO_HOLD:return this._log("info","On hold"),this.parent.emit("hold",this),t();case y.JINGLE_INFO_UNHOLD:case y.JINGLE_INFO_ACTIVE:return this._log("info","Resuming from hold"),this.parent.emit("resumed",this),t();case y.JINGLE_INFO_MUTE:return this._log("info","Muting",n),this.parent.emit("mute",this,n),t();case y.JINGLE_INFO_UNMUTE:return this._log("info","Unmuting",n),this.parent.emit("unmute",this,n),t()}return t()}}]);var n,s,u,c}(b.default);t.default=O},1897(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579),s=n(3693);Object.defineProperty(t,"__esModule",{value:!0});var u=n(1060),c=n(2354),l=n(9978),f={condition:c.StanzaErrorCondition.BadRequest},d={condition:c.StanzaErrorCondition.FeatureNotImplemented,jingleError:c.JingleErrorCondition.UnsupportedInfo,type:"modify"},p=function(){return o(function e(t){var n=this;a(this,e),s(this,"parent",void 0),s(this,"sid",void 0),s(this,"peerID",void 0),s(this,"role",void 0),s(this,"pendingApplicationTypes",void 0),s(this,"pendingAction",void 0),s(this,"processingQueue",void 0),s(this,"_sessionState",void 0),s(this,"_connectionState",void 0),this.parent=t.parent,this.sid=t.sid||(0,l.uuid)(),this.peerID=t.peerID,this.role=t.initiator?c.JingleSessionRole.Initiator:c.JingleSessionRole.Responder,this._sessionState="starting",this._connectionState="starting",this.pendingApplicationTypes=t.applicationTypes||[],this.pendingAction=void 0,this.processingQueue=(0,u.priorityQueue)(function(){var e=i(r.mark(function e(t,i){var a,o,s,u,l;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("ended"!==n.state){e.next=1;break}return"local"===t.type&&t.reject&&t.reject(new Error("Session ended")),i&&i(),e.abrupt("return");case 1:if("local"!==t.type){e.next=6;break}return n._log("debug","Processing local action:",t.name),e.prev=2,e.next=3,t.handler();case 3:a=e.sent,t.resolve(a),e.next=5;break;case 4:e.prev=4,l=e.catch(2),t.reject(l);case 5:return i&&i(),e.abrupt("return");case 6:return o=t.action,s=t.changes,u=t.cb,n._log("debug","Processing remote action:",o),e.abrupt("return",new Promise(function(e){var t=function(t,n){u(t,n),i&&i(),e()};switch(o){case c.JingleAction.ContentAccept:return n.onContentAccept(s,t);case c.JingleAction.ContentAdd:return n.onContentAdd(s,t);case c.JingleAction.ContentModify:return n.onContentModify(s,t);case c.JingleAction.ContentReject:return n.onContentReject(s,t);case c.JingleAction.ContentRemove:return n.onContentRemove(s,t);case c.JingleAction.DescriptionInfo:return n.onDescriptionInfo(s,t);case c.JingleAction.SecurityInfo:return n.onSecurityInfo(s,t);case c.JingleAction.SessionAccept:return n.onSessionAccept(s,t);case c.JingleAction.SessionInfo:return n.onSessionInfo(s,t);case c.JingleAction.SessionInitiate:return n.onSessionInitiate(s,t);case c.JingleAction.SessionTerminate:return n.onSessionTerminate(s,t);case c.JingleAction.TransportAccept:return n.onTransportAccept(s,t);case c.JingleAction.TransportInfo:return n.onTransportInfo(s,t);case c.JingleAction.TransportReject:return n.onTransportReject(s,t);case c.JingleAction.TransportReplace:return n.onTransportReplace(s,t);default:n._log("error","Invalid or unsupported action: "+o),t({condition:c.StanzaErrorCondition.BadRequest})}}));case 7:case"end":return e.stop()}},e,null,[[2,4]])}));return function(t,n){return e.apply(this,arguments)}}(),1)},[{key:"isInitiator",get:function(){return this.role===c.JingleSessionRole.Initiator}},{key:"peerRole",get:function(){return this.isInitiator?c.JingleSessionRole.Responder:c.JingleSessionRole.Initiator}},{key:"state",get:function(){return this._sessionState},set:function(e){e!==this._sessionState&&(this._log("info","Changing session state to: "+e),this._sessionState=e,this.parent&&this.parent.emit("sessionState",this,e))}},{key:"connectionState",get:function(){return this._connectionState},set:function(e){e!==this._connectionState&&(this._log("info","Changing connection state to: "+e),this._connectionState=e,this.parent&&this.parent.emit("connectionState",this,e))}},{key:"send",value:function(e,t){(t=t||{}).sid=this.sid,t.action=e,new Set([c.JingleAction.ContentAccept,c.JingleAction.ContentAdd,c.JingleAction.ContentModify,c.JingleAction.ContentReject,c.JingleAction.ContentRemove,c.JingleAction.SessionAccept,c.JingleAction.SessionInitiate,c.JingleAction.TransportAccept,c.JingleAction.TransportReject,c.JingleAction.TransportReplace]).has(e)?this.pendingAction=e:this.pendingAction=void 0,this.parent.signal(this,{id:(0,l.uuid)(),jingle:t,to:this.peerID,type:"set"})}},{key:"processLocal",value:function(e,t){var n=this;return new Promise(function(r,i){n.processingQueue.push({handler:t,name:e,reject:i,resolve:r,type:"local"},1)})}},{key:"process",value:function(e,t,n){this.processingQueue.push({action:e,cb:n,changes:t,type:"remote"},2)}},{key:"start",value:function(e,t){this._log("error","Can not start base sessions"),this.end("unsupported-applications",!0)}},{key:"accept",value:function(e,t){this._log("error","Can not accept base sessions"),this.end("unsupported-applications")}},{key:"cancel",value:function(){this.end("cancel")}},{key:"decline",value:function(){this.end("decline")}},{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state="ended",this.processingQueue.kill(),"string"==typeof e&&(e={condition:e}),t||this.send("session-terminate",{reason:e}),this.parent.emit("terminated",this,e),this.parent.forgetSession(this)}},{key:"_log",value:function(e,t){if(this.parent){var n,r;t=this.sid+": "+t;for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];(n=this.parent).emit.apply(n,["log",e,t].concat(a)),(r=this.parent).emit.apply(r,["log:"+e,t].concat(a))}}},{key:"onSessionInitiate",value:function(e,t){t()}},{key:"onSessionAccept",value:function(e,t){t()}},{key:"onSessionTerminate",value:function(e,t){this.end(e.reason,!0),t()}},{key:"onSessionInfo",value:function(e,t){e.info?t(d):t()}},{key:"onSecurityInfo",value:function(e,t){t(d)}},{key:"onDescriptionInfo",value:function(e,t){t(d)}},{key:"onTransportInfo",value:function(e,t){t(d)}},{key:"onContentAdd",value:function(e,t){t(),this.send(c.JingleAction.ContentReject,{reason:{condition:c.JingleReasonCondition.FailedApplication,text:"content-add is not supported"}})}},{key:"onContentAccept",value:function(e,t){t(f)}},{key:"onContentReject",value:function(e,t){t(f)}},{key:"onContentModify",value:function(e,t){t(f)}},{key:"onContentRemove",value:function(e,t){t(f)}},{key:"onTransportReplace",value:function(e,t){t(),this.send(c.JingleAction.TransportReject,{reason:{condition:c.JingleReasonCondition.FailedTransport,text:"transport-replace is not supported"}})}},{key:"onTransportAccept",value:function(e,t){t(f)}},{key:"onTransportReject",value:function(e,t){t(f)}}])}();t.default=p},838(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e,t,n){return t=o(t),a(e,d()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var p=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var h=n(3550),v=n(2354),m=n(6519),g=n(2208),y=n(9978),b=p(n(7642)),S=p(n(7385)),_=p(n(1897)),w=786432,O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),e=f(this,t),u(e,"selfID",void 0),u(e,"sessions",void 0),u(e,"peers",void 0),u(e,"iceServers",void 0),u(e,"config",void 0),u(e,"performTieBreak",void 0),u(e,"prepareSession",void 0),u(e,"createPeerConnection",void 0),n=n||{},e.selfID=n.selfID,e.sessions={},e.peers={},e.iceServers=n.iceServers||[],e.prepareSession=n.prepareSession||function(t){if(e.config.hasRTCPeerConnection)return t.applicationTypes.indexOf(m.NS_JINGLE_RTP_1)>=0?new S.default(t):t.applicationTypes.indexOf(m.NS_JINGLE_FILE_TRANSFER_5)>=0?new b.default(t):void 0},e.performTieBreak=n.performTieBreak||function(e,t){var n=(t.jingle.contents||[]).map(function(e){if(e.application)return e.application.applicationType});return(e.pendingApplicationTypes||[]).filter(function(e){return n.includes(e)}).length>0},e.createPeerConnection=n.createPeerConnection||function(e,t){if(g.RTCPeerConnection)return new g.RTCPeerConnection(t)},e.config=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({debug:!1,hasRTCPeerConnection:!!g.RTCPeerConnection,peerConnectionConfig:{bundlePolicy:n.bundlePolicy||"balanced",iceTransportPolicy:n.iceTransportPolicy||"all",rtcpMuxPolicy:n.rtcpMuxPolicy||"require",sdpSemantics:n.sdpSemantics},peerConnectionConstraints:{optional:[{DtlsSrtpKeyAgreement:!0},{RtpDataChannels:!1}]}},n),e}return s(t,e),i(t,[{key:"addICEServer",value:function(e){if("string"!=typeof e)if((t=e).type||!t.urls&&!t.url){var t,n=e.host||"";n.indexOf(":")>=0&&(n="[".concat(n,"]"));var r="".concat(e.type,":").concat(n);e.port&&(r+=":".concat(e.port)),e.transport&&(r+="?transport=".concat(e.transport)),"turn"===e.type||"turns"===e.type?this.iceServers.push({credential:e.password,urls:[r],username:e.username}):"stun"!==e.type&&"stuns"!==e.type||this.iceServers.push({urls:[r]})}else this.iceServers.push(e);else this.iceServers.push({urls:e})}},{key:"resetICEServers",value:function(){this.iceServers=[]}},{key:"addSession",value:function(e){e.parent=this;var t=e.sid,n=e.peerID;return this.sessions[t]=e,this.peers[n]||(this.peers[n]=[]),this.peers[n].push(e),this.emit("createdSession",e),e}},{key:"forgetSession",value:function(e){var t=this.peers[e.peerID]||[];t.length&&t.splice(t.indexOf(e),1),delete this.sessions[e.sid]}},{key:"createMediaSession",value:function(e,t,n){var r=new S.default({config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!0,maxRelayBandwidth:w,parent:this,peerID:e,sid:t,stream:n});return this.addSession(r),r}},{key:"createFileTransferSession",value:function(e,t){var n=new b.default({config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!0,maxRelayBandwidth:w,parent:this,peerID:e,sid:t});return this.addSession(n),n}},{key:"endPeerSessions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.peers[e]||[];delete this.peers[e];var i,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(r);try{for(a.s();!(i=a.n()).done;)i.value.end(t||"gone",n)}catch(e){a.e(e)}finally{a.f()}}},{key:"endAllSessions",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=Object.keys(this.peers);n<r.length;n++){var i=r[n];this.endPeerSessions(i,e,t)}}},{key:"process",value:function(e){var t=this,n=e.jingle?e.jingle.sid:void 0,r=n?this.sessions[n]:void 0,i=e.id,a=e.from;if(a){if("error"===e.type){if(this._log("error","Received error response",e),r&&e.error&&"unknown-session"===e.error.jingleError)return r.end("gone",!0);var o=e.error&&"tie-break"===e.error.jingleError;return r&&"pending"===r.state&&o?r.end("alternative-session",!0):void(r&&(r.pendingAction=void 0))}if("result"!==e.type){var s=e.jingle.action,u=e.jingle.contents||[],c=u.map(function(e){return e.application?e.application.applicationType:void 0}),l=u.map(function(e){return e.transport?e.transport.transportType:void 0});if(s!==v.JingleAction.SessionInitiate){if(!r)return"session-terminate"===s?void this.emit("send",{id:i,to:a,type:"result"}):(this._log("error","Unknown session",n),this._sendError(a,i,{condition:"item-not-found",jingleError:"unknown-session"}));if(r.peerID!==a||"ended"===r.state)return this._log("error","Session has ended, or action has wrong sender"),this._sendError(a,i,{condition:"item-not-found",jingleError:"unknown-session"});if("session-accept"===s&&"pending"!==r.state)return this._log("error","Tried to accept session twice",n),this._sendError(a,i,{condition:"unexpected-request",jingleError:"out-of-order"});if("session-terminate"!==s&&s===r.pendingAction&&(this._log("error","Tie break during pending request"),r.isInitiator))return this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}else if(r){if(r.peerID!==a)return this._log("error","Duplicate sid from new sender"),this._sendError(a,i,{condition:"service-unavailable"});if("pending"!==r.state)return this._log("error","Someone is doing this wrong"),this._sendError(a,i,{condition:"unexpected-request",jingleError:"out-of-order"});if(this.selfID&&this.selfID>r.peerID&&this.performTieBreak(r,e))return this._log("error","Tie break new session because of duplicate sids"),this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}else if(this.peers[a]&&this.peers[a].length)for(var f=0,d=this.peers[a].length;f<d;f++){var p=this.peers[a][f];if(p&&"pending"===p.state&&n&&(0,y.octetCompare)(p.sid,n)>0&&this.performTieBreak(p,e))return this._log("info","Tie break session-initiate"),this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}if("session-initiate"===s){if(!u.length)return this._sendError(a,i,{condition:"bad-request"});r=this._createIncomingSession({applicationTypes:c,config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!1,parent:this,peerID:a,sid:n,transportTypes:l},e)}r.process(s,e.jingle,function(n){n?(t._log("error","Could not process request",e,n),t._sendError(a,i,n)):(t.emit("send",{id:i,to:a,type:"result"}),"session-initiate"===s&&t.emit("incoming",r))})}else r&&(r.pendingAction=void 0)}}},{key:"signal",value:function(e,t){var n=t.jingle&&t.jingle.action;e.isInitiator&&n===v.JingleAction.SessionInitiate&&this.emit("outgoing",e),this.emit("send",t)}},{key:"_createIncomingSession",value:function(e,t){var n;return this.prepareSession&&(n=this.prepareSession(e,t)),n||(n=new _.default(e)),this.addSession(n),n}},{key:"_sendError",value:function(e,t,n){n.type||(n.type="cancel"),this.emit("send",{error:n,id:t,to:e,type:"error"})}},{key:"_log",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];this.emit.apply(this,["log",e,t].concat(r)),this.emit.apply(this,["log:"+e,t].concat(r))}}])}(h.EventEmitter);t.default=O},4697(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=t.FileSession=t.MediaSession=t.ICESession=t.Session=t.exportToSDP=t.importFromSDP=void 0;var i=r(n(7642));t.FileSession=i.default;var a=r(n(7608));t.ICESession=a.default;var o=r(n(7385));t.MediaSession=o.default;var s=r(n(1897));t.Session=s.default;var u=r(n(838));t.SessionManager=u.default;var c=n(4118);Object.defineProperty(t,"importFromSDP",{enumerable:!0,get:function(){return c.importFromSDP}}),Object.defineProperty(t,"exportToSDP",{enumerable:!0,get:function(){return c.exportToSDP}})},4118(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||(a=function(e){return a=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},a(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=a(e),r=0;r<n.length;r++)"default"!==n[r]&&o(t,e,n[r]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.importFromSDP=function(e){var t=c.getMediaSections(e),n=c.getDescription(e),i={groups:[],media:[]};c.matchPrefix(n,"a=ice-lite").length>0&&(i.iceLite=!0);var a,o=r(c.matchPrefix(n,"a=group:"));try{for(o.s();!(a=o.n()).done;){var s=a.value.split(" "),u=s.shift().substr(8);i.groups.push({mids:s,semantics:u})}}catch(e){o.e(e)}finally{o.f()}var l,f=r(t);try{for(f.s();!(l=f.n()).done;){var d=l.value,p=c.getKind(d),h=c.isRejected(d),v=c.parseMLine(d),m={direction:c.getDirection(d,n),kind:p,mid:c.getMid(d),protocol:v.protocol};if(h||(m.iceParameters=c.getIceParameters(d,n),m.dtlsParameters=c.getDtlsParameters(d,n),m.setup=c.matchPrefix(d,"a=setup:")[0].substr(8),i.iceLite&&(m.iceParameters.iceLite=!0)),"audio"===p||"video"===p){m.rtpParameters=c.parseRtpParameters(d),m.rtpEncodingParameters=c.parseRtpEncodingParameters(d),m.rtcpParameters=c.parseRtcpParameters(d);var g=c.parseMsid(d);m.streams=g?[g]:[]}else"application"===p&&(m.sctp=c.parseSctpDescription(d));m.candidates=c.matchPrefix(d,"a=candidate:").map(c.parseCandidate),i.media.push(m)}}catch(e){f.e(e)}finally{f.f()}return i},t.exportToSDP=function(e){var t=[];t.push(c.writeSessionBoilerplate(e.sessionId,e.sessionVersion),"a=msid-semantic:WMS *\r\n"),(e.iceLite||e.media.filter(function(e){return e.iceParameters&&e.iceParameters.iceLite}).length>0)&&t.push("a=ice-lite\r\n");var n,i=r(e.groups||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;t.push("a=group:".concat(a.semantics," ").concat(a.mids.join(" "),"\r\n"))}}catch(e){i.e(e)}finally{i.f()}var o,s=r(e.media||[]);try{for(s.s();!(o=s.n()).done;){var u=o.value,l=!(u.iceParameters&&u.dtlsParameters);if("application"===u.kind&&u.sctp)t.push(c.writeSctpDescription(u,u.sctp));else if(u.rtpParameters){var f=c.writeRtpDescription(u.kind,u.rtpParameters);l&&(f=f.replace("m=".concat(u.kind," 9 "),"m=".concat(u.kind," 0 "))),t.push(f),t.push("a=".concat(u.direction||"sendrecv","\r\n"));var d,p=r(u.streams||[]);try{for(p.s();!(d=p.n()).done;){var h=d.value;t.push("a=msid:".concat(h.stream," ").concat(h.track,"\r\n"))}}catch(e){p.e(e)}finally{p.f()}if(u.rtcpParameters&&(t.push(c.writeRtcpParameters(u.rtcpParameters)),u.rtcpParameters.cname&&u.rtpEncodingParameters&&u.rtpEncodingParameters[0].rtx)){var v=u.rtpEncodingParameters[0];t.push("a=ssrc-group:FID ".concat(v.ssrc," ").concat(v.rtx.ssrc,"\r\n")),t.push("a=ssrc:".concat(v.rtx.ssrc," cname:").concat(u.rtcpParameters.cname,"\r\n"))}}if(void 0!==u.mid&&t.push("a=mid:".concat(u.mid,"\r\n")),u.iceParameters&&t.push(c.writeIceParameters({usernameFragment:u.iceParameters.usernameFragment,password:u.iceParameters.password})),u.dtlsParameters&&u.setup&&t.push(c.writeDtlsParameters(u.dtlsParameters,u.setup)),u.candidates&&u.candidates.length){var m,g=r(u.candidates);try{for(g.s();!(m=g.n()).done;){var y=m.value;t.push("a=".concat(c.writeCandidate(y),"\r\n"))}}catch(e){g.e(e)}finally{g.f()}}}}catch(e){s.e(e)}finally{s.f()}return t.join("")};var c=u(n(722))},4635(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.convertIntermediateToApplication=s,t.convertIntermediateToCandidate=u,t.convertCandidateToIntermediate=c,t.convertIntermediateToTransport=l,t.convertIntermediateToRequest=function(e,t,n){return{contents:e.media.map(function(e){return{application:"audio"===e.kind||"video"===e.kind?s(e,t):{applicationType:"datachannel",protocol:e.protocol},creator:a.JingleSessionRole.Initiator,name:e.mid,senders:(0,a.directionToSenders)(t,e.direction),transport:l(e,n)}}),groups:e.groups?e.groups.map(function(e){return{contents:e.mids,semantics:e.semantics}}):[]}},t.convertContentToIntermediate=f,t.convertRequestToIntermediate=function(e,t){var n,i={groups:[],media:[]},a=r(e.groups||[]);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.groups.push({mids:o.contents,semantics:o.semantics})}}catch(e){a.e(e)}finally{a.f()}var s,u=r(e.contents||[]);try{for(u.s();!(s=u.n()).done;){var c=s.value;i.media.push(f(c,t))}}catch(e){u.e(e)}finally{u.f()}return i};var a=n(2354),o=n(6519);function s(e,t){var n=e.rtpParameters,i=e.rtcpParameters||{},s=e.rtpEncodingParameters||[],u=!1;s&&s.length&&(u=!!s[0].ssrc);var c,l={applicationType:o.NS_JINGLE_RTP_1,codecs:[],headerExtensions:[],media:e.kind,rtcpMux:i.mux,rtcpReducedSize:i.reducedSize,sourceGroups:[],sources:[],ssrc:u?s[0].ssrc.toString():void 0,streams:[]},f=r(n.headerExtensions||[]);try{for(f.s();!(c=f.n()).done;){var d=c.value,p={id:d.id,uri:d.uri};d.direction&&"sendrecv"!==d.direction&&(p.senders=(0,a.directionToSenders)(t,d.direction)),l.headerExtensions.push(p)}}catch(e){f.e(e)}finally{f.f()}i.ssrc&&i.cname&&(l.sources=[{parameters:{cname:i.cname},ssrc:i.ssrc.toString()}]),u&&s[0]&&s[0].rtx&&(l.sourceGroups=[{semantics:"FID",sources:[s[0].ssrc.toString(),s[0].rtx.ssrc.toString()]}]);var h,v=r(e.streams||[]);try{for(v.s();!(h=v.n()).done;){var m=h.value;l.streams.push({id:m.stream,track:m.track})}}catch(e){v.e(e)}finally{v.f()}var g,y=r(n.codecs||[]);try{for(y.s();!(g=y.n()).done;){var b=g.value,S={channels:b.channels,clockRate:b.clockRate,id:b.payloadType.toString(),name:b.name,parameters:b.parameters,rtcpFeedback:b.rtcpFeedback};b.maxptime&&(S.maxptime=b.maxptime),b.parameters&&b.parameters.ptime&&(S.ptime=parseInt(b.parameters.ptime,10)),l.codecs.push(S)}}catch(e){y.e(e)}finally{y.f()}return l}function u(e){return{component:"rtp"===e.component?1:"rtcp"===e.component?2:e.component,foundation:e.foundation,generation:void 0,id:void 0,ip:e.ip,network:void 0,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function c(e){return{address:e.ip,component:1===e.component?"rtp":2===e.component?"rtcp":e.component,foundation:e.foundation,ip:e.ip,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function l(e,t){var n=e.iceParameters,i=e.dtlsParameters,a={candidates:[],transportType:t};n&&(a.usernameFragment=n.usernameFragment,a.password=n.password,n.iceLite&&(a.iceLite=!0)),i&&(a.fingerprints=i.fingerprints.map(function(t){return{algorithm:t.algorithm,setup:e.setup,value:t.value}})),e.sctp&&(a.sctp=e.sctp);var o,s=r(e.candidates||[]);try{for(s.s();!(o=s.n()).done;){var c=o.value;a.candidates.push(u(c))}}catch(e){s.e(e)}finally{s.f()}return a}function f(e,t){var n=e.application||{},i=e.transport,s=n&&n.applicationType===o.NS_JINGLE_RTP_1,u={direction:(0,a.sendersToDirection)(t,e.senders),kind:n.media||"application",mid:e.name,protocol:s?"UDP/TLS/RTP/SAVPF":"UDP/DTLS/SCTP"};if(s){if(u.rtcpParameters={compound:!n.rtcpReducedSize,mux:n.rtcpMux,reducedSize:n.rtcpReducedSize},n.sources&&n.sources.length){var l=n.sources[0];u.rtcpParameters.ssrc=parseInt(l.ssrc,10),l.parameters&&(u.rtcpParameters.cname=l.parameters.cname)}if(u.rtpParameters={codecs:[],fecMechanisms:[],headerExtensions:[],rtcp:[]},n.streams){u.streams=[];var f,d=r(n.streams);try{for(d.s();!(f=d.n()).done;){var p=f.value;u.streams.push({stream:p.id,track:p.track})}}catch(e){d.e(e)}finally{d.f()}}if(n.ssrc&&(u.rtpEncodingParameters=[{ssrc:parseInt(n.ssrc,10)}],n.sourceGroups&&n.sourceGroups.length)){var h=n.sourceGroups[0];u.rtpEncodingParameters[0].rtx={ssrc:parseInt(h.sources[1],10)}}var v,m=!1,g=!1,y=r(n.codecs||[]);try{for(y.s();!(v=y.n()).done;){var b,S=v.value,_=S.parameters||{},w=[],O=r(S.rtcpFeedback||[]);try{for(O.s();!(b=O.n()).done;){var x=b.value;w.push({parameter:x.parameter,type:x.type})}}catch(e){O.e(e)}finally{O.f()}if("red"===S.name||"ulpfec"===S.name){m=m||"red"===S.name,g=g||"ulpfec"===S.name;var k=S.name.toUpperCase();u.rtpParameters.fecMechanisms.includes(k)||u.rtpParameters.fecMechanisms.push(k)}u.rtpParameters.codecs.push({channels:S.channels,clockRate:S.clockRate,name:S.name,numChannels:S.channels,parameters:_,payloadType:parseInt(S.id,10),rtcpFeedback:w})}}catch(e){y.e(e)}finally{y.f()}var T,A=r(n.headerExtensions||[]);try{for(A.s();!(T=A.n()).done;){var E=T.value;u.rtpParameters.headerExtensions.push({direction:(0,a.sendersToDirection)(t,E.senders||"both"),id:E.id,uri:E.uri,attributes:void 0})}}catch(e){A.e(e)}finally{A.f()}}if(i){if(i.usernameFragment&&i.password&&(u.iceParameters={password:i.password,usernameFragment:i.usernameFragment},i.iceLite&&(u.iceParameters.iceLite=!0)),i.fingerprints&&i.fingerprints.length){u.dtlsParameters={fingerprints:[],role:"auto"};var I,N=r(i.fingerprints);try{for(N.s();!(I=N.n()).done;){var j=I.value;u.dtlsParameters.fingerprints.push({algorithm:j.algorithm,value:j.value})}}catch(e){N.e(e)}finally{N.f()}i.sctp&&(u.sctp=i.sctp),u.setup=i.fingerprints[0].setup}u.candidates=(i.candidates||[]).map(c)}return u}},540(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.escapeXML=function(e){return e.replace(c,f)},t.unescapeXML=function(e){return e.replace(u,function(e){return function(e){if(s[e])return s[e];var t=e.startsWith("&#x"),n=parseInt(e.substring(t?3:2,e.length-1),t?16:10);if(9===n||10===n||13===n||32<=n&&n<=55295||57344<=n&&n<=65533||65536<=n&&n<=1114111)return String.fromCodePoint(n);throw a.default.restrictedXML("Prohibited entity: "+e)}(e)})},t.escapeXMLText=function(e){return e.replace(l,f)},t.basicLanguageResolver=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=new Set(e.map(function(e){return e.toLowerCase()})),o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}(n.map(function(e){return e.toLowerCase()}));try{for(o.s();!(t=o.n()).done;){var s=t.value;if("*"!==s)for(;s.length>0;){if(a.has(s))return s;(s=s.substring(0,s.lastIndexOf("-")).toLowerCase()).lastIndexOf("-")===s.length-2&&(s=s.substring(0,s.lastIndexOf("-")))}}}catch(e){o.e(e)}finally{o.f()}return i};var a=i(n(4752)),o={'"':"&quot;","&":"&amp;","'":"&apos;","<":"&lt;",">":"&gt;"},s={"&amp;":"&","&apos;":"'","&gt;":">","&lt;":"<","&quot;":'"'},u=/&([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);/g,c=/&|<|>|"|'/g,l=/&|<|>/g;function f(e){return o[e]}},6686(e,t,n){"use strict";var r=n(5715),i=n(7383),a=n(4579),o=n(3693);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var c=n(540),l=function(){return a(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];i(this,e),o(this,"name",void 0),o(this,"parent",void 0),o(this,"children",void 0),o(this,"attributes",void 0),o(this,"optionalNamespaces",void 0),this.name=t,this.attributes=n,this.children=[],this.optionalNamespaces={};var a,u=s(r);try{for(u.s();!(a=u.n()).done;){var c=a.value;if("string"!=typeof c){var l=new e(c.name,c.attributes,c.children);l.parent=this,this.children.push(l)}else this.children.push(c)}}catch(e){u.e(e)}finally{u.f()}},[{key:"getName",value:function(){return this.name.indexOf(":")>=0?this.name.substr(this.name.indexOf(":")+1):this.name}},{key:"getNamespace",value:function(){if(this.name.indexOf(":")>=0){var e=this.name.substr(0,this.name.indexOf(":"));return this.findNamespaceForPrefix(e)}return this.findNamespaceForPrefix()}},{key:"getNamespaceContext",value:function(){var e={};this.parent&&(e=this.parent.getNamespaceContext());for(var t=0,n=Object.entries(this.attributes);t<n.length;t++){var i=r(n[t],2),a=i[0],o=i[1];if(a.startsWith("xmlns:")){var s=a.substr(6);e[o]=s}}return e}},{key:"getDefaultNamespace",value:function(){return this.attributes.xmlns?this.attributes.xmlns:this.parent?this.parent.getDefaultNamespace():""}},{key:"getNamespaceRoot",value:function(e){if(this.parent){var t=this.parent.getNamespaceRoot(e);if(t)return t}for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];if(o.startsWith("xmlns:")&&s===e)return this}if(this.optionalNamespaces[e])return this}},{key:"getAttribute",value:function(e,t){if(!t)return this.attributes[e];var n=this.getNamespaceContext();return n[t]?this.attributes[[n[t],e].join(":")]:void 0}},{key:"getChild",value:function(e,t){return this.getChildren(e,t)[0]}},{key:"getChildren",value:function(e,t){var n,r=[],i=s(this.children);try{for(i.s();!(n=i.n()).done;){var a=n.value;"string"==typeof a||a.getName()!==e||t&&a.getNamespace()!==t||r.push(a)}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getText",value:function(){var e,t="",n=s(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;"string"==typeof r&&(t+=r)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"appendChild",value:function(e){return this.children.push(e),"string"!=typeof e&&(e.parent=this),e}},{key:"setAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.attributes[e]=t||void 0,""===t&&n&&(this.attributes[e]=t)}},{key:"addOptionalNamespace",value:function(e,t){this.optionalNamespaces[t]=e}},{key:"useNamespace",value:function(e,t){return this.optionalNamespaces[t]&&(e=this.optionalNamespaces[t]),this.setAttribute("xmlns:".concat(e),t),e}},{key:"toJSON",value:function(){for(var e=this.children.map(function(e){return"string"==typeof e?e:e?e.toJSON():void 0}).filter(function(e){return!!e}),t={},n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];null!=s&&(t[o]=s)}return{attributes:t,children:e,name:this.name}}},{key:"toString",value:function(){var e=this.openTag(!0);if(this.children.length){var t,n=s(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;"string"==typeof r?e+=(0,c.escapeXMLText)(r):r&&(e+=r.toString())}}catch(e){n.e(e)}finally{n.f()}e+=this.closeTag()}return e}},{key:"openTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="";t+="<".concat(this.name);for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];void 0!==s&&(t+=" ".concat(o,'="').concat((0,c.escapeXML)(s.toString()),'"'))}return e&&0===this.children.length?t+="/>":t+=">",t}},{key:"closeTag",value:function(){return"</".concat(this.name,">")}},{key:"findNamespaceForPrefix",value:function(e){if(e){var t="xmlns:"+e;if(this.attributes[t])return this.attributes[t];if(this.parent)return this.parent.findNamespaceForPrefix(e)}else{if(this.attributes.xmlns)return this.attributes.xmlns;if(this.parent)return this.parent.findNamespaceForPrefix()}return""}}])}();t.default=l},4752(e,t,n){"use strict";var r,i=n(7383),a=n(4579),o=n(8452),s=n(3072),u=n(9511),c=n(1837),l=n(3693);function f(e,t,n){return t=s(t),o(e,d()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.JXTErrorCondition=void 0,function(e){e.NotWellFormed="not-well-formed",e.RestrictedXML="restricted-xml",e.AlreadyClosed="already-closed",e.UnknownRoot="unknown-stream-root"}(r||(t.JXTErrorCondition=r={}));var p=function(e){function t(e){var n;return i(this,t),n=f(this,t,[e.text]),l(n,"isJXTError",!0),l(n,"condition",void 0),l(n,"text",void 0),n.condition=e.condition,n.text=e.text,n}return u(t,e),a(t,null,[{key:"notWellFormed",value:function(e){return new t({condition:r.NotWellFormed,text:e})}},{key:"restrictedXML",value:function(e){return new t({condition:r.RestrictedXML,text:e})}},{key:"alreadyClosed",value:function(e){return new t({condition:r.AlreadyClosed,text:e})}},{key:"unknownRoot",value:function(e){return new t({condition:r.UnknownRoot,text:e})}}])}(c(Error));t.default=p},7691(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.childJID=t.childJIDAttribute=t.JIDAttribute=void 0,t.addAlias=function(e,t,n){return{aliases:Array.isArray(n)?n:[n],element:t,fields:{},namespace:e}},t.extendMessage=function(e){return{element:"message",fields:e,namespace:r.NS_CLIENT}},t.extendPresence=function(e){return{element:"presence",fields:e,namespace:r.NS_CLIENT}},t.extendIQ=function(e){return{element:"iq",fields:e,namespace:r.NS_CLIENT}},t.extendStreamFeatures=function(e){return{element:"features",fields:e,namespace:r.NS_STREAM}},t.extendStanzaError=function(e){return{element:"error",fields:e,namespace:r.NS_STANZAS,path:"stanzaError"}},t.pubsubItemContentAliases=function(){return[{path:"pubsubcontent",contextField:"itemType"},{path:"pubsubitem.content",contextField:"itemType"},{path:"pubsubeventitem.content",contextField:"itemType"},{path:"iq.pubsub.publish.items",contextField:"itemType"}]};var r=n(6519),i=n(9783);t.JIDAttribute=i.attribute,t.childJIDAttribute=i.childAttribute,t.childJID=i.childText},6851(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t,n){return t=o(t),a(e,f()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e){var t,n,r=new w(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),i=null;if(r.on("text",function(e){n&&n.children.push(e)}),r.on("startElement",function(e,r){var i=new v.default(e,r);t||(t=i),n=n?n.appendChild(i):i}),r.on("endElement",function(e){n?e===n.name?n.parent&&(n=n.parent):r.emit("error",m.default.notWellFormed("b")):r.emit("error",m.default.notWellFormed("a"))}),r.on("error",function(e){i=e}),r.write(e),r.end(),i)throw i;return t};var p=n(3550),h=n(540),v=d(n(6686)),m=d(n(4752));function g(e){return 97<=e&&e<=122||65<=e&&e<=90||58===e||95===e}function y(e){return 192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=767||880<=e&&e<=893||895<=e&&e<=8191||8204<=e&&e<=8205||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||65008<=e&&e<=65533||65536<=e&&e<=983039}function b(e){return g(e)||y(e)}function S(e){return g(e)||45===e||46===e||48<=e&&e<=57||183===e||768<=e&&e<=879||8255<=e&&e<=8256||y(e)}function _(e){return 32===e||10===e||13===e||9===e}var w=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),e=l(this,t),u(e,"allowComments",!0),u(e,"attributeName",void 0),u(e,"attributes",{}),u(e,"state",34),u(e,"tagName",""),u(e,"haveDeclaration",!1),u(e,"recordBuffer",[]),void 0!==n.allowComments&&(e.allowComments=n.allowComments),e}return s(t,e),i(t,[{key:"write",value:function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.codePointAt(0);switch(this.state){case 34:if(60===i){var a=void 0;try{a=(0,h.unescapeXML)(this.endRecord())}catch(e){return void this.emit("error",e)}a&&this.emit("text",a),this.transition(31);continue}this.record(r);continue;case 31:if(47===i){this.transition(7);continue}if(33===i){this.transition(24);continue}if(63===i){if(this.haveDeclaration)return this.restrictedXML();this.transition(25);continue}if(b(i)){this.transition(30),this.startRecord(r);continue}return this.notWellFormed();case 30:if(S(i)){this.record(r);continue}if(_(i)){this.startTag(),this.transition(32);continue}if(47===i){this.startTag(),this.transition(29);continue}if(62===i){this.startTag(),this.transition(34),this.emit("startElement",this.tagName,this.attributes);continue}return this.notWellFormed();case 29:if(62===i){this.emit("startElement",this.tagName,this.attributes),this.emit("endElement",this.tagName),this.transition(34);continue}return this.notWellFormed();case 33:if(_(i)){this.transition(32);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 32:if(_(i))continue;if(b(i)){this.startRecord(r),this.transition(0);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 7:if(b(i)){this.startRecord(r),this.transition(6);continue}return this.notWellFormed();case 6:if(S(i)){this.record(r);continue}if(_(i)){this.transition(8);continue}if(62===i){var o=this.endRecord();this.emit("endElement",o,this.attributes),this.transition(34);continue}return this.notWellFormed();case 8:if(_(i))continue;if(62===i){var s=this.endRecord();this.emit("endElement",s,this.attributes),this.transition(34);continue}return this.notWellFormed();case 0:if(S(i)){this.record(r);continue}if(61===i){this.addAttribute(),this.transition(4);continue}if(_(i)){this.addAttribute(),this.transition(3);continue}return this.notWellFormed();case 3:if(61===i){this.transition(4);continue}if(_(i))continue;return this.notWellFormed();case 4:if(34===i){this.startRecord(),this.transition(1);continue}if(39===i){this.startRecord(),this.transition(2);continue}if(_(i))continue;return this.notWellFormed();case 1:case 2:if(34===i&&1===this.state||39===i&&2===this.state){var u=this.endRecord();this.attributes[this.attributeName]=(0,h.unescapeXML)(u),this.transition(33);continue}if(60===i)return this.notWellFormed();this.record(r);continue;case 24:if(45===i){if(!this.allowComments)return this.restrictedXML();this.transition(23);continue}if(91===i){this.transition(21);continue}return this.notWellFormed();case 23:if(45===i){this.transition(14);continue}return this.notWellFormed();case 14:45===i&&this.transition(12);continue;case 12:45===i?this.transition(11):this.transition(14);continue;case 11:62===i?this.transition(34):this.transition(14);continue;case 25:if(88===i||120===i){this.transition(28);continue}return this.notWellFormed();case 28:if(77===i||109===i){this.transition(27);continue}return this.notWellFormed();case 27:if(76===i||108===i){this.transition(26);continue}return this.notWellFormed();case 26:if(_(i)){this.haveDeclaration=!0,this.transition(15);continue}return this.notWellFormed();case 13:if(62===i){this.transition(34);continue}return this.notWellFormed();case 15:63===i&&this.transition(13);continue;case 21:this.wait(i,67,20);continue;case 20:this.wait(i,68,19);continue;case 19:this.wait(i,65,18);continue;case 18:this.wait(i,84,17);continue;case 17:this.wait(i,65,16);continue;case 16:this.wait(i,91,5);continue;case 5:if(93===i){this.transition(10);continue}this.record(r);continue;case 10:93===i?this.transition(9):(this.record(String.fromCodePoint(93)),this.record(r),this.transition(5));continue;case 9:if(62===i){var l=this.endRecord();l&&this.emit("text",l),this.transition(34)}else this.record(String.fromCodePoint(93)),this.record(String.fromCodePoint(93)),this.record(r),this.transition(5);continue}}}catch(e){n.e(e)}finally{n.f()}}},{key:"end",value:function(e){e&&this.write(e),this.write=function(){}}},{key:"record",value:function(e){this.recordBuffer.push(e)}},{key:"startRecord",value:function(e){this.recordBuffer=[],e&&this.recordBuffer.push(e)}},{key:"endRecord",value:function(){var e=this.recordBuffer;return this.recordBuffer=[],e.join("")}},{key:"startTag",value:function(){this.tagName=this.endRecord(),this.attributes={}}},{key:"addAttribute",value:function(){var e=this.endRecord();if(void 0!==this.attributes[e])return this.notWellFormed();this.attributeName=e,this.attributes[e]=""}},{key:"wait",value:function(e,t,n){if(e!==t)return this.notWellFormed();this.transition(n)}},{key:"transition",value:function(e){this.state=e,34===e&&this.startRecord()}},{key:"notWellFormed",value:function(e){this.emit("error",m.default.notWellFormed(e))}},{key:"restrictedXML",value:function(e){this.emit("error",m.default.restrictedXML(e))}}])}(p.EventEmitter);t.default=w},3803(e,t,n){"use strict";var r=n(5715),i=n(3738),a=n(7383),o=n(4579),s=n(3693);function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var p=n(540),h=d(n(6068)),v=d(n(8738)),m=function(){return o(function e(){a(this,e),s(this,"root",void 0),s(this,"translators",void 0),s(this,"languageResolver",void 0),this.translators=new Map,this.root=new v.default,this.setLanguageResolver(p.basicLanguageResolver)},[{key:"setLanguageResolver",value:function(e){this.languageResolver=e}},{key:"import",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{registry:this};if(this.hasTranslator(e.getNamespace(),e.getName()))return t.acceptLanguages||(t.acceptLanguages=[]),t.acceptLanguages=t.acceptLanguages.map(function(e){return e.toLowerCase()}),t.lang&&(t.lang=t.lang.toLowerCase()),t.resolveLanguage||(t.resolveLanguage=this.languageResolver),t.path=this.getImportKey(e),t.sanitizers||(t.sanitizers={xhtmlim:h.default}),this.getOrCreateTranslator(e.getNamespace(),e.getName()).import(e,f(f({},t),{},{registry:this}))}},{key:"export",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{registry:this};n.acceptLanguages||(n.acceptLanguages=[]),n.acceptLanguages=n.acceptLanguages.map(function(e){return e.toLowerCase()}),n.lang&&(n.lang=n.lang.toLowerCase()),n.sanitizers||(n.sanitizers={xhtmlim:h.default}),n.path=e;var r,i=e.split(".").filter(function(e){return""!==e}),a=this.root,o=u(i);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=a.getChild(s);if(!c)return;a=c}}catch(e){o.e(e)}finally{o.f()}return a.export(t,f(f({},n),{},{registry:this}))}},{key:"getImportKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t?this.walkToTranslator(t.split(".")):this.root;if(n)return n.getImportKey(e)}},{key:"define",value:function(e){if(Array.isArray(e)){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;"object"===i(a)?this.define(a):a(this)}}catch(e){n.e(e)}finally{n.f()}}else if("object"===i(e)){var o=e;o.aliases=o.aliases||[],o.path&&!o.aliases.includes(o.path)&&o.aliases.push(o.path);var s,c=o.aliases.map(function(e){return"string"==typeof e?{path:e}:e}).sort(function(e,t){var n=e.path.split(".").length;return t.path.split(".").length-n});if(this.hasTranslator(o.namespace,o.element)&&(s=this.getOrCreateTranslator(o.namespace,o.element)),!s){var l,f,d=u(c);try{for(d.s();!(f=d.n()).done;){var p=f.value,h=this.walkToTranslator(p.path.split("."));if(h&&!h.placeholder){s=h;break}h&&(l=h)}}catch(e){d.e(e)}finally{d.f()}l&&!s&&((s=l).placeholder=!1)}s||(s=this.getOrCreateTranslator(o.namespace,o.element)),this.indexTranslator(o.namespace,o.element,s);var v=o.fields||{},m=new Map,g=new Map,y=new Map,b=new Map;o.typeField&&(s.typeField=o.typeField),o.defaultType&&(s.defaultType=o.defaultType),o.versionField&&(s.versionField=o.versionField),o.defaultVersion&&(s.defaultVersion=o.defaultVersion),o.languageField&&(s.languageField=o.languageField);for(var S=0,_=Object.entries(v);S<_.length;S++){var w=r(_[S],2),O=w[0],x=w[1];m.set(O,x.importer),y.set(O,x.importOrder||x.order||0),g.set(O,x.exporter),b.set(O,x.exportOrder||x.order||0)}if(o.childrenExportOrder)for(var k=0,T=Object.entries(o.childrenExportOrder);k<T.length;k++){var A=r(T[k],2),E=A[0],I=A[1];b.set(E,I||0)}for(var N=new Map,j=0,R=Object.entries(o.optionalNamespaces||{});j<R.length;j++){var P=r(R[j],2),C=P[0],M=P[1];N.set(C,M)}s.updateDefinition({contexts:new Map,element:o.element,exporterOrdering:b,exporters:g,importerOrdering:y,importers:m,namespace:o.namespace,optionalNamespaces:N,type:o.type,version:o.version,typeOrder:o.typeOrder});var D,L=u(c);try{for(L.s();!(D=L.n()).done;){var B=D.value;this.alias(o.namespace,o.element,B.path,B.multiple,B.selector,B.contextField,o.type,B.impliedType)}}catch(e){L.e(e)}finally{L.f()}var F,q=u(c);try{for(q.s();!(F=q.n()).done;){var U=F.value,z=this.walkToTranslator(U.path.split("."));z&&z!==s&&z.replaceWith(s)}}catch(e){q.e(e)}finally{q.f()}}else e(this)}},{key:"alias",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=this.getOrCreateTranslator(e,t);u.placeholder=!1;var c=n.split(".").filter(function(e){return""!==e}),l=c.pop(),f=this.walkToTranslator(c,!0),d="{".concat(e,"}").concat(t);o&&(a||s)&&u.addContext(n,i,a,d,o,s),f.addChild(l,u,r,i,d)}},{key:"walkToTranslator",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.root,i=u(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getChild(a);if(!o){if(!n)return;(o=new v.default).placeholder=!0,r.addChild(a,o)}r=o}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"hasTranslator",value:function(e,t){return this.translators.has("{".concat(e,"}").concat(t))}},{key:"getOrCreateTranslator",value:function(e,t){var n=this.translators.get("{".concat(e,"}").concat(t));return n||(n=new v.default,this.indexTranslator(e,t,n)),n}},{key:"indexTranslator",value:function(e,t,n){this.translators.set("{".concat(e,"}").concat(t),n)}}])}();t.default=m},9523(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(2208),p=f(n(6686)),h=f(n(4752)),v=f(n(6851)),m=function(e){function t(e){var n;return r(this,t),n=c(this,t,[{objectMode:!0}]),u(n,"closedStream",!1),u(n,"wrappedStream",!1),u(n,"registry",void 0),u(n,"lang",void 0),u(n,"acceptLanguages",void 0),u(n,"currentElement",void 0),u(n,"rootElement",void 0),u(n,"rootImportKey",void 0),u(n,"parser",void 0),n.registry=e.registry,n.acceptLanguages=e.acceptLanguages||[],e.wrappedStream&&(n.wrappedStream=!0,n.rootImportKey=e.rootKey),n.parser=new v.default({allowComments:e.allowComments}),n.parser.on("error",function(e){n.destroy(e)}),n.parser.on("startElement",function(e,t){if(!n.destroyed){if(n.closedStream)return n.destroy(h.default.alreadyClosed());var r=new p.default(e,t),i=n.registry.getImportKey(r);if(n.wrappedStream&&!n.rootElement){if(n.rootImportKey&&i!==n.rootImportKey)return n.destroy(h.default.unknownRoot());var a=n.registry.import(r,{acceptLanguages:n.acceptLanguages,lang:n.lang});return a?(n.rootElement=r,void n.push({event:"stream-start",kind:i,stanza:a,xml:r})):n.destroy(h.default.notWellFormed())}n.currentElement?n.currentElement=n.currentElement.appendChild(r):n.currentElement=r}}),n.parser.on("endElement",function(e){if(!n.destroyed){if(n.wrappedStream&&!n.currentElement)return n.rootElement&&e===n.rootElement.name?(n.closedStream=!0,n.push({event:"stream-end",kind:n.rootImportKey,stanza:{},xml:n.rootElement}),n.end()):(n.closedStream=!0,n.destroy(h.default.notWellFormed()));if(!n.currentElement||e!==n.currentElement.name)return n.closedStream=!0,n.destroy(h.default.notWellFormed());if(n.currentElement.parent)n.currentElement=n.currentElement.parent;else{n.wrappedStream&&(n.currentElement.parent=n.rootElement);var t=n.registry.getImportKey(n.currentElement),r=n.registry.import(n.currentElement,{acceptLanguages:n.acceptLanguages,lang:n.lang});r&&n.push({kind:t,stanza:r,xml:n.currentElement}),n.currentElement=void 0}}}),n.parser.on("text",function(e){n.currentElement&&n.currentElement.children.push(e)}),n}return s(t,e),i(t,[{key:"_transform",value:function(e,t,n){this.parser.write(e.toString()),n()}}])}(d.Transform);t.default=m},8738(e,t,n){"use strict";var r=n(1132),i=n(5715),a=n(7383),o=n(4579),s=n(3693);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var d=n(9783),p=function(){return o(function e(){a(this,e),s(this,"placeholder",void 0),s(this,"typeField",void 0),s(this,"versionField",void 0),s(this,"typeValues",void 0),s(this,"typeOrders",void 0),s(this,"defaultType",void 0),s(this,"defaultVersion",void 0),s(this,"languageField",void 0),s(this,"importers",void 0),s(this,"exporters",void 0),s(this,"children",void 0),s(this,"childrenIndex",void 0),s(this,"implicitChildren",void 0),s(this,"contexts",void 0),s(this,"parents",new Set),this.placeholder=!1,this.typeField="",this.versionField="",this.defaultType="",this.defaultVersion="",this.languageField="lang",this.typeValues=new Map,this.typeOrders=new Map,this.importers=new Map,this.exporters=new Map,this.children=new Map,this.childrenIndex=new Map,this.implicitChildren=new Set,this.contexts=new Map},[{key:"addChild",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o={multiple:n||!1,name:e,selector:r,translator:t},s=this.children.get(e);if(s){var u=s.translator;s.multiple=n,r&&s.selector&&r!==s.selector&&(s.selector=void 0);var c,f=l(t.importers);try{for(f.s();!(c=f.n()).done;){var d=i(c.value,2),p=d[0],h=d[1],v=(u.typeValues.get(p)||"").split("__v__"),m=i(v,2),g=m[0],y=m[1];u.updateDefinition({contexts:t.contexts,element:h.element,exporterOrdering:new Map,exporters:new Map,importerOrdering:h.fieldOrders,importers:h.fields,namespace:h.namespace,optionalNamespaces:new Map,type:g,version:y}),this.implicitChildren.has(p)||this.childrenIndex.set(p,e)}}catch(e){f.e(e)}finally{f.f()}var b,S=l(t.exporters);try{for(S.s();!(b=S.n()).done;){var _=i(b.value,2),w=_[0],O=_[1],x=w.split("__v__"),k=i(x,2),T=k[0],A=k[1];u.updateDefinition({contexts:t.contexts,element:O.element,exporterOrdering:O.fieldOrders,exporters:O.fields,importerOrdering:new Map,importers:new Map,namespace:O.namespace,optionalNamespaces:O.optionalNamespaces,type:T,version:A})}}catch(e){S.e(e)}finally{S.f()}}else{o.translator.parents.add(this),this.children.set(e,o);var E,I=l(t.importers);try{for(I.s();!(E=I.n()).done;){var N=i(E.value,1)[0];this.implicitChildren.has(N)||this.childrenIndex.set(N,e)}}catch(e){I.e(e)}finally{I.f()}a&&this.implicitChildren.add(a)}}},{key:"addContext",value:function(e,t,n,r,i,a){t&&(e="".concat(e,"[").concat(t,"]"));var o=this.contexts.get(e);o||(o={typeField:"",versionField:"",typeValues:new Map}),a&&(o.impliedType=i),o.typeField=n||"",o.typeValues.set(r,i),this.contexts.set(e,o)}},{key:"getChild",value:function(e){var t=this.children.get(e);if(t)return t.translator}},{key:"getImportKey",value:function(e){return this.childrenIndex.get("{".concat(e.getNamespace(),"}").concat(e.getName()))}},{key:"updateDefinition",value:function(e){var t,n="{".concat(e.namespace,"}").concat(e.element),r=e.type||this.defaultType,a=e.version||this.defaultVersion,o=a?"".concat(r,"__v__").concat(a):r,s=this.importers.get(n)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace},u=l(e.importers);try{for(u.s();!(t=u.n()).done;){var c=i(t.value,2),f=c[0],d=c[1];s.fields.set(f,d)}}catch(e){u.e(e)}finally{u.f()}var p,h=l(e.importerOrdering);try{for(h.s();!(p=h.n()).done;){var v=i(p.value,2),m=v[0],g=v[1];s.fieldOrders.set(m,g)}}catch(e){h.e(e)}finally{h.f()}this.importers.set(n,s);var y,b=this.exporters.get(o)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace,optionalNamespaces:e.optionalNamespaces},S=l(e.exporters);try{for(S.s();!(y=S.n()).done;){var _=i(y.value,2),w=_[0],O=_[1];b.fields.set(w,O)}}catch(e){S.e(e)}finally{S.f()}var x,k=l(e.exporterOrdering);try{for(k.s();!(x=k.n()).done;){var T=i(x.value,2),A=T[0],E=T[1];b.fieldOrders.set(A,E)}}catch(e){k.e(e)}finally{k.f()}var I,N=l(e.optionalNamespaces);try{for(N.s();!(I=N.n()).done;){var j=i(I.value,2),R=j[0],P=j[1];b.optionalNamespaces.set(R,P)}}catch(e){N.e(e)}finally{N.f()}this.exporters.set(o,b);var C,M=l(e.contexts);try{for(M.s();!(C=M.n()).done;){var D=i(C.value,2),L=D[0],B=D[1],F=this.contexts.get(L)||{impliedType:void 0,typeField:B.typeField,versionField:B.versionField,typeValues:new Map};F.typeField||(F.typeField=B.typeField),F.versionField||(F.versionField=B.versionField),F.impliedType||(F.impliedType=B.impliedType);var q,U=l(B.typeValues);try{for(U.s();!(q=U.n()).done;){var z=i(q.value,2),J=z[0],G=z[1];F.typeValues.set(J,G)}}catch(e){U.e(e)}finally{U.f()}this.contexts.set(L,F)}}catch(e){M.e(e)}finally{M.f()}if(e.type)this.typeValues.set(n,o),e.typeOrder&&e.type&&this.typeOrders.set(e.type,e.typeOrder);else if(this.typeField&&!e.type){var H,W=l(this.importers);try{for(W.s();!(H=W.n()).done;){var V,Q=i(H.value,2)[1],K=l(e.importers);try{for(K.s();!(V=K.n()).done;){var X=i(V.value,2),Y=X[0],$=X[1];Q.fields.set(Y,$)}}catch(e){K.e(e)}finally{K.f()}var Z,ee=l(e.importerOrdering);try{for(ee.s();!(Z=ee.n()).done;){var te=i(Z.value,2),ne=te[0],re=te[1];Q.fieldOrders.set(ne,re)}}catch(e){ee.e(e)}finally{ee.f()}}}catch(e){W.e(e)}finally{W.f()}var ie,ae=l(this.exporters);try{for(ae.s();!(ie=ae.n()).done;){var oe,se=i(ie.value,2)[1],ue=l(e.exporters);try{for(ue.s();!(oe=ue.n()).done;){var ce=i(oe.value,2),le=ce[0],fe=ce[1];se.fields.set(le,fe)}}catch(e){ue.e(e)}finally{ue.f()}var de,pe=l(e.exporterOrdering);try{for(pe.s();!(de=pe.n()).done;){var he=i(de.value,2),ve=he[0],me=he[1];se.fieldOrders.set(ve,me)}}catch(e){pe.e(e)}finally{pe.f()}}}catch(e){ae.e(e)}finally{ae.f()}}}},{key:"replaceWith",value:function(e){var t,n=l(this.children);try{for(n.s();!(t=n.n()).done;){var r=i(t.value,2),a=r[0],o=r[1];e.children.set(a,o)}}catch(e){n.e(e)}finally{n.f()}var s,u=l(this.childrenIndex);try{for(u.s();!(s=u.n()).done;){var c=i(s.value,2),f=c[0],d=c[1];e.childrenIndex.set(f,d)}}catch(e){u.e(e)}finally{u.f()}var p,h=l(this.contexts);try{for(h.s();!(p=h.n()).done;){var v=i(p.value,2),m=v[0],g=v[1];e.contexts.set(m,g)}}catch(e){h.e(e)}finally{h.f()}var y,b=l(this.implicitChildren);try{for(b.s();!(y=b.n()).done;){var S=y.value;e.implicitChildren.add(S)}}catch(e){b.e(e)}finally{b.f()}var _,w=l(this.parents);try{for(w.s();!(_=w.n()).done;){var O,x=l(_.value.children.values());try{for(x.s();!(O=x.n()).done;){var k=O.value;k.translator===this&&(k.translator=e)}}catch(e){x.e(e)}finally{x.f()}}}catch(e){w.e(e)}finally{w.f()}this.parents=new Set}},{key:"import",value:function(e,t){var n="{".concat(e.getNamespace(),"}").concat(e.getName()),a={},o=this.importers.get(n);if(o){var s,u=(this.typeValues.get(n)||"").split("__v__"),f=i(u,2),d=f[0],p=f[1],h=t.path||"";if(t.pathSelector&&(s=this.contexts.get("".concat(h,"[").concat(t.pathSelector,"]"))),s||(s=this.contexts.get(h)),s){if(!s.impliedType){var v=s.typeValues.get(n)||"";v&&(a[s.typeField]=v)}}else this.typeField&&d&&d!==this.defaultType&&(a[this.typeField]=d);this.versionField&&p&&p!==this.defaultVersion&&(a[this.versionField]=p);var m,g=c(c({},t),{},{data:a,importer:o,lang:(e.getAttribute("xml:lang")||t.lang||"").toLowerCase(),pathSelector:d,translator:this}),y=r(o.fieldOrders.entries()).sort(function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0}),b=y.filter(function(e){return e[1]>=0}),S=y.filter(function(e){return e[1]<0}),_=l(b);try{for(_.s();!(m=_.n()).done;){var w=i(m.value,1)[0],O=o.fields.get(w);g.path="".concat(t.path,".").concat(w);var x=O(e,g);null!=x&&(a[w]=x)}}catch(e){_.e(e)}finally{_.f()}var k,T=l(e.children);try{for(T.s();!(k=T.n()).done;){var A=k.value;if("string"!=typeof A){var E="{".concat(A.getNamespace(),"}").concat(A.getName()),I=this.childrenIndex.get(E);if(I){g.path="".concat(t.path,".").concat(I);var N=this.children.get(I),j=N.translator,R=N.multiple,P=N.selector;if(!P||P===d){var C=j.import(A,g);void 0!==C&&(R?(a[I]||(a[I]=[]),a[I].push(C)):a[I]?a[I]=j.resolveCollision(a[I],C):a[I]=C)}}}}}catch(e){T.e(e)}finally{T.f()}var M,D=l(S);try{for(D.s();!(M=D.n()).done;){var L=i(M.value,1)[0],B=o.fields.get(L);g.path="".concat(t.path,".").concat(L);var F=B(e,g);null!=F&&(a[L]=F)}}catch(e){D.e(e)}finally{D.f()}return a}}},{key:"export",value:function(e,t){if(e){var n,r=this.defaultType,a=this.defaultVersion,o=t.path||"";t.pathSelector&&(n=this.contexts.get("".concat(o,"[").concat(t.pathSelector,"]"))),n||(n=this.contexts.get(o)),n?r=n.impliedType||e[n.typeField]||this.defaultType:this.typeField&&(r=e[this.typeField]||this.defaultType),this.versionField&&(a=e[this.versionField]||this.defaultVersion);var s=a?"".concat(r,"__v__").concat(a):r,u=this.exporters.get(s);if(u){var f=(0,d.createElement)(u.namespace,u.element,t.namespace,t.element);t.element&&(f.parent=t.element);var p,h=l(u.optionalNamespaces);try{for(h.s();!(p=h.n()).done;){var v=i(p.value,2),m=v[0],g=v[1];f.addOptionalNamespace(m,g)}}catch(e){h.e(e)}finally{h.f()}var y=c(c({},t),{},{data:e,element:f,exporter:u,lang:(e[this.languageField]||t.lang||"").toLowerCase(),namespace:f.getDefaultNamespace(),pathSelector:r,translator:this}),b=u.fields.get(this.languageField);b&&b(f,e[this.languageField],t);var S=Object.keys(e);S.sort(function(e,t){return(u.fieldOrders.get(e)||1e5)-(u.fieldOrders.get(t)||1e5)});for(var _=0,w=S;_<w.length;_++){var O=w[_];if(O!==this.languageField){var x=e[O],k=u.fields.get(O);if(k)k(f,x,y);else{var T=this.children.get(O);if(T){y.path="".concat(t.path?t.path+".":"").concat(O);var A=T.translator,E=T.multiple,I=T.selector;if(!I||I===r){var N,j=l(E?null!=x?x:[]:[x]);try{for(j.s();!(N=j.n()).done;){var R=N.value,P=A.export(R,y);P&&f.appendChild(P)}}catch(e){j.e(e)}finally{j.f()}}}}}}return f}}}},{key:"resolveCollision",value:function(e,t){return(this.typeOrders.get(e[this.typeField]||this.defaultType)||0)<=(this.typeOrders.get(t[this.typeField]||this.defaultType)||0)?e:t}}])}();t.default=p},9783(e,t,n){"use strict";var r=n(5715),i=n(3693);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.childJSON=t.childFloat=t.childInteger=t.childDate=t.childTextBuffer=t.childText=t.childLanguageAttribute=t.textBuffer=t.textJSON=t.text=t.childDateAttribute=t.childFloatAttribute=t.childIntegerAttribute=t.childBooleanAttribute=t.childAttribute=t.namespacedDateAttribute=t.namespacedFloatAttribute=t.namespacedIntegerAttribute=t.namespacedBooleanAttribute=t.namespacedAttribute=t.dateAttribute=t.floatAttribute=t.integerAttribute=t.booleanAttribute=t.attribute=void 0,t.createElement=p,t.getLang=h,t.getTargetLang=v,t.findAll=m,t.findOrCreate=g,t.languageAttribute=P,t.childTimezoneOffset=function(e,t){return x(o({element:t,namespace:e,staticDefault:0},R))},t.childBoolean=function(e,t){return{importer:function(n){if(n.getChild(t,e||n.getNamespace()))return!0},exporter:function(n,r){r&&g(n,e||n.getNamespace(),t)}}},t.deepChildText=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return t}}catch(e){a.e(e)}finally{a.f()}return i.getText()||t},exporter:function(t,n){C(e,t,n)}}},t.deepChildInteger=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return}}catch(e){a.e(e)}finally{a.f()}var u=i.getText();return u?parseInt(u,10):t||void 0},exporter:function(t,n){C(e,t,n)}}},t.deepChildBoolean=function(e){return{importer:function(t){var n,r=t,i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(!(r=r.getChild(a.element,a.namespace||r.getNamespace())))return!1}}catch(e){i.e(e)}finally{i.f()}return!0},exporter:function(t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}}}}},t.deepMultipleChildText=function(e){var t=e.pop();return{importer:function(n,r){var i,a=n,o=s(e);try{for(o.s();!(i=o.n()).done;){var u=i.value;if(!(a=a.getChild(u.element,u.namespace||a.getNamespace())))return[]}}catch(e){o.e(e)}finally{o.f()}var c,l=[],f=m(a,t.namespace||a.getNamespace(),t.element),d=v(f,r),p=s(f);try{for(p.s();!(c=p.n()).done;){var g=c.value;h(g,r.lang)===d&&l.push(g.getText())}}catch(e){p.e(e)}finally{p.f()}return l},exporter:function(n,r,i){if(r.length){var a,o=n,u=s(e);try{for(u.s();!(a=u.n()).done;){var c=a.value;o=g(o,c.namespace||o.getNamespace(),c.element)}}catch(e){u.e(e)}finally{u.f()}var l,f=t.namespace,d=t.element,h=s(r);try{for(h.s();!(l=h.n()).done;){var v=l.value,m=p(f||o.getNamespace(),d,i.namespace,o);m.children.push(v),o.appendChild(m)}}catch(e){h.e(e)}finally{h.f()}}}}},t.childEnum=function(e,t,n){var r,i=new Map,a=new Map,o=s(t);try{for(o.s();!(r=o.n()).done;){var u=r.value;"string"==typeof u?(i.set(u,u),a.set(u,u)):(i.set(u[1],u[0]),a.set(u[0],u[1]))}}catch(e){o.e(e)}finally{o.f()}return{importer:function(t){var r,a=s(t.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;if("string"!=typeof o&&o.getNamespace()===(e||t.getNamespace())&&i.has(o.getName()))return i.get(o.getName())}}catch(e){a.e(e)}finally{a.f()}return n},exporter:function(t,n){a.has(n)&&g(t,e,a.get(n))}}},t.childDoubleEnum=function(e,t,n,r){var i=new Set(t),a=new Set(n);return{importer:function(t){var n,o=s(t.children);try{for(o.s();!(n=o.n()).done;){var u=n.value;if("string"!=typeof u&&u.getNamespace()===(e||t.getNamespace())&&i.has(u.getName())){var c,l=s(u.children);try{for(l.s();!(c=l.n()).done;){var f=c.value;if("string"!=typeof f&&f.getNamespace()===(e||t.getNamespace())&&a.has(f.getName()))return[u.getName(),f.getName()]}}catch(e){l.e(e)}finally{l.f()}return[u.getName()]}}}catch(e){o.e(e)}finally{o.f()}return r},exporter:function(t,n){var r=g(t,e,n[0]);n[1]&&g(r,e,n[1])}}},t.multipleChildText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=v(o,r),c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value;h(l,r.lang)===u&&a.push(l.getText())}}catch(e){c.e(e)}finally{c.f()}return a},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=p(e||n.getNamespace(),t,i.namespace,n);c.children.push(u),n.appendChild(c)}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(u)}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=p(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.multipleChildIntegerAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(parseInt(u,10))}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=p(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c.toString()),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.childAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=new Set,c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var d=h(l,r.lang);if(u.has(d))continue;a.push({lang:d,value:f}),u.add(d)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=u.value;if(c){var l=p(e||n.getNamespace(),t,i.namespace,n);u.lang!==i.lang&&l.setAttribute("xml:lang",u.lang),l.children.push(c),n.appendChild(l)}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=new Map,u=!1,c=s(m(n,e||n.getNamespace(),t));try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var d=h(l,r.lang),p=o.get(d);p||(p=[],o.set(d,p),a.push({lang:d,value:p})),p.push(f),u=!0}}}catch(e){c.e(e)}finally{c.f()}return u?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u,c=a.value,l=s(c.value);try{for(l.s();!(u=l.n()).done;){var f=u.value,d=p(e||n.getNamespace(),t,i.namespace,n);c.lang!==i.lang&&d.setAttribute("xml:lang",c.lang),d.children.push(f),n.appendChild(d)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildEnum=function(e,t){var n,r=new Map,i=new Map,a=s(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"==typeof o?(r.set(o,o),i.set(o,o)):(r.set(o[1],o[0]),i.set(o[0],o[1]))}}catch(e){a.e(e)}finally{a.f()}return{importer:function(t){var n,i=[],a=s(t.children);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"!=typeof o&&o.getNamespace()===(e||t.getNamespace())&&r.has(o.getName())&&i.push(r.get(o.getName()))}}catch(e){a.e(e)}finally{a.f()}return i},exporter:function(t,n){var r,a=s(n);try{for(a.s();!(r=a.n()).done;){var o=r.value;g(t,e,i.get(o))}}catch(e){a.e(e)}finally{a.f()}}}},t.splicePath=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{importer:function(i,a){var o=i.getChild(t,e||i.getNamespace());if(o){var u,c=[],l=s(o.children);try{for(l.s();!(u=l.n()).done;){var f=u.value;if("string"!=typeof f&&a.registry.getImportKey(f)===n){var d=a.registry.import(f);d&&c.push(d)}}}catch(e){l.e(e)}finally{l.f()}return r?c:c[0]}},exporter:function(r,i,a){var u,c=[],l=s(Array.isArray(i)?i:[i]);try{for(l.s();!(u=l.n()).done;){var f=u.value,d=a.registry.export(n,f,o(o({},a),{},{namespace:e||r.getNamespace()||void 0}));d&&c.push(d)}}catch(e){l.e(e)}finally{l.f()}if(c.length){var p,h=g(r,e||r.getNamespace(),t),v=s(c);try{for(v.s();!(p=v.n()).done;){var m=p.value;h.appendChild(m)}}catch(e){v.e(e)}finally{v.f()}}}}},t.staticValue=function(e){return{exporter:function(){},importer:function(){return e}}},t.childRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a=r.getChild(t,e||r.getNamespace());return a?n?i.sanitizers[n](a.toJSON()):a.toJSON():void 0}},exporter:function(r,i,a){if("string"==typeof i&&(i=(0,d.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON()),n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}i&&r.appendChild(new f.default(i.name,i.attributes,i.children))}}},t.childLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=m(r,e||r.getNamespace(),t),u=v(o,i),c=s(o);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(h(l,i.lang)===u)return n?i.sanitizers[n](l.toJSON()):l.toJSON()}}catch(e){c.e(e)}finally{c.f()}return o[0]?n?i.sanitizers[n](o[0].toJSON()):o[0].toJSON():void 0}},exporter:function(r,i,a){if("string"==typeof i&&(i=(0,d.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON()),i&&n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}if(i){var o,u=g(r,e||r.getNamespace(),t,a.lang),c=s(i.children);try{for(c.s();!(o=c.n()).done;){var l=o.value;"string"==typeof l?u.appendChild(l):l&&u.appendChild(new f.default(l.name,l.attributes,l.children))}}catch(e){c.e(e)}finally{c.f()}}}}},t.childAlternateLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=[],u=new Set,c=s(m(r,e||r.getNamespace(),t));try{for(c.s();!(a=c.n()).done;){var l=a.value,f=l.toJSON();if(n&&(f=i.sanitizers[n](f)),f){var d=h(l,i.lang);if(u.has(d))continue;o.push({lang:d,value:f}),u.add(d)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?o:void 0}},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=c.value;if("string"==typeof l&&(l=(0,d.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(l,"</").concat(t,">")).toJSON()),l&&n){if(!a.sanitizers||!a.sanitizers[n])continue;l=a.sanitizers[n](l)}if(l){var h=p(e||r.getNamespace(),t,a.namespace,r);r.appendChild(h),c.lang!==a.lang&&h.setAttribute("xml:lang",c.lang);var v,m=s(l.children);try{for(m.s();!(v=m.n()).done;){var g=v.value;"string"==typeof g?h.appendChild(g):h.appendChild(new f.default(g.name,g.attributes,g.children))}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){u.e(e)}finally{u.f()}}}},t.parameterMap=function(e,n,i,a){return{importer:function(r,o){var u,c={},l=m(r,e,n),f=(0,t.attribute)(i).importer,d=(0,t.attribute)(a).importer,p=s(l);try{for(p.s();!(u=p.n()).done;){var h=u.value;c[f(h,o)]=d(h,o)}}catch(e){p.e(e)}finally{p.f()}return c},exporter:function(o,s,u){for(var c=(0,t.attribute)(i).exporter,l=(0,t.attribute)(a).exporter,f=e||o.getNamespace(),d=0,h=Object.entries(s);d<h.length;d++){var v=r(h[d],2),m=v[0],g=v[1],y=p(f,n,u.namespace,o);c(y,m,u),s[m]&&l(y,g,u),o.appendChild(y)}}}};var l=n(2208),f=c(n(6686)),d=n(6851);function p(e,t,n,r){if(r){e=e||r.getNamespace();var i=r.getNamespaceRoot(e);if(i){var a=i.useNamespace("",e);t="".concat(a,":").concat(t)}}var o=new f.default(t);return t.indexOf(":")<0&&(!n||e!==n)&&o.setAttribute("xmlns",e),o}function h(e,t){return(e.getAttribute("xml:lang")||t||"").toLowerCase()}function v(e,t){var n,r=[],i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(h(a,t.lang))}}catch(e){i.e(e)}finally{i.f()}return(t.resolveLanguage?t.resolveLanguage(r,t.acceptLanguages||[],t.lang):t.lang)||""}function m(e,t,n,r){var i=e.getChildren(n,t),a=h(e);return i.length?r?i.filter(function(e){if(h(e,a)===r)return!0}):i:[]}function g(e,t,n,r){t=t||e.getNamespace();var i=m(e,t,n,r);if(i.length)return i[0];var a=p(t,n,e.getDefaultNamespace(),e),o=h(e,r);return r&&o!==r&&a.setAttribute("xml:lang",r),e.appendChild(a),a}function y(e){return{importer:function(t){var n=t.getAttribute(e.name,e.namespace);return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);if(r||e.emitEmpty)if(e.namespace&&e.prefix){var i,a=t.getNamespaceRoot(e.namespace);if(a)i=a.useNamespace(e.prefix,e.namespace);else{var o=t.getNamespaceContext();o[e.namespace]||(i=t.useNamespace(e.prefix,e.namespace),o[e.namespace]=i)}t.setAttribute("".concat(i,":").concat(e.name),r,e.emitEmpty)}else t.setAttribute(e.name,r,e.emitEmpty)}}}}function b(e,t){return function(n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=o({staticDefault:arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0},r),y(o(o({name:n},e),t?t(r):r))}}function S(e,t){return function(n,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return a=o({staticDefault:arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0},a),y(o(o({name:i,namespace:r,prefix:n},e),t?t(a):a))}}function _(e){var t=e.converter||y(o(o({},e),{},{namespace:e.attributeNamespace}));return{importer:function(n,r){var i=n.getChild(e.element,e.namespace||n.getNamespace());return i?t.importer(i,r):e.dynamicDefault?e.dynamicDefault():e.staticDefault},exporter:function(n,r,i){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element);t.exporter(a,r,i)}}}}function w(e,t){return function(n,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return a=o({staticDefault:arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0},a),_(o(o({element:r,name:i,namespace:n},e),t?t(a):a))}}function O(e){return{importer:function(t){var n=t.getText();return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(n||!e.emitEmpty){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);r&&t.children.push(r)}}else t.children.push("")}}}function x(e){var t=O(e);return{importer:function(n,r){var i=m(n,e.namespace||n.getNamespace(),e.element),a=v(i,r);if(!i.length)return e.dynamicDefault?e.dynamicDefault():e.staticDefault;if(e.matchLanguage){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(h(c,r.lang)===a)return t.importer(c,r)}}catch(e){u.e(e)}finally{u.f()}}return t.importer(i[0],r)},exporter:function(n,r,i){if(r||!e.emitEmpty){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0);t.exporter(a,r,i)}}else g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0)}}}var k={parseValue:function(e){return e},writeValue:function(e){return e}},T={parseValue:function(e){return parseInt(e,10)},writeValue:function(e){return e.toString()}},A={parseValue:function(e){return parseFloat(e)},writeValue:function(e){return e.toString()}},E={parseValue:function(e){return"true"===e||"1"===e||"false"!==e&&"0"!==e&&void 0},writeValue:function(e){return e?"1":"0"}},I={parseValue:function(e){return new Date(e)},writeValue:function(e){return"string"==typeof e?e:e.toISOString()}},N={parseValue:function(e){return JSON.parse(e)},writeValue:function(e){return JSON.stringify(e)}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return{parseValue:function(t){return"base64"===e&&"="===t&&(t=""),l.Buffer.from(t.trim(),e)},writeValue:function(t){var n;return n="string"==typeof t?l.Buffer.from(t).toString(e):t?t.toString(e):"","base64"===e&&(n=n||"="),n}}},R={parseValue:function(e){var t=-1;"-"===e.charAt(0)&&(t=1,e=e.slice(1));var n=e.split(":");return(60*parseInt(n[0],10)+parseInt(n[1],10))*t},writeValue:function(e){if("string"==typeof e)return e;var t="-";e<0&&(e=-e,t="+");var n=e/60,r=e%60;return t+(n<10?"0":"")+n+":"+(r<10?"0":"")+r}};function P(){return{importer:function(e,t){return h(e,t.lang)},exporter:function(e,t,n){t&&t.toLowerCase()!==n.lang?e.setAttribute("xml:lang",t):e.setAttribute("xml:lang",void 0)}}}t.attribute=b(k,function(e){return o({dynamicDefault:e.emitEmpty?function(t){return""===t?"":e.staticDefault}:void 0},e)}),t.booleanAttribute=b(E),t.integerAttribute=b(T),t.floatAttribute=b(A),t.dateAttribute=b(I),t.namespacedAttribute=S(k),t.namespacedBooleanAttribute=S(E),t.namespacedIntegerAttribute=S(T),t.namespacedFloatAttribute=S(A),t.namespacedDateAttribute=S(I),t.childAttribute=w(k),t.childBooleanAttribute=w(E),t.childIntegerAttribute=w(T),t.childFloatAttribute=w(A),t.childDateAttribute=w(I),t.text=function(e){return O(o({staticDefault:e},k))},t.textJSON=function(){return O(o({},N))},t.textBuffer=function(){return O(o({},j(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8")))},t.childLanguageAttribute=function(e,t){return _(o({converter:P(),element:t,name:"xml:lang",namespace:e},k))},t.childText=function(e,t,n){return x(o({element:t,emitEmpty:arguments.length>3&&void 0!==arguments[3]&&arguments[3],matchLanguage:!0,namespace:e,staticDefault:n},k))},t.childTextBuffer=function(e,t){return x(o({element:t,matchLanguage:!0,namespace:e},j(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"utf8")))},t.childDate=function(e,t){return x(o({element:t,namespace:e},I))},t.childInteger=function(e,t,n){return x(o({element:t,namespace:e,staticDefault:n},T))},t.childFloat=function(e,t,n){return x(o({element:t,namespace:e,staticDefault:n},A))},t.childJSON=function(e,t){return x(o({element:t,namespace:e},N))};var C=function(e,t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}i.children.push(n.toString())}}},7930(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.XMLElement=t.Translator=t.Registry=t.StreamParser=t.parse=t.Parser=void 0,t.define=function(e){return function(t){t.define(e)}};var o=a(n(6686));t.XMLElement=o.default;var s=a(n(3803));t.Registry=s.default;var u=a(n(8738));t.Translator=u.default,i(n(540),t),i(n(9783),t),i(n(7691),t);var c=n(6851);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return a(c).default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return c.parse}});var l=n(9523);Object.defineProperty(t,"StreamParser",{enumerable:!0,get:function(){return a(l).default}})},6068(e,t,n){"use strict";var r=n(5715);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var o=new Set(["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul"]),s=new Set(["style"]),u=new Map([["a",new Set(["href","style"])],["body",new Set(["style","xml:lang"])],["blockquote",s],["br",s],["cite",s],["em",s],["img",new Set(["alt","height","src","style","width"])],["li",s],["ol",s],["p",s],["span",s],["strong",s],["ul",s]]),c=new Map([["font-style",/normal|italic|oblique|inherit/i],["font-weight",/normal|bold|bolder|lighter|inherit|\d\d\d/i],["text-decoration",/none|underline|overline|line-through|blink|inherit/i]]),l=function(e){return!!e.match(/^(https?|xmpp|cid|mailto|ftps?|im|ircs?|sips?|tel|geo|bitcoin|magnet):/i)&&e},f=function(e){return!!e.match(/^[0-9]*$/)&&e},d={alt:function(e){return e},height:f,href:l,src:l,style:function(e){var t=";".concat(e).replace(/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,"").replace(/\/\*.*/,"").replace(/\\([a-fA-F0-9]{1,6})\s?/,function(e,t){return String.fromCharCode(parseInt(t,16))}).match(/;\s*([a-z-]+)\s*:\s*([^;]*[^\s;])\s*/g),n=[];if(!t)return!1;var r,a=i(t);try{for(a.s();!(r=a.n()).done;){var o=r.value.match(/^;\s*([a-z-]+)\s*:\s*([^;]*[^\s])\s*$/);if(o){var s=c.get(o[1]);if(s){var u=o[2].match(s);u&&n.push("".concat(o[1],":").concat(u[0]))}}}}catch(e){a.e(e)}finally{a.f()}return!!n.length&&n.join("")},width:f};function p(e){if("string"==typeof e)return e;if(!o.has(e.name)){if("script"===e.name)return;return function(e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if("string"==typeof a)n.push(a);else{var o=p(a);o&&(Array.isArray(o)?n=n.concat(o):n.push(o))}}}catch(e){r.e(e)}finally{r.f()}return n}(e)}for(var t=e.children.map(p).filter(function(e){return void 0!==e}),n={},a=0,s=Object.entries(e.attributes);a<s.length;a++){var c=r(s[a],2),l=c[0],f=c[1],h=u.get(e.name);if(h&&h.has(l)&&f){var v=d[l](f);v&&(n[l]=v)}}return{attributes:n,children:t,name:e.name}}t.default=function(e){if("string"!=typeof e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a)if("string"!=typeof a){var o=p(a);Array.isArray(o)?n=n.concat(o):o&&n.push(o)}else n.push(a)}}catch(e){r.e(e)}finally{r.f()}var s={};if("body"===e.name)return void 0!==e.attributes.xmlns&&(s.xmlns=e.attributes.xmlns),e.attributes.style&&(s.style=e.attributes.style),void 0!==e.attributes["xml:lang"]&&(s["xml:lang"]=e.attributes["xml:lang"]),{attributes:s,children:n,name:"body"}}}},1060(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579),s=n(3693);Object.defineProperty(t,"__esModule",{value:!0}),t.priorityQueue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new u,a=!1,o=!1,s=0,c=[],l=function(){if(0===n.length&&0===s){for(var e=0,t=c;e<t.length;e++)(0,t[e])();c=[]}},f=function(){var u=i(r.mark(function i(){var u,c,d,p;return r.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a||o||s>=t||0===n.length)){r.next=1;break}return r.abrupt("return");case 1:if(u=n.pop()){r.next=2;break}return r.abrupt("return");case 2:return s++,r.prev=3,r.next=4,new Promise(function(t){var n=function(){return t()},r=e(u.task,n);r instanceof Promise&&r.then(n).catch(n)});case 4:null===(c=u.callback)||void 0===c||c.call(u),r.next=6;break;case 5:r.prev=5,p=r.catch(3),null===(d=u.callback)||void 0===d||d.call(u,p instanceof Error?p:new Error(String(p)));case 6:return r.prev=6,s--,o||(l(),f()),r.finish(6);case 7:case"end":return r.stop()}},i,null,[[3,5,6,7]])}));return function(){return u.apply(this,arguments)}}();return{push:function(e,t,r){o||(n.push(e,t,r),queueMicrotask(function(){return f()}))},pause:function(){a=!0},resume:function(){a=!1,f()},kill:function(){o=!0,n.clear(),c=[]},idle:function(){return 0===n.length&&0===s},drain:function(){return 0===n.length&&0===s?Promise.resolve():new Promise(function(e){c.push(e)})}}};var u=function(){return o(function e(){a(this,e),s(this,"heap",[]),s(this,"insertionCounter",0)},[{key:"length",get:function(){return this.heap.length}},{key:"push",value:function(e,t,n){0===this.heap.length&&(this.insertionCounter=0);var r={task:e,priority:t,insertionOrder:this.insertionCounter++,callback:n};this.heap.push(r),this.bubbleUp(this.heap.length-1)}},{key:"isHigherPriority",value:function(e,t){return e.priority!==t.priority?e.priority<t.priority:e.insertionOrder<t.insertionOrder}},{key:"pop",value:function(){if(0!==this.heap.length){var e=this.heap[0],t=this.heap.pop();return this.heap.length>0&&(this.heap[0]=t,this.bubbleDown(0)),e}}},{key:"clear",value:function(){this.heap=[],this.insertionCounter=0}},{key:"bubbleUp",value:function(e){for(;e>0;){var t=e-1>>1;if(!this.isHigherPriority(this.heap[e],this.heap[t]))break;this.swap(e,t),e=t}}},{key:"bubbleDown",value:function(e){for(var t=this.heap.length;;){var n=1+(e<<1),r=n+1,i=e;if(n<t&&this.isHigherPriority(this.heap[n],this.heap[i])&&(i=n),r<t&&this.isHigherPriority(this.heap[r],this.heap[i])&&(i=r),i===e)break;this.swap(e,i),e=i}}},{key:"swap",value:function(e,t){var n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n}}])}()},9255(e,t,n){"use strict";var r=n(8452),i=n(3072),a=n(9511),o=n(7383),s=n(4579),u=n(3693);function c(e,t,n){return t=i(t),r(e,l()?Reflect.construct(t,n||[],i(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.SCRAM=t.DIGEST=t.OAUTH=t.PLAIN=t.EXTERNAL=t.ANONYMOUS=t.Factory=t.SimpleMech=void 0,t.createClientNonce=g,t.XOR=y,t.H=b,t.HMAC=S,t.Hi=_;var p=n(2208),h=n(3486),v=function(){return s(function e(t){o(this,e),u(this,"name",void 0),u(this,"authenticated",!1),u(this,"mutuallyAuthenticated",!1),u(this,"errorData",void 0),this.name=t},[{key:"getCacheableCredentials",value:function(){return null}},{key:"processChallenge",value:function(e){}},{key:"processSuccess",value:function(e){this.authenticated=!0}},{key:"finalize",value:function(){var e={authenticated:this.authenticated,mutuallyAuthenticated:this.mutuallyAuthenticated};return this.errorData&&(e.errorData=this.errorData),e}}])}();t.SimpleMech=v;var m=function(){return s(function e(){o(this,e),u(this,"mechanisms",void 0),this.mechanisms=[]},[{key:"register",value:function(e,t,n){this.mechanisms.push({constructor:t,name:e.toUpperCase(),priority:n}),this.mechanisms.sort(function(e,t){return t.priority-e.priority})}},{key:"disable",value:function(e){var t=e.toUpperCase();this.mechanisms=this.mechanisms.filter(function(e){return e.name!==t})}},{key:"createMechanism",value:function(e){var t,n=e.map(function(e){return e.toUpperCase()}),r=f(this.mechanisms);try{for(r.s();!(t=r.n()).done;){var i,a=t.value,o=f(n);try{for(o.s();!(i=o.n()).done;)if(i.value===a.name)return new a.constructor(a.name)}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return null}}])}();function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;return(0,p.randomBytes)(e).toString("hex")}function y(e,t){for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return p.Buffer.from(n)}function b(e,t){return(0,p.createHash)(t).update(e).digest()}function S(e,t,n){return(0,p.createHmac)(n,e).update(t).digest()}function _(e,t,n,r){for(var i=S(e,p.Buffer.concat([t,p.Buffer.from("00000001","hex")]),r),a=i,o=0;o<n-1;o++)a=y(a,i=S(e,i,r));return a}function w(e){for(var t={},n=e.toString().split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;r<i;r++){var a=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);a&&(t[a[1]]=a[2])}return t}function O(e){var t,n=[],r=f(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;","===i?n.push("=2C"):"="===i?n.push("=3D"):n.push(i)}}catch(e){r.e(e)}finally{r.f()}return n.join("")}t.Factory=m;var x=function(e){function t(){return o(this,t),c(this,t,arguments)}return a(t,e),s(t,[{key:"getExpectedCredentials",value:function(){return{optional:["trace"],required:[]}}},{key:"createResponse",value:function(e){return p.Buffer.from(e.trace||"")}}])}(v);t.ANONYMOUS=x;var k=function(e){function t(){return o(this,t),c(this,t,arguments)}return a(t,e),s(t,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:[]}}},{key:"createResponse",value:function(e){return p.Buffer.from(e.authzid||"")}}])}(v);t.EXTERNAL=k;var T=function(e){function t(){return o(this,t),c(this,t,arguments)}return a(t,e),s(t,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["username","password"]}}},{key:"createResponse",value:function(e){return p.Buffer.from((e.authzid||"")+"\0"+e.username+"\0"+(e.password||e.token))}}])}(v);t.PLAIN=T;var A=function(e){function t(e){var n;return o(this,t),n=c(this,t,[e]),u(n,"failed",!1),n.name=e,n}return a(t,e),s(t,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["token"]}}},{key:"createResponse",value:function(e){if(this.failed)return p.Buffer.from("");var t="n,".concat(O((0,h.saslprep)(e.authzid)),","),n="auth=Bearer ".concat(e.token,"");return p.Buffer.from(t+""+n+"","utf8")}},{key:"processChallenge",value:function(e){this.failed=!0,this.errorData=JSON.parse(e.toString("utf8"))}}])}(v);t.OAUTH=A;var E=function(e){function t(e){var n;return o(this,t),n=c(this,t,[e]),u(n,"name",void 0),u(n,"providesMutualAuthentication",!1),u(n,"nonce",void 0),u(n,"realm",void 0),u(n,"charset",void 0),u(n,"state","INITIAL"),n.name=e,n}return a(t,e),s(t,[{key:"processChallenge",value:function(e){this.state="CHALLENGE";var t=w(e);this.authenticated=!!t.rspauth,this.realm=t.realm,this.nonce=t.nonce,this.charset=t.charset}},{key:"getExpectedCredentials",value:function(){return{optional:["authzid","clientNonce","realm"],required:["host","password","serviceName","serviceType","username"]}}},{key:"createResponse",value:function(e){if("INITIAL"===this.state||this.authenticated)return null;var t=e.serviceType+"/"+e.host;e.serviceName&&e.host!==e.serviceName&&(t+="/"+e.serviceName);var n=e.realm||this.realm||"",r=e.clientNonce||g(16),i="00000001",a="auth",o="";o+='username="'+e.username+'"',n&&(o+=',realm="'+n+'"'),o+=',nonce="'+this.nonce+'"',o+=',cnonce="'+r+'"',o+=",nc="+i,o+=",qop="+a,o+=',digest-uri="'+t+'"';var s=(0,p.createHash)("md5").update(e.username).update(":").update(n).update(":").update(e.password).digest(),u=(0,p.createHash)("md5").update(s).update(":").update(this.nonce).update(":").update(r);e.authzid&&u.update(":").update(e.authzid);var c=u.digest("hex"),l=(0,p.createHash)("md5").update("AUTHENTICATE:").update(t).digest("hex");return o+=",response="+(0,p.createHash)("md5").update(c).update(":").update(this.nonce).update(":").update(i).update(":").update(r).update(":").update(a).update(":").update(l).digest("hex"),"utf-8"===this.charset&&(o+=",charset=utf-8"),e.authzid&&(o+=',authzid="'+e.authzid+'"'),p.Buffer.from(o)}}])}(v);t.DIGEST=E;var I=function(){return s(function e(t){o(this,e),u(this,"name",void 0),u(this,"providesMutualAuthentication",!0),u(this,"useChannelBinding",void 0),u(this,"algorithm",void 0),u(this,"challenge",void 0),u(this,"salt",void 0),u(this,"iterationCount",void 0),u(this,"nonce",void 0),u(this,"clientNonce",void 0),u(this,"verifier",void 0),u(this,"error",void 0),u(this,"gs2Header",void 0),u(this,"clientFirstMessageBare",void 0),u(this,"serverSignature",void 0),u(this,"cache",void 0),u(this,"state",void 0),this.name=t,this.state="INITIAL",this.useChannelBinding=this.name.toLowerCase().endsWith("-plus"),this.algorithm=this.name.toLowerCase().split("scram-")[1].split("-plus")[0]},[{key:"getExpectedCredentials",value:function(){var e=["username","password"];return this.useChannelBinding&&e.push("tlsUnique"),{optional:["authzid","clientNonce"],required:e}}},{key:"getCacheableCredentials",value:function(){return this.cache}},{key:"createResponse",value:function(e){return"INITIAL"===this.state?this.initialResponse(e):this.challengeResponse(e)}},{key:"processChallenge",value:function(e){var t=w(e);this.salt=p.Buffer.from(t.s||"","base64"),this.iterationCount=parseInt(t.i,10),this.nonce=t.r,this.verifier=t.v,this.error=t.e,this.challenge=e}},{key:"processSuccess",value:function(e){this.processChallenge(e)}},{key:"finalize",value:function(){return this.verifier?this.serverSignature.toString("base64")!==this.verifier?{authenticated:!1,error:"Mutual authentication failed",mutuallyAuthenticated:!1}:{authenticated:!0,mutuallyAuthenticated:!0}:{authenticated:!1,error:this.error,mutuallyAuthenticated:!1}}},{key:"initialResponse",value:function(e){var t=O((0,h.saslprep)(e.authzid)),n=O((0,h.saslprep)(e.username));this.clientNonce=e.clientNonce||g();var r="n";e.tlsUnique&&(r=this.useChannelBinding?"p=tls-unique":"y"),this.gs2Header=p.Buffer.from(t?"".concat(r,",a=").concat(t,","):"".concat(r,",,")),this.clientFirstMessageBare=p.Buffer.from("n=".concat(n,",r=").concat(this.clientNonce));var i=p.Buffer.concat([this.gs2Header,this.clientFirstMessageBare]);return this.state="CHALLENGE",i}},{key:"challengeResponse",value:function(e){var t,n,r,i=p.Buffer.from("Client Key"),a=p.Buffer.from("Server Key"),o=p.Buffer.concat([this.gs2Header,e.tlsUnique||p.Buffer.from("")]).toString("base64"),s=p.Buffer.from("c=".concat(o,",r=").concat(this.nonce)),u=e.salt&&0===p.Buffer.compare(e.salt,this.salt);u&&e.clientKey&&e.serverKey?(n=p.Buffer.from(e.clientKey),r=p.Buffer.from(e.serverKey)):u&&e.saltedPassword?(n=S(t=p.Buffer.from(e.saltedPassword),i,this.algorithm),r=S(t,a,this.algorithm)):(n=S(t=_(p.Buffer.from((0,h.saslprep)(e.password)),this.salt,this.iterationCount,this.algorithm),i,this.algorithm),r=S(t,a,this.algorithm));var c=b(n,this.algorithm),l=p.Buffer.from(","),f=p.Buffer.concat([this.clientFirstMessageBare,l,this.challenge,l,s]),d=y(n,S(c,f,this.algorithm)).toString("base64");this.serverSignature=S(r,f,this.algorithm);var v=p.Buffer.concat([s,p.Buffer.from(",p=".concat(d))]);return this.state="FINAL",this.cache={clientKey:n,salt:this.salt,saltedPassword:t,serverKey:r},v}}])}();t.SCRAM=I},6929(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_DATA=void 0,t.TABLE_DATA={"A.1":{r:"hk:if|le:lf|nf:nv|qg:qv|rg:rj|rm:rp|rr:rt|rv:s3|vn:vv|17m:17n|17q:17v|18g:19g|1an:1ao|1cb:1cg|1e5:1ef|1fb:1ff|1fl:1gb|1gd:1gq|1gs:1gu|1hr:1hv|1im:1iv|1ne:1nf|1pd:1pf|1qb:1rv|1ti:280|29q:29r|2ae:2af|2al:2an|2bh:2c0|2cd:2ce|2ch:2ci|2dj:2dl|2dq:2dr|2e5:2e6|2e9:2ea|2ee:2em|2eo:2er|2f4:2f5|2fr:2g1|2g3:2g4|2gb:2ge|2gh:2gi|2hq:2hr|2i3:2i6|2i9:2ia|2ie:2io|2iv:2j5|2jl:2k0|2lq:2lr|2me:2mf|2mh:2mv|2n1:2n5|2ng:2o0|2od:2oe|2oh:2oi|2pk:2pl|2pq:2pr|2q4:2q6|2q9:2qa|2qe:2ql|2qo:2qr|2r2:2r5|2rh:2s1|2sb:2sd|2sm:2so|2t0:2t2|2t5:2t7|2tb:2td|2tq:2tt|2u3:2u5|2ue:2um|2uo:2v6|2vj:300|31q:31t|32e:32k|32n:32v|332:335|33g:341|35q:35t|36e:36k|36n:36t|372:375|37g:381|39q:39t|3a4:3a5|3ae:3am|3ao:3av|3b2:3b5|3bg:3c1|3cn:3cp|3du:3dv|3e7:3e9|3eb:3ee|3f0:3fh|3fl:3g0|3hr:3hu|3is:3k0|3k5:3k6|3kb:3kc|3ke:3kj|3l8:3l9|3lu:3lv|3me:3mf|3mq:3mr|3mu:3nv|3rb:3rg|3sc:3sf|3ud:3ue|3ug:3vv|41j:41l|41q:41v|42q:44v|466:46f|47p:47q|47s:47v|4aq:4au|4d3:4d7|4fq:4fv|4ie:4if|4iu:4iv|4ke:4kf|4lm:4ln|4m6:4m7|4om:4on|4qr:4r0|4rt:4sv|4vl:500|5jn:5jv|5kt:5kv|5nh:5nv|5ol:5ov|5pn:5pv|5qk:5qv|5rk:5rv|5ut:5uv|5va:5vv|60q:60v|63o:63v|65a:7fv|7ks:7kv|7nq:7nv|7om:7on|7ou:7ov|7q6:7q7|7qe:7qf|7ru:7rv|7uk:7ul|7vg:7vh|82j:82m|82o:82u|834:839|83i:83j|84f:84v|85i:86f|87b:87v|89r:89s|8ac:8ai|8c4:8cf|8uf:8vv|917:91v|92b:92v|9gk:9gl|9ju:9jv|9ka:9o0|9oa:9ob|9qj:9ql|9qv:9r0|9sl:9sn|9tv:9uf|9vc:9vf|ao0:bjv|bnk:bnv|bum:bvf|bvs:bvv|c4n:c4o|c80:c84|c9d:c9g|cdo:cff|cgt:cgv|ci4:cig|cjs:cju|cmc:cmf|crn:crq|cuu:cuv|jdm:jfv|17t6:17vv|194d:194f|1967:1avv|1lt4:1lvv|1uhe:1uhf|1ujb:1unv|1uo7:1uoi|1uoo:1uos|1uti:1uui|1va0:1vaf|1vcg:1vch|1ve8:1vef|1vft:1vfv|1vgg:1vgv|1vh4:1vhf|1vi7:1vi8|1vjc:1vjf|1vnt:1vnu|1vtv:1vu1|1vu8:1vu9|1vug:1vuh|1vuo:1vup|1vut:1vuv|1vvf:1vvo|2000:20nv|20p4:20pf|20qb:20vv|2116:2117|212e:3jvv|3k7m:3k7v|3k97:3k99|3keu:3kvv|3l50:3l51|3l53:3l54|3l57:3l58|3l8b:3l8c|3la7:3la9|3ll4:3ll7|3lua:3lud|3m00:3vvt|59mn:5tvv|5ugu:5vvt|6000:7vvt|8000:9vvt|a000:bvvt|c000:dvvt|e000:fvvt|g000:hvvt|i000:jvvt|k000:lvvt|m000:nvvt|o000:pvvt|q000:rvvt|s002:s00v|s040:tvvt",s:"9p8|9qc|9qe|9qn|9tg|147|bkq|3l2l|3l4t|3l5d|3l5q|3l5s|3l61|3l64|3l86|3l8l|3l8t|3l9q|3l9v|3la5|3lah|16f|c20|ccf|cnv|cvv|1b0|1c8|1d2|1dq|1h0|1nv|1oe|284|2c4|2d9|2dh|2dt|2eu|2h9|2hh|2hk|2hn|2ht|2it|2k4|2kc|2ke|2ki|2l9|2lh|2lk|2m6|2ma|2o4|2p9|2ph|2qu|2s4|2sh|2sr|2st|2tm|2u9|304|30d|30h|319|31k|325|329|344|34d|34h|359|35k|365|369|36v|384|38d|38h|399|3a9|3c4|3di|3ds|3el|3en|3k3|3k9|3ko|3l0|3l4|3l6|3lc|3lq|3m5|3m7|3q8|3so|3tt|412|418|41b|4g7|4i7|4i9|4in|4ip|4k7|4k9|4lf|4lh|4lv|4m1|4mf|4mn|4nf|4of|4oh|4ov|4q7|h1|5od|5rd|5rh|60f|1upn|1upt|1upv|1uq2|1uq5|1vij|1vj7|1vjl|1vo0|1vv7|20ov|7qo|7qq|7qs|7qu|7tl|7u5|7us|7vl|7vv|sb|sd|s000|t2|97v|uf|9go|9o5"},"B.1":{r:"60b:60d|80b:80d|1vg0:1vgf",s:"5d|606|1vnv|830|qf"},"B.2":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|rq:10;tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ui:u5|uj:ud|uk:ub|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti:7rg;tp|7tj:th;tp|7tk:tc;tp|7tm:th;q2|7tn:th;q2;tp|7ts:th;tp|7tu:tp|7u2:7rk;tp|7u3:tn;tp|7u4:te;tp|7u6:tn;q2|7u7:tn;q2;tp|7uc:tn;tp|7ui:tp;o8;o0|7uj:tp;o8;o1|7um:tp;q2|7un:tp;o8;q2|7v2:u5;o8;o0|7v3:u5;o8;o1|7v4:u1;oj|7v6:u5;q2|7v7:u5;o8;q2|7vi:7rs;tp|7vj:u9;tp|7vk:ue;tp|7vm:u9;q2|7vn:u9;q2;tp|7vs:u9;tp|858:3i;3j|882:33|883:5g;33|887:ir|889:5g;36|88b:38|88c:38|88d:38|88g:39|88h:39|88i:3c|88l:3e|88m:3e;3f|88p:3g|88q:3h|88r:3i|88s:3i|88t:3i|890:3j;3d|891:3k;35;3c|892:3k;3d|894:3q|898:3q|89c:32|89d:33|89g:35|89h:36|89j:3d|89u:tj|89v:u0|8a5:34|crh:38;3g;31|crj:31;3l|crl:3f;3m|cs0:3g;31|cs1:3e;31|cs2:ts;31|cs3:3d;31|cs4:3b;31|cs5:3b;32|cs6:3d;32|cs7:37;32|csa:3g;36|csb:3e;36|csc:ts;36|csg:38;3q|csh:3b;38;3q|csi:3d;38;3q|csj:37;38;3q|csk:3k;38;3q|ct9:3g;31|cta:3b;3g;31|ctb:3d;3g;31|ctc:37;3g;31|ctk:3g;3m|ctl:3e;3m|ctm:ts;3m|ctn:3d;3m|cto:3b;3m|ctp:3d;3m|ctq:3g;3n|ctr:3e;3n|cts:ts;3n|ctt:3d;3n|ctu:3b;3n|ctv:3d;3n|cu0:3b;u9|cu1:3d;u9|cu3:32;3h|cu6:33;8gl;3b;37|cu7:33;3f;1e|cu8:34;32|cu9:37;3p|cub:38;3g|cud:3b;3b|cue:3b;3d|cun:3g;38|cup:3g;3g;3d|cuq:3g;3i|cus:3j;3m|cut:3n;32|1uo0:36;36|1uo1:36;39|1uo2:36;3c|1uo3:36;36;39|1uo4:36;36;3c|1uo5:3j;3k|1uo6:3j;3k|1uoj:1bk;1bm|1uok:1bk;1b5|1uol:1bk;1bb|1uom:1bu;1bm|1uon:1bk;1bd|3l00:31|3l01:32|3l02:33|3l03:34|3l04:35|3l05:36|3l06:37|3l07:38|3l08:39|3l09:3a|3l0a:3b|3l0b:3c|3l0c:3d|3l0d:3e|3l0e:3f|3l0f:3g|3l0g:3h|3l0h:3i|3l0i:3j|3l0j:3k|3l0k:3l|3l0l:3m|3l0m:3n|3l0n:3o|3l0o:3p|3l0p:3q|3l1k:31|3l1l:32|3l1m:33|3l1n:34|3l1o:35|3l1p:36|3l1q:37|3l1r:38|3l1s:39|3l1t:3a|3l1u:3b|3l1v:3c|3l20:3d|3l21:3e|3l22:3f|3l23:3g|3l24:3h|3l25:3i|3l26:3j|3l27:3k|3l28:3l|3l29:3m|3l2a:3n|3l2b:3o|3l2c:3p|3l2d:3q|3l38:31|3l39:32|3l3a:33|3l3b:34|3l3c:35|3l3d:36|3l3e:37|3l3f:38|3l3g:39|3l3h:3a|3l3i:3b|3l3j:3c|3l3k:3d|3l3l:3e|3l3m:3f|3l3n:3g|3l3o:3h|3l3p:3i|3l3q:3j|3l3r:3k|3l3s:3l|3l3t:3m|3l3u:3n|3l3v:3o|3l40:3p|3l41:3q|3l4s:31|3l4u:33|3l4v:34|3l52:37|3l55:3a|3l56:3b|3l59:3e|3l5a:3f|3l5b:3g|3l5c:3h|3l5e:3j|3l5f:3k|3l5g:3l|3l5h:3m|3l5i:3n|3l5j:3o|3l5k:3p|3l5l:3q|3l6g:31|3l6h:32|3l6i:33|3l6j:34|3l6k:35|3l6l:36|3l6m:37|3l6n:38|3l6o:39|3l6p:3a|3l6q:3b|3l6r:3c|3l6s:3d|3l6t:3e|3l6u:3f|3l6v:3g|3l70:3h|3l71:3i|3l72:3j|3l73:3k|3l74:3l|3l75:3m|3l76:3n|3l77:3o|3l78:3p|3l79:3q|3l84:31|3l85:32|3l87:34|3l88:35|3l89:36|3l8a:37|3l8d:3a|3l8e:3b|3l8f:3c|3l8g:3d|3l8h:3e|3l8i:3f|3l8j:3g|3l8k:3h|3l8m:3j|3l8n:3k|3l8o:3l|3l8p:3m|3l8q:3n|3l8r:3o|3l8s:3p|3l9o:31|3l9p:32|3l9r:34|3l9s:35|3l9t:36|3l9u:37|3la0:39|3la1:3a|3la2:3b|3la3:3c|3la4:3d|3la6:3f|3laa:3j|3lab:3k|3lac:3l|3lad:3m|3lae:3n|3laf:3o|3lag:3p|3lbc:31|3lbd:32|3lbe:33|3lbf:34|3lbg:35|3lbh:36|3lbi:37|3lbj:38|3lbk:39|3lbl:3a|3lbm:3b|3lbn:3c|3lbo:3d|3lbp:3e|3lbq:3f|3lbr:3g|3lbs:3h|3lbt:3i|3lbu:3j|3lbv:3k|3lc0:3l|3lc1:3m|3lc2:3n|3lc3:3o|3lc4:3p|3lc5:3q|3ld0:31|3ld1:32|3ld2:33|3ld3:34|3ld4:35|3ld5:36|3ld6:37|3ld7:38|3ld8:39|3ld9:3a|3lda:3b|3ldb:3c|3ldc:3d|3ldd:3e|3lde:3f|3ldf:3g|3ldg:3h|3ldh:3i|3ldi:3j|3ldj:3k|3ldk:3l|3ldl:3m|3ldm:3n|3ldn:3o|3ldo:3p|3ldp:3q|3lek:31|3lel:32|3lem:33|3len:34|3leo:35|3lep:36|3leq:37|3ler:38|3les:39|3let:3a|3leu:3b|3lev:3c|3lf0:3d|3lf1:3e|3lf2:3f|3lf3:3g|3lf4:3h|3lf5:3i|3lf6:3j|3lf7:3k|3lf8:3l|3lf9:3m|3lfa:3n|3lfb:3o|3lfc:3p|3lfd:3q|3lg8:31|3lg9:32|3lga:33|3lgb:34|3lgc:35|3lgd:36|3lge:37|3lgf:38|3lgg:39|3lgh:3a|3lgi:3b|3lgj:3c|3lgk:3d|3lgl:3e|3lgm:3f|3lgn:3g|3lgo:3h|3lgp:3i|3lgq:3j|3lgr:3k|3lgs:3l|3lgt:3m|3lgu:3n|3lgv:3o|3lh0:3p|3lh1:3q|3lhs:31|3lht:32|3lhu:33|3lhv:34|3li0:35|3li1:36|3li2:37|3li3:38|3li4:39|3li5:3a|3li6:3b|3li7:3c|3li8:3d|3li9:3e|3lia:3f|3lib:3g|3lic:3h|3lid:3i|3lie:3j|3lif:3k|3lig:3l|3lih:3m|3lii:3n|3lij:3o|3lik:3p|3lil:3q|3ljg:31|3ljh:32|3lji:33|3ljj:34|3ljk:35|3ljl:36|3ljm:37|3ljn:38|3ljo:39|3ljp:3a|3ljq:3b|3ljr:3c|3ljs:3d|3ljt:3e|3lju:3f|3ljv:3g|3lk0:3h|3lk1:3i|3lk2:3j|3lk3:3k|3lk4:3l|3lk5:3m|3lk6:3n|3lk7:3o|3lk8:3p|3lk9:3q|3ll8:th|3ll9:ti|3lla:tj|3llb:tk|3llc:tl|3lld:tm|3lle:tn|3llf:to|3llg:tp|3llh:tq|3lli:tr|3llj:ts|3llk:tt|3lll:tu|3llm:tv|3lln:u0|3llo:u1|3llp:to|3llq:u3|3llr:u4|3lls:u5|3llt:u6|3llu:u7|3llv:u8|3lm0:u9|3lmj:u3|3ln2:th|3ln3:ti|3ln4:tj|3ln5:tk|3ln6:tl|3ln7:tm|3ln8:tn|3ln9:to|3lna:tp|3lnb:tq|3lnc:tr|3lnd:ts|3lne:tt|3lnf:tu|3lng:tv|3lnh:u0|3lni:u1|3lnj:to|3lnk:u3|3lnl:u4|3lnm:u5|3lnn:u6|3lno:u7|3lnp:u8|3lnq:u9|3lod:u3|3los:th|3lot:ti|3lou:tj|3lov:tk|3lp0:tl|3lp1:tm|3lp2:tn|3lp3:to|3lp4:tp|3lp5:tq|3lp6:tr|3lp7:ts|3lp8:tt|3lp9:tu|3lpa:tv|3lpb:u0|3lpc:u1|3lpd:to|3lpe:u3|3lpf:u4|3lpg:u5|3lph:u6|3lpi:u7|3lpj:u8|3lpk:u9|3lq7:u3|3lqm:th|3lqn:ti|3lqo:tj|3lqp:tk|3lqq:tl|3lqr:tm|3lqs:tn|3lqt:to|3lqu:tp|3lqv:tq|3lr0:tr|3lr1:ts|3lr2:tt|3lr3:tu|3lr4:tv|3lr5:u0|3lr6:u1|3lr7:to|3lr8:u3|3lr9:u4|3lra:u5|3lrb:u6|3lrc:u7|3lrd:u8|3lre:u9|3ls1:u3|3lsg:th|3lsh:ti|3lsi:tj|3lsj:tk|3lsk:tl|3lsl:tm|3lsm:tn|3lsn:to|3lso:tp|3lsp:tq|3lsq:tr|3lsr:ts|3lss:tt|3lst:tu|3lsu:tv|3lsv:u0|3lt0:u1|3lt1:to|3lt2:u3|3lt3:u4|3lt4:u5|3lt5:u6|3lt6:u7|3lt7:u8|3lt8:u9|3ltr:u3",r:"23:2c|2i:2k|2m:2q|60:6m|6o:6u|bo:bp|c1:c2|c6:c7|c9:cb|ce:ch|cj:ck|cm:co|cs:ct|cv:d0|d6:d7|de:df|dh:dj|dn:do|e4:e5|e7:e8|ea:eb|fh:fi|fm:fo|s8:sa|se:sf|sh:t1|t3:tb|100:11f|19h:1am|7o8:7of|7oo:7ot|7p8:7pf|7po:7pv|7q8:7qd|7r8:7rf|7to:7tr|7u8:7ub|7uo:7ur|7v8:7vc|7vo:7vr|89a:89b|8b0:8bf|95m:96f|1vp1:1vpq|2100:2115",s:"v8|va|vc|ve|vk|130|132|134|136|138|13a|13c|13e|13g|13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl|ds|ed|ef|eh|ej|el|en|ep|er|eu|f0|f2|f4|f6|f8|fa|fc|fe|fk|fq|fs|fu|g0|g2|g4|g6|g8|ga|gc|ge|gg|gi|gk|gm|go|gq|gs|gu|h0|h2|h4|h6|h8|ha|hc|he|hg|hi|21|22|7g0|7g2|7g4|7g6|7g8|7ga|7gc|7ge|7gg|7gi|2d|7gk|7gm|7go|7gq|7gs|7gu|7h0|7h2|7h4|7h6|7h8|7ha|7hc|7he|7hg|7hi|7hk|7hm|7ho|7hq|7hs|7hu|7i0|7i2|7i4|7i6|7i8|7ia|7ic|7ie|7ig|7ii|7ik|7im|7io|7iq|7is|7iu|7j0|7j2|7j4|7j6|7j8|7ja|7jc|7je|7jg|7ji|7jk|7jm|2e|7jo|7jq|7js|7ju|7k0|7k2|7k4|7k6|7k8|7ka|7kc|7ke|7kg|7ki|7kk|7l0|7l2|7l4|7l6|7l8|7la|7lc|7le|7lg|7li|7lk|7lm|7lo|7lq|7ls|7lu|7m0|7m2|7m4|7m6|7m8|7ma|7mc|7me|7mg|7mi|7mk|7mm|7mo|7mq|2f|7ms|7mu|7n0|7n2|7n4|7n6|7n8|7na|7nc|7ne|7ng|7ni|7nk|7nm|7no|2g|7qp|7qr|7qt|7qv|2h|896|2l|s6|sc|uo|uq|us|uu|v0|v2|v4|v6"},"B.3":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti:7rg;tp|7tj:th;tp|7tk:tc;tp|7tm:th;q2|7tn:th;q2;tp|7ts:th;tp|7tu:tp|7u2:7rk;tp|7u3:tn;tp|7u4:te;tp|7u6:tn;q2|7u7:tn;q2;tp|7uc:tn;tp|7ui:tp;o8;o0|7uj:tp;o8;o1|7um:tp;q2|7un:tp;o8;q2|7v2:u5;o8;o0|7v3:u5;o8;o1|7v4:u1;oj|7v6:u5;q2|7v7:u5;o8;q2|7vi:7rs;tp|7vj:u9;tp|7vk:ue;tp|7vm:u9;q2|7vn:u9;q2;tp|7vs:u9;tp|1uo0:36;36|1uo1:36;39|1uo2:36;3c|1uo3:36;36;39|1uo4:36;36;3c|1uo5:3j;3k|1uo6:3j;3k|1uoj:1bk;1bm|1uok:1bk;1b5|1uol:1bk;1bb|1uom:1bu;1bm|1uon:1bk;1bd",r:"23:2c|2i:2k|2m:2q|60:6m|6o:6u|bo:bp|c1:c2|c6:c7|c9:cb|ce:ch|cj:ck|cm:co|cs:ct|cv:d0|d6:d7|de:df|dh:dj|dn:do|e4:e5|e7:e8|ea:eb|fh:fi|fm:fo|s8:sa|se:sf|sh:t1|t3:tb|100:11f|19h:1am|7o8:7of|7oo:7ot|7p8:7pf|7po:7pv|7q8:7qd|7r8:7rf|7to:7tr|7u8:7ub|7uo:7ur|7v8:7vc|7vo:7vr|89a:89b|8b0:8bf|95m:96f|1vp1:1vpq|2100:2115",s:"v8|va|vc|ve|vk|130|132|134|136|138|13a|13c|13e|13g|13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl|ds|ed|ef|eh|ej|el|en|ep|er|eu|f0|f2|f4|f6|f8|fa|fc|fe|fk|fq|fs|fu|g0|g2|g4|g6|g8|ga|gc|ge|gg|gi|gk|gm|go|gq|gs|gu|h0|h2|h4|h6|h8|ha|hc|he|hg|hi|21|22|7g0|7g2|7g4|7g6|7g8|7ga|7gc|7ge|7gg|7gi|2d|7gk|7gm|7go|7gq|7gs|7gu|7h0|7h2|7h4|7h6|7h8|7ha|7hc|7he|7hg|7hi|7hk|7hm|7ho|7hq|7hs|7hu|7i0|7i2|7i4|7i6|7i8|7ia|7ic|7ie|7ig|7ii|7ik|7im|7io|7iq|7is|7iu|7j0|7j2|7j4|7j6|7j8|7ja|7jc|7je|7jg|7ji|7jk|7jm|2e|7jo|7jq|7js|7ju|7k0|7k2|7k4|7k6|7k8|7ka|7kc|7ke|7kg|7ki|7kk|7l0|7l2|7l4|7l6|7l8|7la|7lc|7le|7lg|7li|7lk|7lm|7lo|7lq|7ls|7lu|7m0|7m2|7m4|7m6|7m8|7ma|7mc|7me|7mg|7mi|7mk|7mm|7mo|7mq|2f|7ms|7mu|7n0|7n2|7n4|7n6|7n8|7na|7nc|7ne|7ng|7ni|7nk|7nm|7no|2g|7qp|7qr|7qt|7qv|2h|896|2l|s6|sc|uo|uq|us|uu|v0|v2|v4|v6"},"C.1.1":{s:"10"},"C.1.2":{r:"800:80b",s:"c00|50|5k0|81f|82v"},"C.2.1":{r:"0:v",s:"3v"},"C.2.2":{r:"40:4v|80c:80d|818:819|830:833|83a:83f|1vvp:1vvs|3kbj:3kbq",s:"1mt|1of|60e|1vnv"},"C.3":{r:"1o00:1u7v|u000:vvvt|10000:11vvt"},"C.4":{r:"1veg:1vff|1vvu:1vvv|3vvu:3vvv|5vvu:5vvv|7vvu:7vvv|9vvu:9vvv|bvvu:bvvv|dvvu:dvvv|fvvu:fvvv|hvvu:hvvv|jvvu:jvvv|lvvu:lvvv|nvvu:nvvv|pvvu:pvvv|rvvu:rvvv|tvvu:tvvv|vvvu:vvvv|11vvu:11vvv"},"C.5":{r:"1m00:1nvv"},"C.6":{r:"1vvp:1vvt"},"C.7":{r:"bvg:bvr"},"C.8":{r:"q0:q1|80e:80f|81a:81e|83a:83f"},"C.9":{r:"s010:s03v",s:"s001"},"D.1":{r:"1eg:1fa|1fg:1fk|1h1:1hq|1i0:1ia|1jd:1jf|1jh:1ml|1n5:1n6|1nq:1nu|1o0:1od|1oi:1pc|1s0:1t5|1uov:1up8|1upa:1upm|1upo:1ups|1uq0:1uq1|1uq3:1uq4|1uq6:1uth|1uuj:1v9t|1vag:1vcf|1vci:1ve7|1vfg:1vfs|1vjg:1vjk|1vjm:1vns",s:"1du|1e0|1e3|1gr|1gv|1mt|1og|1th|1uot|1upu|80f"},"D.2":{r:"21:2q|31:3q|60:6m|6o:7m|7o:h0|h2:hj|ig:ld|lg:lo|lr:m1|mg:mh|n0:n4|s8:sa|se:t1|t3:ue|ug:vl|100:142|14a:16e|16g:17l|17o:17p|180:18f|19h:1am|1ap:1av|1b1:1c7|285:29p|29t:2a0|2a9:2ac|2ao:2b1|2b4:2bg|2c2:2c3|2c5:2cc|2cf:2cg|2cj:2d8|2da:2dg|2dm:2dp|2du:2e0|2e7:2e8|2eb:2ec|2es:2et|2ev:2f1|2f6:2fh|2fk:2fq|2g5:2ga|2gf:2gg|2gj:2h8|2ha:2hg|2hi:2hj|2hl:2hm|2ho:2hp|2hu:2i0|2ip:2is|2j6:2jf|2ji:2jk|2k5:2kb|2kf:2kh|2kj:2l8|2la:2lg|2li:2lj|2ll:2lp|2lt:2m0|2mb:2mc|2n6:2nf|2o2:2o3|2o5:2oc|2of:2og|2oj:2p8|2pa:2pg|2pi:2pj|2pm:2pp|2pt:2pu|2q7:2q8|2qb:2qc|2qs:2qt|2qv:2r1|2r6:2rg|2s5:2sa|2se:2sg|2si:2sl|2sp:2sq|2su:2sv|2t3:2t4|2t8:2ta|2te:2tl|2tn:2tp|2tu:2tv|2u1:2u2|2u6:2u8|2ua:2uc|2v7:2vi|301:303|305:30c|30e:30g|30i:318|31a:31j|31l:31p|321:324|330:331|336:33f|342:343|345:34c|34e:34g|34i:358|35a:35j|35l:35p|360:364|367:368|36a:36b|36l:36m|370:371|376:37f|382:383|385:38c|38e:38g|38i:398|39a:39p|39u:3a0|3a6:3a8|3aa:3ac|3b0:3b1|3b6:3bf|3c2:3c3|3c5:3cm|3cq:3dh|3dj:3dr|3e0:3e6|3ef:3eh|3eo:3ev|3fi:3fk|3g1:3hg|3hi:3hj|3i0:3i6|3if:3ir|3k1:3k2|3k7:3k8|3kk:3kn|3kp:3kv|3l1:3l3|3la:3lb|3ld:3lg|3li:3lj|3m0:3m4|3mg:3mp|3ms:3mt|3o0:3on|3oq:3pk|3pu:3q7|3q9:3ra|3s8:3sb|3tu:3u5|3u7:3uc|400:411|413:417|419:41a|420:42n|450:465|46g:47o|480:4ap|4av:4d2|4d8:4fp|4g0:4g6|4g8:4i6|4ia:4id|4ig:4im|4iq:4it|4j0:4k6|4ka:4kd|4kg:4le|4li:4ll|4lo:4lu|4m2:4m5|4m8:4me|4mg:4mm|4mo:4ne|4ng:4oe|4oi:4ol|4oo:4ou|4p0:4q6|4q8:4qq|4r1:4rs|4t0:4vk|501:5jm|5k1:5kq|5l0:5ng|5o0:5oc|5oe:5oh|5p0:5ph|5pl:5pm|5q0:5qh|5r0:5rc|5re:5rg|5s0:5tm|5tu:5u5|5u7:5u8|5uk:5uq|5v0:5v9|60g:60p|610:63n|640:658|7g0:7kr|7l0:7np|7o0:7ol|7oo:7ot|7p0:7q5|7q8:7qd|7qg:7qn|7qv:7rt|7s0:7tk|7tm:7ts|7u2:7u4|7u6:7uc|7ug:7uj|7um:7ur|7v0:7vc|7vi:7vk|7vm:7vs|88a:88j|88p:88t|89a:89d|89f:89h|89j:89p|89t:89v|8a5:8a9|8b0:8c3|8pm:8rq|94s:979|c05:c07|c11:c19|c1h:c1l|c1o:c1s|c21:c4m|c4t:c4v|c51:c7q|c7s:c7v|c85:c9c|c9h:cce|ccg:cdn|cfg:cgs|ch0:ci3|cj0:cjr|cjv:clg|cm0:cmb|cmg:cnu|co0:crm|crr:cut|cv0:cvu|d00:jdl|jg0:17t5|1800:194c|1b00:1lt3|1m00:1uhd|1uhg:1uja|1uo0:1uo6|1uoj:1uon|1vp1:1vpq|1vq1:1vqq|1vr6:1vtu|1vu2:1vu7|1vua:1vuf|1vui:1vun|1vuq:1vus|20o0:20ou|20p0:20p3|20pg:20qa|2100:2115|2118:212d|3k00:3k7l|3k80:3k96|3k9a:3kb6|3kba:3kbi|3kc3:3kc4|3kcc:3kd9|3kde:3ket|3l00:3l2k|3l2m:3l4s|3l4u:3l4v|3l55:3l56|3l59:3l5c|3l5e:3l5p|3l5t:3l60|3l62:3l63|3l65:3l85|3l87:3l8a|3l8d:3l8k|3l8m:3l8s|3l8u:3l9p|3l9r:3l9u|3la0:3la4|3laa:3lag|3lai:3ll3|3ll8:3lu9|4000:59mm|5u00:5ugt|u000:vvvt|10000:11vvt",s:"3l52|3l5r|3la6|1c9|5a|5l|5q|283|2ag|2di|2en|2iu|2k3|2kd|2m9|2mg|2n0|2q0|2qn|2s3|2ss|2un|35u|36u|3an|3dt|3k4|3ka|3kd|3l5|3l7|3lt|3m6|3pm|3po|3rv|3s5|3uf|41c|41h|41o|47r|4i8|4io|4k8|4lg|4m0|4og|5us|ne|7qp|7qr|7qt|7tu|80e|83h|83v|882|887|88l|894|896|898|rq|s6|sc|8sl"}}},3486(e,t,n){"use strict";var r=n(5715),i=n(7383),a=n(4579),o=n(3693);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NodePrepProhibited=t.D2=t.D1=t.C9=t.C8=t.C7=t.C6=t.C5=t.C4=t.C3=t.C22=t.C21=t.C12=t.C11=t.B3=t.B2=t.B1=t.A1=t.Table=void 0,t.prepare=p,t.nameprep=function(e){return p(h,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e)},t.nodeprep=function(e){return p(v,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e)},t.resourceprep=function(e){return p(m,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e)},t.saslprep=function(e){return p(g,arguments.length>1&&void 0!==arguments[1]&&arguments[1],e)};var l=c(n(6218)),f=n(6929),d=function(){return a(function e(t,n){i(this,e),o(this,"name",void 0),o(this,"singles",new Set),o(this,"ranges",[]),o(this,"mappings",new Map);var a=f.TABLE_DATA[t];this.name=t,a?(a.s&&(this.singles=new Set(a.s.split("|").map(function(e){return parseInt(e,32)}))),a.r&&(this.ranges=a.r.split("|").map(function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1];return[parseInt(i,32),parseInt(a,32)]})),a.m&&(this.mappings=new Map(a.m.split("|").map(function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1].split(";").map(function(e){return parseInt(e,32)});return[parseInt(i,32),a]})))):n&&(this.singles=new Set(n))},[{key:"contains",value:function(e){if(this.singles.has(e))return!0;for(var t=0,n=this.ranges.length-1;t<=n;){var r=Math.floor((t+n)/2),i=this.ranges[r];if(e<i[0])n=r-1;else{if(!(e>i[1]))return!0;t=r+1}}return!1}},{key:"hasMapping",value:function(e){return this.mappings.has(e)||this.contains(e)}},{key:"map",value:function(e){return this.contains(e)&&!this.mappings.has(e)?String.fromCodePoint(e).toLowerCase().codePointAt(0):this.mappings.get(e)||null}}])}();function p(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=[],o=s(l.default.ucs2.decode(i));try{for(o.s();!(r=o.n()).done;){var u=r.value;if(!n&&e.unassigned.contains(u))throw new Error("Unassigned code point: x"+u.toString(16));var c,f=!1,d=s(e.mappings);try{for(d.s();!(c=d.n()).done;){var p=c.value;if(p.hasMapping(u)){f=!0;var h=p.map(u);h&&(Array.isArray(h)?a=a.concat(h):a.push(h))}}}catch(e){d.e(e)}finally{d.f()}f||a.push(u)}}catch(e){o.e(e)}finally{o.f()}var v=a;if(e.normalize){var m=l.default.ucs2.encode(a).normalize("NFKC");v=l.default.ucs2.decode(m)}var g,y=!1,b=!1,S=s(v);try{for(S.s();!(g=S.n()).done;){var _,w=g.value,O=s(e.prohibited);try{for(O.s();!(_=O.n()).done;)if(_.value.contains(w))throw new Error("Prohibited code point: x"+w.toString(16))}catch(e){O.e(e)}finally{O.f()}if(!n&&e.unassigned.contains(w))throw new Error("Prohibited code point: x"+w.toString(16));e.bidirectional&&(y=y||t.D1.contains(w),b=b||t.D2.contains(w))}}catch(e){S.e(e)}finally{S.f()}if(e.bidirectional){if(y&&b)throw new Error("String contained both LCat and RandALCat code points");if(y&&(!t.D1.contains(v[0])||!t.D1.contains(v[v.length-1])))throw new Error("String containing RandALCat code points must start and end with RandALCat code points")}return l.default.ucs2.encode(v)}t.Table=d,t.A1=new d("A.1"),t.B1=new d("B.1"),t.B2=new d("B.2"),t.B3=new d("B.3"),t.C11=new d("C.1.1"),t.C12=new d("C.1.2"),t.C21=new d("C.2.1"),t.C22=new d("C.2.2"),t.C3=new d("C.3"),t.C4=new d("C.4"),t.C5=new d("C.5"),t.C6=new d("C.6"),t.C7=new d("C.7"),t.C8=new d("C.8"),t.C9=new d("C.9"),t.D1=new d("D.1"),t.D2=new d("D.2"),t.B1.map=function(){return null},t.C11.contains=function(e){return 32===e},t.C12.map=function(e){return t.C12.contains(e)?32:null};var h={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C12,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.NodePrepProhibited=new d("NodePrepProhibited",[34,38,39,47,58,60,62,64]);var v={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C11,t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9,t.NodePrepProhibited],unassigned:t.A1},m={bidirectional:!0,mappings:[t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1},g={bidirectional:!0,mappings:[t.C12,t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1}},2513(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=s(e),o=a[0],u=a[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,u)),l=0,f=u>0?o-4:o;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;s<u;s+=o)a.push(c(e,s,s+o>u?u:s+o));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(u(r));return i.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6360(e,t){"use strict";t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+p]=255&o,p+=h,o/=256,c-=8);e[n+p-h]|=128*v}},391(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3738);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=n(2513),d=n(6360),p="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=m,t.SlowBuffer=function(e){return+e!=e&&(e=0),m.alloc(+e)},t.INSPECT_MAX_BYTES=50;var h=2147483647;function v(e){if(e>h)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}function m(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return b(e)}return g(e,t,n)}function g(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|O(e,t),r=v(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return S(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return _(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return _(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return m.from(r,t,n);var i=function(e){if(m.isBuffer(e)){var t=0|w(e.length),n=v(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||ie(e.length)?v(0):S(e):"Buffer"===e.type&&Array.isArray(e.data)?S(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return m.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e))}function y(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function b(e){return y(e),v(e<0?0:0|w(e))}function S(e){for(var t=e.length<0?0:0|w(e.length),n=v(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function _(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,m.prototype),r}function w(e){if(e>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return 0|e}function O(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(e));var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return te(e).length;default:if(i)return r?-1:ee(e).length;t=(""+t).toLowerCase(),i=!0}}function x(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return D(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return P(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function k(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function T(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),ie(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=m.from(t,r)),m.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*o}else-1!==l&&(a-=a-l),l=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(c(e,a+d)!==c(t,d)){f=!1;break}if(f)return a}return-1}function E(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a,o=t.length;for(r>o/2&&(r=o/2),a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(ie(s))return a;e[n+a]=s}return a}function I(e,t,n,r){return ne(ee(t,e.length-n),e,n,r)}function N(e,t,n,r){return ne(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function j(e,t,n,r){return ne(te(t),e,n,r)}function R(e,t,n,r){return ne(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function P(e,t,n){return 0===t&&n===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var u=void 0,c=void 0,l=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(u=e[i+1]))&&(f=(31&a)<<6|63&u)>127&&(o=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&a)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&a)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){var t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=M));return n}(r)}t.kMaxLength=h,m.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),m.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(e,t,n){return g(e,t,n)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(e,t,n){return function(e,t,n){return y(e),e<=0?v(e):void 0!==t?"string"==typeof n?v(e).fill(t,n):v(e).fill(t):v(e)}(e,t,n)},m.allocUnsafe=function(e){return b(e)},m.allocUnsafeSlow=function(e){return b(e)},m.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==m.prototype},m.compare=function(e,t){if(re(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),re(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(e)||!m.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},m.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return m.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=m.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(re(a,Uint8Array))i+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,i)):Uint8Array.prototype.set.call(r,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},m.byteLength=O,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)k(this,t,t+1);return this},m.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)k(this,t,t+3),k(this,t+1,t+2);return this},m.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)k(this,t,t+7),k(this,t+1,t+6),k(this,t+2,t+5),k(this,t+3,t+4);return this},m.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):x.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(e){if(!m.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===m.compare(this,e)},m.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},p&&(m.prototype[p]=m.prototype.inspect),m.prototype.compare=function(e,t,n,r,i){if(re(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(e));if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],o=l[f];break}return a<o?-1:o<a?1:0},m.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},m.prototype.indexOf=function(e,t,n){return T(this,e,t,n,!0)},m.prototype.lastIndexOf=function(e,t,n){return T(this,e,t,n,!1)},m.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return I(this,e,t,n);case"ascii":case"latin1":case"binary":return N(this,e,t,n);case"base64":return j(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function B(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=ae[e[a]];return i}function F(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function q(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,i,a){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function z(e,t,n,r,i){X(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function J(e,t,n,r,i){X(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function G(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function H(e,t,n,r,i){return t=+t,n>>>=0,i||G(e,0,n,4),d.write(e,t,n,r,23,4),n+4}function W(e,t,n,r,i){return t=+t,n>>>=0,i||G(e,0,n,8),d.write(e,t,n,r,52,8),n+8}m.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,m.prototype),r},m.prototype.readUintLE=m.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||q(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},m.prototype.readUintBE=m.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||q(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},m.prototype.readUint8=m.prototype.readUInt8=function(e,t){return e>>>=0,t||q(e,1,this.length),this[e]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]|this[e+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]<<8|this[e+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(e,t){return e>>>=0,t||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(e,t){return e>>>=0,t||q(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},m.prototype.readBigUInt64LE=oe(function(e){Y(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);var r=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+n*Math.pow(2,24);return BigInt(r)+(BigInt(i)<<BigInt(32))}),m.prototype.readBigUInt64BE=oe(function(e){Y(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);var r=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),m.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||q(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},m.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||q(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},m.prototype.readInt8=function(e,t){return e>>>=0,t||q(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},m.prototype.readInt16LE=function(e,t){e>>>=0,t||q(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},m.prototype.readInt16BE=function(e,t){e>>>=0,t||q(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},m.prototype.readInt32LE=function(e,t){return e>>>=0,t||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},m.prototype.readInt32BE=function(e,t){return e>>>=0,t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},m.prototype.readBigInt64LE=oe(function(e){Y(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);var r=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))}),m.prototype.readBigInt64BE=oe(function(e){Y(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);var r=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n)}),m.prototype.readFloatLE=function(e,t){return e>>>=0,t||q(e,4,this.length),d.read(this,e,!0,23,4)},m.prototype.readFloatBE=function(e,t){return e>>>=0,t||q(e,4,this.length),d.read(this,e,!1,23,4)},m.prototype.readDoubleLE=function(e,t){return e>>>=0,t||q(e,8,this.length),d.read(this,e,!0,52,8)},m.prototype.readDoubleBE=function(e,t){return e>>>=0,t||q(e,8,this.length),d.read(this,e,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||U(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||U(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},m.prototype.writeUint8=m.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,255,0),this[t]=255&e,t+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigUInt64LE=oe(function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=oe(function(e){return J(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+n},m.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+n},m.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},m.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},m.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigInt64LE=oe(function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=oe(function(e){return J(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},m.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)},m.prototype.writeDoubleLE=function(e,t,n){return W(this,e,t,!0,n)},m.prototype.writeDoubleBE=function(e,t,n){return W(this,e,t,!1,n)},m.prototype.copy=function(e,t,n,r){if(!m.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},m.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=m.isBuffer(e)?e:m.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var V={};function Q(e,t,n){V[e]=function(n){function a(){var n;return r(this,a),n=c(this,a),Object.defineProperty(n,"message",{value:t.apply(n,arguments),writable:!0,configurable:!0}),n.name="".concat(n.name," [").concat(e,"]"),n.stack,delete n.name,n}return s(a,n),i(a,[{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}])}(n)}function K(e){for(var t="",n=e.length,r="-"===e[0]?1:0;n>=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function X(e,t,n,r,i,a){if(e>n||e<t){var o,s="bigint"==typeof t?"n":"";throw o=a>3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(n).concat(s),new V.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||$(t,e.length-(n+1))}(r,i,a)}function Y(e,t){if("number"!=typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,n){if(Math.floor(e)!==e)throw Y(e,n),new V.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}Q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(u(t))},TypeError),Q("ERR_OUT_OF_RANGE",function(e,t,n){var r='The value of "'.concat(e,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>Math.pow(2,32)?i=K(String(n)):"bigint"==typeof n&&(i=String(n),(n>Math.pow(BigInt(2),BigInt(32))||n<-Math.pow(BigInt(2),BigInt(32)))&&(i=K(i)),i+="n"),r+" It must be ".concat(t,". Received ").concat(i)},RangeError);var Z=/[^+/0-9A-Za-z-_]/g;function ee(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function te(e){return f.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ne(e,t,n,r){var i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ie(e){return e!=e}var ae=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}();function oe(e){return"undefined"==typeof BigInt?se:e}function se(){throw new Error("BigInt not supported")}},6898(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var f=n(391),d=function(e){function t(e,n){var i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"be";return r(this,t),i=c(this,t),u(i,"_block",void 0),u(i,"_finalSize",void 0),u(i,"_blockSize",void 0),u(i,"_bigEndian",void 0),u(i,"_len",void 0),i._block=f.Buffer.alloc(e),i._finalSize=n,i._blockSize=e,i._bigEndian="be"===a,i._len=0,i}return s(t,e),i(t,[{key:"_transform",value:function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)}},{key:"_flush",value:function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}},{key:"update",value:function(e,t){"string"==typeof e&&(t=t||"utf8",e=f.Buffer.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%r,u=Math.min(i-o,r-s),c=0;c<u;c++)n[s+c]=e[o+c];o+=u,(a+=u)%r===0&&this._update(n)}return this._len+=i,this}},{key:"digest",value:function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._bigEndian?(this._block.writeUInt32BE(0,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)):(this._block.writeUInt32LE(n,this._blockSize-8),this._block.writeUInt32LE(0,this._blockSize-4));else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._bigEndian?(this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)):(this._block.writeUInt32LE(r,this._blockSize-8),this._block.writeUInt32LE(i,this._blockSize-4))}this._update(this._block);var a=this._hash();return e?a.toString(e):a}},{key:"_update",value:function(e){throw new Error("_update must be implemented by subclass")}},{key:"_hash",value:function(){throw new Error("_update must be implemented by subclass")}}])}(n(9677).Transform);t.default=d},2301(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(391),p=n(9677),h=f(n(8370)),v=d.Buffer.alloc(128),m=function(e){function t(e,n){var i;r(this,t),i=c(this,t),u(i,"_alg",void 0),u(i,"_hash",void 0),u(i,"_ipad",void 0),u(i,"_opad",void 0),"string"==typeof n&&(n=d.Buffer.from(n));var a="sha512"===e?128:64;i._alg=e,n.length>a?n=(0,h.default)(e).update(n).digest():n.length<a&&(n=d.Buffer.concat([n,v],a)),i._ipad=d.Buffer.alloc(a),i._opad=d.Buffer.alloc(a);for(var o=0;o<a;o++)i._ipad[o]=54^n[o],i._opad[o]=92^n[o];return i._hash=(0,h.default)(e).update(i._ipad),i}return s(t,e),i(t,[{key:"_transform",value:function(e,t,n){var r;try{this.update(e,t)}catch(e){r=e}finally{n(r)}}},{key:"_flush",value:function(e){var t;try{this.push(this._final())}catch(e){t=e}e(t)}},{key:"_final",value:function(){var e=this._hash.digest();return(0,h.default)(this._alg).update(this._opad).update(e).digest()}},{key:"update",value:function(e,t){return this._hash.update(e,t),this}},{key:"digest",value:function(e){var t=this._final()||d.Buffer.alloc(0);return e?t.toString(e):t}}])}(p.Transform);t.default=m},6832(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(391);function p(e,t){return e<<t|e>>>32-t}function h(e,t,n,r,i,a,o){return p(e+(t&n|~t&r)+i+a|0,o)+t|0}function v(e,t,n,r,i,a,o){return p(e+(t&r|n&~r)+i+a|0,o)+t|0}function m(e,t,n,r,i,a,o){return p(e+(t^n^r)+i+a|0,o)+t|0}function g(e,t,n,r,i,a,o){return p(e+(n^(t|~r))+i+a|0,o)+t|0}var y=function(e){function t(){var e;return r(this,t),e=c(this,t,[64,56,"le"]),u(e,"_a",1732584193),u(e,"_b",4023233417),u(e,"_c",2562383102),u(e,"_d",271733878),u(e,"_m",new Array(16)),e}return s(t,e),i(t,[{key:"_update",value:function(e){for(var t=this._m,n=0;n<16;++n)t[n]=e.readInt32LE(4*n);var r=this._a,i=this._b,a=this._c,o=this._d;r=h(r,i,a,o,t[0],3614090360,7),o=h(o,r,i,a,t[1],3905402710,12),a=h(a,o,r,i,t[2],606105819,17),i=h(i,a,o,r,t[3],3250441966,22),r=h(r,i,a,o,t[4],4118548399,7),o=h(o,r,i,a,t[5],1200080426,12),a=h(a,o,r,i,t[6],2821735955,17),i=h(i,a,o,r,t[7],4249261313,22),r=h(r,i,a,o,t[8],1770035416,7),o=h(o,r,i,a,t[9],2336552879,12),a=h(a,o,r,i,t[10],4294925233,17),i=h(i,a,o,r,t[11],2304563134,22),r=h(r,i,a,o,t[12],1804603682,7),o=h(o,r,i,a,t[13],4254626195,12),a=h(a,o,r,i,t[14],2792965006,17),r=v(r,i=h(i,a,o,r,t[15],1236535329,22),a,o,t[1],4129170786,5),o=v(o,r,i,a,t[6],3225465664,9),a=v(a,o,r,i,t[11],643717713,14),i=v(i,a,o,r,t[0],3921069994,20),r=v(r,i,a,o,t[5],3593408605,5),o=v(o,r,i,a,t[10],38016083,9),a=v(a,o,r,i,t[15],3634488961,14),i=v(i,a,o,r,t[4],3889429448,20),r=v(r,i,a,o,t[9],568446438,5),o=v(o,r,i,a,t[14],3275163606,9),a=v(a,o,r,i,t[3],4107603335,14),i=v(i,a,o,r,t[8],1163531501,20),r=v(r,i,a,o,t[13],2850285829,5),o=v(o,r,i,a,t[2],4243563512,9),a=v(a,o,r,i,t[7],1735328473,14),r=m(r,i=v(i,a,o,r,t[12],2368359562,20),a,o,t[5],4294588738,4),o=m(o,r,i,a,t[8],2272392833,11),a=m(a,o,r,i,t[11],1839030562,16),i=m(i,a,o,r,t[14],4259657740,23),r=m(r,i,a,o,t[1],2763975236,4),o=m(o,r,i,a,t[4],1272893353,11),a=m(a,o,r,i,t[7],4139469664,16),i=m(i,a,o,r,t[10],3200236656,23),r=m(r,i,a,o,t[13],681279174,4),o=m(o,r,i,a,t[0],3936430074,11),a=m(a,o,r,i,t[3],3572445317,16),i=m(i,a,o,r,t[6],76029189,23),r=m(r,i,a,o,t[9],3654602809,4),o=m(o,r,i,a,t[12],3873151461,11),a=m(a,o,r,i,t[15],530742520,16),r=g(r,i=m(i,a,o,r,t[2],3299628645,23),a,o,t[0],4096336452,6),o=g(o,r,i,a,t[7],1126891415,10),a=g(a,o,r,i,t[14],2878612391,15),i=g(i,a,o,r,t[5],4237533241,21),r=g(r,i,a,o,t[12],1700485571,6),o=g(o,r,i,a,t[3],2399980690,10),a=g(a,o,r,i,t[10],4293915773,15),i=g(i,a,o,r,t[1],2240044497,21),r=g(r,i,a,o,t[8],1873313359,6),o=g(o,r,i,a,t[15],4264355552,10),a=g(a,o,r,i,t[6],2734768916,15),i=g(i,a,o,r,t[13],1309151649,21),r=g(r,i,a,o,t[4],4149444226,6),o=g(o,r,i,a,t[11],3174756917,10),a=g(a,o,r,i,t[2],718787259,15),i=g(i,a,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+a|0,this._d=this._d+o|0}},{key:"_hash",value:function(){var e=d.Buffer.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e}}])}(f(n(6898)).default);t.default=y},4016(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(391),p=f(n(6898)),h=[1518500249,1859775393,-1894007588,-899497514];function v(e){return e<<1|e>>>31}function m(e){return e<<5|e>>>27}function g(e){return e<<30|e>>>2}function y(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var b=function(e){function t(){var e;return r(this,t),e=c(this,t,[64,56]),u(e,"_a",1732584193),u(e,"_b",4023233417),u(e,"_c",2562383102),u(e,"_d",271733878),u(e,"_e",3285377520),u(e,"_w",new Array(80)),e}return s(t,e),i(t,[{key:"_update",value:function(e){var t,n=this._w,r=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,s=0|this._e;for(t=0;t<16;++t)n[t]=e.readInt32BE(4*t);for(;t<80;++t)n[t]=v(n[t-3]^n[t-8]^n[t-14]^n[t-16]);for(var u=0;u<80;++u){var c=~~(u/20),l=m(r)+y(c,i,a,o)+s+n[u]+h[c]|0;s=o,o=a,a=g(i),i=r,r=l}this._a=r+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0}},{key:"_hash",value:function(){var e=d.Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e}}])}(p.default);t.default=b},5910(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(391),p=f(n(6898)),h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(e,t,n){return n^e&(t^n)}function m(e,t,n){return e&t|n&(e|t)}function g(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function y(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function b(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function S(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var _=function(e){function t(){var e;return r(this,t),e=c(this,t,[64,56]),u(e,"_a",1779033703),u(e,"_b",3144134277),u(e,"_c",1013904242),u(e,"_d",2773480762),u(e,"_e",1359893119),u(e,"_f",2600822924),u(e,"_g",528734635),u(e,"_h",1541459225),u(e,"_w",new Array(64)),e}return s(t,e),i(t,[{key:"_update",value:function(e){var t,n=this._w,r=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,s=0|this._e,u=0|this._f,c=0|this._g,l=0|this._h;for(t=0;t<16;++t)n[t]=e.readInt32BE(4*t);for(;t<64;++t)n[t]=S(n[t-2])+n[t-7]+b(n[t-15])+n[t-16]|0;for(var f=0;f<64;++f){var d=l+y(s)+v(s,u,c)+h[f]+n[f]|0,p=g(r)+m(r,i,a)|0;l=c,c=u,u=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0}},{key:"_hash",value:function(){var e=d.Buffer.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e}}])}(p.default);t.default=_},5367(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(8452),o=n(3072),s=n(9511),u=n(3693);function c(e,t,n){return t=o(t),a(e,l()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(391),p=f(n(6898)),h=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(e,t,n){return n^e&(t^n)}function m(e,t,n){return e&t|n&(e|t)}function g(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function y(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function b(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function S(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function _(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function w(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function O(e,t){return e>>>0<t>>>0?1:0}var x=function(e){function t(){var e;return r(this,t),e=c(this,t,[128,112]),u(e,"_ah",1779033703),u(e,"_bh",3144134277),u(e,"_ch",1013904242),u(e,"_dh",2773480762),u(e,"_eh",1359893119),u(e,"_fh",2600822924),u(e,"_gh",528734635),u(e,"_hh",1541459225),u(e,"_al",4089235720),u(e,"_bl",2227873595),u(e,"_cl",4271175723),u(e,"_dl",1595750129),u(e,"_el",2917565137),u(e,"_fl",725511199),u(e,"_gl",4215389547),u(e,"_hl",327033209),u(e,"_w",new Array(160)),e}return s(t,e),i(t,[{key:"_update",value:function(e){var t,n,r=this._w,i=0|this._ah,a=0|this._bh,o=0|this._ch,s=0|this._dh,u=0|this._eh,c=0|this._fh,l=0|this._gh,f=0|this._hh,d=0|this._al,p=0|this._bl,x=0|this._cl,k=0|this._dl,T=0|this._el,A=0|this._fl,E=0|this._gl,I=0|this._hl,N=0;for(N=0;N<32;N+=2)r[N]=e.readInt32BE(4*N),r[N+1]=e.readInt32BE(4*N+4);for(;N<160;N+=2){var j=r[N-30],R=r[N-30+1],P=b(j,R),C=S(R,j),M=_(j=r[N-4],R=r[N-4+1]),D=w(R,j),L=r[N-14],B=r[N-14+1],F=r[N-32],q=r[N-32+1];t=(t=(t=P+L+O(n=C+B|0,C)|0)+M+O(n=n+D|0,D)|0)+F+O(n=n+q|0,q)|0,r[N]=t,r[N+1]=n}for(var U=0;U<160;U+=2){t=r[U],n=r[U+1];var z=m(i,a,o),J=m(d,p,x),G=g(i,d),H=g(d,i),W=y(u,T),V=y(T,u),Q=h[U],K=h[U+1],X=v(u,c,l),Y=v(T,A,E),$=I+V|0,Z=f+W+O($,I)|0;Z=(Z=(Z=Z+X+O($=$+Y|0,Y)|0)+Q+O($=$+K|0,K)|0)+t+O($=$+n|0,n)|0;var ee=H+J|0,te=G+z+O(ee,H)|0;f=l,I=E,l=c,E=A,c=u,A=T,u=s+Z+O(T=k+$|0,k)|0,s=o,k=x,o=a,x=p,a=i,p=d,i=Z+te+O(d=$+ee|0,$)|0}this._al=this._al+d|0,this._bl=this._bl+p|0,this._cl=this._cl+x|0,this._dl=this._dl+k|0,this._el=this._el+T|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+I|0,this._ah=this._ah+i+O(this._al,d)|0,this._bh=this._bh+a+O(this._bl,p)|0,this._ch=this._ch+o+O(this._cl,x)|0,this._dh=this._dh+s+O(this._dl,k)|0,this._eh=this._eh+u+O(this._el,T)|0,this._fh=this._fh+c+O(this._fl,A)|0,this._gh=this._gh+l+O(this._gl,E)|0,this._hh=this._hh+f+O(this._hl,I)|0}},{key:"_hash",value:function(){var e=d.Buffer.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e}}])}(p.default);t.default=x},8370(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0,t.default=function(e){e=e.toLowerCase();var t=c.get(e);if(t)return new t;throw new Error("Unsupported hash algorithm: "+e)};var i=r(n(6898));t.Hash=i.default;var a=r(n(6832)),o=r(n(4016)),s=r(n(5910)),u=r(n(5367)),c=new Map([["md5",a.default],["sha-1",o.default],["sha-256",s.default],["sha-512",u.default],["sha1",o.default],["sha256",s.default],["sha512",u.default]])},2208(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return a(t,e),t}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PassThrough=t.Duplex=t.Transform=t.Writable=t.Readable=t.WebSocket=t.RTCPeerConnection=t.fetch=t.Hmac=t.Hash=t.createHash=t.Buffer=t.name=void 0,t.randomBytes=function(e){var t=new Uint8Array(e);return e>0&&(globalThis.crypto||globalThis.msCrypto).getRandomValues(t),u.Buffer.from(t.buffer)},t.getHashes=function(){return["sha-1","sha-256","sha-512","md5"]},t.createHmac=function(e,t){return new l.default(e.toLowerCase(),t)},t.createResolver=function(){};var u=n(391);Object.defineProperty(t,"Buffer",{enumerable:!0,get:function(){return u.Buffer}});var c=o(n(8370));t.createHash=c.default,Object.defineProperty(t,"Hash",{enumerable:!0,get:function(){return c.Hash}});var l=s(n(2301));t.Hmac=l.default;var f=n(9677);Object.defineProperty(t,"Readable",{enumerable:!0,get:function(){return f.Readable}}),Object.defineProperty(t,"Writable",{enumerable:!0,get:function(){return f.Writable}}),Object.defineProperty(t,"Transform",{enumerable:!0,get:function(){return f.Transform}}),Object.defineProperty(t,"PassThrough",{enumerable:!0,get:function(){return f.PassThrough}}),Object.defineProperty(t,"Duplex",{enumerable:!0,get:function(){return f.Duplex}});var d=globalThis.fetch.bind(globalThis);t.fetch=d;var p=globalThis.WebSocket;t.WebSocket=p;var h=globalThis.RTCPeerConnection;t.RTCPeerConnection=h,t.name="browser"},9269(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=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];queueMicrotask(function(){return e.apply(void 0,n)})}},9677(e,t,n){"use strict";t.Readable=n(5807),t.Writable=n(9555),t.Duplex=n(5753),t.Transform=n(3631),t.PassThrough=n(365)},5753(e,t,n){"use strict";var r=n(9269),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var a=Object.create(n(5549)),o=n(5807),s=n(9555);a.inherits(f,o);for(var u=i(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},365(e,t,n){"use strict";e.exports=i;var r=n(3631);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}Object.create(n(5549)).inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},5807(e,t,n){"use strict";var r,i=n(440),a=n(9269);e.exports=g,g.ReadableState=m,n(3550).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},u=n(3550).EventEmitter,c=n(391).Buffer,l="undefined"!=typeof Uint8Array?Uint8Array:function(){},f=Object.create(n(5549)),d=function(){},p=n(8367).x,h=n(9591);f.inherits(g,u);var v=["error","close","destroy","pause","resume"];function m(e,t){e=e||{};var i=t instanceof(r=r||n(5753));this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,s=e.readableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i&&(s||0===s)?s:u,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=n(2639).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function g(e){if(r=r||n(5753),!(this instanceof g))return new g(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function y(e,t,n,r,i){var a,o=e._readableState;return null===t?(o.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,w(e)}}(e,o)):(i||(a=function(e,t){var n,r;return r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):b(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?b(e,o,t,!1):x(e,o)):b(e,o,t,!1))):r||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function b(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&w(e)),x(e,t)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),g.prototype.destroy=h.destroy,g.prototype._undestroy=h.undestroy,g.prototype._destroy=function(e,t){this.push(null),t(e)},g.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),y(this,e,t,!1,n)},g.prototype.unshift=function(e){return y(this,e,null,!0,!1)},g.prototype.isPaused=function(){return!1===this._readableState.flowing},g.prototype.setEncoding=function(e){return o||(o=n(2639).I),this._readableState.decoder=new o(e),this._readableState.encoding=e,this};var S=8388608;function _(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function w(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.flowing,t.emittedReadable=!0,t.sync?a.nextTick(O,e):O(e))}function O(e){e.emit("readable"),E(e)}function x(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d(),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function T(e){e.read(0)}function A(e,t){t.reading||e.read(0),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),E(e),t.flowing&&!t.reading&&e.read(0)}function E(e){var t=e._readableState;for(t.flowing;t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function N(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}g.prototype.read=function(e){e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return t.length,t.ended,0===t.length&&t.ended?N(this):w(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&N(this),null;var r,i=t.needReadable;return(0===t.length||t.length-e<t.highWaterMark)&&(i=!0),t.ended||t.reading?i=!1:i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_(n,t))),null===(r=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&N(this)),null!==r&&this.emit("data",r),r},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,r.pipesCount;var o=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function u(){e.end()}r.endEmitted?a.nextTick(o):n.once("end",o),e.on("unpipe",function t(i,a){i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,e.removeListener("close",h),e.removeListener("finish",v),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",t),n.removeListener("end",u),n.removeListener("end",m),n.removeListener("data",d),l=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;t.awaitDrain,t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,E(e))}}(n);e.on("drain",c);var l=!1,f=!1;function d(t){f=!1,!1!==e.write(t)||f||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==R(r.pipes,e))&&!l&&(n._readableState.awaitDrain,n._readableState.awaitDrain++,f=!0),n.pause())}function p(t){m(),e.removeListener("error",p),0===s(e,"error")&&e.emit("error",t)}function h(){e.removeListener("finish",v),m()}function v(){e.removeListener("close",h),m()}function m(){n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",p),e.once("close",h),e.once("finish",v),e.emit("pipe",n),r.flowing||n.resume(),e},g.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=R(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},g.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&w(this):a.nextTick(T,this))}return n},g.prototype.addListener=g.prototype.on,g.prototype.resume=function(){var e=this._readableState;return e.flowing||(e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(A,e,t))}(this,e)),this},g.prototype.pause=function(){return this._readableState.flowing,!1!==this._readableState.flowing&&(this._readableState.flowing=!1,this.emit("pause")),this},g.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<v.length;a++)e.on(v[a],this.emit.bind(this,v[a]));return this._read=function(t){r&&(r=!1,e.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=I},3631(e,t,n){"use strict";e.exports=a;var r=n(5753);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){s(e,t,n)}):s(this,null,null)}function s(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}Object.create(n(5549)).inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},9555(e,t,n){"use strict";var r=n(9269);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var a,o=r.nextTick;v.WritableState=h;var s,u=Object.create(n(5549)),c=n(3550).EventEmitter,l=n(391).Buffer,f="undefined"!=typeof Uint8Array?Uint8Array:function(){},d=n(9591);function p(){}function h(e,t){a=a||n(5753),e=e||{};var s=t instanceof a;this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:s&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(a(i),e._writableState.errorEmitted=!0,e.emit("error",i),_(e,t))}(e,n,i,t,a);else{var s=b(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),i?o(g,e,n,s,a):g(e,n,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function v(e){if(a=a||n(5753),!(s.call(v,this)||this instanceof a))return new v(e);this._writableState=new h(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function m(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function g(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)a[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;a.allBuffers=u,m(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),_(e,t)})}function _(e,t){var n=b(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,r.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(v,c),h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(h.prototype,"buffer",{get:function(){return this.getBuffer()}})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===v&&e&&e._writableState instanceof h}})):s=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,l.isBuffer(i)||i instanceof f);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=p),a.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),r.nextTick(i,o),a=!1),a}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,n)),t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,a);return u}(this,a,s,e,t,n)),o},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=d.destroy,v.prototype._undestroy=d.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}},8367(e,t,n){"use strict";var r=n(7383),i=n(4579),a=n(391).Buffer;function o(e,t,n){e.copy(t,n)}t.x=function(){return i(function e(){r(this,e),this.head=null,this.tail=null,this.length=0},[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)o(n.data,t,r),r+=n.data.length,n=n.next;return t}}])}()},9591(e,t,n){"use strict";var r=n(9269);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},2639(e,t,n){"use strict";var r=n(391).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},5549(e,t){"use strict";t.inherits=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}},3463(e,t,n){"use strict";var r=n(1132),i=n(3693),a=n(4756),o=n(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.getAccountInfo=function(){var t=o(a.mark(function t(n){var r;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({account:{},to:n,type:"get"});case 1:return r=t.sent,t.abrupt("return",r.account);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.updateAccount=function(t,n){return e.sendIQ({account:n,to:t,type:"set"})},e.deleteAccount=function(t){return e.sendIQ({account:{remove:!0},to:t,type:"set"})},e.getPrivateData=function(){var t=o(a.mark(function t(n){var r;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({privateStorage:i({},n,{}),type:"get"});case 1:return r=t.sent,t.abrupt("return",r.privateStorage[n]);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.setPrivateData=function(){var t=o(a.mark(function t(n,r){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({privateStorage:i({},n,r),type:"set"}));case 1:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.getVCard=function(){var t=o(a.mark(function t(n){var r;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({to:n,type:"get",vcard:{format:s.NS_VCARD_TEMP}});case 1:return r=t.sent,t.abrupt("return",r.vcard);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.publishVCard=function(){var t=o(a.mark(function t(n){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({type:"set",vcard:n});case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.enableNotifications=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.sendIQ({push:{action:"enable",form:{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/pubsub#publish-options"}].concat(r(i)),type:"submit"},jid:t,node:n},type:"set"})},e.disableNotifications=function(t,n){return e.sendIQ({push:{action:"disable",jid:t,node:n},type:"set"})}};var s=n(6519)},2319(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature((0,r.NS_PEP_NOTIFY)(r.NS_AVATAR_METADATA)),e.on("pubsub:published",function(t){if(t.pubsub.items.node===r.NS_AVATAR_METADATA){var n=t.pubsub.items.published[0].content;e.emit("avatar",{avatars:n.versions||[],jid:t.from,source:"pubsub"})}}),e.on("presence",function(t){"error"!==t.type&&t.vcardAvatar&&"string"==typeof t.vcardAvatar&&e.emit("avatar",{avatars:[{id:t.vcardAvatar}],jid:t.from,source:"vcard"})}),e.publishAvatar=function(t,n){return e.publish("",r.NS_AVATAR_DATA,{data:n,itemType:r.NS_AVATAR_DATA},t)},e.useAvatars=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.publish("",r.NS_AVATAR_METADATA,{itemType:r.NS_AVATAR_METADATA,pointers:n,versions:t},"current")},e.getAvatar=function(t,n){return e.getItem(t,r.NS_AVATAR_DATA,n)}};var r=n(6519)},6061(e,t,n){"use strict";var r=n(4756),i=n(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("bind",300,function(){var t=i(r.mark(function t(n,i){var a,o,s;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=1,e.sendIQ({bind:{resource:e.config.resource},type:"set"});case 1:return a=t.sent,e.features.negotiated.bind=!0,e.emit("session:prebind",a.bind.jid),o=!n.legacySession||n.legacySession&&n.legacySession.optional,!e.sessionStarted&&o&&e.emit("session:started",e.jid),t.abrupt("return",i());case 2:return t.prev=2,s=t.catch(0),console.error(s),t.abrupt("return",i("disconnect","JID binding failed"));case 3:case"end":return t.stop()}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}()),e.registerFeature("legacySession",1e3,function(){var t=i(r.mark(function t(n,i){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.sessionStarted||n.legacySession&&n.legacySession.optional)){t.next=1;break}return e.features.negotiated.session=!0,t.abrupt("return",i());case 1:return t.prev=1,t.next=2,e.sendIQ({legacySession:!0,type:"set"});case 2:return e.features.negotiated.session=!0,e.sessionStarted||(e.sessionStarted=!0,e.emit("session:started",e.jid)),t.abrupt("return",i());case 3:return t.prev=3,t.catch(1),t.abrupt("return",i("disconnect","Session requeset failed"));case 4:case"end":return t.stop()}},t,null,[[1,3]])}));return function(e,n){return t.apply(this,arguments)}}()),e.on("session:started",function(){e.sessionStarted=!0}),e.on("session:prebind",function(t){e.jid=t,e.emit("session:bound",e.jid)}),e.on("--reset-stream-features",function(){e.sessionStarted=!1,e.features.negotiated.bind=!1,e.features.negotiated.session=!1})}},4953(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature(r.NS_ADHOC_COMMANDS),e.disco.addItem({name:"Ad-Hoc Commands",node:r.NS_ADHOC_COMMANDS}),e.getCommands=function(t){return e.getDiscoItems(t,r.NS_ADHOC_COMMANDS)}};var r=n(6519)},2934(e,t,n){"use strict";var r=n(4756),i=n(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature(a.NS_PING),e.on("iq:get:ping",function(t){e.sendIQResult(t)}),e.on("--reset-stream-features",function(){e._stopKeepAliveInterval(),e.features.negotiated.streamManagement=!1,e.features.negotiated.clientStateIndication=!1}),e.markActive=function(){return c(e,"active")},e.markInactive=function(){return c(e,"inactive")},e.ping=function(){var t=i(r.mark(function t(n){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({ping:!0,to:n,type:"get"});case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.enableKeepAlive=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e._keepAliveOptions=t;var n=t.interval||300,a=t.timeout||e.config.timeout||15;function u(){return(u=i(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sessionStarted){t.next=4;break}return t.prev=1,t.next=2,(0,o.timeoutPromise)(s(e),1e3*a);case 2:t.next=4;break;case 3:t.prev=3,t.catch(1),e.emit("stream:error",{condition:"connection-timeout",text:"Server did not respond in "+a+" seconds"}),e.transport&&(e.transport.hasStream=!1,e.transport.disconnect(!1));case 4:case"end":return t.stop()}},t,null,[[1,3]])}))).apply(this,arguments)}clearInterval(e._keepAliveInterval),e._keepAliveInterval=setInterval(function(){return u.apply(this,arguments)},1e3*n)},e._stopKeepAliveInterval=function(){e._keepAliveInterval&&(clearInterval(e._keepAliveInterval),delete e._keepAliveInterval)},e.disableKeepAlive=function(){delete e._keepAliveOptions,e._stopKeepAliveInterval()},e.on("stream:management:resumed",function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)}),e.on("stream:start",function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)});var t=function(){var t=i(r.mark(function t(n,a){var o;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.config.useStreamManagement){t.next=1;break}return t.abrupt("return",a());case 1:if(o=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=n.type,t.next="enabled"===i?1:"resumed"===i?3:"failed"===i?5:7;break;case 1:return t.next=2,e.sm.enabled(n);case 2:return e.features.negotiated.streamManagement=!0,e.off("sm",o),t.abrupt("return",a());case 3:return t.next=4,e.sm.resumed(n);case 4:return e.features.negotiated.streamManagement=!0,e.features.negotiated.bind=!0,e.sessionStarted=!0,e.sessionStarting=!1,e.off("sm",o),e.emit("stream:management:resumed",n),t.abrupt("return",a("break"));case 5:return t.next=6,e.sm.failed(n);case 6:e.off("sm",o),e.emit("session:end"),a();case 7:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.on("sm",o),e.sm.id){t.next=5;break}if(!e.features.negotiated.bind){t.next=3;break}return t.next=2,e.sm.enable();case 2:t.next=4;break;case 3:e.off("sm",o),a();case 4:t.next=8;break;case 5:if(!e.sm.id||!e.sm.allowResume){t.next=7;break}return t.next=6,e.sm.resume();case 6:t.next=8;break;case 7:e.off("sm",o),a();case 8:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}();e.registerFeature("streamManagement",200,t),e.registerFeature("streamManagement",500,t),e.registerFeature("clientStateIndication",400,function(t,n){e.features.negotiated.clientStateIndication=!0,n()})};var a=n(6519),o=n(9978);function s(e){return u.apply(this,arguments)}function u(){return(u=i(r.mark(function e(t){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.sm.started){e.next=1;break}return e.abrupt("return",new Promise(function(e){t.once("stream:management:ack",function(){return e()}),t.sm.request()}));case 1:return e.prev=1,e.next=2,t.ping();case 2:e.next=5;break;case 3:if(e.prev=3,!(n=e.catch(1)).error||"timeout"===n.error.condition){e.next=4;break}return e.abrupt("return");case 4:throw n;case 5:case"end":return e.stop()}},e,null,[[1,3]])}))).apply(this,arguments)}function c(e,t){e.features.negotiated.clientStateIndication&&e.send("csi",{type:t})}},4801(e,t,n){"use strict";var r=n(4756),i=n(9293);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var o,s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||(o=function(e){return o=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},o(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=o(e),r=0;r<n.length;r++)"default"!==n[r]&&s(t,e,n[r]);return u(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature("jid\\20escaping"),e.disco.addFeature(f.NS_DELAY),e.disco.addFeature(f.NS_EME_0),e.disco.addFeature(f.NS_FORWARD_0),e.disco.addFeature(f.NS_HASHES_2),e.disco.addFeature(f.NS_HASHES_1),e.disco.addFeature(f.NS_IDLE_1),e.disco.addFeature(f.NS_JSON_0),e.disco.addFeature(f.NS_OOB),e.disco.addFeature(f.NS_PSA),e.disco.addFeature(f.NS_REFERENCE_0),e.disco.addFeature(f.NS_SHIM),e.disco.addFeature(f.NS_DATAFORM),e.disco.addFeature(f.NS_DATAFORM_MEDIA),e.disco.addFeature(f.NS_DATAFORM_VALIDATION),e.disco.addFeature(f.NS_DATAFORM_LAYOUT);var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}(d.getHashes());try{for(n.s();!(t=n.n()).done;){var o=t.value;e.disco.addFeature((0,f.NS_HASH_NAME)(o))}}catch(e){n.e(e)}finally{n.f()}e.disco.addFeature(f.NS_TIME),e.disco.addFeature(f.NS_VERSION),e.on("iq:get:softwareVersion",function(t){return e.sendIQResult(t,{softwareVersion:e.config.softwareVersion||{name:"stanzajs.org",version:l.VERSION}})}),e.on("iq:get:time",function(t){var n=new Date;e.sendIQResult(t,{time:{tzo:n.getTimezoneOffset(),utc:n}})}),e.getSoftwareVersion=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({softwareVersion:{},to:n,type:"get"});case 1:return i=t.sent,t.abrupt("return",i.softwareVersion);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.getTime=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({time:{},to:n,type:"get"});case 1:return i=t.sent,t.abrupt("return",i.time);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.getLastActivity=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({lastActivity:{},to:n,type:"get"});case 1:return i=t.sent,t.abrupt("return",i.lastActivity);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()};var l=n(2354),f=n(6519),d=c(n(2208))},3329(e,t,n){"use strict";var r=n(4756),i=n(9293);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.features={handlers:Object.create(null),negotiated:Object.create(null),order:[]},e.registerFeature=function(t,n,r){this.features.order.push({name:t,priority:n}),this.features.order.sort(function(e,t){return e.priority-t.priority}),this.features.handlers[t]=r.bind(e)},e.on("features",function(){var t=i(r.mark(function t(n){var i,o,s,u,c,l,f,d,p,h,v,m,g,y;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:f=function(e){return new Promise(function(t){o[e](n,function(e,n){t(e?{command:e,message:n}:null)})})},i=e.features.negotiated,o=e.features.handlers,s=[],u=a(e.features.order);try{for(u.s();!(c=u.n()).done;)l=c.value.name,n[l]&&o[l]&&!i[l]&&s.push(l)}catch(e){u.e(e)}finally{u.f()}d=0,p=s;case 1:if(!(d<p.length)){t.next=9;break}if(h=p[d],!i[h]){t.next=2;break}return t.abrupt("continue",8);case 2:return v="",m="",t.prev=3,t.next=4,f(h);case 4:(g=t.sent)&&(v=g.command,m=g.message||""),t.next=6;break;case 5:t.prev=5,y=t.catch(3),v="disconnect",m=y.message,console.error(y);case 6:if(v){t.next=7;break}return t.abrupt("continue",8);case 7:return"restart"===v&&e.transport&&e.transport.restart(),"disconnect"===v&&(e.emit("stream:error",{condition:"policy-violation",text:"Failed to negotiate stream features: "+m}),e.disconnect()),t.abrupt("return");case 8:d++,t.next=1;break;case 9:case"end":return t.stop()}},t,null,[[3,5]])}));return function(e){return t.apply(this,arguments)}}())}},7241(e,t,n){"use strict";var r=n(4756),i=n(1132),a=n(9293);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.discoverBindings=function(){var t=a(r.mark(function t(n){var a,s,c,l;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=new Set,s=new Set,c=e.resolver.getHostMeta(n).then(function(e){var t,n,r=o(null!==(t=e.links)&&void 0!==t?t:[]);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.href&&i.rel===u.NS_ALT_CONNECTIONS_WEBSOCKET&&s.add(i.href),i.href&&i.rel===u.NS_ALT_CONNECTIONS_XBOSH&&a.add(i.href)}}catch(e){r.e(e)}finally{r.f()}}).catch(function(e){return console.error(e)}),l=e.config.allowAlternateDNSDiscovery?e.resolver.resolveTXT("_xmppconnect.".concat(n)).then(function(e){var t,n=o(e);try{for(n.s();!(t=n.n()).done;){var r,i=o(t.value);try{for(i.s();!(r=i.n()).done;){var u=r.value;if(u.startsWith("_xmpp-client-websocket=")){var c=u.substring(u.indexOf("=")+1);c&&s.add(c)}if(u.startsWith("_xmpp-client-xbosh=")){var l=u.substring(u.indexOf("=")+1);l&&a.add(l)}}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}}).catch(function(e){return console.error(e)}):Promise.resolve(),t.next=1,Promise.all([c,l]).catch(function(e){return console.error(e)});case 1:return t.abrupt("return",{bosh:i(a).filter(function(e){return e.startsWith("https://")}),websocket:i(s).filter(function(e){return e.startsWith("wss://")})});case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()};var u=n(6519)},9611(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(3693);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l,f=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),d=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p=this&&this.__importStar||(l=function(e){return l=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},l(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=l(e),r=0;r<n.length;r++)"default"!==n[r]&&f(t,e,n[r]);return d(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=!!h.RTCPeerConnection,n={advertiseAudio:t,advertiseFileTransfer:t,advertiseVideo:t,bundlePolicy:"balanced",hasRTCPeerConnection:t,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require",trickleIce:!0},a=e.config.jingle,s=c(c({},n),a),u=e.jingle=new v.SessionManager(s),l=[m.NS_JINGLE_1];s.hasRTCPeerConnection&&(l.push(m.NS_JINGLE_ICE_0,m.NS_JINGLE_ICE_UDP_1,m.NS_JINGLE_DTLS_SCTP_1,m.NS_JINGLE_DTLS_0,"urn:ietf:rfc:5888"),!1===s.trickleIce&&l.push("urn:ietf:rfc:3264"),(s.advertiseAudio||s.advertiseVideo)&&l.push(m.NS_JINGLE_RTP_1,m.NS_JINGLE_RTP_RTCP_FB_0,m.NS_JINGLE_RTP_HDREXT_0,"urn:ietf:rfc:5576"),s.advertiseAudio&&l.push(m.NS_JINGLE_RTP_AUDIO),s.advertiseVideo&&l.push(m.NS_JINGLE_RTP_VIDEO),s.advertiseFileTransfer&&l.push(m.NS_JINGLE_FILE_TRANSFER_4,m.NS_JINGLE_FILE_TRANSFER_5));for(var f=0,d=l;f<d.length;f++){var p=d[f];e.disco.addFeature(p)}for(var g=function(){var t=b[y];u.on(t,function(n,r){e.emit("jingle:"+t,n,r)})},y=0,b=["outgoing","incoming","accepted","terminated","ringing","mute","unmute","hold","resumed"];y<b.length;y++)g();u.on("createdSession",function(t){e.emit("jingle:created",t)}),u.on("send",function(){var t=i(r.mark(function t(n){var i,a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,"set"!==n.type){t.next=2;break}return t.next=1,e.sendIQ(n);case 1:(i=t.sent).jingle||(i.jingle={}),i.jingle.sid=n.jingle.sid,u.process(i);case 2:"result"===n.type&&e.sendIQResult({type:"set",id:n.id,from:n.to},n),"error"===n.type&&e.sendIQError({type:"set",id:n.id,from:n.to},n),t.next=4;break;case 3:t.prev=3,(a=t.catch(0)).jingle||(a.jingle=n.jingle),a.jingle.sid=n.jingle.sid,u.process(a);case 4:case"end":return t.stop()}},t,null,[[0,3]])}));return function(e){return t.apply(this,arguments)}}()),e.on("session:bound",function(e){u.selfID=e}),e.on("iq:set:jingle",function(e){u.process(e)}),e.on("unavailable",function(e){u.endPeerSessions(e.from,void 0,!0)}),e.getServices=function(){var t=i(r.mark(function t(n,i,a){var o,s;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({externalServices:{type:i,version:a},to:n,type:"get"});case 1:return o=t.sent,(s=o.externalServices).services=s.services||[],t.abrupt("return",s);case 2:case"end":return t.stop()}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),e.getServiceCredentials=function(){var t=i(r.mark(function t(n,i,a,o,s){var u;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({externalServiceCredentials:{host:i,port:o,type:a,version:s},to:n,type:"get"});case 1:return u=t.sent,t.abrupt("return",u.externalServiceCredentials);case 2:case"end":return t.stop()}},t)}));return function(e,n,r,i,a){return t.apply(this,arguments)}}(),e.discoverICEServers=i(r.mark(function t(){var n,i,a,s,u,c,l,f=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.length>0&&void 0!==f[0]?f[0]:{},t.prev=1,t.next=2,e.getServices(e.config.server,void 0,n.version);case 2:i=t.sent,a=i.services||[],s=[],u=o(a);try{for(u.s();!(c=u.n()).done;)l=c.value,e.jingle.addICEServer(l)}catch(e){u.e(e)}finally{u.f()}return t.abrupt("return",s);case 3:return t.prev=3,t.catch(1),t.abrupt("return",[]);case 4:case"end":return t.stop()}},t,null,[[1,3]])}))};var h=n(2208),v=p(n(4697)),m=n(6519)},3857(e,t,n){"use strict";var r=n(3693);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature(o.NS_ACTIVITY),e.disco.addFeature(o.NS_GEOLOC),e.disco.addFeature(o.NS_MOOD),e.disco.addFeature(o.NS_NICK),e.disco.addFeature(o.NS_TUNE),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_ACTIVITY)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_GEOLOC)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_MOOD)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_NICK)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_TUNE)),e.publishActivity=function(t){return e.publish("",o.NS_ACTIVITY,a({itemType:o.NS_ACTIVITY},t))},e.publishGeoLoc=function(t){return e.publish("",o.NS_GEOLOC,a({itemType:o.NS_GEOLOC},t))},e.publishMood=function(t){return e.publish("",o.NS_MOOD,a({itemType:o.NS_MOOD},t))},e.publishNick=function(t){return e.publish("",o.NS_NICK,{itemType:o.NS_NICK,nick:t})},e.publishTune=function(t){return e.publish("",o.NS_TUNE,a({itemType:o.NS_TUNE},t))},e.on("pubsub:published",function(t){var n=t.pubsub.items.published[0].content;switch(t.pubsub.items.node){case o.NS_ACTIVITY:return e.emit("activity",{activity:n,jid:t.from});case o.NS_GEOLOC:return e.emit("geoloc",{geoloc:n,jid:t.from});case o.NS_MOOD:return e.emit("mood",{jid:t.from,mood:n});case o.NS_NICK:return e.emit("nick",{jid:t.from,nick:n.nick});case o.NS_TUNE:return e.emit("tune",{jid:t.from,tune:t.pubsub.items.published[0].content})}})};var o=n(6519)},5989(e,t,n){"use strict";var r=n(4756),i=n(3693),a=n(9293);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("sasl",100,function(){var t=a(r.mark(function t(n,i){var o,u,c,l;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.sasl.createMechanism(n.sasl.mechanisms),u=function(){var t=a(r.mark(function t(n){var a,c,l,f,d;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o){t.next=1;break}return t.abrupt("return");case 1:f=n.type,t.next="success"===f?2:"challenge"===f?3:"failure"===f||"abort"===f?8:9;break;case 2:return e.features.negotiated.sasl=!0,e.off("sasl",u),e.emit("auth:success",e.config.credentials),e.transport&&(e.transport.authenticated=!0),i("restart"),t.abrupt("return");case 3:return o.processChallenge(n.value),t.prev=4,t.next=5,e.getCredentials();case 5:a=t.sent,(c=o.createResponse(a))||""===c?e.send("sasl",{type:"response",value:c}):e.send("sasl",{type:"response"}),(l=o.getCacheableCredentials())&&(e.config.credentials||(e.config.credentials={}),e.config.credentials=s(s({},e.config.credentials),l),e.emit("credentials:update",e.config.credentials)),t.next=7;break;case 6:t.prev=6,d=t.catch(4),console.error(d),e.send("sasl",{type:"abort"});case 7:return t.abrupt("return");case 8:return e.off("sasl",u),e.emit("auth:failed"),i("disconnect","authentication failed"),t.abrupt("return");case 9:case"end":return t.stop()}},t,null,[[4,6]])}));return function(e){return t.apply(this,arguments)}}(),o){t.next=1;break}return e.off("sasl",u),e.emit("auth:failed"),t.abrupt("return",i("disconnect","authentication failed"));case 1:return e.on("sasl",u),e.once("--reset-stream-features",function(){e.features.negotiated.sasl=!1,e.off("sasl",u)}),t.prev=2,t.next=3,e.getCredentials();case 3:c=t.sent,e.send("sasl",{mechanism:o.name,type:"auth",value:o.createResponse(c)}),t.next=5;break;case 4:t.prev=4,l=t.catch(2),console.error(l),e.send("sasl",{type:"abort"});case 5:case"end":return t.stop()}},t,null,[[2,4]])}));return function(e,n){return t.apply(this,arguments)}}())}},4224(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8704),t),i(n(4466),t),i(n(3826),t),i(n(1713),t),i(n(9781),t),i(n(1049),t),i(n(3370),t),i(n(7414),t),i(n(8690),t),i(n(2527),t),i(n(9718),t),i(n(6012),t),i(n(3057),t),i(n(4642),t),i(n(8692),t),i(n(6072),t),i(n(431),t),i(n(3939),t),i(n(7363),t),i(n(9424),t),i(n(8729),t),i(n(1426),t),i(n(5735),t),i(n(7165),t),i(n(9409),t),i(n(1522),t),i(n(386),t),i(n(255),t),i(n(1142),t),i(n(5903),t),i(n(1288),t),i(n(2451),t),i(n(9017),t),i(n(1440),t),i(n(8578),t),i(n(8777),t),i(n(4262),t),i(n(5530),t),i(n(6495),t),i(n(4062),t),i(n(7805),t),i(n(2507),t),i(n(9151),t),i(n(4792),t),i(n(9514),t),i(n(1296),t),i(n(4604),t),i(n(6667),t),i(n(996),t),i(n(565),t),i(n(9846),t),i(n(7334),t),i(n(7274),t),i(n(5413),t),i(n(2251),t),i(n(9848),t),i(n(2094),t),i(n(3813),t),i(n(4854),t),i(n(1065),t),i(n(4971),t),i(n(9263),t),i(n(6916),t),i(n(6443),t),i(n(6588),t),i(n(9344),t),i(n(1564),t),i(n(1778),t),i(n(6870),t),i(n(8470),t),i(n(4983),t),i(n(6208),t),i(n(6571),t),i(n(8025),t),i(n(1619),t),i(n(4256),t),i(n(9118),t),i(n(5151),t),i(n(4396),t),i(n(2176),t),i(n(8428),t),i(n(4218),t);var o=a(n(8704)),s=a(n(4466)),u=a(n(3826)),c=a(n(1713)),l=a(n(9781)),f=a(n(1049)),d=a(n(3370)),p=a(n(7414)),h=a(n(8690)),v=a(n(2527)),m=a(n(9718)),g=a(n(6012)),y=a(n(3057)),b=a(n(4642)),S=a(n(8692)),_=a(n(6072)),w=a(n(431)),O=a(n(3939)),x=a(n(7363)),k=a(n(9424)),T=a(n(8729)),A=a(n(1426)),E=a(n(5735)),I=a(n(7165)),N=a(n(9409)),j=a(n(1522)),R=a(n(386)),P=a(n(255)),C=a(n(1142)),M=a(n(5903)),D=a(n(1288)),L=a(n(2451)),B=a(n(1440)),F=a(n(8578)),q=a(n(8777)),U=a(n(9017)),z=a(n(4262)),J=a(n(5530)),G=a(n(6495)),H=a(n(4062)),W=a(n(7805)),V=a(n(2507)),Q=a(n(9151)),K=a(n(4792)),X=a(n(9514)),Y=a(n(1296)),$=a(n(4604)),Z=a(n(6667)),ee=a(n(996)),te=a(n(565)),ne=a(n(9846)),re=a(n(7334)),ie=a(n(7274)),ae=a(n(5413)),oe=a(n(2251)),se=a(n(9848)),ue=a(n(2094)),ce=a(n(3813)),le=a(n(4854)),fe=a(n(1065)),de=a(n(4971)),pe=a(n(9263)),he=a(n(6916)),ve=a(n(6443)),me=a(n(6588)),ge=a(n(9344)),ye=a(n(1564)),be=a(n(1778)),Se=a(n(6870)),_e=a(n(8470)),we=a(n(4983)),Oe=a(n(6208)),xe=a(n(6571)),ke=a(n(8025)),Te=a(n(1619)),Ae=a(n(4256)),Ee=a(n(9118)),Ie=a(n(5151)),Ne=a(n(4396)),je=a(n(2176)),Re=a(n(8428)),Pe=a(n(4218)),Ce=[o.default,s.default,u.default,c.default,l.default,f.default,d.default,p.default,h.default,v.default,m.default,g.default,y.default,b.default,S.default,_.default,w.default,O.default,x.default,k.default,T.default,A.default,E.default,I.default,N.default,j.default,R.default,P.default,C.default,M.default,D.default,L.default,B.default,F.default,q.default,U.default,z.default,J.default,G.default,H.default,W.default,V.default,Q.default,K.default,X.default,Y.default,$.default,Z.default,ee.default,te.default,ne.default,re.default,ie.default,ae.default,oe.default,se.default,ue.default,ce.default,le.default,fe.default,de.default,pe.default,he.default,ve.default,me.default,ge.default,ye.default,be.default,Se.default,_e.default,we.default,Oe.default,xe.default,ke.default,Te.default,Ae.default,Ee.default,Ie.default,Ne.default,je.default,Re.default,Pe.default];t.default=Ce},8704(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:["features.legacySession","iq.legacySession"],element:"session",fields:{optional:(0,r.childBoolean)(null,"optional")},namespace:i.NS_SESSION};t.default=a},4466(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o=[{aliases:["atomentry"].concat(r((0,i.pubsubItemContentAliases)())),element:"entry",fields:{id:(0,i.childText)(null,"id"),published:(0,i.childDate)(null,"published"),updated:(0,i.childDate)(null,"updated")},namespace:a.NS_ATOM,type:a.NS_ATOM,typeField:"itemType"},{element:"summary",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.summary"},{element:"title",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.title"},{aliases:[{path:"atomentry.links",multiple:!0}],element:"link",fields:{href:(0,i.attribute)("href"),mediaType:(0,i.attribute)("type"),rel:(0,i.attribute)("rel")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.authors",multiple:!0}],element:"author",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.contributors",multiple:!0}],element:"contributor",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.categories",multiple:!0}],element:"category",fields:{term:(0,i.attribute)("term"),scheme:(0,i.attribute)("scheme"),label:(0,i.attribute)("label")},namespace:a.NS_ATOM},{element:"content",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.content"},{element:"rights",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.rights"}];t.default=o},3826(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(2354),a=n(7930),o=n(6519),s={defaultType:"stream",element:"stream",fields:{from:(0,a.attribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.attribute)("to"),version:(0,a.attribute)("version")},namespace:o.NS_STREAM,path:"stream",type:"stream",typeField:"action"},u={element:"features",namespace:o.NS_STREAM,path:"features"},c={element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STREAMS,"text"),condition:(0,a.childEnum)(o.NS_STREAMS,Object.values(i.StreamErrorCondition),i.StreamErrorCondition.UndefinedCondition),seeOtherHost:(0,a.childText)(o.NS_STREAMS,i.StreamErrorCondition.SeeOtherHost),text:(0,a.childText)(o.NS_STREAMS,"text")},namespace:o.NS_STREAM,path:"streamError"},l=Object.values(i.StreamType).map(function(e){return{aliases:["stanzaError","message.error","presence.error","iq.error"],defaultType:o.NS_CLIENT,element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STANZAS,"text"),by:(0,a.JIDAttribute)("by"),condition:(0,a.childEnum)(o.NS_STANZAS,Object.values(i.StanzaErrorCondition),i.StanzaErrorCondition.UndefinedCondition),gone:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Gone),redirect:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Redirect),text:(0,a.childText)(o.NS_STANZAS,"text"),type:(0,a.attribute)("type")},namespace:e,type:e,typeField:"streamType"}}),f=new Set(["from","id","lang","to","type","payloadType","error","streamType"]),d=Object.values(i.StreamType).map(function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"iq",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),payloadType:{order:-1e4,importer:function(e,t){if("get"===t.data.type||"set"===t.data.type){if(1!==e.children.filter(function(e){return"string"!=typeof e}).length)return"invalid-payload-count";var n=Object.keys(t.data).filter(function(e){return!f.has(e)});return 1!==n.length?"unknown-payload":n[0]}}},to:(0,a.JIDAttribute)("to"),type:(0,a.attribute)("type")},namespace:e,path:"iq",type:e,typeField:"streamType"}}),p=Object.values(i.StreamType).map(function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"message",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"message",type:e,typeField:"streamType"}}),h=Object.values(i.StreamType).map(function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"presence",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"presence",type:e,typeField:"streamType"}}),v=[{element:"mechanisms",fields:{mechanisms:(0,a.multipleChildText)(null,"mechanism")},namespace:o.NS_SASL,path:"features.sasl"},{element:"abort",namespace:o.NS_SASL,path:"sasl",type:"abort",typeField:"type"},{element:"auth",fields:{mechanism:(0,a.attribute)("mechanism"),value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"auth",typeField:"type"},{element:"challenge",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"challenge",typeField:"type"},{element:"response",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"response",typeField:"type"},{element:"success",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"success",typeField:"type"},{element:"failure",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_SASL,"text"),condition:(0,a.childEnum)(o.NS_SASL,Object.values(i.SASLFailureCondition)),text:(0,a.childText)(o.NS_SASL,"text")},namespace:o.NS_SASL,path:"sasl",type:"failure",typeField:"type"}],m=[{aliases:["features.tls"],defaultType:"start",element:"starttls",fields:{required:(0,a.childBoolean)(null,"required")},namespace:o.NS_STARTTLS,path:"tls",type:"start",typeField:"type"},{element:"proceed",namespace:o.NS_STARTTLS,path:"tls",type:"proceed",typeField:"type"},{element:"failure",namespace:o.NS_STARTTLS,path:"tls",type:"failure",typeField:"type"}],g={aliases:["features.bind","iq.bind"],element:"bind",fields:{jid:(0,a.childText)(null,"jid"),resource:(0,a.childText)(null,"resource")},namespace:o.NS_BIND},y=[s,u,c].concat(r(l),v,m,r(d),r(p),r(h),[g]);t.default=y},1713(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendStreamFeatures)({rosterPreApproval:(0,r.childBoolean)(i.NS_SUBSCRIPTION_PREAPPROVAL,"sub"),rosterVersioning:(0,r.childBoolean)(i.NS_ROSTER_VERSIONING,"ver")}),(0,r.extendMessage)({alternateLanguageBodies:(0,r.childAlternateLanguageText)(null,"body"),alternateLanguageSubjects:(0,r.childAlternateLanguageText)(null,"subject"),body:(0,r.childText)(null,"body"),hasSubject:(0,r.childBoolean)(null,"subject"),parentThread:(0,r.childAttribute)(null,"thread","parent"),subject:(0,r.childText)(null,"subject"),thread:(0,r.childText)(null,"thread"),type:(0,r.attribute)("type")}),(0,r.extendPresence)({alternateLanguageStatuses:(0,r.childAlternateLanguageText)(null,"status"),priority:(0,r.childInteger)(null,"priority",0),show:(0,r.childText)(null,"show"),status:(0,r.childText)(null,"status"),type:(0,r.attribute)("type")}),{element:"query",fields:{version:(0,r.attribute)("ver",void 0,{emitEmpty:!0})},namespace:i.NS_ROSTER,path:"iq.roster"},{aliases:[{path:"iq.roster.items",multiple:!0}],element:"item",fields:{groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),pending:(0,r.attribute)("ask"),preApproved:(0,r.booleanAttribute)("approved"),subscription:(0,r.attribute)("subscription")},namespace:i.NS_ROSTER}];t.default=a},9781(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"open",fields:{from:(0,r.attribute)("from"),id:(0,r.attribute)("id"),lang:(0,r.languageAttribute)(),to:(0,r.attribute)("to"),version:(0,r.attribute)("version")},namespace:i.NS_FRAMING,path:"stream",type:"open"},{element:"close",fields:{seeOtherURI:(0,r.attribute)("see-other-uri")},namespace:i.NS_FRAMING,path:"stream",type:"close"}];t.default=a},1049(e,t,n){"use strict";var r=n(3693);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2354),u=n(7930),c=n(6519),l=[{aliases:[{path:"message.forms",multiple:!0}],element:"x",fields:{instructions:o(o({},(0,u.multipleChildText)(null,"instructions")),{},{exportOrder:2}),reported:o(o({},(0,u.splicePath)(null,"reported","dataformField",!0)),{},{exportOrder:3}),title:o(o({},(0,u.childText)(null,"title")),{},{exportOrder:1}),type:(0,u.attribute)("type")},namespace:c.NS_DATAFORM,optionalNamespaces:{xdv:c.NS_DATAFORM_VALIDATION},path:"dataform"},{aliases:[{path:"dataform.fields",multiple:!0},{path:"dataform.items.fields",multiple:!0}],element:"field",fields:{description:(0,u.childText)(null,"desc"),label:(0,u.attribute)("label"),name:(0,u.attribute)("var"),rawValues:o(o({},(0,u.multipleChildText)(null,"value")),{},{exporter:function(){return null}}),required:(0,u.childBoolean)(null,"required"),type:(0,u.attribute)("type"),value:{importer:function(e,t){var n=e.getAttribute("type"),r=(0,u.multipleChildText)(c.NS_DATAFORM,"value").importer(e,t),i=r[0];switch(n){case s.DataFormFieldType.TextMultiple:case s.DataFormFieldType.ListMultiple:case s.DataFormFieldType.JIDMultiple:return r;case s.DataFormFieldType.Hidden:case s.DataFormFieldType.Fixed:return 1===r.length?i:r;case s.DataFormFieldType.Boolean:if(i)return"1"===i||"true"===i;break;default:return i}},exporter:function(e,t,n){var r=(0,u.multipleChildText)(null,"value"),a=[],o=n.data&&n.data.rawValues?n.data.rawValues[0]:void 0;if("boolean"==typeof t)a="true"===o||"false"===o?[o]:[t?"1":"0"];else if(Array.isArray(t)){var s,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}(t);try{for(l.s();!(s=l.n()).done;){var f=s.value;a.push(f.toString())}}catch(e){l.e(e)}finally{l.f()}}else a=[t.toString()];r.exporter(e,a,Object.assign({},n,{namespace:c.NS_DATAFORM}))}}},namespace:c.NS_DATAFORM,path:"dataformField"},{aliases:[{path:"dataform.fields.options",multiple:!0}],element:"option",fields:{label:(0,u.attribute)("label"),value:(0,u.childText)(null,"value")},namespace:c.NS_DATAFORM},{aliases:[{path:"dataform.items",multiple:!0}],element:"item",namespace:c.NS_DATAFORM},{element:"validate",fields:{listMax:(0,u.childIntegerAttribute)(null,"list-range","max"),listMin:(0,u.childIntegerAttribute)(null,"list-range","min"),method:(0,u.childEnum)(null,["basic","open","range","regex"],"basic"),rangeMax:(0,u.childAttribute)(null,"range","max"),rangeMin:(0,u.childAttribute)(null,"range","min"),regex:(0,u.childText)(null,"regex"),type:(0,u.attribute)("datatype","xs:string")},namespace:c.NS_DATAFORM_VALIDATION,path:"dataform.fields.validation"}];t.default=l},3370(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:["presence.legacyLastActivity","iq.lastActivity"],element:"query",fields:{seconds:(0,r.integerAttribute)("seconds"),status:(0,r.text)()},namespace:i.NS_LAST_ACTIVITY}];t.default=a},7414(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"query",fields:{activeList:(0,r.childAttribute)(null,"active","name"),defaultList:(0,r.childAttribute)(null,"default","name")},namespace:i.NS_PRIVACY,path:"iq.privacy"},{aliases:[{path:"iq.privacy.lists",multiple:!0}],element:"list",fields:{name:(0,r.attribute)("name")},namespace:i.NS_PRIVACY},{aliases:[{path:"iq.privacy.lists.items",multiple:!0}],element:"item",fields:{action:(0,r.attribute)("action"),incomingPresence:(0,r.childBoolean)(null,"presence-in"),iq:(0,r.childBoolean)(null,"iq"),messages:(0,r.childBoolean)(null,"message"),order:(0,r.integerAttribute)("order"),outgoingPresence:(0,r.childBoolean)(null,"presence-out"),type:(0,r.attribute)("type"),value:(0,r.attribute)("value")},namespace:i.NS_PRIVACY}];t.default=a},8690(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:["iq.disco","message.disco","features.disco"],childrenExportOrder:{identities:1,features:2,extensions:3},element:"query",fields:{features:(0,r.multipleChildAttribute)(null,"feature","var"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_INFO,path:"disco",type:"info",typeField:"type"},{aliases:[{path:"disco.identities",selector:"info",multiple:!0}],element:"identity",fields:{category:(0,r.attribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},{aliases:[{path:"disco.items",multiple:!0,selector:"items"}],element:"item",fields:{jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS},{aliases:[{path:"disco.items",multiple:!0,selector:"info"}],element:"item",fields:{category:(0,r.JIDAttribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},(0,r.addAlias)(i.NS_DATAFORM,"x",[{path:"disco.extensions",multiple:!0,selector:"info"}]),(0,r.addAlias)(i.NS_RSM,"set",[{path:"disco.paging",selector:"items"}]),{aliases:["iq.disco","message.disco","features.disco"],element:"query",fields:{node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS,path:"disco",type:"items",typeField:"type"}];t.default=a},2527(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),(0,r.extendPresence)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),{element:"address",fields:{alternateLanguageDescriptions:(0,r.childAlternateLanguageText)(null,"desc"),delivered:(0,r.booleanAttribute)("delivered"),description:(0,r.attribute)("desc"),jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_ADDRESS,path:"extendedAddress"}];t.default=a},9718(e,t,n){"use strict";var r=n(3693);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7930),s=n(6519),u=[(0,o.addAlias)(s.NS_DATAFORM,"x",[{path:"iq.muc.form",selector:"configure"}]),{defaultType:"info",element:"x",fields:{password:(0,o.childText)(null,"password")},namespace:s.NS_MUC,path:"presence.muc",type:"join",typeField:"type"},{aliases:[{path:"presence.muc.history",selector:"join"}],element:"history",fields:{maxCharacters:(0,o.integerAttribute)("maxchars"),maxStanzas:(0,o.integerAttribute)("maxstanzas"),seconds:(0,o.integerAttribute)("seconds"),since:(0,o.dateAttribute)("since")},namespace:s.NS_MUC},{aliases:["presence.muc","message.muc"],defaultType:"info",element:"x",fields:{action:(0,o.childEnum)(null,["invite","decline","destroy"]),actor:(0,o.splicePath)(null,"item","mucactor"),affiliation:(0,o.childAttribute)(null,"item","affiliation"),jid:(0,o.childJIDAttribute)(null,"item","jid"),nick:(0,o.childAttribute)(null,"item","nick"),password:(0,o.childText)(null,"password"),reason:(0,o.deepChildText)([{namespace:null,element:"item"},{namespace:null,element:"reason"}]),role:(0,o.childAttribute)(null,"item","role"),statusCodes:(0,o.multipleChildAttribute)(null,"status","code")},namespace:s.NS_MUC_USER,type:"info",typeField:"type",typeOrder:1},{element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_USER,path:"mucactor"},{element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_USER,path:"presence.muc.destroy"},{aliases:[{path:"message.muc.invite",multiple:!0}],element:"invite",fields:{continue:(0,o.childBoolean)(null,"continue"),from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),thread:(0,o.childAttribute)(null,"continue","thread"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER},{element:"decline",fields:{from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER,path:"message.muc",type:"decline"},{element:"query",namespace:s.NS_MUC_ADMIN,path:"iq.muc",type:"user-list",typeField:"type"},{aliases:[{path:"iq.muc.users",multiple:!0,selector:"user-list"}],element:"item",fields:{affiliation:(0,o.attribute)("affiliation"),jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick"),reason:(0,o.childText)(null,"reason"),role:(0,o.attribute)("role")},namespace:s.NS_MUC_ADMIN},{aliases:["iq.muc.users.actor"],element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_ADMIN},{element:"query",namespace:s.NS_MUC_OWNER,path:"iq.muc",type:"configure",typeField:"type"},{aliases:[{path:"iq.muc.destroy",selector:"configure"}],element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_OWNER},{element:"x",fields:{action:(0,o.staticValue)("invite"),continue:(0,o.booleanAttribute)("continue"),jid:(0,o.JIDAttribute)("jid"),legacyReason:(0,o.text)(),password:(0,o.attribute)("password"),reason:(0,o.attribute)("reason"),thread:(0,o.attribute)("thread")},namespace:s.NS_MUC_DIRECT_INVITE,path:"message.muc",type:"direct-invite",typeOrder:2},{element:"unique",fields:{name:(0,o.text)()},namespace:s.NS_MUC_UNIQUE,path:"iq.muc",type:"unique"},(0,o.extendMessage)({legacyMUC:{exporter:function(e,t,n){var r=n.registry?n.registry.export("message.muc",a(a({},t),{},{type:"direct-invite"})):void 0;r&&e.appendChild(r)},exportOrder:100001,importer:function(e,t){if((0,o.findAll)(e,s.NS_MUC_USER,"x")[0]){var n=(0,o.findAll)(e,s.NS_MUC_DIRECT_INVITE,"x")[0];if(n)return t.registry?t.registry.import(n,a(a({},t),{},{path:"message"})):void 0}},importOrder:-1}})];t.default=u},6012(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:["iq.ibb","message.ibb"],element:"open",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){(0,r.attribute)("stanza").exporter(e,t?"iq":"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"open",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"close",fields:{sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"close",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"data",fields:{data:(0,r.textBuffer)("base64"),seq:(0,r.integerAttribute)("seq"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"data",typeField:"action"}];t.default=a},3057(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o=[{aliases:[{path:"bookmarkStorage",impliedType:!0},{path:"iq.privateStorage.bookmarks",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"storage",namespace:a.NS_BOOKMARKS,type:a.NS_BOOKMARKS,typeField:"itemType"},{aliases:[{path:"bookmarkStorage.rooms",multiple:!0}],element:"conference",fields:{autoJoin:(0,i.booleanAttribute)("autojoin"),jid:(0,i.JIDAttribute)("jid"),name:(0,i.attribute)("name"),nick:(0,i.childText)(null,"nick"),password:(0,i.childText)(null,"password")},namespace:a.NS_BOOKMARKS}];t.default=o},4642(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={element:"query",namespace:n(6519).NS_PRIVATE,path:"iq.privateStorage"};t.default=r},8692(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.command.form"]),(0,r.extendStanzaError)({commandError:(0,r.childEnum)(i.NS_ADHOC_COMMANDS,["bad-action","bad-locale","bad-payload","bad-sessionid","malformed-action","session-expired"])}),{element:"command",fields:{action:(0,r.attribute)("action"),node:(0,r.attribute)("node"),sid:(0,r.attribute)("sessionid"),status:(0,r.attribute)("status")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command"},{element:"actions",fields:{complete:(0,r.childBoolean)(null,"complete"),execute:(0,r.attribute)("execute"),next:(0,r.childBoolean)(null,"next"),prev:(0,r.childBoolean)(null,"prev")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command.availableActions"},{aliases:[{path:"iq.command.notes",multiple:!0}],element:"note",fields:{type:(0,r.attribute)("type"),value:(0,r.text)()},namespace:i.NS_ADHOC_COMMANDS}];t.default=a},6072(e,t,n){"use strict";var r=n(3693);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7930),s=n(6519),u="vcardTemp.records";function c(e,t){return{aliases:[{multiple:!0,path:u}],element:e,fields:{value:(0,o.text)()},namespace:s.NS_VCARD_TEMP,type:t,typeField:"type"}}var l=[{aliases:[{path:"iq.vcard"}],defaultType:s.NS_VCARD_TEMP,element:"vCard",fields:{fullName:(0,o.childText)(null,"FN")},namespace:s.NS_VCARD_TEMP,path:"vcardTemp",type:s.NS_VCARD_TEMP,typeField:"format"},{element:"N",fields:{additional:a(a({},(0,o.childText)(null,"MIDDLE")),{},{order:3}),family:a(a({},(0,o.childText)(null,"FAMILY")),{},{order:1}),given:a(a({},(0,o.childText)(null,"GIVEN")),{},{order:2}),prefix:a(a({},(0,o.childText)(null,"PREFIX")),{},{order:4}),suffix:a(a({},(0,o.childText)(null,"SUFFIX")),{},{order:5})},namespace:s.NS_VCARD_TEMP,path:"vcardTemp.name"},c("NICKNAME","nickname"),c("BDAY","birthday"),c("JABBERID","jid"),c("TZ","timezone"),c("TITLE","title"),c("ROLE","role"),c("URL","url"),c("NOTE","note"),c("SORT-STRING","sort"),c("UID","uid"),c("REV","revision"),c("PRODID","productId"),c("DESC","description"),{aliases:[{multiple:!0,path:u}],element:"EMAIL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["internet","INTERNET"]]),value:(0,o.childText)(null,"USERID")},namespace:s.NS_VCARD_TEMP,type:"email"},{aliases:[{path:u,multiple:!0}],element:"ORG",fields:{units:a(a({},(0,o.multipleChildText)(null,"ORGUNIT")),{},{order:2}),value:a(a({},(0,o.childText)(null,"ORGNAME")),{},{order:1})},namespace:s.NS_VCARD_TEMP,type:"organization",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"ADR",fields:{city:(0,o.childText)(null,"LOCALITY"),code:(0,o.childText)(null,"PCODE"),country:(0,o.childText)(null,"CTRY"),pobox:(0,o.childText)(null,"POBOX"),preferred:(0,o.childBoolean)(null,"PREF"),region:(0,o.childText)(null,"REGION"),street:(0,o.childText)(null,"STREET"),street2:(0,o.childText)(null,"EXTADD"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["domestic","DOM"],["international","INTL"],["postal","POSTAL"],["parcel","PARCEL"]])},namespace:s.NS_VCARD_TEMP,type:"address",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LABEL",fields:{lines:(0,o.multipleChildText)(null,"LINE"),preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"]])},namespace:s.NS_VCARD_TEMP,type:"addressLabel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"TEL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["cell","CELL"],["fax","FAX"],["voice","VOICE"],["msg","MSG"]]),value:(0,o.childText)(null,"NUMBER","",!0)},namespace:s.NS_VCARD_TEMP,type:"tel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"PHOTO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"photo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LOGO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"logo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"CATEGORIES",fields:{value:(0,o.multipleChildText)(null,"KEYWORD")},namespace:s.NS_VCARD_TEMP,type:"categories",typeField:"type"}];t.default=l},431(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.search.form"]),(0,r.addAlias)(i.NS_RSM,"set",["iq.search.paging"]),{element:"query",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH,path:"iq.search"},{aliases:[{path:"iq.search.items",multiple:!0}],element:"item",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),jid:(0,r.JIDAttribute)("jid"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH}];t.default=a},3939(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:["iq.pubsub.paging"],element:"set",fields:{after:(0,r.childText)(null,"after"),before:(0,r.childText)(null,"before"),count:(0,r.childInteger)(null,"count"),first:(0,r.childText)(null,"first"),firstIndex:(0,r.childIntegerAttribute)(null,"first","index"),index:(0,r.childInteger)(null,"index"),last:(0,r.childText)(null,"last"),max:(0,r.childInteger)(null,"max")},namespace:i.NS_RSM,path:"paging"};t.default=a},7363(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2354),a=n(7930),o=n(6519),s={configurable:(0,a.childBoolean)(null,"subscribe-options"),configurationRequired:(0,a.deepChildBoolean)([{namespace:null,element:"subscribe-options"},{namespace:null,element:"required"}]),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),state:(0,a.attribute)("subscription"),subid:(0,a.attribute)("subid")},u={node:(0,a.attribute)("node")},c=[{aliases:["pubsub","iq.pubsub","message.pubsub"],childrenExportOrder:{configure:0,create:100,publish:100,subscribe:100,subscriptionOptions:0},defaultType:"user",element:"pubsub",fields:{publishOptions:(0,a.splicePath)(null,"publish-options","dataform")},namespace:o.NS_PUBSUB,type:"user",typeField:"context"},{aliases:["pubsub","iq.pubsub","message.pubsub"],defaultType:"user",element:"pubsub",fields:{purge:(0,a.childAttribute)(null,"purge","node")},namespace:o.NS_PUBSUB_OWNER,type:"owner",typeField:"context"},(0,a.addAlias)(o.NS_DATAFORM,"x",["iq.pubsub.configure.form","iq.pubsub.defaultConfiguration.form","iq.pubsub.defaultSubscriptionOptions.form","iq.pubsub.subscriptionOptions.form","message.pubsub.configuration.form"]),(0,a.addAlias)(o.NS_RSM,"set",["iq.pubsub.fetch.paging"]),(0,a.extendStanzaError)({pubsubError:(0,a.childEnum)(o.NS_PUBSUB_ERRORS,Object.values(i.PubsubErrorCondition)),pubsubUnsupportedFeature:(0,a.childAttribute)(o.NS_PUBSUB_ERRORS,"unsupported","feature")}),{element:"subscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscribe"},{element:"unsubscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.unsubscribe"},{element:"options",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscriptionOptions"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"user",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"owner",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.subscription",selector:"owner"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB},{aliases:[{path:"iq.pubsub.subscription",selector:"user"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"user"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.affiliations",selector:"user",impliedType:!0},{path:"message.pubsub.affiliations",selector:"user",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.affiliations",selector:"owner",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"user"},{impliedType:!0,multiple:!0,path:"message.pubsub.affiliations.items",selector:"user"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"owner"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{element:"create",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.create"},{aliases:[{path:"iq.pubsub.destroy",selector:"owner"}],element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_OWNER},{aliases:[{path:"iq.pubsub.configure",selector:"owner",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.configure",selector:"user",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB,type:"user"},{element:"default",fields:{node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.defaultSubscriptionOptions"},{element:"default",fields:{},namespace:o.NS_PUBSUB_OWNER,path:"iq.pubsub.defaultConfiguration"},{element:"publish",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.publish"},{element:"retract",fields:{id:(0,a.childAttribute)(null,"item","id"),node:(0,a.attribute)("node"),notify:(0,a.booleanAttribute)("notify")},namespace:o.NS_PUBSUB,path:"iq.pubsub.retract"},{element:"items",fields:{max:(0,a.integerAttribute)("max_items"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.fetch"},{aliases:["pubsubitem","iq.pubsub.publish.item",{multiple:!0,path:"iq.pubsub.fetch.items"}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB},{element:"event",fields:{eventType:(0,a.childEnum)(null,["purge","delete","subscription","configuration","items"])},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub",type:"event",typeField:"context"},{aliases:[{path:"message.pubsub.items.published",multiple:!0}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB_EVENT,path:"pubsubeventitem"},{element:"purge",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.purge"},{element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.delete"},{aliases:[{path:"message.pubsub.subscription",selector:"event",impliedType:!0}],element:"subscription",fields:{expires:(r="expiry",{importer:function(e){var t=e.getAttribute(r);return"presence"===t?t:t?new Date(t):void 0},exporter:function(e,t){var n;n="string"==typeof t?t:t.toISOString(),e.setAttribute(r,n)}}),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid"),type:(0,a.attribute)("subscription")},namespace:o.NS_PUBSUB_EVENT,type:"event"},{element:"configuration",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.configuration"},{element:"items",fields:{node:(0,a.attribute)("node"),retracted:(0,a.multipleChildAttribute)(null,"retract","id")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.items"}];t.default=c},9424(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"query",fields:{activate:(0,r.childText)(null,"activate"),address:(0,r.attribute)("dstaddr"),candidateUsed:(0,r.childJIDAttribute)(null,"streamhost-used","jid"),mode:(0,r.attribute)("mode","tcp"),sid:(0,r.attribute)("sid"),udpSuccess:(0,r.childAttribute)(null,"udpsuccess","dstaddr")},namespace:i.NS_SOCKS5,path:"iq.socks5"},{aliases:[{multiple:!0,path:"iq.socks5.candidates"}],element:"streamhost",fields:{host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),uri:(0,r.attribute)("uri")},namespace:i.NS_SOCKS5}];t.default=a},8729(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:[{multiple:!0,path:"message.links"}],element:"x",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB},{element:"query",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB_TRANSFER,path:"iq.transferLink"}];t.default=a},1426(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"html",fields:{alternateLanguageBodies:(0,r.childAlternateLanguageRawElement)(i.NS_XHTML,"body","xhtmlim"),body:(0,r.childLanguageRawElement)(i.NS_XHTML,"body","xhtmlim")},namespace:i.NS_XHTML_IM,path:"message.html"};t.default=a},5735(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendStreamFeatures)({inbandRegistration:(0,r.childBoolean)(i.NS_INBAND_REGISTRATION,"register")}),(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.account.form"]),(0,r.addAlias)(i.NS_OOB,"x",["iq.account.registrationLink"]),{element:"query",fields:{address:(0,r.childText)(null,"address"),date:(0,r.childDate)(null,"date"),email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),fullName:(0,r.childText)(null,"name"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),key:(0,r.childText)(null,"key"),locality:(0,r.childText)(null,"city"),misc:(0,r.childText)(null,"misc"),nick:(0,r.childText)(null,"nick"),password:(0,r.childText)(null,"password"),phone:(0,r.childText)(null,"phone"),postalCode:(0,r.childText)(null,"zip"),region:(0,r.childText)(null,"state"),registered:(0,r.childBoolean)(null,"registered"),remove:(0,r.childBoolean)(null,"remove"),text:(0,r.childText)(null,"text"),uri:(0,r.childText)(null,"uri"),username:(0,r.childText)(null,"username")},namespace:i.NS_REGISTER,path:"iq.account"}];t.default=a},7165(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o={aliases:[{path:"message.geoloc",impliedType:!0},{path:"dataform.fields.geoloc",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"geoloc",fields:{accuracy:(0,i.childFloat)(null,"accuracy"),altitude:(0,i.childFloat)(null,"alt"),altitudeAccuracy:(0,i.childFloat)(null,"altaccuracy"),area:(0,i.childText)(null,"area"),building:(0,i.childText)(null,"building"),country:(0,i.childText)(null,"country"),countryCode:(0,i.childText)(null,"countrycode"),datum:(0,i.childText)(null,"datum"),description:(0,i.childText)(null,"description"),error:(0,i.childFloat)(null,"error"),floor:(0,i.childText)(null,"floor"),heading:(0,i.childFloat)(null,"bearing"),lang:(0,i.languageAttribute)(),latitude:(0,i.childFloat)(null,"lat"),locality:(0,i.childText)(null,"locality"),longitude:(0,i.childFloat)(null,"lon"),postalCode:(0,i.childText)(null,"postalcode"),region:(0,i.childText)(null,"region"),room:(0,i.childText)(null,"room"),speed:(0,i.childFloat)(null,"speed"),street:(0,i.childText)(null,"street"),text:(0,i.childText)(null,"text"),timestamp:(0,i.childDate)(null,"timestamp"),tzo:(0,i.childTimezoneOffset)(null,"tzo"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_GEOLOC,type:a.NS_GEOLOC};t.default=o},9409(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o=[{aliases:(0,i.pubsubItemContentAliases)(),element:"data",fields:{data:(0,i.textBuffer)("base64")},namespace:a.NS_AVATAR_DATA,path:"avatar",type:a.NS_AVATAR_DATA,typeField:"itemType"},{aliases:[{path:"avatar",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"metadata",namespace:a.NS_AVATAR_METADATA,type:a.NS_AVATAR_METADATA,typeField:"itemType",childrenExportOrder:{versions:1,pointers:2}},{aliases:[{multiple:!0,path:"avatar.versions",selector:a.NS_AVATAR_METADATA}],element:"info",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),uri:(0,i.attribute)("url"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA},{aliases:[{multiple:!0,path:"avatar.pointers",selector:a.NS_AVATAR_METADATA}],element:"pointer",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA}];t.default=o},1522(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2354),i=n(7930),a=n(6519);t.default=(0,i.extendMessage)({chatState:(0,i.childEnum)(a.NS_CHAT_STATES,Object.values(r.ChatState))})},386(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"query",fields:{name:(0,r.childText)(null,"name"),os:(0,r.childText)(null,"os"),version:(0,r.childText)(null,"version")},namespace:i.NS_VERSION,path:"iq.softwareVersion"};t.default=a},255(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(2354),a=n(7930),o=n(6519),s={aliases:[{path:"message.mood",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"mood",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text"),value:(0,a.childEnum)(null,i.USER_MOODS)},namespace:o.NS_MOOD,type:o.NS_MOOD};t.default=s},1142(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(2354),a=n(7930),o=n(6519),s={aliases:[{path:"activity",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"activity",fields:{activity:(0,a.childDoubleEnum)(null,i.USER_ACTIVITY_GENERAL,i.USER_ACTIVITY_SPECIFIC),alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text")},namespace:o.NS_ACTIVITY,type:o.NS_ACTIVITY};t.default=s},5903(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"handshake",fields:{value:(0,r.textBuffer)("hex")},namespace:i.NS_COMPONENT,path:"handshake"};t.default=a},1288(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:[{path:"presence.legacyCapabilities",multiple:!0},{path:"features.legacyCapabilities",multiple:!0}],element:"c",fields:{algorithm:(0,r.attribute)("hash"),legacy:(0,r.staticValue)(!0),node:(0,r.attribute)("node"),value:(0,r.attribute)("ver")},namespace:i.NS_DISCO_LEGACY_CAPS};t.default=a},2451(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o={aliases:[{impliedType:!0,path:"tune"}].concat(r((0,i.pubsubItemContentAliases)())),element:"tune",fields:{artist:(0,i.childText)(null,"artist"),length:(0,i.childInteger)(null,"length"),rating:(0,i.childInteger)(null,"rating"),source:(0,i.childText)(null,"source"),title:(0,i.childText)(null,"title"),track:(0,i.childText)(null,"track"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_TUNE,type:a.NS_TUNE};t.default=o},1440(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"body",fields:{acceptMediaTypes:(0,r.attribute)("accept"),ack:(0,r.integerAttribute)("ack"),authId:(0,r.attribute)("authid"),characterSets:(0,r.attribute)("charsets"),condition:(0,r.attribute)("condition"),from:(0,r.JIDAttribute)("from"),key:(0,r.attribute)("key"),lang:(0,r.languageAttribute)(),maxClientRequests:(0,r.integerAttribute)("requests"),maxHoldOpen:(0,r.integerAttribute)("hold"),maxInactivityTime:(0,r.integerAttribute)("inactivity"),maxSessionPause:(0,r.integerAttribute)("maxpause"),maxWaitTime:(0,r.integerAttribute)("wait"),mediaType:(0,r.attribute)("content"),minPollingInterval:(0,r.integerAttribute)("polling"),newKey:(0,r.attribute)("newkey"),pauseSession:(0,r.integerAttribute)("pause"),report:(0,r.integerAttribute)("report"),rid:(0,r.integerAttribute)("rid"),route:(0,r.attribute)("string"),seeOtherURI:(0,r.childText)(null,"uri"),sid:(0,r.attribute)("sid"),stream:(0,r.attribute)("stream"),time:(0,r.integerAttribute)("time"),to:(0,r.JIDAttribute)("to"),type:(0,r.attribute)("type"),version:(0,r.attribute)("ver"),xmppRestart:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restart",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppRestartLogic:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restartlogic",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppVersion:(0,r.namespacedAttribute)("xmpp",i.NS_BOSH_XMPP,"version")},namespace:i.NS_BOSH,path:"bosh"};t.default=a},8578(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),(0,r.extendPresence)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),{element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_SHIM,path:"header"}];t.default=a},8777(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"compression",fields:{methods:(0,r.multipleChildText)(null,"method")},namespace:i.NS_COMPRESSION_FEATURE,path:"features.compression"},{element:"compress",fields:{method:(0,r.childText)(null,"method")},namespace:i.NS_COMPRESSION,path:"compression",type:"start",typeField:"type"},{aliases:["error.compressionError"],element:"failure",fields:{condition:(0,r.childEnum)(null,["unsupported-method","setup-failed","processing-failed"])},namespace:i.NS_COMPRESSION,path:"compression",type:"failure",typeField:"type"},{element:"compressed",namespace:i.NS_COMPRESSION,path:"compression",type:"success",typeField:"type"}];t.default=a},9017(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=["dataformLayout",{multiple:!0,path:"dataformLayout.contents"},{multiple:!0,path:"dataform.layout.contents"}],o=[{aliases:[{multiple:!0,path:"dataform.layout"}],element:"page",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT},{aliases:a,element:"section",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT,type:"section",typeField:"type"},{aliases:a,element:"text",fields:{value:(0,r.text)()},namespace:i.NS_DATAFORM_LAYOUT,type:"text",typeField:"type"},{aliases:a,element:"fieldref",fields:{field:(0,r.attribute)("var")},namespace:i.NS_DATAFORM_LAYOUT,type:"fieldref",typeField:"type"},{aliases:a,element:"reportedref",namespace:i.NS_DATAFORM_LAYOUT,type:"reportedref",typeField:"type"}];t.default=o},4262(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),(0,r.extendIQ)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),{element:"item",fields:{action:(0,r.attribute)("action"),groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name")},namespace:i.NS_ROSTER_EXCHANGE,path:"rosterExchange"}];t.default=a},5530(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519);t.default=(0,r.extendPresence)({vcardAvatar:{importer:function(e){var t=(0,r.findAll)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(t.length){var n=(0,r.findAll)(t[0],i.NS_VCARD_TEMP_UPDATE,"photo");return!n.length||n[0].getText()}},exporter:function(e,t){var n=(0,r.findOrCreate)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(""===t)(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo");else{if(!0===t)return;t&&(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo").children.push(t)}}}})},6495(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")}),(0,r.extendIQ)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")})];t.default=a},4062(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2354),i=n(7930),a=n(6519),o=[(0,i.extendStanzaError)({jingleError:(0,i.childEnum)(a.NS_JINGLE_ERRORS_1,Object.values(r.JingleErrorCondition))}),{element:"jingle",fields:{action:(0,i.attribute)("action"),initiator:(0,i.JIDAttribute)("initiator"),responder:(0,i.JIDAttribute)("responder"),sid:(0,i.attribute)("sid")},namespace:a.NS_JINGLE_1,path:"iq.jingle"},{aliases:[{multiple:!0,path:"iq.jingle.contents"}],element:"content",fields:{creator:(0,i.attribute)("creator"),disposition:(0,i.attribute)("disposition","session"),name:(0,i.attribute)("name"),senders:(0,i.attribute)("senders","both")},namespace:a.NS_JINGLE_1},{element:"reason",fields:{alternativeSession:(0,i.childText)(null,"alternative-session"),condition:(0,i.childEnum)(null,Object.values(r.JingleReasonCondition)),text:(0,i.childText)(null,"text")},namespace:a.NS_JINGLE_1,path:"iq.jingle.reason"}];t.default=o},7805(e,t,n){"use strict";var r=n(3693);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var u=n(2354),c=n(7930),l=n(6519);function f(){return{importer:function(e,t){var n,r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb"),i=(0,c.attribute)("type").importer,a=(0,c.attribute)("subtype").importer,s=(0,c.attribute)("value").importer,u=[],f=o(r);try{for(f.s();!(n=f.n()).done;){var d=n.value,p=i(d,t),h=a(d,t);u.push(h?{type:p,parameter:h}:{type:p})}}catch(e){f.e(e)}finally{f.f()}var v,m=o(r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int"));try{for(m.s();!(v=m.n()).done;){var g=s(v.value,t);u.push(g?{type:"trr-int",parameter:g}:{type:"trr-int"})}}catch(e){m.e(e)}finally{m.f()}return u},exporter:function(e,t,n){var r,i=(0,c.attribute)("type").exporter,a=(0,c.attribute)("subtype").exporter,s=(0,c.attribute)("value").exporter,u=o(t);try{for(u.s();!(r=u.n()).done;){var f=r.value,d=void 0;"trr-int"===f.type?(d=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int",n.namespace,e),f.parameter&&s(d,f.parameter,n)):(i(d=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb",n.namespace,e),f.type,n),f.parameter&&a(d,f.parameter,n)),e.appendChild(d)}}catch(e){u.e(e)}finally{u.f()}}}}var d="iq.jingle.info",p=[{aliases:["iq.jingle.contents.application"],childrenExportOrder:{codecs:4,encryption:5,headerExtensions:6,sourceGroups:8,sources:7,streams:9},element:"description",fields:{media:(0,c.attribute)("media"),rtcpFeedback:a(a({},f()),{},{exportOrder:3}),rtcpMux:a(a({},(0,c.childBoolean)(null,"rtcp-mux")),{},{exportOrder:1}),rtcpReducedSize:a(a({},(0,c.childBoolean)(null,"rtcp-reduced-size")),{},{exportOrder:2}),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_1,optionalNamespaces:{rtcpf:l.NS_JINGLE_RTP_RTCP_FB_0,rtph:l.NS_JINGLE_RTP_HDREXT_0},type:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.headerExtensions",selector:l.NS_JINGLE_RTP_1}],element:"rtp-hdrext",fields:{id:(0,c.integerAttribute)("id"),senders:(0,c.attribute)("senders"),uri:(0,c.attribute)("uri")},namespace:l.NS_JINGLE_RTP_HDREXT_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.codecs",selector:l.NS_JINGLE_RTP_1},"rtpcodec"],element:"payload-type",fields:{channels:(0,c.integerAttribute)("channels"),clockRate:(0,c.integerAttribute)("clockrate"),id:(0,c.attribute)("id"),maxptime:(0,c.integerAttribute)("maxptime"),name:(0,c.attribute)("name"),parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_1,"parameter","name","value"),ptime:(0,c.integerAttribute)("ptime"),rtcpFeedback:f()},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sources",selector:l.NS_JINGLE_RTP_1}],element:"source",fields:{parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_SSMA_0,"parameter","name","value"),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sourceGroups",selector:l.NS_JINGLE_RTP_1}],element:"ssrc-group",fields:{semantics:(0,c.attribute)("semantics"),sources:(0,c.multipleChildAttribute)(null,"source","ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.streams",selector:l.NS_JINGLE_RTP_1}],element:"stream",fields:{id:(0,c.attribute)("id"),track:(0,c.attribute)("track")},namespace:l.NS_JINGLE_RTP_MSID_0},{aliases:[{path:"iq.jingle.contents.application.encryption",selector:l.NS_JINGLE_RTP_1}],element:"encryption",fields:{required:(0,c.booleanAttribute)("required")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.encryption.sdes",selector:l.NS_JINGLE_RTP_1}],element:"crypto",fields:{cryptoSuite:(0,c.attribute)("crypto-suite"),keyParameters:(0,c.attribute)("key-params"),sessionParameters:(0,c.attribute)("session-params"),tag:(0,c.integerAttribute)("tag")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{path:"iq.jingle.contents.application.encryption.zrtp",selector:l.NS_JINGLE_RTP_1}],element:"zrtp-hash",fields:{value:(0,c.textBuffer)("hex"),version:(0,c.attribute)("version")},namespace:l.NS_JINGLE_RTP_1},{element:"mute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_MUTE},{element:"unmute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_UNMUTE},{element:"hold",namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_HOLD},{element:"unhold",namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_UNHOLD},{element:"active",namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_ACTIVE},{element:"ringing",namespace:l.NS_JINGLE_RTP_INFO_1,path:d,type:u.JINGLE_INFO_RINGING}];t.default=p},2507(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({nick:(0,r.childText)(i.NS_NICK,"nick")}),(0,r.extendPresence)({nick:(0,r.childText)(i.NS_NICK,"nick")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"nick",fields:{nick:(0,r.text)()},namespace:i.NS_NICK,type:i.NS_NICK}];t.default=a},9151(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519),o=function(e){return[{element:"transport",fields:{gatheringComplete:(0,i.childBoolean)(null,"gathering-complete"),password:(0,i.attribute)("pwd"),usernameFragment:(0,i.attribute)("ufrag")},namespace:e,path:"iq.jingle.contents.transport",type:e,typeField:"transportType"},{aliases:[{impliedType:!0,path:"iq.jingle.contents.transport.remoteCandidate",selector:e}],element:"remote-candidate",fields:{component:(0,i.integerAttribute)("component"),ip:(0,i.attribute)("ip"),port:(0,i.integerAttribute)("port")},namespace:e,type:e,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:e}],element:"candidate",fields:{component:(0,i.integerAttribute)("component"),foundation:(0,i.attribute)("foundation"),generation:(0,i.integerAttribute)("generation"),id:(0,i.attribute)("id"),ip:(0,i.attribute)("ip"),network:(0,i.integerAttribute)("network"),port:(0,i.integerAttribute)("port"),priority:(0,i.integerAttribute)("priority"),protocol:(0,i.attribute)("protocol"),relatedAddress:(0,i.attribute)("rel-addr"),relatedPort:(0,i.attribute)("rel-port"),tcpType:(0,i.attribute)("tcptype"),type:(0,i.attribute)("type")},namespace:e,type:e,typeField:"transportType"}]},s=[].concat(r(o(a.NS_JINGLE_ICE_0)),r(o(a.NS_JINGLE_ICE_UDP_1)));t.default=s},4792(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"transport",fields:{gatheringComplete:(0,r.childBoolean)(null,"gathering-complete"),password:(0,r.attribute)("pwd"),usernameFragment:(0,r.attribute)("ufrag")},namespace:i.NS_JINGLE_RAW_UDP_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_RAW_UDP_1}],element:"candidate",fields:{component:(0,r.integerAttribute)("component"),foundation:(0,r.attribute)("foundation"),generation:(0,r.integerAttribute)("generation"),id:(0,r.attribute)("id"),ip:(0,r.attribute)("ip"),port:(0,r.integerAttribute)("port"),type:(0,r.attribute)("type")},namespace:i.NS_JINGLE_RAW_UDP_1,type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"}];t.default=a},9514(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"request",namespace:i.NS_RECEIPTS,path:"message.receipt",type:"request",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_RECEIPTS,path:"message.receipt",type:"received",typeField:"type"}];t.default=a},1296(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"invisible",fields:{probe:(0,r.booleanAttribute)("probe")},namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"invisible",typeField:"type"},{element:"visible",namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"visible"}];t.default=a},4604(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendStanzaError)({blocked:(0,r.childBoolean)(i.NS_BLOCKING_ERRORS,"blocked")}),{element:"blocklist",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"list",typeField:"action"},{element:"block",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"block",typeField:"action"},{element:"unblock",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"unblock",typeField:"action"}];t.default=a},6667(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendStreamFeatures)({streamManagement:(0,r.childBoolean)(i.NS_SMACKS_3,"sm")}),{element:"a",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"ack",typeField:"type"},{element:"r",namespace:i.NS_SMACKS_3,path:"sm",type:"request",typeField:"type"},{element:"enable",fields:{allowResumption:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enable",typeField:"type"},{element:"enabled",fields:{id:(0,r.attribute)("id"),resume:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enabled",typeField:"type"},{element:"resume",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resume",typeField:"type"},{element:"resumed",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resumed",typeField:"type"},{element:"failed",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"failed",typeField:"type"}];t.default=a},996(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519);t.default=(0,r.extendIQ)({ping:(0,r.childBoolean)(i.NS_PING,"ping")})},565(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"time",fields:{tzo:(0,r.childTimezoneOffset)(null,"tzo"),utc:(0,r.childDate)(null,"utc")},namespace:i.NS_TIME,path:"iq.time"};t.default=a},9846(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:["message.delay","presence.delay"],element:"delay",fields:{from:(0,r.JIDAttribute)("from"),reason:(0,r.text)(),timestamp:(0,r.dateAttribute)("stamp")},namespace:i.NS_DELAY};t.default=a},7334(e,t,n){"use strict";var r=n(5715);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(7930),a=n(6519),o={2:a.NS_DISCO_EXTERNAL_2,1:a.NS_DISCO_EXTERNAL_1},s=[],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],d=l[1];s.push({aliases:["iq.externalServiceCredentials"],defaultType:"2",element:"credentials",fields:{expires:(0,i.childDateAttribute)(null,"service","expires"),host:(0,i.childAttribute)(null,"service","host"),name:(0,i.childAttribute)(null,"service","name"),password:(0,i.childAttribute)(null,"service","password"),port:(0,i.childIntegerAttribute)(null,"service","port"),restricted:(0,i.childBooleanAttribute)(null,"service","restricted"),transport:(0,i.childAttribute)(null,"service","transport"),type:(0,i.childAttribute)(null,"service","type"),username:(0,i.childAttribute)(null,"service","username")},namespace:d,type:f,typeField:"version"},{aliases:["iq.externalServices"],defaultType:"2",element:"services",fields:{type:(0,i.attribute)("type")},namespace:d,type:f,typeField:"version"},{aliases:[{path:"iq.externalServices.services",multiple:!0}],defaultType:"2",element:"service",fields:{expires:(0,i.dateAttribute)("expires"),host:(0,i.attribute)("host"),name:(0,i.attribute)("name"),password:(0,i.attribute)("password"),port:(0,i.integerAttribute)("port"),restricted:(0,i.booleanAttribute)("restricted"),transport:(0,i.attribute)("transport"),type:(0,i.attribute)("type"),username:(0,i.attribute)("username")},namespace:d,type:f,typeField:"version"})}t.default=s},7274(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"media",fields:{height:(0,r.integerAttribute)("height"),width:(0,r.integerAttribute)("width")},namespace:i.NS_DATAFORM_MEDIA,path:"dataform.fields.media"},{aliases:[{multiple:!0,path:"dataform.fields.media.sources"}],element:"uri",fields:{mediaType:(0,r.attribute)("type"),uri:(0,r.text)()},namespace:i.NS_DATAFORM_MEDIA}];t.default=a},5413(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519);t.default=(0,r.extendMessage)({requestingAttention:(0,r.childBoolean)(i.NS_ATTENTION_0,"attention")})},2251(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:["iq.bits",{path:"message.bits",multiple:!0},{path:"presence.bits",multiple:!0},{path:"iq.jingle.bits",multiple:!0}],element:"data",fields:{cid:(0,r.attribute)("cid"),data:(0,r.textBuffer)("base64"),maxAge:(0,r.integerAttribute)("max-age"),mediaType:(0,r.attribute)("type")},namespace:i.NS_BOB};t.default=a},9848(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_HASHES_2,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_1,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_2,"hash-used",[{path:"file.hashesUsed",multiple:!0}]),(0,r.addAlias)(i.NS_THUMBS_1,"thumbnail",[{path:"file.thumbnails",multiple:!0}])],o=0,s=[i.NS_JINGLE_FILE_TRANSFER_4,i.NS_JINGLE_FILE_TRANSFER_5];o<s.length;o++){var u=s[o];a=a.concat([{aliases:["file",{impliedType:!0,path:"iq.jingle.contents.application.file",selector:u},{impliedType:!0,path:"iq.jingle.info.file",selector:"{".concat(u,"}checksum")}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"file",fields:{date:(0,r.childDate)(null,"date"),description:(0,r.childText)(null,"desc"),mediaType:(0,r.childText)(null,"media-type"),name:(0,r.childText)(null,"name"),size:(0,r.childInteger)(null,"size")},namespace:u,type:u,typeField:"version"},{aliases:[{impliedType:!0,path:"file.range",selector:u}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"range",fields:{length:(0,r.integerAttribute)("length"),offset:(0,r.integerAttribute)("offset",0)},namespace:u,type:u,typeField:"version"},{element:"description",namespace:u,path:"iq.jingle.contents.application",type:u,typeField:"applicationType"},{element:"received",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}received"),typeField:"infoType"},{element:"checksum",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}checksum"),typeField:"infoType"}])}t.default=a},2094(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6519),i={element:"description",namespace:r.NS_JINGLE_XML_0,path:"iq.jingle.contents.application",type:r.NS_JINGLE_XML_0,typeField:"applicationType"};t.default=i},3813(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"transport",fields:{activated:(0,r.childAttribute)(null,"activated","cid"),address:(0,r.attribute)("dstaddr"),candidateError:(0,r.childBoolean)(null,"candidate-error"),candidateUsed:(0,r.childAttribute)(null,"candidate-used","cid"),mode:(0,r.attribute)("mode","tcp"),proxyError:(0,r.childBoolean)(null,"proxy-error"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_SOCKS5_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_SOCKS5_1,typeField:"transportType"},{aliases:[{multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_SOCKS5_1}],element:"candidate",fields:{cid:(0,r.attribute)("cid"),host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),priority:(0,r.integerAttribute)("priority"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_JINGLE_SOCKS5_1}];t.default=a},4854(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"transport",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){!1===t&&(0,r.attribute)("stanza").exporter(e,"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_IBB_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_IBB_1,typeField:"transportType"};t.default=a},1065(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_BOB,"data",[{path:"iq.jingle.bits",multiple:!0}]),{element:"thumbnail",fields:{height:(0,r.integerAttribute)("height"),mediaType:(0,r.attribute)("media-type"),uri:(0,r.attribute)("uri"),width:(0,r.integerAttribute)("width")},namespace:i.NS_THUMBS_1,path:"thumbnail"}];t.default=a},4971(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_FORWARD_0,"forwarded",["message.carbon.forward"]),{element:"enable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"enable",typeField:"action"},{element:"disable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"disable",typeField:"action"},{element:"sent",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"sent",typeField:"type"},{element:"received",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"received",typeField:"type"}];t.default=a},9263(e,t,n){"use strict";var r=n(1132);Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(2354),o=n(6519),s=[].concat(r(Object.values(a.StreamType).map(function(e){return(0,i.addAlias)(e,"message",["forward.message"])})),r(Object.values(a.StreamType).map(function(e){return(0,i.addAlias)(e,"presence",["forward.presence"])})),r(Object.values(a.StreamType).map(function(e){return(0,i.addAlias)(e,"iq",["forward.iq"])})),[(0,i.addAlias)(o.NS_DELAY,"delay",["forward.delay"]),{aliases:["message.forward"],element:"forwarded",namespace:o.NS_FORWARD_0,path:"forward"}]);t.default=s},6916(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{defaultType:"2",element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("base64"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hash",type:"2",typeField:"version"},{element:"hash-used",fields:{algorithm:(0,r.attribute)("algo"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hashUsed"},{element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("hex"),version:(0,r.staticValue)("1")},namespace:i.NS_HASHES_1,path:"hash",type:"1",typeField:"version"}];t.default=a},6443(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"rtt",fields:{event:(0,r.attribute)("event","edit"),id:(0,r.attribute)("id"),seq:(0,r.integerAttribute)("seq")},namespace:i.NS_RTT_0,path:"message.rtt"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"t",fields:{position:(0,r.integerAttribute)("p"),text:(0,r.text)()},namespace:i.NS_RTT_0,type:"insert",typeField:"type"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"e",fields:{length:(0,r.integerAttribute)("n",1),position:(0,r.integerAttribute)("p")},namespace:i.NS_RTT_0,type:"erase",typeField:"type"},{aliases:[{multiple:!0,path:"message.rtt.actions"}],element:"w",fields:{duration:(0,r.integerAttribute)("n",0)},namespace:i.NS_RTT_0,type:"wait",typeField:"type"}];t.default=a},6588(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519);t.default=(0,r.extendMessage)({replace:(0,r.childAttribute)(i.NS_CORRECTION_0,"replace","id")})},9344(e,t,n){"use strict";var r=n(5715);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(7930),a=n(6519),o={2:a.NS_MAM_2,1:a.NS_MAM_1},s=[(0,i.addAlias)(a.NS_DATAFORM,"x",["iq.archive.form"]),(0,i.addAlias)(a.NS_FORWARD_0,"forwarded",["message.archive.item"]),(0,i.addAlias)(a.NS_RSM,"set",["iq.archive.paging"])],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],d=l[1];s.push({defaultType:"query",defaultVersion:"2",element:"query",fields:{node:(0,i.attribute)("node"),queryId:(0,i.attribute)("queryid")},namespace:d,path:"iq.archive",type:"query",typeField:"type",version:f,versionField:"version"},{element:"fin",fields:{complete:(0,i.booleanAttribute)("complete"),stable:(0,i.booleanAttribute)("stable")},namespace:d,path:"iq.archive",type:"result",version:f},{element:"prefs",fields:{default:(0,i.attribute)("default"),always:(0,i.deepMultipleChildText)([{namespace:null,element:"always"},{namespace:null,element:"jid"}]),never:(0,i.deepMultipleChildText)([{namespace:null,element:"never"},{namespace:null,element:"jid"}])},namespace:d,path:"iq.archive",type:"preferences",version:f},{element:"result",defaultType:"2",fields:{id:(0,i.attribute)("id"),queryId:(0,i.attribute)("queryid")},namespace:d,path:"message.archive",type:f,typeField:"version"})}t.default=s},1564(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendPresence)({hats:(0,r.splicePath)(i.NS_HATS_0,"hats","hat",!0)}),{element:"hat",fields:{id:(0,r.attribute)("name"),name:(0,r.attribute)("displayName")},namespace:i.NS_HATS_0,path:"hat"}];t.default=a},1778(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519);t.default=(0,r.extendPresence)({idleSince:(0,r.childDate)(i.NS_IDLE_1,"since")})},6870(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:[{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_UDP_1},{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_0},{multiple:!0,path:"iq.jingle.contents.application.encryption.dtls",selector:i.NS_JINGLE_RTP_1}],element:"fingerprint",fields:{algorithm:(0,r.attribute)("hash"),setup:(0,r.attribute)("setup"),value:(0,r.text)()},namespace:i.NS_JINGLE_DTLS_0};t.default=a},8470(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a="message.marker",o=[{element:"markable",namespace:i.NS_CHAT_MARKERS_0,path:a,type:"markable",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"received"},{element:"displayed",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"displayed"},{element:"acknowledged",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"acknowledged"}];t.default=o},4983(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7930),a=n(6519);t.default=(0,i.extendMessage)({processingHints:{importer:function(e){var t,n={},i=!1,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}(e.children);try{for(o.s();!(t=o.n()).done;){var s=t.value;if("string"!=typeof s&&s.getNamespace()===a.NS_HINTS)switch(s.getName()){case"no-copy":n.noCopy=!0,i=!0;break;case"no-permanent-store":n.noPermanentStore=!0,i=!0;break;case"no-store":n.noStore=!0,i=!0;break;case"store":n.store=!0,i=!0}}}catch(e){o.e(e)}finally{o.f()}return i?n:void 0},exporter:function(e,t,n){t.noCopy&&e.appendChild((0,i.createElement)(a.NS_HINTS,"no-copy",n.namespace,e)),t.noPermanentStore&&e.appendChild((0,i.createElement)(a.NS_HINTS,"no-permanent-store",n.namespace,e)),t.noStore&&e.appendChild((0,i.createElement)(a.NS_HINTS,"no-store",n.namespace,e)),t.store&&e.appendChild((0,i.createElement)(a.NS_HINTS,"store",n.namespace,e))}}})},6208(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({json:(0,r.childJSON)(i.NS_JSON_0,"json")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"json",fields:{json:(0,r.textJSON)()},namespace:i.NS_JSON_0,type:i.NS_JSON_0},{aliases:[{path:"message.jsonPayloads",multiple:!0}],element:"payload",fields:{type:(0,r.attribute)("datatype"),data:(0,r.childJSON)(i.NS_JSON_0,"json")},namespace:i.NS_JSON_MESSAGE_0}];t.default=a},6571(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:[{path:"iq.jingle.groups",multiple:!0}],element:"group",fields:{contents:(0,r.multipleChildAttribute)(null,"content","name"),semantics:(0,r.attribute)("semantics")},namespace:i.NS_JINGLE_GROUPING_0}];t.default=a},8025(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={aliases:[{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_UDP_1},{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_0}],element:"sctpmap",fields:{port:(0,r.integerAttribute)("number"),protocol:(0,r.attribute)("protocol"),streams:(0,r.attribute)("streams")},namespace:i.NS_JINGLE_DTLS_SCTP_1};t.default=a},1619(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6519),i=[{element:"active",namespace:r.NS_CSI_0,path:"csi",type:"active",typeField:"state"},{element:"inactive",namespace:r.NS_CSI_0,path:"csi",type:"inactive",typeField:"state"}];t.default=i},4256(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.push.form","pushNotification.form"]),{element:"enable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"enable",typeField:"action"},{element:"disable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"disable",typeField:"action"},{aliases:(0,r.pubsubItemContentAliases)(),element:"notification",namespace:i.NS_PUSH_0,path:"pushNotification",type:i.NS_PUSH_0,typeField:"itemType"}];t.default=a},9118(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendMessage)({originId:(0,r.childAttribute)(i.NS_SID_0,"origin-id","id")}),{aliases:[{path:"message.stanzaIds",multiple:!0}],element:"stanza-id",fields:{by:(0,r.JIDAttribute)("by"),id:(0,r.attribute)("id")},namespace:i.NS_SID_0}];t.default=a},5151(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendStanzaError)({httpUploadError:(0,r.childEnum)(i.NS_HTTP_UPLOAD_0,["file-too-large","retry"]),httpUploadMaxFileSize:(0,r.deepChildInteger)([{namespace:i.NS_HTTP_UPLOAD_0,element:"file-too-large"},{namespace:i.NS_HTTP_UPLOAD_0,element:"max-file-size"}]),httpUploadRetry:(0,r.childDateAttribute)(i.NS_HTTP_UPLOAD_0,"retry","stamp")}),{element:"request",fields:{mediaType:(0,r.attribute)("content-type"),name:(0,r.attribute)("filename"),size:(0,r.integerAttribute)("size")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"request",typeField:"type"},{element:"slot",fields:{download:(0,r.childAttribute)(null,"get","url")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"slot"},{aliases:[{path:"iq.httpUpload.upload",selector:"slot"}],element:"put",fields:{url:(0,r.attribute)("url")},namespace:i.NS_HTTP_UPLOAD_0},{aliases:[{path:"iq.httpUpload.upload.headers",multiple:!0}],element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_HTTP_UPLOAD_0}];t.default=a},4396(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a={element:"encryption",fields:{id:(0,r.attribute)("namespace"),name:(0,r.attribute)("name")},namespace:i.NS_EME_0,path:"message.encryptionMethod"};t.default=a},2176(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{aliases:["message.omemo"],element:"encrypted",fields:{payload:(0,r.childTextBuffer)(null,"payload","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo"},{element:"header",fields:{iv:(0,r.childTextBuffer)(null,"iv","base64"),sid:(0,r.integerAttribute)("sid")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo.header"},{aliases:[{path:"omemo.header.keys",multiple:!0}],element:"key",fields:{preKey:(0,r.booleanAttribute)("prekey"),rid:(0,r.integerAttribute)("rid"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL},{aliases:(0,r.pubsubItemContentAliases)(),element:"list",fields:{devices:(0,r.multipleChildIntegerAttribute)(null,"device","id")},namespace:i.NS_OMEMO_AXOLOTL,type:i.NS_OMEMO_AXOLOTL_DEVICELIST,typeField:"itemType"},{element:"preKeyPublic",fields:{id:(0,r.integerAttribute)("preKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoPreKey"},{element:"signedPreKeyPublic",fields:{id:(0,r.integerAttribute)("signedPreKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice.signedPreKeyPublic"},{aliases:(0,r.pubsubItemContentAliases)(),element:"bundle",fields:{identityKey:(0,r.childTextBuffer)(null,"identityKey","base64"),preKeys:(0,r.splicePath)(null,"prekeys","omemoPreKey",!0),signedPreKeySignature:(0,r.childTextBuffer)(null,"signedPreKeySignature","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice",type:i.NS_OMEMO_AXOLOTL_BUNDLES,typeField:"itemType"}];t.default=a},8428(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[(0,r.extendPresence)({occupantId:(0,r.childAttribute)(i.NS_OCCUPANT_0,"occupant-id","id")}),(0,r.extendMessage)({occupantId:(0,r.childAttribute)(i.NS_OCCUPANT_0,"occupant-id","id")})];t.default=a},4218(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7930),i=n(6519),a=[{element:"XRD",fields:{subject:(0,r.childText)(null,"Subject")},namespace:i.NS_XRD,path:"xrd"},{aliases:[{path:"xrd.links",multiple:!0}],element:"Link",fields:{href:(0,r.attribute)("href"),rel:(0,r.attribute)("rel"),type:(0,r.attribute)("type")},namespace:i.NS_XRD}];t.default=a},1284(e,t,n){"use strict";var r=n(5715),i=n(8452),a=n(3072),o=n(9511),s=n(4756),u=n(9293),c=n(7383),l=n(4579),f=n(3693);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return t=a(t),i(e,v()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var m=n(2354),g=n(2208),y=n(7930),b=n(9978),S=function(){return l(function e(t){c(this,e),f(this,"rid",void 0),f(this,"maxTimeout",void 0),f(this,"active",!1),f(this,"stream",void 0),f(this,"maxRetries",5),this.stream=t,this.maxTimeout=1100*this.stream.maxWaitTime},[{key:"send",value:(e=u(s.mark(function e(t,n){var r,i,a,o,u;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.rid=t,this.active=!0,r=0;case 1:if(!(r<=this.maxRetries)){e.next=11;break}return r+=1,e.prev=2,e.next=3,(0,b.timeoutPromise)((0,g.fetch)(this.stream.url,{body:n,headers:{"Content-Type":this.stream.contentType},method:"POST"}),this.maxTimeout,function(){return new Error("Request timed out")});case 3:if((i=e.sent).ok){e.next=4;break}throw new Error("HTTP Status Error: "+i.status);case 4:return e.next=5,i.text();case 5:return a=e.sent,this.active=!1,e.abrupt("return",a);case 6:if(e.prev=6,u=e.catch(2),1!==r){e.next=7;break}return e.abrupt("continue",1);case 7:if(!(r<this.maxRetries)){e.next=9;break}return o=Math.min(this.maxTimeout,1e3*Math.pow(r,2)),e.next=8,(0,b.sleep)(o+1e3*Math.random());case 8:return e.abrupt("continue",1);case 9:throw this.active=!1,u;case 10:e.next=1;break;case 11:throw new Error("Request failed");case 12:case"end":return e.stop()}},e,this,[[2,6]])})),function(t,n){return e.apply(this,arguments)})}]);var e}(),_=function(e){function t(e,n,r){var i;return c(this,t),i=h(this,t,[{objectMode:!0}]),f(i,"hasStream",void 0),f(i,"stream",void 0),f(i,"authenticated",void 0),f(i,"url",void 0),f(i,"rid",Math.floor(4294967295*Math.random())),f(i,"sid",""),f(i,"maxHoldOpen",2),f(i,"maxWaitTime",30),f(i,"contentType","text/xml; charset=utf-8"),f(i,"channels",[new S(i),new S(i)]),f(i,"activeChannelID",0),f(i,"client",void 0),f(i,"config",void 0),f(i,"sm",void 0),f(i,"stanzas",void 0),f(i,"idleTimeout",void 0),f(i,"queue",[]),f(i,"isEnded",!1),i.client=e,i.sm=n,i.stanzas=r,i.on("data",function(e){i.client.emit("stream:data",e.stanza,e.kind)}),i.on("end",function(){i.isEnded=!0,clearTimeout(i.idleTimeout),i.client.transport===i&&i.client.emit("--transport-disconnected")}),i}return o(t,e),l(t,[{key:"_write",value:function(e,t,n){this.queue.push([e,n]),this.scheduleRequests()}},{key:"_writev",value:function(e,t){this.queue.push([e.map(function(e){return e.chunk}).join(""),t]),this.scheduleRequests()}},{key:"_read",value:function(){}},{key:"process",value:function(e){var t=this,n=new y.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,rootKey:"bosh",wrappedStream:!0});n.on("error",function(e){var n={condition:m.StreamErrorCondition.InvalidXML};return t.client.emit("stream:error",n,e),t.send("error",n),t.disconnect()}),n.on("data",function(e){if("stream-start"===e.event)return t.stream=e.stanza,void("terminate"===e.stanza.type?(t.hasStream=!1,t.rid=void 0,t.sid=void 0,t.isEnded||(t.isEnded=!0,t.client.emit("bosh:terminate",e.stanza),t.client.emit("stream:end"),t.push(null))):t.hasStream||(t.hasStream=!0,t.stream=e.stanza,t.sid=e.stanza.sid||t.sid,t.maxWaitTime=e.stanza.maxWaitTime||t.maxWaitTime,t.client.emit("stream:start",e.stanza)));e.event||t.push({kind:e.kind,stanza:e.stanza})}),this.client.emit("raw","incoming",e),n.write(e),this.scheduleRequests()}},{key:"connect",value:function(e){if(this.config=e,this.url=e.url,e.rid&&(this.rid=e.rid),e.sid&&(this.sid=e.sid),e.wait&&(this.maxWaitTime=e.wait),e.maxHoldOpen&&(this.maxHoldOpen=e.maxHoldOpen),this.sid)return this.hasStream=!0,this.stream={},this.client.emit("connected"),this.client.emit("session:prebind",this.config.jid),void this.client.emit("session:started");this._send({lang:e.lang,maxHoldOpen:this.maxHoldOpen,maxWaitTime:this.maxWaitTime,to:e.server,version:"1.6",xmppVersion:"1.0"})}},{key:"restart",value:function(){this.hasStream=!1,this._send({to:this.config.server,xmppRestart:!0})}},{key:"disconnect",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasStream&&e?this._send({type:"terminate"}):(this.stream=void 0,this.sid=void 0,this.rid=void 0,this.client.emit("--transport-disconnected"))}},{key:"send",value:(a=u(s.mark(function e(t,n){var r,i,a=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&(r=null===(i=this.stanzas.export(t,n))||void 0===i?void 0:i.toString()),r){e.next=1;break}return e.abrupt("return");case 1:return e.abrupt("return",new Promise(function(e,t){a.write(r,"utf8",function(n){return n?t(n):e()})}));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"sendingChannel",get:function(){return this.channels[this.activeChannelID]}},{key:"pollingChannel",get:function(){return this.channels[0===this.activeChannelID?1:0]}},{key:"toggleChannel",value:function(){this.activeChannelID=0===this.activeChannelID?1:0}},{key:"_send",value:(i=u(s.mark(function e(t){var n,r,i,a,o=this,u=arguments;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:"",!this.isEnded){e.next=1;break}return e.abrupt("return");case 1:r=this.rid++,i=this.stanzas.export("bosh",p(p({},t),{},{rid:r,sid:this.sid})),a=n?[i.openTag(),n,i.closeTag()].join(""):i.toString(),this.client.emit("raw","outgoing",a),this.sendingChannel.send(r,a).then(function(e){o.process(e)}).catch(function(e){o.end(e)}),this.toggleChannel();case 2:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"_poll",value:(n=u(s.mark(function e(){var t,n,r=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isEnded){e.next=1;break}return e.abrupt("return");case 1:t=this.rid++,n=this.stanzas.export("bosh",{rid:t,sid:this.sid}).toString(),this.client.emit("raw","outgoing",n),this.pollingChannel.send(t,n).then(function(e){r.process(e)}).catch(function(e){r.end(e)});case 2:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"scheduleRequests",value:function(){var e=this;clearTimeout(this.idleTimeout),this.idleTimeout=setTimeout(function(){e.fireRequests()},10)}},{key:"fireRequests",value:function(){if(!this.isEnded)if(this.queue.length)if(this.sendingChannel.active)this.scheduleRequests();else{var e=this.queue.shift(),t=r(e,2),n=t[0],i=t[1];this._send({},n),i()}else!this.authenticated||this.channels[0].active||this.channels[1].active||this._poll()}}]);var n,i,a}(g.Duplex);t.default=_},1925(e,t,n){"use strict";var r=n(4756),i=n(9293),a=n(7383),o=n(4579),s=n(8452),u=n(3072),c=n(9511),l=n(3693);function f(e,t,n){return t=u(t),s(e,d()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0});var p=n(2354),h=n(7930),v=n(2208),m=function(e){function t(e,n,r){var i;return a(this,t),i=f(this,t,[{objectMode:!0}]),l(i,"hasStream",void 0),l(i,"stream",void 0),l(i,"client",void 0),l(i,"config",void 0),l(i,"sm",void 0),l(i,"stanzas",void 0),l(i,"closing",void 0),l(i,"parser",void 0),l(i,"socket",void 0),l(i,"disconnectTimeoutId",void 0),i.sm=n,i.stanzas=r,i.closing=!1,i.client=e,i.on("data",function(e){i.client.emit("stream:data",e.stanza,e.kind)}),i.on("error",function(){i.end()}),i.on("end",function(){i.client.transport===i&&i.client.emit("--transport-disconnected")}),i}return c(t,e),o(t,[{key:"_read",value:function(){}},{key:"_write",value:function(e,t,n){if(!this.socket||1!==this.socket.readyState)return n(new Error("Socket closed"));var r=v.Buffer.from(e,"utf8").toString();this.client.emit("raw","outgoing",r),this.socket.send(r),n()}},{key:"connect",value:function(e){var t=this;this.config=e,this.hasStream=!1,this.closing=!1,this.parser=new h.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,wrappedStream:!1}),this.parser.on("data",function(e){var n=e.kind,r=e.stanza;if("stream"===n){if("open"===r.action)return t.hasStream=!0,t.stream=r,t.client.emit("stream:start",r);if("close"===r.action)return t.client.emit("stream:end"),t.disconnect()}t.push({kind:e.kind,stanza:e.stanza})}),this.parser.on("error",function(e){var n={condition:p.StreamErrorCondition.InvalidXML};return t.client.emit("stream:error",n,e),t.write(t.stanzas.export("error",n).toString()),t.disconnect()}),this.socket=new v.WebSocket(e.url,"xmpp"),this.socket.onopen=function(){t.emit("connect"),t.sm.started=!1,t.client.emit("connected"),t.write(t.startHeader())},this.socket.onmessage=function(e){var n=v.Buffer.from(e.data,"utf8").toString();t.client.emit("raw","incoming",n),t.parser&&t.parser.write(n)},this.socket.onclose=function(){t.push(null)},this.socket.onerror=function(e){console.error(e),t.push(null)}}},{key:"disconnect",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.socket&&!this.closing&&this.hasStream&&t?(this.closing=!0,this.write(this.closeHeader()),this.disconnectTimeoutId=setTimeout(function(){e.socket&&e.disconnect(!1)},1e3)):(clearTimeout(this.disconnectTimeoutId),this.hasStream=!1,this.stream=void 0,this.socket&&(this.end(),this.socket.close(),this.client.transport===this&&this.client.emit("--transport-disconnected")),this.socket=void 0)}},{key:"send",value:(n=i(r.mark(function e(t,n){var i,a,o=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&(i=null===(a=this.stanzas.export(t,n))||void 0===a?void 0:a.toString()),i){e.next=1;break}return e.abrupt("return");case 1:return e.abrupt("return",new Promise(function(e,t){o.write(i,"utf8",function(n){return n?t(n):e()})}));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return n.apply(this,arguments)})},{key:"restart",value:function(){this.hasStream=!1,this.write(this.startHeader())}},{key:"startHeader",value:function(){return this.stanzas.export("stream",{action:"open",lang:this.config.lang,to:this.config.server,version:"1.0"}).toString()}},{key:"closeHeader",value:function(){return this.stanzas.export("stream",{action:"close"}).toString()}}]);var n}(v.Duplex);t.default=m},1205(e,t,n){var r=n(4579),i=n(7383),a=n(8452),o=n(3072),s=n(9511),u=n(1837),c=n(3738);function l(e,t,n){return t=o(t),a(e,f()?Reflect.construct(t,n||[],o(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var p,h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y={};!function(e,t){for(var n in t)h(e,n,{get:t[n],enumerable:!0})}(y,{Emitter:function(){return _},MemoryLeakError:function(){return b}}),e.exports=(p=y,function(e,t,n,r){if(t&&"object"===c(t)||"function"==typeof t){var i,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(m(t));try{var o=function(){var n=i.value;g.call(e,n)||void 0===n||h(e,n,{get:function(){return t[n]},enumerable:!(r=v(t,n))||r.enumerable})};for(a.s();!(i=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}return e}(h({},"__esModule",{value:!0}),p));var b=function(e){"use strict";function t(e,n,r){var a;return i(this,t),(a=l(this,t,["Possible EventEmitter memory leak detected. ".concat(r," ").concat(n.toString()," listeners added. Use emitter.setMaxListeners() to increase limit")])).emitter=e,a.type=n,a.count=r,a.name="MaxListenersExceededWarning",a}return s(t,e),r(t)}(u(Error)),S=function(){"use strict";return r(function e(){i(this,e),this.events=new Map,this.maxListeners=S.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1},[{key:"_emitInternalEvent",value:function(e,t,n){this.emit.apply(this,[e].concat([t,n]))}},{key:"_getListeners",value:function(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}},{key:"_removeListener",value:function(e,t){var n=e.indexOf(t);return n>-1&&e.splice(n,1),[]}},{key:"_wrapOnceListener",value:function(e,t){var n=this,r=function(){n.removeListener(e,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return t.apply(n,a)};return Object.defineProperty(r,"name",{value:t.name}),r}},{key:"setMaxListeners",value:function(e){return this.maxListeners=e,this}},{key:"getMaxListeners",value:function(){return this.maxListeners}},{key:"eventNames",value:function(){return Array.from(this.events.keys())}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=this._getListeners(e);return a.forEach(function(e){e.apply(t,r)}),a.length>0}},{key:"addListener",value:function(e,t){this._emitInternalEvent("newListener",e,t);var n=this._getListeners(e).concat(t);if(this.events.set(e,n),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;var r=new b(this,e,this.listenerCount(e));console.warn(r)}return this}},{key:"on",value:function(e,t){return this.addListener(e,t)}},{key:"once",value:function(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}},{key:"prependListener",value:function(e,t){var n=this._getListeners(e);if(n.length>0){var r=[t].concat(n);this.events.set(e,r)}else this.events.set(e,n.concat(t));return this}},{key:"prependOnceListener",value:function(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}},{key:"removeListener",value:function(e,t){var n=this._getListeners(e);return n.length>0&&(this._removeListener(n,t),this.events.set(e,n),this._emitInternalEvent("removeListener",e,t)),this}},{key:"off",value:function(e,t){return this.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){return e?this.events.delete(e):this.events.clear(),this}},{key:"listeners",value:function(e){return Array.from(this._getListeners(e))}},{key:"listenerCount",value:function(e){return this._getListeners(e).length}},{key:"rawListeners",value:function(e){return this.listeners(e)}}],[{key:"listenerCount",value:function(e,t){return e.listenerCount(t)}}])}(),_=S;_.defaultMaxListeners=10},9357(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},u=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var c,l=n(3550);o(n(6341),t);var f=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.peerConnection=t,r.haveConnectionMetrics=!1,r.statsArr=[],c="undefined"!=typeof window,r.session=n.session,r.initiator=n.initiator,r.conference=n.conference,r.statsInterval=1e3*(n.interval||5),r.logger=n.logger||console,r.boundHandleIceStateChange=r.handleIceStateChange.bind(r),r.boundHandleConnectionStateChange=r.handleConnectionStateChange.bind(r),["new","checking"].includes(t.iceConnectionState)&&("checking"===t.iceConnectionState&&(r.logger.warn("iceConnectionState is already in checking state so ice connect time may not be accurate"),r.handleIceStateChange()),t.addEventListener("iceconnectionstatechange",r.boundHandleIceStateChange)),t.addEventListener("connectionstatechange",r.boundHandleConnectionStateChange),"connected"===t.connectionState&&r.pollForStats(),r}return i(t,e),t.prototype.stop=function(){this.peerConnection.removeEventListener("iceconnectionstatechange",this.boundHandleIceStateChange),this.peerConnection.removeEventListener("connectionstatechange",this.boundHandleConnectionStateChange),this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null)},t.prototype.handleIceStateChange=function(){var e=this,t=this.peerConnection.iceConnectionState;if("checking"===t&&c&&(this.iceStartTime=window.performance.now()),"connected"===t){if(this.haveConnectionMetrics)return;this.haveConnectionMetrics=!0;var n=void 0,r=void 0,i=void 0;c&&(this.iceConnectionTime=window.performance.now()-this.iceStartTime,n=window.navigator.userAgent,r=window.navigator.platform,i=window.navigator.hardwareConcurrency);var a={name:"connect",userAgent:n,platform:r,cores:i,session:this.session,conference:this.conference,connectTime:this.iceConnectionTime};return this.waitForSelectedCandidatePair().then(function(t){e.gatherSelectedCandidateInfo(t,a),e.emit("stats",a)})}if("failed"===t)return c&&(this.iceFailedTime=window.performance.now()-this.iceStartTime),this.gatherStats().then(function(){var t={name:"failure",session:e.session,initiator:e.initiator,conference:e.conference,failTime:e.iceFailedTime,iceRW:0,numLocalHostCandidates:0,numLocalSrflxCandidates:0,numLocalRelayCandidates:0,numRemoteHostCandidates:0,numRemoteSrflxCandidates:0,numRemoteRelayCandidates:0},n=e.peerConnection.localDescription.sdp.split("\r\n").filter(function(e){return e.indexOf("a=candidate:")>-1}),r=e.peerConnection.remoteDescription.sdp.split("\r\n").filter(function(e){return e.indexOf("a=candidate:")>-1});["Host","Srflx","Relay"].forEach(function(e){t["numLocal"+e+"Candidates"]=n.filter(function(t){return t.split(" ")[7]===e.toLowerCase()}).length,t["numRemote"+e+"Candidates"]=r.filter(function(t){return t.split(" ")[7]===e.toLowerCase()}).length}),e.emit("stats",t)})},t.prototype.waitForSelectedCandidatePair=function(e,t){var n=this;return void 0===e&&(e=300),void 0===t&&(t=1),this.gatherStats().then(function(r){return n.getSelectedCandidatePair(r)?r:t>3?Promise.reject(new Error("Max wait attempts for connected candidate info reached")):new Promise(function(r,i){setTimeout(function(){return n.waitForSelectedCandidatePair(e,t+1).then(r,i)},e)})})},t.prototype.getSelectedCandidatePair=function(e){var t=null;return e.forEach(function(e){var n=e.value;"candidate-pair"===n.type&&n.nominated&&"succeeded"===n.state&&(t=n)}),t},t.prototype.gatherSelectedCandidateInfo=function(e,t){var n=this.getSelectedCandidatePair(e);if(n){var r,i,a=n.localCandidateId,o=n.remoteCandidateId;if(e.forEach(function(e){var n=e.value;a&&"local-candidate"===n.type&&n.id===a&&(r=n,t.localCandidateType=n.candidateType),o&&"remote-candidate"===n.type&&n.id===o&&(i=n,t.remoteCandidateType=n.candidateType)}),r&&i&&(t.candidatePair=r.candidateType+";"+i.candidateType,t.candidatePairDetails={local:r,remote:i,pair:n}),r){if(t.transport=r.transport||r.protocol,r.priority){var s=parseInt(r.priority,10);t.turnType={2:"udp",1:"tcp",0:"tls"}[s>>24],t.networkType=r.networkType}t.usingIPv6=r.ipAddress&&0===r.ipAddress.indexOf("[")}}},t.prototype.handleConnectionStateChange=function(){return s(this,void 0,void 0,function(){var e,t=this;return u(this,function(n){if("connected"===(e=this.peerConnection.connectionState))this.pollForStats();else{if("disconnected"===e)return"stable"!==this.peerConnection.signalingState?[2]:[2,this.gatherStats().then(function(e){var n=t.createStatsReport(e);n.type="disconnected",t.emit("stats",n)})];["closed","failed"].includes(e)&&this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null)}return[2]})})},t.prototype.pollForStats=function(){var e=this;if(!this.pollingInterval){var t=function(){return e.gatherStats().then(function(t){if(0!==t.length){var n=e.createStatsReport(t,!0);(n.tracks.length>0||n.remoteTracks.length>0)&&e.checkBitrate(n)&&e.emit("stats",n)}else e.logger.warn("Empty stats gathered, ignoring and not emitting stats")})};c&&(window.setTimeout(t,0),this.pollingInterval=window.setInterval(t,this.statsInterval))}},t.prototype.checkBitrate=function(e){var t;return e.remoteTracks.length&&0!==(null===(t=e.remoteTracks[0])||void 0===t?void 0:t.bitrate)?(this.statsArr=[],!0):!(this.statsArr.length>=5||(this.statsArr.push(e),0))},t.prototype.polyFillStats=function(e){if(!e)return[];if(Array.isArray(e))return e;var t=[];if(this.isNativeStatsReport(e))e.forEach(function(e,n){t.push({key:n,value:e})});else{if(!(Object.keys(e).length>0))return this.logger.warn("Unknown stats results format, returning unmodified",e),[];Object.keys(e).forEach(function(n){t.push({key:n,value:e[n]})})}return t},t.prototype.isNativeStatsReport=function(e){return void 0!==window.RTCStatsReport&&e instanceof window.RTCStatsReport},t.prototype.gatherStats=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),["connecting","connected"].includes(this.peerConnection.connectionState)?[4,this.peerConnection.getStats(null).then(this.polyFillStats.bind(this))]:[3,2];case 1:return[2,t.sent()];case 2:return"closed"===this.peerConnection.connectionState?(this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null),[2,[]]):[2,[]];case 3:return[3,5];case 4:return e=t.sent(),this.logger.error("Failed to gather stats. Are you using RTCPeerConnection as your connection? {expect peerconnection.getStats}",{peerConnection:this.peerConnection,err:e}),[2,Promise.reject(e)];case 5:return[2]}})})},t.prototype.createStatsReport=function(e,t){var n=this;void 0===t&&(t=!0);var r={name:"getStats",session:this.session,initiator:this.initiator,conference:this.conference,tracks:[],remoteTracks:[]};if(0===e.length)return r;e.filter(function(e){return["inbound-rtp","outbound-rtp"].indexOf(e.value.type)>-1}).forEach(function(t){n.processSource({source:t.value,event:r,results:e})});var i=e.find(function(e){return"candidate-pair"===e.value.type&&"succeeded"===e.value.state&&!0===e.value.nominated});return i&&this.processSelectedCandidatePair({report:i.value,event:r,results:e}),t&&(this.lastResult=e),r},t.prototype.processSource=function(e){var t,n,r,i,a,o,s,u=e.source,c=e.results,l=e.event,f=new Date(u.timestamp),p=this.lastResult&&this.lastResult.find(function(e){return e.key===u.id});(p=p&&p.value)&&(t=(t=this.lastResult&&this.lastResult.find(function(e){return e.value.localId===p.id}))&&t.value),c.forEach(function(e){e.value.localId===u.id?n=e.value:e.key===u.transportId?r=e.value:e.key===u.trackId?a=e.value:e.key===u.mediaSourceId?o=e.value:e.key===u.codecId&&(s=e.value)}),r&&(i=(i=c.find(function(e){return e.key===r.selectedCandidatePairId}))&&i.value),i&&(l.candidatePairHadActiveSource=!0);var h=u.kind||u.mediaType,v="outbound-rtp"===u.type,m={track:a&&a.trackIdentifier,kind:h,timestamp:d("timestamp",u,n),jitter:d("jitter",u,n),roundTripTime:d("roundTripTime",u,n),totalRoundTripTime:d("totalRoundTripTime",u,n),roundTripTimeMeasurements:d("roundTripTimeMeasurements",u,n),packetsLost:d("packetsLost",u,n)||0,packetLoss:0,bytes:parseInt(v?u.bytesSent:u.bytesReceived,10)||0};if(s&&(m.codec="".concat(s.payloadType," ").concat(s.mimeType," ").concat(s.clockRate)),p){var g=parseInt(v?p.bytesSent:p.bytesReceived,10)||0,y=f.getTime()-new Date(p.timestamp).getTime();m.bitrate=Math.floor(8*(m.bytes-g)/y)}var b=d("packetsLost",p,t);v?(m.packetsSent=u.packetsSent,m.packetLoss=m.packetsLost/(m.packetsSent||1)*100,p&&(m.intervalPacketsSent=m.packetsSent-(p.packetsSent||0),m.intervalPacketsLost=m.packetsLost-(b||0),m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsSent||1)*100),m.retransmittedBytesSent=u.retransmittedBytesSent,m.retransmittedPacketsSent=u.retransmittedPacketsSent):(m.packetsReceived=u.packetsReceived,m.packetLoss=m.packetsLost/(m.packetsReceived||1)*100,p&&(m.intervalPacketsReceived=m.packetsReceived-p.packetsReceived,m.intervalPacketsLost=m.packetsLost-b,m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsReceived||1)*100)),a&&"audio"===h&&(a.remoteSource?(m.audioLevel=a.audioLevel,m.totalAudioEnergy=a.totalAudioEnergy):(m.echoReturnLoss=a.echoReturnLoss,m.echoReturnLossEnhancement=a.echoReturnLossEnhancement)),"audio"!==h||!o||a&&a.remoteSource||(m.audioLevel=o.audioLevel,m.totalAudioEnergy=o.totalAudioEnergy),Object.keys(m).forEach(function(e){return void 0===m[e]&&delete m[e]}),v?l.tracks.push(m):l.remoteTracks.push(m)},t.prototype.processSelectedCandidatePair=function(e){var t=this,n=e.report,r=e.event,i=e.results,a=n.localCandidateId,o=n.remoteCandidateId;r.localCandidateChanged=!!this.lastActiveLocalCandidate&&a!==this.lastActiveLocalCandidate.id,r.remoteCandidateChanged=!!this.lastActiveRemoteCandidate&&o!==this.lastActiveRemoteCandidate.id,(!this.lastActiveLocalCandidate||r.localCandidateChanged||r.remoteCandidateChanged)&&i.forEach(function(e){t.checkLastActiveCandidate({localId:a,remoteId:o,report:e.value})}),this.lastActiveLocalCandidate&&(r.networkType=this.lastActiveLocalCandidate.networkType,this.lastActiveRemoteCandidate&&(r.candidatePair=this.lastActiveLocalCandidate.candidateType+";"+this.lastActiveRemoteCandidate.candidateType)),r.bytesSent=n.bytesSent,r.bytesReceived=n.bytesReceived,r.requestsReceived=n.requestsReceived,r.requestsSent=n.requestsSent,r.responsesReceived=n.responsesReceived,r.responsesSent=n.responsesSent,r.consentRequestsSent=n.consentRequestsSent,r.totalRoundTripTime=n.totalRoundTripTime},t.prototype.checkLastActiveCandidate=function(e){var t=e.localId,n=e.remoteId,r=e.report;t&&"local-candidate"===r.type&&r.id===t&&(this.lastActiveLocalCandidate=r),n&&"remote-candidate"===r.type&&r.id===n&&(this.lastActiveRemoteCandidate=r)},t}(l.EventEmitter);function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.find(function(t){return t&&(t[e]||0===t[e])});return r&&r[e]}t.default=f},6341(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},2987(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},5901(e,t,n){var r=n(79);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},2475(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},3513(e,t,n){var r=n(5172);e.exports=function(e){var t={},n=!1;function i(t,i){return n=!0,i=new Promise(function(n){n(e[t](i))}),{done:!1,value:new r(i,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):i("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},9293(e){function t(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,u,"next",e)}function u(e){t(o,i,a,s,u,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},3344(e,t,n){var r=n(5172);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},7383(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},9646(e,t,n){var r=n(7550),i=n(5636);e.exports=function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var o=new(e.bind.apply(e,a));return n&&i(o,n.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports},4579(e,t,n){var r=n(7736);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},3693(e,t,n){var r=n(7736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},2395(e,t,n){var r=n(9552);function i(){return e.exports=i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=r(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3072(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9511(e,t,n){var r=n(5636);e.exports=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},691(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},7550(e){function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9291(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},1156(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},7752(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},1869(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},1847(e,t,n){var r=n(4893);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},4893(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports},8452(e,t,n){var r=n(3738).default,i=n(2475);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,n){var r=n(5546);function i(){var t,n,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function u(e,i,a,o){var s=i&&i.prototype instanceof l?i:l,u=Object.create(s.prototype);return r(u,"_invoke",function(e,r,i){var a,o,s,u=0,l=i||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return a=e,o=0,s=t,d.n=n,c}};function p(e,r){for(o=e,s=r,n=0;!f&&u&&!i&&n<l.length;n++){var i,a=l[n],p=d.p,h=a[2];e>3?(i=h===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=t):a[0]<=p&&((i=e<2&&p<a[1])?(o=0,d.v=r,d.n=a[1]):p<h&&(i=e<3||a[0]>r||r>h)&&(a[4]=e,a[5]=r,d.n=h,o=0))}if(i||e>1)return c;throw f=!0,r}return function(i,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),o=l,s=h;(n=o<2?t:s)||!f;){a||(o?o<3?(o>1&&(d.n=-1),p(o,s)):d.n=s:d.v=s);try{if(u=2,a){if(o||(i="next"),n=a[i]){if(!(n=n.call(a,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=a.return)&&n.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);a=t}else if((n=(f=d.n<0)?s:e.call(r,d))!==c)break}catch(e){a=t,o=1,s=e}finally{u=1}}return{value:n,done:f}}}(e,a,o),!0),u}var c={};function l(){}function f(){}function d(){}n=Object.getPrototypeOf;var p=[][o]?n(n([][o]())):(r(n={},o,function(){return this}),n),h=d.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=d,r(h,"constructor",d),r(d,"constructor",f),f.displayName="GeneratorFunction",r(d,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(e.exports=i=function(){return{w:u,m:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,n){var r=n(887);e.exports=function(e,t,n,i,a){var o=r(e,t,n,i,a);return o.next().then(function(e){return e.done?e.value:o.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var r=n(6993),i=n(1791);e.exports=function(e,t,n,a,o){return new i(r().w(e,t,n,a),o||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,n){var r=n(5172),i=n(5546);e.exports=function e(t,n){function a(e,i,o,s){try{var u=t[e](i),c=u.value;return c instanceof r?n.resolve(c.v).then(function(e){a("next",e,o,s)},function(e){a("throw",e,o,s)}):n.resolve(c).then(function(e){u.value=e,o(u)},function(e){return a("throw",e,o,s)})}catch(e){s(e)}}var o;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(e,t,r){function i(){return new n(function(t,n){a(e,r,t,n)})}return o=o?o.then(i,i):i()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(n,r,i,a){var o=Object.defineProperty;try{o({},"",{})}catch(n){o=0}e.exports=t=function(e,n,r,i){function a(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?o?o(e,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[n]=r:(a("next",0),a("throw",1),a("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var r=n(5172),i=n(6993),a=n(5869),o=n(887),s=n(1791),u=n(4373),c=n(579);function l(){"use strict";var t=i(),n=t.m(l),f=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function h(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,p[e],t)},delegateYield:function(e,i,a){return t.resultName=i,n(r.d,c(e),a)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,i){return t.w(h(e),n,r,i&&i.reverse())},isGeneratorFunction:d,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,i){return(d(t)?o:a)(h(e),t,n,r,i)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,n){var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},5636(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5715(e,t,n){var r=n(2987),i=n(1156),a=n(7122),o=n(7752);e.exports=function(e,t){return r(e)||i(e,t)||a(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},9552(e,t,n){var r=n(3072);e.exports=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},1132(e,t,n){var r=n(5901),i=n(9291),a=n(7122),o=n(1869);e.exports=function(e){return r(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},9045(e,t,n){var r=n(3738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7736(e,t,n){var r=n(3738).default,i=n(9045);e.exports=function(e){var t=i(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="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.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7122(e,t,n){var r=n(79);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},2958(e,t,n){var r=n(5172);function i(e){var t,n;function i(t,n){try{var o=e[t](n),s=o.value,u=s instanceof r;Promise.resolve(u?s.v:s).then(function(n){if(u){var r="return"===t&&s.k?t:"next";if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(!!o.done,n)},function(e){i("throw",e)})}catch(e){a(2,e)}}function a(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=function(e){return function(){return new i(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},1837(e,t,n){var r=n(3072),i=n(5636),a=n(691),o=n(9646);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},1764(e,t,n){"use strict";var r=n(440),i=n(9293),a=n(4756),o=n(3693),s=n(8452),u=n(3072),c=n(9511),l=n(1837),f=n(7383),d=n(4579),p=n(5715),h=n(3738),v=n(1132),m=n(2958),g=n(3344),y=n(3513);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(e,t,n){return t=u(t),s(e,w()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e){var t,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new T(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function T(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return T=function(e){this.s=e,this.n=e.next},T.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new T(e)}function A(e,t){return function(){return e.apply(t,arguments)}}var E,I=Object.prototype.toString,N=Object.getPrototypeOf,j=Symbol.iterator,R=Symbol.toStringTag,P=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),C=function(e){return"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e)},M=function(e,t,n){return e===Object.prototype||!n&&null===t},D=function(e,t){for(var n=e,r=[];null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);var i=N(n);if(M(n,i,n===e))return!1;if(P(n,t))return!0;n=i}return!1},L=(E=Object.create(null),function(e){var t=I.call(e);return E[t]||(E[t]=t.slice(8,-1).toLowerCase())}),B=function(e){return e=e.toLowerCase(),function(t){return L(t)===e}},F=function(e){return function(t){return h(t)===e}},q=Array.isArray,U=F("undefined");function z(e){return null!==e&&!U(e)&&null!==e.constructor&&!U(e.constructor)&&H(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var J=B("ArrayBuffer"),G=F("string"),H=F("function"),W=F("number"),V=function(e){return null!==e&&"object"===h(e)},Q=function(e){if(!V(e))return!1;var t=N(e);return!(null!==t&&t!==Object.prototype&&null!==N(t)||D(e,R)||D(e,j))},K=B("Date"),X=B("File"),Y=B("Blob"),$=B("FileList"),Z=B("Set"),ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},te=void 0!==ee.FormData?ee.FormData:void 0,ne=B("URLSearchParams"),re=["ReadableStream","Request","Response","Headers"].map(B),ie=p(re,4),ae=ie[0],oe=ie[1],se=ie[2],ue=ie[3];function ce(e,t){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==h(e)&&(e=[e]),q(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(z(e))return;var o,s=a?Object.getOwnPropertyNames(e):Object.keys(e),u=s.length;for(n=0;n<u;n++)o=s[n],t.call(null,e[o],o,e)}}function le(e,t){if(z(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),i=r.length;i-- >0;)if(t===(n=r[i]).toLowerCase())return n;return null}var fe,de,pe,he,ve,me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,ge=function(e){return!U(e)&&e!==me},ye=(fe="undefined"!=typeof Uint8Array&&N(Uint8Array),function(e){return fe&&e instanceof fe}),be=B("HTMLFormElement"),Se=Object.prototype.propertyIsEnumerable,_e=B("RegExp"),we=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};ce(n,function(n,i){var a;!1!==(a=t(n,i,e))&&(r[i]=a||n)}),Object.defineProperties(e,r)},Oe=B("AsyncFunction"),xe=(de="function"==typeof setImmediate,pe=H(me.postMessage),de?setImmediate:pe?(he="axios@".concat(Math.random()),ve=[],me.addEventListener("message",function(e){var t=e.source,n=e.data;t===me&&n===he&&ve.length&&ve.shift()()},!1),function(e){ve.push(e),me.postMessage(he,"*")}):function(e){return setTimeout(e)}),ke="undefined"!=typeof queueMicrotask?queueMicrotask.bind(me):void 0!==r&&r.nextTick||xe,Te=function(e){return null!=e&&H(e[j])},Ae={isArray:q,isArrayBuffer:J,isBuffer:z,isFormData:function(e){if(!e)return!1;if(te&&e instanceof te)return!0;var t=N(e);if(!t||t===Object.prototype)return!1;if(!H(e.append))return!1;var n=L(e);return"formdata"===n||"object"===n&&H(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&J(e.buffer)},isString:G,isNumber:W,isBoolean:function(e){return!0===e||!1===e},isObject:V,isPlainObject:Q,isEmptyObject:function(e){if(!V(e)||z(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ae,isRequest:oe,isResponse:se,isHeaders:ue,isUndefined:U,isDate:K,isFile:X,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:Y,isRegExp:_e,isFunction:H,isStream:function(e){return V(e)&&H(e.pipe)},isURLSearchParams:ne,isTypedArray:ye,isFileList:$,forEach:ce,merge:function e(){for(var t=ge(this)&&this||{},n=t.caseless,r=t.skipUndefined,i={},a=function(t,a){if("__proto__"!==a&&"constructor"!==a&&"prototype"!==a){var o=n&&"string"==typeof a&&le(i,a)||a,s=P(i,o)?i[o]:void 0;Q(s)&&Q(t)?i[o]=e(s,t):Q(t)?i[o]=e({},t):q(t)?i[o]=t.slice():r&&U(t)||(i[o]=t)}},o=0,s=arguments.length;o<s;o++){var u=o<0||arguments.length<=o?void 0:arguments[o];if(u&&!z(u)&&(ce(u,a),"object"===h(u)&&!q(u)))for(var c=Object.getOwnPropertySymbols(u),l=0;l<c.length;l++){var f=c[l];Se.call(u,f)&&a(u[f],f)}}return i},extend:function(e,t,n){return ce(t,function(t,r){n&&H(t)?Object.defineProperty(e,r,{__proto__:null,value:A(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,a,o,s={};if(t=t||{},null==e)return t;do{for(a=(i=Object.getOwnPropertyNames(e)).length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&N(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:L,kindOfTest:B,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(q(e))return e;var t=e.length;if(!W(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[j]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:be,hasOwnProperty:P,hasOwnProp:P,hasOwnInPrototypeChain:D,getSafeProp:function(e,t){return null!=e&&D(e,t)?e[t]:void 0},toSafeFlatObject:function(e){if(null==e||"object"!==h(e)&&"function"!=typeof e)return e;var t=N(e);if(null===t&&function(e){if(!Object.isExtensible(e))return!1;var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push.apply(t,v(Object.getOwnPropertySymbols(e))),t.every(function(t){if(C(t))return!1;var n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})}(e))return e;for(var n=Object.create(null),r=Object.create(null),i=[],a=e;null!=a&&-1===i.indexOf(a);){i.push(a);var o=a===e?t:N(a);if(M(a,o,a===e))break;var s=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&s.push.apply(s,v(Object.getOwnPropertySymbols(a)));var u,c=O(s);try{for(c.s();!(u=c.n()).done;){var l=u.value;C(l)||P(r,l)||(n[l]=e[l],r[l]=!0)}}catch(e){c.e(e)}finally{c.f()}a=o}return n},reduceDescriptors:we,freezeMethods:function(e){we(e,function(t,n){if(H(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];H(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:function(e,t){var n={},r=function(e){e.forEach(function(e){n[e]=!0})};return q(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:le,global:me,isContextDefined:ge,isSpecCompliantForm:function(e){return!!(e&&H(e.append)&&"FormData"===e[R]&&e[j])},toJSONObject:function(e){var t=new WeakSet,n=function(e){if(V(e)){if(t.has(e))return;if(z(e))return e;if(!("toJSON"in e)){var r;if(t.add(e),Z(e)){r=[];var i,a=O(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=n(o);!U(s)&&r.push(s)}}catch(e){a.e(e)}finally{a.f()}}else r=q(e)?[]:{},ce(e,function(e,t){var i=n(e);!U(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:Oe,isThenable:function(e){return e&&(V(e)||H(e))&&H(e.then)&&H(e.catch)},setImmediate:xe,asap:ke,isIterable:Te,isSafeIterable:function(e){return null!=e&&D(e,j)&&Te(e)}},Ee=Ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ie=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ne=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function je(e,t){return Ae.isArray(e)?e.map(function(e){return je(e,t)}):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var i=e.charCodeAt(n-1);if(9!==i&&32!==i)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Re(e){var t=Object.create(null);return Ae.forEach(e.toJSON(),function(e,n){t[n]=function(e){return je(e,Ne)}(e)}),t}var Pe=Symbol("internals");function Ce(e){return e&&String(e).trim().toLowerCase()}function Me(e){return!1===e||null==e?e:Ae.isArray(e)?e.map(Me):function(e){return je(e,Ie)}(String(e))}var De=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Le(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var i=e.charCodeAt(n-1);if(9!==i&&32!==i)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Be(e,t,n,r,i){return Ae.isFunction(r)?r.call(this,t,n):(i&&(t=n),Ae.isString(t)?Ae.isString(r)?-1!==t.indexOf(r):Ae.isRegExp(r)?r.test(t):void 0:void 0)}var Fe=function(){return d(function e(t){f(this,e),t&&this.set(t)},[{key:"set",value:function(e,t,n){var r=this;function i(e,t,n){var i=Ce(t);if(i){var a=Ae.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Me(e))}}var a=function(e,t){return Ae.forEach(e,function(e,n){return i(e,n,t)})};if(Ae.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Ae.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a(function(e){var t,n,r,i={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim();var a=Ae.hasOwnProp(i,t);!t||a&&Ae.hasOwnProp(Ee,t)||("set-cookie"===t?a?i[t].push(n):i[t]=[n]:i[t]=a?i[t]+", "+n:n)}),i}(e),t);else if(Ae.isObject(e)&&Ae.isSafeIterable(e)){var o,s,u,c=Object.create(null),l=O(e);try{for(l.s();!(u=l.n()).done;){var f=u.value;if(!Ae.isArray(f))throw new TypeError("Object iterator must return a key-value pair");s=f[0],Ae.hasOwnProp(c,s)?(o=c[s],c[s]=Ae.isArray(o)?[].concat(v(o),[f[1]]):[o,f[1]]):c[s]=f[1]}}catch(e){l.e(e)}finally{l.f()}a(c,t)}else null!=e&&i(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Ce(e)){var n=Ae.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Ae.isFunction(t))return t.call(this,r,n);if(Ae.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Ce(e)){var n=Ae.findKey(this,e);return!(!n||void 0===this[n]||t&&!Be(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function i(e){if(e=Ce(e)){var i=Ae.findKey(n,e);!i||t&&!Be(0,n[i],i,t)||(delete n[i],r=!0)}}return Ae.isArray(e)?e.forEach(i):i(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var i=t[n];e&&!Be(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Ae.forEach(this,function(r,i){var a=Ae.findKey(n,i);if(a)return t[a]=Me(r),void delete t[i];var o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})}(i):String(i).trim();o!==i&&delete t[i],t[o]=Me(r),n[o]=!0}),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Ae.forEach(this,function(n,r){null!=n&&!1!==n&&(t[r]=e&&Ae.isArray(n)?n.join(", "):n)}),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map(function(e){var t=p(e,2);return t[0]+": "+t[1]}).join("\n")}},{key:"getSetCookie",value:function(){var e=this.get("set-cookie");return Ae.isArray(e)?e:null==e||!1===e?[]:[e]}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"parseParameters",value:function(e){return function(e){var t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){var i=Le(n.slice(r,e)),a=i.indexOf("=");if(!(a<1)){var o=Le(i.slice(0,a));if(De.test(o)){var s=o.toLowerCase();if("__proto__"!==s&&"constructor"!==s&&"prototype"!==s){var u=Le(i.slice(a+1));t[s]=function(e){var t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;for(var n="",r=1;r<t;r++){var i=e.charCodeAt(r);if(34===i)return e;if(92===i&&(r+=1)>=t)return e;n+=e[r]}return n}(u)}}}}for(var s=0;s<n.length;s++){var u=n.charCodeAt(s);i?a?a=!1:92===u?a=!0:34===u&&(i=!1):34===u?i=!0:44!==u&&59!==u||(o(s),r=s+1)}return o(n.length),t}(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach(function(e){return t.set(e)}),t}},{key:"accessor",value:function(e){var t=(this[Pe]=this[Pe]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Ce(e);t[r]||(function(e,t){var n=Ae.toCamelCase(" "+t);["get","set","has"].forEach(function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return Ae.isArray(e)?e.forEach(r):r(e),this}}])}();Fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ae.reduceDescriptors(Fe.prototype,function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}}),Ae.freezeMethods(Fe);var qe="[REDACTED ****]";function Ue(e){try{return String(e)}catch(e){return""}}var ze=function(e){function t(e,n,r,i,a){var o;return f(this,t),o=_(this,t,[e]),Object.defineProperty(o,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),o.name="AxiosError",o.isAxiosError=!0,n&&(o.code=n),r&&(o.config=r),i&&(o.request=i),a&&(o.response=a,o.status=a.status),o}return c(t,e),d(t,[{key:"toJSON",value:function(){var e=this.config,t=e&&Ae.hasOwnProp(e,"redact")?e.redact:void 0,n=Ae.isArray(t)&&t.length>0?function(e,t){var n=new Set(t.map(function(e){return String(e).toLowerCase()})),r=[],i=function(e){if(null===e||"object"!==h(e))return e;if(Ae.isBuffer(e))return e;if(-1===r.indexOf(e)){var t;if(e instanceof Fe&&(e=e.toJSON()),r.push(e),Ae.isArray(e))t=[],e.forEach(function(e,n){var r=i(e);Ae.isUndefined(r)||(t[n]=r)});else{if(!Ae.isPlainObject(e)&&function(e){if(Ae.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Ae.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(var a=0,o=Object.entries(e);a<o.length;a++){var s=p(o[a],2),u=s[0],c=s[1],l=n.has(u.toLowerCase())?qe:i(c);Ae.isUndefined(l)||(t[u]=l)}}return r.pop(),t}};return i(e)}(e,t):Ae.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,n,r,i,a,o){var s=e.message;!s&&Ae.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(function(e){try{return e&&e.message?Ue(e.message):Ue(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));var u=new t(s,n||e.code,r,i,a);return Object.defineProperty(u,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),u.name=e.name,null!=e.status&&null==u.status&&(u.status=e.status),o&&Object.assign(u,o),u}}])}(l(Error));function Je(e){return Ae.isPlainObject(e)||Ae.isArray(e)}function Ge(e){return Ae.endsWith(e,"[]")?e.slice(0,-2):e}function He(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ge(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}ze.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ze.ERR_BAD_OPTION="ERR_BAD_OPTION",ze.ECONNABORTED="ECONNABORTED",ze.ETIMEDOUT="ETIMEDOUT",ze.ECONNREFUSED="ECONNREFUSED",ze.ERR_NETWORK="ERR_NETWORK",ze.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ze.ERR_DEPRECATED="ERR_DEPRECATED",ze.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ze.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ze.ERR_CANCELED="ERR_CANCELED",ze.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ze.ERR_INVALID_URL="ERR_INVALID_URL",ze.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var We=Ae.toFlatObject(Ae,{},null,function(e){return/^is[A-Z]/.test(e)});function Ve(e,t,n){if(!Ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=function(e,t){var r=Ae.getSafeProp(n,e);return Ae.isUndefined(r)?t:r},i=r("metaTokens",!0),a=r("visitor")||v,o=r("dots",!1),s=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),l=u&&Ae.isSpecCompliantForm(t),f=[];if(!Ae.isFunction(a))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Ae.isDate(e))return e.toISOString();if(Ae.isBoolean(e))return e.toString();if(!l&&Ae.isBlob(e))throw new ze("Blob is not supported. Use a Buffer instead.");if(Ae.isArrayBuffer(e)||Ae.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new ze("Blob is not supported. Use a Buffer instead.",ze.ERR_NOT_SUPPORT)}return e}function p(e){if(e>c)throw new ze("Object is too deeply nested ("+e+" levels). Max depth: "+c,ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(e,n,r){var a=e;if(Ae.isReactNative(t)&&Ae.isReactNativeBlob(e))return t.append(He(r,n,o),d(e)),!1;if(e&&!r&&"object"===h(e))if(Ae.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e){if(c===1/0)return JSON.stringify(e);var t=[];return JSON.stringify(e,function(e,n){if(!Ae.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),p(1+t.length-1),n})}(e);else if(Ae.isArray(e)&&function(e){return Ae.isArray(e)&&!e.some(Je)}(e)||(Ae.isFileList(e)||Ae.endsWith(n,"[]"))&&(a=Ae.toArray(e)))return n=Ge(n),a.forEach(function(e,r){!Ae.isUndefined(e)&&null!==e&&t.append(!0===s?He([n],r,o):null===s?n:n+"[]",d(e))}),!1;return!!Je(e)||(t.append(He(r,n,o),d(e)),!1)}var m=Object.assign(We,{defaultVisitor:v,convertValue:d,isVisitable:Je});if(!Ae.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Ae.isUndefined(n)){if(p(i),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),Ae.forEach(n,function(n,o){!0===(!(Ae.isUndefined(n)||null===n)&&a.call(t,n,Ae.isString(o)?o.trim():o,r,m))&&e(n,r?r.concat(o):[o],i+1)}),f.pop()}}(e),t}function Qe(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Ke(e,t){this._pairs=[],e&&Ve(e,this,t)}var Xe=Ke.prototype;function Ye(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,n){if(!t)return e;e=e||"";var r,i=Ae.isFunction(n)?{serialize:n}:n,a=Ae.getSafeProp(i,"encode")||Ye,o=Ae.getSafeProp(i,"serialize");if(r=o?o(t,i):Ae.isURLSearchParams(t)?t.toString():new Ke(t,i).toString(a)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Xe.append=function(e,t){this._pairs.push([e,t])},Xe.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,Qe)}:Qe;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};var Ze=Symbol("internals");function et(e){return e?e.length:0}function tt(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function nt(e,t){var n=e.handlers,r=et(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}var rt=function(){return d(function e(){f(this,e),this.handlers=[],this[Ze]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}},[{key:"use",value:function(e,t,n){var r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[Ze];null==this.handlers&&(this.handlers=[]),nt(this,i);var a=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(a,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,a}},{key:"eject",value:function(e){var t=this[Ze];nt(this,t);var n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(tt(this.handlers),t.handlersLength=this.handlers.length)}}},{key:"clear",value:function(){this.handlers&&(this.handlers=[],nt(this,this[Ze]))}},{key:"forEach",value:function(e){var t=this[Ze];nt(this,t),t.iterationDepth++;try{Ae.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(nt(this,t),tt(this.handlers),t.handlersLength=et(this.handlers))}}}])}(),it={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},at={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ke,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ot="undefined"!=typeof window&&"undefined"!=typeof document,st="object"===("undefined"==typeof navigator?"undefined":h(navigator))&&navigator||void 0,ut=ot&&(!st||["ReactNative","NativeScript","NS"].indexOf(st.product)<0),ct="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,lt=ot&&window.location.href||"http://localhost",ft=S(S({},Object.freeze({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserEnv:ut,hasStandardBrowserWebWorkerEnv:ct,navigator:st,origin:lt})),at);function dt(e){if(e>100)throw new ze("FormData field is too deeply nested ("+e+" levels). Max depth: 100",ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}function pt(e){function t(e,n,r,i){dt(i);var a=e[i++];if("__proto__"===a)return!0;var o=Number.isFinite(+a),s=i>=e.length;return a=!a&&Ae.isArray(r)?r.length:a,s?(Ae.hasOwnProp(r,a)?r[a]=Ae.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):(Ae.hasOwnProp(r,a)&&Ae.isObject(r[a])||(r[a]=[]),t(e,n,r[a],i)&&Ae.isArray(r[a])&&(r[a]=function(e){var t,n,r={},i=Object.keys(e),a=i.length;for(t=0;t<a;t++)r[n=i[t]]=e[n];return r}(r[a])),!o)}if(Ae.isFormData(e)&&Ae.isFunction(e.entries)){var n={};return Ae.forEachEntry(e,function(e,r){t(function(e){for(var t,n=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;null!==(t=r.exec(e));)dt(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)}),n}return null}var ht=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),vt=function(e,t){return null!=e&&Ae.hasOwnProp(e,t)?e[t]:void 0},mt={transitional:it,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",i=r.indexOf("application/json")>-1,a=Ae.isObject(e);if(a&&Ae.isHTMLForm(e)&&(e=new FormData(e)),Ae.isFormData(e))return i?JSON.stringify(pt(e)):e;if(Ae.isArrayBuffer(e)||Ae.isBuffer(e)||Ae.isStream(e)||Ae.isFile(e)||Ae.isBlob(e)||Ae.isReadableStream(e))return e;if(Ae.isArrayBufferView(e))return e.buffer;if(Ae.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(a){var o=vt(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ve(e,new ft.classes.URLSearchParams,S({visitor:function(e,t,n,r){return ft.isNode&&Ae.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,o).toString();if((n=Ae.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=vt(this,"env"),u=s&&s.FormData;return Ve(n?{"files[]":e}:e,u&&new u,o)}}return a||i?(t.setContentType("application/json",!1),function(e){if(Ae.isString(e))try{return(0,JSON.parse)(e),Ae.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=vt(this,"transitional")||mt.transitional,n=t&&t.forcedJSONParsing,r=vt(this,"responseType"),i="json"===r;if(Ae.isResponse(e)||Ae.isReadableStream(e))return e;if(e&&Ae.isString(e)&&(n&&!r||i)){var a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,vt(this,"parseReviver"))}catch(e){if(a){if("SyntaxError"===e.name)throw ze.from(e,ze.ERR_BAD_RESPONSE,this,null,vt(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function gt(e,t){var n=this||mt,r=t||n,i=Fe.from(r.headers),a=r.data;return Ae.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function yt(e){return!(!e||!e.__CANCEL__)}Ae.forEach(ht,function(e){mt.headers[e]={}});var bt=function(e){function t(e,n,r){var i;return f(this,t),(i=_(this,t,[e??"canceled",ze.ERR_CANCELED,n,r])).name="CanceledError",i.__CANCEL__=!0,i}return c(t,e),d(t)}(ze);function St(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ze("Request failed with status code "+n.status,n.status>=400&&n.status<500?ze.ERR_BAD_REQUEST:ze.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var _t=/[\t\n\r]/g;function wt(e){if("string"!=typeof e)return e;for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(_t,"")}function Ot(e){var t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var xt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(e,t){e=e||10;var n,r=new Array(e),i=new Array(e),a=0,o=0;return t=void 0!==t?t:1e3,function(s){var u=Date.now(),c=i[o];n||(n=u),r[a]=s,i[a]=u;for(var l=o,f=0;l!==a;)f+=r[l++],l%=e;if((a=(a+1)%e)===o&&(o=(o+1)%e),!(u-n<t)){var d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}}(50,250);return function(e,t){var n,r,i=0,a=1e3/t,o=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=a,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,v(t))};return[function(){for(var e=Date.now(),t=e-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];t>=a?o(u,e):(n=u,r||(r=setTimeout(function(){r=null,o(n)},a-t)))},function(){return n&&o(n)},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(t)}]}(function(n){if(n&&Ae.isNumber(n.loaded)){var a=n.loaded,s=n.lengthComputable?n.total:void 0,u=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,u-r),l=i(c);r=Math.max(r,u);var f=o({loaded:u,total:s,progress:s?u/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-u)/l:void 0,event:n,lengthComputable:null!=s},t?"download":"upload",!0);e(f)}},n)},kt=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Tt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ae.asap;return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t(function(){return e.apply(void 0,r)})}},At=ft.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):function(){return!0},Et=ft.hasStandardBrowserEnv?{write:function(e,t,n,r,i,a,o){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Ae.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Ae.isString(r)&&s.push("path=".concat(r)),Ae.isString(i)&&s.push("domain=".concat(i)),!0===a&&s.push("secure"),Ae.isString(o)&&s.push("SameSite=".concat(o)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch(e){return r.slice(i+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}},It=/^https?:(?!\/\/)/i;function Nt(e,t){if("string"==typeof e){var n=wt(e);if(It.test(n))throw new ze("Invalid URL ".concat(JSON.stringify(function(e){var t,n=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,"$1".concat(qe,"@")),r=n.indexOf("#"),i=(-1===r?n:n.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,"$1".concat(qe));return-1===r?i:"".concat(i,"#").concat((t=n.slice(r+1))?t.replace(/(^|&)([^=&]*=)?[^&]+/g,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"".concat(t).concat(n).concat(qe)}):t)}(n)),': missing "//" after protocol'),ze.ERR_INVALID_URL,t)}}function jt(e,t,n,r){Nt(t,r);var i,a=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));return e&&(a||!1===n)?(Nt(e,r),function(e,t){if(!t)return e;for(var n=e.length;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Rt=function(e){return e instanceof Fe?S({},e):e};function Pt(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Ae.isPlainObject(e)&&Ae.isPlainObject(t)?Ae.merge.call({caseless:r},e,t):Ae.isPlainObject(t)?Ae.merge({},t):Ae.isArray(t)?t.slice():t}function i(e,t,n,i){return Ae.isUndefined(t)?Ae.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!Ae.isUndefined(t))return r(void 0,t)}function o(e,t){return Ae.isUndefined(t)?Ae.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return Ae.hasOwnProp(t,a)?r(n,i):Ae.hasOwnProp(e,a)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var u,c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:function(e,t,n){return i(Rt(e),Rt(t),0,!0)}};return Ae.forEach((u=S(S({},e),t),Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(u).concat(Object.getOwnPropertySymbols(u).filter(function(e){return Object.getOwnPropertyDescriptor(u,e).enumerable})):Object.keys(u)),function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var a=Ae.hasOwnProp(c,r)?c[r]:i,o=a(Ae.hasOwnProp(e,r)?e[r]:void 0,Ae.hasOwnProp(t,r)?t[r]:void 0,r);Ae.isUndefined(o)&&a!==s||(n[r]=o)}}),Ae.hasOwnProp(t,"validateStatus")&&Ae.isUndefined(t.validateStatus)&&!1===function(n){var r=Ae.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Ae.isUndefined(r)){if(!Ae.isPlainObject(r))return;if(Ae.hasOwnProp(r,n))return r[n]}var i=Ae.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Ae.isPlainObject(i)&&Ae.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Ae.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Ct=["content-type","content-length"];function Mt(e){var t=Pt({},e),n=function(e){return Ae.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),i=n("withXSRFToken"),a=n("xsrfHeaderName"),o=n("xsrfCookieName"),s=n("headers"),u=n("auth"),c=n("baseURL"),l=n("allowAbsoluteUrls"),f=n("url");if(t.headers=s=Fe.from(s),t.url=$e(jt(c,f,l,t),n("params"),n("paramsSerializer")),u){var d=Ae.getSafeProp(u,"username")||"",h=Ae.getSafeProp(u,"password")||"";try{s.set("Authorization","Basic "+btoa(d+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}):"")))}catch(t){throw ze.from(t,ze.ERR_BAD_OPTION_VALUE,e)}}if(Ae.isFormData(r)){var v=Ae.getSafeProp(r,"getHeaders");ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv||Ae.isReactNative(r)?s.setContentType(void 0):Ae.isFunction(v)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(function(t){var n=p(t,2),r=n[0],i=n[1];Ct.includes(r.toLowerCase())&&e.set(r,i)}):e.set(t)}(s,v.call(r),n("formDataHeaderPolicy"))}if(ft.hasStandardBrowserEnv&&(Ae.isFunction(i)&&(i=i(t)),!0===i||null==i&&At(t.url))){var m=a&&o&&Et.read(o);m&&s.set(a,m)}return t}var Dt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r,i,a,o,s,u,c=Mt(e),l=c.data,f=Fe.from(c.headers).normalize(),d=c.responseType,h=c.onUploadProgress,v=c.onDownloadProgress;function m(){o&&o(),s&&s(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}var g=new XMLHttpRequest;function y(r){if(g){if(!(0!==g.status||"file"===(Ot(wt(c.url))||Ot(ft.origin))||g.responseURL&&g.responseURL.startsWith("file:")))return n(new ze("Request aborted",ze.ECONNABORTED,e,g)),m(),void(g=null);try{r?u&&u(r):s&&s()}catch(e){setTimeout(function(){throw e})}if(g){var i=Fe.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());St(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:i,config:e,request:g}),g=null}}}if(g.open(c.method.toUpperCase(),c.url,!0),g.timeout=c.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new ze("Request aborted",ze.ECONNABORTED,e,g)),m(),g=null)},g.onerror=function(t){var r=t&&t.message?t.message:"Network Error",i=new ze(r,ze.ERR_NETWORK,e,g);i.event=t||null,n(i),m(),g=null},g.ontimeout=function(){var t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||it;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new ze(t,r.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,g)),m(),g=null},void 0===l&&f.setContentType(null),"setRequestHeader"in g&&Ae.forEach(Re(f),function(e,t){g.setRequestHeader(t,e)}),Ae.isUndefined(c.withCredentials)||(g.withCredentials=!!c.withCredentials),d&&"json"!==d&&(g.responseType=c.responseType),v){var b=xt(v,!0),S=p(b,3);a=S[0],s=S[1],u=S[2],g.addEventListener("progress",a)}if(h&&g.upload){var _=xt(h),w=p(_,2);i=w[0],o=w[1],g.upload.addEventListener("progress",i),g.upload.addEventListener("loadend",o)}(c.cancelToken||c.signal)&&(r=function(t){g&&(n(!t||t.type?new bt(null,e,g):t),g.abort(),m(),g=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));var O=Ot(c.url);if(O&&!ft.protocols.includes(O))return n(new ze("Unsupported protocol "+O+":",ze.ERR_BAD_REQUEST,e)),void m();g.send(l||null)})},Lt=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();var t=e instanceof Error?e:this.reason;n.abort(t instanceof ze?t:new bt(t instanceof Error?t.message:t))}},a=t&&setTimeout(function(){a=null,i(new ze("timeout of ".concat(t,"ms exceeded"),ze.ETIMEDOUT))},t),o=function(){e&&(a&&clearTimeout(a),a=null,e.forEach(function(e){e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(function(e){r||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});var s=n.signal;return s.unsubscribe=function(){return Ae.asap(o)},s}},Bt=a.mark(function e(t,n){var r,i,o;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=t.byteLength)<n)){e.next=2;break}return e.next=1,t;case 1:return e.abrupt("return");case 2:i=0;case 3:if(!(i<r)){e.next=5;break}return o=i+n,e.next=4,t.slice(i,o);case 4:i=o,e.next=3;break;case 5:case"end":return e.stop()}},e)}),Ft=function(){var e=m(a.mark(function e(t,n){var r,i,o,s,u,c,l;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=1,s=k(qt(t));case 2:return e.next=3,g(s.next());case 3:if(!(r=!(u=e.sent).done)){e.next=5;break}return c=u.value,e.delegateYield(y(k(Bt(c,n)),g),"t0",4);case 4:r=!1,e.next=2;break;case 5:e.next=7;break;case 6:e.prev=6,l=e.catch(1),i=!0,o=l;case 7:if(e.prev=7,e.prev=8,!r||null==s.return){e.next=9;break}return e.next=9,g(s.return());case 9:if(e.prev=9,!i){e.next=10;break}throw o;case 10:return e.finish(9);case 11:return e.finish(7);case 12:case"end":return e.stop()}},e,null,[[1,6,7,12],[8,,9,11]])}));return function(t,n){return e.apply(this,arguments)}}(),qt=function(){var e=m(a.mark(function e(t){var n,r,i,o;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=2;break}return e.delegateYield(y(k(t),g),"t0",1);case 1:return e.abrupt("return");case 2:n=t.getReader(),e.prev=3;case 4:return e.next=5,g(n.read());case 5:if(r=e.sent,i=r.done,o=r.value,!i){e.next=6;break}return e.abrupt("continue",8);case 6:return e.next=7,o;case 7:e.next=4;break;case 8:return e.prev=8,e.next=9,g(n.cancel());case 9:return e.finish(8);case 10:case"end":return e.stop()}},e,null,[[3,,8,10]])}));return function(t){return e.apply(this,arguments)}}(),Ut=function(e,t,n,r){var o,s=Ft(e,t),u=0,c=function(e){o||(o=!0,r&&r(e))};return new ReadableStream({pull:function(e){return i(a.mark(function t(){var r,i,o,l,f,d;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=1,s.next();case 1:if(r=t.sent,i=r.done,o=r.value,!i){t.next=2;break}return c(),e.close(),t.abrupt("return");case 2:l=o.byteLength,n&&(f=u+=l,n(f)),e.enqueue(new Uint8Array(o)),t.next=4;break;case 3:throw t.prev=3,d=t.catch(0),c(d),d;case 4:case"end":return t.stop()}},t,null,[[0,3]])}))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},zt=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},Jt=function(e,t,n){return t+2<n&&zt(e.charCodeAt(t+1))&&zt(e.charCodeAt(t+2))},Gt=function(e){return e<=57?e-48:(223&e)-55},Ht=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e},Wt=function(e){return 9===e||10===e||12===e||13===e||32===e},Vt=function(e){for(var t=e.length,n=0,r=0,i=!1,a=0;a<t;a++){var o=e.charCodeAt(a);37===o&&Jt(e,a,t)&&(o=16*Gt(e.charCodeAt(a+1))+Gt(e.charCodeAt(a+2)),a+=2),Wt(o)||(61!==o?!Ht(o)||r>0?i=!0:n++:r++)}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?function(e){var t=e.length,n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)}(e):function(e){var t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)}(n)};function Qt(e){var t="string"==typeof e?e.indexOf("#"):-1;return function(e,t){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var n=e.indexOf(",");if(n<0)return 0;var r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);for(var a=0,o=0,s=i.length;o<s;o++){var u=i.charCodeAt(o);if(37===u&&Jt(i,o,s))a+=1,o+=2;else if(u<128)a+=1;else if(u<2048)a+=2;else if(u>=55296&&u<=56319&&o+1<s){var c=i.charCodeAt(o+1);c>=56320&&c<=57343?(a+=4,o++):a+=3}else a+=3}return a}(-1===t?e:e.slice(0,t),Vt)}var Kt="1.20.0",Xt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},Yt=Ae.isFunction,$t=function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},Zt=function(e){if(!Ae.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},en=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},tn=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},nn=function(e){var t=void 0!==Ae.global&&null!==Ae.global?Ae.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,o=e=Ae.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=o.fetch,u=o.Request,c=o.Response,l=s?Yt(s):"function"==typeof fetch,f=Yt(u),d=Yt(c);if(!l)return!1;var h,v=l&&Yt(n),m=l&&("function"==typeof r?(h=new r,function(e){return h.encode(e)}):function(){var e=i(a.mark(function e(t){var n,r;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=Uint8Array,e.next=1,new u(t).arrayBuffer();case 1:return r=e.sent,e.abrupt("return",new n(r));case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),g=f&&v&&en(function(){var e=!1,t=new u(ft.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),y=d&&v&&en(function(){return Ae.isReadableStream(new c("").body)}),b={stream:y&&function(e){return e.body}};l&&["text","arrayBuffer","blob","formData","stream"].forEach(function(e){!b[e]&&(b[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new ze("Response type '".concat(e,"' is not supported"),ze.ERR_NOT_SUPPORT,n)})});var S=function(){var e=i(a.mark(function e(t){var n;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=1;break}return e.abrupt("return",0);case 1:if(!Ae.isBlob(t)){e.next=2;break}return e.abrupt("return",t.size);case 2:if(!Ae.isSpecCompliantForm(t)){e.next=4;break}return n=new u(ft.origin,{method:"POST",body:t}),e.next=3,n.arrayBuffer();case 3:case 6:return e.abrupt("return",e.sent.byteLength);case 4:if(!Ae.isArrayBufferView(t)&&!Ae.isArrayBuffer(t)){e.next=5;break}return e.abrupt("return",t.byteLength);case 5:if(Ae.isURLSearchParams(t)&&(t+=""),!Ae.isString(t)){e.next=7;break}return e.next=6,m(t);case 7:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=i(a.mark(function e(t,n){var r;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ae.toFiniteNumber(t.getContentLength()),e.abrupt("return",r??S(n));case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=i(a.mark(function e(t){var n,i,o,l,d,h,m,w,O,x,k,T,A,E,I,N,j,R,P,C,M,D,L,B,F,q,U,z,J,G,H,W,V,Q,K,X,Y,$,Z,ee,te,ne,re,ie,ae,oe,se,ue,ce,le,fe,de,pe,he,ve,me,ge,ye,be,Se,_e,we,Oe,xe;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Mt(t),i=n.url,o=n.method,l=n.data,d=n.signal,h=n.cancelToken,m=n.timeout,w=n.onDownloadProgress,O=n.onUploadProgress,x=n.responseType,k=n.headers,T=n.withCredentials,A=void 0===T?"same-origin":T,E=n.fetchOptions,I=n.maxContentLength,N=n.maxBodyLength,j=n.maxRedirects,R=Ae.isNumber(I)&&I>-1,P=Ae.isNumber(N)&&N>-1,C=function(e){return Ae.hasOwnProp(t,e)?t[e]:void 0},M=s||fetch,x=x?(x+"").toLowerCase():"text",D=Lt([d,h&&h.toAbortSignal()],m),L=null,B=D&&D.unsubscribe&&function(){D.unsubscribe()},q=null,U=function(){return new ze("Request body larger than maxBodyLength limit",ze.ERR_BAD_REQUEST,t,L)},e.prev=1,z=void 0,(J=C("auth"))&&(G=Ae.getSafeProp(J,"username")||"",H=Ae.getSafeProp(J,"password")||"",z={username:G,password:H}),tn(i)&&(W=new URL(i,ft.origin),z||!W.username&&!W.password||(V=Zt(W.username),Q=Zt(W.password),z={username:V,password:Q}),(W.username||W.password)&&(W.username="",W.password="",i=W.href)),z&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa($t((z.username||"")+":"+(z.password||""))))),!R||"string"!=typeof i||!i.startsWith("data:")){e.next=2;break}if(!(Qt(i)>I)){e.next=2;break}throw new ze("maxContentLength size of "+I+" exceeded",ze.ERR_BAD_RESPONSE,t,L);case 2:if(!P||"get"===o||"head"===o){e.next=4;break}return e.next=3,S(l);case 3:if("number"!=typeof(K=e.sent)||!isFinite(K)){e.next=4;break}if(F=K,!(K>N)){e.next=4;break}throw U();case 4:if(X=P&&(Ae.isReadableStream(l)||Ae.isStream(l)),Y=function(e,t,n){return Ut(e,65536,function(e){if(P&&e>N)throw q=U();t&&t(e)},n)},!g||"get"===o||"head"===o||!O&&!X){e.next=8;break}if(null!=F){e.next=6;break}return e.next=5,_(k,l);case 5:Oe=e.sent,e.next=7;break;case 6:Oe=F;case 7:(0!==(F=Oe)||X)&&($=new u(i,{method:"POST",body:l,duplex:"half"}),Ae.isFormData(l)&&(Z=$.headers.get("content-type"))&&k.setContentType(Z),$.body&&(ee=O&&kt(F,xt(Tt(O)))||[],te=p(ee,2),ne=te[0],re=te[1],l=Y($.body,ne,re))),e.next=10;break;case 8:if(!X||f||!v||"get"===o||"head"===o){e.next=9;break}l=Y(l),e.next=10;break;case 9:if(!X||!f||g||"get"===o||"head"===o){e.next=10;break}throw new ze("Stream request bodies are not supported by the current fetch implementation",ze.ERR_NOT_SUPPORT,t,L);case 10:return Ae.isString(A)||(A=A?"include":"omit"),ie=f&&"credentials"in u.prototype,Ae.isFormData(l)&&(ae=k.getContentType())&&/^multipart\/form-data/i.test(ae)&&!/boundary=/i.test(ae)&&k.delete("content-type"),k.set("User-Agent","axios/"+Kt,!1),(oe=null==E?E:Object.assign(Object.create(null),E))&&(delete oe.body,delete oe.headers,delete oe.method,delete oe.signal,delete oe.duplex,delete oe.credentials),se=Object.assign(Object.create(null),oe,{signal:D,method:o.toUpperCase(),headers:Re(k.normalize()),body:l,duplex:"half",credentials:ie?A:void 0}),f&&(Ae.forEach(Xt,function(e,t){void 0===se[t]&&(se[t]=e)}),void 0===se.signal&&(se.signal=null),void 0===se.body&&(se.body=null)),0===j&&(se.redirect="manual",oe&&(oe.redirect="manual")),L=f&&new u(i,se),e.next=11,f?M(L,oe):M(i,se);case 11:if(ue=e.sent,ce=Fe.from(ue.headers),!R){e.next=12;break}if(!(null!=(le=Ae.toFiniteNumber(ce.getContentLength()))&&le>I)){e.next=12;break}throw new ze("maxContentLength size of "+I+" exceeded",ze.ERR_BAD_RESPONSE,t,L);case 12:return fe=y&&("stream"===x||"response"===x),y&&ue.body&&(w||R||fe&&B)&&(de={},["status","statusText","headers"].forEach(function(e){de[e]=ue[e]}),pe=Ae.toFiniteNumber(ce.getContentLength()),he=w&&kt(pe,xt(Tt(w),!0))||[],ve=p(he,2),me=ve[0],ge=ve[1],ye=function(e){if(R&&e>I)throw new ze("maxContentLength size of "+I+" exceeded",ze.ERR_BAD_RESPONSE,t,L);me&&me(e)},ue=new c(Ut(ue.body,65536,ye,function(){ge&&ge(),B&&B()}),de)),x=x||"text",e.next=13,b[Ae.findKey(b,x)||"text"](ue,t);case 13:if(be=e.sent,!R||y||fe){e.next=14;break}if(null!=be&&("number"==typeof be.byteLength?Se=be.byteLength:"number"==typeof be.size?Se=be.size:"string"==typeof be&&(Se="function"==typeof r?(new r).encode(be).byteLength:be.length)),!("number"==typeof Se&&Se>I)){e.next=14;break}throw new ze("maxContentLength size of "+I+" exceeded",ze.ERR_BAD_RESPONSE,t,L);case 14:return!fe&&B&&B(),e.next=15,new Promise(function(e,n){St(e,n,{data:be,headers:Fe.from(ue.headers),status:ue.status,statusText:ue.statusText,config:t,request:L})});case 15:return e.abrupt("return",e.sent);case 16:if(e.prev=16,xe=e.catch(1),B&&B(),!(D&&D.aborted&&D.reason instanceof ze)){e.next=17;break}throw(_e=D.reason).config=t,L&&(_e.request=L),xe!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:xe,writable:!0,enumerable:!1,configurable:!0}),_e;case 17:if(!q){e.next=18;break}throw L&&!q.request&&(q.request=L),q;case 18:if(!(xe instanceof ze)){e.next=19;break}throw L&&!xe.request&&(xe.request=L),xe;case 19:if(!xe||"TypeError"!==xe.name||!/Load failed|fetch/i.test(xe.message)){e.next=20;break}throw we=new ze("Network Error",ze.ERR_NETWORK,t,L,xe&&xe.response),Object.defineProperty(we,"cause",{__proto__:null,value:xe.cause||xe,writable:!0,enumerable:!1,configurable:!0}),we;case 20:throw ze.from(xe,xe&&xe.code,t,L,xe&&xe.response);case 21:case"end":return e.stop()}},e,null,[[1,16]])}));return function(t){return e.apply(this,arguments)}}()},rn=new Map,an=function(e){for(var t,n,r=e&&e.env||{},i=r.fetch,a=[r.Request,r.Response,i],o=a.length,s=rn;o--;)t=a[o],void 0===(n=s.get(t))&&s.set(t,n=o?new Map:nn(r)),s=n;return n};an();var on={http:null,xhr:Dt,fetch:{get:an}};Ae.forEach(on,function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var sn=function(e){return"- ".concat(e)},un=function(e){return Ae.isFunction(e)||null===e||!1===e},cn=function(e,t){for(var n,r,i=(e=Ae.isArray(e)?e:[e]).length,a={},o=0;o<i;o++){var s=void 0;if(r=n=e[o],!un(n)&&void 0===(r=on[(s=String(n)).toLowerCase()]))throw new ze("Unknown adapter '".concat(s,"'"));if(r&&(Ae.isFunction(r)||(r=r.get(t))))break;a[s||"#"+o]=r}if(!r){var u=Object.entries(a).map(function(e){var t=p(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}),c=i?u.length>1?"since :\n"+u.map(sn).join("\n"):" "+sn(u[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+c,ze.ERR_NOT_SUPPORT)}return r};function ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new bt(null,e)}function fn(e){var t=Ae.toSafeFlatObject(e);return ln(t),t.headers=Fe.from(Ae.getSafeProp(t,"headers")),t.data=gt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),cn(t.adapter||mt.adapter,t)(t).then(function(e){ln(t),t.response=e;try{e.data=gt.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Fe.from(e.headers),e},function(e){if(!yt(e)&&(ln(t),e&&e.response)){t.response=e.response;try{e.response.data=gt.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Fe.from(e.response.headers)}return Promise.reject(e)})}var dn={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){dn[e]=function(n){return h(n)===e||"a"+(t<1?"n ":" ")+e}});var pn={};dn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Kt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new ze(r(i," has been removed"+(t?" in "+t:"")),ze.ERR_DEPRECATED);return t&&!pn[i]&&(pn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}},dn.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var hn={assertOptions:function(e,t,n){if("object"!==h(e)||null===e)throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){var s=e[a],u=void 0===s||o(s,a,e);if(!0!==u)throw new ze("option "+a+" must be "+u,ze.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ze("Unknown option "+a,ze.ERR_BAD_OPTION)}},validators:dn},vn=hn.validators,mn=function(){return d(function e(t){f(this,e),this.defaults=t||{},this.interceptors={request:new rt,response:new rt}},[{key:"request",value:(e=i(a.mark(function e(t,n){var r,i,o,s,u,c,l,f;return a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,this._request(t,n);case 1:return e.abrupt("return",e.sent);case 2:if(e.prev=2,(f=e.catch(0))instanceof Error)try{r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack,o="","string"==typeof i&&(s=i.indexOf("\n"),o=-1===s?"":i.slice(s+1)),f.stack?o&&(u=o.indexOf("\n"),c=-1===u?-1:o.indexOf("\n",u+1),l=-1===c?"":o.slice(c+1),String(f.stack).endsWith(l)||(f.stack+="\n"+o)):f.stack=o}catch(e){}throw f;case 3:case"end":return e.stop()}},e,this,[[0,2]])})),function(t,n){return e.apply(this,arguments)})},{key:"_request",value:function(e,t){var n=this;"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Pt(this.defaults,t),i=r.transitional,a=r.paramsSerializer,o=r.headers;void 0!==i&&hn.assertOptions(i,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean),legacyInterceptorReqResOrdering:vn.transitional(vn.boolean),advertiseZstdAcceptEncoding:vn.transitional(vn.boolean),validateStatusUndefinedResolves:vn.transitional(vn.boolean)},!1),null!=a&&(Ae.isFunction(a)?t.paramsSerializer={serialize:a}:hn.assertOptions(a,{encode:vn.function,serialize:vn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),hn.assertOptions(t,{baseUrl:vn.spelling("baseURL"),withXsrfToken:vn.spelling("withXSRFToken")},!0),t.method=(Ae.getSafeProp(t,"method")||Ae.getSafeProp(this.defaults,"method")||"get").toLowerCase();var s=o&&Ae.merge(o.common,o[t.method]);o&&Ae.forEach(ht.concat("common"),function(e){delete o[e]}),t.headers=Fe.concat(s,o);var u=[],c=!0;this.interceptors.request.forEach(function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){c=c&&e.synchronous;var n=t.transitional||it;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)}});var l,f=[];this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)});var d,p=0;if(!c){var h=[fn.bind(this),void 0];for(h.unshift.apply(h,u),h.push.apply(h,f),d=h.length,l=Promise.resolve(t);p<d;)l=l.then(h[p++],h[p++]);return l}d=u.length;for(var v=t;p<d;){var m=u[p++],g=u[p++];try{v=m?m(v):v}catch(e){if(!g){l=Promise.reject(e);break}try{var y=g.call(this,e);Ae.isThenable(y)&&(l=Promise.resolve(y).then(function(){return fn.call(n,v)}))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=fn.call(this,v)}catch(e){l=Promise.reject(e)}for(p=0,d=f.length;p<d;)l=l.then(f[p++],f[p++]);return l}},{key:"getUri",value:function(e){return $e(jt((e=Pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]);var e}();Ae.forEach(["delete","get","head","options"],function(e){mn.prototype[e]=function(t,n){return this.request(Pt(n||{},{method:e,url:t,data:n&&Ae.hasOwnProp(n,"data")?n.data:void 0}))}}),Ae.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,i){return this.request(Pt(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mn.prototype[e]=t(),"query"!==e&&(mn.prototype[e+"Form"]=t(!0))});var gn=function(){function e(t){if(f(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t(function(e,t,i){r.reason||(r.reason=new bt(e,t,i),n(r.reason))})}return d(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e(function(e){t=e}),cancel:t}}}])}(),yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(yn).forEach(function(e){var t=p(e,2),n=t[0],r=t[1];void 0===yn[r]&&(yn[r]=n)});var bn=function e(t){var n=new mn(t),r=A(mn.prototype.request,n);return Ae.extend(r,mn.prototype,n,{allOwnKeys:!0}),Ae.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Pt(t,n))},r}(mt);bn.Axios=mn,bn.CanceledError=bt,bn.CancelToken=gn,bn.isCancel=yt,bn.VERSION=Kt,bn.toFormData=Ve,bn.AxiosError=ze,bn.Cancel=bn.CanceledError,bn.all=function(e){return Promise.all(e)},bn.spread=function(e){return function(t){return e.apply(null,t)}},bn.isAxiosError=function(e){return Ae.isObject(e)&&!0===e.isAxiosError},bn.mergeConfig=Pt,bn.AxiosHeaders=Fe,bn.formToJSON=function(e){return pt(Ae.isHTMLForm(e)?new FormData(e):e)},bn.getAdapter=cn,bn.HttpStatusCode=yn,bn.default=bn,e.exports=bn},744(e,t,n){"use strict";var r,i,a,o,s,u,c,l,f,d,p,h,v,m,g,y,b,S,_,w,O,x,k,T,A,E,I,N,j,R,P,C,M,D,L,B,F,q=n(440),U=n(1847),z=n(9293),J=n(1132),G=n(5715),H=n(4756),W=n(3693),V=n(4579),Q=n(7383),K=n(8452),X=n(3072),Y=n(9511),$=n(1837),Z=n(3738),ee=["context","status","forceRefresh"];function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){W(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function re(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e,t,n){oe(e,t),t.set(e,n)}function oe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function se(e,t,n){return e.set(ce(e,t),n),n}function ue(e,t){return e.get(ce(e,t))}function ce(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function le(e,t,n){return t=X(t),K(e,fe()?Reflect.construct(t,n||[],X(e).constructor):t.apply(e,n))}function fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fe=function(){return!!e})()}var de=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},pe=de(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t={hasSubscribers:!1};e.metrics=t,e.tracing=t}),he=de(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf="object"==("undefined"==typeof performance?"undefined":Z(performance))&&performance&&"function"==typeof performance.now?performance:Date});Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;var ve=pe(),me=he(),ge=function(){return ve.metrics.hasSubscribers||ve.tracing.hasSubscribers},ye=new Set,be="object"==(void 0===q?"undefined":Z(q))&&q?q:{},Se=function(e){return!!e&&e===Math.floor(e)&&e>0&&isFinite(e)},_e=function(e){return Se(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?we:null:null},we=function(e){function t(e){var n;return Q(this,t),(n=le(this,t,[e])).fill(0),n}return Y(t,e),V(t)}($(Array)),Oe=(r=function(){function e(t,n){if(Q(this,e),W(this,"heap",void 0),W(this,"length",void 0),!ce(r,e,i)._)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}return V(e,[{key:"push",value:function(e){this.heap[this.length++]=e}},{key:"pop",value:function(){return this.heap[--this.length]}}],[{key:"create",value:function(t){var n=_e(t);if(!n)return[];i._=ce(r,e,!0);var a=new e(t,n);return i._=ce(r,e,!1),a}}])}(),i={_:!1},r),xe=(a=new WeakMap,o=new WeakMap,s=new WeakMap,u=new WeakMap,c=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,h=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,b=new WeakMap,S=new WeakMap,_=new WeakMap,w=new WeakMap,O=new WeakMap,x=new WeakMap,k=new WeakMap,T=new WeakMap,A=new WeakMap,E=new WeakMap,I=new WeakMap,N=new WeakMap,j=new WeakMap,R=new WeakSet,P=new WeakMap,C=new WeakMap,M=new WeakMap,D=new WeakMap,L=new WeakMap,B=new WeakMap,F=new WeakMap,function(){return V(function e(t){var n;Q(this,e),oe(this,n=R),n.add(this),ae(this,a,void 0),ae(this,o,void 0),ae(this,s,void 0),ae(this,u,void 0),ae(this,c,void 0),ae(this,l,void 0),ae(this,f,void 0),ae(this,d,void 0),W(this,"ttl",void 0),W(this,"ttlResolution",void 0),W(this,"ttlAutopurge",void 0),W(this,"updateAgeOnGet",void 0),W(this,"updateAgeOnHas",void 0),W(this,"allowStale",void 0),W(this,"noDisposeOnSet",void 0),W(this,"noUpdateTTL",void 0),W(this,"maxEntrySize",void 0),W(this,"sizeCalculation",void 0),W(this,"noDeleteOnFetchRejection",void 0),W(this,"noDeleteOnStaleGet",void 0),W(this,"allowStaleOnFetchAbort",void 0),W(this,"allowStaleOnFetchRejection",void 0),W(this,"ignoreFetchAbort",void 0),W(this,"backgroundFetchSize",void 0),ae(this,p,void 0),ae(this,h,void 0),ae(this,v,void 0),ae(this,m,void 0),ae(this,g,void 0),ae(this,y,void 0),ae(this,b,void 0),ae(this,S,void 0),ae(this,_,void 0),ae(this,w,void 0),ae(this,O,void 0),ae(this,x,void 0),ae(this,k,void 0),ae(this,T,void 0),ae(this,A,void 0),ae(this,E,void 0),ae(this,I,void 0),ae(this,N,void 0),ae(this,j,void 0),ae(this,P,function(){}),ae(this,C,function(){}),ae(this,M,function(){}),ae(this,D,function(){return!1}),ae(this,L,function(e){}),ae(this,B,function(e,t,n){}),ae(this,F,function(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}),W(this,Symbol.toStringTag,"LRUCache");var r=t.max,i=void 0===r?0:r,q=t.ttl,U=t.ttlResolution,z=void 0===U?1:U,J=t.ttlAutopurge,G=t.updateAgeOnGet,H=t.updateAgeOnHas,V=t.allowStale,K=t.dispose,X=t.onInsert,Y=t.disposeAfter,$=t.noDisposeOnSet,Z=t.noUpdateTTL,ee=t.maxSize,te=void 0===ee?0:ee,ne=t.maxEntrySize,re=void 0===ne?0:ne,ie=t.sizeCalculation,le=t.fetchMethod,fe=t.memoMethod,de=t.noDeleteOnFetchRejection,pe=t.noDeleteOnStaleGet,he=t.allowStaleOnFetchRejection,ve=t.allowStaleOnFetchAbort,ge=t.ignoreFetchAbort,we=t.backgroundFetchSize,xe=void 0===we?1:we,Ae=t.perf;if(this.backgroundFetchSize=xe,void 0!==Ae&&"function"!=typeof(null==Ae?void 0:Ae.now))throw new TypeError("perf option must have a now() method if specified");if(se(d,this,null!=Ae?Ae:me.defaultPerf),0!==i&&!Se(i))throw new TypeError("max option must be a nonnegative integer");var Ee=i?_e(i):Array;if(!Ee)throw new Error("invalid max value: "+i);if(se(a,this,i),se(o,this,te),this.maxEntrySize=re||ue(o,this),this.sizeCalculation=ie,this.sizeCalculation){if(!ue(o,this)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==fe&&"function"!=typeof fe)throw new TypeError("memoMethod must be a function if defined");if(se(f,this,fe),void 0!==le&&"function"!=typeof le)throw new TypeError("fetchMethod must be a function if specified");if(se(l,this,le),se(I,this,!!le),se(v,this,new Map),se(m,this,Array.from({length:i}).fill(void 0)),se(g,this,Array.from({length:i}).fill(void 0)),se(y,this,new Ee(i)),se(b,this,new Ee(i)),se(S,this,0),se(_,this,0),se(w,this,Oe.create(i)),se(p,this,0),se(h,this,0),"function"==typeof K&&se(s,this,K),"function"==typeof X&&se(u,this,X),"function"==typeof Y?(se(c,this,Y),se(O,this,[])):(se(c,this,void 0),se(O,this,void 0)),se(E,this,!!ue(s,this)),se(j,this,!!ue(u,this)),se(N,this,!!ue(c,this)),this.noDisposeOnSet=!!$,this.noUpdateTTL=!!Z,this.noDeleteOnFetchRejection=!!de,this.allowStaleOnFetchRejection=!!he,this.allowStaleOnFetchAbort=!!ve,this.ignoreFetchAbort=!!ge,0!==this.maxEntrySize){if(0!==ue(o,this)&&!Se(ue(o,this)))throw new TypeError("maxSize must be a positive integer if specified");if(!Se(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ce(R,this,Te).call(this)}if(this.allowStale=!!V,this.noDeleteOnStaleGet=!!pe,this.updateAgeOnGet=!!G,this.updateAgeOnHas=!!H,this.ttlResolution=Se(z)||0===z?z:1,this.ttlAutopurge=!!J,this.ttl=q||0,this.ttl){if(!Se(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ce(R,this,ke).call(this)}if(0===ue(a,this)&&0===this.ttl&&0===ue(o,this))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!ue(a,this)&&!ue(o,this)){var Ie="LRU_CACHE_UNBOUNDED";(function(e){return!ye.has(e)})(Ie)&&(ye.add(Ie),function(e,t,n,r){"function"==typeof be.emitWarning?be.emitWarning(e,t,n,r):console.error("[".concat(n,"] ").concat(t,": ").concat(e))}("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ie,e))}},[{key:"perf",get:function(){return ue(d,this)}},{key:"max",get:function(){return ue(a,this)}},{key:"maxSize",get:function(){return ue(o,this)}},{key:"calculatedSize",get:function(){return ue(h,this)}},{key:"size",get:function(){return ue(p,this)}},{key:"fetchMethod",get:function(){return ue(l,this)}},{key:"memoMethod",get:function(){return ue(f,this)}},{key:"dispose",get:function(){return ue(s,this)}},{key:"onInsert",get:function(){return ue(u,this)}},{key:"disposeAfter",get:function(){return ue(c,this)}},{key:"getRemainingTTL",value:function(e){return ue(v,this).has(e)?1/0:0}},{key:"entries",value:H.mark(function e(){var t,n,r,i;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ae).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===ue(g,this)[r]||void 0===ue(m,this)[r]||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,[ue(m,this)[r],ue(g,this)[r]];case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,i=e.catch(1),t.e(i);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:"rentries",value:H.mark(function e(){var t,n,r,i;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ee).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===ue(g,this)[r]||void 0===ue(m,this)[r]||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,[ue(m,this)[r],ue(g,this)[r]];case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,i=e.catch(1),t.e(i);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:"keys",value:H.mark(function e(){var t,n,r,i,a;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ae).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===(i=ue(m,this)[r])||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,i;case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,a=e.catch(1),t.e(a);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:"rkeys",value:H.mark(function e(){var t,n,r,i,a;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ee).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===(i=ue(m,this)[r])||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,i;case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,a=e.catch(1),t.e(a);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:"values",value:H.mark(function e(){var t,n,r,i;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ae).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===ue(g,this)[r]||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,ue(g,this)[r];case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,i=e.catch(1),t.e(i);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:"rvalues",value:H.mark(function e(){var t,n,r,i;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=re(ce(R,this,Ee).call(this)),e.prev=1,t.s();case 2:if((n=t.n()).done){e.next=4;break}if(r=n.value,void 0===ue(g,this)[r]||ce(R,this,Me).call(this,ue(g,this)[r])){e.next=3;break}return e.next=3,ue(g,this)[r];case 3:e.next=2;break;case 4:e.next=6;break;case 5:e.prev=5,i=e.catch(1),t.e(i);case 6:return e.prev=6,t.f(),e.finish(6);case 7:case"end":return e.stop()}},e,this,[[1,5,6,7]])})},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"find",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=re(ce(R,this,Ae).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=ue(g,this)[i],o=ce(R,this,Me).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&e(o,ue(m,this)[i],this))return ce(R,this,Ue).call(this,ue(m,this)[i],n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"forEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=re(ce(R,this,Ae).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=ue(g,this)[i],o=ce(R,this,Me).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,ue(m,this)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"rforEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=re(ce(R,this,Ee).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=ue(g,this)[i],o=ce(R,this,Me).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,ue(m,this)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"purgeStale",value:function(){var e,t=!1,n=re(ce(R,this,Ee).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value;ue(D,this).call(this,r)&&(ce(R,this,Ge).call(this,ue(m,this)[r],"expire"),t=!0)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"info",value:function(e){var t=ue(v,this).get(e);if(void 0!==t){var n=ue(g,this)[t],r=ce(R,this,Me).call(this,n)?n.__staleWhileFetching:n;if(void 0!==r){var i={value:r};if(ue(T,this)&&ue(k,this)){var a=ue(T,this)[t],o=ue(k,this)[t];if(a&&o){var s=a-(ue(d,this).now()-o);i.ttl=s,i.start=Date.now()}}return ue(x,this)&&(i.size=ue(x,this)[t]),i}}}},{key:"dump",value:function(){var e,t=[],n=re(ce(R,this,Ae).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=ue(m,this)[r],a=ue(g,this)[r],o=ce(R,this,Me).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&void 0!==i){var s={value:o};if(ue(T,this)&&ue(k,this)){s.ttl=ue(T,this)[r];var u=ue(d,this).now()-ue(k,this)[r];s.start=Math.floor(Date.now()-u)}ue(x,this)&&(s.size=ue(x,this)[r]),t.unshift([i,s])}}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"load",value:function(e){this.clear();var t,n=re(e);try{for(n.s();!(t=n.n()).done;){var r=G(t.value,2),i=r[0],a=r[1];if(a.start){var o=Date.now()-a.start;a.start=ue(d,this).now()-o}ce(R,this,Ne).call(this,i,a.value,a)}}catch(e){n.e(e)}finally{n.f()}}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.status,i=void 0===r?ve.metrics.hasSubscribers?{}:void 0:r;n.status=i,i&&(i.op="set",i.key=e,void 0!==t&&(i.value=t),i.cache=this);var a=ce(R,this,Ne).call(this,e,t,n);return i&&ve.metrics.hasSubscribers&&ve.metrics.publish(i),a}},{key:"pop",value:function(){try{for(;ue(p,this);){var e=ue(g,this)[ue(S,this)];if(ce(R,this,je).call(this,!0),ce(R,this,Me).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(ue(N,this)&&ue(O,this))for(var t,n=ue(O,this);t=null==n?void 0:n.shift();){var r;null===(r=ue(c,this))||void 0===r||r.call.apply(r,[this].concat(J(t)))}}}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.status,r=void 0===n?ve.metrics.hasSubscribers?{}:void 0:n;t.status=r,r&&(r.op="has",r.key=e,r.cache=this);var i=ce(R,this,Re).call(this,e,t);return ve.metrics.hasSubscribers&&ve.metrics.publish(r),i}},{key:"peek",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.status,r=void 0===n?ge()?{}:void 0:n;r&&(r.op="peek",r.key=e,r.cache=this),t.status=r;var i=ce(R,this,Pe).call(this,e,t);return ve.metrics.hasSubscribers&&ve.metrics.publish(r),i}},{key:"fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ve.tracing.hasSubscribers,r=t.status,i=void 0===r?ge()?{}:void 0:r;t.status=i,i&&t.context&&(i.context=t.context);var a=ce(R,this,De).call(this,e,t);return i&&n&&(i.trace=!0,ve.tracing.tracePromise(function(){return a},i).catch(function(){})),a}},{key:"forceFetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ve.tracing.hasSubscribers,r=t.status,i=void 0===r?ge()?{}:void 0:r;t.status=i,i&&t.context&&(i.context=t.context);var a=ce(R,this,Be).call(this,e,t);return i&&n&&(i.trace=!0,ve.tracing.tracePromise(function(){return a},i).catch(function(){})),a}},{key:"memo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.status,r=void 0===n?ve.metrics.hasSubscribers?{}:void 0:n;t.status=r,r&&(r.op="memo",r.key=e,t.context&&(r.context=t.context),r.cache=this);var i=ce(R,this,qe).call(this,e,t);return r&&(r.value=i),ve.metrics.hasSubscribers&&ve.metrics.publish(r),i}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.status,r=void 0===n?ve.metrics.hasSubscribers?{}:void 0:n;t.status=r,r&&(r.op="get",r.key=e,r.cache=this);var i=ce(R,this,Ue).call(this,e,t);return r&&(void 0!==i&&(r.value=i),ve.metrics.hasSubscribers&&ve.metrics.publish(r)),i}},{key:"delete",value:function(e){return ce(R,this,Ge).call(this,e,"delete")}},{key:"clear",value:function(){return ce(R,this,He).call(this,"delete")}}],[{key:"unsafeExposeInternals",value:function(e){return{starts:ue(k,e),ttls:ue(T,e),autopurgeTimers:ue(A,e),sizes:ue(x,e),keyMap:ue(v,e),keyList:ue(m,e),valList:ue(g,e),next:ue(y,e),prev:ue(b,e),get head(){return ue(S,e)},get tail(){return ue(_,e)},free:ue(w,e),isBackgroundFetch:function(t){return ce(R,e,Me).call(e,t)},backgroundFetch:function(t,n,r,i){return ce(R,e,Ce).call(e,t,n,r,i)},moveToTail:function(t){return ce(R,e,Je).call(e,t)},indexes:function(t){return ce(R,e,Ae).call(e,t)},rindexes:function(t){return ce(R,e,Ee).call(e,t)},isStale:function(t){return ue(D,e).call(e,t)}}}}])}());function ke(){var e=this,t=new we(ue(a,this)),n=new we(ue(a,this));se(T,this,t),se(k,this,n);var r=this.ttlAutopurge?Array.from({length:ue(a,this)}):void 0;se(A,this,r),se(M,this,function(r,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue(d,e).now();n[r]=0!==a?o:0,t[r]=a,i(r,a)}),se(P,this,function(r){n[r]=0!==t[r]?ue(d,e).now():0,i(r,t[r])});var i=this.ttlAutopurge?function(t,n){if(null!=r&&r[t]&&(clearTimeout(r[t]),r[t]=void 0),n&&0!==n&&r){var a=setTimeout(function(){ue(D,e).call(e,t)?(ce(R,e,Ge).call(e,ue(m,e)[t],"expire"),r[t]=void 0):i(t,u(t))},n+1);a.unref&&a.unref(),r[t]=a}}:function(){};se(C,this,function(e,r){if(t[r]){var i=t[r],a=n[r];if(!i||!a)return;e.ttl=i,e.start=a,e.now=o||s();var u=e.now-a;e.remainingTTL=i-u}});var o=0,s=function(){var t=ue(d,e).now();if(e.ttlResolution>0){o=t;var n=setTimeout(function(){return o=0},e.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=function(t){var n=ue(v,e).get(t);return void 0===n?0:u(n)};var u=function(e){var r=t[e],i=n[e];return r&&i?r-((o||s())-i):1/0};se(D,this,function(e){var r=n[e],i=t[e];return!!i&&!!r&&(o||s())-r>i})}function Te(){var e=this,t=new we(ue(a,this));se(h,this,0),se(x,this,t),se(L,this,function(n){se(h,e,ue(h,e)-t[n]),t[n]=0}),se(F,this,function(t,n,r,i){if(!Se(r)){if(ce(R,e,Me).call(e,n))return e.backgroundFetchSize;if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(r=i(n,t),!Se(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r}),se(B,this,function(n,r,i){if(t[n]=r,ue(o,e))for(var a=ue(o,e)-t[n];ue(h,e)>a;)ce(R,e,je).call(e,!0);se(h,e,ue(h,e)+t[n]),i&&(i.entrySize=r,i.totalCalculatedSize=ue(h,e))})}function Ae(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).allowStale,n=void 0===t?this.allowStale:t;return H.mark(function t(){var r,i;return H.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!ue(p,e)){t.next=5;break}r=ue(_,e);case 1:if(!(i=ce(R,e,Ie).call(e,r))){t.next=3;break}if(!n&&ue(D,e).call(e,r)){t.next=2;break}return t.next=2,r;case 2:i=r!==ue(S,e);case 3:if(!i){t.next=5;break}r=ue(b,e)[r];case 4:t.next=1;break;case 5:case"end":return t.stop()}},t)})()}function Ee(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).allowStale,n=void 0===t?this.allowStale:t;return H.mark(function t(){var r,i;return H.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!ue(p,e)){t.next=5;break}r=ue(S,e);case 1:if(!(i=ce(R,e,Ie).call(e,r))){t.next=3;break}if(!n&&ue(D,e).call(e,r)){t.next=2;break}return t.next=2,r;case 2:i=r!==ue(_,e);case 3:if(!i){t.next=5;break}r=ue(y,e)[r];case 4:t.next=1;break;case 5:case"end":return t.stop()}},t)})()}function Ie(e){return void 0!==e&&ue(v,this).get(ue(m,this)[e])===e}function Ne(e,t,n,r){var i,o,l=n.ttl,f=void 0===l?this.ttl:l,d=n.start,h=n.noDisposeOnSet,S=void 0===h?this.noDisposeOnSet:h,x=n.sizeCalculation,k=void 0===x?this.sizeCalculation:x,A=n.status,I=ce(R,this,Me).call(this,t);if(void 0===t)return A&&(A.set="deleted"),this.delete(e),this;var P=n.noUpdateTTL,D=void 0===P?this.noUpdateTTL:P;A&&!I&&(A.value=t);var q=ue(F,this).call(this,e,t,n.size||0,k,A);if(this.maxEntrySize&&q>this.maxEntrySize)return ce(R,this,Ge).call(this,e,"set"),A&&(A.set="miss",A.maxEntrySizeExceeded=!0),this;var U=0===ue(p,this)?void 0:ue(v,this).get(e);if(void 0===U)U=0===ue(p,this)?ue(_,this):0!==ue(w,this).length?ue(w,this).pop():ue(p,this)===ue(a,this)?ce(R,this,je).call(this,!1):ue(p,this),ue(m,this)[U]=e,ue(g,this)[U]=t,ue(v,this).set(e,U),ue(y,this)[ue(_,this)]=U,ue(b,this)[U]=ue(_,this),se(_,this,U),se(p,this,(o=ue(p,this),++o)),ue(B,this).call(this,U,q,A),A&&(A.set="add"),D=!1,ue(j,this)&&!I&&(null===(i=ue(u,this))||void 0===i||i.call(this,t,e,"add"));else{var z;ce(R,this,Je).call(this,U);var G=ue(g,this)[U];if(t!==G){var H,W;if(!S)if(ce(R,this,Me).call(this,G)){var V,Q;G!==r&&G.__abortController.abort(new Error("replaced"));var K=G.__staleWhileFetching;void 0!==K&&K!==t&&(ue(E,this)&&null!==(V=ue(s,this))&&void 0!==V&&V.call(this,K,e,"set"),ue(N,this)&&(null===(Q=ue(O,this))||void 0===Q||Q.push([K,e,"set"])))}else ue(E,this)&&null!==(H=ue(s,this))&&void 0!==H&&H.call(this,G,e,"set"),ue(N,this)&&(null===(W=ue(O,this))||void 0===W||W.push([G,e,"set"]));if(ue(L,this).call(this,U),ue(B,this).call(this,U,q,A),ue(g,this)[U]=t,!I){var X,Y=G&&ce(R,this,Me).call(this,G)?G.__staleWhileFetching:G,$=void 0===Y?"add":t!==Y?"replace":"update";A&&(A.set=$,void 0!==Y&&(A.oldValue=Y)),ue(j,this)&&(null===(X=this.onInsert)||void 0===X||X.call(this,t,e,$))}}else I||(A&&(A.set="update"),ue(j,this)&&(null===(z=this.onInsert)||void 0===z||z.call(this,t,e,"update")))}if(0!==f&&!ue(T,this)&&ce(R,this,ke).call(this),ue(T,this)&&(D||ue(M,this).call(this,U,f,d),A&&ue(C,this).call(this,A,U)),!S&&ue(N,this)&&ue(O,this))for(var Z,ee=ue(O,this);Z=null==ee?void 0:ee.shift();){var te;null===(te=ue(c,this))||void 0===te||te.call.apply(te,[this].concat(J(Z)))}return this}function je(e){var t,n,r,i,a=ue(S,this),o=ue(m,this)[a],u=ue(g,this)[a],c=ce(R,this,Me).call(this,u);c&&u.__abortController.abort(new Error("evicted"));var l=c?u.__staleWhileFetching:u;return(ue(E,this)||ue(N,this))&&void 0!==l&&(ue(E,this)&&null!==(t=ue(s,this))&&void 0!==t&&t.call(this,l,o,"evict"),ue(N,this)&&null!==(n=ue(O,this))&&void 0!==n&&n.push([l,o,"evict"])),ue(L,this).call(this,a),null!==(r=ue(A,this))&&void 0!==r&&r[a]&&(clearTimeout(ue(A,this)[a]),ue(A,this)[a]=void 0),e&&(ue(m,this)[a]=void 0,ue(g,this)[a]=void 0,ue(w,this).push(a)),1===ue(p,this)?(se(S,this,se(_,this,0)),ue(w,this).length=0):se(S,this,ue(y,this)[a]),ue(v,this).delete(o),se(p,this,(i=ue(p,this),--i)),a}function Re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.updateAgeOnHas,r=void 0===n?this.updateAgeOnHas:n,i=t.status,a=ue(v,this).get(e);if(void 0!==a){var o=ue(g,this)[a];if(ce(R,this,Me).call(this,o)&&void 0===o.__staleWhileFetching)return!1;if(!ue(D,this).call(this,a))return r&&ue(P,this).call(this,a),i&&(i.has="hit",ue(C,this).call(this,i,a)),!0;i&&(i.has="stale",ue(C,this).call(this,i,a))}else i&&(i.has="miss");return!1}function Pe(e,t){var n=t.status,r=t.allowStale,i=void 0===r?this.allowStale:r,a=ue(v,this).get(e);if(void 0!==a&&(i||!ue(D,this).call(this,a))){var o=ue(g,this)[a],s=ce(R,this,Me).call(this,o)?o.__staleWhileFetching:o;return n&&(void 0!==s?(n.peek="hit",n.value=s):n.peek="miss"),s}n&&(n.peek=void 0===a?"miss":"stale")}function Ce(e,t,n,r){var i=this,a=void 0===t?void 0:ue(g,this)[t];if(ce(R,this,Me).call(this,a))return a;var o=new AbortController,s=n.signal;null==s||s.addEventListener("abort",function(){return o.abort(s.reason)},{signal:o.signal});var u={signal:o.signal,options:n,context:r},c=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o.signal.aborted,c=n.ignoreFetchAbort&&void 0!==r,l=n.ignoreFetchAbort||!(!n.allowStaleOnFetchAbort||void 0===r);if(n.status&&(s&&!a?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!a)return f(o.signal.reason,l);var p=d,h=ue(g,i)[t];return(h===d||void 0===h&&c&&a)&&(void 0===r?void 0!==p.__staleWhileFetching?ue(g,i)[t]=p.__staleWhileFetching:ce(R,i,Ge).call(i,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),ce(R,i,Ne).call(i,e,r,u.options,p))),r},f=function(r,a){var s=o.signal.aborted&&n.allowStaleOnFetchAbort,u=s||n.allowStaleOnFetchRejection,c=u||n.noDeleteOnFetchRejection,l=d;if(ue(g,i)[t]===d&&(!c||!a&&void 0===l.__staleWhileFetching?ce(R,i,Ge).call(i,e,"fetch"):s||(ue(g,i)[t]=l.__staleWhileFetching)),u)return n.status&&void 0!==l.__staleWhileFetching&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r};n.status&&(n.status.fetchDispatched=!0);var d=new Promise(function(t,r){var s,f=null===(s=ue(l,i))||void 0===s?void 0:s.call(i,e,a,u);o.signal.addEventListener("abort",function(){(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=function(e){return c(e,!0)}))}),f&&f instanceof Promise?f.then(function(e){return t(void 0===e?void 0:e)},r):void 0!==f&&t(f)}).then(c,function(e){return n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),f(e,!1)}),p=Object.assign(d,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return void 0===t?(ce(R,this,Ne).call(this,e,p,ne(ne({},u.options),{},{status:void 0})),t=ue(v,this).get(e)):ue(g,this)[t]=p,p}function Me(e){if(!ue(I,this))return!1;var t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}function De(e){return Le.apply(this,arguments)}function Le(){return Le=z(H.mark(function e(t){var n,r,i,a,o,s,u,c,l,f,d,p,h,m,y,b,S,_,w,O,x,k,T,A,E,N,j,M,L,B,F,q,U,z,J,G,W,V,Q=arguments;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(n=Q.length>1&&void 0!==Q[1]?Q[1]:{}).allowStale,i=void 0===r?this.allowStale:r,a=n.updateAgeOnGet,o=void 0===a?this.updateAgeOnGet:a,s=n.noDeleteOnStaleGet,u=void 0===s?this.noDeleteOnStaleGet:s,c=n.ttl,l=void 0===c?this.ttl:c,f=n.noDisposeOnSet,d=void 0===f?this.noDisposeOnSet:f,p=n.size,h=void 0===p?0:p,m=n.sizeCalculation,y=void 0===m?this.sizeCalculation:m,b=n.noUpdateTTL,S=void 0===b?this.noUpdateTTL:b,_=n.noDeleteOnFetchRejection,w=void 0===_?this.noDeleteOnFetchRejection:_,O=n.allowStaleOnFetchRejection,x=void 0===O?this.allowStaleOnFetchRejection:O,k=n.ignoreFetchAbort,T=void 0===k?this.ignoreFetchAbort:k,A=n.allowStaleOnFetchAbort,E=void 0===A?this.allowStaleOnFetchAbort:A,N=n.context,j=n.forceRefresh,M=void 0!==j&&j,L=n.status,B=n.signal,L&&(L.op="fetch",L.key=t,M&&(L.forceRefresh=!0),L.cache=this),ue(I,this)){e.next=1;break}return e.abrupt("return",(L&&(L.fetch="get"),ce(R,this,Ue).call(this,t,{allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,status:L})));case 1:if(F={allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,ttl:l,noDisposeOnSet:d,size:h,sizeCalculation:y,noUpdateTTL:S,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:E,ignoreFetchAbort:T,status:L,signal:B},void 0!==(q=ue(v,this).get(t))){e.next=2;break}return L&&(L.fetch="miss"),U=ce(R,this,Ce).call(this,t,q,F,N),e.abrupt("return",U.__returned=U);case 2:if(z=ue(g,this)[q],!ce(R,this,Me).call(this,z)){e.next=3;break}return J=i&&void 0!==z.__staleWhileFetching,e.abrupt("return",(L&&(L.fetch="inflight",J&&(L.returnedStale=!0)),J?z.__staleWhileFetching:z.__returned=z));case 3:if(G=ue(D,this).call(this,q),M||G){e.next=4;break}return e.abrupt("return",(L&&(L.fetch="hit"),ce(R,this,Je).call(this,q),o&&ue(P,this).call(this,q),L&&ue(C,this).call(this,L,q),z));case 4:return W=ce(R,this,Ce).call(this,t,q,F,N),V=void 0!==W.__staleWhileFetching&&i,e.abrupt("return",(L&&(L.fetch=G?"stale":"refresh",V&&G&&(L.returnedStale=!0)),V?W.__staleWhileFetching:W.__returned=W));case 5:case"end":return e.stop()}},e,this)})),Le.apply(this,arguments)}function Be(e){return Fe.apply(this,arguments)}function Fe(){return Fe=z(H.mark(function e(t){var n,r,i=arguments;return H.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},e.next=1,ce(R,this,De).call(this,t,n);case 1:if(void 0!==(r=e.sent)){e.next=2;break}throw new Error("fetch() returned undefined");case 2:return e.abrupt("return",r);case 3:case"end":return e.stop()}},e,this)})),Fe.apply(this,arguments)}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ue(f,this);if(!n)throw new Error("no memoMethod provided to constructor");var r=t.context,i=t.status,a=t.forceRefresh,o=U(t,ee);i&&a&&(i.forceRefresh=!0);var s=ce(R,this,Ue).call(this,e,o),u=a||void 0===s;if(i&&(i.memo=u?"miss":"hit",u||(i.value=s)),!u)return s;var c=n(e,s,{options:o,context:r});return i&&(i.value=c),ce(R,this,Ne).call(this,e,c,o),c}function Ue(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowStale,r=void 0===n?this.allowStale:n,i=t.updateAgeOnGet,a=void 0===i?this.updateAgeOnGet:i,o=t.noDeleteOnStaleGet,s=void 0===o?this.noDeleteOnStaleGet:o,u=t.status,c=ue(v,this).get(e);if(void 0!==c){var l=ue(g,this)[c],f=ce(R,this,Me).call(this,l);return u&&ue(C,this).call(this,u,c),ue(D,this).call(this,c)?f?(u&&(u.get="stale-fetching"),r&&void 0!==l.__staleWhileFetching?(u&&(u.returnedStale=!0),l.__staleWhileFetching):void 0):(s||ce(R,this,Ge).call(this,e,"expire"),u&&(u.get="stale"),r?(u&&(u.returnedStale=!0),l):void 0):(u&&(u.get=f?"fetching":"hit"),ce(R,this,Je).call(this,c),a&&ue(P,this).call(this,c),f?l.__staleWhileFetching:l)}u&&(u.get="miss")}function ze(e,t){ue(b,this)[t]=e,ue(y,this)[e]=t}function Je(e){e!==ue(_,this)&&(e===ue(S,this)?se(S,this,ue(y,this)[e]):ce(R,this,ze).call(this,ue(b,this)[e],ue(y,this)[e]),ce(R,this,ze).call(this,ue(_,this),e),se(_,this,e))}function Ge(e,t){var n;ve.metrics.hasSubscribers&&ve.metrics.publish({op:"delete",delete:t,key:e,cache:this});var r=!1;if(0!==ue(p,this)){var i,a=ue(v,this).get(e);if(void 0!==a)if(null!==(i=ue(A,this))&&void 0!==i&&i[a]&&(clearTimeout(ue(A,this)[a]),ue(A,this)[a]=void 0),r=!0,1===ue(p,this))ce(R,this,He).call(this,t);else{var o,u,l;ue(L,this).call(this,a);var f=ue(g,this)[a];if(ce(R,this,Me).call(this,f)?f.__abortController.abort(new Error("deleted")):(ue(E,this)||ue(N,this))&&(ue(E,this)&&null!==(u=ue(s,this))&&void 0!==u&&u.call(this,f,e,t),ue(N,this)&&(null===(l=ue(O,this))||void 0===l||l.push([f,e,t]))),ue(v,this).delete(e),ue(m,this)[a]=void 0,ue(g,this)[a]=void 0,a===ue(_,this))se(_,this,ue(b,this)[a]);else if(a===ue(S,this))se(S,this,ue(y,this)[a]);else{var d=ue(b,this)[a];ue(y,this)[d]=ue(y,this)[a];var h=ue(y,this)[a];ue(b,this)[h]=ue(b,this)[a]}se(p,this,(o=ue(p,this),--o)),ue(w,this).push(a)}}if(ue(N,this)&&null!==(n=ue(O,this))&&void 0!==n&&n.length)for(var x,k=ue(O,this);x=null==k?void 0:k.shift();){var T;null===(T=ue(c,this))||void 0===T||T.call.apply(T,[this].concat(J(x)))}return r}function He(e){var t,n=re(ce(R,this,Ee).call(this,{allowStale:!0}));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=ue(g,this)[r];if(ce(R,this,Me).call(this,i))i.__abortController.abort(new Error("deleted"));else{var a,o,u=ue(m,this)[r];ue(E,this)&&null!==(a=ue(s,this))&&void 0!==a&&a.call(this,i,u,e),ue(N,this)&&(null===(o=ue(O,this))||void 0===o||o.push([i,u,e]))}}}catch(e){n.e(e)}finally{n.f()}if(ue(v,this).clear(),ue(g,this).fill(void 0),ue(m,this).fill(void 0),ue(T,this)&&ue(k,this)){var l,f;ue(T,this).fill(0),ue(k,this).fill(0);var d,y=re(null!==(f=ue(A,this))&&void 0!==f?f:[]);try{for(y.s();!(d=y.n()).done;){var b=d.value;void 0!==b&&clearTimeout(b)}}catch(e){y.e(e)}finally{y.f()}null===(l=ue(A,this))||void 0===l||l.fill(void 0)}if(ue(x,this)&&ue(x,this).fill(0),se(S,this,0),se(_,this,0),ue(w,this).length=0,se(h,this,0),se(p,this,0),ue(N,this)&&ue(O,this))for(var I,j=ue(O,this);I=null==j?void 0:j.shift();){var P;null===(P=ue(c,this))||void 0===P||P.call.apply(P,[this].concat(J(I)))}}t.LRUCache=xe},3145(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},3893(e,t,n){"use strict";function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,{A:()=>r})},436(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(3145),i=n(3893),a=n(7800);function o(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||(0,i.A)(e)||(0,a.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},7800(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(3145);function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,i){if(1&i&&(r=this(r)),8&i)return r;if("object"==typeof r&&r){if(4&i&&r.__esModule)return r;if(16&i&&"function"==typeof r.then)return r}const a=Object.create(null);n.r(a);const o={};t=t||[null,e({}),e([]),e(e)];for(var s=2&i&&r;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,n.d(a,o),a}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],a=t[r++],o=0===a?{enumerable:!0,value:t[r++]}:{enumerable:!0,get:a};n.o(e,i)||Object.defineProperty(e,i,o)}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let r={};(()=>{"use strict";n.d(r,{default:()=>Ne});var e=n.cw(function(e,t){var n=ge(),r=Te(),i=he(),a=ve(),o=me(),s=_e(),u=be(),c=Se();function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var p=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AlertingLeaderExtension=void 0;var v=p(Ae()),m=p(O()),g=h(),y=x(),b=S(),_=function(e){function t(e,n){var r,i,o,c,l;return a(this,t),o=this,c=u(c=t),(r=s(o,d()?Reflect.construct(c,[],u(o).constructor):c.apply(o,l))).client=e,r.leaderStatus={},r.alertableInteractionTypes=null!==(i=n.alertableInteractionTypes)&&void 0!==i?i:[],r.debouncedClaimAlertingLeader=(0,m.default)(r.claimAlertingLeader.bind(r),300),r}return c(t,e),o(t,[{key:"handleStanzaInstanceChange",value:function(e){var t,n;this.connectionId=null===(n=null===(t=e.transport)||void 0===t?void 0:t.stream)||void 0===n?void 0:n.id,this.setupAlertingLeader()}},{key:"setupAlertingLeader",value:(S=i(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.alertableInteractionTypes.length){e.next=6;break}return e.prev=1,this.getAlertingLeaderEarly(),e.next=2,this.subscribeToAlertingLeader();case 2:return e.next=3,this.markAsAlertable();case 3:return e.next=4,this.getAlertingLeader();case 4:e.next=6;break;case 5:e.prev=5,e.catch(1),this.client.logger.warn("Failed to setup alerting leader; falling back to acting as the leader"),this.leaderStatus={voice:{alerting:!0,configured:!1}},this.emit("alertingLeaderChanged",this.leaderStatus);case 6:case"end":return e.stop()}},e,this,[[1,5]])})),function(){return S.apply(this,arguments)})},{key:"subscribeToAlertingLeader",value:(y=i(r.mark(function e(){var t,n=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="v2.users.".concat(this.client.config.userId,".alertingleader"),this.client.on("notify:".concat(t),function(e){var t,r;if(null===(t=n.getLeaderAbortController)||void 0===t||t.abort(),null===(r=e.eventBody)||void 0===r?void 0:r.connectionId){var i=e.eventBody.connectionId===n.connectionId,a=e.eventBody.clientType,o={alerting:i,configured:!0};a&&(o=f(f({},o),{},{clientType:a})),n.leaderStatus={voice:o},n.emit("alertingLeaderChanged",n.leaderStatus)}}),e.abrupt("return",this.client._notifications._subscribeInternal(t));case 1:case"end":return e.stop()}},e,this)})),function(){return y.apply(this,arguments)})},{key:"markAsAlertable",value:(h=i(r.mark(function e(){var t,n,i,a,o=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.client.config.userId,n={method:"patch",host:this.client.config.apiHost,authToken:this.client.config.authToken,logger:this.client.logger,data:{alertable:!0}},i=0,a=(0,b.retryPromise)(function(){return o.client.http.requestApi("apps/users/".concat(t,"/connections/").concat(o.connectionId),n)},function(){return!(++i>=16&&(o.client.logger.info("Max retries reached for marking connection as alertable"),1))},500,this.client.logger),e.abrupt("return",a.promise.catch(function(){o.client.logger.warn("Could not mark this connection as alertable")}));case 1:case"end":return e.stop()}},e,this)})),function(){return h.apply(this,arguments)})},{key:"getAlertingLeaderEarly",value:(p=i(r.mark(function e(){var t;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,this.getAlertingLeader();case 1:e.next=3;break;case 2:e.prev=2,t=e.catch(0),v.default.isAxiosError(t)&&400===t.status&&(this.client.logger.info("The org has not configured alerting leader functionality or there are not yet any active alertable connections; falling back to acting as the leader"),this.leaderStatus={voice:{alerting:!0,configured:!1}},this.emit("alertingLeaderChanged",this.leaderStatus));case 3:case"end":return e.stop()}},e,this,[[0,2]])})),function(){return p.apply(this,arguments)})},{key:"getAlertingLeader",value:(l=i(r.mark(function e(){var t,n,i,a,o,s,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.getLeaderAbortController)||void 0===t||t.abort(),this.getLeaderAbortController=new AbortController,n={method:"get",host:this.client.config.apiHost,authToken:this.client.config.authToken,logger:this.client.logger,signal:this.getLeaderAbortController.signal},e.prev=1,e.next=2,this.client.http.requestApiWithRetry("users/alertingleader",n,1e3).promise;case 2:i=e.sent,a=i.data.connectionId===this.connectionId,o=i.data.clientType,s={alerting:a,configured:!0},o&&(s=f(f({},s),{},{clientType:o})),this.leaderStatus={voice:s},this.emit("alertingLeaderChanged",this.leaderStatus),e.next=5;break;case 3:if(e.prev=3,u=e.catch(1),!v.default.isCancel(u)){e.next=4;break}return e.abrupt("return");case 4:throw u;case 5:case"end":return e.stop()}},e,this,[[1,3]])})),function(){return l.apply(this,arguments)})},{key:"claimAlertingLeader",value:(n=i(r.mark(function e(){var t,n=this;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.alertableInteractionTypes.length){e.next=1;break}throw this.client.logger.info("This client is not configured for any alertable interactions and will not attempt to claim alerting leader"),new b.StreamingClientError(g.StreamingClientErrorTypes.generic,"Unable to claim alerting leader; this client is not configured for any alertable interactions");case 1:return t={method:"put",host:this.client.config.apiHost,authToken:this.client.config.authToken,logger:this.client.logger,data:{connectionId:this.connectionId}},e.abrupt("return",this.client.http.requestApi("users/alertingleader",t).catch(function(e){throw n.client.logger.warn("Unable to claim alerting leader; this client may not alert for incoming interactions"),new b.StreamingClientError(g.StreamingClientErrorTypes.generic,"Unable to claim alerting leader",e)}));case 2:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"expose",get:function(){var e=this;return{on:this.on.bind(this),off:this.off.bind(this),claimAlertingLeader:this.debouncedClaimAlertingLeader,getLeaderStatus:function(){return e.leaderStatus},leaderStatus:this.leaderStatus}}}]);var n,l,p,h,y,S}(y.EventEmitter);t.AlertingLeaderExtension=_}),t=n.cw(function(t,n){var r=we(),s=Te(),p=he(),v=ve(),g=me(),w=_e(),O=be(),A=Se();function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return I(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}var j=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.Client=void 0;var R=Ie(),P=T();f();var C=e(),M=c(),D=_(),L=l(),B=d(),F=S(),q=o(),U=h(),z=j(x()),J=i(),G=k(),H=j(m()),W=y(),V=u(),Q=a(),K=j(b()),X={notifications:M.Notifications,webrtcSessions:D.WebrtcExtension,messenger:V.MessengerExtension,alertingLeader:C.AlertingLeaderExtension},Y="stanzaDisconnected",$="notify:no_longer_subscribed",Z="notify:duplicate_id",ee=2e3,te=function(e){function t(e){var n,r,i,a;v(this,t),r=this,i=O(i=t),(n=w(r,N()?Reflect.construct(i,[],O(r).constructor):i.apply(r,a))).connected=!1,n.connecting=!1,n.hardReconnectRequired=!0,n.isGuest=!1,n.backgroundAssistantMode=!1,n.autoReconnect=!0,n.cancelConnectionAttempt=!1,n.extensions=[],n.channelReuses=0,n.hasMadeInitialAttempt=!1,n.jidResource="",n.http=new q.HttpClient({customHeaders:e.customHeaders}),n.reconnectOnNoLongerSubscribed=!1!==e.reconnectOnNoLongerSubscribed,n.useServerSidePings=!1!==e.useServerSidePings,n.config={host:e.host,apiHost:e.apiHost||e.host.replace("wss://streaming.",""),authToken:e.authToken,jwt:e.jwt,jid:e.jid,jidResource:e.jidResource,userId:e.userId,channelId:null,appName:e.appName,appVersion:e.appVersion,appId:e.appId,logLevel:e.logLevel,customHeaders:e.customHeaders},n.backgroundAssistantMode=n.checkIsBackgroundAssistant(),n.isGuest=!n.backgroundAssistantMode&&!e.authToken;var o=e.authToken||"",s="https://api.".concat(n.config.apiHost,"/api/v2/diagnostics/trace");return n.backgroundAssistantMode&&(o=e.jwt,s+="/backgroundassistant"),n.logger=new P.Logger({accessToken:o,url:s,uploadDebounceTime:1e3,initializeServerLogging:!n.isGuest&&!e.optOutOfWebrtcStatsTelemetry,appVersion:t.version,appName:"streaming-client",logLevel:n.config.logLevel||"info",logger:e.logger||console,formatters:e.logFormatters,useUniqueLogUploader:e.useUniqueLogUploader,originAppName:e.appName,originAppVersion:e.appVersion,originAppId:e.appId,customHeaders:e.customHeaders}),n.connectionManager=new J.ConnectionManager(n.logger,n.config),Object.keys(X).forEach(function(t){var r=new X[t](n,e);n.extensions.push(r),r.tokenBucket||(r.tokenBucket=new R.TokenBucket(20,25,1e3),r.tokenBucket.content=25),"function"==typeof r.on&&r.on("send",n.handleSendEventFromExtension.bind(n,r)),n[t]=r.expose,n["_".concat(t)]=r}),n}return A(t,e),g(t,[{key:"handleSendEventFromExtension",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.tokenBucket.removeTokens(1,function(){var e=n.activeStanzaInstance;return e?!0===r?e.sendMessage(t):e.sendIQ(t):n.logger.warn("cannot send message, no active stanza client",{data:t,message:r},{skipServer:!0})})}},{key:"checkIsBackgroundAssistant",value:function(){if(this.config.jwt){var e=(0,F.parseJwt)(this.config.jwt);return e&&"urn:purecloud:screenrecording"===e.iss}return!1}},{key:"addInateEventHandlers",value:function(e){this.removeStanzaBoundEventHandlers(),this.boundStanzaDisconnect=this.handleStanzaDisconnectedEvent.bind(this,e),this.boundStanzaNoLongerSubscribed=this.handleNoLongerSubscribed.bind(this,e),this.boundStanzaDuplicateId=this.handleDuplicateId.bind(this,e),this.on(Y,this.boundStanzaDisconnect),this.on($,this.boundStanzaNoLongerSubscribed),this.on(Z,this.boundStanzaDuplicateId),this.extensions.forEach(function(t){"function"==typeof t.handleIq&&e.on("iq",t.handleIq.bind(t)),"function"==typeof t.handleMessage&&e.on("message",t.handleMessage.bind(t))})}},{key:"removeStanzaBoundEventHandlers",value:function(){this.boundStanzaDisconnect&&(this.off(Y,this.boundStanzaDisconnect),this.boundStanzaDisconnect=void 0),this.boundStanzaNoLongerSubscribed&&(this.off($,this.boundStanzaNoLongerSubscribed),this.boundStanzaNoLongerSubscribed=void 0),this.boundStanzaDuplicateId&&(this.off(Z,this.boundStanzaDuplicateId),this.boundStanzaDuplicateId=void 0)}},{key:"proxyStanzaEvents",value:function(e){var t=this;e.originalEmitter=e.emit,e.emit=function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=e.originalEmitter.apply(e,[n].concat(i));return"connected"===n?o:("disconnected"===n&&(n=Y),t.emit.apply(t,[n].concat(i)))}}},{key:"handleStanzaDisconnectedEvent",value:(f=p(s.mark(function e(t){var n,r,i=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("stanzaDisconnected event received",{stanzaInstanceId:t.id,channelId:t.channelId}),this.connected=!1,this.connecting=!1,null===(n=t.pinger)||void 0===n||n.stop(),null===(r=t.serverMonitor)||void 0===r||r.stop(),this.removeAllListeners(Y),this.removeAllListeners($),t.originalEmitter&&(t.emit=t.originalEmitter),this.activeStanzaInstance=void 0,this.emit("disconnected",{reconnecting:this.autoReconnect}),!this.autoReconnect){e.next=1;break}return e.abrupt("return",this.connect({keepTryingOnFailure:!0}).catch(function(e){i.logger.error("Failed to auto reconnect",{keepTryingOnFailure:!0,stanzaInstanceId:t.id,channelId:t.channelId}),i.emit("disconnected",{error:e,reconnecting:!1})}));case 1:case"end":return e.stop()}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"handleNoLongerSubscribed",value:function(e){var t,n;this.logger.warn("noLongerSubscribed event received",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0,this.reconnectOnNoLongerSubscribed||(this.autoReconnect=!1)}},{key:"handleDuplicateId",value:function(e){var t,n;this.logger.warn("duplicate_id event received, forcing hard reconnect",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0}},{key:"disconnect",value:(l=p(s.mark(function e(){var t=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("streamingClient.disconnect was called"),this.jidResource="",e.abrupt("return",(0,F.timeoutPromise)(function(e){t.hardReconnectRequired=!0,t.autoReconnect=!1,t.cancelConnectionAttempt=!0,t.http.stopAllRetries();var n=t.connectionManager.currentStanzaInstance;if(n)return n.disconnect().then(e);e()},5e3,"disconnecting streaming service"));case 1:case"end":return e.stop()}},e,this)})),function(){return l.apply(this,arguments)})},{key:"getSessionStoreKey",value:function(){var e=this.config.appName||this.logger.clientId;return"".concat("sc_connectionData","_").concat(e)}},{key:"getConnectionData",value:function(){var e=sessionStorage.getItem(this.getSessionStoreKey()),t={currentDelayMs:0};if(e)try{return JSON.parse(e)}catch(e){return this.logger.warn("failed to parse streaming client connection data"),t}return t}},{key:"setConnectionData",value:function(e){sessionStorage.setItem(this.getSessionStoreKey(),JSON.stringify(e))}},{key:"increaseBackoff",value:function(){var e=this.getConnectionData(),t=Math.max(2*e.currentDelayMs,4e3),n={currentDelayMs:t,delayMsAfterNextReduction:t/2,nextDelayReductionTime:(new Date).getTime()+5*t,timeOfTotalReset:(new Date).getTime()+36e5};return this.setConnectionData(n),n}},{key:"decreaseBackoff",value:function(e){var t=this,n=this.getConnectionData(),r=5*e,i={currentDelayMs:e,delayMsAfterNextReduction:e/2,nextDelayReductionTime:(new Date).getTime()+r,timeOfTotalReset:n.timeOfTotalReset};if(n.timeOfTotalReset&&n.timeOfTotalReset<(new Date).getTime()||e<ee)return this.logger.debug("decreaseBackoff() called, but timeOfTotalReset has elasped or next delay is below 2s. Resetting backoff"),this.setConnectionData({currentDelayMs:0});this.setConnectionData(i),clearTimeout(this.backoffReductionTimer),this.logger.debug("Setting timer for next backoff reduction since we haven't reached total reset",{msUntilReduction:r,delayMsAfterNextReduction:i.delayMsAfterNextReduction}),this.backoffReductionTimer=setTimeout(function(){return t.decreaseBackoff(i.delayMsAfterNextReduction)},r)}},{key:"getStartingDelay",value:function(e,t){var n=Math.max(e.currentDelayMs,ee);return e.timeOfTotalReset&&e.timeOfTotalReset<(new Date).getTime()?ee:Math.min(n,t)}},{key:"connect",value:(c=p(s.mark(function e(t){var n,r,i,a,o,u,c,l,f,d,h,v,m=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cancelConnectionAttempt=!1,!this.connecting){e.next=1;break}return r=new Error("Already trying to connect streaming client"),e.abrupt("return",this.logger.warn(r));case 1:return this.connecting=!0,i=(null==t?void 0:t.maxDelayBetweenConnectionAttempts)||9e4,a=(null==t?void 0:t.maxConnectionAttempts)||1,(null==t?void 0:t.keepTryingOnFailure)&&(a=1/0),clearTimeout(this.backoffReductionTimer),o=this.getConnectionData(),u=this.getStartingDelay(o,i),c=this.hasMadeInitialAttempt,this.hasMadeInitialAttempt=!0,o.currentDelayMs&&this.logger.debug("streamingClient.connect was called, but backoff is remembered",{currentDelayMs:o.currentDelayMs,delayingThisAttempt:c,clientId:this.logger.clientId,appName:this.config.appName}),e.prev=2,e.next=3,(0,G.backOff)(p(s.mark(function e(){var t,n;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=m.getConnectionData(),e.next=1,m.makeConnectionAttempt();case 1:t.nextDelayReductionTime&&(n=t.nextDelayReductionTime-(new Date).getTime(),m.logger.debug("Setting timer for next backoff reduction",{msUntilReduction:n,delayMsAfterNextReduction:t.delayMsAfterNextReduction}),m.backoffReductionTimer=setTimeout(function(){return m.decreaseBackoff(t.delayMsAfterNextReduction||0)},n));case 2:case"end":return e.stop()}},e)})),{jitter:"none",maxDelay:i,numOfAttempts:a,startingDelay:u,delayFirstAttempt:c,retry:this.backoffConnectRetryHandler.bind(this,{maxConnectionAttempts:a})});case 3:e.next=5;break;case 4:throw e.prev=4,v=e.catch(2),f=v,this.cancelConnectionAttempt?(l=new F.StreamingClientError(U.StreamingClientErrorTypes.userCancelled,"Streaming client connection cancelled",v),f=l):v?"AxiosError"===v.name?(h=(d=v).config||{url:void 0,method:void 0},f={config:{url:h.url,method:h.method},status:null===(n=d.response)||void 0===n?void 0:n.status,code:d.code,name:d.name,message:d.message},l=new F.StreamingClientError(U.StreamingClientErrorTypes.generic,"Failed to connect streaming client due to network error",v),this.networkErrorNeedsAuth(v)&&(l=new F.StreamingClientError(U.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",v))):v instanceof H.default?(l=new F.StreamingClientError(U.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",v),this.saslErrorIsRetryable(v)&&(l=new F.StreamingClientError(U.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received a SASL error",v))):l=new F.StreamingClientError(U.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an unknown error",v):(l=new F.StreamingClientError(U.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an undefined error"),f=l),this.logger.error("Failed to connect streaming client",{error:f}),l;case 5:case"end":return e.stop()}},e,this,[[2,4]])})),function(e){return c.apply(this,arguments)})},{key:"backoffConnectRetryHandler",value:(u=p(s.mark(function e(t,n,r){var i,a,o,u,c,l,f,d,p,h,v,m;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cancelConnectionAttempt){e.next=1;break}return e.abrupt("return",!1);case 1:if(!(r>=t.maxConnectionAttempts)){e.next=2;break}return e.abrupt("return",!1);case 2:if(c={connectionAttempt:r,error:n},n){e.next=3;break}c.error=new Error("streaming client backoff handler received undefined error"),e.next=4;break;case 3:if("AxiosError"!==n.name){e.next=4;break}if(f=(l=n).config||{url:void 0,method:void 0},d={config:{url:f.url,method:f.method},status:null===(i=l.response)||void 0===i?void 0:i.status,code:l.code,name:l.name,message:l.message},c.error=d,!this.networkErrorNeedsAuth(n)){e.next=4;break}return this.logger.error("Streaming client received an error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 4:if(!(n instanceof H.default)){e.next=6;break}if(!this.saslErrorIsRetryable(n)){e.next=5;break}this.logger.info("hardReconnectRequired set to true due to sasl error"),this.hardReconnectRequired=!0,Object.assign(c,{channelId:n.channelId,stanzaInstanceId:n.stanzaInstanceId}),e.next=6;break;case 5:return c.error=n.condition,this.logger.error("Streaming-client received a SASL error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 6:if(n instanceof W.TimeoutError&&(c.error=n.message,(p=n.details)&&(c.details=p)),!(null==n?void 0:n.response)){e.next=8;break}if(!(h=(null===(a=n.response.headers)||void 0===a?void 0:a["retry-after"])||(null===(u=(o=n.response).getResponseHeader)||void 0===u?void 0:u.call(o,"retry-after")))){e.next=8;break}return v=1e3*parseInt(h,10),c.retryDelay=v,this.logger.error("Failed streaming client connection attempt, respecting retry-after header and will retry afterwards.",c),e.next=7,(0,F.delay)(v);case 7:return this.logger.debug("finished waiting for retry-after"),e.abrupt("return",!0);case 8:return m=this.increaseBackoff(),this.logger.error("Failed streaming client connection attempt, retrying",c),this.logger.debug("debug: retry info",{expectedRetryInMs:m.currentDelayMs,appName:this.config.appName,clientId:this.logger.clientId}),e.abrupt("return",!0);case 9:case"end":return e.stop()}},e,this)})),function(e,t,n){return u.apply(this,arguments)})},{key:"networkErrorNeedsAuth",value:function(e){var t;return[401,403].includes((null===(t=e.response)||void 0===t?void 0:t.status)||0)}},{key:"saslErrorIsRetryable",value:function(e){return["encryption-required","incorrect-encoding","invalid-mechanism","malformed-request","mechanism-too-weak"].includes(e.condition)}},{key:"checkNetworkConnectivity",value:(o=p(s.mark(function e(){var t,n;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=1;break}return this.logger.warn("navigator.onLine reports offline — connectivity may be unavailable"),this.emit("networkConnectivityWarning",{reason:"navigator.onLine is false"}),e.abrupt("return",!1);case 1:if(!this.config.jwt||this.config.authToken){e.next=2;break}return this.logger.debug("Skipping active connectivity check in JWT mode, relying on navigator.onLine"),e.abrupt("return",!0);case 2:return e.prev=2,t={method:"get",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger,requestTimeout:1e4},e.next=3,this.http.requestApi("users/me",t);case 3:return e.abrupt("return",!0);case 4:return e.prev=4,n=e.catch(2),this.logger.warn("Active network connectivity check failed — connectivity may be unavailable",{error:n}),this.emit("networkConnectivityWarning",{reason:"active connectivity check failed",error:n}),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,this,[[2,4]])})),function(){return o.apply(this,arguments)})},{key:"makeConnectionAttempt",value:(a=p(s.mark(function e(){var t,n,r,i,a,o,u,c,l,f,d,p=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cancelConnectionAttempt){e.next=1;break}throw new K.default("Connection attempt cancelled");case 1:return this.checkNetworkConnectivity().then(function(e){e||p.logger.warn("Network connectivity check failed, but proceeding with connection attempt anyway")}),i=this.connecting,e.prev=2,e.next=3,this.prepareForConnect();case 3:if(!this.cancelConnectionAttempt){e.next=4;break}throw new K.default("Connection attempt cancelled");case 4:return e.next=5,this.connectionManager.getNewStanzaConnection();case 5:r=e.sent,this.addInateEventHandlers(r),this.proxyStanzaEvents(r),a=E(this.extensions),e.prev=6,a.s();case 7:if((o=a.n()).done){e.next=9;break}if(!(u=o.value).configureNewStanzaInstance){e.next=8;break}return e.next=8,u.configureNewStanzaInstance(r);case 8:e.next=7;break;case 9:e.next=11;break;case 10:e.prev=10,f=e.catch(6),a.e(f);case 11:return e.prev=11,a.f(),e.finish(11);case 12:c=E(this.extensions);try{for(c.s();!(l=c.n()).done;)l.value.handleStanzaInstanceChange(r)}catch(e){c.e(e)}finally{c.f()}return e.next=13,this.setupConnectionMonitoring(r);case 13:this.activeStanzaInstance=r,this.connected=!0,this.connecting=!1,this.emit("connected"),e.next=17;break;case 14:if(e.prev=14,d=e.catch(2),!r){e.next=16;break}return this.logger.error("Error occurred in connection attempt, but after websocket connected. Cleaning up connection so backoff is respected",{stanzaInstanceId:r.id,channelId:r.channelId}),this.removeStanzaBoundEventHandlers(),null===(t=r.pinger)||void 0===t||t.stop(),null===(n=r.serverMonitor)||void 0===n||n.stop(),e.next=15,r.disconnect();case 15:this.connected=!1,this.connecting=i;case 16:throw d;case 17:case"end":return e.stop()}},e,this,[[2,14],[6,10,11,12]])})),function(){return a.apply(this,arguments)})},{key:"setupConnectionMonitoring",value:(i=p(s.mark(function e(t){var n,r=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.connectionTransfer=new Q.ConnectionTransfer(this,t),n=function(e){var n="".concat(e,", falling back to client-side pinging");r.logger.warn(n,{stanzaInstanceId:t.id,channelId:t.channelId}),t.pinger=new L.Ping(r,t)},!this.useServerSidePings){e.next=5;break}return e.prev=1,e.next=2,t.subscribeToNode(this._notifications.pubsubHost,"enable.server.side.pings");case 2:t.serverMonitor=new B.ServerMonitor(this,t),e.next=4;break;case 3:e.prev=3,e.catch(1),n("failed to establish server-side pinging");case 4:e.next=6;break;case 5:n("client configured to not use server-side pinging");case 6:case"end":return e.stop()}},e,this,[[1,3]])})),function(e){return i.apply(this,arguments)})},{key:"prepareForConnect",value:(n=p(s.mark(function e(){var t,n,i,a,o,u,c,l,f,d;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.jwt){e.next=1;break}return this.hardReconnectRequired=!1,e.abrupt("return",this.connectionManager.setConfig(this.config));case 1:if(this.hardReconnectRequired||(this.channelReuses++,this.channelReuses>=10&&(this.logger.warn("Forcing a hard reconnect due to max channel reuses",{channelId:this.config.channelId,channelReuses:this.channelReuses}),this.channelReuses=0,this.hardReconnectRequired=!0)),!this.hardReconnectRequired){e.next=4;break}return this.config.userId&&this.config.jid?t=Promise.resolve({userId:this.config.userId,jid:this.config.jid}):(n={method:"get",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},t=this.http.requestApi("users/me",n).then(function(e){return{userId:e.data.id,jid:e.data.chat.jabberId}})),this.jidResource=this.config.jidResource||globalThis.crypto.randomUUID(),i={method:"post",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},e.next=2,this.http.requestApi("notifications/channels?connectionType=streaming",i).then(function(e){return e.data.id});case 2:return a=e.sent,e.next=3,Promise.all([t,a]);case 3:o=e.sent,u=r(o,2),c=u[0],l=c.userId,f=c.jid,d=u[1],this.config.userId=l,this.config.jid=f,this.config.jidResource=this.jidResource,this.config.channelId=d,this.autoReconnect=!0,this.logger.info("attempting to connect streaming client on channel",{channelId:d}),this.connectionManager.setConfig(this.config),this.hardReconnectRequired=!1;case 4:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"stopServerLogging",value:function(){this.logger.sendAllLogsInstantly(),this.logger.stopServerLogging()}},{key:"startServerLogging",value:function(){this.logger.startServerLogging()}},{key:"setAccessToken",value:function(e){this.config.authToken=e,this.logger.setAccessToken(e)}},{key:"version",get:function(){return t.version}}],[{key:"extend",value:function(e,t){if(X[e])throw new Error("Cannot register already existing namespace ".concat(e));X[e]=t}},{key:"version",get:function(){return"20.1.0"}}]);var n,i,a,o,u,c,l,f}(z.default);n.Client=te}),i=n.cw(function(e,t){var n=Te(),r=he(),i=ve(),a=me(),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionManager=void 0;var s=L(),u=o(m()),c=S(),l=function(){return a(function e(t,n){i(this,e),this.logger=t,this.config=n},[{key:"setConfig",value:function(e){this.config=e}},{key:"getNewStanzaConnection",value:(e=r(n.mark(function e(){var t,r,i,a,o,u,l,f,d=this;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getStanzaOptions(),r=(0,s.createClient)({}),this.currentStanzaInstance=r,r.sasl.mechanisms.find(function(e){return"ANONYMOUS"===e.name}).priority=0,r.sasl.mechanisms=r.sasl.mechanisms.sort(function(e,t){return t.priority-e.priority}),r.id=globalThis.crypto.randomUUID(),i=r.channelId=this.config.channelId,(f=(0,c.timeoutPromise)(function(e,n){a=d.checkForErrorStanza.bind(d,r),r.on("raw:incoming",a),o=d.handleSessionStarted.bind(d,r,e),r.on("session:started",o),u=d.handleSessionSasl.bind(d,r,n),r.on("sasl",u),l=d.handleSessionDisconnected.bind(d,r,n),r.on("disconnected",l),r.updateConfig(t),r.connect()},15e3,"connecting to streaming service",{channelId:i,stanzaInstanceId:r.id})).catch(function(){return r.disconnect()}),e.abrupt("return",f.finally(function(){r.off("raw:incoming",a),r.off("session:started",o),r.off("sasl",u),r.off("disconnected",l)}));case 1:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"handleSessionStarted",value:function(e,t){this.logger.info("new stanza instance connected",{stanzaInstanceId:e.id,channelId:e.channelId}),t(e)}},{key:"handleSessionSasl",value:function(e,t,n){"failure"===n.type&&t(new u.default(n.condition,e.channelId,e.id))}},{key:"handleSessionDisconnected",value:function(e,t){this.logger.error("stanza disconnected",{stanzaInstanceId:e.id,channelId:e.channelId}),t()}},{key:"checkForErrorStanza",value:function(e,t){t.includes("error")&&this.logger.error("Received a stanza during setup that tripped the error filter",{rawStanza:t,stanzaInstanceId:e.id,channelId:e.channelId})}},{key:"getStanzaOptions",value:function(){return this.config.jwt?this.getJwtOptions():this.getStandardOptions()}},{key:"getJwtOptions",value:function(){var e,t=this.config,n=(0,c.parseJwt)(t.jwt).data.jid;try{e=n.split("@")[1].replace("conference.","")}catch(e){throw new Error("failed to parse jid")}var r=t.host.replace(/\/$/,"");return{resource:t.jidResource,transports:{websocket:"".concat(r,"/stream/jwt/").concat(t.jwt)},server:e}}},{key:"getStandardOptions",value:function(){var e=this.config,t=e.host.replace(/\/$/,"");return{jid:e.jid,resource:e.jidResource,credentials:{username:e.jid,password:"authKey:".concat(e.authToken)},transports:{websocket:"".concat(t,"/stream/channels/").concat(e.channelId)}}}}]);var e}();t.ConnectionManager=l}),a=()=>n(5065),o=n.cw(function(e,t){var n=ge(),r=ve(),i=me();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return u(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;var l=c(Ae()),f=S(),d="inin-correlation-id",p=function(){function e(t){r(this,e),this._httpRetryingRequests=new Map,this.customHeaders=null==t?void 0:t.customHeaders}return i(e,[{key:"requestApiWithRetry",value:function(t,n,r){var i=this,a=n.maxAttempts||10,o=0,s=(0,f.retryPromise)(this.requestApi.bind(this,t,n),function(r){var i,s,u;if(++o>=a)return(n.logger||console).info("Max retries reached, will not retry.",{maxRetries:a,retryCount:o,path:t}),!1;var c=!1;if(null==r?void 0:r.response){c=e.retryStatusCodes.has(r.response.status||0);var l=(null===(i=r.response.headers)||void 0===i?void 0:i["retry-after"])||(null===(u=(s=r.response).getResponseHeader)||void 0===u?void 0:u.call(s,"retry-after"));l&&((n.logger||console).debug("retry-after header found on response. setting retry delay",{retryAfter:l}),c=1e3*parseInt(l,10))}return(null==r?void 0:r.code)&&!1===c&&e.retryNetworkErrorCodes.has(r.code)&&((n.logger||console).debug("Retry network error code found, will retry.",{code:r.code}),c=!0),c},r,n.logger);return this._httpRetryingRequests.set(s._id,s),s.promise.then(function(){return i.cancelRetryRequest(s._id)},function(){return i.cancelRetryRequest(s._id)}),s}},{key:"requestApi",value:function(e,t){var n=t.logger||console,r=(new Date).getTime();t.customHeaders=o(o({},this.customHeaders||{}),t.customHeaders||{});var i=this._buildUri(t.host,e,t.version),a=o({"content-type":t.contentType||"application/json"},t.customHeaders),s={method:t.method,url:i,data:t.data,responseType:t.responseType,timeout:t.requestTimeout||3e4,headers:a,signal:t.signal};t.noAuthHeader||(s.headers.Authorization="Bearer ".concat(t.authToken));var u=this.handleResponse.bind(this,n,r,s);return(0,l.default)(s).then(u,u)}},{key:"handleResponse",value:function(e,t,n,r){var i,a,s,u=(new Date).getTime(),c=u-t+"ms";if(r instanceof l.AxiosError){if((null===(a=null===(i=r.config)||void 0===i?void 0:i.headers)||void 0===a?void 0:a.Authorization)&&(r.config.headers.Authorization="redacted"),"ECONNABORTED"===r.code)return e.debug("request error: ".concat(n.url),{message:r.message,now:u,elapsed:c},{skipServer:!0}),Promise.reject(r);var f=r.response||{},p=f.status,h=f.headers&&f.headers[d],v=f.data,m=o(o({},r),{},{text:null===(s=f.request)||void 0===s?void 0:s.response});return e.debug("request error: ".concat(n.url),{message:r.message,now:u,elapsed:c,status:p,correlationId:h,body:v},{skipServer:!0}),Promise.reject(m)}var g=r.status,y=r.headers[d],b=JSON.stringify(r.data);return e.debug("response: ".concat(n.method.toUpperCase()," ").concat(n.url),{now:u,status:g,elapsed:c,correlationId:y,body:b},{skipServer:!0}),Promise.resolve(r)}},{key:"stopAllRetries",value:function(){var e=this;Array.from(this._httpRetryingRequests.keys()).forEach(function(t){return e.cancelRetryRequest(t)})}},{key:"cancelRetryRequest",value:function(e){var t=this._httpRetryingRequests.get(e);return t&&(t.cancel(new Error("Retry request cancelled")),this._httpRetryingRequests.delete(e)),!0}},{key:"formatRequestError",value:function(e){if(this.isSuperagentNetworkError(e))return{status:e.status,method:e.method,url:e.url,crossDomain:e.crossDomain,message:e.message,name:e.name,stack:e.stack};if(this.isSuperagentResponseError(e)){var t=e.response;return{status:e.status,correlationId:t.headers["inin-correlation-id"],message:"Error making HTTP request",method:t.req.method,name:t.error.name,stack:t.error.stack}}return e}},{key:"isSuperagentNetworkError",value:function(e){return e&&e.hasOwnProperty("status")&&e.hasOwnProperty("method")&&e.hasOwnProperty("url")}},{key:"isSuperagentResponseError",value:function(e){return!!(e&&e.response&&e.response.body&&e.response.req)}},{key:"_buildUri",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"v2";return t=t.replace(/^\/+|\/+$/g,""),0===e.indexOf("http")?"".concat(e,"/api/").concat(n,"/").concat(t):"https://api.".concat(e,"/api/").concat(n,"/").concat(t)}}])}();t.HttpClient=p,p.retryStatusCodes=new Set([408,413,429,500,502,503,504]),p.retryNetworkErrorCodes=new Set(["ECONNABORTED","ECONNRESET","ERR_NETWORK","ETIMEDOUT"])}),s=n.cw(function(e,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.parseJwt=n.StreamingSubscriptionError=n.StreamingClientError=n.HttpClient=void 0;var a=t();i(p(),n),i(g(),n),i(v(),n),i(h(),n),i(u(),n);var s=o();Object.defineProperty(n,"HttpClient",{enumerable:!0,get:function(){return s.HttpClient}});var c=S();Object.defineProperty(n,"StreamingClientError",{enumerable:!0,get:function(){return c.StreamingClientError}}),Object.defineProperty(n,"StreamingSubscriptionError",{enumerable:!0,get:function(){return c.StreamingSubscriptionError}}),Object.defineProperty(n,"parseJwt",{enumerable:!0,get:function(){return c.parseJwt}}),n.default=a.Client}),u=n.cw(function(e,t){var n=Te(),r=he(),i=ge(),a=ve(),o=me(),s=_e(),u=be(),c=Se();function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.MessengerExtension=void 0;var p=de(),h=j(),v=function(e){function t(e,n){var r,i,o,c;return a(this,t),i=this,o=u(o=t),(r=s(i,d()?Reflect.construct(o,[],u(i).constructor):o.apply(i,c))).client=e,r.stanzaInstance=n,r}return c(t,e),o(t,[{key:"bareJid",get:function(){return(0,h.toBare)(this.stanzaInstance.jid)}},{key:"handleStanzaInstanceChange",value:function(e){this.stanzaInstance=e}},{key:"isMediaMessage",value:function(e){return!!e.mediaMessage}},{key:"handleMessage",value:function(e){if(this.isMediaMessage(e)){var t=e.from===this.stanzaInstance.jid,n=(0,h.toBare)(e.from)===this.bareJid;this.emit("mediaMessage",f(f({},e),{},{fromMyClient:t,fromMyUser:n}))}}},{key:"broadcastMessage",value:(i=r(n.mark(function e(t){var r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=globalThis.crypto.randomUUID(),t.id=r,t.from=this.stanzaInstance.jid,t.to||(t.to=this.bareJid),e.next=1,this.stanzaInstance.send("message",t);case 1:return e.abrupt("return",r);case 2:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"expose",get:function(){return{broadcastMessage:this.broadcastMessage.bind(this),on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeListener:this.removeListener.bind(this),addListener:this.addListener.bind(this)}}}]);var i}(p.Emitter);t.MessengerExtension=v}),c=n.cw(function(e,t){var n=xe(),r=ge(),i=Te(),a=he(),o=ve(),u=me(),c=Oe();function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Notifications=void 0;var p=d(O()),h=S(),v=s(),m=1e3;function g(e,t){return[].concat(c(e),c(t)).filter(function(e,t,n){return n.indexOf(e)===t})}var y=function(){return u(function e(t,n){var r;o(this,e),this.subscriptions={},this.bulkSubscriptions={},this.topicPriorities={},this.internalSubscriptions=[],this.client=t,this.enablePartialBulkResubscribe=null!==(r=null==n?void 0:n.enablePartialBulkResubscribe)&&void 0!==r&&r,t.on("pubsub:event",this.pubsubEvent.bind(this)),t.on("connected",this.subscriptionsKeepAlive.bind(this)),this.debouncedResubscribe=(0,p.default)(this.resubscribe.bind(this),100)},[{key:"pubsubHost",get:function(){try{var e=this.client.config.apiHost.replace(/http(s?):\/\//,"");return"notifications.".concat(e)}catch(e){return"notifications.mypurecloud.com"}}},{key:"handleStanzaInstanceChange",value:function(e){var t=this,n=this.stanzaInstance&&this.stanzaInstance.id!==e.id&&this.stanzaInstance.channelId!==e.channelId;this.stanzaInstance=e,n&&(this.client.logger.info("resubscribing due to hard reconnect"),this.debouncedResubscribe().catch(function(e){var n="Error resubscribing to topics";t.client.logger.error(n,e),t.client.emit("pubsub:error",{msg:n,err:e})}))}},{key:"topicHandlers",value:function(e){return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e]}},{key:"pubsubEvent",value:function(e){var t=e.pubsub,n=t.items.node;n.includes("no_longer_subscribed")?n="no_longer_subscribed":n.includes("duplicate_id")&&(n="duplicate_id");var r=t.items.published[0].content.json,i=this.topicHandlers(n);this.client.emit("notify",{topic:n,data:r}),this.client.emit("notify:".concat(n),r),i.forEach(function(e){e(r)})}},{key:"xmppSubscribe",value:(f=a(i.mark(function e(t){var n,r=this;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.topicHandlers(t).length&&!this.bulkSubscriptions[t]){e.next=1;break}return e.abrupt("return",Promise.resolve());case 1:if(n=function(){return r.stanzaInstance.subscribeToNode(r.pubsubHost,t)},!this.client.connected){e.next=2;break}return e.abrupt("return",n());case 2:return e.abrupt("return",new Promise(function(e,t){r.client.once("connected",function(){return n().then(e,t)})}));case 3:case"end":return e.stop()}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"xmppUnsubscribe",value:function(e){var t=this;if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();var n=function(){return t.stanzaInstance.unsubscribeFromNode(t.pubsubHost,e)};return this.client.connected?n():new Promise(function(e,r){t.client.once("connected",function(){return n().then(e,r)})})}},{key:"mapCombineTopics",value:function(e){var t=this,n={},r=[],i=[];e.forEach(function(e){e.includes("?")?r.push({id:e}):i.push(e)}),i.map(function(e){var t=e.split("."),n=t.splice(t.length-1);return{prefix:t.join("."),postfix:n}}).forEach(function(e){n[e.prefix]?n[e.prefix].push(e.postfix):n[e.prefix]=[e.postfix]});var a=[],o=function(e,n){var r=1===n.length?".":"?",i="".concat(e).concat(r).concat(n.join("&"));i.length<200?a.push({id:i}):1===n.length?t.client.logger.error("Refusing to attempt topic with length > 200",i):(o(e,n.slice(0,n.length/2)),o(e,n.slice(n.length/2)))};Object.keys(n).forEach(function(e){var t=n[e];o(e,t)});var s=a.concat(r);return this.truncateTopicList(this.prioritizeTopicList(s))}},{key:"prioritizeTopicList",value:function(e){var t=this;return e.sort(function(e,n){return t.getTopicPriority(n.id)-t.getTopicPriority(e.id)}),e}},{key:"getTopicPriority",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getTopicParts(e),r=n.prefix,i=n.postfixes,a=this.topicPriorities[r],o=a&&Object.keys(a).filter(function(e){return i.includes(e)}).map(function(e){return a[e]}),s=o&&o.length&&o.reduce(function(e,t){return t>e?t:e});return t?s||0:s}},{key:"truncateTopicList",value:function(e){var t=e.slice(0,m);if(e.length>m){var n=e.slice(m);if(n.length>20){var r=n.length-20;(n=n.slice(20)).push("...and ".concat(r," more"))}this.client.logger.warn("Too many topics to subscribe to; truncating extra topics",{droppedTopics:n})}return t}},{key:"makeBulkSubscribeRequest",value:(c=a(i.mark(function e(t,n){var r,a,o,s,u=this;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.pendingConnectedWait&&(this.pendingConnectedWait.cancel(new Error("Superseded by newer bulk subscribe request")),this.pendingConnectedWait=void 0),this.pendingBulkSubscribeRetry&&!this.pendingBulkSubscribeRetry.hasCompleted()&&(this.client.logger.info("Cancelling previous bulk subscribe retry — new request supersedes it"),this.pendingBulkSubscribeRetry.cancel(new Error("Superseded by newer bulk subscribe request"))),this.client.connected){e.next=1;break}return this.client.logger.info("Client not connected, waiting for reconnection before bulk subscribe",{topicCount:t.length}),e.next=1,new Promise(function(e,t){var n=function(){u.pendingConnectedWait=void 0,e()};u.client.once("connected",n),u.pendingConnectedWait={cancel:function(e){u.client.off("connected",n),t(e)}}});case 1:return r={method:n.replace?"put":"post",host:this.client.config.apiHost,authToken:this.client.config.authToken,data:JSON.stringify(this.mapCombineTopics(t)),logger:this.client.logger,maxAttempts:3},a=this.stanzaInstance.channelId,o="notifications/channels/".concat(a,"/subscriptions"),this.enablePartialBulkResubscribe&&(o+="?ignoreErrors=true"),s=this.client.http.requestApiWithRetry(o,r,2e3),this.pendingBulkSubscribeRetry=s,e.abrupt("return",s.promise);case 2:case"end":return e.stop()}},e,this)})),function(e,t){return c.apply(this,arguments)})},{key:"createSubscription",value:function(e,t){var n=this;(0,h.splitIntoIndividualTopics)(e).forEach(function(e){var r=n.topicHandlers(e);r.includes(t)||r.push(t)})}},{key:"removeSubscription",value:function(e,t){var n=this;(0,h.splitIntoIndividualTopics)(e).forEach(function(e){var r=n.topicHandlers(e),i=r.indexOf(t);i>-1&&r.splice(i,1),r.length||delete n.subscriptions[e]})}},{key:"removeTopicPriority",value:function(e){var t=this;if(this.getTopicPriority(e,!1)){var n=this.getTopicParts(e),r=n.prefix;n.postfixes.forEach(function(e){delete t.topicPriorities[r][e]}),Object.keys(this.topicPriorities[r]).length||delete this.topicPriorities[r]}}},{key:"getActiveIndividualTopics",value:function(){var e=this,t=[];return Object.keys(this.subscriptions).forEach(function(n){"streaming-subscriptions-expiring"!==n&&e.topicHandlers(n).length>0&&t.push(n)}),t}},{key:"resubscribe",value:function(){var e=Object.keys(this.bulkSubscriptions);return e.length+this.getActiveIndividualTopics().length===0?Promise.resolve({}):this.bulkSubscribe(e,{replace:!0})}},{key:"subscriptionsKeepAlive",value:function(){var e=this,t="streaming-subscriptions-expiring";0===this.topicHandlers(t).length&&this.createSubscription(t,function(){e.client.logger.info("".concat(t," - Triggering resubscribe."),{channelId:e.client.config.channelId}),e.debouncedResubscribe().catch(function(t){var n="Error resubscribing to topics";e.client.logger.error(n,t),e.client.emit("pubsub:error",{msg:n,err:t})})})}},{key:"getTopicParts",value:function(e){var t=e.includes("?"),n=t?"?":".",r=e.split(n),i=t?r[1]:r.splice(r.length-1);return{prefix:t?r[0]:r.join("."),postfixes:t?i.split("&"):i}}},{key:"setTopicPriorities",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach(function(n){var r=e.getTopicParts(n),i=e.topicPriorities[r.prefix],a=t[n];if(i)r.postfixes.forEach(function(e){var t=i[e];(t&&t<a||!t)&&(i[e]=a)});else{var o=r.postfixes.reduce(function(e,t){return e[t]=a,e},{});e.topicPriorities[r.prefix]=o}})}},{key:"subscribe",value:(s=a(i.mark(function e(t,a,o,s){var u,c,l,f,d;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s&&this.setTopicPriorities(r({},t,s)),u=o?this.xmppSubscribe(t):this.debouncedResubscribe(),a?this.createSubscription(t,a):this.bulkSubscriptions[t]=!0,e.next=1,u;case 1:if(c=e.sent,l={topic:t,state:"Permitted"},this.enablePartialBulkResubscribe&&c&&"object"===n(c)&&b(c[t])&&(l=c[t]),"Permitted"===l.state){e.next=2;break}throw f=l.rejectionReason||"Failed to subscribe topic ".concat(t),d=l.missingPermissions,new v.StreamingSubscriptionError(f,t,"subscribe",{missingPermissions:d});case 2:return e.abrupt("return",l);case 3:case"end":return e.stop()}},e,this)})),function(e,t,n,r){return s.apply(this,arguments)})},{key:"_subscribeInternal",value:(t=a(i.mark(function e(t){var n;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.internalSubscriptions.includes(t)){e.next=1;break}return e.abrupt("return",Promise.resolve());case 1:return this.setTopicPriorities(r({},t,Number.MAX_VALUE)),n=this.xmppSubscribe(t),this.internalSubscriptions.push(t),this.bulkSubscriptions[t]=!0,e.abrupt("return",n);case 2:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"unsubscribe",value:function(e,t,n){return t?this.removeSubscription(e,t):(delete this.bulkSubscriptions[e],delete this.subscriptions[e]),this.removeTopicPriority(e),n?this.xmppUnsubscribe(e):this.debouncedResubscribe()}},{key:"bulkSubscribe",value:(e=a(i.mark(function e(t){var n,r,a,o,s,u,c,f,d,p,v,m,y,b,S,_,w,O,x,k,T,A,E,I,N,j,R=this,P=arguments;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=P.length>1&&void 0!==P[1]?P[1]:{replace:!1,force:!1},r=P.length>2&&void 0!==P[2]?P[2]:{},this.setTopicPriorities(r),s=g(t,this.internalSubscriptions),n.replace&&!n.force?s=g(s,this.getActiveIndividualTopics()):n.force&&(this.subscriptions={}),e.prev=1,e.next=2,this.makeBulkSubscribeRequest(s,n);case 2:u=e.sent,e.next=5;break;case 3:if(e.prev=3,j=e.catch(1),!(null===(a=null==j?void 0:j.message)||void 0===a?void 0:a.includes("Superseded by newer bulk subscribe request"))){e.next=4;break}this.client.logger.debug("Bulk subscribe was superseded, deferring to newer request"),c={},f=l(s);try{for(f.s();!(d=f.n()).done;)p=d.value,c[p]={topic:p,state:"Unknown"}}catch(e){f.e(e)}finally{f.f()}return e.abrupt("return",c);case 4:throw j;case 5:v=[],u&&u.data&&"entities"in u.data&&Array.isArray(u.data.entities)&&(v=u.data.entities),m={},y=l(v);try{for(y.s();!(b=y.n()).done;)if(S=b.value,_=S.id,w=S.state,O=S.rejectionReason,x=S.missingPermissions,m[_]={topic:_,state:w,rejectionReason:O,missingPermissions:x},_.includes("?")){k=l((0,h.splitIntoIndividualTopics)(_));try{for(k.s();!(T=k.n()).done;)A=T.value,m.hasOwnProperty(A)||(m[A]=m[_])}catch(e){k.e(e)}finally{k.f()}}}catch(e){y.e(e)}finally{y.f()}n.replace&&(this.bulkSubscriptions={}),t.forEach(function(e){R.bulkSubscriptions[e]=!0}),this.internalSubscriptions.forEach(function(e){R.bulkSubscriptions[e]=!0}),E=l(s);try{for(E.s();!(I=E.n()).done;)N=I.value,null!==(o=m[N])&&void 0!==o||(m[N]={topic:N,state:this.enablePartialBulkResubscribe?"Unknown":"Permitted"})}catch(e){E.e(e)}finally{E.f()}return e.abrupt("return",m);case 6:case"end":return e.stop()}},e,this,[[1,3]])})),function(t){return e.apply(this,arguments)})},{key:"expose",get:function(){return{subscribe:this.subscribe.bind(this),unsubscribe:this.unsubscribe.bind(this),bulkSubscribe:this.bulkSubscribe.bind(this)}}}]);var e,t,s,c,f}();function b(e){var t=!1,r=!1;return e&&"object"===n(e)&&(t="topic"in e&&"string"==typeof e.topic,r="state"in e&&["Permitted","Rejected","Unknown"].includes(e.state)),t&&r}t.Notifications=y}),l=()=>n(3761),f=n.cw(function(e,t){n.g||Object.defineProperty(window,"crypto",{value:window.crypto||window.msCrypto,writable:!1,configurable:!1})}),d=()=>n(925),p=n.cw(function(e,t){var n=ge(),r=Te(),i=he(),a=ve(),o=me();function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GenesysCloudMediaSession=void 0;var l=c(pe()),f=x(),d=S(),p=h(),v=function(){return o(function e(t,n){var r=this;a(this,e),this.webrtcExtension=t,this.iceCandidatesDiscovered=0,this.iceCandidatesReceivedFromPeer=0,this.state="pending",this.connectionState="starting",this.id=n.id,this.fromJid=n.fromJid,this.peerID=n.peerID,this.logger=n.logger,this.conversationId=n.conversationId,this.fromUserId=n.fromUserId,this.pc=this.peerConnection=new RTCPeerConnection({iceServers:n.iceServers,iceTransportPolicy:n.iceTransportPolicy}),this.originalRoomJid=n.originalRoomJid,this.sessionType=p.SessionTypes[n.sessionType],this.ignoreHostCandidatesFromRemote=!!n.ignoreHostCandidatesFromRemote,this.allowIPv6=!!n.allowIPv6,this.allowTCP=!!n.allowTCP,this.reinvite=!!n.reinvite,this.privAnswerMode=n.privAnswerMode,this.meetingId=n.meetingId;var i=new f.EventEmitter;Object.keys(i.__proto__).forEach(function(e){r[e]=i[e]}),n.optOutOfWebrtcStatsTelemetry||this.setupStatsGatherer(),this.peerConnection.addEventListener("icecandidate",this.onIceCandidate.bind(this)),this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceStateChange.bind(this)),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange.bind(this)),this.peerConnection.addEventListener("icecandidateerror",this.onIceCandidateError.bind(this))},[{key:"keepStateInSyncWithPeerConnection",value:function(){var e=this;this.stateSyncTimeout&&(clearTimeout(this.stateSyncTimeout),this.stateSyncTimeout=void 0);var t=Date.now();this.stateSyncTimeout=setTimeout(function(){Date.now()-t>4e3&&(e.log("warn","MediaSession detected timer anomally. Reasons include taxed resources or system sleep."),"ended"!==e.state&&["failed","closed"].includes(e.peerConnection.connectionState)&&(e.log("warn","state mismatch between session.state and peerConnection.connectionState, manually terminating the session",{sessionId:e.id,conversationId:e.conversationId,sessionType:e.sessionType}),e.onSessionTerminate())),"ended"!==e.state&&e.keepStateInSyncWithPeerConnection()},2e3)}},{key:"setRemoteDescription",value:(S=i(r.mark(function e(t){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.peerConnection.setRemoteDescription({sdp:t,type:"offer"}));case 1:case"end":return e.stop()}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"log",value:function(e,t,n,r){n||(n={});var i=u(u({},n),this.getLogDetails());this.logger[e](t,i,r)}},{key:"sendGenesysWebrtc",value:(b=i(r.mark(function e(t){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.id=t.id||globalThis.crypto.randomUUID(),t.jsonrpc=t.jsonrpc||"2.0",n={type:"set",genesysWebrtc:t,from:this.webrtcExtension.jid,to:this.peerID},e.abrupt("return",this.webrtcExtension.sendIq(n));case 1:case"end":return e.stop()}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"end",value:(y=i(r.mark(function e(){var t,n,i,a=this,o=arguments;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:"success",n=o.length>1&&void 0!==o[1]&&o[1],this.state="ended",i={sessionId:this.id,reason:t.condition||t},n){e.next=1;break}return e.next=1,(0,d.timeoutPromise)(function(e,t){a.log("info","sending sdp terminate"),a.sendGenesysWebrtc({jsonrpc:"2.0",method:"terminate",params:i}).then(e,t)},2e3,"Timeout waiting for response to termination request",{sessionId:this.id,conversationId:this.conversationId,sessionType:this.sessionType}).catch(function(e){return a.logger.error(e)});case 1:this.onSessionTerminate(i.reason);case 2:case"end":return e.stop()}},e,this)})),function(){return y.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new l.default(this.peerConnection),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:(g=i(r.mark(function e(){var t,n,i,a,o;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.peerConnection.iceConnectionState,n=this.id,i=this.conversationId,a=this.sessionType,this.log("info","ICE state changed: ",{iceState:t,sessionId:n,conversationId:i}),"disconnected"!==t){e.next=1;break}"stable"===this.peerConnection.signalingState&&(this.interruptionStart=new Date,this.log("info","Connection state is interrupted",{sessionId:n,conversationId:i,sessionType:a})),e.next=4;break;case 1:if("connected"!==t){e.next=3;break}return this.log("info","sending session-info: active"),o={sessionId:this.id,status:"active"},e.next=2,this.sendGenesysWebrtc({jsonrpc:"2.0",params:o,method:"info"});case 2:this._setupDataChannel(),e.next=4;break;case 3:"failed"===t&&this.log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer});case 4:case"end":return e.stop()}},e,this)})),function(){return g.apply(this,arguments)})},{key:"onConnectionStateChange",value:function(){var e=this.connectionState=this.peerConnection.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if("connected"===e&&this.keepStateInSyncWithPeerConnection(),this.log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this.log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&(this.log("info","Connection was interrupted and failed to recover, cleaning up",{sessionId:t,conversationId:n,sessionType:r}),this.onSessionTerminate());this.emit("connectionState",e)}},{key:"onIceCandidateError",value:function(e){var t=e;this.log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url})}},{key:"createIceCandidate",value:function(e,t){return new RTCIceCandidate({sdpMid:e,candidate:t})}},{key:"addRemoteIceCandidate",value:(m=i(r.mark(function e(t){var n,i,a;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.match(/m=([^\s]+)/)[1],i=t.match(/a=([^\\\r]+)/)[1],a=this.createIceCandidate(n,i),e.next=1,this.peerConnection.addIceCandidate(a);case 1:case"end":return e.stop()}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"onIceCandidate",value:function(e){var t,n,r,i=null===(t=e.candidate)||void 0===t?void 0:t.candidate,a=null===(n=e.candidate)||void 0===n?void 0:n.sdpMid;if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var o=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(o&&!o[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this.log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this.log("debug","Processing ice candidate",e.candidate),this.log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++,r="m=".concat(a," 9 RTP/AVP 0\r\na=").concat(i,"\r\n")}else r="a=end-of-candidates\r\n",this.emit("endOfCandidates");return this.sendGenesysWebrtc({jsonrpc:"2.0",method:"iceCandidate",params:{sessionId:this.id,sdp:r}})}},{key:"onSessionTerminate",value:function(e){this.state="ended",this.peerConnection&&this.peerConnection.close(),this.logger.info("emitting sdp media-session (terminate)"),this.emit("terminated",{condition:e||"success"})}},{key:"addTrack",value:(v=i(r.mark(function e(t,n){var i;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.peerConnection.getTransceivers().find(function(e){var n;return!e.sender.track&&(null===(n=e.receiver.track)||void 0===n?void 0:n.kind)===t.kind}))){e.next=1;break}return e.abrupt("return",i.sender.replaceTrack(t));case 1:this.peerConnection.addTrack(t,n);case 2:case"end":return e.stop()}},e,this)})),function(e,t){return v.apply(this,arguments)})},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.peerConnection.remoteDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this.log("info","creating data channel"),this.dataChannel=this.peerConnection.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",function(){t.log("info","data channel opened")}),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",function(){t.log("info","closing data channel")}),this.dataChannel.addEventListener("error",function(e){t.log("error","Error occurred with the data channel",e)}))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this.log("error","Failed to parse data channel message",{error:e})}}},{key:"accept",value:(h=i(r.mark(function e(){var t,n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",e.next=1,this.peerConnection.createAnswer();case 1:return t=e.sent,e.next=2,this.peerConnection.setLocalDescription(t);case 2:return n={sdp:t.sdp,sessionId:this.id},this.logger.info("sending sdp answer",{sessionId:this.id,conversationId:this.conversationId}),e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"answer",params:n}));case 3:case"end":return e.stop()}},e,this)})),function(){return h.apply(this,arguments)})},{key:"mute",value:(c=i(r.mark(function e(t,n){var i;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"mute",params:i}));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return c.apply(this,arguments)})},{key:"unmute",value:(s=i(r.mark(function e(t,n){var i;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"unmute",params:i}));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return s.apply(this,arguments)})},{key:"removeTrack",value:(n=i(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)})},{key:"hold",value:(t=i(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)})},{key:"resume",value:(e=i(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)})},{key:"toString",value:function(){return{connectionState:this.connectionState,state:this.state,sessionType:this.sessionType,fromJid:this.fromJid,conversationId:this.conversationId,id:this.id,peerConnection:this.peerConnection}}}]);var e,t,n,s,c,h,v,m,g,y,b,S}();t.GenesysCloudMediaSession=v}),h=n.cw(function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionTypes=t.StreamingClientErrorTypes=t.AlertableInteractionTypes=void 0,(t.AlertableInteractionTypes||(t.AlertableInteractionTypes={})).voice="voice",(r=t.StreamingClientErrorTypes||(t.StreamingClientErrorTypes={})).generic="generic",r.invalid_token="invalid_token",r.userCancelled="user_cancelled",(n=t.SessionTypes||(t.SessionTypes={})).softphone="softphone",n.collaborateVideo="collaborateVideo",n.acdScreenShare="screenShare",n.screenRecording="screenRecording",n.liveScreenMonitoring="liveScreenMonitoring",n.unknown="unknown"}),v=n.cw(function(e,t){Object.defineProperty(t,"__esModule",{value:!0})}),m=()=>n(9399),g=n.cw(function(e,t){var n=ge(),r=xe(),i=Te(),a=he(),o=ve(),s=me(),u=_e(),c=be(),l=ye(),f=Se();function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function y(e,t,n,r){var i=l(c(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var b=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StanzaMediaSession=void 0;var S=b(x()),_=B(),w=N(),O=b(pe()),k=h(),T={"Discovered new ICE candidate":{skipMessage:!0}},A=function(e){function t(e){var n,r,i,a;o(this,t),r=this,i=t,a=[e.options],i=c(i),(n=u(r,g()?Reflect.construct(i,a||[],c(r).constructor):i.apply(r,a))).iceCandidatesDiscovered=0,n.iceCandidatesReceivedFromPeer=0,n.reinvite=!1,n.logger=e.logger,n.conversationId=e.conversationId,n.peerConnection=n.pc,n.fromUserId=e.fromUserId,n.meetingId=e.meetingId,n.id=n.sid,n.originalRoomJid=e.originalRoomJid,n.sessionType=k.SessionTypes[e.sessionType],n.ignoreHostCandidatesFromRemote=!!e.ignoreHostCandidatesFromRemote,n.allowIPv6=!!e.allowIPv6,n.allowTCP=!!e.allowTCP,n.privAnswerMode=e.privAnswerMode;var s=new S.default;return Object.keys(s.__proto__).forEach(function(e){n[e]=s[e]}),e.optOutOfWebrtcStatsTelemetry||n.setupStatsGatherer(),n.pc.addEventListener("connectionstatechange",n.onConnectionStateChange.bind(n)),n.pc.addEventListener("icecandidateerror",n.onIceCandidateError.bind(n)),n}return f(t,e),s(t,[{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"onTransportInfo",value:(l=a(i.mark(function e(n,r){var a,o,s,u,c,l,f,d;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null===(a=n.contents)||void 0===a?void 0:a[0].transport,u=null==s?void 0:s.candidates,this.ignoreHostCandidatesFromRemote&&(c=null==u?void 0:u.filter(function(e){return"host"!==e.type}),(null==c?void 0:c.length)!==(null===(o=null==s?void 0:s.candidates)||void 0===o?void 0:o.length)&&(this._log("info","Ignoring remote host ice candidates"),s.candidates=c)),u){l=v(u);try{for(l.s();!(f=l.n()).done;)d=f.value,this._log("info","Received candidate from peer",{candidateType:d.type}),this.iceCandidatesReceivedFromPeer++}catch(e){l.e(e)}finally{l.f()}}return e.abrupt("return",y(t,"onTransportInfo",this,3)([n,r]));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"_log",value:function(e,t){var n=T[t];if(!(null==n?void 0:n.skipMessage)){for(var i,a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];if(o.length){var u=o[0];"object"!==r(u)||Array.isArray(u)||null===u?i=p(p({},this.getLogDetails()),{},{data:u}):(Object.assign(o[0],this.getLogDetails()),i=o)}else i=[].concat(o,[this.getLogDetails()]);this.logger[e](t,i)}}},{key:"end",value:(n=a(i.mark(function e(){var t,n,r=this,a=arguments;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=a.length>0&&void 0!==a[0]?a[0]:"success",n=a.length>1&&void 0!==a[1]&&a[1],this.state="ended",this.processingQueue.kill(),"string"==typeof t&&(t={condition:t}),n||(this._log("info","sending jingle session-terminate"),this.send("session-terminate",{reason:t})),setTimeout(function(){"connected"!==r.pc.connectionState&&"connecting"!==r.pc.connectionState||r.pc.close()},2e3),this.parent.emit("terminated",this,t),this.parent.forgetSession(this);case 1:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new O.default(this.pc),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:function(){var e=this.pc.iceConnectionState,n=this.id,r=this.conversationId,i=this.sessionType;this._log("info","ICE state changed: ",{iceState:e,sessionId:n,conversationId:r}),"disconnected"===e?"stable"===this.pc.signalingState&&(this.interruptionStart=new Date,this._log("info","Connection state is interrupted",{sessionId:n,conversationId:r,sessionType:i})):"connected"===e?(this._log("info","sending session-info: active"),this.send(w.JingleAction.SessionInfo,{info:{infoType:w.JINGLE_INFO_ACTIVE}}),this._setupDataChannel()):"failed"===e&&this._log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer}),y(t,"onIceStateChange",this,3)([])}},{key:"onConnectionStateChange",value:function(){var e=this.pc.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if(this._log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this._log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&this._log("info","Connection was interrupted and failed to recover",{sessionId:t,conversationId:n,sessionType:r})}},{key:"onIceCandidateError",value:function(e){var t=e;this._log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url}),console.error("IceCandidateError",t)}},{key:"onIceCandidate",value:function(e){if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var n=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(n&&!n[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this._log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this._log("debug","Processing ice candidate",e.candidate.candidate),this._log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++}return y(t,"onIceCandidate",this,3)([e])}},{key:"onIceEndOfCandidates",value:function(){y(t,"onIceEndOfCandidates",this,3)([]),this.emit("endOfCandidates")}},{key:"addTrack",value:function(e,t){var n=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",a(i.mark(function r(){var a;return i.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a=n.pc.getTransceivers().find(function(t){var n;return!t.sender.track&&(null===(n=t.receiver.track)||void 0===n?void 0:n.kind)===e.kind}))){r.next=1;break}return r.abrupt("return",a.sender.replaceTrack(e));case 1:return n.pc.addTrack(e,t),r.abrupt("return");case 2:case"end":return r.stop()}},r)})))}},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.pc.localDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this._log("info","creating data channel"),this.dataChannel=this.pc.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",function(){t._log("info","data channel opened")}),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",function(){t._log("info","closing data channel")}),this.dataChannel.addEventListener("error",function(e){t._log("error","Error occurred with the data channel",e)}))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this._log("error","Failed to parse data channel message",{error:e})}}}]);var n,l}(_.MediaSession);t.StanzaMediaSession=A}),y=n.cw(function(e,t){var n=me(),r=ve(),i=_e(),a=be(),o=Se(),s=ke();function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=void 0;var c=function(e){function t(e){return r(this,t),n=this,s=[e],o=a(o=t),i(n,u()?Reflect.construct(o,s||[],a(n).constructor):o.apply(n,s));var n,o,s}return o(t,e),n(t)}(s(Error));t.TimeoutError=c}),b=()=>n(4641),S=n.cw(function(e,t){var n=Te(),r=he(),i=me(),a=ve(),o=_e(),s=be(),u=Se(),c=ke();function l(e,t,n){return t=s(t),o(e,f()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.iceIsDifferent=t.getIcePwdFromSdp=t.getUfragFromSdp=t.calculatePayloadSize=t.parseJwt=t.retryPromise=t.isVideoJid=t.isSoftphoneJid=t.isLiveScreenMonitoringJid=t.isScreenRecordingJid=t.isAcdJid=t.splitIntoIndividualTopics=t.delay=t.timeoutPromise=t.StreamingSubscriptionError=t.StreamingClientError=void 0;var d=y(),p=h(),v=function(e){function t(e,n,r){var i;return a(this,t),i=l(this,t,[n instanceof Error?n.message:n]),n instanceof Error&&(i.name=n.name),i.type=null!=e?e:p.StreamingClientErrorTypes.generic,i.details=r,i}return u(t,e),i(t)}(c(Error));t.StreamingClientError=v;var m=function(e){function t(e,n,r,i){var o;return a(this,t),(o=l(this,t,[e])).topic=n,o.operation=r,o.name="StreamingSubscriptionError",o.missingPermissions=null==i?void 0:i.missingPermissions,o}return u(t,e),i(t)}(c(Error));function g(e){if(!e)return null;var t=e.match(/a=ice-ufrag:(\S+)/);return t?t[1]:null}function b(e){if(!e)return null;var t=e.match(/a=ice-pwd:(\S+)/);return t?t[1]:null}t.StreamingSubscriptionError=m,t.timeoutPromise=function(e,t,n,r){return new Promise(function(i,a){var o=setTimeout(function(){var e=new d.TimeoutError("Timeout: ".concat(n));e.details=r,a(e)},t);e(function(e){clearTimeout(o),i(e)},a)})},t.delay=function(e){return new Promise(function(t){setTimeout(t,e)})},t.splitIntoIndividualTopics=function(e){var t=[];if(e.includes("?")){var n=e.split("?"),r=n[0],i=n[1]&&n[1].split("&");i&&i.length&&i.forEach(function(e){t.push("".concat(r,".").concat(e))})}else t.push(e);return t},t.isAcdJid=function(e){return e.startsWith("acd-")&&!(0,t.isSoftphoneJid)(e)},t.isScreenRecordingJid=function(e){return e.startsWith("screenrecording-")&&!(0,t.isSoftphoneJid)(e)},t.isLiveScreenMonitoringJid=function(e){return e.startsWith("livemonitor-")&&!(0,t.isSoftphoneJid)(e)},t.isSoftphoneJid=function(e){return!!e&&!!e.match(/.*@.*gjoll.*/i)},t.isVideoJid=function(e){return!(!e||!e.match(/@conference/)||(0,t.isAcdJid)(e))},t.retryPromise=function(e,t){var i,a,o,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console,l=!1,f=new Promise(function(f,d){s=function(){var l=r(n.mark(function r(){var l,f,d,p;return n.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=1,e();case 1:l=n.sent,o(l),n.next=3;break;case 2:n.prev=2,p=n.catch(0),f=u,d=t(p),Number.isInteger(d)&&(f=d),!1!==d?(c.debug("Retrying promise",p),i=setTimeout(s,f)):a(p);case 3:case"end":return n.stop()}},r,null,[[0,2]])}));return function(){return l.apply(this,arguments)}}(),o=function(e){clearTimeout(i),l=!0,f(e)},a=function(e){clearTimeout(i),l=!0,d(e)},s()});return{promise:f,cancel:a,complete:o,_id:globalThis.crypto.randomUUID(),hasCompleted:function(){return l}}},t.parseJwt=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)},t.calculatePayloadSize=function(e){var t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},t.getUfragFromSdp=g,t.getIcePwdFromSdp=b,t.iceIsDifferent=function(e,t){return g(e)!==g(t)||b(e)!==b(t)}}),_=n.cw(function(e,r){var i=we(),a=Oe(),s=Te(),u=ge(),c=he(),l=ve(),f=me(),d=_e(),v=be(),m=Se();function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}var T=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.WebrtcExtension=void 0;var A=x(),I=j(),R=Ee(),P=N(),C=T(E()),M=w(),D=n(8710),L=S(),B=t(),F=n(4313),q=h(),U=g(),z=p(),J=o(),G="incomingRtcSession",H="rtcSessionError",W=216e5,V=function(e){function t(e,n){var r,i,a,o;return l(this,t),i=this,a=v(a=t),(r=d(i,k()?Reflect.construct(a,[],v(i).constructor):a.apply(i,o))).ignoredSessions=new R.LRUCache({max:10,ttl:216e3}),r.earlyIceCandidates=new R.LRUCache({max:10,ttl:6e4,ttlAutopurge:!0}),r.pendingSessions={},r.statsArr=[],r.throttleSendStatsInterval=25e3,r.currentMaxStatSize=15e3,r.statsSizeDecreaseAmount=3e3,r.statBuffer=0,r.discoRetries=0,r.iceServers=[],r.stanzaSessions=[],r.webrtcSessions=[],r.reinviteCache=new R.LRUCache({max:5,ttl:18e4}),r.sessionsMap={},r.client=e,r.config={allowIPv6:!0===n.allowIPv6,optOutOfWebrtcStatsTelemetry:n.optOutOfWebrtcStatsTelemetry},r.logger=e.logger,r.addEventListeners(),r.throttledSendStats=(0,C.default)(r.sendStats.bind(r),r.throttleSendStatsInterval,{leading:!1,trailing:!0}),r.client.on("jingle:outgoing",function(e){return r.logger.info("Emitting jingle:outgoing media-session (session-init)",e.sid),r.emit("outgoingRtcSession",e)}),r.client.on("jingle:incoming",function(e){return r.logger.info("Emitting jingle:incoming media-session (session-init)",e.sid),r.emit(G,e)}),r.client.on("jingle:created",function(e){e instanceof U.StanzaMediaSession||e.end("cancel",!0)}),window.addEventListener("offline",function(){return r.onOnlineStatusChange(!1)}),window.addEventListener("online",function(){return r.onOnlineStatusChange(!0)}),r}return m(t,e),f(t,[{key:"jid",get:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jid}},{key:"onOnlineStatusChange",value:function(e){this.addStatToQueue({actionName:"WebrtcStats",details:{_eventType:"onlineStatus",_eventTimestamp:(new Date).getTime(),online:e}})}},{key:"handleStanzaInstanceChange",value:(X=c(s.mark(function e(t){var n;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.stanzaInstance=t,n=this.stanzaSessions.reduce(function(e,n){return n.parent=t.jingle,O(O({},e),{},u({},n.id,n))},{}),this.stanzaInstance.jingle.sessions=n,this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),t.on("iq:set:genesysWebrtc",this.handleGenesysWebrtcStanza.bind(this)),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),W),this.client.emit("sessionManagerChange",t);case 1:case"end":return e.stop()}},e,this)})),function(e){return X.apply(this,arguments)})},{key:"configureNewStanzaInstance",value:(K=c(s.mark(function e(t){var n,r,i,a,o=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Object.assign(t.jingle.config.peerConnectionConfig,{sdpSemantics:"unified-plan"}),e.next=1,this.configureStanzaIceServers(t);case 1:t.stanzas.define(D.definitions),t.jingle.prepareSession=this.prepareSession.bind(this),t.jingle.on("log",function(e,t,n){o.logger[e](t,n)}),n=["iceConnectionType","peerTrackAdded","peerTrackRemoved","mute","unmute","sessionState","connectionState","terminated","stats","endOfCandidates"],r=s.mark(function e(){var n;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=a[i],t.jingle.on(n,function(e){if(e instanceof U.StanzaMediaSession){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit.apply(e,[n].concat(r))}});case 1:case"end":return e.stop()}},e)}),i=0,a=n;case 2:if(!(i<a.length)){e.next=4;break}return e.delegateYield(r(),"t0",3);case 3:i++,e.next=2;break;case 4:case"end":return e.stop()}},e,this)})),function(e){return K.apply(this,arguments)})},{key:"configureStanzaIceServers",value:function(e){return e.jingle.config.iceServers=[],this.setIceServers([],e),this._refreshIceServers(e)}},{key:"handleGenesysOffer",value:(Q=c(s.mark(function e(t){var n,r,i,a,o,u,c,l,f=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,!(r=n.params).reinvite||!this.reinviteCache.get(n.id)){e.next=1;break}return this.logger.info("Ignoring duplicate reinvite offer",n.id),e.abrupt("return");case 1:if(r.reinvite&&this.reinviteCache.set(n.id,!0),i="relay"===this.getIceTransportPolicy()&&M.isFirefox,a={id:r.sessionId,logger:this.logger,peerID:t.from,fromJid:t.from,sessionType:this.getSessionTypeByJid(t.from),conversationId:r.conversationId,ignoreHostCandidatesFromRemote:i,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,allowIPv6:this.config.allowIPv6,iceServers:this.iceServers,reinvite:!!r.reinvite,iceTransportPolicy:this.getIceTransportPolicy()},(u=this.pendingSessions[r.sessionId])?(o=O(O({},a),{},{meetingId:u.meetingId,fromUserId:u.fromUserId,originalRoomJid:u.originalRoomJid,privAnswerMode:u.privAnswerMode}),delete this.pendingSessions[u.sessionId]):o=a,c=this.webrtcSessions.find(function(e){return e.id===o.id}),this.logger.info("offer received",{existingSession:!!c,mediaSessionParams:o}),!c){e.next=2;break}if(c.conversationId=r.conversationId,(0,L.iceIsDifferent)(c.peerConnection.remoteDescription.sdp,r.sdp)){e.next=2;break}return e.abrupt("return",this.handleGenesysRenegotiate(c,r.sdp));case 2:return l=new z.GenesysCloudMediaSession(this,o),e.next=3,l.setRemoteDescription(r.sdp);case 3:return this.proxyStatsForSession(l),l.on("sendIq",function(e){var t;return null===(t=f.stanzaInstance)||void 0===t?void 0:t.sendIQ(e)}),l.on("terminated",function(){delete f.sessionsMap[l.id],f.webrtcSessions=f.webrtcSessions.filter(function(e){return e.id!==l.id})}),this.webrtcSessions.push(l),this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(l),e.abrupt("return",this.emit(G,l));case 4:case"end":return e.stop()}},e,this)})),function(e){return Q.apply(this,arguments)})},{key:"applyEarlyIceCandidates",value:function(e){var t=this.earlyIceCandidates.get(e.id);if(t){this.earlyIceCandidates.delete(e.id);var n,r=y(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.addRemoteIceCandidate(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"handleGenesysRenegotiate",value:(V=c(s.mark(function e(t,n){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.peerConnection.setRemoteDescription({sdp:n,type:"offer"});case 1:return e.next=2,t.accept();case 2:case"end":return e.stop()}},e)})),function(e,t){return V.apply(this,arguments)})},{key:"handleGenesysIceCandidate",value:(j=c(s.mark(function e(t){var n,r,i,o;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,r=n.params,!(i=this.getSessionById(r.sessionId,!0))){e.next=2;break}return e.next=1,i.addRemoteIceCandidate(r.sdp);case 1:e.next=3;break;case 2:(o=this.earlyIceCandidates.get(r.sessionId))?this.earlyIceCandidates.set(r.sessionId,[].concat(a(o),[r.sdp])):this.earlyIceCandidates.set(r.sessionId,[r.sdp]);case 3:case"end":return e.stop()}},e,this)})),function(e){return j.apply(this,arguments)})},{key:"handleGenesysTerminate",value:(N=c(s.mark(function e(t){var n,r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,r=n.params,i=this.getSessionById(r.sessionId,!0)){e.next=1;break}return this.logger.warn("Received terminate for session that does not exist",{sessionId:r.sessionId}),e.abrupt("return");case 1:i.onSessionTerminate(r.reason);case 2:case"end":return e.stop()}},e,this)})),function(e){return N.apply(this,arguments)})},{key:"getSessionById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getAllSessions().find(function(t){return t.id===e});if(!n&&!t){var r=new Error("Failed to find session by id");throw this.logger.error(r,{sessionId:e}),r}return n}},{key:"sendIq",value:(E=c(s.mark(function e(t){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stanzaInstance){e.next=1;break}throw new Error("Failed to send iq because there was no stanza instance");case 1:return e.abrupt("return",this.stanzaInstance.sendIQ(t));case 2:case"end":return e.stop()}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"handleMessage",value:(A=c(s.mark(function e(t){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.propose){e.next=2;break}return e.next=1,this.handlePropose(t);case 1:e.next=3;break;case 2:t.retract?this.handleRetract(t.retract.sessionId):t.accept?this.handledIncomingRtcSession(t.accept.sessionId,t):t.reject&&this.handledIncomingRtcSession(t.reject.sessionId,t);case 3:case"end":return e.stop()}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"handleGenesysWebrtcStanza",value:(T=c(s.mark(function e(t){var n;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("offer"!==(n=t.genesysWebrtc).method){e.next=1;break}return e.abrupt("return",this.handleGenesysOffer(t));case 1:if("iceCandidate"!==n.method){e.next=2;break}return e.abrupt("return",this.handleGenesysIceCandidate(t));case 2:if("terminate"!==n.method){e.next=3;break}return e.abrupt("return",this.handleGenesysTerminate(t));case 3:case"end":return e.stop()}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"prepareSession",value:function(e){var t=this;if(!e.sid||!this.sessionsMap[e.sid]){var n=this.pendingSessions[e.sid];n&&delete this.pendingSessions[n.sessionId];var r="relay"===this.getIceTransportPolicy()&&M.isFirefox,i={options:e,logger:this.logger,id:e.sid,fromJid:e.peerID,peerID:e.peerID,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,conversationId:null==n?void 0:n.conversationId,fromUserId:null==n?void 0:n.fromJid,originalRoomJid:null==n?void 0:n.originalRoomJid,sessionType:null==n?void 0:n.sessionType,allowIPv6:this.config.allowIPv6,ignoreHostCandidatesFromRemote:r,meetingId:null==n?void 0:n.meetingId},a=new U.StanzaMediaSession(i);return this.proxyStatsForSession(a),this.stanzaSessions.push(a),a.on("terminated",function(){delete t.sessionsMap[a.id],t.stanzaSessions=t.stanzaSessions.filter(function(e){return e.id!==a.id})}),a}this.logger.debug("skipping creation of jingle webrtc session due to sdpOverXmpp")}},{key:"proxyStatsForSession",value:function(e){var t=this;e.on("stats",function(n){var r=JSON.parse(JSON.stringify(n)),i={conversationId:e.conversationId,sessionId:e.id,sessionType:e.sessionType},a=(0,F.formatStatsEvent)(r,i);t.addStatToQueue(a)})}},{key:"addStatToQueue",value:function(e){if(!this.config.optOutOfWebrtcStatsTelemetry){e.details._appId||(e.details._appId=this.logger.clientId,e.details._appName="streamingclient",e.details._appVersion=B.Client.version),e.details._originAppId=this.client.config.appId;var t=(0,F.deepFlatten)(e.details);Object.keys(t).forEach(function(e){var n=t[e];"boolean"==typeof n&&(t[e]="".concat(n))});var n=O(O({},e),{},{details:t}),r=(0,L.calculatePayloadSize)(n),i=this.statBuffer+r>this.currentMaxStatSize;this.statsArr.push(n),this.statBuffer+=r,i?this.sendStatsImmediately():this.throttledSendStats()}}},{key:"getLogDetailsForPendingSessionId",value:function(e){var t={sessionId:e},n=this.pendingSessions[e];return n&&(t.sessionType=n.sessionType,t.conversationId=n.conversationId),t}},{key:"sendStatsImmediately",value:function(){this.throttledSendStats(),this.throttledSendStats.flush()}},{key:"sendStats",value:(x=c(s.mark(function e(){var t,n,r,i,o,u,c,l,f,d,p,h,v,m;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=1;break}return e.abrupt("return");case 1:r=[],i=0,o=y(this.statsArr),e.prev=2,o.s();case 3:if((u=o.n()).done){e.next=6;break}if(c=u.value,l=(0,L.calculatePayloadSize)(c),!(i+l<this.currentMaxStatSize)){e.next=4;break}r.push(c),i+=l,e.next=5;break;case 4:return e.abrupt("continue",6);case 5:e.next=3;break;case 6:e.next=8;break;case 7:e.prev=7,v=e.catch(2),o.e(v);case 8:return e.prev=8,o.f(),e.finish(8);case 9:if(this.statsArr.splice(0,r.length),this.statBuffer=this.statsArr.reduce(function(e,t){return e+(0,L.calculatePayloadSize)(t)},0),r.length&&!this.client.isGuest){e.next=10;break}return e.abrupt("return");case 10:return f={appName:"streamingclient",appVersion:B.Client.version,originAppName:this.client.config.appName,originAppVersion:this.client.config.appVersion,actions:r},e.prev=11,d=this.client.config.authToken,p="diagnostics/newrelic/insights",this.client.backgroundAssistantMode&&(d=this.client.config.jwt,p+="/backgroundassistant"),e.next=12,this.client.http.requestApi(p,{method:"post",responseType:"text",host:this.client.config.apiHost,authToken:d,logger:this.client.logger,data:f});case 12:this.currentMaxStatSize=15e3,e.next=16;break;case 13:if(e.prev=13,m=e.catch(11),!J.HttpClient.retryStatusCodes.has(null===(t=m.response)||void 0===t?void 0:t.status)&&navigator.onLine||(this.statsArr=[].concat(r,a(this.statsArr)),this.statBuffer=this.statsArr.reduce(function(e,t){return e+(0,L.calculatePayloadSize)(t)},0)),413!==(null===(n=m.response)||void 0===n?void 0:n.status)){e.next=15;break}return h=this.currentMaxStatSize,this.currentMaxStatSize-=this.statsSizeDecreaseAmount,this.logger.info("Failed to send stats due to 413, retrying with smaller set",{attemptedPayloadSize:h,newPayloadSize:this.currentMaxStatSize}),e.next=14,this.sendStats();case 14:e.next=16;break;case 15:this.logger.error("Failed to send stats",{err:m,numberOfFailedStats:r.length},{skipServer:!navigator.onLine});case 16:case"end":return e.stop()}},e,this,[[2,7,8,9],[11,13]])})),function(){return x.apply(this,arguments)})},{key:"addEventListeners",value:function(){var e=this;this.client.on("connected",function(){return e.refreshIceServersTimer&&(clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null),e.refreshIceServersTimer=setInterval(e.refreshIceServers.bind(e),W),e.refreshIceServers().catch(function(t){return e.logger.error("Error fetching ice servers after streaming-client connected",{error:t,channelId:e.client.config.channelId})})}),this.client.on("disconnected",function(){clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null})}},{key:"handlePropose",value:(w=c(s.mark(function e(t){var n,r,i,a,o,u,c,l;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.from!==this.jid){e.next=1;break}return e.abrupt("return");case 1:if(n=t.propose.sessionId,r=this.pendingSessions[n],i=!!r,a=this.getSessionTypeByJid(t.from),o={sessionId:n,conversationId:t.propose.conversationId,sessionType:a,isDuplicatePropose:i},this.logger.info("propose received",o),i||(this.client.config.appId,u={actionName:"WebrtcStats",details:{_eventTimestamp:(new Date).getTime(),_eventType:"firstPropose",conversationId:o.conversationId,sdpViaXmppRequested:!!t.propose.sdpOverXmpp,sessionId:n,sessionType:a}},this.addStatToQueue(u),c=t.from,l=c,t.propose.originalRoomJid=t.propose.originalRoomJid||l,r=O(O({},t.propose),{},{toJid:t.to,fromJid:c,sessionType:a,roomJid:l,id:n,sdpOverXmpp:t.propose.sdpOverXmpp,privAnswerMode:t.propose.privAnswerMode}),i||(this.sessionsMap[r.id]=!!r.sdpOverXmpp,this.pendingSessions[n]=r)),!r.accepted){e.next=3;break}return this.logger.info("proceed already sent for this session, but sending another",o),e.next=2,this.acceptRtcSession(n);case 2:return e.abrupt("return");case 3:this.emit("requestIncomingRtcSession",Object.assign(r));case 4:case"end":return e.stop()}},e,this)})),function(e){return w.apply(this,arguments)})},{key:"handleRetract",value:function(e){return this.logger.info("retract received",this.getLogDetailsForPendingSessionId(e)),delete this.sessionsMap[e],delete this.pendingSessions[e],this.emit("cancelIncomingRtcSession",e)}},{key:"handledIncomingRtcSession",value:function(e,t){var n=t.accept?"accept":"reject";return this.logger.info("".concat(n," received"),this.getLogDetailsForPendingSessionId(e)),this.emit("handledIncomingRtcSession",e)}},{key:"initiateRtcSession",value:(_=c(s.mark(function e(t){var n,r,i,a,o,u,c,l,f;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n={to:t.jid,propose:{id:globalThis.crypto.randomUUID(),descriptions:[]}},t.stream)for(r=0,i=Array.from(t.stream.getTracks());r<i.length;r++)a=i[r],n.propose.descriptions.push({media:a.kind});if(t.provideVideo&&(n.propose.descriptions.filter(function(e){return"video"===e.media}).length>0||n.propose.descriptions.push({media:"video"})),t.provideAudio&&(n.propose.descriptions.filter(function(e){return"audio"===e.media}).length>0||n.propose.descriptions.push({media:"audio"})),t.mediaPurpose&&n.propose.descriptions.push({media:t.mediaPurpose}),!t.jid||!t.jid.match(/@conference/)){e.next=2;break}0===(o=n.propose.descriptions).length&&(o=[{media:"listener"}]),u={type:"upgradeMedia",to:t.jid,id:globalThis.crypto.randomUUID(),from:this.jid,media:{conversationId:t.conversationId,sourceCommunicationId:t.sourceCommunicationId}},t.mediaPurpose===q.SessionTypes.collaborateVideo&&Object.assign(u.media,{video:!0,audio:!0,videoGuest:!0}),c=y(o);try{for(c.s();!(l=c.n()).done;)f=l.value,u.media[f.media]=!0}catch(e){c.e(e)}finally{c.f()}return e.next=1,this.stanzaInstance.send("presence",u);case 1:e.next=4;break;case 2:return e.next=3,this.stanzaInstance.send("message",n);case 3:this.pendingSessions[n.propose.id]=n;case 4:return e.abrupt("return",n.propose.id);case 5:case"end":return e.stop()}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"acceptRtcSession",value:(S=c(s.mark(function e(t){var n,r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t]){e.next=1;break}return this.emit(H,"Cannot accept session because it is not pending or does not exist"),e.abrupt("return");case 1:return r={to:n.fromJid,proceed:{sessionId:t}},n.accepted=!0,i=this.getLogDetailsForPendingSessionId(t),this.logger.info("sending jingle proceed",i),e.next=2,this.stanzaInstance.send("message",r);case 2:this.logger.info("sent jingle proceed",i);case 3:case"end":return e.stop()}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"rejectRtcSession",value:(b=c(s.mark(function e(t){var n,r,i,a,o,u,c,l=arguments;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.length>1&&void 0!==l[1]&&l[1],r=this.getLogDetailsForPendingSessionId(t),i=this.pendingSessions[t]){e.next=1;break}return this.emit(H,"Cannot reject session because it is not pending or does not exist"),e.abrupt("return");case 1:if(delete this.sessionsMap[t],delete this.pendingSessions[t],!n){e.next=2;break}this.ignoredSessions.set(t,!0),e.next=4;break;case 2:return a={to:(0,I.toBare)(this.jid),reject:{sessionId:t}},o=this.stanzaInstance.send("message",a),u={to:i.fromJid,reject:{sessionId:t}},c=this.stanzaInstance.send("message",u),this.logger.info("sending jingle reject",r),e.next=3,Promise.all([o,c]);case 3:this.logger.info("sent jingle reject",r);case 4:case"end":return e.stop()}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"rtcSessionAccepted",value:(g=c(s.mark(function e(t){var n,r;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingSessions[t],n=this.getLogDetailsForPendingSessionId(t),r={to:(0,I.toBare)(this.jid),accept:{sessionId:t}},this.logger.info("sending session-info:accept",n),e.next=1,this.stanzaInstance.send("message",r);case 1:this.logger.info("sent session-info:accept",n);case 2:case"end":return e.stop()}},e,this)})),function(e){return g.apply(this,arguments)})},{key:"notifyScreenShareStart",value:(h=c(s.mark(function e(t){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:P.JingleAction.SessionInfo,sid:t.id,screenstart:{}}}));case 1:case"end":return e.stop()}},e,this)})),function(e){return h.apply(this,arguments)})},{key:"notifyScreenShareStop",value:(p=c(s.mark(function e(t){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:P.JingleAction.SessionInfo,sid:t.id,screenstop:{}}}));case 1:case"end":return e.stop()}},e,this)})),function(e){return p.apply(this,arguments)})},{key:"cancelRtcSession",value:(o=c(s.mark(function e(t){var n,r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t],r=this.getLogDetailsForPendingSessionId(t),n){e.next=1;break}return this.emit(H,"Cannot cancel session because it is not pending or does not exist"),e.abrupt("return");case 1:return i={to:n.toJid,retract:{sessionId:t}},delete this.pendingSessions[t],delete this.sessionsMap[t],this.logger.info("sending jingle retract",r),e.next=2,this.stanzaInstance.send("message",i);case 2:this.logger.info("sent jingle retract",r);case 3:case"end":return e.stop()}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"refreshIceServers",value:(r=c(s.mark(function e(){var t=this;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.refreshIceServersRetryPromise||(this.refreshIceServersRetryPromise=(0,L.retryPromise)(this._refreshIceServers.bind(this,this.stanzaInstance),function(e){return++t.discoRetries>2?(t.logger.warn("fetching ice servers failed. max retries reached.",{retryAttempt:t.discoRetries,MAX_DISCO_RETRIES:2,error:e,channelId:t.client.config.channelId}),!1):(t.logger.warn("fetching ice servers failed. retrying",{retryAttempt:t.discoRetries,error:e,channelId:t.client.config.channelId}),!0)},0,this.client.logger)),e.abrupt("return",this.refreshIceServersRetryPromise.promise.finally(function(){t.discoRetries=0,t.refreshIceServersRetryPromise=void 0}));case 1:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"_refreshIceServers",value:(n=c(s.mark(function e(t){var n,r,o,u,c,l,f,d,p;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=1;break}throw new Error("No stanza instance to refresh ice servers");case 1:return n=t.config.server,r=t.getServices(n,"turn","1"),o=t.getServices(n,"stun","1"),u=new Promise(function(e,t){setTimeout(function(){t(new Error("Timeout waiting for refresh ice servers to finish"))},15e3),Promise.all([r,o]).then(function(t){var n=i(t,2),r=n[0],a=n[1];e([r,a])}).catch(t)}),e.next=2,u;case 2:return c=e.sent,l=i(c,2),f=l[0],d=l[1],p=[].concat(a(f.services),a(d.services)).map(function(e){var t=e.port?":".concat(e.port):"",n={type:e.type,urls:"".concat(e.type,":").concat(e.host).concat(t)};return["turn","turns"].includes(e.type)&&(e.transport&&"udp"!==e.transport&&(n.urls+="?transport=".concat(e.transport)),e.username&&(n.username=e.username),e.password&&(n.credential=e.password)),n}),this.setIceServers(p,t),d.services.length?this.setIceTransportPolicy("all",t):(this.logger.info('No stun servers received, setting iceTransportPolicy to "relay"'),this.setIceTransportPolicy("relay",t)),e.abrupt("return",p);case 3:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setIceServers",value:function(e,t){t.jingle.iceServers=e,this.iceServers=e}},{key:"getIceTransportPolicy",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.config.peerConnectionConfig.iceTransportPolicy}},{key:"setIceTransportPolicy",value:function(e,t){t.jingle.config.peerConnectionConfig.iceTransportPolicy=e}},{key:"getSessionTypeByJid",value:function(e){return(0,L.isAcdJid)(e)?q.SessionTypes.acdScreenShare:(0,L.isScreenRecordingJid)(e)?q.SessionTypes.screenRecording:(0,L.isLiveScreenMonitoringJid)(e)?q.SessionTypes.liveScreenMonitoring:(0,L.isSoftphoneJid)(e)?q.SessionTypes.softphone:(0,L.isVideoJid)(e)?q.SessionTypes.collaborateVideo:q.SessionTypes.unknown}},{key:"getSessionManager",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle}},{key:"getAllSessions",value:function(){return[].concat(a(this.stanzaSessions),a(this.webrtcSessions))}},{key:"proxyNRStat",value:function(e){this.addStatToQueue(e)}},{key:"expose",get:function(){return{on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeAllListeners:this.removeAllListeners.bind(this),removeListener:this.removeListener.bind(this),refreshIceServers:this.refreshIceServers.bind(this),acceptRtcSession:this.acceptRtcSession.bind(this),rejectRtcSession:this.rejectRtcSession.bind(this),cancelRtcSession:this.cancelRtcSession.bind(this),notifyScreenShareStart:this.notifyScreenShareStart.bind(this),notifyScreenShareStop:this.notifyScreenShareStop.bind(this),rtcSessionAccepted:this.rtcSessionAccepted.bind(this),initiateRtcSession:this.initiateRtcSession.bind(this),getSessionTypeByJid:this.getSessionTypeByJid.bind(this),getSessionManager:this.getSessionManager.bind(this),getAllSessions:this.getAllSessions.bind(this),proxyNRStat:this.proxyNRStat.bind(this)}}}]);var n,r,o,p,h,g,b,S,_,w,x,T,A,E,N,j,V,Q,K,X}(A.EventEmitter);r.WebrtcExtension=V}),w=()=>n(7833),O=()=>n(6646),x=()=>n(3550),k=()=>n(8529),T=()=>n(8031),A=()=>n(3394),E=()=>n(5039),I=n.cw(function(e,t){var n=Te(),r=he(),i=ve(),a=me(),o=_e(),s=be(),u=ye(),c=Se(),l=ge();function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}function m(e,t,n,r){var i=u(s(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var g,y=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=this&&this.__importStar||(g=function(e){return g=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},g(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=g(e),r=0;r<n.length;r++)"default"!==n[r]&&y(t,e,n[r]);return b(t,e),t}),_=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var w=q(),O=x(),k=_(D()),T=S(j()),A=S(F()),E=S(U()),I=Z(),N=_(ce()),R=_(le()),C=_(fe()),L=P(),B=_(M()),z=function(e){function t(){var e,a,u,c,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),a=this,u=s(u=t),e=o(a,v()?Reflect.construct(u,[],s(a).constructor):u.apply(a,c)),l(e,"jid",void 0),l(e,"config",void 0),l(e,"sm",void 0),l(e,"transport",void 0),l(e,"stanzas",void 0),l(e,"resolver",void 0),l(e,"sessionStarting",void 0),l(e,"sessionStarted",void 0),l(e,"sessionTerminating",void 0),l(e,"reconnectAttempts",0),l(e,"transports",void 0),l(e,"sasl",void 0),l(e,"incomingDataQueue",void 0),l(e,"outgoingDataQueue",void 0),l(e,"reconnectTimer",void 0),e.setMaxListeners(100),e.off=e.removeListener,e.updateConfig(f),e.jid="",e.sasl=new E.Factory,e.sasl.register("EXTERNAL",E.EXTERNAL,1e3),e.sasl.register("SCRAM-SHA-256-PLUS",E.SCRAM,350),e.sasl.register("SCRAM-SHA-256",E.SCRAM,300),e.sasl.register("SCRAM-SHA-1-PLUS",E.SCRAM,250),e.sasl.register("SCRAM-SHA-1",E.SCRAM,200),e.sasl.register("DIGEST-MD5",E.DIGEST,100),e.sasl.register("OAUTHBEARER",E.OAUTH,100),e.sasl.register("X-OAUTH2",E.PLAIN,50),e.sasl.register("PLAIN",E.PLAIN,1),e.sasl.register("ANONYMOUS",E.ANONYMOUS,0),e.stanzas=new A.Registry,e.stanzas.define(N.default),e.resolver=new B.default,e.use(I.core),e.sm=new k.default,void 0!==e.config.allowResumption&&(e.sm.allowResume=e.config.allowResumption),e.sm.on("prebound",function(t){e.jid=t,e.emit("session:bound",t)}),e.on("session:bound",function(t){return e.sm.bind(t)}),e.sm.on("send",function(t){return e.send("sm",t)}),e.sm.on("acked",function(t){return e.emit("stanza:acked",t)}),e.sm.on("failed",function(t){return e.emit("stanza:failed",t)}),e.sm.on("hibernated",function(t){return e.emit("stanza:hibernated",t)}),e.sm.on("begin-resend",function(){return e.outgoingDataQueue.pause()}),e.sm.on("resend",function(t){var n=t.kind,r=t.stanza;return e.send(n,r,!0)}),e.sm.on("end-resend",function(){return e.outgoingDataQueue.resume()});for(var d=function(){var t=h[p];e.on("stanza:".concat(t),function(n){"message"===n.kind&&e.emit("message:".concat(t),n.stanza)})},p=0,h=["acked","hibernated","failed"];p<h.length;p++)d();e.transports={bosh:R.default,websocket:C.default},e.incomingDataQueue=(0,w.priorityQueue)(function(){var t=r(n.mark(function t(r,i){var a,o;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.kind,o=r.stanza,e.emit(a,o),o.id&&e.emit(a+":id:"+o.id,o),"message"!==a&&"presence"!==a&&"iq"!==a){t.next=2;break}return e.emit("stanza",o),t.next=1,e.sm.handle();case 1:t.next=5;break;case 2:if("sm"!==a){t.next=5;break}if("ack"!==o.type){t.next=4;break}return t.next=3,e.sm.process(o);case 3:e.emit("stream:management:ack",o);case 4:"request"===o.type&&e.sm.ack();case 5:i&&i();case 6:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),1);var m=function(t,n){["message","presence","iq"].includes(t)&&(e.sm.started&&e.sm.resumable?e.sm.resumable&&!e.transport&&e.emit("stanza:hibernated",{kind:t,stanza:n}):e.emit("stanza:failed",{kind:t,stanza:n}))};return e.outgoingDataQueue=(0,w.priorityQueue)(function(){var t=r(n.mark(function t(r,i){var a,o,s,u,c,l,f;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.kind,o=r.stanza,s=r.replay,l=s){t.next=2;break}return t.next=1,e.sm.track(a,o);case 1:l=t.sent;case 2:if(u=l,"message"===a&&(s?e.emit("message:retry",o):e.emit("message:sent",o,!1)),!e.transport){t.next=7;break}return t.prev=3,t.next=4,e.transport.send(a,o);case 4:u&&(null===(c=e.transport)||void 0===c||c.send("sm",{type:"request"})),t.next=6;break;case 5:t.prev=5,f=t.catch(3),console.error(f),m(a,o);case 6:t.next=8;break;case 7:m(a,o);case 8:i&&i();case 9:case"end":return t.stop()}},t,null,[[3,5]])}));return function(e,n){return t.apply(this,arguments)}}(),1),e.on("stream:data",function(t,n){e.incomingDataQueue.push({kind:n,stanza:t},0)}),e.on("--transport-disconnected",r(n.mark(function t(){var r;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=[],e.incomingDataQueue.idle()||r.push(e.incomingDataQueue.drain()),e.outgoingDataQueue.idle()||r.push(e.outgoingDataQueue.drain()),t.next=1,Promise.all(r);case 1:return t.next=2,e.sm.hibernate();case 2:e.transport&&delete e.transport,e.emit("--reset-stream-features"),!e.sessionTerminating&&e.config.autoReconnect&&(e.reconnectAttempts+=1,clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout(function(){e.connect()},1e3*Math.min(Math.pow(2,e.reconnectAttempts)+Math.random(),e.config.maxReconnectBackoff||32))),e.emit("disconnected");case 3:case"end":return t.stop()}},t)}))),e.on("iq",function(t){var n=t.type,r=t.payloadType,i="iq:"+n+":"+r;if("get"===n||"set"===n){if("invalid-payload-count"===r)return e.sendIQError(t,{error:{condition:"bad-request",type:"modify"}});if("unknown-payload"===r||0===e.listenerCount(i))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});e.emit(i,t)}}),e.on("message",function(t){var n=t.alternateLanguageBodies&&t.alternateLanguageBodies.length||t.links&&t.links.length,r=t.marker&&"markable"!==t.marker.type;n&&!r&&("chat"===t.type||"normal"===t.type?e.emit("chat",t):"groupchat"===t.type&&e.emit("groupchat",t)),"error"===t.type&&e.emit("message:error",t)}),e.on("presence",function(t){var n=t.type||"available";"error"===n&&(n="presence:error"),e.emit(n,t)}),e.on("session:started",function(){e.sessionStarting=!1,e.reconnectAttempts=0,e.reconnectTimer&&clearTimeout(e.reconnectTimer)}),e}return c(t,e),a(t,[{key:"updateConfig",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.config||{};this.config=h(h({allowResumption:!0,jid:"",transports:{bosh:!0,websocket:!0},useStreamManagement:!0,transportPreferenceOrder:["websocket","bosh"]},n),t),this.config.server||(this.config.server=T.getDomain(this.config.jid)),this.config.password&&(this.config.credentials=this.config.credentials||{},this.config.credentials.password=this.config.password,delete this.config.password),this.config.transportPreferenceOrder||(this.config.transportPreferenceOrder=Object.keys(null!==(e=this.config.transports)&&void 0!==e?e:{}))}},{key:"stream",get:function(){return this.transport?this.transport.stream:void 0}},{key:"emit",value:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=m(t,"emit",this,3)([e].concat(r));return"raw"===e?(m(t,"emit",this,3)(["raw:".concat(r[0]),r[1]]),m(t,"emit",this,3)(["raw:*","raw:".concat(r[0]),r[1]]),m(t,"emit",this,3)(["*","raw:".concat(r[0]),r[1]])):m(t,"emit",this,3)(["*",e].concat(r)),a}},{key:"use",value:function(e){"function"==typeof e&&e(this,this.stanzas,this.config)}},{key:"nextId",value:function(){return(0,L.uuid)()}},{key:"getCredentials",value:(g=r(n.mark(function e(){return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getConfiguredCredentials());case 1:case"end":return e.stop()}},e,this)})),function(){return g.apply(this,arguments)})},{key:"connect",value:(p=r(n.mark(function e(){var t,r,i,a,o,s,u,c,l,d,p,v,m,g;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.sessionTerminating=!1,this.sessionStarting=!0,this.emit("--reset-stream-features"),this.transport&&this.transport.disconnect(!1),r=null!==(t=this.config.transportPreferenceOrder)&&void 0!==t?t:[],a=f(r),e.prev=1,a.s();case 2:if((o=a.n()).done){e.next=15;break}if(c=o.value,(l=this.config.transports[c])&&this.transports[c]){e.next=3;break}return e.abrupt("continue",14);case 3:if(d={acceptLanguages:this.config.acceptLanguages||[null!==(s=this.config.lang)&&void 0!==s?s:"en"],jid:this.config.jid,lang:null!==(u=this.config.lang)&&void 0!==u?u:"en",server:this.config.server},p=new this.transports[c](this,this.sm,this.stanzas),"string"!=typeof l){e.next=4;break}d.url=l,e.next=13;break;case 4:if(1!=l){e.next=13;break}if(!p.discoverBindings){e.next=7;break}return e.next=5,p.discoverBindings(this.config.server);case 5:if(v=e.sent){e.next=6;break}return e.abrupt("continue",14);case 6:d=h(h({},d),v),e.next=13;break;case 7:if(i){e.next=11;break}return e.prev=8,e.next=9,this.discoverBindings(this.config.server);case 9:i=e.sent,e.next=11;break;case 10:return e.prev=10,m=e.catch(8),console.error(m),e.abrupt("continue",14);case 11:if(i[c]=(i[c]||[]).filter(function(e){return e.startsWith("wss:")||e.startsWith("https:")}),i[c]&&i[c].length){e.next=12;break}return e.abrupt("continue",14);case 12:d.url=i[c][0];case 13:return this.transport=p,this.transport.connect(d),e.abrupt("return");case 14:e.next=2;break;case 15:e.next=17;break;case 16:e.prev=16,g=e.catch(1),a.e(g);case 17:return e.prev=17,a.f(),e.finish(17);case 18:console.error("No endpoints found for the requested transports."),this.emit("--transport-disconnected");case 19:case"end":return e.stop()}},e,this,[[1,16,17,18],[8,10]])})),function(){return p.apply(this,arguments)})},{key:"disconnect",value:(d=r(n.mark(function e(){return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sessionTerminating=!0,clearTimeout(this.reconnectTimer),this.outgoingDataQueue.pause(),this.sessionStarted&&!this.sm.started&&this.emit("session:end"),this.emit("--reset-stream-features"),this.sessionStarted=!1,this.transport?this.transport.disconnect():this.emit("--transport-disconnected"),this.outgoingDataQueue.resume(),this.outgoingDataQueue.idle()){e.next=1;break}return e.next=1,this.outgoingDataQueue.drain();case 1:return e.next=2,this.sm.shutdown();case 2:case"end":return e.stop()}},e,this)})),function(){return d.apply(this,arguments)})},{key:"send",value:(u=r(n.mark(function e(t,r){var i,a=this,o=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>2&&void 0!==o[2]&&o[2],e.abrupt("return",new Promise(function(e,n){a.outgoingDataQueue.push({kind:t,stanza:r,replay:i},i?0:1,function(t){return t?n(t):e()})}));case 1:case"end":return e.stop()}},e)})),function(e,t){return u.apply(this,arguments)})},{key:"sendMessage",value:function(e){var t=e.id||this.nextId(),n=h({id:t,originId:t},e);return this.send("message",n),n.id}},{key:"sendPresence",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=h({id:this.nextId()},e);return this.send("presence",t),t.id}},{key:"sendIQ",value:function(e){var t=this,n=h({id:this.nextId()},e),r=T.allowedResponders(this.jid,e.to),i="iq:id:"+n.id,a=new Promise(function(e,n){var a=function(o){r.has(o.from)&&("result"!==o.type&&"error"!==o.type||(t.off(i,a),"result"===o.type?e(o):n(o)))};t.on(i,a)});this.send("iq",n);var o=this.config.timeout||15;return(0,L.timeoutPromise)(a,1e3*o,function(){return h(h({},n),{},{to:void 0,from:void 0,error:{condition:"timeout",text:"Request timed out after ".concat(o," seconds.")},id:n.id,type:"error"})})}},{key:"sendIQResult",value:function(e,t){this.send("iq",h(h({},t),{},{id:e.id,to:e.from,type:"result"}))}},{key:"sendIQError",value:function(e,t){this.send("iq",h(h({},t),{},{id:e.id,to:e.from,type:"error"}))}},{key:"sendStreamError",value:function(e){this.emit("stream:error",e),this.send("error",e),this.disconnect()}},{key:"_getConfiguredCredentials",value:function(){var e=this.config.credentials||{},t=T.parse(this.config.jid||""),n=e.username||t.local,r=e.host||t.domain;return h({host:r,password:this.config.password,realm:r,serviceName:r,serviceType:"xmpp",username:n},e)}}]);var u,d,p,g}(O.EventEmitter);t.default=z}),N=()=>n(2354),j=n.cw(function(e,t){var r=we();function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.escapeLocal=c,t.unescapeLocal=l,t.prepare=f,t.create=d,t.createFull=function(e,t){return t?"".concat(v(e),"/").concat(t):v(e)},t.parse=p,t.allowedResponders=function(e,t){var n=new Set;if(n.add(void 0),n.add(""),e){var r=p(e);n.add(r.full),n.add(r.bare),n.add(r.domain)}if(t){var i=p(t);n.add(i.domain),n.add(i.bare),n.add(i.full)}return n},t.equal=function(e,t){if(!e||!t)return!1;var n=p(e),r=p(t);return n.local===r.local&&n.domain===r.domain&&n.resource===r.resource},t.equalBare=function(e,t){if(!e||!t)return!1;var n=p(e),r=p(t);return n.local===r.local&&n.domain===r.domain},t.isFull=h,t.isBare=function(e){return!h(e)},t.getLocal=function(){return p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").local},t.getDomain=function(){return p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").domain},t.getResource=function(){return p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").resource},t.toBare=v,t.parseURI=function(e){var t=new URL(e);if("xmpp:"!==t.protocol)throw new Error("Invalid XMPP URI, wrong protocol: "+t.protocol);var n,a=t.hostname?t.username?d({domain:decodeURIComponent(t.hostname),local:decodeURIComponent(t.username)},{escaped:!0}):decodeURIComponent(t.hostname):void 0,o=p(decodeURIComponent(a?t.pathname.substr(1):t.pathname)).full,s=t.search&&t.search.indexOf(";")>=1,u=s?t.search.substr(t.search.indexOf(";")+1):"",c=t.search?decodeURIComponent(t.search.substr(1,s?t.search.indexOf(";")-1:void 0)):void 0,l={},f=i(u.split(";"));try{for(f.s();!(n=f.n()).done;){var h=n.value.split("=").map(decodeURIComponent),v=r(h,2),m=v[0],g=v[1];if(l[m]){var y=l[m];Array.isArray(y)?y.push(g):l[m]=[y,g]}else l[m]=g}}catch(e){f.e(e)}finally{f.f()}return{action:c,identity:a,jid:o,parameters:l}},t.toURI=function(e){var t=["xmpp:"],n=function(e,n){var r=p(e);r.local&&(t.push(encodeURIComponent(c(r.local))),t.push("@")),t.push(encodeURIComponent(r.domain)),n&&r.resource&&(t.push("/"),t.push(encodeURIComponent(r.resource)))};e.identity&&(t.push("//"),n(e.identity,!1),e.jid&&t.push("/")),e.jid&&n(e.jid,!0),e.action&&(t.push("?"),t.push(encodeURIComponent(e.action)));for(var a=0,o=Object.entries(e.parameters||{});a<o.length;a++){var s,u=r(o[a],2),l=u[0],f=u[1],d=i(Array.isArray(f)?f:[f]);try{for(d.s();!(s=d.n()).done;){var h=s.value;t.push(";"),t.push(encodeURIComponent(l)),void 0!==h&&(t.push("="),t.push(encodeURIComponent(h)))}}catch(e){d.e(e)}finally{d.f()}}return t.join("")};var s=o(n(6218)),u=z();function c(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/^\s+|\s+$/g,"").replace(/\\5c/g,"\\5c5c").replace(/\\20/g,"\\5c20").replace(/\\22/g,"\\5c22").replace(/\\26/g,"\\5c26").replace(/\\27/g,"\\5c27").replace(/\\2f/g,"\\5c2f").replace(/\\3a/g,"\\5c3a").replace(/\\3c/g,"\\5c3c").replace(/\\3e/g,"\\5c3e").replace(/\\40/g,"\\5c40").replace(/ /g,"\\20").replace(/"/g,"\\22").replace(/&/g,"\\26").replace(/'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40")}function l(e){return e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")}function f(e){var t=e.local||"",n=e.domain,r=e.resource||"";return t&&(t=(0,u.nodeprep)(t)),r&&(r=(0,u.resourceprep)(r)),"."===n[n.length-1]&&(n=n.slice(0,n.length-1)),{domain:n=(0,u.nameprep)(n.split(".").map(s.default.toUnicode).join(".")),local:t,resource:r}}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.local;t.escaped||(n=c(e.local));var r=t.prepared?e:f({local:n,domain:e.domain,resource:e.resource}),i=n?"".concat(n,"@").concat(r.domain):r.domain;return r.resource?"".concat(i,"/").concat(r.resource):i}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="",n="",r=e.indexOf("/");r>0&&(n=e.slice(r+1),e=e.slice(0,r));var i=e.indexOf("@");i>0&&(t=e.slice(0,i),e=e.slice(i+1));var a=f({domain:e,local:t,resource:n});return{bare:d({local:a.local,domain:a.domain},{escaped:!0,prepared:!0}),domain:a.domain,full:d(a,{escaped:!0,prepared:!0}),local:l(a.local),resource:a.resource}}function h(e){return!!p(e).resource}function v(){return p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").bare}}),R=()=>n(6519),P=()=>n(9978),C=()=>n(98),M=()=>n(5937),D=()=>n(1990),L=n.cw(function(e,t){var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return a(t,e),t}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.Platform=t.SASL=t.RTT=t.RSM=t.Utils=t.Jingle=t.Stanzas=t.Namespaces=t.JID=t.JXT=t.DataForms=t.Constants=t.Client=void 0,t.createClient=function(e){var t=new c.default(e);return t.use(w.default),t};var c=u(I());t.Client=c.default;var l=o(N());t.Constants=l;var f=o(n(4755));t.RTT=f;var d=o(j());t.JID=d;var p=o(B());t.Jingle=p;var h=o(F());t.JXT=h;var v=o(U());t.SASL=v;var m=o(R());t.Namespaces=m;var g=o(ce());t.Stanzas=g;var y=o(P());t.Utils=y;var b=o(J());t.Platform=b,s(D(),t);var S=o(n(895));t.RSM=S;var _=o(C());t.DataForms=_,t.VERSION=l.VERSION;var w=u(Z());s(Z(),t)}),B=()=>n(4697),F=()=>n(7930),q=()=>n(1060),U=()=>n(9255),z=()=>n(3486),J=()=>n(2208),G=()=>n(3463),H=()=>n(2319),W=()=>n(6061),V=()=>n(4953),Q=()=>n(2934),K=n.cw(function(e,t){var r=Te(),i=ge(),a=he();function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u,c=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=this&&this.__importStar||(u=function(e){return u=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},u(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=u(e),r=0;r<n.length;r++)"default"!==n[r]&&c(t,e,n[r]);return l(t,e),t}),d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco=new p.default,e.disco.addFeature(v.NS_DISCO_INFO),e.disco.addFeature(v.NS_DISCO_ITEMS),e.disco.addIdentity({category:"client",type:"web"}),e.registerFeature("caps",100,function(t,n){var r=h.getDomain(e.jid)||e.config.server;e.emit("disco:caps",{caps:t.legacyCapabilities||[],jid:r}),e.features.negotiated.caps=!0,n()}),e.getDiscoInfo=function(){var t=a(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({disco:{node:i,type:"info"},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",s({extensions:[],features:[],identities:[]},a.disco));case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.getDiscoItems=function(){var t=a(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({disco:{node:i,type:"items"},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",s({items:[]},a.disco));case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.updateCaps=function(){var t=e.config.capsNode||"https://stanzajs.org";return e.disco.updateCaps(t)},e.getCurrentCaps=function(){var t=e.disco.getCaps();if(t){var n="".concat(t[0].node,"#").concat(t[0].value);return{info:e.disco.getNodeInfo(n),legacyCapabilities:t}}},e.on("presence",function(t){t.legacyCapabilities&&e.emit("disco:caps",{caps:t.legacyCapabilities,jid:t.from})}),e.on("iq:get:disco",function(t){var n=t.disco,r=n.type,i=n.node;"info"===r&&e.sendIQResult(t,{disco:s(s({},e.disco.getNodeInfo(i||"")),{},{node:i,type:"info"})}),"items"===r&&e.sendIQResult(t,{disco:{items:e.disco.items.get(i||"")||[],type:"items"}})})};var p=d(n(3032)),h=f(j()),v=R()}),X=()=>n(4801),Y=()=>n(3329),$=()=>n(7241),Z=n.cw(function(e,t){var n=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.core=function(e){e.use(d.default),e.use(l.default),e.use(s.default),e.use(c.default),e.use(p.default),e.use(_.default)},t.default=function(e){e.use(a.default),e.use(m.default),e.use(o.default),e.use(u.default),e.use(f.default),e.use(h.default),e.use(v.default),e.use(g.default),e.use(y.default),e.use(b.default),e.use(S.default),e.use(w.default)},r(G(),t),r(H(),t),r(W(),t),r(V(),t),r(Q(),t),r(K(),t),r(X(),t),r(Y(),t),r($(),t),r(ee(),t),r(te(),t),r(ne(),t),r(re(),t),r(ie(),t),r(ae(),t),r(oe(),t),r(se(),t),r(ue(),t);var a=i(G()),o=i(H()),s=i(W()),u=i(V()),c=i(Q()),l=i(K()),f=i(X()),d=i(Y()),p=i($()),h=i(ee()),v=i(te()),m=i(ne()),g=i(re()),y=i(ie()),b=i(ae()),S=i(oe()),_=i(se()),w=i(ue())}),ee=()=>n(9611),te=n.cw(function(e,t){var n=ge(),r=Te(),i=he();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),r=0;r<n.length;r++)"default"!==n[r]&&u(t,e,n[r]);return c(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.getHistorySearchForm=function(){var t=i(r.mark(function t(n){var i,a,o=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:{},t.next=1,e.sendIQ({archive:{type:"query",version:i.version},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.archive.form);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.searchHistory=function(){var t=i(r.mark(function t(n){var i,a,s,u,c,l,h,v,m,g,y=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=y.length>1&&void 0!==y[1]?y[1]:{},a=e.nextId(),s="","string"==typeof n?s=n:(s=n.to||"",i=n),i.queryId=a,(u=i.form||{}).type="submit",c=u.fields||[],l=[{name:"FORM_TYPE",type:"hidden",value:p.NS_MAM_2}],i.with&&l.push({name:"with",type:"text-single",value:i.with}),i.start&&l.push({name:"start",type:"text-single",value:i.start.toISOString()}),i.end&&l.push({name:"end",type:"text-single",value:i.end.toISOString()}),u.fields=(0,f.mergeFields)(l,c),i.form=u,h=d.allowedResponders(e.jid,s),v=[],m=function(e){h.has(e.from)&&e.archive&&e.archive.queryId===a&&v.push(e.archive)},e.on("mam:item",m),t.prev=1,t.next=2,e.sendIQ({archive:i,id:a,to:s,type:"set"});case 2:return g=t.sent,t.abrupt("return",o(o({},g.archive),{},{results:v}));case 3:return t.prev=3,e.off("mam:item",m),t.finish(3);case 4:case"end":return t.stop()}},t,null,[[1,,3,4]])}));return function(e){return t.apply(this,arguments)}}(),e.getHistoryPreferences=i(r.mark(function t(){var n;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({archive:{type:"preferences"},type:"get"});case 1:return n=t.sent,t.abrupt("return",n.archive);case 2:case"end":return t.stop()}},t)})),e.setHistoryPreferences=function(t){return e.sendIQ({archive:o({type:"preferences"},t),type:"set"})},e.on("message",function(t){t.archive&&e.emit("mam:item",t)})};var f=C(),d=l(j()),p=R()}),ne=n.cw(function(e,t){var n=Te(),r=ge(),i=he();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),r=0;r<n.length;r++)"default"!==n[r]&&u(t,e,n[r]);return c(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature(d.NS_ATTENTION_0),e.disco.addFeature(d.NS_CHAT_MARKERS_0),e.disco.addFeature(d.NS_CHAT_STATES),e.disco.addFeature(d.NS_CORRECTION_0),e.disco.addFeature(d.NS_RECEIPTS),e.disco.addFeature(d.NS_RTT_0),e.enableCarbons=function(){return x(e,"enable")},e.disableCarbons=function(){return x(e,"disable")},e.markReceived=function(t){return e.sendMarker(t,"received")},e.markDisplayed=function(t){return e.sendMarker(t,"displayed")},e.markAcknowledged=function(t){return e.sendMarker(t,"acknowledged")},e.getAttention=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendMessage(o(o({},n),{},{requestingAttention:!0,to:t,type:"headline"}))},e.sendMarker=function(t,n,r){if(w(t,n)||r){var i=!1!==e.config.groupchatMarkersUseStanzaID,a=t.id;if("groupchat"===t.type&&t.stanzaIds&&i){var o=t.stanzaIds.find(function(e){return f.equalBare(e.by,t.from)});o&&(a=o.id)}e.sendMessage({marker:{id:a,type:n},to:"groupchat"===t.type?f.toBare(t.from):t.from,type:t.type})}},e.on("message",function(t){if(t.carbon&&f.equalBare(t.from,e.jid)){var n=t.carbon.forward.message;n.delay||(n.delay=t.carbon.forward.delay||{timestamp:new Date(Date.now())}),m(t)&&(e.emit("carbon:received",t),e.emit("message",n)),g(t)&&(e.emit("carbon:sent",t),e.emit("message:sent",n,!0))}O(t)&&e.emit("dataform",t),t.requestingAttention&&e.emit("attention",t),S(t)&&e.emit("rtt",t),_(t)&&e.emit("replace",t),y(t)&&h.has(t.type||"normal")&&e.emit("chat:state",t);var r=!1!==e.config.sendReceipts,i=!1!==e.config.sendMUCReceipts,a=!1!==e.config.chatMarkers,o=!1!==e.config.groupchatMarkersUseStanzaID,s=b(t),u=w(t,"received"),c=s&&r&&("groupchat"!==t.type||i);if(c||a&&u){var l="groupchat"===t.type?f.toBare(t.from):t.from,d=t.id;if("groupchat"===t.type&&t.stanzaIds&&o){var p=t.stanzaIds.find(function(e){return f.equalBare(e.by,t.from)});p&&(d=p.id)}e.sendMessage({receipt:c?{id:t.id,type:"received"}:void 0,marker:a&&u?{id:d,type:"received"}:void 0,to:l,type:t.type})}t.receipt&&"received"===t.receipt.type&&e.emit("receipt",t),t.marker&&"markable"!==t.marker.type&&e.emit("marker:".concat(t.marker.type),t)})};var f=l(j()),d=R(),p=new Set(["chat","groupchat","headline","normal"]),h=new Set(["chat","groupchat","normal"]),v=new Map([["markable",0],["received",1],["displayed",2],["acknowledged",3]]),m=function(e){return!!e.carbon&&"received"===e.carbon.type},g=function(e){return!!e.carbon&&"sent"===e.carbon.type},y=function(e){return!!e.chatState},b=function(e){var t;return!!e.receipt&&"request"===e.receipt.type&&p.has(null!==(t=e.type)&&void 0!==t?t:"normal")},S=function(e){return!!e.rtt},_=function(e){return!!e.replace},w=function(e,t){var n;return e.marker&&(v.get(e.marker.type)<v.get(t)||"markable"===(null===(n=e.marker)||void 0===n?void 0:n.type))},O=function(e){return!!e.forms&&e.forms.length>0};function x(e,t){return k.apply(this,arguments)}function k(){return(k=i(n.mark(function e(t,r){return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.sendIQ({carbons:{action:r},type:"set"});case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}}),re=n.cw(function(e,t){var n=Te(),r=ge(),i=he(),a=we();function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var l,f=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),d=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p=this&&this.__importStar||(l=function(e){return l=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},l(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=l(e),r=0;r<n.length;r++)"default"!==n[r]&&f(t,e,n[r]);return d(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature(m.NS_MUC),e.disco.addFeature(m.NS_MUC_DIRECT_INVITE),e.disco.addFeature(m.NS_HATS_0),e.joinedRooms=new Map,e.joiningRooms=new Map,e.leavingRooms=new Map,e.on("session:started",function(){var t=e.joiningRooms;e.joiningRooms=new Map;var n,r=u(t);try{for(r.s();!(n=r.n()).done;){var i=a(n.value,2),o=i[0],s=i[1];e.joinRoom(o,s)}}catch(e){r.e(e)}finally{r.f()}var c=e.joinedRooms;e.joinedRooms=new Map;var l,f=u(c);try{for(f.s();!(l=f.n()).done;){var d=a(l.value,2),p=d[0],h=d[1];e.joinRoom(p,h)}}catch(e){f.e(e)}finally{f.f()}}),e.on("message",function(t){if("groupchat"!==t.type||!t.hasSubject||t.body){if(t.muc)if("direct-invite"===t.muc.type||!t.muc.invite&&t.legacyMUC){var n="direct-invite"===t.muc.type?t.muc:t.legacyMUC;e.emit("muc:invite",{from:t.from,password:n.password,reason:n.reason,room:n.jid,thread:n.thread,type:"direct"})}else t.muc.invite?e.emit("muc:invite",{from:t.muc.invite[0].from,password:t.muc.password,reason:t.muc.invite[0].reason,room:t.from,thread:t.muc.invite[0].thread,type:"mediated"}):t.muc.decline?e.emit("muc:declined",{from:t.muc.decline.from,reason:t.muc.decline.reason,room:t.from}):e.emit("muc:other",t)}else e.emit("muc:topic",{from:t.from,room:v.toBare(t.from),topic:t.subject||""})}),e.on("presence",function(t){var n=v.toBare(t.from);if(e.joiningRooms.has(n)&&"error"===t.type)return e.joiningRooms.delete(n),e.emit("muc:failed",t),void e.emit("muc:error",t);if(function(e){return!!e.muc}(t)){var r=t.muc.statusCodes&&t.muc.statusCodes.indexOf(h.MUCStatusCode.SelfPresence)>=0,i=t.muc.statusCodes&&t.muc.statusCodes.indexOf(h.MUCStatusCode.NickChanged)>=0;if("error"!==t.type){if("unavailable"===t.type)return e.emit("muc:unavailable",t),r&&(i?e.joinedRooms.set(n,t.muc.nick):(e.emit("muc:leave",t),e.joinedRooms.delete(n),e.leavingRooms.delete(n))),void(t.muc.destroy&&e.emit("muc:destroyed",{newRoom:t.muc.destroy.jid,password:t.muc.destroy.password,reason:t.muc.destroy.reason,room:n}));e.emit("muc:available",t);var a=e.joiningRooms.has(n)||!e.joinedRooms.has(n);r&&(e.joinedRooms.set(n,v.getResource(t.from)),a&&(e.joiningRooms.delete(n),e.emit("muc:join",t)))}else e.emit("muc:error",t)}}),e.joinRoom=function(){var t=i(n.mark(function t(r,i){var a,o=arguments;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.length>2&&void 0!==o[2]?o[2]:{},r=v.toBare(r),e.joiningRooms.set(r,i||""),i){t.next=4;break}return t.prev=1,t.next=2,e.getReservedNick(r);case 2:i=t.sent,e.joiningRooms.set(r,i),t.next=4;break;case 3:throw t.prev=3,t.catch(1),new Error("Room nick required");case 4:return t.abrupt("return",new Promise(function(t,n){function o(n){v.equalBare(n.from,r)&&(e.off("muc:join",o),e.off("muc:failed",u),t(n))}function u(t){v.equalBare(t.from,r)&&(e.off("muc:join",o),e.off("muc:failed",u),n(t))}e.on("muc:join",o),e.on("muc:failed",u),e.sendPresence(s(s({},a),{},{muc:s(s({},a.muc),{},{type:"join"}),to:v.createFull(r,i)}))}));case 5:case"end":return t.stop()}},t,null,[[1,3]])}));return function(e,n){return t.apply(this,arguments)}}(),e.leaveRoom=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=v.toBare(t),n=n||e.joinedRooms.get(t),e.leavingRooms.set(t,n),new Promise(function(i,a){var o=r.id||(0,g.uuid)(),u=v.allowedResponders(t);function c(n){v.equalBare(n.from,t)&&(e.off("muc:leave",c),e.off("presence:error",l),i(n))}function l(n){n.id===o&&u.has(n.from)&&(e.joinedRooms.has(t)||e.leavingRooms.delete(t),e.off("muc:leave",c),e.off("presence:error",l),a(n))}e.on("muc:leave",c),e.on("presence:error",l),e.sendPresence(s(s({},r),{},{id:o,to:v.createFull(t,n),type:"unavailable"}))})},e.ban=function(t,n,r){return e.setRoomAffiliation(t,n,"outcast",r)},e.kick=function(t,n,r){return e.setRoomRole(t,n,"none",r)},e.invite=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(n)||(n=[n]),e.sendMessage({muc:{invite:n,type:"info"},to:t})},e.directInvite=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.sendMessage({muc:s(s({},r),{},{jid:t,type:"direct-invite"}),to:n})},e.declineInvite=function(t,n,r){e.sendMessage({muc:{decline:{reason:r,to:n},type:"info"},to:t})},e.changeNick=function(t,n){var r=(0,g.uuid)(),i=v.createFull(t,n),a=v.allowedResponders(t);return new Promise(function(t,n){function o(n){a.has(v.toBare(n.from))&&n.muc.statusCodes&&n.muc.statusCodes.includes(h.MUCStatusCode.SelfPresence)&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),t(n))}function s(i){a.has(v.toBare(i.from))&&i.id===r&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),"error"===i.type?n(i):t(i))}e.on("muc:available",o),e.on("presence:id:".concat(r),s),e.sendPresence({id:r,to:i})})},e.setSubject=function(t,n){e.sendMessage({subject:n,to:t,type:"groupchat"})},e.getReservedNick=function(){var t=i(n.mark(function t(r){var i,a;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=1,e.getDiscoInfo(r,"x-roomuser-item");case 1:if(i=t.sent,!(a=i.identities[0]).name){t.next=2;break}return t.abrupt("return",a.name);case 2:throw new Error("No nickname reserved");case 3:t.next=5;break;case 4:throw t.prev=4,t.catch(0),new Error("No nickname reserved");case 5:case"end":return t.stop()}},t,null,[[0,4]])}));return function(e){return t.apply(this,arguments)}}(),e.requestRoomVoice=function(t){e.sendMessage({forms:[{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/muc#request"},{name:"muc#role",type:"text-single",value:"participant"}],type:"submit"}],to:t})},e.setRoomAffiliation=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{affiliation:r,jid:n,reason:i}]},to:t,type:"set"})},e.setRoomRole=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{nick:n,reason:i,role:r}]},to:t,type:"set"})},e.getRoomMembers=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{affiliation:"member"};return e.sendIQ({muc:{type:"user-list",users:[n]},to:t,type:"get"})},e.getRoomConfig=function(){var t=i(n.mark(function t(r){var i;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({muc:{type:"configure"},to:r,type:"get"});case 1:if((i=t.sent).muc.form){t.next=2;break}throw new Error("No configuration form returned");case 2:return t.abrupt("return",i.muc.form);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.configureRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{form:s(s({},n),{},{type:"submit"}),type:"configure"},to:t,type:"set"})},e.destroyRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{destroy:n,type:"configure"},to:t,type:"set"})},e.getUniqueRoomName=function(){var e=i(n.mark(function e(t){var r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,this.sendIQ({muc:{type:"unique"},to:t,type:"get"});case 1:if((r=e.sent).muc.name){e.next=2;break}throw new Error("No unique name returned");case 2:return e.abrupt("return",r.muc.name);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),e.getBookmarks=i(n.mark(function t(){var r;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.getPrivateData("bookmarks");case 1:if((r=t.sent)&&r.rooms){t.next=2;break}return t.abrupt("return",[]);case 2:return t.abrupt("return",r.rooms);case 3:case"end":return t.stop()}},t)})),e.setBookmarks=function(t){return e.setPrivateData("bookmarks",{rooms:t})},e.addBookmark=function(){var t=i(n.mark(function t(r){var i,a,o,c,l,f;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.getBookmarks();case 1:i=t.sent,a=[],o=!1,c=u(i);try{for(c.s();!(l=c.n()).done;)f=l.value,v.equalBare(f.jid,r.jid)?(a.push(s(s({},f),r)),o=!0):a.push(f)}catch(e){c.e(e)}finally{c.f()}return o||a.push(r),t.abrupt("return",e.setBookmarks(a));case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.removeBookmark=function(){var t=i(n.mark(function t(r){var i,a;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.getBookmarks();case 1:return i=t.sent,a=i.filter(function(e){return!v.equalBare(e.jid,r)}),t.abrupt("return",e.setBookmarks(a));case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()};var h=N(),v=p(j()),m=R(),g=P()}),ie=()=>n(3857),ae=n.cw(function(e,t){var n=ge(),r=Te(),i=he();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),r=0;r<n.length;r++)"default"!==n[r]&&u(t,e,n[r]);return c(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.disco.addFeature("".concat(d.NS_SHIM,"#SubID"),d.NS_SHIM),e.on("message",function(t){!function(e){return!!e.pubsub&&!(e.pubsub.context&&"user"!==e.pubsub.context||!e.pubsub.affiliations)}(t)?function(e){return!!e.pubsub}(t)&&(e.emit("pubsub:event",t),function(e){return!!e.pubsub.items&&!!e.pubsub.items.published}(t)?e.emit("pubsub:published",t):function(e){return!!e.pubsub.items&&!!e.pubsub.items.retracted}(t)?e.emit("pubsub:retracted",t):function(e){return"purge"===e.pubsub.eventType}(t)?e.emit("pubsub:purged",t):function(e){return"delete"===e.pubsub.eventType}(t)?e.emit("pubsub:deleted",t):function(e){return"subscription"===e.pubsub.eventType}(t)?e.emit("pubsub:subscription",t):function(e){return"configuration"===e.pubsub.eventType}(t)&&e.emit("pubsub:config",t)):e.emit("pubsub:affiliations",t)}),e.subscribeToNode=function(){var t=i(r.mark(function t(n,i){var a,o,s,u;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a={},"string"==typeof i?(a.node=i,a.jid=f.toBare(e.jid)):(a.node=i.node,a.jid=i.jid||(i.useBareJID?f.toBare(e.jid):e.jid),o=i.options),t.next=1,e.sendIQ({pubsub:{context:"user",subscribe:a,subscriptionOptions:o?{form:o}:void 0},to:n,type:"set"});case 1:return s=t.sent,u=s.pubsub.subscription||{},s.pubsub.subscriptionOptions&&(u.options=s.pubsub.subscriptionOptions.form),t.abrupt("return",u);case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.unsubscribeFromNode=function(){var t=i(r.mark(function t(n,i){var a,s;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a={},"string"==typeof i?(a.node=i,a.jid=f.toBare(e.jid)):(a.node=i.node,a.subid=i.subid,a.jid=i.jid||(i.useBareJID?f.toBare(e.jid):e.jid)),t.next=1,e.sendIQ({pubsub:{context:"user",unsubscribe:a},to:n,type:"set"});case 1:if((s=t.sent).pubsub&&s.pubsub.subscription){t.next=2;break}return t.abrupt("return",o(o({},a),{},{state:"none"}));case 2:return t.abrupt("return",s.pubsub.subscription);case 3:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.publish=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",publish:{item:{content:r,id:i},node:n}},to:t,type:"set"})},e.getItem=function(){var t=i(r.mark(function t(n,i,a){var o;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{context:"user",fetch:{items:[{id:a}],node:i}},to:n,type:"get"});case 1:return o=t.sent,t.abrupt("return",o.pubsub.fetch.items[0]);case 2:case"end":return t.stop()}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),e.getItems=function(){var t=i(r.mark(function t(n,i){var a,o,s,u=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.next=1,e.sendIQ({pubsub:{context:"user",fetch:{max:a.max,node:i},paging:a},to:n,type:"get"});case 1:return o=t.sent,(s=o.pubsub.fetch).paging=o.pubsub.paging,t.abrupt("return",s);case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.retract=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",retract:{id:r,node:n,notify:i}},to:t,type:"set"})},e.purgeNode=function(t,n){return e.sendIQ({pubsub:{context:"owner",purge:n},to:t,type:"set"})},e.deleteNode=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",destroy:{node:n,redirect:r}},to:t,type:"set"})},e.createNode=function(){var t=i(r.mark(function t(n,i,a){var o;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{configure:a?{form:a}:void 0,context:"user",create:{node:i}},to:n,type:"set"});case 1:if((o=t.sent).pubsub&&o.pubsub.create){t.next=2;break}return t.abrupt("return",{node:i});case 2:return t.abrupt("return",o.pubsub.create);case 3:case"end":return t.stop()}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),e.getSubscriptions=function(){var t=i(r.mark(function t(n){var i,a,o=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:{},t.next=1,e.sendIQ({pubsub:{context:"user",subscriptions:i},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.pubsub.subscriptions);case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.getAffiliations=function(t,n){return e.sendIQ({pubsub:{affiliations:{node:n}},to:t,type:"get"})},e.getNodeSubscribers=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"string"==typeof n?r.node=n:r=o(o({},r),n),e.sendIQ({pubsub:{context:"owner",subscriptions:r},to:t,type:"get"})},e.updateNodeSubscriptions=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",subscriptions:{items:r,node:n}},to:t,type:"set"})},e.getNodeAffiliations=function(){var t=i(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{affiliations:{node:i},context:"owner"},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.pubsub.affiliations);case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.updateNodeAffiliations=function(t,n,r){return e.sendIQ({pubsub:{affiliations:{items:r,node:n},context:"owner"},to:t,type:"set"})},e.getNodeConfig=function(){var t=i(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{configure:{node:i},context:"owner"},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.pubsub.configure.form||{});case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.getDefaultNodeConfig=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{context:"owner",defaultConfiguration:{}},to:n,type:"get"});case 1:return i=t.sent,t.abrupt("return",i.pubsub.defaultConfiguration.form||{});case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.configureNode=function(){var t=i(r.mark(function t(n,i,a){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({pubsub:{configure:{form:a,node:i},context:"owner"},to:n,type:"set"}));case 1:case"end":return t.stop()}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),e.getDefaultSubscriptionOptions=function(){var t=i(r.mark(function t(n){var i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({pubsub:{defaultSubscriptionOptions:{}},to:n,type:"get"});case 1:return i=t.sent,t.abrupt("return",i.pubsub.defaultSubscriptionOptions.form||{});case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()};var f=l(j()),d=R()}),oe=n.cw(function(e,t){var n=ge(),r=Te(),i=he();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),r=0;r<n.length;r++)"default"!==n[r]&&u(t,e,n[r]);return c(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e,t){return n.apply(this,arguments)}function n(){return(n=i(r.mark(function t(n,i){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({blockList:{action:n,jids:[i]},type:"set"});case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}e.on("iq:set:roster",function(t){if(!f.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});e.emit("roster:update",t),e.sendIQResult(t)}),e.on("iq:set:blockList",function(t){if(!f.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});var n=t.blockList;e.emit(n.action,{jids:n.jids||[]}),e.sendIQResult(t)}),e.getRoster=i(r.mark(function t(){var n,i;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({roster:{version:e.config.rosterVer},type:"get"});case 1:if(!(n=t.sent).roster){t.next=2;break}return(i=n.roster.version)&&(e.config.rosterVer=i,e.emit("roster:ver",i)),n.roster.items=n.roster.items||[],t.abrupt("return",n.roster);case 2:return t.abrupt("return",{items:[]});case 3:case"end":return t.stop()}},t)})),e.updateRosterItem=function(){var t=i(r.mark(function t(n){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({roster:{items:[n]},type:"set"});case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.removeRosterItem=function(t){return e.updateRosterItem({jid:t,subscription:"remove"})},e.subscribe=function(t){e.sendPresence({type:"subscribe",to:t})},e.unsubscribe=function(t){e.sendPresence({type:"unsubscribe",to:t})},e.acceptSubscription=function(t){e.sendPresence({type:"subscribed",to:t})},e.denySubscription=function(t){e.sendPresence({type:"unsubscribed",to:t})},e.getBlocked=i(r.mark(function t(){var n;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({blockList:{action:"list"},type:"get"});case 1:return n=t.sent,t.abrupt("return",o({jids:[]},n.blockList));case 2:case"end":return t.stop()}},t)})),e.block=function(){var e=i(r.mark(function e(n){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("block",n));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.unblock=function(){var e=i(r.mark(function e(n){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("unblock",n));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.goInvisible=i(r.mark(function t(){var n,i=arguments;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>0&&void 0!==i[0]&&i[0],t.next=1,e.sendIQ({type:"set",visiblity:{probe:n,type:"invisible"}});case 1:case"end":return t.stop()}},t)})),e.goVisible=i(r.mark(function t(){return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({type:"set",visiblity:{type:"visible"}});case 1:case"end":return t.stop()}},t)}))};var f=l(j())}),se=()=>n(5989),ue=n.cw(function(e,t){var n=ge(),r=Te(),i=he();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c,l=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),f=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=this&&this.__importStar||(c=function(e){return c=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},c(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=c(e),r=0;r<n.length;r++)"default"!==n[r]&&l(t,e,n[r]);return f(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e){return n.apply(this,arguments)}function n(){return(n=i(r.mark(function t(n){var i,a,o,u,c,l,f,d;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.getDiscoInfo(n);case 1:if((i=t.sent).features&&i.features.includes(h.NS_HTTP_UPLOAD_0)){t.next=2;break}return t.abrupt("return");case 2:o=s(i.extensions||[]),t.prev=3,o.s();case 4:if((u=o.n()).done){t.next=6;break}if(c=u.value,!(l=c.fields||[]).some(function(e){return"FORM_TYPE"===e.name&&e.value===h.NS_HTTP_UPLOAD_0})){t.next=5;break}return(f=l.find(function(e){return"max-file-size"===e.name}))&&(a=parseInt(f.value,10)),t.abrupt("return",{jid:n,maxSize:a});case 5:t.next=4;break;case 6:t.next=8;break;case 7:t.prev=7,d=t.catch(3),o.e(d);case 8:return t.prev=8,o.f(),t.finish(8);case 9:case"end":return t.stop()}},t,null,[[3,7,8,9]])}))).apply(this,arguments)}e.disco.addFeature(h.NS_BOB),e.getBits=function(){var t=i(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({bits:{cid:i},to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.bits);case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.getUploadService=i(r.mark(function n(){var i,a,o,u,c,l,f,d,h=arguments;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=h.length>0&&void 0!==h[0]?h[0]:p.getDomain(e.jid),n.next=1,t(i);case 1:if(!(a=n.sent)){n.next=2;break}return n.abrupt("return",a);case 2:return n.next=3,e.getDiscoItems(i);case 3:o=n.sent,u=s(o.items||[]),n.prev=4,u.s();case 5:if((c=u.n()).done){n.next=9;break}if((l=c.value).jid){n.next=6;break}return n.abrupt("continue",8);case 6:return n.next=7,t(l.jid);case 7:if(!(f=n.sent)){n.next=8;break}return n.abrupt("return",f);case 8:n.next=5;break;case 9:n.next=11;break;case 10:n.prev=10,d=n.catch(4),u.e(d);case 11:return n.prev=11,u.f(),n.finish(11);case 12:throw new Error("No upload service discovered on: "+i);case 13:case"end":return n.stop()}},n,null,[[4,10,11,12]])})),e.getUploadSlot=function(){var t=i(r.mark(function t(n,i){var a;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.sendIQ({httpUpload:o({type:"request"},i),to:n,type:"get"});case 1:return a=t.sent,t.abrupt("return",a.httpUpload);case 2:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()};var p=d(j()),h=R()}),ce=()=>n(4224),le=()=>n(1284),fe=()=>n(1925),de=()=>n(1205),pe=()=>n(9357),he=()=>n(9293),ve=()=>n(7383),me=()=>n(4579),ge=()=>n(3693),ye=()=>n(2395),be=()=>n(3072),Se=()=>n(9511),_e=()=>n(8452),we=()=>n(5715),Oe=()=>n(1132),xe=()=>n(3738),ke=()=>n(1837),Te=()=>n(4756),Ae=()=>n(1764),Ee=()=>n(744);function Ie(){return Ie.c||(Ie.c=n.t(A(),2))}h(),S(),p(),g(),v(),u(),o(),t();const Ne=t().Client})(),window.GenesysCloudStreamingClient=r.default})();