@cloudflare/realtimekit-ui 2.2.0-staging.2 → 2.2.0-staging.3

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.
@@ -182,6 +182,20 @@ const RtkNotifications = class {
182
182
  this.audio = new notification.RTKNotificationsAudio(meeting);
183
183
  const { notifications, notification_duration, notification_sounds } = this.permissions;
184
184
  this.participantJoinedListener = (participant) => {
185
+ /**
186
+ * NOTE(ravindra-cloudflare):
187
+ * Participants that immediately reconnected,
188
+ * due to Websocket disconnects with error code 1006,
189
+ * will have a peerIdBeforeReconnect set.
190
+ *
191
+ * We don't want to show notifications for such participants
192
+ * as they are not actually joining the meeting,
193
+ * but rather reconnecting to it.
194
+ */
195
+ const isReconnectedParticipant = !!participant.peerIdBeforeReconnect;
196
+ if (isReconnectedParticipant) {
197
+ return;
198
+ }
185
199
  if (notifications.participant_joined) {
186
200
  this.add({
187
201
  id: `${participant.id}-joined`,
@@ -195,8 +209,16 @@ const RtkNotifications = class {
195
209
  }
196
210
  };
197
211
  this.participantLeftListener = (participant) => {
212
+ /**
213
+ * NOTE(ravindra-cloudflare):
214
+ * A departing participant replaced after reconnecting has replacedByPeerId
215
+ * set before its leave event. Suppress the leave notification and sound.
216
+ */
217
+ if (participant.replacedByPeerId) {
218
+ return;
219
+ }
198
220
  const { socketState: { state }, } = this.meeting.meta;
199
- if (notifications.participant_left && state !== 'connected') {
221
+ if (notifications.participant_left && state === 'connected') {
200
222
  this.add({
201
223
  id: `${participant.id}-left`,
202
224
  message: `${string.formatName(participant.name)} ${this.t('notifications.left')}`,
@@ -942,7 +942,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
942
942
  * The literal below is replaced with the released package version by `prepublish.js`.
943
943
  * Builds that are not published (local, dev) report it as is.
944
944
  */
945
- const UI_KIT_VERSION = '2.2.0-staging.2';
945
+ const UI_KIT_VERSION = '2.2.0-staging.3';
946
946
  /**
947
947
  * The wrapper packages load components from the loader bundle, which carries its own copy of
948
948
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -146,6 +146,20 @@ export class RtkNotifications {
146
146
  this.audio = new RTKNotificationsAudio(meeting);
147
147
  const { notifications, notification_duration, notification_sounds } = this.permissions;
148
148
  this.participantJoinedListener = (participant) => {
149
+ /**
150
+ * NOTE(ravindra-cloudflare):
151
+ * Participants that immediately reconnected,
152
+ * due to Websocket disconnects with error code 1006,
153
+ * will have a peerIdBeforeReconnect set.
154
+ *
155
+ * We don't want to show notifications for such participants
156
+ * as they are not actually joining the meeting,
157
+ * but rather reconnecting to it.
158
+ */
159
+ const isReconnectedParticipant = !!participant.peerIdBeforeReconnect;
160
+ if (isReconnectedParticipant) {
161
+ return;
162
+ }
149
163
  if (notifications.participant_joined) {
150
164
  this.add({
151
165
  id: `${participant.id}-joined`,
@@ -159,8 +173,16 @@ export class RtkNotifications {
159
173
  }
160
174
  };
161
175
  this.participantLeftListener = (participant) => {
176
+ /**
177
+ * NOTE(ravindra-cloudflare):
178
+ * A departing participant replaced after reconnecting has replacedByPeerId
179
+ * set before its leave event. Suppress the leave notification and sound.
180
+ */
181
+ if (participant.replacedByPeerId) {
182
+ return;
183
+ }
162
184
  const { socketState: { state }, } = this.meeting.meta;
163
- if (notifications.participant_left && state !== 'connected') {
185
+ if (notifications.participant_left && state === 'connected') {
164
186
  this.add({
165
187
  id: `${participant.id}-left`,
166
188
  message: `${formatName(participant.name)} ${this.t('notifications.left')}`,
@@ -2,7 +2,7 @@
2
2
  * The literal below is replaced with the released package version by `prepublish.js`.
3
3
  * Builds that are not published (local, dev) report it as is.
4
4
  */
5
- const UI_KIT_VERSION = '2.2.0-staging.2';
5
+ const UI_KIT_VERSION = '2.2.0-staging.3';
6
6
  /**
7
7
  * The wrapper packages load components from the loader bundle, which carries its own copy of
8
8
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -1 +1 @@
1
- import{j as t,k as n,l as o,m as r,n as e,o as i,p as s,q as a,r as c,s as f,t as u,v as d,w as l,x as v,y as m,z as p,A as b,S as g}from"./p-aXMUeMjU.js";import{i as y,a as k,b as F}from"./p-Dkd2PDJ-.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const j={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},x={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},h={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function E(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=E(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in x){const r=x[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=j[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var R,S,B,I=Date.now,M=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,P=(R=M,S=0,B=0,function(){var t=I(),n=16-(t-B);if(B=t,n>0){if(++S>=800)return arguments[0]}else S=0;return R.apply(void 0,arguments)}),U=Math.max;var L=Object.prototype.hasOwnProperty;function N(t){return r(t)?a(t,!0):function(t){if(!y(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=s(t),o=[];for(var r in t)("constructor"!=r||!n&&L.call(t,r))&&o.push(r);return o}(t)}var T=Function.prototype.toString,H=Object.prototype.hasOwnProperty,V=T.call(Object);function q(t,o,r){(void 0!==r&&!i(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function J(t,e,i,s,a,g,$){var j=z(t,i),x=z(e,i),h=$.get(x);if(h)q(t,i,h);else{var E,A=g?g(j,x,i+"",t,e,$):void 0,O=void 0===A;if(O){var D=d(x),w=!D&&f(x),C=!D&&!w&&u(x);A=x,D||w||C?d(j)?A=j:k(E=j)&&r(E)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(j):w?(O=!1,A=l(x,!0)):C?(O=!1,A=v(x,!0)):A=[]:function(t){if(!k(t)||"[object Object]"!=F(t))return!1;var n=c(t);if(null===n)return!0;var o=H.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&T.call(o)==V}(x)||m(x)?(A=j,m(j)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,N(t))}(j):y(j)&&!p(j)||(A=b(x))):O=!1}O&&($.set(x,A),a(A,x,s,g,$),$.delete(x)),q(t,i,A)}}function K(t,n,o,r,e){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(i,s){if(e||(e=new g),y(i))J(t,n,s,o,K,r,e);else{var a=r?r(z(t,s),i,s+"",t,n,e):void 0;void 0===a&&(a=i),q(t,s,a)}}),N)}var W,X=(W=function(t,n,o){K(t,n,o)},function(t,n){return P(function(t,n,o){return n=U(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=U(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,s=n.length,a=s>1?n[s-1]:void 0,c=s>2?n[2]:void 0;for(a=W.length>3&&"function"==typeof a?(s--,a):void 0,c&&function(t,n,o){if(!y(o))return!1;var s=typeof n;return!!("number"==s?r(o)&&e(n,o.length):"string"==s&&n in o)&&i(o[n],t)}(n[0],n[1],c)&&(a=s<3?void 0:a,s=1),t=Object(t);++o<s;){var f=n[o];f&&W(t,f,o)}return t})));const G=Symbol.for("rtk.uikit.sdkName"),Q=globalThis;function Y(t){Q[G]=t}function Z(){var t;return null!==(t=Q[G])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.2.0-staging.2",sdkName:Z()})}catch(t){}}export{A as i,X as m,C as p,tt as r,Y as s}
1
+ import{j as t,k as n,l as o,m as r,n as e,o as i,p as s,q as a,r as c,s as f,t as u,v as d,w as l,x as v,y as m,z as p,A as b,S as g}from"./p-aXMUeMjU.js";import{i as y,a as k,b as F}from"./p-Dkd2PDJ-.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const j={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},x={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},h={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function E(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=E(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in x){const r=x[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=j[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var R,S,B,I=Date.now,M=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,P=(R=M,S=0,B=0,function(){var t=I(),n=16-(t-B);if(B=t,n>0){if(++S>=800)return arguments[0]}else S=0;return R.apply(void 0,arguments)}),U=Math.max;var L=Object.prototype.hasOwnProperty;function N(t){return r(t)?a(t,!0):function(t){if(!y(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=s(t),o=[];for(var r in t)("constructor"!=r||!n&&L.call(t,r))&&o.push(r);return o}(t)}var T=Function.prototype.toString,H=Object.prototype.hasOwnProperty,V=T.call(Object);function q(t,o,r){(void 0!==r&&!i(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function J(t,e,i,s,a,g,$){var j=z(t,i),x=z(e,i),h=$.get(x);if(h)q(t,i,h);else{var E,A=g?g(j,x,i+"",t,e,$):void 0,O=void 0===A;if(O){var D=d(x),w=!D&&f(x),C=!D&&!w&&u(x);A=x,D||w||C?d(j)?A=j:k(E=j)&&r(E)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(j):w?(O=!1,A=l(x,!0)):C?(O=!1,A=v(x,!0)):A=[]:function(t){if(!k(t)||"[object Object]"!=F(t))return!1;var n=c(t);if(null===n)return!0;var o=H.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&T.call(o)==V}(x)||m(x)?(A=j,m(j)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,N(t))}(j):y(j)&&!p(j)||(A=b(x))):O=!1}O&&($.set(x,A),a(A,x,s,g,$),$.delete(x)),q(t,i,A)}}function K(t,n,o,r,e){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(i,s){if(e||(e=new g),y(i))J(t,n,s,o,K,r,e);else{var a=r?r(z(t,s),i,s+"",t,n,e):void 0;void 0===a&&(a=i),q(t,s,a)}}),N)}var W,X=(W=function(t,n,o){K(t,n,o)},function(t,n){return P(function(t,n,o){return n=U(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=U(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,s=n.length,a=s>1?n[s-1]:void 0,c=s>2?n[2]:void 0;for(a=W.length>3&&"function"==typeof a?(s--,a):void 0,c&&function(t,n,o){if(!y(o))return!1;var s=typeof n;return!!("number"==s?r(o)&&e(n,o.length):"string"==s&&n in o)&&i(o[n],t)}(n[0],n[1],c)&&(a=s<3?void 0:a,s=1),t=Object(t);++o<s;){var f=n[o];f&&W(t,f,o)}return t})));const G=Symbol.for("rtk.uikit.sdkName"),Q=globalThis;function Y(t){Q[G]=t}function Z(){var t;return null!==(t=Q[G])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.2.0-staging.3",sdkName:Z()})}catch(t){}}export{A as i,X as m,C as p,tt as r,Y as s}
@@ -1 +1 @@
1
- import{p as t,H as i,w as s,h as e,d as n,t as o}from"./p-BBHQOrFK.js";import{R as a}from"./p-B56IYWsZ.js";import{f as c}from"./p-CJsXePY3.js";import{c as h,i as r,e as d}from"./p-aXMUeMjU.js";import"./p-Rq_6y0HI.js";import{s as u}from"./p-C0vp-Q7v.js";import{f as l}from"./p-HuHRVcj4.js";import{S as p}from"./p-ByMjaTnP.js";import{d as g}from"./p-D6vw6bT2.js";import{d as m}from"./p-BYIBbfJ8.js";import{d as f}from"./p-C_e0a6jQ.js";const v=2e3,k=Object.freeze({notifications:{participant_joined:!0,participant_left:!0,participant_joined_waitlist:!0,chat:!0,polls:!0,webinar:!0,tab_sync:!0,recording_started:!0,recording_stopped:!0},notification_sounds:{participant_joined:!0,participant_left:!0,chat:!0,polls:!0,webinar:!0,participant_joined_waitlist:!0},notification_duration:{participant_joined:2100,participant_left:2100,participant_joined_waitlist:4e3,chat:v,polls:v,webinar:v,tab_sync:v,recording_started:v,recording_stopped:v},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});var _=function(t,i,s,e){var n,o=arguments.length,a=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,s,e);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(a=(o<3?n(a):o>3?n(i,s,a):n(i,s))||a);return o>3&&a&&Object.defineProperty(i,s,a),a};function j(t){return Object.keys(t).filter((i=>t[i]))}const b=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.permissions=k,this.enabledSounds=j(k.notification_sounds),this.config=h(),this.t=r(),this.iconPack=d,this.notifications=[],this.addStagePeersListeners=t=>{t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener)},this.removeStagePeersListeners=t=>{t.participants.joined.removeListener("participantJoined",this.participantJoinedListener),t.participants.joined.removeListener("participantLeft",this.participantLeftListener)},this.onNotification=t=>{this.add(t.detail);const i=t.detail.playSound;null!=i&&this.audio.play(i)},this.onRecordingUpdate=t=>{var i,s;"RECORDING"===t&&!1!==this.permissions.notifications.recording_started?this.add({id:"recording-started",icon:this.iconPack.recording,message:this.t("recording.started"),duration:null!==(i=this.permissions.notification_duration.recording_started)&&void 0!==i?i:v}):"STOPPING"===t&&!1!==this.permissions.notifications.recording_stopped&&this.add({id:"recording-stopped",icon:this.iconPack.stop_recording,message:this.t("recording.stopped"),duration:null!==(s=this.permissions.notification_duration.recording_stopped)&&void 0!==s?s:v})},this.paused=!1}connectedCallback(){"undefined"!=typeof document&&(null===document||void 0===document||document.addEventListener("rtkNotification",this.onNotification)),this.meetingChanged(this.meeting),this.configChanged(this.config),this.statesChanged(this.states)}clearListeners(t){var i,s,e,n,o,a,c,h;const r="LIVESTREAM"===t.meta.viewType;(r&&"ON_STAGE"===(null===(i=t.stage)||void 0===i?void 0:i.status)||!r)&&this.removeStagePeersListeners(t),this.chatUpdateListener&&(null===(s=t.chat)||void 0===s||s.removeListener("chatUpdate",this.chatUpdateListener)),this.pollUpdateListener&&(null===(e=t.polls)||void 0===e||e.removeListener("pollsUpdate",this.pollUpdateListener)),t.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener),this.stageRequestAccepted&&(null===(n=t.stage)||void 0===n||n.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(o=t.stage)||void 0===o||o.removeListener("stageRequestRejected",this.stageRequestRejected)),this.newStageRequests&&(null===(a=t.stage)||void 0===a||a.removeListener("newStageRequest",this.newStageRequests)),this.stageStatusUpdateListener&&(null===(c=t.stage)||void 0===c||c.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)),null===(h=t.recording)||void 0===h||h.removeListener("recordingUpdate",this.onRecordingUpdate),clearTimeout(this.disconnectTimeout),t.self.removeListener("deviceUpdate",this.deviceUpdateListener)}disconnectedCallback(){var t;"undefined"!=typeof document&&(null===document||void 0===document||document.removeEventListener("rtkNotification",this.onNotification)),this.meeting&&(this.clearListeners(this.meeting),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.activeTabUpdateListener&&(null===(t=this.meeting.meta)||void 0===t||t.removeListener("activeTabUpdate",this.activeTabUpdateListener)),this.peerStageStatusListener&&this.meeting.participants.joined.removeListener("stageStatusUpdate",this.peerStageStatusListener))}meetingChanged(t,i){var s,e,n,o,h,r,d,p,g;if(clearTimeout(this.disconnectTimeout),i&&this.clearListeners(i),!t)return;const m="LIVESTREAM"===t.meta.viewType;this.audio=new a(t);const{notifications:f,notification_duration:v,notification_sounds:k}=this.permissions;if(this.participantJoinedListener=t=>{f.participant_joined&&this.add({id:t.id+"-joined",message:`${c(t.name)} ${this.t("notifications.joined")}`,image:t.picture,duration:v.participant_joined}),k.participant_joined&&this.canPlayParticipantJoinedSound()&&this.audio.play("joined")},this.participantLeftListener=t=>{const{socketState:{state:i}}=this.meeting.meta;f.participant_left&&"connected"!==i&&this.add({id:t.id+"-left",message:`${c(t.name)} ${this.t("notifications.left")}`,image:t.picture,duration:v.participant_left}),k.participant_left&&this.canPlayParticipantJoinedSound()&&this.audio.play("left")},this.waitlistedParticipantJoinedListener=t=>{if(!this.canAcceptWaitingRequests())return;const i=t.id+"-joined-waitlist";this.add({id:i,message:`${c(t.name)} ${this.t("notifications.requesting_to_join_meeting")}`,image:t.picture,duration:v.participant_joined_waitlist,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.participants.acceptWaitingRoomRequest(t.id),this.remove(i)}}}),k.participant_joined_waitlist&&this.canPlayParticipantJoinedSound()&&this.audio.play("message")},this.waitlistedParticipantLeftListener=t=>{this.remove(t.id+"-joined-waitlist")},this.chatUpdateListener=({message:i,action:s})=>{if("add"!==s)return;const e=l(i);if(null!=e){if(e.userId===t.self.userId)return;"text"===e.type&&(f.chat&&this.add({id:"message-"+Math.random().toString(36),icon:this.iconPack.chat,message:`${e.displayName}: ${e.message}`,duration:v.chat}),k.chat&&this.canPlayChatSound()&&this.audio.play("message"))}},this.pollUpdateListener=({polls:t,newPoll:i})=>{!1!==i&&(f.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.add({id:"poll-"+Math.random().toString(36),icon:this.iconPack.poll,message:`${this.t("notifications.new_poll_created_by")} ${t[t.length-1].createdBy}`,duration:v.polls}),k.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.canPlayChatSound()&&this.audio.play("message"))},this.deviceUpdateListener=({device:t,preview:i})=>{i||("audiooutput"===t.kind&&(this.audio.setDevice(t.deviceId),this.remove("speaker-switched"),this.add({id:"speaker-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.iconPack.speaker,duration:5e3})),"videoinput"===t.kind&&(this.remove("camera-switched"),this.add({id:"camera-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.videoEnabled?this.iconPack.video_on:this.iconPack.video_off,iconVariant:this.meeting.self.videoEnabled?"primary":"danger",duration:5e3})),"audioinput"===t.kind&&(this.remove("mic-switched"),this.add({id:"mic-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off,iconVariant:this.meeting.self.audioEnabled?"primary":"danger",duration:5e3})))},this.socketConnectionUpdateListener=({state:t,reconnectionAttempt:i,reconnected:s})=>{switch(t){case"connected":this.remove("socket"),s&&this.add({id:"socket",icon:this.iconPack.wifi,message:this.t("network.restored"),duration:3e3});break;case"disconnected":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.reconnecting")});break;case"reconnecting":i>=6?(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.disconnected"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})):i>=4&&(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.delay_extended")}));break;case"failed":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.leaving"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})}},this.activeTabUpdateListener=i=>{if(f.tab_sync)switch(i.type){case"plugin":const s=t.plugins.active.toArray().find((t=>t.id==i.id));null!=s&&this.add({id:"activeTab",message:`${this.t("notifications.plugin_switched_to")} ${s.name}`,duration:v.participant_joined});break;case"screenshare":const e=t.participants.joined.toArray().filter((t=>t.screenShareEnabled)).find((t=>t.id==i.id));null!=e&&this.add({id:"spotlight",message:`Now watching ${e.name}'s screen`,duration:v.webinar})}},this.peerStageStatusListener=t=>{"REQUESTED_TO_JOIN_STAGE"===t.stageStatus&&(this.add({id:"stage-request-"+t.id,message:`${t.name} ${this.t("notifications.requested_to_join_stage")}`,duration:v.webinar,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.stage.grantAccess([t.userId]),this.remove("stage-request-"+t.id)}}}),k.webinar&&this.audio.play("joined")),"ON_STAGE"===t.stageStatus&&(this.add({id:"stage-joined-"+t.id,message:`${t.name} ${this.t("notifications.joined_stage")}`,duration:v.webinar}),k.webinar&&this.audio.play("joined"))},this.stageRequestAccepted=()=>{this.add({id:"stage-request-accepted",message:this.t("notifications.request_to_join_accepted"),duration:3e3})},this.stageRequestRejected=()=>{this.add({id:"stage-request-rejected",message:this.t("notifications.request_to_join_rejected"),duration:3e3})},this.newStageRequests=({count:t})=>{this.add({id:"new-stage-request",message:`You have ${t<0?"new stage":t+" pending"} request${1===t?"":"s"}`,duration:3e3})},this.stageStatusUpdateListener=i=>{"ON_STAGE"===i?this.addStagePeersListeners(t):this.removeStagePeersListeners(t)},!u(t)&&(null===(s=t.chat)||void 0===s||s.addListener("chatUpdate",this.chatUpdateListener)),"CHAT"===(null===(e=t.self.config.viewType)||void 0===e?void 0:""+e))return;const _=t.self.getCurrentDevices();null!=_.speaker&&this.audio.setDevice(_.speaker.deviceId),m?null===(n=t.stage)||void 0===n||n.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(t),this.canAcceptWaitingRequests()&&(t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),null===(o=t.polls)||void 0===o||o.addListener("pollsUpdate",this.pollUpdateListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),null===(h=t.meta)||void 0===h||h.addListener("activeTabUpdate",this.activeTabUpdateListener),null===(r=t.recording)||void 0===r||r.addListener("recordingUpdate",this.onRecordingUpdate),null===(d=t.stage)||void 0===d||d.addListener("stageRequestApproved",this.stageRequestAccepted),null===(p=t.stage)||void 0===p||p.addListener("stageRequestRejected",this.stageRequestRejected),t.self.permissions.stageEnabled&&t.self.permissions.acceptStageRequests&&(null===(g=t.stage)||void 0===g||g.addListener("newStageRequest",this.newStageRequests))}configChanged(t){null!=t&&null!=(null==t?void 0:t.config)&&(this.permissions=function(t){const i=Object.assign({},k);return null==t||(Object.assign(i.notification_sounds,t.notification_sounds),Object.assign(i.notifications,t.notifications),Object.assign(i.notification_duration,t.notification_duration),i.participant_chat_message_sound_notification_limit=t.participant_chat_message_sound_notification_limit,i.participant_joined_sound_notification_limit=t.participant_joined_sound_notification_limit),i}(t.config),this.enabledSounds=j(this.permissions.notification_sounds))}statesChanged(t){var i;if(null!=t){const s=!(null===(i=null==t?void 0:t.prefs)||void 0===i?void 0:i.muteNotificationSounds);for(const t of this.enabledSounds)t in this.permissions.notification_sounds&&(this.permissions.notification_sounds[t]=s)}}apiErrorListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:v,icon:this.iconPack.warning})}sendNotificationListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:v})}add(t){"visible"===document.visibilityState&&this.notifications.length<5&&(this.notifications=[...this.notifications,t])}remove(t){this.notifications=this.notifications.filter((i=>i.id!==t))}handleDismiss(t){t.stopPropagation();const i=t.detail,e=this.host.shadowRoot.querySelector(`[data-id="${i}"]`);null==e||e.classList.add("exit"),setTimeout((()=>{s((()=>{this.remove(i)}))}),400)}canPlayParticipantJoinedSound(){return null==this.permissions.participant_joined_sound_notification_limit||this.permissions.participant_joined_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_joined_sound_notification_limit}canPlayChatSound(){return null==this.permissions.participant_chat_message_sound_notification_limit||this.permissions.participant_chat_message_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_chat_message_sound_notification_limit}canAcceptWaitingRequests(){return this.permissions.notifications.participant_joined_waitlist&&this.meeting.self.permissions.acceptWaitingRequests}render(){if(this.meeting)return e(n,null,e("div",{onMouseEnter:()=>this.paused=!0,onFocusin:()=>this.paused=!0,onMouseLeave:()=>this.paused=!1,onFocusout:()=>this.paused=!1},this.notifications.map((t=>e("rtk-notification",{size:this.size,key:t.id,"data-id":t.id,notification:t,onRtkNotificationDismiss:t=>this.handleDismiss(t),iconPack:this.iconPack,paused:this.paused,t:this.t})))))}get host(){return this}static get watchers(){return{meeting:[{meetingChanged:0}],config:[{configChanged:0}],states:[{statesChanged:0}]}}static get style(){return":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:absolute;top:var(--rtk-space-4, 16px);right:var(--rtk-space-4, 16px);bottom:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;z-index:100}rtk-notification{margin-top:var(--rtk-space-2, 8px)}"}},[1,"rtk-notifications",{meeting:[16],states:[16],config:[16],t:[16],size:[513],iconPack:[16],notifications:[32],paused:[32]},[[8,"rtkApiError","apiErrorListener"],[8,"rtkSendNotification","sendNotificationListener"]],{meeting:[{meetingChanged:0}],config:[{configChanged:0}],states:[{statesChanged:0}]}]);function w(){"undefined"!=typeof customElements&&["rtk-notifications","rtk-button","rtk-icon","rtk-notification"].forEach((t=>{switch(t){case"rtk-notifications":customElements.get(o(t))||customElements.define(o(t),b);break;case"rtk-button":customElements.get(o(t))||g();break;case"rtk-icon":customElements.get(o(t))||m();break;case"rtk-notification":customElements.get(o(t))||f()}}))}_([p()],b.prototype,"meeting",void 0),_([p()],b.prototype,"states",void 0),_([p()],b.prototype,"config",void 0),_([p()],b.prototype,"t",void 0),_([p()],b.prototype,"iconPack",void 0),w();const $=b,y=w;export{$ as RtkNotifications,y as defineCustomElement}
1
+ import{p as t,H as i,w as s,h as e,d as n,t as o}from"./p-BBHQOrFK.js";import{R as a}from"./p-B56IYWsZ.js";import{f as c}from"./p-CJsXePY3.js";import{c as h,i as r,e as d}from"./p-aXMUeMjU.js";import"./p-Rq_6y0HI.js";import{s as u}from"./p-C0vp-Q7v.js";import{f as l}from"./p-HuHRVcj4.js";import{S as p}from"./p-ByMjaTnP.js";import{d as g}from"./p-D6vw6bT2.js";import{d as m}from"./p-BYIBbfJ8.js";import{d as f}from"./p-C_e0a6jQ.js";const v=2e3,k=Object.freeze({notifications:{participant_joined:!0,participant_left:!0,participant_joined_waitlist:!0,chat:!0,polls:!0,webinar:!0,tab_sync:!0,recording_started:!0,recording_stopped:!0},notification_sounds:{participant_joined:!0,participant_left:!0,chat:!0,polls:!0,webinar:!0,participant_joined_waitlist:!0},notification_duration:{participant_joined:2100,participant_left:2100,participant_joined_waitlist:4e3,chat:v,polls:v,webinar:v,tab_sync:v,recording_started:v,recording_stopped:v},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});var _=function(t,i,s,e){var n,o=arguments.length,a=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,s,e);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(a=(o<3?n(a):o>3?n(i,s,a):n(i,s))||a);return o>3&&a&&Object.defineProperty(i,s,a),a};function j(t){return Object.keys(t).filter((i=>t[i]))}const b=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.permissions=k,this.enabledSounds=j(k.notification_sounds),this.config=h(),this.t=r(),this.iconPack=d,this.notifications=[],this.addStagePeersListeners=t=>{t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener)},this.removeStagePeersListeners=t=>{t.participants.joined.removeListener("participantJoined",this.participantJoinedListener),t.participants.joined.removeListener("participantLeft",this.participantLeftListener)},this.onNotification=t=>{this.add(t.detail);const i=t.detail.playSound;null!=i&&this.audio.play(i)},this.onRecordingUpdate=t=>{var i,s;"RECORDING"===t&&!1!==this.permissions.notifications.recording_started?this.add({id:"recording-started",icon:this.iconPack.recording,message:this.t("recording.started"),duration:null!==(i=this.permissions.notification_duration.recording_started)&&void 0!==i?i:v}):"STOPPING"===t&&!1!==this.permissions.notifications.recording_stopped&&this.add({id:"recording-stopped",icon:this.iconPack.stop_recording,message:this.t("recording.stopped"),duration:null!==(s=this.permissions.notification_duration.recording_stopped)&&void 0!==s?s:v})},this.paused=!1}connectedCallback(){"undefined"!=typeof document&&(null===document||void 0===document||document.addEventListener("rtkNotification",this.onNotification)),this.meetingChanged(this.meeting),this.configChanged(this.config),this.statesChanged(this.states)}clearListeners(t){var i,s,e,n,o,a,c,h;const r="LIVESTREAM"===t.meta.viewType;(r&&"ON_STAGE"===(null===(i=t.stage)||void 0===i?void 0:i.status)||!r)&&this.removeStagePeersListeners(t),this.chatUpdateListener&&(null===(s=t.chat)||void 0===s||s.removeListener("chatUpdate",this.chatUpdateListener)),this.pollUpdateListener&&(null===(e=t.polls)||void 0===e||e.removeListener("pollsUpdate",this.pollUpdateListener)),t.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener),this.stageRequestAccepted&&(null===(n=t.stage)||void 0===n||n.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(o=t.stage)||void 0===o||o.removeListener("stageRequestRejected",this.stageRequestRejected)),this.newStageRequests&&(null===(a=t.stage)||void 0===a||a.removeListener("newStageRequest",this.newStageRequests)),this.stageStatusUpdateListener&&(null===(c=t.stage)||void 0===c||c.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)),null===(h=t.recording)||void 0===h||h.removeListener("recordingUpdate",this.onRecordingUpdate),clearTimeout(this.disconnectTimeout),t.self.removeListener("deviceUpdate",this.deviceUpdateListener)}disconnectedCallback(){var t;"undefined"!=typeof document&&(null===document||void 0===document||document.removeEventListener("rtkNotification",this.onNotification)),this.meeting&&(this.clearListeners(this.meeting),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.activeTabUpdateListener&&(null===(t=this.meeting.meta)||void 0===t||t.removeListener("activeTabUpdate",this.activeTabUpdateListener)),this.peerStageStatusListener&&this.meeting.participants.joined.removeListener("stageStatusUpdate",this.peerStageStatusListener))}meetingChanged(t,i){var s,e,n,o,h,r,d,p,g;if(clearTimeout(this.disconnectTimeout),i&&this.clearListeners(i),!t)return;const m="LIVESTREAM"===t.meta.viewType;this.audio=new a(t);const{notifications:f,notification_duration:v,notification_sounds:k}=this.permissions;if(this.participantJoinedListener=t=>{t.peerIdBeforeReconnect||(f.participant_joined&&this.add({id:t.id+"-joined",message:`${c(t.name)} ${this.t("notifications.joined")}`,image:t.picture,duration:v.participant_joined}),k.participant_joined&&this.canPlayParticipantJoinedSound()&&this.audio.play("joined"))},this.participantLeftListener=t=>{if(t.replacedByPeerId)return;const{socketState:{state:i}}=this.meeting.meta;f.participant_left&&"connected"===i&&this.add({id:t.id+"-left",message:`${c(t.name)} ${this.t("notifications.left")}`,image:t.picture,duration:v.participant_left}),k.participant_left&&this.canPlayParticipantJoinedSound()&&this.audio.play("left")},this.waitlistedParticipantJoinedListener=t=>{if(!this.canAcceptWaitingRequests())return;const i=t.id+"-joined-waitlist";this.add({id:i,message:`${c(t.name)} ${this.t("notifications.requesting_to_join_meeting")}`,image:t.picture,duration:v.participant_joined_waitlist,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.participants.acceptWaitingRoomRequest(t.id),this.remove(i)}}}),k.participant_joined_waitlist&&this.canPlayParticipantJoinedSound()&&this.audio.play("message")},this.waitlistedParticipantLeftListener=t=>{this.remove(t.id+"-joined-waitlist")},this.chatUpdateListener=({message:i,action:s})=>{if("add"!==s)return;const e=l(i);if(null!=e){if(e.userId===t.self.userId)return;"text"===e.type&&(f.chat&&this.add({id:"message-"+Math.random().toString(36),icon:this.iconPack.chat,message:`${e.displayName}: ${e.message}`,duration:v.chat}),k.chat&&this.canPlayChatSound()&&this.audio.play("message"))}},this.pollUpdateListener=({polls:t,newPoll:i})=>{!1!==i&&(f.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.add({id:"poll-"+Math.random().toString(36),icon:this.iconPack.poll,message:`${this.t("notifications.new_poll_created_by")} ${t[t.length-1].createdBy}`,duration:v.polls}),k.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.canPlayChatSound()&&this.audio.play("message"))},this.deviceUpdateListener=({device:t,preview:i})=>{i||("audiooutput"===t.kind&&(this.audio.setDevice(t.deviceId),this.remove("speaker-switched"),this.add({id:"speaker-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.iconPack.speaker,duration:5e3})),"videoinput"===t.kind&&(this.remove("camera-switched"),this.add({id:"camera-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.videoEnabled?this.iconPack.video_on:this.iconPack.video_off,iconVariant:this.meeting.self.videoEnabled?"primary":"danger",duration:5e3})),"audioinput"===t.kind&&(this.remove("mic-switched"),this.add({id:"mic-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off,iconVariant:this.meeting.self.audioEnabled?"primary":"danger",duration:5e3})))},this.socketConnectionUpdateListener=({state:t,reconnectionAttempt:i,reconnected:s})=>{switch(t){case"connected":this.remove("socket"),s&&this.add({id:"socket",icon:this.iconPack.wifi,message:this.t("network.restored"),duration:3e3});break;case"disconnected":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.reconnecting")});break;case"reconnecting":i>=6?(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.disconnected"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})):i>=4&&(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.delay_extended")}));break;case"failed":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.leaving"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})}},this.activeTabUpdateListener=i=>{if(f.tab_sync)switch(i.type){case"plugin":const s=t.plugins.active.toArray().find((t=>t.id==i.id));null!=s&&this.add({id:"activeTab",message:`${this.t("notifications.plugin_switched_to")} ${s.name}`,duration:v.participant_joined});break;case"screenshare":const e=t.participants.joined.toArray().filter((t=>t.screenShareEnabled)).find((t=>t.id==i.id));null!=e&&this.add({id:"spotlight",message:`Now watching ${e.name}'s screen`,duration:v.webinar})}},this.peerStageStatusListener=t=>{"REQUESTED_TO_JOIN_STAGE"===t.stageStatus&&(this.add({id:"stage-request-"+t.id,message:`${t.name} ${this.t("notifications.requested_to_join_stage")}`,duration:v.webinar,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.stage.grantAccess([t.userId]),this.remove("stage-request-"+t.id)}}}),k.webinar&&this.audio.play("joined")),"ON_STAGE"===t.stageStatus&&(this.add({id:"stage-joined-"+t.id,message:`${t.name} ${this.t("notifications.joined_stage")}`,duration:v.webinar}),k.webinar&&this.audio.play("joined"))},this.stageRequestAccepted=()=>{this.add({id:"stage-request-accepted",message:this.t("notifications.request_to_join_accepted"),duration:3e3})},this.stageRequestRejected=()=>{this.add({id:"stage-request-rejected",message:this.t("notifications.request_to_join_rejected"),duration:3e3})},this.newStageRequests=({count:t})=>{this.add({id:"new-stage-request",message:`You have ${t<0?"new stage":t+" pending"} request${1===t?"":"s"}`,duration:3e3})},this.stageStatusUpdateListener=i=>{"ON_STAGE"===i?this.addStagePeersListeners(t):this.removeStagePeersListeners(t)},!u(t)&&(null===(s=t.chat)||void 0===s||s.addListener("chatUpdate",this.chatUpdateListener)),"CHAT"===(null===(e=t.self.config.viewType)||void 0===e?void 0:""+e))return;const _=t.self.getCurrentDevices();null!=_.speaker&&this.audio.setDevice(_.speaker.deviceId),m?null===(n=t.stage)||void 0===n||n.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(t),this.canAcceptWaitingRequests()&&(t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),null===(o=t.polls)||void 0===o||o.addListener("pollsUpdate",this.pollUpdateListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),null===(h=t.meta)||void 0===h||h.addListener("activeTabUpdate",this.activeTabUpdateListener),null===(r=t.recording)||void 0===r||r.addListener("recordingUpdate",this.onRecordingUpdate),null===(d=t.stage)||void 0===d||d.addListener("stageRequestApproved",this.stageRequestAccepted),null===(p=t.stage)||void 0===p||p.addListener("stageRequestRejected",this.stageRequestRejected),t.self.permissions.stageEnabled&&t.self.permissions.acceptStageRequests&&(null===(g=t.stage)||void 0===g||g.addListener("newStageRequest",this.newStageRequests))}configChanged(t){null!=t&&null!=(null==t?void 0:t.config)&&(this.permissions=function(t){const i=Object.assign({},k);return null==t||(Object.assign(i.notification_sounds,t.notification_sounds),Object.assign(i.notifications,t.notifications),Object.assign(i.notification_duration,t.notification_duration),i.participant_chat_message_sound_notification_limit=t.participant_chat_message_sound_notification_limit,i.participant_joined_sound_notification_limit=t.participant_joined_sound_notification_limit),i}(t.config),this.enabledSounds=j(this.permissions.notification_sounds))}statesChanged(t){var i;if(null!=t){const s=!(null===(i=null==t?void 0:t.prefs)||void 0===i?void 0:i.muteNotificationSounds);for(const t of this.enabledSounds)t in this.permissions.notification_sounds&&(this.permissions.notification_sounds[t]=s)}}apiErrorListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:v,icon:this.iconPack.warning})}sendNotificationListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:v})}add(t){"visible"===document.visibilityState&&this.notifications.length<5&&(this.notifications=[...this.notifications,t])}remove(t){this.notifications=this.notifications.filter((i=>i.id!==t))}handleDismiss(t){t.stopPropagation();const i=t.detail,e=this.host.shadowRoot.querySelector(`[data-id="${i}"]`);null==e||e.classList.add("exit"),setTimeout((()=>{s((()=>{this.remove(i)}))}),400)}canPlayParticipantJoinedSound(){return null==this.permissions.participant_joined_sound_notification_limit||this.permissions.participant_joined_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_joined_sound_notification_limit}canPlayChatSound(){return null==this.permissions.participant_chat_message_sound_notification_limit||this.permissions.participant_chat_message_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_chat_message_sound_notification_limit}canAcceptWaitingRequests(){return this.permissions.notifications.participant_joined_waitlist&&this.meeting.self.permissions.acceptWaitingRequests}render(){if(this.meeting)return e(n,null,e("div",{onMouseEnter:()=>this.paused=!0,onFocusin:()=>this.paused=!0,onMouseLeave:()=>this.paused=!1,onFocusout:()=>this.paused=!1},this.notifications.map((t=>e("rtk-notification",{size:this.size,key:t.id,"data-id":t.id,notification:t,onRtkNotificationDismiss:t=>this.handleDismiss(t),iconPack:this.iconPack,paused:this.paused,t:this.t})))))}get host(){return this}static get watchers(){return{meeting:[{meetingChanged:0}],config:[{configChanged:0}],states:[{statesChanged:0}]}}static get style(){return":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:absolute;top:var(--rtk-space-4, 16px);right:var(--rtk-space-4, 16px);bottom:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;z-index:100}rtk-notification{margin-top:var(--rtk-space-2, 8px)}"}},[1,"rtk-notifications",{meeting:[16],states:[16],config:[16],t:[16],size:[513],iconPack:[16],notifications:[32],paused:[32]},[[8,"rtkApiError","apiErrorListener"],[8,"rtkSendNotification","sendNotificationListener"]],{meeting:[{meetingChanged:0}],config:[{configChanged:0}],states:[{statesChanged:0}]}]);function w(){"undefined"!=typeof customElements&&["rtk-notifications","rtk-button","rtk-icon","rtk-notification"].forEach((t=>{switch(t){case"rtk-notifications":customElements.get(o(t))||customElements.define(o(t),b);break;case"rtk-button":customElements.get(o(t))||g();break;case"rtk-icon":customElements.get(o(t))||m();break;case"rtk-notification":customElements.get(o(t))||f()}}))}_([p()],b.prototype,"meeting",void 0),_([p()],b.prototype,"states",void 0),_([p()],b.prototype,"config",void 0),_([p()],b.prototype,"t",void 0),_([p()],b.prototype,"iconPack",void 0),w();const $=b,y=w;export{$ as RtkNotifications,y as defineCustomElement}
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-11-23T10:35:24",
2
+ "timestamp": "2026-11-26T06:54:27",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.43.5",
@@ -9926,7 +9926,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
9926
9926
  * The literal below is replaced with the released package version by `prepublish.js`.
9927
9927
  * Builds that are not published (local, dev) report it as is.
9928
9928
  */
9929
- const UI_KIT_VERSION = '2.2.0-staging.2';
9929
+ const UI_KIT_VERSION = '2.2.0-staging.3';
9930
9930
  /**
9931
9931
  * The wrapper packages load components from the loader bundle, which carries its own copy of
9932
9932
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -21759,6 +21759,20 @@ const RtkNotifications = class {
21759
21759
  this.audio = new RTKNotificationsAudio(meeting);
21760
21760
  const { notifications, notification_duration, notification_sounds } = this.permissions;
21761
21761
  this.participantJoinedListener = (participant) => {
21762
+ /**
21763
+ * NOTE(ravindra-cloudflare):
21764
+ * Participants that immediately reconnected,
21765
+ * due to Websocket disconnects with error code 1006,
21766
+ * will have a peerIdBeforeReconnect set.
21767
+ *
21768
+ * We don't want to show notifications for such participants
21769
+ * as they are not actually joining the meeting,
21770
+ * but rather reconnecting to it.
21771
+ */
21772
+ const isReconnectedParticipant = !!participant.peerIdBeforeReconnect;
21773
+ if (isReconnectedParticipant) {
21774
+ return;
21775
+ }
21762
21776
  if (notifications.participant_joined) {
21763
21777
  this.add({
21764
21778
  id: `${participant.id}-joined`,
@@ -21772,8 +21786,16 @@ const RtkNotifications = class {
21772
21786
  }
21773
21787
  };
21774
21788
  this.participantLeftListener = (participant) => {
21789
+ /**
21790
+ * NOTE(ravindra-cloudflare):
21791
+ * A departing participant replaced after reconnecting has replacedByPeerId
21792
+ * set before its leave event. Suppress the leave notification and sound.
21793
+ */
21794
+ if (participant.replacedByPeerId) {
21795
+ return;
21796
+ }
21775
21797
  const { socketState: { state }, } = this.meeting.meta;
21776
- if (notifications.participant_left && state !== 'connected') {
21798
+ if (notifications.participant_left && state === 'connected') {
21777
21799
  this.add({
21778
21800
  id: `${participant.id}-left`,
21779
21801
  message: `${formatName(participant.name)} ${this.t('notifications.left')}`,
@@ -180,6 +180,20 @@ const RtkNotifications = class {
180
180
  this.audio = new RTKNotificationsAudio(meeting);
181
181
  const { notifications, notification_duration, notification_sounds } = this.permissions;
182
182
  this.participantJoinedListener = (participant) => {
183
+ /**
184
+ * NOTE(ravindra-cloudflare):
185
+ * Participants that immediately reconnected,
186
+ * due to Websocket disconnects with error code 1006,
187
+ * will have a peerIdBeforeReconnect set.
188
+ *
189
+ * We don't want to show notifications for such participants
190
+ * as they are not actually joining the meeting,
191
+ * but rather reconnecting to it.
192
+ */
193
+ const isReconnectedParticipant = !!participant.peerIdBeforeReconnect;
194
+ if (isReconnectedParticipant) {
195
+ return;
196
+ }
183
197
  if (notifications.participant_joined) {
184
198
  this.add({
185
199
  id: `${participant.id}-joined`,
@@ -193,8 +207,16 @@ const RtkNotifications = class {
193
207
  }
194
208
  };
195
209
  this.participantLeftListener = (participant) => {
210
+ /**
211
+ * NOTE(ravindra-cloudflare):
212
+ * A departing participant replaced after reconnecting has replacedByPeerId
213
+ * set before its leave event. Suppress the leave notification and sound.
214
+ */
215
+ if (participant.replacedByPeerId) {
216
+ return;
217
+ }
196
218
  const { socketState: { state }, } = this.meeting.meta;
197
- if (notifications.participant_left && state !== 'connected') {
219
+ if (notifications.participant_left && state === 'connected') {
198
220
  this.add({
199
221
  id: `${participant.id}-left`,
200
222
  message: `${formatName(participant.name)} ${this.t('notifications.left')}`,
@@ -940,7 +940,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
940
940
  * The literal below is replaced with the released package version by `prepublish.js`.
941
941
  * Builds that are not published (local, dev) report it as is.
942
942
  */
943
- const UI_KIT_VERSION = '2.2.0-staging.2';
943
+ const UI_KIT_VERSION = '2.2.0-staging.3';
944
944
  /**
945
945
  * The wrapper packages load components from the loader bundle, which carries its own copy of
946
946
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -0,0 +1 @@
1
+ import{r as t,e as i,h as s,a as e,g as n}from"./p-gJCRRBX0.js";import{R as o}from"./p-B56IYWsZ.js";import{f as a}from"./p-vBD2htwQ.js";import{c as h,i as c,e as r}from"./p-C8tHk7bV.js";import"./p-Rq_6y0HI.js";import{s as d}from"./p-C0vp-Q7v.js";import{f as l}from"./p-CRQsZMW5.js";import{S as u}from"./p-CGOvNX5H.js";import"./p-CAqYddlg.js";import"./p-Daj_55_i.js";const p=2e3,g=Object.freeze({notifications:{participant_joined:!0,participant_left:!0,participant_joined_waitlist:!0,chat:!0,polls:!0,webinar:!0,tab_sync:!0,recording_started:!0,recording_stopped:!0},notification_sounds:{participant_joined:!0,participant_left:!0,chat:!0,polls:!0,webinar:!0,participant_joined_waitlist:!0},notification_duration:{participant_joined:2100,participant_left:2100,participant_joined_waitlist:4e3,chat:p,polls:p,webinar:p,tab_sync:p,recording_started:p,recording_stopped:p},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});var f=function(t,i,s,e){var n,o=arguments.length,a=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,s,e);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(a=(o<3?n(a):o>3?n(i,s,a):n(i,s))||a);return o>3&&a&&Object.defineProperty(i,s,a),a};function m(t){return Object.keys(t).filter((i=>t[i]))}const v=class{constructor(i){t(this,i),this.permissions=g,this.enabledSounds=m(g.notification_sounds),this.config=h(),this.t=c(),this.iconPack=r,this.notifications=[],this.addStagePeersListeners=t=>{t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener)},this.removeStagePeersListeners=t=>{t.participants.joined.removeListener("participantJoined",this.participantJoinedListener),t.participants.joined.removeListener("participantLeft",this.participantLeftListener)},this.onNotification=t=>{this.add(t.detail);const i=t.detail.playSound;null!=i&&this.audio.play(i)},this.onRecordingUpdate=t=>{var i,s;"RECORDING"===t&&!1!==this.permissions.notifications.recording_started?this.add({id:"recording-started",icon:this.iconPack.recording,message:this.t("recording.started"),duration:null!==(i=this.permissions.notification_duration.recording_started)&&void 0!==i?i:p}):"STOPPING"===t&&!1!==this.permissions.notifications.recording_stopped&&this.add({id:"recording-stopped",icon:this.iconPack.stop_recording,message:this.t("recording.stopped"),duration:null!==(s=this.permissions.notification_duration.recording_stopped)&&void 0!==s?s:p})},this.paused=!1}connectedCallback(){"undefined"!=typeof document&&(null===document||void 0===document||document.addEventListener("rtkNotification",this.onNotification)),this.meetingChanged(this.meeting),this.configChanged(this.config),this.statesChanged(this.states)}clearListeners(t){var i,s,e,n,o,a,h,c;const r="LIVESTREAM"===t.meta.viewType;(r&&"ON_STAGE"===(null===(i=t.stage)||void 0===i?void 0:i.status)||!r)&&this.removeStagePeersListeners(t),this.chatUpdateListener&&(null===(s=t.chat)||void 0===s||s.removeListener("chatUpdate",this.chatUpdateListener)),this.pollUpdateListener&&(null===(e=t.polls)||void 0===e||e.removeListener("pollsUpdate",this.pollUpdateListener)),t.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener),this.stageRequestAccepted&&(null===(n=t.stage)||void 0===n||n.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(o=t.stage)||void 0===o||o.removeListener("stageRequestRejected",this.stageRequestRejected)),this.newStageRequests&&(null===(a=t.stage)||void 0===a||a.removeListener("newStageRequest",this.newStageRequests)),this.stageStatusUpdateListener&&(null===(h=t.stage)||void 0===h||h.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)),null===(c=t.recording)||void 0===c||c.removeListener("recordingUpdate",this.onRecordingUpdate),clearTimeout(this.disconnectTimeout),t.self.removeListener("deviceUpdate",this.deviceUpdateListener)}disconnectedCallback(){var t;"undefined"!=typeof document&&(null===document||void 0===document||document.removeEventListener("rtkNotification",this.onNotification)),this.meeting&&(this.clearListeners(this.meeting),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.activeTabUpdateListener&&(null===(t=this.meeting.meta)||void 0===t||t.removeListener("activeTabUpdate",this.activeTabUpdateListener)),this.peerStageStatusListener&&this.meeting.participants.joined.removeListener("stageStatusUpdate",this.peerStageStatusListener))}meetingChanged(t,i){var s,e,n,h,c,r,u,p,g;if(clearTimeout(this.disconnectTimeout),i&&this.clearListeners(i),!t)return;const f="LIVESTREAM"===t.meta.viewType;this.audio=new o(t);const{notifications:m,notification_duration:v,notification_sounds:_}=this.permissions;if(this.participantJoinedListener=t=>{t.peerIdBeforeReconnect||(m.participant_joined&&this.add({id:`${t.id}-joined`,message:`${a(t.name)} ${this.t("notifications.joined")}`,image:t.picture,duration:v.participant_joined}),_.participant_joined&&this.canPlayParticipantJoinedSound()&&this.audio.play("joined"))},this.participantLeftListener=t=>{if(t.replacedByPeerId)return;const{socketState:{state:i}}=this.meeting.meta;m.participant_left&&"connected"===i&&this.add({id:`${t.id}-left`,message:`${a(t.name)} ${this.t("notifications.left")}`,image:t.picture,duration:v.participant_left}),_.participant_left&&this.canPlayParticipantJoinedSound()&&this.audio.play("left")},this.waitlistedParticipantJoinedListener=t=>{if(!this.canAcceptWaitingRequests())return;const i=`${t.id}-joined-waitlist`;this.add({id:i,message:`${a(t.name)} ${this.t("notifications.requesting_to_join_meeting")}`,image:t.picture,duration:v.participant_joined_waitlist,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.participants.acceptWaitingRoomRequest(t.id),this.remove(i)}}}),_.participant_joined_waitlist&&this.canPlayParticipantJoinedSound()&&this.audio.play("message")},this.waitlistedParticipantLeftListener=t=>{this.remove(`${t.id}-joined-waitlist`)},this.chatUpdateListener=({message:i,action:s})=>{if("add"!==s)return;const e=l(i);if(null!=e){if(e.userId===t.self.userId)return;"text"===e.type&&(m.chat&&this.add({id:`message-${Math.random().toString(36)}`,icon:this.iconPack.chat,message:`${e.displayName}: ${e.message}`,duration:v.chat}),_.chat&&this.canPlayChatSound()&&this.audio.play("message"))}},this.pollUpdateListener=({polls:t,newPoll:i})=>{!1!==i&&(m.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.add({id:`poll-${Math.random().toString(36)}`,icon:this.iconPack.poll,message:`${this.t("notifications.new_poll_created_by")} ${t[t.length-1].createdBy}`,duration:v.polls}),_.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.canPlayChatSound()&&this.audio.play("message"))},this.deviceUpdateListener=({device:t,preview:i})=>{i||("audiooutput"===t.kind&&(this.audio.setDevice(t.deviceId),this.remove("speaker-switched"),this.add({id:"speaker-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.iconPack.speaker,duration:5e3})),"videoinput"===t.kind&&(this.remove("camera-switched"),this.add({id:"camera-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.videoEnabled?this.iconPack.video_on:this.iconPack.video_off,iconVariant:this.meeting.self.videoEnabled?"primary":"danger",duration:5e3})),"audioinput"===t.kind&&(this.remove("mic-switched"),this.add({id:"mic-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off,iconVariant:this.meeting.self.audioEnabled?"primary":"danger",duration:5e3})))},this.socketConnectionUpdateListener=({state:t,reconnectionAttempt:i,reconnected:s})=>{switch(t){case"connected":this.remove("socket"),s&&this.add({id:"socket",icon:this.iconPack.wifi,message:this.t("network.restored"),duration:3e3});break;case"disconnected":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.reconnecting")});break;case"reconnecting":i>=6?(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.disconnected"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})):i>=4&&(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.delay_extended")}));break;case"failed":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.leaving"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leave()}}})}},this.activeTabUpdateListener=i=>{if(m.tab_sync)switch(i.type){case"plugin":const s=t.plugins.active.toArray().find((t=>t.id==i.id));null!=s&&this.add({id:"activeTab",message:`${this.t("notifications.plugin_switched_to")} ${s.name}`,duration:v.participant_joined});break;case"screenshare":const e=t.participants.joined.toArray().filter((t=>t.screenShareEnabled)).find((t=>t.id==i.id));null!=e&&this.add({id:"spotlight",message:`Now watching ${e.name}'s screen`,duration:v.webinar})}},this.peerStageStatusListener=t=>{"REQUESTED_TO_JOIN_STAGE"===t.stageStatus&&(this.add({id:`stage-request-${t.id}`,message:`${t.name} ${this.t("notifications.requested_to_join_stage")}`,duration:v.webinar,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.stage.grantAccess([t.userId]),this.remove(`stage-request-${t.id}`)}}}),_.webinar&&this.audio.play("joined")),"ON_STAGE"===t.stageStatus&&(this.add({id:`stage-joined-${t.id}`,message:`${t.name} ${this.t("notifications.joined_stage")}`,duration:v.webinar}),_.webinar&&this.audio.play("joined"))},this.stageRequestAccepted=()=>{this.add({id:"stage-request-accepted",message:this.t("notifications.request_to_join_accepted"),duration:3e3})},this.stageRequestRejected=()=>{this.add({id:"stage-request-rejected",message:this.t("notifications.request_to_join_rejected"),duration:3e3})},this.newStageRequests=({count:t})=>{this.add({id:"new-stage-request",message:`You have ${t<0?"new stage":`${t} pending`} request${1===t?"":"s"}`,duration:3e3})},this.stageStatusUpdateListener=i=>{"ON_STAGE"===i?this.addStagePeersListeners(t):this.removeStagePeersListeners(t)},!d(t)&&(null===(s=t.chat)||void 0===s||s.addListener("chatUpdate",this.chatUpdateListener)),"CHAT"===(null===(e=t.self.config.viewType)||void 0===e?void 0:e.toString()))return;const k=t.self.getCurrentDevices();null!=k.speaker&&this.audio.setDevice(k.speaker.deviceId),f?null===(n=t.stage)||void 0===n||n.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(t),this.canAcceptWaitingRequests()&&(t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),null===(h=t.polls)||void 0===h||h.addListener("pollsUpdate",this.pollUpdateListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),null===(c=t.meta)||void 0===c||c.addListener("activeTabUpdate",this.activeTabUpdateListener),null===(r=t.recording)||void 0===r||r.addListener("recordingUpdate",this.onRecordingUpdate),null===(u=t.stage)||void 0===u||u.addListener("stageRequestApproved",this.stageRequestAccepted),null===(p=t.stage)||void 0===p||p.addListener("stageRequestRejected",this.stageRequestRejected),t.self.permissions.stageEnabled&&t.self.permissions.acceptStageRequests&&(null===(g=t.stage)||void 0===g||g.addListener("newStageRequest",this.newStageRequests))}configChanged(t){null!=t&&null!=(null==t?void 0:t.config)&&(this.permissions=function(t){const i=Object.assign({},g);return null==t||(Object.assign(i.notification_sounds,t.notification_sounds),Object.assign(i.notifications,t.notifications),Object.assign(i.notification_duration,t.notification_duration),i.participant_chat_message_sound_notification_limit=t.participant_chat_message_sound_notification_limit,i.participant_joined_sound_notification_limit=t.participant_joined_sound_notification_limit),i}(t.config),this.enabledSounds=m(this.permissions.notification_sounds))}statesChanged(t){var i;if(null!=t){const s=!(null===(i=null==t?void 0:t.prefs)||void 0===i?void 0:i.muteNotificationSounds);for(const t of this.enabledSounds)t in this.permissions.notification_sounds&&(this.permissions.notification_sounds[t]=s)}}apiErrorListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:p,icon:this.iconPack.warning})}sendNotificationListener({detail:t}){const{trace:i,message:s}=t;this.add({id:i,message:s,duration:p})}add(t){"visible"===document.visibilityState&&this.notifications.length<5&&(this.notifications=[...this.notifications,t])}remove(t){this.notifications=this.notifications.filter((i=>i.id!==t))}handleDismiss(t){t.stopPropagation();const s=t.detail,e=this.host.shadowRoot.querySelector(`[data-id="${s}"]`);null==e||e.classList.add("exit"),setTimeout((()=>{i((()=>{this.remove(s)}))}),400)}canPlayParticipantJoinedSound(){return null==this.permissions.participant_joined_sound_notification_limit||this.permissions.participant_joined_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_joined_sound_notification_limit}canPlayChatSound(){return null==this.permissions.participant_chat_message_sound_notification_limit||this.permissions.participant_chat_message_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_chat_message_sound_notification_limit}canAcceptWaitingRequests(){return this.permissions.notifications.participant_joined_waitlist&&this.meeting.self.permissions.acceptWaitingRequests}render(){if(this.meeting)return s(e,null,s("div",{onMouseEnter:()=>this.paused=!0,onFocusin:()=>this.paused=!0,onMouseLeave:()=>this.paused=!1,onFocusout:()=>this.paused=!1},this.notifications.map((t=>s("rtk-notification",{size:this.size,key:t.id,"data-id":t.id,notification:t,onRtkNotificationDismiss:t=>this.handleDismiss(t),iconPack:this.iconPack,paused:this.paused,t:this.t})))))}get host(){return n(this)}static get watchers(){return{meeting:[{meetingChanged:0}],config:[{configChanged:0}],states:[{statesChanged:0}]}}};f([u()],v.prototype,"meeting",void 0),f([u()],v.prototype,"states",void 0),f([u()],v.prototype,"config",void 0),f([u()],v.prototype,"t",void 0),f([u()],v.prototype,"iconPack",void 0),v.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:absolute;top:var(--rtk-space-4, 16px);right:var(--rtk-space-4, 16px);bottom:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;z-index:100}rtk-notification{margin-top:var(--rtk-space-2, 8px)}";export{v as rtk_notifications}
@@ -1 +1 @@
1
- import{m as t,n,o,p as r,q as e,r as i,t as s,v as a,w as c,x as f,y as u,z as d,A as l,B as v,C as m,D as p,E as b,F as g,G as y,H as F,S as k}from"./p-C8tHk7bV.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const x={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},h={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},E={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function j(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=j(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=j(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=j(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in E){const r=E[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=x[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var B,R,S,H=Date.now,I=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,L=(B=I,R=0,S=0,function(){var t=H(),n=16-(t-S);if(S=t,n>0){if(++R>=800)return arguments[0]}else R=0;return B.apply(void 0,arguments)}),N=Math.max;var P=Object.prototype.hasOwnProperty;function T(t){return e(t)?c(t,!0):function(t){if(!r(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=a(t),o=[];for(var e in t)("constructor"!=e||!n&&P.call(t,e))&&o.push(e);return o}(t)}var V=Function.prototype.toString,M=Object.prototype.hasOwnProperty,U=V.call(Object);function q(t,o,r){(void 0!==r&&!s(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function G(t,i,s,a,c,k,$){var x=z(t,s),h=z(i,s),E=$.get(h);if(E)q(t,s,E);else{var j,A=k?k(x,h,s+"",t,i,$):void 0,O=void 0===A;if(O){var D=m(h),w=!D&&l(h),C=!D&&!w&&v(h);A=h,D||w||C?m(x)?A=x:f(j=x)&&e(j)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(x):w?(O=!1,A=p(h,!0)):C?(O=!1,A=b(h,!0)):A=[]:function(t){if(!f(t)||"[object Object]"!=u(t))return!1;var n=d(t);if(null===n)return!0;var o=M.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&V.call(o)==U}(h)||g(h)?(A=x,g(x)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,T(t))}(x):r(x)&&!y(x)||(A=F(h))):O=!1}O&&($.set(h,A),c(A,h,a,k,$),$.delete(h)),q(t,s,A)}}function K(t,n,o,e,i){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(s,a){if(i||(i=new k),r(s))G(t,n,a,o,K,e,i);else{var c=e?e(z(t,a),s,a+"",t,n,i):void 0;void 0===c&&(c=s),q(t,a,c)}}),T)}var W,J=(W=function(t,n,o){K(t,n,o)},function(t,n){return L(function(t,n,o){return n=N(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=N(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,a=n.length,c=a>1?n[a-1]:void 0,f=a>2?n[2]:void 0;for(c=W.length>3&&"function"==typeof c?(a--,c):void 0,f&&function(t,n,o){if(!r(o))return!1;var a=typeof n;return!!("number"==a?e(o)&&i(n,o.length):"string"==a&&n in o)&&s(o[n],t)}(n[0],n[1],f)&&(c=a<3?void 0:c,a=1),t=Object(t);++o<a;){var u=n[o];u&&W(t,u,o)}return t})));const Q=Symbol.for("rtk.uikit.sdkName"),X=globalThis;function Y(t){X[Q]=t}function Z(){var t;return null!==(t=X[Q])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.2.0-staging.2",sdkName:Z()})}catch(t){}}export{A as i,J as m,C as p,tt as r,Y as s}
1
+ import{m as t,n,o,p as r,q as e,r as i,t as s,v as a,w as c,x as f,y as u,z as d,A as l,B as v,C as m,D as p,E as b,F as g,G as y,H as F,S as k}from"./p-C8tHk7bV.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const x={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},h={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},E={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function j(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=j(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=j(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=j(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in E){const r=E[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=x[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var B,R,S,H=Date.now,I=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,L=(B=I,R=0,S=0,function(){var t=H(),n=16-(t-S);if(S=t,n>0){if(++R>=800)return arguments[0]}else R=0;return B.apply(void 0,arguments)}),N=Math.max;var P=Object.prototype.hasOwnProperty;function T(t){return e(t)?c(t,!0):function(t){if(!r(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=a(t),o=[];for(var e in t)("constructor"!=e||!n&&P.call(t,e))&&o.push(e);return o}(t)}var V=Function.prototype.toString,M=Object.prototype.hasOwnProperty,U=V.call(Object);function q(t,o,r){(void 0!==r&&!s(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function G(t,i,s,a,c,k,$){var x=z(t,s),h=z(i,s),E=$.get(h);if(E)q(t,s,E);else{var j,A=k?k(x,h,s+"",t,i,$):void 0,O=void 0===A;if(O){var D=m(h),w=!D&&l(h),C=!D&&!w&&v(h);A=h,D||w||C?m(x)?A=x:f(j=x)&&e(j)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(x):w?(O=!1,A=p(h,!0)):C?(O=!1,A=b(h,!0)):A=[]:function(t){if(!f(t)||"[object Object]"!=u(t))return!1;var n=d(t);if(null===n)return!0;var o=M.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&V.call(o)==U}(h)||g(h)?(A=x,g(x)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,T(t))}(x):r(x)&&!y(x)||(A=F(h))):O=!1}O&&($.set(h,A),c(A,h,a,k,$),$.delete(h)),q(t,s,A)}}function K(t,n,o,e,i){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(s,a){if(i||(i=new k),r(s))G(t,n,a,o,K,e,i);else{var c=e?e(z(t,a),s,a+"",t,n,i):void 0;void 0===c&&(c=s),q(t,a,c)}}),T)}var W,J=(W=function(t,n,o){K(t,n,o)},function(t,n){return L(function(t,n,o){return n=N(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=N(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,a=n.length,c=a>1?n[a-1]:void 0,f=a>2?n[2]:void 0;for(c=W.length>3&&"function"==typeof c?(a--,c):void 0,f&&function(t,n,o){if(!r(o))return!1;var a=typeof n;return!!("number"==a?e(o)&&i(n,o.length):"string"==a&&n in o)&&s(o[n],t)}(n[0],n[1],f)&&(c=a<3?void 0:c,a=1),t=Object(t);++o<a;){var u=n[o];u&&W(t,u,o)}return t})));const Q=Symbol.for("rtk.uikit.sdkName"),X=globalThis;function Y(t){X[Q]=t}function Z(){var t;return null!==(t=X[Q])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.2.0-staging.3",sdkName:Z()})}catch(t){}}export{A as i,J as m,C as p,tt as r,Y as s}