@nethesis/phone-island 1.0.8-dev.4 → 1.0.8-dev.6
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.
- package/README.md +79 -0
- package/dist/App.js +1 -1
- package/dist/App.js.map +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/_virtual/index9.js +1 -1
- package/dist/components/CallView/index.js +1 -1
- package/dist/components/CallView/index.js.map +1 -1
- package/dist/components/Island.js +1 -1
- package/dist/components/Island.js.map +1 -1
- package/dist/components/SettingsView/index.js +1 -1
- package/dist/components/SettingsView/index.js.map +1 -1
- package/dist/components/SideView/hooks/useSideViewLogic.js +1 -1
- package/dist/components/SideView/hooks/useSideViewLogic.js.map +1 -1
- package/dist/components/Socket.js +1 -1
- package/dist/components/Socket.js.map +1 -1
- package/dist/components/TranscriptionView/TranscriptionView.js.map +1 -1
- package/dist/components/VideoView/index.js +1 -1
- package/dist/components/VideoView/index.js.map +1 -1
- package/dist/components/WebRTC.js +1 -1
- package/dist/components/WebRTC.js.map +1 -1
- package/dist/events/CallEvents.js +1 -1
- package/dist/events/CallEvents.js.map +1 -1
- package/dist/events/SocketEvents.js +1 -1
- package/dist/events/SocketEvents.js.map +1 -1
- package/dist/lib/devices/devices.js +1 -1
- package/dist/lib/phone/call.js +1 -1
- package/dist/lib/phone/call.js.map +1 -1
- package/dist/lib/webrtc/messages.js +1 -1
- package/dist/lib/webrtc/messages.js.map +1 -1
- package/dist/models/currentCall.js +1 -1
- package/dist/models/currentCall.js.map +1 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +1 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/immer/dist/immer.esm.mjs.js +1 -1
- package/dist/node_modules/immer/dist/immer.esm.mjs.js.map +1 -1
- package/dist/node_modules/mic-check/lib/index.js +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-moment/dist/index.js +1 -1
- package/dist/node_modules/react-redux/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/socket.io-parser/build/esm/index.js +1 -1
- package/dist/node_modules/socket.io-parser/build/esm/index.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/user.js +1 -1
- package/dist/services/user.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/genericFunctions/summaryEvents.js +0 -2
- package/dist/utils/genericFunctions/summaryEvents.js.map +0 -1
package/README.md
CHANGED
|
@@ -13,6 +13,85 @@ Available as widget on `jsDelivr`
|
|
|
13
13
|
[](https://cdn.jsdelivr.net/gh/nethesis/phone-island/dist-widget/index.widget.js)
|
|
14
14
|
[](https://cdn.jsdelivr.net/gh/nethesis/phone-island/dist-widget/index.widget.css)
|
|
15
15
|
|
|
16
|
+
## Integrate in any template
|
|
17
|
+
|
|
18
|
+
Phone Island can be embedded in any HTML template, CMS page or server-rendered application without a React-specific integration.
|
|
19
|
+
|
|
20
|
+
To embed the standalone widget you need:
|
|
21
|
+
|
|
22
|
+
1. the CDN CSS file
|
|
23
|
+
2. the CDN JavaScript bundle
|
|
24
|
+
3. a container element with class `phone-island`
|
|
25
|
+
4. a Base64 config token in `data-config`
|
|
26
|
+
5. a host-side JavaScript file that dispatches commands and listens to Phone Island browser events
|
|
27
|
+
|
|
28
|
+
### Minimal HTML example
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!doctype html>
|
|
32
|
+
<html lang="en">
|
|
33
|
+
<head>
|
|
34
|
+
<meta charset="utf-8" />
|
|
35
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
36
|
+
<title>Phone Island integration</title>
|
|
37
|
+
|
|
38
|
+
<link
|
|
39
|
+
rel="stylesheet"
|
|
40
|
+
href="https://cdn.jsdelivr.net/gh/nethesis/phone-island@latest/dist-widget/index.widget.css"
|
|
41
|
+
/>
|
|
42
|
+
</head>
|
|
43
|
+
<body>
|
|
44
|
+
<div class="phone-island" data-config="YOUR_BASE64_CONFIG_TOKEN"></div>
|
|
45
|
+
|
|
46
|
+
<script src="https://cdn.jsdelivr.net/gh/nethesis/phone-island@latest/dist-widget/index.widget.js"></script>
|
|
47
|
+
<script src="./phone-island-integration.js"></script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Host-side integration script
|
|
53
|
+
|
|
54
|
+
Create a file such as `phone-island-integration.js` and use it to control the widget from your page.
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
function dispatchPhoneIslandEvent(eventName, detail = {}) {
|
|
58
|
+
window.dispatchEvent(new CustomEvent(eventName, { detail }))
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
window.addEventListener('phone-island-call-started', (event) => {
|
|
62
|
+
console.log('Call started', event.detail)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
window.addEventListener('phone-island-video-call-started', (event) => {
|
|
66
|
+
console.log('Video call started', event.detail)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
document.getElementById('call-200')?.addEventListener('click', () => {
|
|
70
|
+
dispatchPhoneIslandEvent('phone-island-call-start', { number: '200' })
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Base64 config token
|
|
75
|
+
|
|
76
|
+
The standalone widget expects a Base64 string in this format:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
<cti_host>:<cti_username>:<cti_token>:<sip_ext>:<sip_secret>:<sip_host>:<sip_port>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Example generation:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
echo -n "<cti_host>:<cti_username>:<cti_token>:<sip_ext>:<sip_secret>:<sip_host>:<sip_port>" | base64 -w0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Full example
|
|
89
|
+
|
|
90
|
+
For a complete browser integration example, including event log, device switching, toast notifications and debug actions, see:
|
|
91
|
+
|
|
92
|
+
1. `widget-example/index.html`
|
|
93
|
+
2. `widget-example/index.js`
|
|
94
|
+
|
|
16
95
|
## Online Demo
|
|
17
96
|
|
|
18
97
|
The repository root now contains a demo entrypoint for GitHub Pages.
|
package/dist/App.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./node_modules/tslib/tslib.es6.js"),n=require("react"),t=require("./components/Events.js"),i=require("./components/Socket.js"),r=require("./components/WebRTC.js"),s=require("./components/Island.js"),a=require("./components/RestAPI.js"),o=require("./utils/customHooks/useEventListener.js"),c=require("./utils/genericFunctions/eventDispatch.js"),u=require("./utils/genericFunctions/localStorage.js"),d=require("./utils/genericFunctions/summaryEvents.js"),l=require("./store/index.js"),p=require("./services/user.js");require("./node_modules/react-redux/es/index.js"),require("./node_modules/@fortawesome/react-fontawesome/index.es.js"),require("./node_modules/i18next/dist/esm/i18next.js"),require("./node_modules/react-tooltip/dist/react-tooltip.min.mjs.js"),require("./components/TranscriptionView/TranscriptionView.js");var v=require("./node_modules/js-base64/base64.mjs.js"),h=require("./workers/wake_up.js"),f=require("./lib/i18n.js"),m=require("./lib/webrtc/messages.js"),g=require("./lib/darkTheme.js"),w=require("./utils/genericFunctions/isEmpty.js"),b=require("./utils/genericFunctions/checkConnection.js"),S=require("./utils/genericFunctions/isBackCallVisible.js"),I=require("./lib/phone/trunk.js"),y=require("./lib/phone/call.js"),E=require("./node_modules/react-redux/es/components/Provider.js");function D(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),require("./node_modules/react-redux/node_modules/react-is/index.js"),require("./node_modules/react-redux/es/components/Context.js");var k=D(n);if("undefined"!=typeof window&&window.location.hostname.includes(".support.my.")){var _=window.fetch;window.fetch=function(n,t){return _(n,e.__assign({credentials:"include"},t))}}var L=n.forwardRef((function(D,_){var L=D.dataConfig,U=D.showAlways,N=void 0!==U&&U,q=D.uaType,C=D.urlParamWithEvent,T=void 0!==C&&C,j=v.Base64.atob(L||"").split(":"),R=j[0],A=j[1],O=j[2],P=j[3],V=j[4],x=j[5],J=j[6],F=n.useState(!1),W=F[0],M=F[1],Q=n.useState(!1),z=Q[0],H=Q[1],$=n.useState(!1),B=$[0],G=$[1],K=n.useRef(0),X=n.useRef(null),Y=n.useRef(null);n.useImperativeHandle(_,(function(){return{reset:function(){console.info("PhoneIsland: Performing full component reset"),M(!0)}}}),[]),n.useEffect((function(){var e=Date.now(),n=function(){if(!document.hidden){var n=Date.now(),t=n-e;setTimeout((function(){c.eventDispatch("phone-island-emergency-stop-ringtone",{})}),2e3),t>3e5&&(console.info("Tab inactive for long period, performing soft reconnection"),M(!0)),e=n}},t=new Worker(h.default,{type:"module"});return t.onmessage=function(n){"ping"===n.data&&(e=Date.now())},document.addEventListener("visibilitychange",n),function(){t.terminate(),document.removeEventListener("visibilitychange",n)}}),[]),n.useEffect((function(){B&&z&&(M(!1),H(!1),G(!1))}),[B,z]),n.useEffect((function(){var e=setInterval((function(){var e,n,t,i,r=l.store.getState().alerts.data,s=(null===(e=r.webrtc_down)||void 0===e?void 0:e.active)||!1,a=(null===(n=r.socket_down)||void 0===n?void 0:n.active)||!1,o=Date.now(),c=o-K.current,u=l.store.getState().webrtc.sipcall,d=l.store.getState().currentCall,p=d.accepted,v=d.outgoing,h=null===(i=null===(t=null==u?void 0:u.webrtcStuff)||void 0===t?void 0:t.pc)||void 0===i?void 0:i.iceConnectionState,f=p||v||"connected"===h||"completed"===h,m=navigator.onLine;if((s||a)&&!W&&c>1e4&&m){if(f)return void console.info("Alert detected but active call in progress - skipping automatic reload to let ICE recover",{timeSinceLastReload:Math.round(c/1e3)+"s",isWebRTCDown:s,isSocketDown:a,iceState:h,accepted:p,outgoing:v});console.info("Alert detected (webrtc_down or socket_down), triggering automatic reload",{timeSinceLastReload:Math.round(c/1e3)+"s",isWebRTCDown:s,isSocketDown:a}),K.current=o,M(!0)}}),1e3);return function(){return clearInterval(e)}}),[W]),o.useEventListener("phone-island-expand",(function(){l.store.dispatch.island.toggleIsOpen(!0),c.eventDispatch("phone-island-expanded",{})})),o.useEventListener("phone-island-compress",(function(){l.store.dispatch.island.toggleIsOpen(!1),c.eventDispatch("phone-island-compressed",{})})),o.useEventListener("phone-island-call-keypad-close",(function(){l.store.dispatch.island.setIslandView("call"),c.eventDispatch("phone-island-call-keypad-closed",{})})),o.useEventListener("phone-island-call-transfer-close",(function(){l.store.dispatch.island.setIslandView("call"),c.eventDispatch("phone-island-call-transfer-closed",{})})),o.useEventListener("phone-island-recording-close",(function(){l.store.dispatch.island.setIslandView(null),c.eventDispatch("phone-island-recording-closed",{})})),o.useEventListener("phone-island-audio-player-close",(function(){l.store.dispatch.island.setIslandView(null),c.eventDispatch("phone-island-audio-player-closed",{})})),o.useEventListener("phone-island-emergency-stop-ringtone",(function(){null===l.store.getState().island.view?(console.warn("Emergency stop ringtone triggered - phone island inactive"),l.store.dispatch.player.emergencyStopAudioPlayer(),c.eventDispatch("phone-island-emergency-stop-ringtone-completed",{})):console.log("Phone island is active, ringtone stop ignored")})),o.useEventListener("phone-island-detach",(function(e){m.detach(),l.store.dispatch.webrtc.updateWebRTC({sipcall:null,registered:!1,isDetached:!0,jsepGlobal:null}),l.store.dispatch.webrtc.updateRemoteAudioStream(null),l.store.dispatch.webrtc.updateLocalAudioStream(null),l.store.dispatch.webrtc.updateLocalVideoStream(null),l.store.dispatch.webrtc.updateRemoteVideoStream(null),c.eventDispatch("phone-island-detached",{})})),o.useEventListener("phone-island-reload-component",(function(e){(null==e?void 0:e.force)&&l.store.dispatch.island.setForceReload(!0),M(!0)})),o.useEventListener("phone-island-audio-input-change",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return(t=n.deviceId)&&"default"!==t?[4,ue(t)]:[3,3];case 1:return e.sent()?[3,3]:(console.warn("Audio input device ".concat(t," not available, falling back to default device")),[4,de()]);case 2:t=e.sent(),e.label=3;case 3:return u.setJSONItem("phone-island-audio-input-device",{deviceId:t}),c.eventDispatch("phone-island-audio-input-changed",{}),t!==n.deviceId&&console.info("Audio input device changed from ".concat(n.deviceId," to ").concat(t," (fallback)")),[2]}}))}))})),o.useEventListener("phone-island-video-input-change",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return(t=n.deviceId)&&"default"!==t?[4,le(t)]:[3,3];case 1:return e.sent()?[3,3]:(console.warn("Video input device ".concat(t," not available, falling back to default device")),[4,pe()]);case 2:t=e.sent(),e.label=3;case 3:return u.setJSONItem("phone-island-video-input-device",{deviceId:t}),c.eventDispatch("phone-island-video-input-changed",{}),t!==n.deviceId&&console.info("Video input device changed from ".concat(n.deviceId," to ").concat(t," (fallback)")),[2]}}))}))}));var Z=n.useState(!0),ee=Z[0],ne=Z[1],te=n.useState(!0),ie=te[0],re=te[1],se=n.useState(!1),ae=se[0],oe=se[1],ce=n.useSyncExternalStore(l.store.subscribe,(function(){return l.store.getState().fetchDefaults.fetchReady||!1}));n.useEffect((function(){ee&&(f.initI18n(),ne(!1))}),[ee]),n.useEffect((function(){ce&&!ae&&(oe(!0),e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.getParamUrl()];case 1:return n=e.sent(),t=(null==n?void 0:n.url)||"",i=t&&""!==t.trim(),l.store.dispatch.paramUrl.setParamUrl({url:t,onlyQueues:(null==n?void 0:n.only_queues)||!1,hasValidUrl:i}),[3,3];case 2:return r=e.sent(),console.warn("Non-blocking param URL fetch failed:",r),l.store.dispatch.paramUrl.setParamUrl({url:"",onlyQueues:!1,hasValidUrl:!1}),[3,3];case 3:return[2]}}))})))}),[ce,ae]);var ue=function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return t=e.sent(),[2,t.filter((function(e){return"audioinput"===e.kind})).some((function(e){return e.deviceId===n}))];case 2:return i=e.sent(),console.warn("Error checking audio input device availability:",i),[2,!1];case 3:return[2]}}))}))},de=function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"audioinput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return r=e.sent(),console.warn("Error getting default audio input device:",r),[2,"default"];case 3:return[2]}}))}))},le=function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return t=e.sent(),[2,t.filter((function(e){return"videoinput"===e.kind})).some((function(e){return e.deviceId===n}))];case 2:return i=e.sent(),console.warn("Error checking video input device availability:",i),[2,!1];case 3:return[2]}}))}))},pe=function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"videoinput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return r=e.sent(),console.warn("Error getting default video input device:",r),[2,"default"];case 3:return[2]}}))}))};o.useEventListener("phone-island-audio-output-change",(function(n){e.__awaiter(void 0,void 0,void 0,(function(){var t,i,r,s,a,o,d,p,v;return e.__generator(this,(function(h){switch(h.label){case 0:return(null==(t=l.store.getState().player.remoteAudio)?void 0:t.current)?(i=n.deviceId)&&"default"!==i?[4,(f=i,e.__awaiter(void 0,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return[2,e.sent().filter((function(e){return"audiooutput"===e.kind})).some((function(e){return e.deviceId===f}))];case 2:return n=e.sent(),console.warn("Error checking device availability:",n),[2,!1];case 3:return[2]}}))})))]:[3,3]:(console.warn("Remote audio element not available"),[2]);case 1:return h.sent()?[3,3]:(console.warn("Audio output device ".concat(i," not available, falling back to default device")),[4,e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"audiooutput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return r=e.sent(),console.warn("Error getting default device:",r),[2,"default"];case 3:return[2]}}))}))]);case 2:i=h.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),h.label=3;case 3:return h.trys.push([3,5,,15]),[4,t.current.setSinkId(i)];case 4:return h.sent(),console.info("Default audio output device changed successfully!"),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,15];case 5:r=h.sent(),console.log("Direct setSinkId failed, trying with temporary stream:",r),h.label=6;case 6:return h.trys.push([6,7,,14]),s=new(window.AudioContext||window.webkitAudioContext),a=s.createOscillator(),o=s.createGain(),a.frequency.setValueAtTime(440,s.currentTime),o.gain.setValueAtTime(0,s.currentTime),a.connect(o),d=s.createMediaStreamDestination(),o.connect(d),t.current.srcObject=d.stream,a.start(),setTimeout((function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,t.current.setSinkId(i)];case 1:return e.sent(),console.info("Default audio output device changed successfully with temporary stream!"),a.stop(),s.close(),t.current.srcObject=null,u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,7];case 2:if(n=e.sent(),console.error("Final setSinkId attempt failed:",n),a.stop(),s.close(),t.current.srcObject=null,"default"===i)return[3,6];console.log("Trying fallback to default device"),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,t.current.setSinkId("default")];case 4:return e.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:"default"}),console.info("Fallback to default audio device successful"),[3,6];case 5:return r=e.sent(),console.error("Even default device failed:",r),[3,6];case 6:return u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,7];case 7:return[2]}}))}))}),100),[3,14];case 7:if(p=h.sent(),console.error("Failed to create temporary audio stream:",p),"default"===i)return[3,12];h.label=8;case 8:return h.trys.push([8,10,,11]),[4,t.current.setSinkId("default")];case 9:return h.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:"default"}),console.info("Emergency fallback to default audio device successful"),[3,11];case 10:return v=h.sent(),console.error("Emergency fallback to default device failed:",v),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),[3,11];case 11:return[3,13];case 12:u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),h.label=13;case 13:return c.eventDispatch("phone-island-audio-output-changed",{}),[3,14];case 14:return[3,15];case 15:return[2]}var f}))}))})),o.useEventListener("phone-island-presence-change",(function(e){p.changeOperatorStatus(e),c.eventDispatch("phone-island-presence-changed",{})})),o.useEventListener("phone-island-view-changed",(function(e){var n=null==e?void 0:e.viewType;l.store.dispatch.island.setIslandView(n)}));var ve=l.store.getState().player.remoteAudio;n.useEffect((function(){var e;if(ie&&ve){var n=null===(e=u.getJSONItem("phone-island-audio-output-device"))||void 0===e?void 0:e.deviceId;c.eventDispatch("phone-island-audio-output-change",{deviceId:n}),re(!1)}}),[ie,ve]),n.useEffect((function(){g.checkDarkTheme()}),[]),o.useEventListener("phone-island-theme-change",(function(e){g.setTheme(null==e?void 0:e.selectedTheme)})),o.useEventListener("phone-island-default-device-change",(function(e){l.store.dispatch.currentUser.updateCurrentDefaultDevice(null==e?void 0:e.deviceInformationObject),c.eventDispatch("phone-island-default-device-changed",{})})),o.useEventListener("phone-island-alert",(function(e){l.store.dispatch.alerts.setAlert(e.toString())})),o.useEventListener("phone-island-ringing-tone-list",(function(){var e=l.store.getState().ringtones.availableRingtones.map((function(e){return{name:e.name,displayName:e.displayName,base64Audio:e.base64Audio}}));c.eventDispatch("phone-island-ringing-tone-list-response",{ringtones:e})})),o.useEventListener("phone-island-ringing-tone-select",(function(e){(null==e?void 0:e.name)&&(u.setJSONItem("phone-island-selected-ringtone",{value:e.name}),l.store.dispatch.ringtones.setSelectedRingtone(e.name),c.eventDispatch("phone-island-ringing-tone-selected",{name:e.name}))})),o.useEventListener("phone-island-ringing-tone-output",(function(e){(null==e?void 0:e.deviceId)&&(u.setJSONItem("phone-island-ringtone-output-device",{value:e.deviceId}),l.store.dispatch.ringtones.setOutputDeviceId(e.deviceId),c.eventDispatch("phone-island-ringing-tone-output-changed",{deviceId:e.deviceId}))})),n.useEffect((function(){var e=u.getJSONItem("phone-island-selected-ringtone"),n=u.getJSONItem("phone-island-ringtone-output-device");(null==e?void 0:e.value)&&l.store.dispatch.ringtones.setSelectedRingtone(e.value),(null==n?void 0:n.value)&&l.store.dispatch.ringtones.setOutputDeviceId(n.value)}),[]),o.useEventListener("phone-island-check-connection",(function(){b.checkInternetConnection().then((function(e){e?c.eventDispatch("phone-island-internet-connected",{}):c.eventDispatch("phone-island-internet-disconnected",{})}))})),n.useEffect((function(){var e=setInterval((function(){b.checkInternetConnection().then((function(e){e?c.eventDispatch("phone-island-internet-connected",{}):c.eventDispatch("phone-island-internet-disconnected",{})}))}),5e3);return function(){return clearInterval(e)}}),[]),o.useEventListener("phone-island-main-presence",(function(e){var n,t,i,r,s=null===(n=l.store.getState().currentUser)||void 0===n?void 0:n.username,a=l.store.getState().currentUser,o=null==a?void 0:a.mainPresence;if(void 0!==s&&""!==s&&!w.isEmpty(e[s])&&void 0!==(null===(t=e[s])||void 0===t?void 0:t.mainPresence)){var u=null===(i=e[s])||void 0===i?void 0:i.mainPresence;l.store.dispatch.currentUser.updateMainPresence(null===(r=e[s])||void 0===r?void 0:r.mainPresence),"online"===u&&"online"!==o&&c.eventDispatch("phone-island-call-ended",{})}})),o.useEventListener("phone-island-call-status",(function(){var e=l.store.getState().currentCall;console.log("Call status debug informations: ",e)}));var he=function(e,n,t,i,r){var s=l.store.getState().paramUrl;if(null==s?void 0:s.hasValidUrl){var a=s.url||"";if(a){var o=l.store.getState().island.urlOpened,u=s.openParamUrlType;if(!o||"button"===u){var d=a;d.includes("$CALLER_NUMBER")&&e&&(d=d.replace(/\$CALLER_NUMBER/g,encodeURIComponent(e))),d.includes("$CALLER_NAME")&&n&&(d=d.replace(/\$CALLER_NAME/g,encodeURIComponent(n))),d.includes("$UNIQUEID")&&i&&(d=d.replace(/\$UNIQUEID/g,encodeURIComponent(i))),d.includes("$CALLED")&&t&&(d=d.replace(/\$CALLED/g,encodeURIComponent(t))),d.includes("{phone}")&&e&&(d=d.replace(/\{phone\}/g,encodeURIComponent(e)));var p=d.startsWith("http")?d:"https://".concat(d);if("mobile"!==q&&!T&&r){var v=window.open("about:blank","_blank");v&&(v.location.href=p,l.store.dispatch.island.setUrlOpened(!0))}else c.eventDispatch("phone-island-url-parameter-opened-external",{formattedUrl:p})}}}};return o.useEventListener("phone-island-already-opened-external-page",(function(){l.store.dispatch.island.setUrlOpened(!0)})),o.useEventListener("phone-island-url-parameter-opened",(function(e){var n=l.store.getState().paramUrl;if(n.hasValidUrl&&!l.store.getState().island.urlOpened){var t=n.onlyQueues||!1,i=I.isFromTrunk(null==e?void 0:e.counterpartNum);l.store.dispatch.paramUrl.setThroughTrunk(i);var r=l.store.getState().currentUser.default_device,s=!("desktop"===q&&"nethlink"===(null==r?void 0:r.type));"in"===(null==e?void 0:e.direction)&&(!0===t&&!0===(null==e?void 0:e.throughQueue)?he(null==e?void 0:e.counterpartNum,null==e?void 0:e.counterpartName,null==e?void 0:e.owner,null==e?void 0:e.linkedId,s):!1!==t||!0!==i&&!0!==(null==e?void 0:e.throughQueue)||he(null==e?void 0:e.counterpartNum,null==e?void 0:e.counterpartName,null==e?void 0:e.owner,null==e?void 0:e.linkedId,s))}})),o.useEventListener("phone-island-user-status",(function(){var e=l.store.getState().currentUser;console.log("User status debug informations: ",e)})),o.useEventListener("phone-island-all-users-status",(function(){var e=l.store.getState().users;console.log("Users status debug informations: ",e)})),o.useEventListener("phone-island-status",(function(){var e=l.store.getState().island;console.log("Phone island status debug informations: ",e)})),o.useEventListener("phone-island-webrtc-status",(function(){var e=l.store.getState().webrtc;console.log("Webrtc status debug informations: ",e)})),o.useEventListener("phone-island-player-status",(function(){var e=l.store.getState().player;console.log("Player status debug informations: ",e)})),o.useEventListener("phone-island-conference-status",(function(){var e=l.store.getState().conference;console.log("Webrtc status debug informations: ",e)})),o.useEventListener("phone-island-streaming-status",(function(){var e=l.store.getState().streaming;console.log("Streaming status debug informations: ",e)})),o.useEventListener("phone-island-paramurl-status",(function(){var e=l.store.getState().paramUrl;console.log("Paramurl status debug informations: ",e)})),o.useEventListener("phone-island-queue-status",(function(){var e=l.store.getState().queue;console.log("Queue status debug informations: ",e)})),o.useEventListener("phone-island-player-force-stop",(function(){l.store.dispatch.player.reset(),console.log("Audio player is interrupted")})),o.useEventListener("phone-island-stores-download",(function(){l.downloadStoresAsJSON(),c.eventDispatch("phone-island-stores-downloaded",{})})),o.useEventListener("phone-island-sideview-open",(function(){l.store.dispatch.island.toggleSideViewVisible(!0),l.store.dispatch.island.setUrlOpened(!1),c.eventDispatch("phone-island-sideview-opened",{})})),o.useEventListener("phone-island-sideview-close",(function(){l.store.dispatch.island.toggleSideViewVisible(!1),c.eventDispatch("phone-island-sideview-closed",{})})),o.useEventListener("phone-island-transcription-close",(function(){l.store.dispatch.island.toggleTranscriptionViewVisible(!1),(X.current||Y.current)&&(c.eventDispatch("phone-island-stop-transcription",{uniqueid:X.current,linkedid:Y.current}),X.current=null,Y.current=null),c.eventDispatch("phone-island-transcription-closed",{})})),o.useEventListener("phone-island-transcription-open",(function(e){var n=null==e?void 0:e.linkedid,t=null==e?void 0:e.uniqueid;(n||t)&&(Y.current=n||null,X.current=t||null,c.eventDispatch("phone-island-start-transcription",{linkedid:n,uniqueid:t}),l.store.dispatch.island.toggleTranscriptionViewVisible(!0),c.eventDispatch("phone-island-transcription-opened",{}))})),o.useEventListener("phone-island-init-audio",(function(){var e=l.store.getState().currentCall,n=e.accepted,t=e.incoming,i=e.outgoing,r=e.incomingWebRTC,s=e.incomingSocket;if(n||t||i||r||s)console.log("[AUDIO-WARMUP] Skipping audio warm-up: active call in progress");else if(x&&"string"==typeof x&&0!==x.length){var a=l.store.getState().currentUser.featureCodes,o=null==a?void 0:a.audio_test,c=o&&"string"==typeof o&&o.length>0?o:"*41";console.log("[AUDIO-WARMUP] Starting audio warm-up test call",{codeToCall:c,SIP_HOST:x}),y.callNumber(c,x)}else console.warn("[AUDIO-WARMUP] Skipping audio warm-up: SIP_HOST not available",{SIP_HOST:x})})),o.useEventListener("phone-island-transcription-toggle",(function(){var e=!l.store.getState().island.transcriptionViewIsVisible;l.store.dispatch.island.toggleTranscriptionViewVisible(e),c.eventDispatch(e?"phone-island-transcription-opened":"phone-island-transcription-closed",{})})),o.useEventListener("phone-island-summary-call-check",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i,r,s,a,o,c,u,p,v,h;return e.__generator(this,(function(e){switch(e.label){case 0:return t=(null==n?void 0:n.linkedid)||(null==n?void 0:n.linkedId),i=(null==n?void 0:n.uniqueid)||(null==n?void 0:n.uniqueId),t?i?(r=l.store.getState().conference,s=r.isActive,a=r.usersList,o=r.conferenceStartedFrom,c=l.store.getState().currentUser,u=c.name,p=c.username,v=s&&(o===p||!!a&&Object.values(a).some((function(e){return e.name===u}))),v?[2]:[4,new Promise((function(e){return setTimeout(e,1e3)}))]):(console.warn("[Summary Check] No unique identifier provided"),[2]):(console.warn("[Summary Check] No call identifier provided"),[2]);case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,Promise.resolve().then((function(){return require("./services/user.js")}))];case 3:return[4,(0,e.sent().checkSummaryCall)(i,t)];case 4:return e.sent(),d.dispatchSummaryReady({linkedid:t,uniqueid:i,source:"check"}),[3,6];case 5:return 204===(null==(h=e.sent())?void 0:h.status)?(console.log("[Summary Check] Summary not ready for ".concat(t)),d.dispatchSummaryNotReady({linkedid:t,uniqueid:i,source:"check"})):console.warn("[Summary Check] Non-blocking summary check failed:",h),[3,6];case 6:return[2]}}))}))})),o.useEventListener("phone-island-call-summary-notify",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i,r;return e.__generator(this,(function(e){switch(e.label){case 0:if(t=null==n?void 0:n.linkedid,i=null==n?void 0:n.uniqueid,!t)return console.warn("[Summary Notify] No call identifier provided"),[2];if(!i)return console.warn("[Summary Notify] No unique identifier provided"),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,Promise.resolve().then((function(){return require("./services/user.js")}))];case 2:return[4,(0,e.sent().watchSummaryCall)(t,i)];case 3:return e.sent(),c.eventDispatch("phone-island-summary-call-notified",{linkedid:t,uniqueid:i}),[3,5];case 4:return r=e.sent(),console.warn("[Summary Check] Non-blocking summary watch failed:",r),[3,5];case 5:return[2]}}))}))})),o.useEventListener("phone-island-size-change",(function(n){var t=l.store.getState().island,i=t.sideViewIsVisible,r=t.transcriptionViewIsVisible,s=t.actionsExpanded,a=n.sizeInformation,o=e.__assign(e.__assign({},a),{right:i?"42px":"0px",top:S.isBackCallActive()?"40px":"0px",bottomTranscription:r&&s?"335px":r&&!s?"330px":"0px"});c.eventDispatch("phone-island-size-changed",{sizes:o})})),o.useEventListener("phone-island-call-ended",(function(){if("online"===l.store.getState().currentUser.mainPresence){c.eventDispatch("phone-island-size-change",{sizeInformation:{width:"0px",height:"0px"}}),c.eventDispatch("phone-island-sideview-close",{}),l.store.dispatch.island.handleResetIslandStore(),l.store.dispatch.paramUrl.setThroughTrunk(!1)}})),o.useEventListener("phone-island-conference-list-open",(function(){l.store.dispatch.island.toggleConferenceList(!0),c.eventDispatch("phone-island-conference-list-opened",{})})),o.useEventListener("phone-island-alert-removed",(function(e){var n=l.store.getState().alerts.status.activeAlertsCount,t=l.store.getState().island,i=t.view,r=t.previousView,s=l.store.getState().conference.isActive,a=l.store.getState().alerts.data,o=l.store.getState().currentCall,u=o.incoming,d=o.outgoing,p=o.accepted,v=null==e?void 0:e.type,h=o.incoming||o.outgoing||o.accepted||""!==o.conversationId;if(!(u||d||p||n>0||"player"===i||"recorder"===i||"physicalPhoneRecorder"===i||"waitingConference"===i&&s||"transfer"===i&&s||"settings"===i&&s||"settings"===i&&("recorder"===r||"player"===r)||"operatorBusy"===i&&!s)&&0===n&&(!v||a[v]&&!a[v].active)&&!h){c.eventDispatch("phone-island-size-change",{sizeInformation:{width:"0px",height:"0px"}}),c.eventDispatch("phone-island-sideview-close",{}),l.store.dispatch.island.handleResetIslandStore()}})),o.useEventListener("phone-island-conference-list-close",(function(){l.store.dispatch.island.toggleConferenceList(!1),c.eventDispatch("phone-island-conference-list-closed",{})})),o.useEventListener("phone-island-conversations",(function(e){var n,t=Object.keys(e)[0];if(t===(null===(n=l.store.getState().currentUser)||void 0===n?void 0:n.username)){var i=e[t].conversations,r=l.store.getState().paramUrl,s=l.store.getState().island.urlOpened;if(!r.hasValidUrl||s)return;if("answered"===r.openParamUrlType&&i&&Object.keys(i).length>0){var a=i[Object.keys(i)[0]],o=l.store.getState().currentUser.default_device,c=!("desktop"===q&&"nethlink"===(null==o?void 0:o.type));if((null==a?void 0:a.connected)&&"in"===(null==a?void 0:a.direction)){var u=r.onlyQueues||!1,d=I.isFromTrunk(a.counterpartNum);l.store.dispatch.paramUrl.setThroughTrunk(d),!0===u&&!0===(null==a?void 0:a.throughQueue)?he(a.counterpartNum,a.counterpartName,a.owner,a.uniqueId,c):!1!==u||!0!==d&&!0!==(null==a?void 0:a.throughQueue)||he(a.counterpartNum,a.counterpartName,a.owner,a.uniqueId,c)}}}})),k.default.createElement(k.default.Fragment,null,k.default.createElement(E.default,{store:l.store},P&&""!==P.trim()?k.default.createElement(r.WebRTC,{hostName:R,sipExten:P,sipSecret:V,sipHost:x,sipPort:J,reload:W,reloadedCallback:function(){return H(!0)},uaType:q},k.default.createElement(a.RestAPI,{hostName:R,username:A,authToken:O},k.default.createElement(i.Socket,{hostName:R,username:A,authToken:O,reload:W,reloadedCallback:function(){return G(!0)},uaType:q},k.default.createElement(t.Events,{sipHost:x},k.default.createElement(s.Island,{showAlways:N,uaType:q}))))):k.default.createElement(a.RestAPI,{hostName:R,username:A,authToken:O},k.default.createElement(i.Socket,{hostName:R,username:A,authToken:O,reload:W,reloadedCallback:function(){G(!0),H(!0)},uaType:q},k.default.createElement(t.Events,{sipHost:x},k.default.createElement(s.Island,{showAlways:N,uaType:q}))))))}));L.displayName="PhoneIslandComponent";var U=n.forwardRef((function(n,t){return k.default.createElement(L,e.__assign({},n,{ref:t}))}));U.displayName="PhoneIsland",exports.PhoneIsland=U;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./node_modules/tslib/tslib.es6.js"),n=require("react"),t=require("./components/Events.js"),i=require("./components/Socket.js"),s=require("./components/WebRTC.js"),r=require("./components/Island.js"),a=require("./components/RestAPI.js"),o=require("./utils/customHooks/useEventListener.js"),c=require("./utils/genericFunctions/eventDispatch.js"),u=require("./utils/genericFunctions/localStorage.js"),l=require("./store/index.js"),d=require("./services/user.js");require("./node_modules/react-redux/es/index.js"),require("./node_modules/@fortawesome/react-fontawesome/index.es.js"),require("./node_modules/i18next/dist/esm/i18next.js"),require("./node_modules/react-tooltip/dist/react-tooltip.min.mjs.js"),require("./components/TranscriptionView/TranscriptionView.js");var p=require("./node_modules/js-base64/base64.mjs.js"),v=require("./workers/wake_up.js"),h=require("./lib/i18n.js"),f=require("./lib/webrtc/messages.js"),m=require("./lib/darkTheme.js"),g=require("./utils/genericFunctions/isEmpty.js"),w=require("./utils/genericFunctions/checkConnection.js"),b=require("./utils/genericFunctions/isBackCallVisible.js"),S=require("./lib/phone/trunk.js"),I=require("./lib/phone/call.js"),y=require("./node_modules/react-redux/es/components/Provider.js");function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),require("./node_modules/react-redux/node_modules/react-is/index.js"),require("./node_modules/react-redux/es/components/Context.js");var D=E(n);if("undefined"!=typeof window&&window.location.hostname.includes(".support.my.")){var k=window.fetch;window.fetch=function(n,t){return k(n,e.__assign({credentials:"include"},t))}}var _=n.forwardRef((function(E,k){var _=E.dataConfig,L=E.showAlways,U=void 0!==L&&L,C=E.uaType,T=E.urlParamWithEvent,j=void 0!==T&&T,q=p.Base64.atob(_||"").split(":"),N=q[0],A=q[1],O=q[2],R=q[3],P=q[4],V=q[5],x=q[6],J=n.useState(!1),W=J[0],F=J[1],M=n.useState(!1),Q=M[0],z=M[1],H=n.useState(!1),$=H[0],B=H[1],G=n.useRef(0),K=n.useRef(null);n.useImperativeHandle(k,(function(){return{reset:function(){console.info("PhoneIsland: Performing full component reset"),F(!0)}}}),[]),n.useEffect((function(){var e=Date.now(),n=function(){if(!document.hidden){var n=Date.now(),t=n-e;setTimeout((function(){c.eventDispatch("phone-island-emergency-stop-ringtone",{})}),2e3),t>3e5&&(console.info("Tab inactive for long period, performing soft reconnection"),F(!0)),e=n}},t=new Worker(v.default,{type:"module"});return t.onmessage=function(n){"ping"===n.data&&(e=Date.now())},document.addEventListener("visibilitychange",n),function(){t.terminate(),document.removeEventListener("visibilitychange",n)}}),[]),n.useEffect((function(){$&&Q&&(F(!1),z(!1),B(!1))}),[$,Q]),n.useEffect((function(){var e=setInterval((function(){var e,n,t,i,s=l.store.getState().alerts.data,r=(null===(e=s.webrtc_down)||void 0===e?void 0:e.active)||!1,a=(null===(n=s.socket_down)||void 0===n?void 0:n.active)||!1,o=Date.now(),c=o-G.current,u=l.store.getState().webrtc.sipcall,d=l.store.getState().currentCall,p=d.accepted,v=d.outgoing,h=null===(i=null===(t=null==u?void 0:u.webrtcStuff)||void 0===t?void 0:t.pc)||void 0===i?void 0:i.iceConnectionState,f=p||v||"connected"===h||"completed"===h,m=navigator.onLine;if((r||a)&&!W&&c>1e4&&m){if(f)return void console.info("Alert detected but active call in progress - skipping automatic reload to let ICE recover",{timeSinceLastReload:Math.round(c/1e3)+"s",isWebRTCDown:r,isSocketDown:a,iceState:h,accepted:p,outgoing:v});console.info("Alert detected (webrtc_down or socket_down), triggering automatic reload",{timeSinceLastReload:Math.round(c/1e3)+"s",isWebRTCDown:r,isSocketDown:a}),G.current=o,F(!0)}}),1e3);return function(){return clearInterval(e)}}),[W]),o.useEventListener("phone-island-expand",(function(){l.store.dispatch.island.toggleIsOpen(!0),c.eventDispatch("phone-island-expanded",{})})),o.useEventListener("phone-island-compress",(function(){l.store.dispatch.island.toggleIsOpen(!1),c.eventDispatch("phone-island-compressed",{})})),o.useEventListener("phone-island-call-keypad-close",(function(){l.store.dispatch.island.setIslandView("call"),c.eventDispatch("phone-island-call-keypad-closed",{})})),o.useEventListener("phone-island-call-transfer-close",(function(){l.store.dispatch.island.setIslandView("call"),c.eventDispatch("phone-island-call-transfer-closed",{})})),o.useEventListener("phone-island-recording-close",(function(){l.store.dispatch.island.setIslandView(null),c.eventDispatch("phone-island-recording-closed",{})})),o.useEventListener("phone-island-audio-player-close",(function(){l.store.dispatch.island.setIslandView(null),c.eventDispatch("phone-island-audio-player-closed",{})})),o.useEventListener("phone-island-emergency-stop-ringtone",(function(){null===l.store.getState().island.view?(console.warn("Emergency stop ringtone triggered - phone island inactive"),l.store.dispatch.player.emergencyStopAudioPlayer(),c.eventDispatch("phone-island-emergency-stop-ringtone-completed",{})):console.log("Phone island is active, ringtone stop ignored")})),o.useEventListener("phone-island-detach",(function(e){f.detach(),l.store.dispatch.webrtc.updateWebRTC({sipcall:null,registered:!1,isDetached:!0,jsepGlobal:null}),l.store.dispatch.webrtc.updateRemoteAudioStream(null),l.store.dispatch.webrtc.updateLocalAudioStream(null),l.store.dispatch.webrtc.updateLocalVideoStream(null),l.store.dispatch.webrtc.updateRemoteVideoStream(null),c.eventDispatch("phone-island-detached",{})})),o.useEventListener("phone-island-reload-component",(function(e){(null==e?void 0:e.force)&&l.store.dispatch.island.setForceReload(!0),F(!0)})),o.useEventListener("phone-island-audio-input-change",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return(t=n.deviceId)&&"default"!==t?[4,oe(t)]:[3,3];case 1:return e.sent()?[3,3]:(console.warn("Audio input device ".concat(t," not available, falling back to default device")),[4,ce()]);case 2:t=e.sent(),e.label=3;case 3:return u.setJSONItem("phone-island-audio-input-device",{deviceId:t}),c.eventDispatch("phone-island-audio-input-changed",{}),t!==n.deviceId&&console.info("Audio input device changed from ".concat(n.deviceId," to ").concat(t," (fallback)")),[2]}}))}))})),o.useEventListener("phone-island-video-input-change",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return(t=n.deviceId)&&"default"!==t?[4,ue(t)]:[3,3];case 1:return e.sent()?[3,3]:(console.warn("Video input device ".concat(t," not available, falling back to default device")),[4,le()]);case 2:t=e.sent(),e.label=3;case 3:return u.setJSONItem("phone-island-video-input-device",{deviceId:t}),c.eventDispatch("phone-island-video-input-changed",{}),t!==n.deviceId&&console.info("Video input device changed from ".concat(n.deviceId," to ").concat(t," (fallback)")),[2]}}))}))}));var X=n.useState(!0),Y=X[0],Z=X[1],ee=n.useState(!0),ne=ee[0],te=ee[1],ie=n.useState(!1),se=ie[0],re=ie[1],ae=n.useSyncExternalStore(l.store.subscribe,(function(){return l.store.getState().fetchDefaults.fetchReady||!1}));n.useEffect((function(){Y&&(h.initI18n(),Z(!1))}),[Y]),n.useEffect((function(){ae&&!se&&(re(!0),e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.getParamUrl()];case 1:return n=e.sent(),t=(null==n?void 0:n.url)||"",i=t&&""!==t.trim(),l.store.dispatch.paramUrl.setParamUrl({url:t,onlyQueues:(null==n?void 0:n.only_queues)||!1,hasValidUrl:i}),[3,3];case 2:return s=e.sent(),console.warn("Non-blocking param URL fetch failed:",s),l.store.dispatch.paramUrl.setParamUrl({url:"",onlyQueues:!1,hasValidUrl:!1}),[3,3];case 3:return[2]}}))})))}),[ae,se]);var oe=function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return t=e.sent(),[2,t.filter((function(e){return"audioinput"===e.kind})).some((function(e){return e.deviceId===n}))];case 2:return i=e.sent(),console.warn("Error checking audio input device availability:",i),[2,!1];case 3:return[2]}}))}))},ce=function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"audioinput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return s=e.sent(),console.warn("Error getting default audio input device:",s),[2,"default"];case 3:return[2]}}))}))},ue=function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return t=e.sent(),[2,t.filter((function(e){return"videoinput"===e.kind})).some((function(e){return e.deviceId===n}))];case 2:return i=e.sent(),console.warn("Error checking video input device availability:",i),[2,!1];case 3:return[2]}}))}))},le=function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"videoinput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return s=e.sent(),console.warn("Error getting default video input device:",s),[2,"default"];case 3:return[2]}}))}))};o.useEventListener("phone-island-audio-output-change",(function(n){e.__awaiter(void 0,void 0,void 0,(function(){var t,i,s,r,a,o,d,p,v;return e.__generator(this,(function(h){switch(h.label){case 0:return(null==(t=l.store.getState().player.remoteAudio)?void 0:t.current)?(i=n.deviceId)&&"default"!==i?[4,(f=i,e.__awaiter(void 0,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,!1];case 1:return[2,e.sent().filter((function(e){return"audiooutput"===e.kind})).some((function(e){return e.deviceId===f}))];case 2:return n=e.sent(),console.warn("Error checking device availability:",n),[2,!1];case 3:return[2]}}))})))]:[3,3]:(console.warn("Remote audio element not available"),[2]);case 1:return h.sent()?[3,3]:(console.warn("Audio output device ".concat(i," not available, falling back to default device")),[4,e.__awaiter(void 0,void 0,void 0,(function(){var n,t,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[2,"default"];case 1:return n=e.sent(),t=n.filter((function(e){return"audiooutput"===e.kind})),[2,(i=t.find((function(e){return"default"===e.deviceId||""===e.deviceId}))||t[0])?i.deviceId:"default"];case 2:return s=e.sent(),console.warn("Error getting default device:",s),[2,"default"];case 3:return[2]}}))}))]);case 2:i=h.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),h.label=3;case 3:return h.trys.push([3,5,,15]),[4,t.current.setSinkId(i)];case 4:return h.sent(),console.info("Default audio output device changed successfully!"),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,15];case 5:s=h.sent(),console.log("Direct setSinkId failed, trying with temporary stream:",s),h.label=6;case 6:return h.trys.push([6,7,,14]),r=new(window.AudioContext||window.webkitAudioContext),a=r.createOscillator(),o=r.createGain(),a.frequency.setValueAtTime(440,r.currentTime),o.gain.setValueAtTime(0,r.currentTime),a.connect(o),d=r.createMediaStreamDestination(),o.connect(d),t.current.srcObject=d.stream,a.start(),setTimeout((function(){return e.__awaiter(void 0,void 0,void 0,(function(){var n,s;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,t.current.setSinkId(i)];case 1:return e.sent(),console.info("Default audio output device changed successfully with temporary stream!"),a.stop(),r.close(),t.current.srcObject=null,u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,7];case 2:if(n=e.sent(),console.error("Final setSinkId attempt failed:",n),a.stop(),r.close(),t.current.srcObject=null,"default"===i)return[3,6];console.log("Trying fallback to default device"),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,t.current.setSinkId("default")];case 4:return e.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:"default"}),console.info("Fallback to default audio device successful"),[3,6];case 5:return s=e.sent(),console.error("Even default device failed:",s),[3,6];case 6:return u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),c.eventDispatch("phone-island-audio-output-changed",{}),[3,7];case 7:return[2]}}))}))}),100),[3,14];case 7:if(p=h.sent(),console.error("Failed to create temporary audio stream:",p),"default"===i)return[3,12];h.label=8;case 8:return h.trys.push([8,10,,11]),[4,t.current.setSinkId("default")];case 9:return h.sent(),u.setJSONItem("phone-island-audio-output-device",{deviceId:"default"}),console.info("Emergency fallback to default audio device successful"),[3,11];case 10:return v=h.sent(),console.error("Emergency fallback to default device failed:",v),u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),[3,11];case 11:return[3,13];case 12:u.setJSONItem("phone-island-audio-output-device",{deviceId:i}),h.label=13;case 13:return c.eventDispatch("phone-island-audio-output-changed",{}),[3,14];case 14:return[3,15];case 15:return[2]}var f}))}))})),o.useEventListener("phone-island-presence-change",(function(e){d.changeOperatorStatus(e),c.eventDispatch("phone-island-presence-changed",{})})),o.useEventListener("phone-island-view-changed",(function(e){var n=null==e?void 0:e.viewType;l.store.dispatch.island.setIslandView(n)}));var de=l.store.getState().player.remoteAudio;n.useEffect((function(){var e;if(ne&&de){var n=null===(e=u.getJSONItem("phone-island-audio-output-device"))||void 0===e?void 0:e.deviceId;c.eventDispatch("phone-island-audio-output-change",{deviceId:n}),te(!1)}}),[ne,de]),n.useEffect((function(){m.checkDarkTheme()}),[]),o.useEventListener("phone-island-theme-change",(function(e){m.setTheme(null==e?void 0:e.selectedTheme)})),o.useEventListener("phone-island-default-device-change",(function(e){l.store.dispatch.currentUser.updateCurrentDefaultDevice(null==e?void 0:e.deviceInformationObject),c.eventDispatch("phone-island-default-device-changed",{})})),o.useEventListener("phone-island-alert",(function(e){l.store.dispatch.alerts.setAlert(e.toString())})),o.useEventListener("phone-island-ringing-tone-list",(function(){var e=l.store.getState().ringtones.availableRingtones.map((function(e){return{name:e.name,displayName:e.displayName,base64Audio:e.base64Audio}}));c.eventDispatch("phone-island-ringing-tone-list-response",{ringtones:e})})),o.useEventListener("phone-island-ringing-tone-select",(function(e){(null==e?void 0:e.name)&&(u.setJSONItem("phone-island-selected-ringtone",{value:e.name}),l.store.dispatch.ringtones.setSelectedRingtone(e.name),c.eventDispatch("phone-island-ringing-tone-selected",{name:e.name}))})),o.useEventListener("phone-island-ringing-tone-output",(function(e){(null==e?void 0:e.deviceId)&&(u.setJSONItem("phone-island-ringtone-output-device",{value:e.deviceId}),l.store.dispatch.ringtones.setOutputDeviceId(e.deviceId),c.eventDispatch("phone-island-ringing-tone-output-changed",{deviceId:e.deviceId}))})),n.useEffect((function(){var e=u.getJSONItem("phone-island-selected-ringtone"),n=u.getJSONItem("phone-island-ringtone-output-device");(null==e?void 0:e.value)&&l.store.dispatch.ringtones.setSelectedRingtone(e.value),(null==n?void 0:n.value)&&l.store.dispatch.ringtones.setOutputDeviceId(n.value)}),[]),o.useEventListener("phone-island-check-connection",(function(){w.checkInternetConnection().then((function(e){e?c.eventDispatch("phone-island-internet-connected",{}):c.eventDispatch("phone-island-internet-disconnected",{})}))})),n.useEffect((function(){var e=setInterval((function(){w.checkInternetConnection().then((function(e){e?c.eventDispatch("phone-island-internet-connected",{}):c.eventDispatch("phone-island-internet-disconnected",{})}))}),5e3);return function(){return clearInterval(e)}}),[]),o.useEventListener("phone-island-main-presence",(function(e){var n,t,i,s,r=null===(n=l.store.getState().currentUser)||void 0===n?void 0:n.username,a=l.store.getState().currentUser,o=null==a?void 0:a.mainPresence;if(void 0!==r&&""!==r&&!g.isEmpty(e[r])&&void 0!==(null===(t=e[r])||void 0===t?void 0:t.mainPresence)){var u=null===(i=e[r])||void 0===i?void 0:i.mainPresence;l.store.dispatch.currentUser.updateMainPresence(null===(s=e[r])||void 0===s?void 0:s.mainPresence),"online"===u&&"online"!==o&&c.eventDispatch("phone-island-call-ended",{})}})),o.useEventListener("phone-island-call-status",(function(){var e=l.store.getState().currentCall;console.log("Call status debug informations: ",e)}));var pe=function(e,n,t,i,s){var r=l.store.getState().paramUrl;if(null==r?void 0:r.hasValidUrl){var a=r.url||"";if(a){var o=l.store.getState().island.urlOpened,u=r.openParamUrlType;if(!o||"button"===u){var d=a;d.includes("$CALLER_NUMBER")&&e&&(d=d.replace(/\$CALLER_NUMBER/g,encodeURIComponent(e))),d.includes("$CALLER_NAME")&&n&&(d=d.replace(/\$CALLER_NAME/g,encodeURIComponent(n))),d.includes("$UNIQUEID")&&i&&(d=d.replace(/\$UNIQUEID/g,encodeURIComponent(i))),d.includes("$CALLED")&&t&&(d=d.replace(/\$CALLED/g,encodeURIComponent(t))),d.includes("{phone}")&&e&&(d=d.replace(/\{phone\}/g,encodeURIComponent(e)));var p=d.startsWith("http")?d:"https://".concat(d);if("mobile"!==C&&!j&&s){var v=window.open("about:blank","_blank");v&&(v.location.href=p,l.store.dispatch.island.setUrlOpened(!0))}else c.eventDispatch("phone-island-url-parameter-opened-external",{formattedUrl:p})}}}};return o.useEventListener("phone-island-already-opened-external-page",(function(){l.store.dispatch.island.setUrlOpened(!0)})),o.useEventListener("phone-island-url-parameter-opened",(function(e){var n=l.store.getState().paramUrl;if(n.hasValidUrl&&!l.store.getState().island.urlOpened){var t=n.onlyQueues||!1,i=S.isFromTrunk(null==e?void 0:e.counterpartNum);l.store.dispatch.paramUrl.setThroughTrunk(i);var s=l.store.getState().currentUser.default_device,r=!("desktop"===C&&"nethlink"===(null==s?void 0:s.type));"in"===(null==e?void 0:e.direction)&&(!0===t&&!0===(null==e?void 0:e.throughQueue)?pe(null==e?void 0:e.counterpartNum,null==e?void 0:e.counterpartName,null==e?void 0:e.owner,null==e?void 0:e.linkedId,r):!1!==t||!0!==i&&!0!==(null==e?void 0:e.throughQueue)||pe(null==e?void 0:e.counterpartNum,null==e?void 0:e.counterpartName,null==e?void 0:e.owner,null==e?void 0:e.linkedId,r))}})),o.useEventListener("phone-island-user-status",(function(){var e=l.store.getState().currentUser;console.log("User status debug informations: ",e)})),o.useEventListener("phone-island-all-users-status",(function(){var e=l.store.getState().users;console.log("Users status debug informations: ",e)})),o.useEventListener("phone-island-status",(function(){var e=l.store.getState().island;console.log("Phone island status debug informations: ",e)})),o.useEventListener("phone-island-webrtc-status",(function(){var e=l.store.getState().webrtc;console.log("Webrtc status debug informations: ",e)})),o.useEventListener("phone-island-player-status",(function(){var e=l.store.getState().player;console.log("Player status debug informations: ",e)})),o.useEventListener("phone-island-conference-status",(function(){var e=l.store.getState().conference;console.log("Webrtc status debug informations: ",e)})),o.useEventListener("phone-island-streaming-status",(function(){var e=l.store.getState().streaming;console.log("Streaming status debug informations: ",e)})),o.useEventListener("phone-island-paramurl-status",(function(){var e=l.store.getState().paramUrl;console.log("Paramurl status debug informations: ",e)})),o.useEventListener("phone-island-queue-status",(function(){var e=l.store.getState().queue;console.log("Queue status debug informations: ",e)})),o.useEventListener("phone-island-player-force-stop",(function(){l.store.dispatch.player.reset(),console.log("Audio player is interrupted")})),o.useEventListener("phone-island-stores-download",(function(){l.downloadStoresAsJSON(),c.eventDispatch("phone-island-stores-downloaded",{})})),o.useEventListener("phone-island-sideview-open",(function(){l.store.dispatch.island.toggleSideViewVisible(!0),l.store.dispatch.island.setUrlOpened(!1),c.eventDispatch("phone-island-sideview-opened",{})})),o.useEventListener("phone-island-sideview-close",(function(){l.store.dispatch.island.toggleSideViewVisible(!1),c.eventDispatch("phone-island-sideview-closed",{})})),o.useEventListener("phone-island-transcription-close",(function(){l.store.dispatch.island.toggleTranscriptionViewVisible(!1),K.current&&(c.eventDispatch("phone-island-stop-transcription",{uniqueid:K.current,linkedid:K.current}),K.current=null),c.eventDispatch("phone-island-transcription-closed",{})})),o.useEventListener("phone-island-transcription-open",(function(e){var n=(null==e?void 0:e.linkedid)||(null==e?void 0:e.uniqueid)||null;n&&(K.current=n,c.eventDispatch("phone-island-start-transcription",{linkedid:n,uniqueid:n}),l.store.dispatch.island.toggleTranscriptionViewVisible(!0),c.eventDispatch("phone-island-transcription-opened",{}))})),o.useEventListener("phone-island-init-audio",(function(){var e=l.store.getState().currentCall,n=e.accepted,t=e.incoming,i=e.outgoing,s=e.incomingWebRTC,r=e.incomingSocket;if(n||t||i||s||r)console.log("[AUDIO-WARMUP] Skipping audio warm-up: active call in progress");else if(V&&"string"==typeof V&&0!==V.length){var a=l.store.getState().currentUser.featureCodes,o=null==a?void 0:a.audio_test,c=o&&"string"==typeof o&&o.length>0?o:"*41";console.log("[AUDIO-WARMUP] Starting audio warm-up test call",{codeToCall:c,SIP_HOST:V}),I.callNumber(c,V)}else console.warn("[AUDIO-WARMUP] Skipping audio warm-up: SIP_HOST not available",{SIP_HOST:V})})),o.useEventListener("phone-island-transcription-toggle",(function(){var e=!l.store.getState().island.transcriptionViewIsVisible;l.store.dispatch.island.toggleTranscriptionViewVisible(e),c.eventDispatch(e?"phone-island-transcription-opened":"phone-island-transcription-closed",{})})),o.useEventListener("phone-island-summary-call-check",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i,s,r,a,o,u,d,p,v;return e.__generator(this,(function(e){switch(e.label){case 0:return(t=(null==n?void 0:n.linkedid)||(null==n?void 0:n.uniqueid)||(null==n?void 0:n.uniqueId))?(i=l.store.getState().conference,s=i.isActive,r=i.usersList,a=i.conferenceStartedFrom,o=l.store.getState().currentUser,u=o.name,d=o.username,p=s&&(a===d||!!r&&Object.values(r).some((function(e){return e.name===u}))),p?[2]:[4,new Promise((function(e){return setTimeout(e,1e3)}))]):(console.warn("[Summary Check] No call identifier provided"),[2]);case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,Promise.resolve().then((function(){return require("./services/user.js")}))];case 3:return[4,(0,e.sent().checkSummaryCall)(t)];case 4:return e.sent(),c.eventDispatch("phone-island-summary-ready",{linkedid:t}),[3,6];case 5:return 204===(null==(v=e.sent())?void 0:v.status)?(console.log("[Summary Check] Summary not ready for ".concat(t)),c.eventDispatch("phone-island-summary-not-ready",{linkedid:t})):console.warn("[Summary Check] Non-blocking summary check failed:",v),[3,6];case 6:return[2]}}))}))})),o.useEventListener("phone-island-call-summary-notify",(function(n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,i;return e.__generator(this,(function(e){switch(e.label){case 0:if(!(t=(null==n?void 0:n.linkedid)||(null==n?void 0:n.uniqueid)||(null==n?void 0:n.uniqueId)))return[3,5];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,Promise.resolve().then((function(){return require("./services/user.js")}))];case 2:return[4,(0,e.sent().watchSummaryCall)(t)];case 3:return e.sent(),c.eventDispatch("phone-island-summary-call-notified",{linkedid:t}),[3,5];case 4:return i=e.sent(),console.warn("[Summary Check] Non-blocking summary watch failed:",i),[3,5];case 5:return[2]}}))}))})),o.useEventListener("phone-island-size-change",(function(n){var t=l.store.getState().island,i=t.sideViewIsVisible,s=t.transcriptionViewIsVisible,r=t.actionsExpanded,a=n.sizeInformation,o=e.__assign(e.__assign({},a),{right:i?"42px":"0px",top:b.isBackCallActive()?"40px":"0px",bottomTranscription:s&&r?"335px":s&&!r?"330px":"0px"});c.eventDispatch("phone-island-size-changed",{sizes:o})})),o.useEventListener("phone-island-call-ended",(function(){if("online"===l.store.getState().currentUser.mainPresence){c.eventDispatch("phone-island-size-change",{sizeInformation:{width:"0px",height:"0px"}}),c.eventDispatch("phone-island-sideview-close",{}),l.store.dispatch.island.handleResetIslandStore(),l.store.dispatch.paramUrl.setThroughTrunk(!1)}})),o.useEventListener("phone-island-conference-list-open",(function(){l.store.dispatch.island.toggleConferenceList(!0),c.eventDispatch("phone-island-conference-list-opened",{})})),o.useEventListener("phone-island-alert-removed",(function(e){var n=l.store.getState().alerts.status.activeAlertsCount,t=l.store.getState().island,i=t.view,s=t.previousView,r=l.store.getState().conference.isActive,a=l.store.getState().alerts.data,o=l.store.getState().currentCall,u=o.incoming,d=o.outgoing,p=o.accepted,v=null==e?void 0:e.type,h=o.incoming||o.outgoing||o.accepted||""!==o.conversationId;if(!(u||d||p||n>0||"player"===i||"recorder"===i||"physicalPhoneRecorder"===i||"waitingConference"===i&&r||"transfer"===i&&r||"settings"===i&&r||"settings"===i&&("recorder"===s||"player"===s)||"operatorBusy"===i&&!r)&&0===n&&(!v||a[v]&&!a[v].active)&&!h){c.eventDispatch("phone-island-size-change",{sizeInformation:{width:"0px",height:"0px"}}),c.eventDispatch("phone-island-sideview-close",{}),l.store.dispatch.island.handleResetIslandStore()}})),o.useEventListener("phone-island-conference-list-close",(function(){l.store.dispatch.island.toggleConferenceList(!1),c.eventDispatch("phone-island-conference-list-closed",{})})),o.useEventListener("phone-island-conversations",(function(e){var n,t=Object.keys(e)[0];if(t===(null===(n=l.store.getState().currentUser)||void 0===n?void 0:n.username)){var i=e[t].conversations,s=l.store.getState().paramUrl,r=l.store.getState().island.urlOpened;if(!s.hasValidUrl||r)return;if("answered"===s.openParamUrlType&&i&&Object.keys(i).length>0){var a=i[Object.keys(i)[0]],o=l.store.getState().currentUser.default_device,c=!("desktop"===C&&"nethlink"===(null==o?void 0:o.type));if((null==a?void 0:a.connected)&&"in"===(null==a?void 0:a.direction)){var u=s.onlyQueues||!1,d=S.isFromTrunk(a.counterpartNum);l.store.dispatch.paramUrl.setThroughTrunk(d),!0===u&&!0===(null==a?void 0:a.throughQueue)?pe(a.counterpartNum,a.counterpartName,a.owner,a.uniqueId,c):!1!==u||!0!==d&&!0!==(null==a?void 0:a.throughQueue)||pe(a.counterpartNum,a.counterpartName,a.owner,a.uniqueId,c)}}}})),D.default.createElement(D.default.Fragment,null,D.default.createElement(y.default,{store:l.store},R&&""!==R.trim()?D.default.createElement(s.WebRTC,{hostName:N,sipExten:R,sipSecret:P,sipHost:V,sipPort:x,reload:W,reloadedCallback:function(){return z(!0)},uaType:C},D.default.createElement(a.RestAPI,{hostName:N,username:A,authToken:O},D.default.createElement(i.Socket,{hostName:N,username:A,authToken:O,reload:W,reloadedCallback:function(){return B(!0)},uaType:C},D.default.createElement(t.Events,{sipHost:V},D.default.createElement(r.Island,{showAlways:U,uaType:C}))))):D.default.createElement(a.RestAPI,{hostName:N,username:A,authToken:O},D.default.createElement(i.Socket,{hostName:N,username:A,authToken:O,reload:W,reloadedCallback:function(){B(!0),z(!0)},uaType:C},D.default.createElement(t.Events,{sipHost:V},D.default.createElement(r.Island,{showAlways:U,uaType:C}))))))}));_.displayName="PhoneIslandComponent";var L=n.forwardRef((function(n,t){return D.default.createElement(_,e.__assign({},n,{ref:t}))}));L.displayName="PhoneIsland",exports.PhoneIsland=L;
|
|
2
2
|
//# sourceMappingURL=App.js.map
|