@beterdichtbij/component-library 0.66.0-alpha.4 → 0.66.0-alpha.5

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.
@@ -191186,101 +191186,101 @@ var gBe = { class: "video-call-template" }, _Be = {
191186
191186
  deviceManager: null,
191187
191187
  incomingCall: null,
191188
191188
  call: null
191189
- }), E = M(null), ee = M(null), O = M(null), k = M(null), A = M(0), ie = M(0), N = M(null), ae = a(() => i.videoTestUrl || void 0), oe = a(() => {
191189
+ }), E = M(null), ee = M(null), O = M(null), k = M(null), A = M(0), ie = M(0), N = M(null), ae = a(() => {
191190
191190
  switch (A.value) {
191191
191191
  case 0: return g.value.hasNoAvailableCamera;
191192
191192
  case 1: return g.value.hasOneAvailableCamera;
191193
191193
  default: return g.value.hasMultipleAvailableCameras;
191194
191194
  }
191195
- }), ce = a(() => {
191195
+ }), oe = a(() => {
191196
191196
  let e = navigator.userAgent;
191197
191197
  return /Mobi/.test(e) && !_.value;
191198
- }), le = a(() => {
191198
+ }), ce = a(() => {
191199
191199
  let e = navigator.userAgent, t = e.indexOf("Android") !== -1, n = /Mobi/.test(e), r = /iPad|iPhone|iPod/.test(e) && !window.MSStream;
191200
191200
  return !(t && n || r);
191201
- }), ue = a(() => !x.value?.video && z.value), F = a(() => !x.value?.audio && z.value), de = a(() => S.value === Z9 ? "incoming--declined" : "incoming--loading"), I = a(() => {
191201
+ }), le = a(() => !x.value?.video && _e.value), ue = a(() => !x.value?.audio && _e.value), F = a(() => S.value === Z9 ? "incoming--declined" : "incoming--loading"), de = a(() => {
191202
191202
  switch (b.value) {
191203
191203
  case 0: return "weak";
191204
191204
  case 1: return "steady";
191205
191205
  case 2: return "strong";
191206
191206
  default: return null;
191207
191207
  }
191208
- }), fe = a(() => {
191208
+ }), I = a(() => {
191209
191209
  switch (b.value) {
191210
191210
  case 0: return g.value.signalStrength.weak;
191211
191211
  case 1: return g.value.signalStrength.steady;
191212
191212
  case 2: return g.value.signalStrength.strong;
191213
191213
  default: return null;
191214
191214
  }
191215
- }), pe = a(() => _.value ? g.value.stopSharingScreen : g.value.shareScreen), me = a(() => g.value.placeholderSettingsHelpTitle), L = a(() => g.value.placeholderSettingsHelpMessage), he = a(() => S.value === Z9), R = a(() => S.value === FBe), ge = a(() => S.value === IBe), _e = a(() => !ge.value), z = a(() => S.value === $9), ve = a(() => R.value ? g.value.messageWhenVideoCallHangedUp : he.value ? g.value.messageWhenVideoCallDeclined : z.value ? g.value.messageWhenDevicePermissionDenied : i.messageWhenLoading), V = a(() => y.value ? ".incoming__screenshare" : ".incoming__video");
191215
+ }), fe = a(() => _.value ? g.value.stopSharingScreen : g.value.shareScreen), pe = a(() => g.value.placeholderSettingsHelpTitle), me = a(() => g.value.placeholderSettingsHelpMessage), L = a(() => S.value === Z9), he = a(() => S.value === FBe), R = a(() => S.value === IBe), ge = a(() => !R.value), _e = a(() => S.value === $9), z = a(() => he.value ? g.value.messageWhenVideoCallHangedUp : L.value ? g.value.messageWhenVideoCallDeclined : _e.value ? g.value.messageWhenDevicePermissionDenied : i.messageWhenLoading), ve = a(() => y.value ? ".incoming__screenshare" : ".incoming__video");
191216
191216
  te(() => {
191217
- qe();
191217
+ Ke();
191218
191218
  }), ne(() => {
191219
- N.value && window.clearInterval(N.value), Ge();
191219
+ N.value && window.clearInterval(N.value), We();
191220
191220
  });
