hanc-webrtc-widgets 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17352,11 +17352,13 @@ let Je = class extends gt {
|
|
|
17352
17352
|
);
|
|
17353
17353
|
break;
|
|
17354
17354
|
case "disconnected":
|
|
17355
|
-
case "error":
|
|
17356
17355
|
this.callStatus = "idle", this.dispatchEvent(
|
|
17357
17356
|
new Event("call-end", { bubbles: !0, composed: !0 })
|
|
17358
17357
|
);
|
|
17359
17358
|
break;
|
|
17359
|
+
case "error":
|
|
17360
|
+
this.callStatus = "idle";
|
|
17361
|
+
break;
|
|
17360
17362
|
}
|
|
17361
17363
|
}, this.toggleCall = async () => {
|
|
17362
17364
|
if (!this.agentId) return new Error("Agent ID is required to make a call.");
|
|
@@ -17612,11 +17614,13 @@ let we = class extends gt {
|
|
|
17612
17614
|
);
|
|
17613
17615
|
break;
|
|
17614
17616
|
case "disconnected":
|
|
17615
|
-
case "error":
|
|
17616
17617
|
this.callStatus = "idle", this.dispatchEvent(
|
|
17617
17618
|
new Event("call-end", { bubbles: !0, composed: !0 })
|
|
17618
17619
|
);
|
|
17619
17620
|
break;
|
|
17621
|
+
case "error":
|
|
17622
|
+
this.callStatus = "idle";
|
|
17623
|
+
break;
|
|
17620
17624
|
}
|
|
17621
17625
|
}, this.toggleCall = async () => {
|
|
17622
17626
|
if (!this.agentId) return new Error("Agent ID is required to make a call.");
|
|
@@ -275,7 +275,7 @@ a=extmap-allow-mixed`)!==-1){const r=s.sdp.split(`
|
|
|
275
275
|
/>
|
|
276
276
|
<line x1="22" x2="2" y1="2" y2="22" />
|
|
277
277
|
</svg>
|
|
278
|
-
`;var Fu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,wt=(n,e,t,i)=>{for(var s=i>1?void 0:i?ju(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&Fu(e,t,s),s};H.InlineCall=class extends ft{constructor(){super(...arguments),this.callManager=new ko,this.callStatus="idle",this.buttonStartText="Start Call with ai",this.buttonConnectingText="Connecting...",this.handleStatusChange=e=>{switch(e.detail){case"connecting":this.callStatus="connecting";break;case"connected":this.callStatus="connected",this.dispatchEvent(new Event("call-start",{bubbles:!0,composed:!0}));break;case"disconnected":
|
|
278
|
+
`;var Fu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,wt=(n,e,t,i)=>{for(var s=i>1?void 0:i?ju(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&Fu(e,t,s),s};H.InlineCall=class extends ft{constructor(){super(...arguments),this.callManager=new ko,this.callStatus="idle",this.buttonStartText="Start Call with ai",this.buttonConnectingText="Connecting...",this.handleStatusChange=e=>{switch(e.detail){case"connecting":this.callStatus="connecting";break;case"connected":this.callStatus="connected",this.dispatchEvent(new Event("call-start",{bubbles:!0,composed:!0}));break;case"disconnected":this.callStatus="idle",this.dispatchEvent(new Event("call-end",{bubbles:!0,composed:!0}));break;case"error":this.callStatus="idle";break}},this.toggleCall=async()=>{if(!this.agentId)return new Error("Agent ID is required to make a call.");this.callStatus==="idle"?(this.callStatus="connecting",await this.callManager.makeCall({agentId:this.agentId})):this.callManager.hangUp()}}connectedCallback(){super.connectedCallback(),this.voiceServiceUrl&&(this.callManager.serviceUrl=this.voiceServiceUrl),this.callManager.addEventListener("status-changed",this.handleStatusChange)}disconnectedCallback(){super.disconnectedCallback(),this.callManager.removeEventListener("status-changed",this.handleStatusChange),this.callManager.hangUp()}updated(e){super.updated(e),e.has("agentId")&&(this.callManager.hangUp(),this.callStatus="idle"),e.has("voiceServiceUrl")&&(this.callManager.serviceUrl=this.voiceServiceUrl)}get isActive(){return this.callStatus==="connected"}get buttonText(){switch(this.callStatus){case"connecting":return this.buttonConnectingText;default:return this.buttonStartText}}render(){return lt`
|
|
279
279
|
<div class="wrapper" part="wrapper">
|
|
280
280
|
<div class="filter-light" part="filter-light"></div>
|
|
281
281
|
<div class="filter-gradient" part="filter-gradient"></div>
|
|
@@ -454,7 +454,7 @@ a=extmap-allow-mixed`)!==-1){const r=s.sdp.split(`
|
|
|
454
454
|
width: 16px;
|
|
455
455
|
height: 16px;
|
|
456
456
|
}
|
|
457
|
-
`;var Vu=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Ye=(n,e,t,i)=>{for(var s=i>1?void 0:i?qu(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&Vu(e,t,s),s};H.FloatingCall=class extends ft{constructor(){super(...arguments),this.callManager=new ko,this.callStatus="idle",this.labelText="Need a help?",this.buttonStartText="Start Call with ai",this.buttonConnectingText="Connecting...",this.buttonEndText="End call",this.handleStatusChange=e=>{switch(e.detail){case"connecting":this.callStatus="connecting";break;case"connected":this.callStatus="connected",this.dispatchEvent(new Event("call-start",{bubbles:!0,composed:!0}));break;case"disconnected":
|
|
457
|
+
`;var Vu=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Ye=(n,e,t,i)=>{for(var s=i>1?void 0:i?qu(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&Vu(e,t,s),s};H.FloatingCall=class extends ft{constructor(){super(...arguments),this.callManager=new ko,this.callStatus="idle",this.labelText="Need a help?",this.buttonStartText="Start Call with ai",this.buttonConnectingText="Connecting...",this.buttonEndText="End call",this.handleStatusChange=e=>{switch(e.detail){case"connecting":this.callStatus="connecting";break;case"connected":this.callStatus="connected",this.dispatchEvent(new Event("call-start",{bubbles:!0,composed:!0}));break;case"disconnected":this.callStatus="idle",this.dispatchEvent(new Event("call-end",{bubbles:!0,composed:!0}));break;case"error":this.callStatus="idle";break}},this.toggleCall=async()=>{if(!this.agentId)return new Error("Agent ID is required to make a call.");this.callStatus==="idle"?(this.callStatus="connecting",await this.callManager.makeCall({agentId:this.agentId})):this.callManager.hangUp()}}connectedCallback(){super.connectedCallback(),this.voiceServiceUrl&&(this.callManager.serviceUrl=this.voiceServiceUrl),this.callManager.addEventListener("status-changed",this.handleStatusChange)}disconnectedCallback(){super.disconnectedCallback(),this.callManager.removeEventListener("status-changed",this.handleStatusChange),this.callManager.hangUp()}updated(e){super.updated(e),e.has("agentId")&&(this.callManager.hangUp(),this.callStatus="idle"),e.has("voiceServiceUrl")&&(this.callManager.serviceUrl=this.voiceServiceUrl)}get isActive(){return this.callStatus==="connected"}get buttonText(){switch(this.callStatus){case"connecting":return this.buttonConnectingText;case"connected":return this.buttonEndText;default:return this.buttonStartText}}render(){return lt`
|
|
458
458
|
<div class="root" part="root">
|
|
459
459
|
<div class="avatar-wrapper" part="avatar-wrapper">
|
|
460
460
|
<div class="filter-light" part="filter-light"></div>
|