191221
- function H() {
191221
+ function V() {
191222
191222
  S.value = Z9;
191223
191223
  }
191224
- function ye() {}
191225
- function be() {
191226
- S.value !== $9 && Te();
191224
+ function H() {}
191225
+ function ye() {
191226
+ S.value !== $9 && we();
191227
191227
  }
191228
- async function xe() {
191229
- S.value = FBe, x.value.video && Ue();
191228
+ async function be() {
191229
+ S.value = FBe, x.value.video && He();
191230
191230
  }
191231
- async function Se(e) {
191231
+ async function xe(e) {
191232
191232
  T.client = w(new G9());
191233
- let t = await new Hue(e);
191233
+ let t = new Hue(e);
191234
191234
  T.agent = w(await T.client.createCallAgent(t)), T.deviceManager = await T.client.getDeviceManager(), x.value = await T.deviceManager.askDevicePermission({
191235
191235
  video: !0,
191236
191236
  audio: !0
191237
- }), N.value = window.setInterval(Ue, 5e3), (!x.value.audio || !x.value.video) && (S.value = $9), i.isCallee && (T.agent.on("incomingCall", Ce), o("ready"));
191237
+ }), N.value = window.setInterval(He, 5e3), (!x.value.audio || !x.value.video) && (S.value = $9), i.isCallee && (T.agent.on("incomingCall", Se), o("ready"));
191238
191238
  }
191239
- async function Ce(e) {
191239
+ async function Se(e) {
191240
191240
  try {
191241
- T.incomingCall = e.incomingCall, Ee();
191241
+ T.incomingCall = e.incomingCall, Te();
191242
191242
  } catch {
191243
191243
  console.log("error occured during starting call");
191244
191244
  }
191245
191245
  }
191246
- async function we() {
191247
- let e = await De();
191246
+ async function Ce() {
191247
+ let e = await Ee();
191248
191248
  return e ? { localVideoStreams: [e] } : void 0;
191249
191249
  }
191250
- async function Te() {
191250
+ async function we() {
191251
191251
  try {
191252
- let e = await we(), t = { communicationUserId: i.participant.videoCallIdentityId };
191253
- T.call = T.agent.startCall([t], { videoOptions: e }), je(), Oe();
191252
+ let e = await Ce(), t = { communicationUserId: i.participant.videoCallIdentityId };
191253
+ T.call = T.agent.startCall([t], { videoOptions: e }), Oe(), De();
191254
191254
  } catch (e) {
191255
191255
  console.error(e);
191256
191256
  }
191257
191257
  }
191258
- async function Ee() {
191259
- let e = await we();
191260
- T.call = await T.incomingCall.accept({ videoOptions: e }), je(), Oe();
191258
+ async function Te() {
191259
+ let e = await Ce();
191260
+ T.call = await T.incomingCall.accept({ videoOptions: e }), Oe(), De();
191261
191261
  }
191262
- async function De() {
191262
+ async function Ee() {
191263
191263
  let e = (await T.deviceManager.getCameras())[0];
191264
191264
  if (e) return new Z6(e);
191265
191265
  console.error("No camera device found on the system");
191266
191266
  }
191267
- function Oe() {
191268
- T.call.on("stateChanged", Ne), T.call.on("localVideoStreamsUpdated", (e) => {
191269
- e.added.forEach(Fe), e.removed.forEach(Pe);
191270
- }), T.call.remoteParticipants.forEach(Le), T.call.on("remoteParticipantsUpdated", (e) => {
191271
- e.added.forEach(Le);
191267
+ function De() {
191268
+ T.call.on("stateChanged", Me), T.call.on("localVideoStreamsUpdated", (e) => {
191269
+ e.added.forEach(Pe), e.removed.forEach(Ne);
191270
+ }), T.call.remoteParticipants.forEach(Ie), T.call.on("remoteParticipantsUpdated", (e) => {
191271
+ e.added.forEach(Ie);
191272
191272
  }), T.call.on("isScreenSharingOnChanged", () => {
191273
191273
  _.value = T.call.isScreenSharingOn;
191274
191274
  });
191275
191275
  }
191276
- function je() {
191277
- C.value = T.call.feature($5.UserFacingDiagnostics), C.value.media.on("diagnosticChanged", Me), C.value.network.on("diagnosticChanged", Me);
191276
+ function Oe() {
191277
+ C.value = T.call.feature($5.UserFacingDiagnostics), C.value.media.on("diagnosticChanged", je), C.value.network.on("diagnosticChanged", je);
191278
191278
  }
191279
- function Me(e) {
191279
+ function je(e) {
191280
191280
  (e.diagnostic === "networkReceiveQuality" || e.diagnostic === "networkSendQuality") && (e.value === r6.Bad ? (console.error(`${e.diagnostic} is bad quality`), b.value = 0) : e.value === r6.Poor ? (console.error(`${e.diagnostic} is poor quality`), b.value = 1) : b.value = 2);
191281
191281
  }
191282
- function Ne() {
191283
- switch (T.call.state) {
191282
+ function Me() {
191283
+ switch (console.log("Call state changed to: " + T.call.state), T.call.state) {
191284
191284
  case "EarlyMedia":
191285
191285
  S.value = Q9;
191286
191286
  break;
@@ -191291,11 +191291,11 @@ var gBe = { class: "video-call-template" }, _Be = {
191291
191291
  S.value = IBe;
191292
191292
  break;
191293
191293
  case "Disconnected":
191294
- xe();
191294
+ be();
191295
191295
  break;
191296
191296
  }
191297
191297
  }
191298
- async function Pe(e) {
191298
+ async function Ne(e) {
191299
191299
  if (!e || e.mediaStreamType !== "ScreenSharing" || !k.value) return;
191300
191300
  k.value.dispose();
191301
191301
  let t = document.querySelector(".outgoing__screenshare");
@@ -191303,7 +191303,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191303
191303
  let n = document.querySelector(".outgoing__video");
191304
191304
  n.style.display = "flex";
191305
191305
  }
191306
- async function Fe(e) {
191306
+ async function Pe(e) {
191307
191307
  if (!e || e.mediaStreamType !== "ScreenSharing") return;
191308
191308
  k.value = await new A7(e).createView();
191309
191309
  let t = document.querySelector(".outgoing__screenshare");
@@ -191313,7 +191313,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191313
191313
  let r = t.querySelector("video");
191314
191314
  r.style.objectFit = "contain";
191315
191315
  }
191316
- async function Ie(e) {
191316
+ async function Fe(e) {
191317
191317
  if (e && e.source && E.value && E.value.source && E.value.source.id == e.source.id) return !0;
191318
191318
  try {
191319
191319
  ee.value = new A7(e);
@@ -191324,79 +191324,79 @@ var gBe = { class: "video-call-template" }, _Be = {
191324
191324
  }
191325
191325
  return E.value = e, !0;
191326
191326
  }
191327
- async function Le(e) {
191328
- e.videoStreams.forEach(Re), e.on("videoStreamsUpdated", (e) => {
191329
- e.added.forEach(Re);
191327
+ async function Ie(e) {
191328
+ e.videoStreams.forEach(Le), e.on("videoStreamsUpdated", (e) => {
191329
+ e.added.forEach(Le);
191330
191330
  });
191331
191331
  }
191332
- async function Re(e) {
191333
- if (e.mediaStreamType === "Video" && (await ze(e), e.on("isAvailableChanged", async () => await ze(e))), e.mediaStreamType === "ScreenSharing" && e.on("isAvailableChanged", Ve), e.mediaStreamType === "ScreenSharing" && e.isAvailable) {
191332
+ async function Le(e) {
191333
+ if (e.mediaStreamType === "Video" && (await Re(e), e.on("isAvailableChanged", async () => await Re(e))), e.mediaStreamType === "ScreenSharing" && e.on("isAvailableChanged", Be), e.mediaStreamType === "ScreenSharing" && e.isAvailable) {
191334
191334
  O.value = new A7(e);
191335
191335
  let t = await O.value.createView(), n = document.querySelector(".incoming__screenshare");
191336
- Be(!0), y.value = !0, We(".incoming__screenshare"), n.replaceChildren(t.target);
191336
+ ze(!0), y.value = !0, Ue(".incoming__screenshare"), n.replaceChildren(t.target);
191337
191337
  }
191338
191338
  }
191339
- async function ze(e) {
191339
+ async function Re(e) {
191340
191340
  if (!e.isAvailable) return;
191341
191341
  O.value = new A7(e);
191342
191342
  let t = await O.value.createView(), n = document.querySelector(".incoming__video");
191343
- n.hidden = !1, n.replaceChildren(t.target), We(".incoming__video"), Be(!1);
191343
+ n.hidden = !1, n.replaceChildren(t.target), Ue(".incoming__video"), ze(!1);
191344
191344
  }
191345
- function Be(e) {
191345
+ function ze(e) {
191346
191346
  let t = document.querySelector(".incoming__video"), n = document.querySelector(".incoming__screenshare");
191347
191347
  t.style.display = e ? "none" : "block", n.style.display = e ? "flex" : "none";
191348
191348
  }
191349
- function Ve() {
191350
- y.value = !1, Be(!1);
191349
+ function Be() {
191350
+ y.value = !1, ze(!1);
191351
191351
  }
191352
- async function He() {
191353
- Ue(!0);
191352
+ async function Ve() {
191353
+ He(!0);
191354
191354
  }
191355
- async function Ue(e = !1) {
191355
+ async function He(e = !1) {
191356
191356
  let t = (await T.deviceManager.getCameras()).filter((e) => e.name != "OBS Virtual Camera");
191357
191357
  A.value = t.length;
191358
191358
  for (let n = 0; n < A.value; n++) {
191359
191359
  (e || n != 0) && (ie.value = (ie.value + 1) % A.value);
191360
191360
  let r = t[ie.value];
191361
- if (await Ie(new Z6(r))) break;
191361
+ if (await Fe(new Z6(r))) break;
191362
191362
  }
191363
191363
  }
191364
- function We(e) {
191364
+ function Ue(e) {
191365
191365
  let t = document.querySelector(e);
191366
191366
  if (!t) return;
191367
191367
  let n = t.querySelector("video");
191368
191368
  n && (n.style.objectFit = "contain", n.disablePictureInPicture = !1);
191369
191369
  }
191370
- async function Ge() {
191370
+ async function We() {
191371
191371
  T.call && T.call.state !== "Disconnected" && (await T.call.hangUp({ forEveryone: !0 }), await T.agent.dispose()), o("end-video-call"), window.close();
191372
191372
  }
191373
- function Ke() {
191373
+ function Ge() {
191374
191374
  window.close();
191375
191375
  }
191376
- function qe() {
191376
+ function Ke() {
191377
191377
  _oe("verbose"), goe.log = (...e) => {
191378
191378
  let t = [...e];
191379
191379
  f.value = f.value.splice(1 - LBe).concat(t);
191380
191380
  };
191381
191381
  }
191382
- function Je() {
191383
- document.querySelector(V.value).querySelector("video").requestFullscreen();
191382
+ function qe() {
191383
+ document.querySelector(ve.value).querySelector("video").requestFullscreen();
191384
191384
  }
191385
- function Ye() {
191386
- let e = document.querySelector(V.value).querySelector("video");
191385
+ function Je() {
191386
+ let e = document.querySelector(ve.value).querySelector("video");
191387
191387
  document.pictureInPictureElement ? e.exitPictureInPicture() : document.pictureInPictureEnabled && e.requestPictureInPicture();
191388
191388
  }
191389
- async function Xe() {
191389
+ async function Ye() {
191390
191390
  T.call && T.call.isScreenSharingOn ? await T.call.stopScreenSharing() : await T.call.startScreenSharing();
191391
191391
  }
191392
191392
  return n({
191393
- CallDeclined: H,
191394
- CallAnswered: ye,
191395
- CallStartVideoCall: be,
191396
- CallHangUp: xe,
191397
- InitializeAcsConnection: Se
191393
+ CallDeclined: V,
191394
+ CallAnswered: H,
191395
+ CallStartVideoCall: ye,
191396
+ CallHangUp: be,
191397
+ InitializeAcsConnection: xe
191398
191398
  }), (n, r) => {
191399
- let i = se("BDLoader");
191399
+ let a = se("BDLoader");
191400
191400
  return j(), l("div", gBe, [m(ke, null, {
191401
191401
  default: B(() => [m(Ae, null, {
191402
191402
  default: B(() => [m(U, null, {
@@ -191410,21 +191410,21 @@ var gBe = { class: "video-call-template" }, _Be = {
191410
191410
  }), m(Ae, null, {
191411
191411
  default: B(() => [m(U, {
191412
191412
  sm: "12",
191413
- lg: he.value ? "12" : "8"
191413
+ lg: L.value ? "12" : "8"
191414
191414
  }, {
191415
- default: B(() => [u("div", { class: D(["incoming", de.value]) }, [_e.value ? (j(), l("div", _Be, [
191416
- m(i, {
191415
+ default: B(() => [u("div", { class: D(["incoming", F.value]) }, [ge.value ? (j(), l("div", _Be, [
191416
+ m(a, {
191417
191417
  size: "lg",
191418
- message: ve.value,
191419
- stopAnimation: he.value || R.value || z.value
191418
+ message: z.value,
191419
+ stopAnimation: L.value || he.value || _e.value
191420
191420
  }, null, 8, ["message", "stopAnimation"]),
191421
- F.value ? (j(), l("div", vBe, [u("div", yBe, [m(Mi, { class: "icon-xl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForAudio), 1)])) : c("", !0),
191422
- ue.value ? (j(), l("div", bBe, [u("div", xBe, [m(eo, { class: "icon-xl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForVideo), 1)])) : c("", !0),
191423
- he.value || R.value || z.value ? (j(), s(xo, {
191421
+ ue.value ? (j(), l("div", vBe, [u("div", yBe, [m(Mi, { class: "icon-xl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForAudio), 1)])) : c("", !0),
191422
+ le.value ? (j(), l("div", bBe, [u("div", xBe, [m(eo, { class: "icon-xl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForVideo), 1)])) : c("", !0),
191423
+ L.value || he.value || _e.value ? (j(), s(xo, {
191424
191424
  key: 2,
191425
191425
  variant: "primary",
191426
191426
  class: "text-center",
191427
- onClick: Ke
191427
+ onClick: Ge
191428
191428
  }, {
191429
191429
  default: B(() => [p(P(g.value.closeWindow), 1)]),
191430
191430
  _: 1
@@ -191435,7 +191435,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191435
191435
  u("div", CBe, [m(xo, {
191436
191436
  variant: "primary",
191437
191437
  class: "text-center",
191438
- onClick: Je
191438
+ onClick: qe
191439
191439
  }, {
191440
191440
  default: B(() => [m(ha), u("span", null, P(g.value.fullScreen), 1)]),
191441
191441
  _: 1
@@ -191443,59 +191443,59 @@ var gBe = { class: "video-call-template" }, _Be = {
191443
191443
  key: 0,
191444
191444
  variant: "primary",
191445
191445
  class: "text-center",
191446
- onClick: Ye
191446
+ onClick: Je
191447
191447
  }, {
191448
191448
  default: B(() => [m(ha), u("span", null, P(g.value.miniPlayer), 1)]),
191449
191449
  _: 1
191450
191450
  })) : c("", !0)])
191451
191451
  ]))], 2)]),
191452
191452
  _: 1
191453
- }, 8, ["lg"]), he.value ? c("", !0) : (j(), s(U, {
191453
+ }, 8, ["lg"]), L.value ? c("", !0) : (j(), s(U, {
191454
191454
  key: 0,
191455
191455
  sm: "12",
191456
191456
  lg: "4"
191457
191457
  }, {
191458
191458
  default: B(() => [u("div", wBe, [u("div", null, [u("div", TBe, [u("div", EBe, [
191459
- z.value ? c("", !0) : (j(), l("div", DBe)),
191459
+ _e.value ? c("", !0) : (j(), l("div", DBe)),
191460
191460
  r[2] ||= u("div", { class: "outgoing__screenshare" }, null, -1),
191461
- le.value && !z.value && !v.value && !_e.value ? (j(), s(xo, {
191461
+ ce.value && !_e.value && !v.value && !ge.value ? (j(), s(xo, {
191462
191462
  key: 1,
191463
191463
  variant: _.value ? "danger" : "primary",
191464
191464
  class: "text-center",
191465
- onClick: Xe
191465
+ onClick: Ye
191466
191466
  }, {
191467
- default: B(() => [m(ha), u("span", null, P(pe.value), 1)]),
191467
+ default: B(() => [m(ha), u("span", null, P(fe.value), 1)]),
191468
191468
  _: 1
191469
191469
  }, 8, ["variant"])) : c("", !0),
191470
- ce.value ? (j(), l(t, { key: 2 }, [m(xo, {
191470
+ oe.value ? (j(), l(t, { key: 2 }, [m(xo, {
191471
191471
  class: "text-center",
191472
- onClick: He
191472
+ onClick: Ve
191473
191473
  }, {
191474
191474
  default: B(() => [p(P(g.value.switchCamera), 1)]),
191475
191475
  _: 1
191476
- }), u("p", OBe, P(oe.value), 1)], 64)) : c("", !0),
191477
- ue.value ? (j(), l("div", kBe, [u("div", ABe, [m(eo, { class: "icon-xxl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForVideo), 1)])) : c("", !0)
191478
- ])]), u("div", jBe, [u("div", { class: D(["settings__signal", I.value]) }, [r[3] ||= u("ul", { class: "indicator" }, [
191476
+ }), u("p", OBe, P(ae.value), 1)], 64)) : c("", !0),
191477
+ le.value ? (j(), l("div", kBe, [u("div", ABe, [m(eo, { class: "icon-xxl icon-state-error" })]), u("span", null, P(g.value.permissionDeniedForVideo), 1)])) : c("", !0)
191478
+ ])]), u("div", jBe, [u("div", { class: D(["settings__signal", de.value]) }, [r[3] ||= u("ul", { class: "indicator" }, [
191479
191479
  u("li"),
191480
191480
  u("li"),
191481
191481
  u("li")
191482
- ], -1), u("p", null, P(fe.value), 1)], 2), u("div", MBe, [
191483
- u("p", null, [u("b", null, P(me.value), 1)]),
191484
- u("p", null, P(L.value), 1),
191482
+ ], -1), u("p", null, P(I.value), 1)], 2), u("div", MBe, [
191483
+ u("p", null, [u("b", null, P(pe.value), 1)]),
191484
+ u("p", null, P(me.value), 1),
191485
191485
  u("p", null, [
191486
191486
  u("a", {
191487
- href: ae.value,
191487
+ href: i.videoTestUrl,
191488
191488
  target: "blank",
191489
191489
  rel: "noopener noreferrer"
191490
191490
  }, P(g.value.testCall), 9, NBe),
191491
191491
  r[4] ||= p(" • ", -1),
191492
191492
  u("a", PBe, P(g.value.serviceDesk), 1)
191493
191493
  ])
191494
- ])])]), !R.value && !z.value ? (j(), s(xo, {
191494
+ ])])]), !he.value && !_e.value ? (j(), s(xo, {
191495
191495
  key: 0,
191496
191496
  variant: "danger",
191497
191497
  class: "text-center w-100",
191498
- onClick: Ge
191498
+ onClick: We
191499
191499
  }, {
191500
191500
  default: B(() => [m(Fn), u("span", null, P(g.value.endCall), 1)]),
191501
191501
  _: 1