@cometchat/calls-sdk-react-native 5.0.4 → 5.0.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/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./polyfills";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(e,M,P,F)=>{if(M&&typeof M==`object`||typeof M==`function`)for(var I=__getOwnPropNames(M),L=0,R=I.length,z;L<R;L++)z=I[L],!__hasOwnProp.call(e,z)&&z!==P&&__defProp(e,z,{get:(e=>M[e]).bind(null,z),enumerable:!(F=__getOwnPropDesc(M,z))||F.enumerable});return e},__toESM=(A,j,N)=>(N=A==null?{}:__create(__getProtoOf(A)),__copyProps(j||!A||!A.__esModule?__defProp(N,`default`,{value:A,enumerable:!0}):N,A));let valibot=require(`valibot`);valibot=__toESM(valibot);let zustand=require(`zustand`),zustand_middleware=require(`zustand/middleware`),zustand_shallow=require(`zustand/shallow`),react=require(`react`);react=__toESM(react);let __cometchat_calls_lib_webrtc=require(`@cometchat/calls-lib-webrtc`);__cometchat_calls_lib_webrtc=__toESM(__cometchat_calls_lib_webrtc);let __react_native_async_storage_async_storage=require(`@react-native-async-storage/async-storage`);__react_native_async_storage_async_storage=__toESM(__react_native_async_storage_async_storage);let react_native=require(`react-native`),react_native_webrtc=require(`react-native-webrtc`),react_jsx_runtime=require(`react/jsx-runtime`),react_native_svg=require(`react-native-svg`);react_native_svg=__toESM(react_native_svg);var EventBus=class{actionListenersMap;emittingEvents=!1;constructor(){this.actionListenersMap=new Map}startEmitting(){this.emittingEvents=!0}stopEmitting(){this.emittingEvents=!1}publish(e,k=!1){let A=e.type.startsWith(`internal.`);if(!this.emittingEvents&&!k&&!A)return;let j=this.actionListenersMap.get(e.type);if(j)for(let k of j)typeof k==`function`&&(`payload`in e?k(e.payload):k())}subscribe(e,k,A){if(A?.signal?.aborted)return()=>{};this.actionListenersMap.get(e)||this.actionListenersMap.set(e,[]),this.actionListenersMap.get(e)?.push(k);let j=()=>{let A=this.actionListenersMap.get(e);A&&this.actionListenersMap.set(e,A.filter(e=>e!==k))};return A?.signal&&A.signal.addEventListener(`abort`,j,{once:!0}),j}};const eventBus=new EventBus,MIN_ASPECT_RATIO=3/4,MAX_ASPECT_RATIO=16/9,GRID_GAP=8,MIN_TILE_WIDTH=240,PARTICIPANT_ROLE={MODERATOR:`moderator`,NONE:`none`},MEDIA_TYPE={AUDIO:`audio`,VIDEO:`video`,SCREENSHARE:`screenshare`},LAYOUT={TILE:`TILE`,SIDEBAR:`SIDEBAR`,SPOTLIGHT:`SPOTLIGHT`},SESSION_TYPE={VOICE:`VOICE`,VIDEO:`VIDEO`},CAMERA_FACING={FRONT:`FRONT`,REAR:`REAR`},CAMERA_FACING_INTERNAL={USER:`user`,ENVIRONMENT:`environment`},VIDEO_PAUSE_AUTHORITY={USER:1,BACKGROUND:2,SCREEN_SHARE:4},CONFERENCE_COMMANDS={userInfo:`user-info`,initialConfig:`initial_config`},VIDEO_QUALITY_LEVELS={ULTRA:2160,HIGH:720,STANDARD:360,LOW:180,NONE:0},SDK_PLATFORM={WEB:`web`,ANDROID:`android`,IOS:`ios`,REACT_NATIVE_ANDROID:`react-native-android`,REACT_NATIVE_IOS:`react-native-ios`},EVENT_LISTENER_METHODS={SessionStatusListener:{onSessionJoined:`onSessionJoined`,onSessionLeft:`onSessionLeft`,onConnectionLost:`onConnectionLost`,onConnectionRestored:`onConnectionRestored`,onRemoteConnectionLost:`onRemoteConnectionLost`,onRemoteConnectionRestored:`onRemoteConnectionRestored`,onConnectionClosed:`onConnectionClosed`,onConnectionFailed:`onConnectionFailed`,onSessionTimedOut:`onSessionTimedOut`},MediaEventsListener:{onAudioMuted:`onAudioMuted`,onAudioUnMuted:`onAudioUnMuted`,onVideoPaused:`onVideoPaused`,onVideoResumed:`onVideoResumed`,onRecordingStarted:`onRecordingStarted`,onRecordingStopped:`onRecordingStopped`,onStreamingStarted:`onStreamingStarted`,onStreamingStopped:`onStreamingStopped`,onScreenShareStarted:`onScreenShareStarted`,onScreenShareStopped:`onScreenShareStopped`},ParticipantEventsListner:{onParticipantJoined:`onParticipantJoined`,onParticipantLeft:`onParticipantLeft`,onParticipantAudioMuted:`onParticipantAudioMuted`,onParticipantAudioUnmuted:`onParticipantAudioUnmuted`,onParticipantVideoPaused:`onParticipantVideoPaused`,onParticipantVideoResumed:`onParticipantVideoResumed`,onParticipantHandRaised:`onParticipantHandRaised`,onParticipantHandLowered:`onParticipantHandLowered`,onParticipantStartedScreenShare:`onParticipantStartedScreenShare`,onParticipantStoppedScreenShare:`onParticipantStoppedScreenShare`,onParticipantStartedRecording:`onParticipantStartedRecording`,onParticipantStoppedRecording:`onParticipantStoppedRecording`,onParticipantStartedStreaming:`onParticipantStartedStreaming`,onParticipantStoppedStreaming:`onParticipantStoppedStreaming`,onDominantSpeakerChanged:`onDominantSpeakerChanged`,onParticipantListChanged:`onParticipantListChanged`},ButtonClickListener:{onLeaveSessionButtonClicked:`onLeaveSessionButtonClicked`,onRaiseHandButtonClicked:`onRaiseHandButtonClicked`,onShareInviteButtonClicked:`onShareInviteButtonClicked`,onChangeLayoutButtonClicked:`onChangeLayoutButtonClicked`,onParticipantListButtonClicked:`onParticipantListButtonClicked`,onToggleAudioButtonClicked:`onToggleAudioButtonClicked`,onToggleVideoButtonClicked:`onToggleVideoButtonClicked`,onRecordingToggleButtonClicked:`onRecordingToggleButtonClicked`,onScreenShareButtonClicked:`onScreenShareButtonClicked`,onChatButtonClicked:`onChatButtonClicked`},CallLayoutListener:{onCallLayoutChanged:`onCallLayoutChanged`,onParticipantListVisible:`onParticipantListVisible`,onParticipantListHidden:`onParticipantListHidden`}},EVENT_LISTENER_METHODS_WEB={...EVENT_LISTENER_METHODS,MediaEventsListener:{...EVENT_LISTENER_METHODS.MediaEventsListener,onAudioInputDeviceChanged:`onAudioInputDeviceChanged`,onVideoInputDeviceChanged:`onVideoInputDeviceChanged`,onAudioOutputDeviceChanged:`onAudioOutputDeviceChanged`,onAudioInputDevicesChanged:`onAudioInputDevicesChanged`,onVideoInputDevicesChanged:`onVideoInputDevicesChanged`,onAudioOutputDevicesChanged:`onAudioOutputDevicesChanged`}},EVENT_LISTENER_METHODS_MOBILE={...EVENT_LISTENER_METHODS,MediaEventsListener:{...EVENT_LISTENER_METHODS.MediaEventsListener,onAudioModeChanged:`onAudioModeChanged`,onAudioModesChanged:`onAudioModesChanged`,onCameraFacingChanged:`onCameraFacingChanged`},ButtonClickListener:{...EVENT_LISTENER_METHODS.ButtonClickListener,onSwitchCameraButtonClicked:`onSwitchCameraButtonClicked`},CallLayoutListener:{...EVENT_LISTENER_METHODS.CallLayoutListener,onPictureInPictureLayoutEnabled:`onPictureInPictureLayoutEnabled`,onPictureInPictureLayoutDisabled:`onPictureInPictureLayoutDisabled`}},INTERNAL_EVENTS={connectionWillClose:`internal.sessionWillClose`,onConnectionEstablished:`internal.onConnectionEstablished`,onSessionJoined:`internal.onSessionJoined`,notification:`internal.notification`,queryPermission:`internal.queryPermission`,lifecycle:{componentDidMount:`internal.componentDidMount`,componentWillUnmount:`internal.componentWillUnmount`,SDKInitialized:`internal.SDKInitialized`}};function calculateTileLayout(e,k,A){if(e<=0||k<=0||A<=0)throw Error(`Container dimensions and number of tiles must be positive`);let j=e*k/A;if(57600*MIN_ASPECT_RATIO,j<43200){let j=Math.max(2,Math.floor(e/240)),M=Math.ceil(A/j),N=(e-j*8)/j;return{rows:M,columns:j,tileWidth:N,tileHeight:N*MIN_ASPECT_RATIO,paddingVertical:0,allocatedWidth:e,allocatedHeight:k}}let M=Math.sqrt(A),N=Math.floor(M),P=Math.ceil(A/N),F=getCalculatedAspectRatio(e,k,P,N);if(F<MIN_ASPECT_RATIO)for(;F<MIN_ASPECT_RATIO&&P>1;)P--,N=Math.ceil(A/P),F=getCalculatedAspectRatio(e,k,P,N);else for(;F>MAX_ASPECT_RATIO&&P<A;)P++,N=Math.ceil(A/P),F=getCalculatedAspectRatio(e,k,P,N);Math.ceil(A/(P-1))===N&&P--;let I=P*8,L=N*8,R=(e-I)/P,z=(k-L)/N,B=0,V=R/z;V<9/16?(B=(z-R*MAX_ASPECT_RATIO)*N/2,z=R*MAX_ASPECT_RATIO):V>MAX_ASPECT_RATIO&&(R=z*MAX_ASPECT_RATIO);let H=R*P+I,U=z*N+L;return{rows:N,columns:P,tileWidth:R,tileHeight:z,paddingVertical:B,allocatedWidth:H,allocatedHeight:U}}function getCalculatedAspectRatio(e,k,A,j){let M=A*8,N=j*8;return(e-M)/A/((k-N)/j)}const getAvatarTextInitials=e=>e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2),miliSecondsToMMSS=e=>{let k=Math.floor(e/1e3),A=Math.floor(k/3600),j=Math.floor(k%3600/60),M=k%60,N=j.toString().padStart(2,`0`),P=M.toString().padStart(2,`0`);return A>0?`${A.toString().padStart(2,`0`)}:${N}:${P}`:`${N}:${P}`};function getHueFromName(e){let k=0;for(let A=0;A<e.length;A++)k=e.charCodeAt(A)+((k<<5)-k);return Math.abs(k)%360}function hsvToRgb(e,k,A){k/=100,A/=100;let j=A*k,M=j*(1-Math.abs(e/60%2-1)),N=A-j,P=0,F=0,I=0;return e>=0&&e<60?[P,F,I]=[j,M,0]:e>=60&&e<120?[P,F,I]=[M,j,0]:e>=120&&e<180?[P,F,I]=[0,j,M]:e>=180&&e<240?[P,F,I]=[0,M,j]:e>=240&&e<300?[P,F,I]=[M,0,j]:e>=300&&e<360&&([P,F,I]=[j,0,M]),`rgb(${Math.round((P+N)*255)}, ${Math.round((F+N)*255)}, ${Math.round((I+N)*255)})`}function getColorFromName(e){return hsvToRgb(getHueFromName(e),45,35)}function safeParseJson(e){try{return JSON.parse(e)}catch{return null}}const getMediaType=e=>e.getType()===`audio`?MEDIA_TYPE.AUDIO:e.getVideoType()===`desktop`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO;function differenceBy(e,k,A){let j=new Set(k.map(A));return e.filter(e=>!j.has(A(e)))}function sleep(e=1e3){return new Promise(k=>setTimeout(k,e))}function isArrayOfObjEqual(e,k){if(e.length!==k.length)return!1;for(let A=0;A<e.length;A++)if(!(0,zustand_shallow.shallow)(e[A],k[A]))return!1;return!0}function isDeviceEqual(e,k){return e?.deviceId===k?.deviceId&&e?.label===k?.label}function getDefaultDevice(e){return e.find(e=>e.deviceId===`default`)||e[0]}function waitForStoreState(e,k,A=5e3){return new Promise((j,M)=>{if(k(e.getState())){j();return}let N=setTimeout(()=>{P(),M(Error(`waitForStoreState timed out`))},A),P=e.subscribe(e=>{k(e)&&(clearTimeout(N),P(),j())})})}const FATAL_ERRORS=[`connection.droppedError`,`connection.otherError`,`connection.serverError`];function isFatalConnectionError(e){return FATAL_ERRORS.includes(e.name)}async function tryCatch(e,k){try{return{data:k==null?await e:await Promise.race([e,new Promise((e,A)=>setTimeout(()=>A(Error(`timeout`)),k))]),error:null}}catch(e){return{data:null,error:e}}}function tryCatchSync(e){try{return{data:e(),error:null}}catch(e){return{data:null,error:e}}}function debounce(e,k){let A=null;return(...j)=>{A&&clearTimeout(A),A=setTimeout(()=>{tryCatchSync(()=>e(...j))},k)}}var SessionMethodsCore=class{static muteAudio(e=!0){e?muteAudioTrack():unMuteAudioTrack()}static unmuteAudio(){unMuteAudioTrack()}static toggleAudio(){toggleAudioTrack()}static pauseVideo(e=!0){e?pauseVideoTrack():resumeVideoTrack()}static resumeVideo(){resumeVideoTrack()}static toggleVideo(){toggleVideoTrack()}static leaveSession(){leaveSession()}static endSessionForAll(){leaveSession({shouldEndSession:!0})}static raiseHand(){raisedHandLocal()}static lowerHand(){lowerHandLocal()}static toggleHand(){toggleRaiseHand()}static switchCamera(){switchCamera()}static setLayout(e){setLayout(e)}static startStreaming(e,k){startStreaming(e,k)}static stopStreaming(){stopStreaming()}static startRecording(){startRecording()}static stopRecording(){stopRecording()}static toggleRecording(){toggleRecording()}static pinParticipant(e,k){pinParticipant(e,k)}static unpinParticipant(){unpinParticipant()}static muteParticipant(e){muteParticipant(e)}static pauseParticipantVideo(e){pauseParticipantVideo(e)}static setChatButtonUnreadCount(e){setChatButtonUnreadCount(e)}static toggleParticipantList(){toggleParticipantList()}static showParticipantList(){showParticipantList()}static hideParticipantList(){hideParticipantList()}static switchToVideoCall(){}static endSession(){this.leaveSession()}static getCallDetails(e,k){throw Error(`This method is deprecated and not supported.`)}};function getRealDeviceId(e,k){if(e!==`default`)return e;let A=k===`audio`?useBaseStore.getState().audioInputDevices:useBaseStore.getState().videoInputDevices,j=A.find(e=>e.deviceId===`default`);return j?A.find(e=>e.deviceId!==`default`&&e.groupId===j.groupId)?.deviceId??e:e}async function createLocalTrackF(e,k=null,A=null,j={}){if(useConfigStore.getState().iAmRecorder)return;let{data:M,error:N}=await tryCatch(__cometchat_calls_lib_webrtc.default.createLocalTracks({devices:[e],cameraDeviceId:k,micDeviceId:k,timeout:A,...j}));if(N)throw N;return M[0]}async function createLocalTrack(e,k=null,A=CAMERA_FACING_INTERNAL.USER){let j=useBaseStore.getState().isMobile()?null:k,{data:M,error:N}=await tryCatch(createLocalTrackF(e,getRealDeviceId(j,e),null,{facingMode:A}));M?(j===`default`&&(M._realDeviceId=M.deviceId=`default`),onTrack(M)):(e===`video`?pauseVideoTrack():e===`audio`&&muteAudioTrack(),N instanceof Error&&N.name===`gum.permission_denied`&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for ${e} track. Please allow access to your device.`}}))}function createLocalTracks(){if(useConfigStore.getState().enableCompanionMode||createLocalTrack(`audio`,useConfigStore.getState().audioInputDeviceId??useBaseStore.getState().audioInputDevice?.deviceId),useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO){let e=useConfigStore.getState().videoInputDeviceId,k=useBaseStore.getState().videoInputDevice?.deviceId,A=useConfigStore.getState().initialCameraFacing,j=useBaseStore.getState().cameraFacing;e?createLocalTrack(`video`,e):A?createLocalTrack(`video`,null,j):createLocalTrack(`video`,k,j)}}function updateAudioInputDevice(e){useBaseStore.getState().audioInputDevices.filter(e=>e.deviceId!==``).length>0&&createLocalTrack(`audio`,e)}function updateAudioInputDeviceState(e,k=!1){useBaseStore.getState().isMobileSDK()||e&&useBaseStore.setState({audioInputDevice:{...e.toJSON(),skipSubscribe:k}})}async function updateVideoInputDevice(e,k){if(useBaseStore.getState().videoInputDevices.filter(e=>e.deviceId!==``).length>0)createLocalTrack(`video`,e,k);else if(e===null){let A=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;if(A){await A.dispose();let e=useConferenceStore.getState().conference;e&&e.replaceTrack(A,null)}createLocalTrack(`video`,e,k)}}function updateVideoInputDeviceState(e,k=!1){if(!useBaseStore.getState().isMobileSDK()&&e){let A=e.toJSON?e.toJSON():e;useBaseStore.setState({videoInputDevice:{...A,skipSubscribe:k}})}}function updateAudioOutputDevice(e){__cometchat_calls_lib_webrtc.default.mediaDevices.isDeviceChangeAvailable(`output`)&&__cometchat_calls_lib_webrtc.default.mediaDevices.setAudioOutputDevice(e).then(()=>{let k=useBaseStore.getState().audioOutputDevices.find(k=>k.deviceId===e);k&&useBaseStore.setState({audioOutputDevice:k})})}const MaxBitratesVideoSchema=valibot.object({low:valibot.optional(valibot.number()),standard:valibot.optional(valibot.number()),high:valibot.optional(valibot.number()),fullHd:valibot.optional(valibot.number()),ultraHd:valibot.optional(valibot.number()),ssHigh:valibot.optional(valibot.number())}),CodecConfigSchema=valibot.object({maxBitratesVideo:valibot.optional(MaxBitratesVideoSchema),scalabilityModeEnabled:valibot.optional(valibot.boolean()),useSimulcast:valibot.optional(valibot.boolean()),useKSVC:valibot.optional(valibot.boolean())}),VideoQualitySchema=valibot.object({codecPreferenceOrder:valibot.optional(valibot.array(valibot.string())),screenshareCodec:valibot.optional(valibot.string()),mobileScreenshareCodec:valibot.optional(valibot.string()),enableAdaptiveMode:valibot.optional(valibot.boolean()),av1:valibot.optional(CodecConfigSchema),h264:valibot.optional(CodecConfigSchema),vp8:valibot.optional(CodecConfigSchema),vp9:valibot.optional(CodecConfigSchema),minHeightForQualityLvl:valibot.optional(valibot.record(valibot.string(),valibot.string())),mobileCodecPreferenceOrder:valibot.optional(valibot.array(valibot.string()))}),UserSchema=valibot.object({uid:valibot.string(),name:valibot.string(),avatar:valibot.optional(valibot.string()),status:valibot.optional(valibot.string()),role:valibot.optional(valibot.string()),lastActiveAt:valibot.optional(valibot.number())}),SettingsSchema=valibot.object({WEBRTC_HOST:valibot.optional(valibot.string()),ANALYTICS_HOST:valibot.optional(valibot.string()),ANALYTICS_VERSION:valibot.optional(valibot.string()),PRESENTER_MODE_ENABLED:valibot.optional(valibot.boolean()),connectionConfig:valibot.object({audioQuality:valibot.optional(valibot.object({stereo:valibot.optional(valibot.boolean())})),bridgeChannel:valibot.optional(valibot.object({preferSctp:valibot.optional(valibot.boolean())})),constraints:valibot.optional(valibot.object({video:valibot.optional(valibot.object({height:valibot.optional(valibot.object({ideal:valibot.optional(valibot.number()),max:valibot.optional(valibot.number()),min:valibot.optional(valibot.number())})),width:valibot.optional(valibot.object({ideal:valibot.optional(valibot.number()),max:valibot.optional(valibot.number()),min:valibot.optional(valibot.number())}))}))})),e2ee:valibot.optional(valibot.array(valibot.unknown())),e2eping:valibot.optional(valibot.object({enabled:valibot.optional(valibot.boolean())})),flags:valibot.optional(valibot.object({receiveMultipleVideoStreams:valibot.optional(valibot.boolean()),sendMultipleVideoStreams:valibot.optional(valibot.boolean()),sourceNameSignaling:valibot.optional(valibot.boolean()),ssrcRewritingEnabled:valibot.optional(valibot.boolean())})),hosts:valibot.object({domain:valibot.optional(valibot.string()),muc:valibot.optional(valibot.string())}),hiddenDomain:valibot.optional(valibot.string()),bosh:valibot.optional(valibot.string()),websocket:valibot.optional(valibot.string()),serviceUrl:valibot.string(),p2p:valibot.object({enabled:valibot.boolean()}),resolution:valibot.optional(valibot.number()),videoQuality:valibot.optional(VideoQualitySchema),pcStatsInterval:valibot.optional(valibot.number())})}),InternalSettingSchema=valibot.object({callToken:valibot.string(),settings:SettingsSchema,sessionId:valibot.string(),user:UserSchema}),ParticipantSchema=valibot.object({pid:valibot.string(),name:valibot.string(),uid:valibot.string(),avatar:valibot.optional(valibot.string())});function sendParticipantEvent(e,k){let A=useParticipantStore.getState().getParticipantById(k);if(A){let k=valibot.safeParse(ParticipantSchema,A);k.success&&eventBus.publish({type:e,payload:k.output})}}function sendParticipantListChangedEvent(){let e=useParticipantStore.getState().participants,k=valibot.safeParse(valibot.array(ParticipantSchema),e);k.success&&eventBus.publish({type:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantListChanged,payload:k.output})}var en_US_default={header:{layouts:{tileView:`Tile View`,sideLayout:`Side Layout`,spotlight:`Spotlight`}},controlPanel:{audioControl:{muteMicrophone:`Mute microphone`,unmuteMicrophone:`Unmute microphone`,audioDeviceOptions:`Audio device options`,audioSettings:`Audio settings`},videoControl:{turnOffCamera:`Turn off camera`,turnOnCamera:`Turn on camera`,videoDeviceOptions:`Video device options`,videoSettings:`Video settings`},settingsDialog:{todo:`// TODO: Revisit this section`,title:`Settings`,tabs:{audio:`Audio`,video:`Video`},deviceLabels:{microphone:`Microphone`,speaker:`Speaker`,camera:`Camera`,frameRate:`Desktop sharing frame rate`},deviceStates:{noMicrophoneSelected:`No microphone selected`,noSpeakerSelected:`No speaker selected`,noCameraSelected:`No camera selected`},audioSettings:{enableNoiseReduction:`Enable noise reduction`},videoSettings:{mirrorMyVideo:`Mirror my video`,selectCameraToSeePreview:`Select a camera to see preview`,loadingCameraPreview:`Loading camera preview...`,frameRateUnit:`frames per second`,frameRateNotice:`You need to restart the screen share for the new settings to take effect.`},permissions:{errorTitle:`Some permissions are missing`,microphoneBlocked:`Access to your microphone is blocked. Please check your browser settings.`,cameraBlocked:`Access to your camera is blocked. Please check your browser settings.`,microphoneAndCameraBlocked:`Access to your microphone and camera is blocked. Please check your browser settings.`},buttons:{cancel:`Cancel`,done:`Done`}},recording:{startRecording:`Start recording`,stopRecording:`Stop recording`,startRecordingConfirmation:`Recording will capture video, audio, and screen sharing from this call.`,stopRecordingConfirmation:`Stopping will end the recording of video, audio, and screen sharing from this call.`,cancel:`Cancel`},streaming:{startStreaming:`Start streaming`,stopStreaming:`Stop streaming`,startStreamingConfirmation:`Enter the RTMP stream URL and stream key to start live streaming.`,stopStreamingConfirmation:`Are you sure you want to stop the live stream?`,streamUrlPlaceholder:`Enter stream URL`,streamKeyPlaceholder:`Enter stream key (optional)`,cancel:`Cancel`},raiseHand:`Raise hand`,lowerHand:`Lower hand`,startScreenSharing:`Start screen sharing`,stopScreenSharing:`Stop screen sharing`,moreOptions:`More options`,leaveSession:`Leave session`,reactions:`Reactions`},idealTimeout:{title:`Are you still there?`,subtitle:`You are the only one here, so this call will end in less than {minutes} minute{plural}. Do you want to stay in this call?`,buttons:{stayInCall:`Stay in the call`,leaveNow:`Leave now`}},participantList:{header:{title:`Participants`,closeButton:`Close participants list`},search:{placeholder:`Search Participant`},emptyState:{title:`No participants found`,subtitle:`No participants match your search`}},virtualBackground:{title:`Virtual Background`,addBackground:`Add Background`,noCameraFeed:`No camera feed detected`,buttons:{cancel:`Cancel`,done:`Done`}},indicators:{recording:{label:`REC`,tooltip:`This session is being recorded`},streaming:{label:`LIVE`,tooltip:`This session is being streamed`}},notifications:{recordingStarted:`The session is being recorded`,recordingStopped:`Recording has been stopped`,streamingStarted:`Live streaming has started`,streamingStopped:`Live streaming has stopped`},general:{error:`Something went wrong, please try again.`},other:{}};const initialState$8={translations:{"en-US":en_US_default},currentLocale:`en-US`},useTranslationStore=(0,zustand.create)((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$8,e=>({reset:()=>e(initialState$8),setLocale:k=>e(()=>({currentLocale:k}))}))));function get(e,k){let A=k.split(`.`),j=e;for(let e of A){if(typeof j!=`object`||!j)return``;j=j[e]}return j}function translate(e){let{translations:k,currentLocale:A}=useTranslationStore.getState();return get(k,`${A}.${e}`)}const useTranslation=()=>{let{translations:e,currentLocale:k}=useTranslationStore();return{t:A=>get(e,`${k}.${A}`),currentLocale:k,translations:e}},initialState$7={sessionType:`VIDEO`,autoStartRecording:!1,layout:LAYOUT.TILE,hideRecordingButton:!0,hideStreamingButton:!0,hideVirtualBackgroundButton:!1,hideAudioModeButton:!1,hideSwitchCameraButton:!1,devSessionId:`dev-session`,iAmRecorder:!1,hideControlPanel:!1,hideHeaderPanel:!1,hideRaiseHandButton:!1,hideShareInviteButton:!0,hideChangeLayoutButton:!1,hideLeaveSessionButton:!1,hideToggleAudioButton:!1,hideParticipantListButton:!1,hideChatButton:!0,hideToggleVideoButton:!1,hideScreenSharingButton:!1,hideSessionTimer:!1,hideNetworkIndicator:!0,hideRecordingStatusIndicator:!1,hideStreamingStatusIndicator:!1,enableParticipantContextMenu:!0,displayName:``,startAudioMuted:!1,startVideoPaused:!1,title:``,enableNoiseReduction:!1,unstable_headlessMode:!1,idleTimeoutPeriodBeforePrompt:6e4,idleTimeoutPeriodAfterPrompt:18e4,enableSpotlightDrag:!0,enableSpotlightSwap:!0,enableIOSPictureInPicture:!1,showFrameRate:!1,enableCompanionMode:!1,isPeerCall:!1,enableNotifications:!0},useConfigStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$7,e=>({reset:()=>e(initialState$7)})))),setConfig=e=>{useConfigStore.setState(e)},initialLocalParticipant={avatar:void 0,isLocal:!0,name:``,pid:`local`,ruid:`local-human`,role:`none`,sources:new Map,type:`human`,uid:`unknown`},initialState$6={dominantSpeakers:[],localParticipant:initialLocalParticipant,participants:[],virtualParticipants:[]},useParticipantStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$6,(e,k)=>({addParticipant:k=>{e(e=>({participants:e.participants.some(e=>e.pid===k.pid)?e.participants.map(e=>e.pid===k.pid?{...e,...k}:e):[...e.participants,k]}))},addVirtualParticipant:k=>{e(e=>({virtualParticipants:e.virtualParticipants.some(e=>e.pid===k.pid&&e.type===k.type)?e.virtualParticipants.map(e=>e.pid===k.pid&&e.type===k.type?{...e,...k}:e):[...e.virtualParticipants,k]}))},clearParticipants:()=>e({participants:[],virtualParticipants:[]}),removeParticipant:k=>{let A=useParticipantStore.getState().participants.find(e=>e.pid===k);A&&(sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantLeft,A.pid),useParticipantStore.getState().pinnedParticipant?.pid===A.pid&&useParticipantStore.getState().unpinParticipant()),e(e=>({participants:e.participants.filter(e=>e.pid!==k)}))},removeVirtualParticipant:(k,A=`screen-share`)=>{let j=useParticipantStore.getState().pinnedParticipant;j?.pid===k&&j.type===A&&useParticipantStore.getState().unpinParticipant(),e(e=>({virtualParticipants:e.virtualParticipants.filter(e=>!(e.pid===k&&e.type===A))}))},updateLocalParticipant:k=>{e(e=>({localParticipant:{...e.localParticipant,...k}}))},updateParticipant:(k,A)=>{e(e=>k===e.localParticipant.pid?{localParticipant:{...e.localParticipant,...A}}:{participants:e.participants.map(e=>e.pid===k?{...e,...A}:e)})},updateParticipantRole:(k,A)=>{e(e=>({participants:e.participants.map(e=>e.pid===k?{...e,role:A}:e)}))},pinParticipant:(k,A)=>{let j=getAllParticipants().find(e=>e.pid===k&&e.type===A);j&&e({pinnedParticipant:j})},unpinParticipant:()=>{e({pinnedParticipant:void 0})},getParticipantById:e=>{let A=k().localParticipant;return e===A.pid?A:k().participants.find(k=>k.pid===e)},reset:()=>e(initialState$6)}))));function useAllParticipants(){let e=useParticipantStore(e=>e.localParticipant),k=useParticipantStore(e=>e.participants),A=useParticipantStore(e=>e.virtualParticipants),j=useConfigStore.getState().iAmRecorder;return(0,react.useMemo)(()=>j?[...A,...k]:[e,...A,...k],[j,e,k,A])}function getAllParticipants(){let e=useParticipantStore.getState().localParticipant,k=useParticipantStore.getState().participants;return[e,...useParticipantStore.getState().virtualParticipants,...k]}const updateDominantSpeakers=()=>{let e=useParticipantStore.getState().dominantSpeakers,k=useParticipantStore.getState().participants;useParticipantStore.setState({dominantSpeakers:e.filter(e=>k.some(k=>k.pid===e))})},sortParticipants=()=>{let{participants:e,dominantSpeakers:k}=useParticipantStore.getState(),A=k[0];if(!A||e.slice(0,4).some(e=>e.pid===A))return;let j=[...e].sort((e,A)=>{let j=k.indexOf(e.pid),M=k.indexOf(A.pid);return j===-1&&M===-1?0:j===-1?1:M===-1?-1:j-M});useParticipantStore.setState({participants:j})};useParticipantStore.subscribe(e=>e.dominantSpeakers,sortParticipants);const pinParticipant=(e,k)=>{useParticipantStore.getState().pinParticipant(e,k)},unpinParticipant=()=>{useParticipantStore.getState().unpinParticipant()},togglePinParticipant=(e,k)=>{let A=useParticipantStore.getState().pinnedParticipant;A?.pid===e&&A.type===k?useParticipantStore.getState().unpinParticipant():useParticipantStore.getState().pinParticipant(e,k)};useParticipantStore.subscribe(e=>e.virtualParticipants,e=>{e&&e.length>0?setLayout(LAYOUT.SIDEBAR,!0):useBaseStore.getState().sidebarLayoutSetProgrammatically&&setLayout(LAYOUT.TILE)}),useParticipantStore.subscribe(e=>e.participants.length,()=>{updateDominantSpeakers()}),useParticipantStore.subscribe(e=>e.participants.map(({pid:e,name:k,avatar:A,uid:j})=>({pid:e,name:k,avatar:A,uid:j})),()=>{sendParticipantListChangedEvent()},{equalityFn:isArrayOfObjEqual}),useParticipantStore.subscribe(e=>e.localParticipant.pid,e=>{useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{pid:e}),useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{pid:e})}),useParticipantStore.subscribe(e=>!!e.pinnedParticipant,e=>{e?useBaseStore.getState().layout===LAYOUT.TILE&&setLayout(LAYOUT.SIDEBAR,!0):useBaseStore.getState().sidebarLayoutSetProgrammatically&&setLayout(LAYOUT.TILE)}),useParticipantStore.subscribe(e=>e.participants.length,e=>{e===0?useBaseStore.getState().restartIdealTimeoutTimer():useBaseStore.getState().clearIdealTimeoutTimer()}),eventBus.subscribe(EVENT_LISTENER_METHODS.SessionStatusListener.onSessionJoined,()=>{useParticipantStore.getState().participants.length===0&&useBaseStore.getState().restartIdealTimeoutTimer()});const getMainParticipantFromState=e=>{let{pinnedParticipant:k,participants:A,virtualParticipants:j,dominantSpeakers:M,localParticipant:N}=e;if(k)return k;if(j.length>0)return j[0];for(let e of M){let k=A.find(k=>k.pid===e);if(k)return k}return A.length>0?A[0]:N},getParticipantMediaType=e=>e?.type===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO;useParticipantStore.subscribe(e=>e.participants.filter(e=>e.uid),(e,k)=>{e.length>k.length&&differenceBy(e,k,e=>e.uid).forEach(e=>{sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantJoined,e.pid)})});const MAX_TOASTS=3,initialState$5={toasts:[]};let counter=0;const useToastStore=(0,zustand.create)(e=>({...initialState$5,addToast:k=>{if(!getIsConferenceJoined()||!useConfigStore.getState().enableNotifications)return``;let A=k.id??`toast-${++counter}-${Date.now()}`,j={...k,id:A,createdAt:Date.now()};return e(e=>{let k=e.toasts.findIndex(e=>e.id===A);if(k!==-1){let A=[...e.toasts];return A[k]=j,{toasts:A}}let M=[...e.toasts,j];return M.length>3?{toasts:M.slice(-3)}:{toasts:M}}),A},removeToast:k=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==k)}))},clearAll:()=>{e(initialState$5)},reset:()=>{e(initialState$5)}}));function showToast(e){return useToastStore.getState().addToast({id:e.id,message:e.message,type:e.type??`info`,duration:e.duration??3e3,position:e.position??`bottom`,action:e.action})}const MAX_RECORDING_RETRIES=8,RECORDING_RETRY_BASE_DELAY=5e3;let recordingRetryAttempts=0,recordingRetryTimer=null;function clearRecordingRetry(){recordingRetryTimer&&=(clearTimeout(recordingRetryTimer),null),recordingRetryAttempts=0}function scheduleRecordingRetry(){if(recordingRetryTimer)return;if(recordingRetryAttempts>=8){clearRecordingRetry(),showToast({id:`recording-failed`,type:`error`,message:`Recording failed`});return}let e=5e3*2**Math.max(0,recordingRetryAttempts-2);recordingRetryAttempts+=1,recordingRetryTimer=setTimeout(()=>{recordingRetryTimer=null,startRecording()},e)}function sendInitialConfig(){let e=useConferenceStore.getState().conference;if(!e?.room)return;let k=useConfigStore.getState(),A=useParticipantStore.getState().localParticipant,j={session_id:k.sessionId,is_audio_only:String(k.sessionType===`VOICE`),is_audio_muted:String(k.startAudioMuted),is_video_muted:String(k.startVideoPaused),is_peer_call:String(k.isPeerCall),start_recording_on_call_start:String(k.autoStartRecording),uid:A.uid,platform:useBaseStore.getState().sdkPlatform,platform_version:useBaseStore.getState().platformVersion,user_agent:useBaseStore.getState().userAgent,meeting_id:e.room?.xmpp?.getJid?.()??k.sessionId,mode:k.layout,commit_id:`65efcec`};e.room.addOrReplaceInPresence(CONFERENCE_COMMANDS.initialConfig,{attributes:j})}const initialState$4={conference:null,conferenceJoined:!1,conferenceJoinedAt:null,conferenceStartedAt:null,conferenceStatus:`initial`,p2p:!1,connectionQuality:new Map,remoteStatsTimestamps:new Map,raiseHandMap:new Map,recording:{status:__cometchat_calls_lib_webrtc.default.constants.recording.status.OFF,mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE},isRecording:!1,isStreaming:!1},useConferenceStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$4,e=>({conferenceWillJoin:k=>{window?.APP!==void 0&&(window.APP.conference._room=k),e({conference:k,conferenceStatus:`joining`})},reset:()=>{clearRecordingRetry(),e(initialState$4)},raiseHand:(k,A)=>{e(e=>({raiseHandMap:new Map(e.raiseHandMap).set(k,A)})),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantHandRaised,k)},lowerHand:k=>{useConferenceStore.getState().raiseHandMap.has(k)&&(e(e=>{let A=new Map(e.raiseHandMap);return A.delete(k),{raiseHandMap:A}}),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantHandLowered,k))},leaveConference:async()=>{let e=useConferenceStore.getState().conference;if(e){let{error:k}=await tryCatch(e.leave(),500);k&&eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionLeft})}},endConference:async()=>{let e=useConferenceStore.getState().conference;if(e){let{error:k}=await tryCatch(e.end())}}})))),useSessionTimer=()=>{let[e,k]=(0,react.useState)(0),A=useConferenceStore(e=>e.conferenceStartedAt);return(0,react.useEffect)(()=>{let e=setInterval(()=>{if(!A){k(0);return}k(Math.max(Date.now()-A,0))},1e3);return()=>clearInterval(e)},[A]),e};function raisedHandLocal(){let e=useConferenceStore.getState().conference;if(e){let k=Date.now(),A=useParticipantStore.getState().localParticipant.pid;e?.setLocalParticipantProperty(`raisedHand`,k),useConferenceStore.getState().raiseHand(A,k)}}function lowerHandLocal(){let e=useConferenceStore.getState().conference;if(e){let k=useParticipantStore.getState().localParticipant.pid;e.setLocalParticipantProperty(`raisedHand`,0),useConferenceStore.getState().lowerHand(k)}}function toggleRaiseHand(){useConferenceStore.getState().conference?.getLocalParticipantProperty(`raisedHand`)?lowerHandLocal():raisedHandLocal()}const useIsRecording=()=>{let e=useConferenceStore(e=>e.isRecording);return!useConfigStore(e=>e.iAmRecorder)&&e},useIsStreaming=()=>{let e=useConferenceStore(e=>e.isStreaming);return!useConfigStore(e=>e.iAmRecorder)&&e};useConferenceStore.subscribe(e=>e.recording,e=>{let k=e.status,A=e.mode,j=e.error,M=e.initiator,N=!j&&M&&(k===__cometchat_calls_lib_webrtc.default.constants.recording.status.ON||k===__cometchat_calls_lib_webrtc.default.constants.recording.status.PENDING),P=__cometchat_calls_lib_webrtc.default.constants.recording.error;if(j){let e=A===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM,k=e?`streaming-failed`:`recording-failed`;j===P.UNEXPECTED_REQUEST||(j===P.RESOURCE_CONSTRAINT?e?showToast({id:k,type:`error`,message:`Streaming failed`}):(showToast({id:k,type:`error`,duration:0,message:`Recorders busy, retrying...`}),scheduleRecordingRetry()):j===P.SERVICE_UNAVAILABLE?showToast({id:k,type:`error`,message:e?`Streaming unavailable`:`Recording unavailable`}):showToast({id:k,type:`error`,message:e?`Streaming failed`:`Recording failed`}))}let F=N&&A===__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE,I=N&&A===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM;F&&(clearRecordingRetry(),useToastStore.getState().removeToast(`recording-failed`)),I&&useToastStore.getState().removeToast(`streaming-failed`),useConferenceStore.setState({isRecording:!!F,isStreaming:!!I})}),useConferenceStore.subscribe(e=>e.isRecording,e=>{let k=useConferenceStore.getState().recording.initiator?.getId?.(),A=useParticipantStore.getState().localParticipant.pid;e?(k&&k!==A?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedRecording,k):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onRecordingStarted}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.recordingStarted`)}})):(k&&k!==A?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedRecording,k):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onRecordingStopped}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.recordingStopped`)}}))});async function startRecording(){let{conference:e,isStreaming:k}=useConferenceStore.getState();if(!k&&e){let{data:k,error:A}=await tryCatch(e.startRecording({mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE,appData:JSON.stringify({startedAt:Date.now()})}))}}async function stopActiveRecordingSession(){clearRecordingRetry();let{conference:e,recording:k}=useConferenceStore.getState();if(!e||!k.sessionId)return;let{error:A}=await tryCatch(e.stopRecording(k.sessionId))}async function stopRecording(){let{recording:e}=useConferenceStore.getState();e.mode!==__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM&&await stopActiveRecordingSession()}async function toggleRecording(){useConferenceStore.getState().isRecording?await stopRecording():await startRecording()}useConferenceStore.subscribe(e=>e.isStreaming,e=>{let k=useConferenceStore.getState().recording.initiator?.getId?.(),A=useParticipantStore.getState().localParticipant.pid;e?(useBaseStore.getState().clearIdealTimeoutTimer(),k&&k!==A?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedStreaming,k):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onStreamingStarted}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.streamingStarted`)}})):(useBaseStore.getState().restartIdealTimeoutTimer(),k&&k!==A?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedStreaming,k):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onStreamingStopped}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.streamingStopped`)}}))});async function startStreaming(e,k){let{conference:A,isRecording:j}=useConferenceStore.getState();if(j)return;let M=k?`${e.replace(/\/+$/,``)}/${k}`:e;if(A){let{error:e}=await tryCatch(A.startRecording({mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM,streamId:M,appData:JSON.stringify({startedAt:Date.now()})}))}}async function stopStreaming(){let{recording:e}=useConferenceStore.getState();e.mode===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM&&await stopActiveRecordingSession()}const getIsConferenceJoined=()=>{let e=useConferenceStore.getState().conferenceStatus;return e===`joined`||e===`restored`};useConferenceStore.subscribe(e=>e.conferenceStatus,(e,k)=>{e===`interrupted`&&(k===`joined`||k===`restored`)?eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionLost}):k===`interrupted`&&(e===`joined`||e===`restored`)&&eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionRestored})}),useConferenceStore.subscribe(e=>e.conference,e=>{if(sendInitialConfig(),e){let k=useParticipantStore.getState().localParticipant;e.sendCommand(CONFERENCE_COMMANDS.userInfo,{value:JSON.stringify(k)})}});const initialState$3={tracks:[],permissions:{audio:!1,video:!1,initialized:!1}},useTracksStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$3,(e,k)=>({reset:()=>e({...initialState$3,permissions:k().permissions}),addTrack:k=>e(e=>{let A=k.isLocal(),j=(()=>k.getParticipantId()?k.getParticipantId():A?useParticipantStore.getState().localParticipant?.pid:k.getId())(),M={local:A,mediaType:getMediaType(k),pid:j,videoType:k.getVideoType(),muted:k.isMuted()?1:0,streamingStatus:`active`,originalTrack:k},N=e.tracks.findIndex(e=>e.pid===j&&e.mediaType===M.mediaType&&e.local===A&&e.originalTrack===k);if(N!==-1){let k=[...e.tracks];return k[N]=M,{tracks:k}}return{tracks:[M,...e.tracks]}}),removeTrack:k=>e(e=>({tracks:e.tracks.filter(e=>e.originalTrack!==k)})),updateTrack:(k,A)=>e(e=>({tracks:e.tracks.map(e=>e.originalTrack===k?{...e,mediaType:e.mediaType??getMediaType(k),videoType:e.videoType??k.getVideoType(),...A}:e)})),updateLocalTrack:(k,A)=>e(e=>{let j=e.tracks.find(e=>e.local&&e.mediaType===k);if(!j){let j=useParticipantStore.getState().localParticipant;return{tracks:[...e.tracks,{local:!0,mediaType:k,pid:j.pid,videoType:k===MEDIA_TYPE.SCREENSHARE?`desktop`:k===MEDIA_TYPE.VIDEO?`camera`:null,muted:A.muted??0,streamingStatus:`active`,...A}]}}return{tracks:e.tracks.map(e=>e===j?{...e,...A,mediaType:k,videoType:k===MEDIA_TYPE.SCREENSHARE?`desktop`:k===MEDIA_TYPE.VIDEO?`camera`:null}:e)}})})))),useTrackByParticipantId=(e,k=MEDIA_TYPE.VIDEO)=>{let A=useTracksStore(e=>e.tracks);return(0,react.useMemo)(()=>A.find(A=>A.pid===e&&A.mediaType===k),[A,e,k])},getTrackByParticipantId=(e,k=MEDIA_TYPE.VIDEO)=>useTracksStore.getState().tracks.find(A=>A.pid===e&&A.mediaType===k),useLocalTrack=(e=MEDIA_TYPE.VIDEO)=>{let k=useTracksStore(e=>e.tracks);return(0,react.useMemo)(()=>k.find(k=>k.local&&k.mediaType===e),[k,e])},getLocalTrack=(e=MEDIA_TYPE.VIDEO)=>useTracksStore.getState().tracks.find(k=>k.local&&k.mediaType===e),disposeLocalTracks=async()=>{let e=useTracksStore.getState().tracks.filter(e=>e.local),k=[];for(let{originalTrack:A}of e)A&&A.disposed!==!0&&k.push(tryCatch(A.dispose()));let A=await Promise.all(k);for(let{error:e}of A);},muteAudioTrack=()=>{useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:1})},unMuteAudioTrack=async()=>{let e=getLocalTrack(MEDIA_TYPE.AUDIO),k=useTracksStore.getState().permissions,A=useBaseStore.getState().isMobileSDK();if(!k.audio&&k.initialized&&!A){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for audio track. Please allow access to your device.`}}),eventBus.publish({type:INTERNAL_EVENTS.queryPermission});return}e?.originalTrack||(await createLocalTrack(`audio`),e=getLocalTrack(MEDIA_TYPE.AUDIO)),e?.originalTrack&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:0})},toggleAudioTrack=()=>{getLocalTrack(MEDIA_TYPE.AUDIO)?.muted?unMuteAudioTrack():muteAudioTrack()},pauseVideoTrack=(e=VIDEO_PAUSE_AUTHORITY.USER)=>{let k=(getLocalTrack(MEDIA_TYPE.VIDEO)?.muted||0)|e;useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:k})},resumeVideoTrack=async(e=VIDEO_PAUSE_AUTHORITY.USER)=>{let k=getLocalTrack(MEDIA_TYPE.VIDEO),A=useTracksStore.getState().permissions,j=useBaseStore.getState().isMobileSDK();if(!A.video&&A.initialized&&!j){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for video track. Please allow access to your device.`}}),eventBus.publish({type:INTERNAL_EVENTS.queryPermission});return}if(k?.originalTrack||(await createLocalTrack(MEDIA_TYPE.VIDEO),k=getLocalTrack(MEDIA_TYPE.VIDEO)),!k?.originalTrack)return;let M=k.muted&~e;useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:M})},toggleVideoTrack=()=>{getLocalTrack(MEDIA_TYPE.VIDEO)?.muted?resumeVideoTrack():pauseVideoTrack()};useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.muted,(e,k)=>{let A=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack;e&&A?A.mute():A&&A.unmute(),typeof e==`number`&&typeof k==`number`&&eventBus.publish({type:e?EVENT_LISTENER_METHODS.MediaEventsListener.onAudioMuted:EVENT_LISTENER_METHODS.MediaEventsListener.onAudioUnMuted})}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.muted,(e,k)=>{let A=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;e&&A?A.mute():A&&A.unmute(),typeof e==`number`&&typeof k==`number`&&eventBus.publish({type:e?EVENT_LISTENER_METHODS.MediaEventsListener.onVideoPaused:EVENT_LISTENER_METHODS.MediaEventsListener.onVideoResumed})}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&e.local)?.muted,e=>{let k=getLocalTrack(MEDIA_TYPE.SCREENSHARE)?.originalTrack;e&&k&&k.mute()}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.originalTrack,e=>{e&&(getLocalTrack(MEDIA_TYPE.AUDIO)?.muted?e.mute():e.unmute())}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.originalTrack,e=>{e&&(getLocalTrack(MEDIA_TYPE.VIDEO)?.muted?e.mute():e.unmute())}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.originalTrack,(e,k)=>{let A=useConferenceStore.getState().conference;if(A&&(k&&e?A.replaceTrack(k,e):e?A.addTrack(e):k&&A.replaceTrack(k,null)),e){let k=e.getDeviceId();waitForStoreState(useBaseStore,e=>e.audioInputDevices.length>0).then(()=>{updateAudioInputDeviceState(useBaseStore.getState().audioInputDevices.find(e=>e.deviceId===k),!0)}).catch(()=>{updateAudioInputDeviceState(void 0,!0)})}}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.originalTrack,(e,k)=>{let A=useConferenceStore.getState().conference;if(A&&(k&&e?A.replaceTrack(k,e):e?A.addTrack(e):k&&A.replaceTrack(k,null)),e){let k=e.getDeviceId();updateVideoInputDeviceState(useBaseStore.getState().videoInputDevices.find(e=>e.deviceId===k),!0)}}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&e.local)?.originalTrack,(e,k)=>{let A=useConferenceStore.getState().conference;A&&(k&&e?A.replaceTrack(k,e).then(()=>{k.removeAllListeners(),k.dispose()}):e&&A.addTrack(e))}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&!e.muted).length,()=>{let e=useTracksStore.getState().tracks.filter(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&!e.muted),k=useParticipantStore.getState().virtualParticipants.filter(e=>e.type===`screen-share`),A=differenceBy(e,k,e=>e.pid);differenceBy(k,e,e=>e.pid).forEach(e=>{removeScreenShareParticipant(e.pid)}),A.forEach(e=>{e.originalTrack&&addScreenShareParticipant(e.originalTrack)})}),useTracksStore.subscribe(e=>e.permissions,(e,k)=>{let A=useConferenceStore.getState().conferenceStatus;if(!(A!==`joined`&&A!==`restored`)){if(e.audio===!1&&k.audio===!0){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for audio track. Please allow access to your device.`}}),muteAudioTrack();let e=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack;e&&e.dispose().catch(()=>{})}e.video===!1&&k.video===!0&&(eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for video track. Please allow access to your device.`}}),pauseVideoTrack())}}),useTracksStore.subscribe(e=>e.permissions.audio||e.permissions.video,e=>{e&&initDeviceList()}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.AUDIO&&!e.local).map(e=>({muted:e.muted,pid:e.pid})),(e,k)=>{k.forEach(k=>{let A=e.find(e=>e.pid===k.pid);A&&A.muted!==k.muted&&sendParticipantEvent(A.muted?EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantAudioMuted:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantAudioUnmuted,A.pid)})},{equalityFn:isArrayOfObjEqual}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.VIDEO&&!e.local).map(e=>({muted:e.muted,pid:e.pid})),(e,k)=>{k.forEach(k=>{let A=e.find(e=>e.pid===k.pid);A&&A.muted!==k.muted&&sendParticipantEvent(A.muted?EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantVideoPaused:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantVideoResumed,A.pid)})},{equalityFn:isArrayOfObjEqual});function updateConfig(e){if(setConfig(e),e.layout&&setLayout(e.layout),typeof e.internalSettings==`string`){let k=safeParseJson(e.internalSettings);if(!k?.data)return;let A=valibot.safeParse(InternalSettingSchema,k.data);if(A.success){let e=useConfigStore.getState().displayName;useParticipantStore.getState().updateLocalParticipant({name:e||A.output.user.name,avatar:e?void 0:A.output.user.avatar,uid:A.output.user.uid}),useConfigStore.setState({sessionId:A.output.sessionId}),useConnectionStore.setState({jwt:A.output.callToken,connectionConfig:A.output.settings.connectionConfig})}}e.devSessionId&&useConfigStore.setState({sessionId:e.devSessionId}),e.initialCameraFacing&&useBaseStore.setState({cameraFacing:e.initialCameraFacing===CAMERA_FACING.REAR?CAMERA_FACING_INTERNAL.ENVIRONMENT:CAMERA_FACING_INTERNAL.USER}),e.displayName&&useParticipantStore.getState().updateLocalParticipant({name:e.displayName,avatar:void 0}),typeof e.startAudioMuted==`boolean`&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:e.startAudioMuted?1:0}),typeof e.startVideoPaused==`boolean`&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:e.startVideoPaused?VIDEO_PAUSE_AUTHORITY.USER:0}),typeof e.enableNoiseReduction==`boolean`&&useBaseStore.setState({enableNoiseReduction:e.enableNoiseReduction})}const initialState$2={audioModeMenuVisible:!1,audioModes:[],audioInputDevices:[],audioOutputDevices:[],videoInputDevices:[],cameraFacing:CAMERA_FACING_INTERNAL.USER,isPIPLayoutEnabled:!1,layout:LAYOUT.TILE,sidebarLayoutSetProgrammatically:!1,mainAreaDimension:{height:0,width:0},tileDimensions:{tileHeight:0,tileWidth:0},callContainerDimension:{height:0,width:0},moreMenuVisible:!1,participantListVisible:!1,subscriptions:[],connectionRetryCount:0,settingsDialogVisible:!1,settingsDialogTab:`audio`,virtualBackgroundDialogVisible:!1,idleTimeoutModalVisible:!1,mirrorLocalVideo:!0,isDesktopSharingEnabled:!1,isBlurSupported:!1,desktopSharingFrameRate:5,chatButtonUnreadCount:0,enableNoiseReduction:!0,sdkPlatform:SDK_PLATFORM.WEB,isMobileBrowser:!1,visibleParticipants:{startIndex:0,endIndex:0},sidebarVisibleParticipants:{startIndex:0,endIndex:0}},useBaseStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.persist)((0,zustand_middleware.combine)(initialState$2,(e,k)=>({addSubscriptions:e=>{useBaseStore.setState(k=>({subscriptions:[...k.subscriptions,...e]}))},reset:()=>e(e=>({...initialState$2,audioInputDevice:e.audioInputDevice,audioOutputDevice:e.audioOutputDevice,videoInputDevice:e.videoInputDevice,enableNoiseReduction:e.enableNoiseReduction,isMobileBrowser:e.isMobileBrowser})),toggleMoreMenuVisible:()=>e(e=>({moreMenuVisible:!e.moreMenuVisible})),toggleParticipantListVisible:()=>e(e=>({participantListVisible:!e.participantListVisible})),incrementConnectionRetryCount:()=>e(e=>({connectionRetryCount:e.connectionRetryCount+1})),isMobileSDK:()=>k().sdkPlatform!==`web`,isMobile:()=>{let e=k().sdkPlatform!==`web`,A=k().isMobileBrowser;return e||A},clearIdealTimeoutTimer:()=>{let A=k().idealTimeoutTimer;A&&(clearTimeout(A),e({idealTimeoutTimer:void 0,idleTimeoutModalVisible:!1}))},restartIdealTimeoutTimer:()=>{if(useBaseStore.getState().clearIdealTimeoutTimer(),useConfigStore.getState().iAmRecorder||useParticipantStore.getState().participants.length>0||!getIsConferenceJoined()||useConferenceStore.getState().isStreaming)return;let k=useConfigStore.getState().idleTimeoutPeriodBeforePrompt;e({idealTimeoutTimer:setTimeout(()=>{e({idleTimeoutModalVisible:!0})},k)})}})),{name:`base-store`,partialize:e=>({audioInputDevice:e.audioInputDevice,audioOutputDevice:e.audioOutputDevice,videoInputDevice:e.videoInputDevice,enableNoiseReduction:e.enableNoiseReduction})}))),toggleParticipantListVisible=useBaseStore.getState().toggleParticipantListVisible,hideParticipantList=()=>useBaseStore.setState({participantListVisible:!1}),showParticipantList=()=>useBaseStore.setState({participantListVisible:!0}),toggleParticipantList=()=>useBaseStore.setState(e=>({participantListVisible:!e.participantListVisible})),toggleMoreMenuVisible=useBaseStore.getState().toggleMoreMenuVisible,toggleAudioModeMenuVisible=()=>{useBaseStore.setState(e=>({audioModeMenuVisible:!e.audioModeMenuVisible}))},setLayout=(e,k=!1)=>{e!==LAYOUT.SIDEBAR&&useParticipantStore.setState({pinnedParticipant:void 0}),useBaseStore.setState({layout:e,sidebarLayoutSetProgrammatically:k})},hideAllBottomSheets=()=>{useBaseStore.setState({audioModeMenuVisible:!1,moreMenuVisible:!1})},enablePictureInPictureLayout=()=>useBaseStore.setState({isPIPLayoutEnabled:!0}),disablePictureInPictureLayout=()=>useBaseStore.setState({isPIPLayoutEnabled:!1}),showSettingsDialog=(e=`audio`)=>{useBaseStore.setState({settingsDialogVisible:!0,settingsDialogTab:e})},hideSettingsDialog=()=>{useBaseStore.setState({settingsDialogVisible:!1})},toggleSettingsDialog=()=>{useBaseStore.setState(e=>({settingsDialogVisible:!e.settingsDialogVisible}))},showVirtualBackgroundDialog=()=>{useBaseStore.setState({virtualBackgroundDialogVisible:!0,participantListVisible:!1})},hideVirtualBackgroundDialog=()=>{useBaseStore.setState({virtualBackgroundDialogVisible:!1})},toggleMirrorLocalVideo=()=>{useBaseStore.setState(e=>({mirrorLocalVideo:!e.mirrorLocalVideo}))},toggleEnableNoiseReduction=()=>{useBaseStore.setState(e=>({enableNoiseReduction:!e.enableNoiseReduction}))},setChatButtonUnreadCount=e=>{useBaseStore.setState({chatButtonUnreadCount:e})},setAudioModes=e=>{let k=useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO?e.filter(e=>e.type!==`EARPIECE`):e;useBaseStore.setState({audioModes:k.map(e=>e.uid?e:{...e,uid:e.type})})},getLayout=()=>useBaseStore.getState().layout;function initBaseStoreSubscriptions(){let e=[],k=useBaseStore.subscribe(e=>e.audioModes,e=>{if(eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModesChanged}),e.length>0){let k=e.find(e=>e.selected)??e[0];useBaseStore.setState({selectedAudioModeType:k.type})}});e.push(k);let A=useBaseStore.subscribe(e=>e.selectedAudioModeType,e=>{e&&eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModeChanged})});e.push(A);let j=useBaseStore.subscribe(e=>e.layout,e=>{eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS.CallLayoutListener.onCallLayoutChanged})});e.push(j);let M=useBaseStore.subscribe(e=>e.participantListVisible,e=>{e?eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListVisible}):eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListHidden})});e.push(M);let N=useBaseStore.subscribe(e=>e.isPIPLayoutEnabled,e=>{e?eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutEnabled}):eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutDisabled})});e.push(N);let P=useBaseStore.subscribe(e=>e.cameraFacing,e=>{eventBus.publish({payload:e===CAMERA_FACING_INTERNAL.USER?CAMERA_FACING.FRONT:CAMERA_FACING.REAR,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onCameraFacingChanged});let k=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;k&&k.getCameraFacingMode()!==e&&(useBaseStore.getState().isMobileBrowser?updateVideoInputDevice(null,e):k._switchCamera())});e.push(P);let F=useBaseStore.subscribe(e=>e.audioInputDevices,e=>{if(e.length>0){let k=useBaseStore.getState().audioInputDevice;k?e.some(e=>e.deviceId===k.deviceId&&e.label===k.label)||updateAudioInputDeviceState(getDefaultDevice(e)):updateAudioInputDeviceState(getDefaultDevice(e),!0)}});e.push(F);let I=useBaseStore.subscribe(e=>e.audioOutputDevices,e=>{if(e.length>0){let k=useBaseStore.getState().audioOutputDevice;k&&e.some(e=>e.deviceId===k.deviceId&&e.label===k.label)||useBaseStore.setState({audioOutputDevice:getDefaultDevice(e)})}});e.push(I);let L=useBaseStore.subscribe(e=>e.videoInputDevices,e=>{if(e.length>0){let k=useBaseStore.getState().videoInputDevice;k?e.some(e=>e.deviceId===k.deviceId&&e.label===k.label)||updateVideoInputDeviceState(getDefaultDevice(e)):updateVideoInputDeviceState(getDefaultDevice(e),!0)}});e.push(L),useBaseStore.subscribe(e=>e.previewVideoTrack,(e,k)=>{k&&k.disposed!==!0&&k.dispose()}),useBaseStore.getState().addSubscriptions(e)}initBaseStoreSubscriptions();const CONNECTION_TIMEOUT_MS=1e4,initialState$1={connection:void 0,connectionStatus:`initial`,error:void 0,timeEstablished:void 0},useConnectionStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$1,e=>({connectionEstablished:k=>e({connection:k,connectionStatus:`connected`,error:void 0,timeEstablished:Date.now()}),connectionFailed:k=>e({connectionStatus:`error`,error:k,timeEstablished:void 0}),connectionWillConnect:k=>{window?.APP!==void 0&&(window.APP.connection=k),useConfigStore.getState().iAmRecorder&&k.addFeature(`http://jitsi.org/protocol/jibri`),e({connection:k,connectionStatus:`connecting`,error:void 0,timeEstablished:void 0})},disconnect:async()=>{let k=useConnectionStore.getState().connection,A=useConnectionStore.getState().connectionStatus;k&&A!==`disconnecting`&&(e({connectionStatus:`disconnecting`}),eventBus.publish({type:INTERNAL_EVENTS.connectionWillClose}),eventBus.stopEmitting(),await tryCatch(k.disconnect()),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed},!0),e(initialState$1))},reset:()=>e(initialState$1)}))));function waitForConnection(){let{connectionStatus:e}=useConnectionStore.getState();return e===`connected`?Promise.resolve():new Promise((e,k)=>{let A=setTimeout(()=>{j(),k(Error(`Connection timed out after ${CONNECTION_TIMEOUT_MS/1e3} seconds`))},CONNECTION_TIMEOUT_MS),j=useConnectionStore.subscribe(e=>e.connectionStatus,M=>{M===`connected`?(clearTimeout(A),j(),e()):M===`error`&&(clearTimeout(A),j(),k(useConnectionStore.getState().error))})})}const useHideMuteAudioButton=()=>{let e=useConfigStore(e=>e.hideToggleAudioButton),k=useConfigStore(e=>e.enableCompanionMode);return e||k},useHideToggleVideoButton=()=>{let e=useConfigStore(e=>e.hideToggleVideoButton),k=useConfigStore(e=>e.sessionType);return e||k!==SESSION_TYPE.VIDEO},useIsConferenceJoined=()=>{let e=useConferenceStore(e=>e.conferenceStatus);return e===`joined`||e===`restored`},useHideScreenSharingButton=()=>{let e=useConfigStore(e=>e.hideScreenSharingButton),k=useBaseStore(e=>e.sdkPlatform===`android`),A=useBaseStore(e=>e.isDesktopSharingEnabled),j=useIsConferenceJoined(),M=useBaseStore.getState().isMobileSDK();return e||M||!j||(k?!1:!A)},useHideSwitchCameraButton=()=>{let e=getLocalTrack(MEDIA_TYPE.VIDEO);return useConfigStore(e=>e.hideSwitchCameraButton)||!e?.originalTrack},useHideChatButton=()=>useConfigStore(e=>e.hideChatButton),useLocalParticipant=e=>useParticipantStore(k=>e?e(k.localParticipant):k.localParticipant),useScreenShareRunning=()=>{let e=useLocalTrack(MEDIA_TYPE.SCREENSHARE);return e?.originalTrack&&!e.muted},useTrackMuted=(e,k)=>{let A=useLocalParticipant(),j=useTrackByParticipantId(k??A.pid,e);return e===MEDIA_TYPE.VIDEO&&j?.streamingStatus!==`active`?!0:j?!!j.muted:!0},useMainParticipant=()=>getMainParticipantFromState({pinnedParticipant:useParticipantStore(e=>e.pinnedParticipant),participants:useParticipantStore(e=>e.participants),virtualParticipants:useParticipantStore(e=>e.virtualParticipants),dominantSpeakers:useParticipantStore(e=>e.dominantSpeakers),localParticipant:useLocalParticipant()}),getMainParticipant=()=>{let e=useParticipantStore.getState();return getMainParticipantFromState({pinnedParticipant:e.pinnedParticipant,participants:e.participants,virtualParticipants:e.virtualParticipants,dominantSpeakers:e.dominantSpeakers,localParticipant:e.localParticipant})},useIsReconnecting=()=>{let e=useConnectionStore(e=>e.connectionStatus),k=useConferenceStore(e=>e.conferenceStatus),A=useConferenceStore(e=>e.p2p),[j,M]=(0,react.useState)(!0);(0,react.useEffect)(()=>{if(typeof window>`u`)return;let e=new AbortController,{signal:k}=e;return window.addEventListener(`online`,()=>M(!0),{signal:k}),window.addEventListener(`offline`,()=>M(!1),{signal:k}),()=>e.abort()},[]);let N=e===`connected`&&k===`interrupted`;return A&&N&&j?!1:N},useHideRecordingButton=()=>{let e=useConfigStore(e=>e.hideRecordingButton),k=useConferenceStore(e=>e.isStreaming),A=useIsConferenceJoined(),j=useLocalParticipant();return k||e||!A||j.role!==`moderator`},useHideStreamingButton=()=>{let e=useConfigStore(e=>e.hideStreamingButton),k=useConferenceStore(e=>e.isRecording),A=useIsConferenceJoined(),j=useLocalParticipant();return k||e||!A||j.role!==`moderator`},useHideVirtualBackgroundButton=()=>{let e=useConfigStore(e=>e.hideVirtualBackgroundButton),k=getLocalTrack(MEDIA_TYPE.VIDEO),A=useBaseStore(e=>e.isBlurSupported);return e||!k?.originalTrack||!A},useLayout=()=>useBaseStore(e=>e.layout),useEnableParticipantContextMenu=()=>{let e=useConfigStore(e=>e.enableParticipantContextMenu),k=useBaseStore(e=>e.isPIPLayoutEnabled);return useLayout()===LAYOUT.SPOTLIGHT||k?!1:e},useRaisedHandTimestamp=(e,k=`human`)=>{let A=useLocalParticipant(),j=useConferenceStore(k=>k.raiseHandMap.get(e??A.pid));return k===`human`?j:void 0},useIsParticipantPinned=(e,k)=>{let A=useParticipantStore(e=>e.pinnedParticipant);return!!(A&&A.pid===e&&A.type===k)},useOrderedParticipants=()=>{let e=useAllParticipants(),k=useConferenceStore(e=>e.raiseHandMap);return e.sort((e,A)=>{let j=k.get(e.pid),M=k.get(A.pid);return j&&!M?-1:!j&&M?1:e.name.localeCompare(A.name)})},useNonRecoverableError=()=>{let e=useConferenceStore(e=>e.conferenceError),k=useConnectionStore(e=>e.error);if(e)return e;if(k)return k.message||k.name},useIsSwitchCameraEnabledBrowser=()=>{let e=useBaseStore(e=>e.isMobileBrowser),k=getLocalTrack(MEDIA_TYPE.VIDEO);return e&&k?.originalTrack},useIsAudioInputSelectionSupported=()=>{let e=useTracksStore(e=>e.permissions.audio),k=useBaseStore(e=>e.audioInputDevices);return e&&k.length>0},useIsVideoInputSelectionSupported=()=>{let e=useTracksStore(e=>e.permissions.video),k=useBaseStore(e=>e.videoInputDevices);return e&&k.length>0},useShouldMirrorLocalVideo=()=>{let e=useBaseStore(e=>e.mirrorLocalVideo);return useBaseStore(e=>e.cameraFacing)===`user`&&e};function resetAllStores(){useBaseStore.getState().reset(),useConferenceStore.getState().reset(),useConfigStore.getState().reset(),useConnectionStore.getState().reset(),useParticipantStore.getState().reset(),useToastStore.getState().reset(),useTracksStore.getState().reset()}const switchCamera=()=>{useBaseStore.setState(e=>({cameraFacing:e.cameraFacing===CAMERA_FACING_INTERNAL.USER?CAMERA_FACING_INTERNAL.ENVIRONMENT:CAMERA_FACING_INTERNAL.USER}))};function getNearestVideoQualityLevel(e){return e<=VIDEO_QUALITY_LEVELS.LOW?VIDEO_QUALITY_LEVELS.LOW:e<=VIDEO_QUALITY_LEVELS.STANDARD?VIDEO_QUALITY_LEVELS.STANDARD:VIDEO_QUALITY_LEVELS.HIGH}let backgroundOverrideSent=!1;function getSystemPiPSource(){if(!useConfigStore.getState().enableIOSPictureInPicture)return;let e=getMainParticipant(),k=getTrackByParticipantId(e.pid,getParticipantMediaType(e));if(!(!k||k.local))return k.originalTrack?.getSourceName?.()}function setReceiverConstraintsInternal(){let{sessionType:e,unstable_headlessMode:k}=useConfigStore.getState();if(k&&e===SESSION_TYPE.VOICE){useConferenceStore.getState().conference?.setReceiverConstraints({lastN:0});return}let{appState:A,isPIPLayoutEnabled:j}=useBaseStore.getState();if(A===`background`&&!j){let e=useConferenceStore.getState().conference;if(e){let k=useConfigStore.getState().enableIOSPictureInPicture,A=getSystemPiPSource();e.setReceiverConstraints({lastN:k?1:0,onStageSources:A?[A]:[]}),backgroundOverrideSent=!0}return}if(useBaseStore.getState().isMobileSDK()){backgroundOverrideSent&&=(useConferenceStore.getState().conference?.setReceiverConstraints({lastN:-1,onStageSources:[]}),!1);return}let M={constraints:{},defaultConstraints:{maxHeight:VIDEO_QUALITY_LEVELS.NONE},lastN:-1,onStageSources:[],selectedSources:[]},N=getLayout();if(N===`SPOTLIGHT`){let e=getMainParticipant().sources?.get(`video`);e&&Array.from(e.keys()).forEach(e=>{M.constraints[e]={maxHeight:720},M.onStageSources.push(e)})}else if(N===`TILE`){let e=getNearestVideoQualityLevel(useBaseStore.getState().tileDimensions.tileHeight),k=useBaseStore.getState().visibleParticipants;getAllParticipants().slice(k.startIndex,k.endIndex+1).forEach(k=>{let A=k.isLocal,j=k.sources?.get(`video`);!A&&j&&Array.from(j.keys()).forEach(k=>{M.constraints[k]={maxHeight:e}})})}else if(N===`SIDEBAR`){let{startIndex:e,endIndex:k}=useBaseStore.getState().sidebarVisibleParticipants;getAllParticipants().slice(e,k).forEach(e=>{let k=e.sources?.get(`video`);k&&Array.from(k.keys()).forEach(e=>{M.constraints[e]={maxHeight:180}})});let A=getMainParticipant().sources?.get(`video`);A&&Array.from(A.keys()).forEach(e=>{M.constraints[e]={maxHeight:720},M.onStageSources.push(e)})}let P=useConferenceStore.getState().conference;P&&(Object.keys(M.constraints).length>0||backgroundOverrideSent)&&(P.setReceiverConstraints(M),backgroundOverrideSent=!1)}const setReceiverConstraints=debounce(setReceiverConstraintsInternal,200);useBaseStore.subscribe(e=>e.visibleParticipants,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.sidebarVisibleParticipants,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.layout,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.appState,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.isPIPLayoutEnabled,()=>{setReceiverConstraints()}),useTracksStore.subscribe(()=>useBaseStore.getState().appState===`background`?getSystemPiPSource():void 0,()=>{setReceiverConstraints()}),useParticipantStore.subscribe(e=>getMainParticipantFromState(e).ruid,()=>{let{appState:e,layout:k}=useBaseStore.getState();(e===`background`||k===`SPOTLIGHT`||k===`SIDEBAR`)&&setReceiverConstraints()});const REMOTE_STATS_STALE_THRESHOLD_MS=1e4,STALENESS_CHECK_INTERVAL_MS=4e3,REMOTE_STATS_SEED_BUFFER_MS=4e3;let stalenessCheckInterval=null,remoteConnectionLost=!1;function setRemoteStatsTimestamps(e){useConferenceStore.setState(k=>{let A=new Map(k.remoteStatsTimestamps);return e(A),{remoteStatsTimestamps:A}})}function seedRemoteStatsTimestamp(e){setRemoteStatsTimestamps(k=>k.set(e,Date.now()+REMOTE_STATS_SEED_BUFFER_MS))}function removeRemoteStatsTimestamp(e){setRemoteStatsTimestamps(k=>k.delete(e))}function reseedRemoteStatsTimestamps(){let e=Date.now()+REMOTE_STATS_SEED_BUFFER_MS;setRemoteStatsTimestamps(k=>{for(let A of k.keys())k.set(A,e)})}function isLocallyHealthy(){let e=useConferenceStore.getState().conferenceStatus;return e===`joined`||e===`restored`}function isRemotePeerStale(){if(!useConfigStore.getState().isPeerCall)return!1;let e=useParticipantStore.getState().participants;if(e.length===0)return!1;let k=useConferenceStore.getState().remoteStatsTimestamps,A=Date.now();return e.some(e=>A-(k.get(e.pid)??0)>=1e4)}function checkRemotePeerStale(){remoteConnectionLost||!isLocallyHealthy()||isRemotePeerStale()&&(remoteConnectionLost=!0,eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onRemoteConnectionLost}))}function recordRemoteStatsTimestamp(e){setRemoteStatsTimestamps(k=>k.set(e,Date.now())),!(!remoteConnectionLost||!isLocallyHealthy())&&(isRemotePeerStale()||(remoteConnectionLost=!1,eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onRemoteConnectionRestored})))}function startRemoteStatsWatchdog(){!useConfigStore.getState().isPeerCall||stalenessCheckInterval||(stalenessCheckInterval=setInterval(checkRemotePeerStale,4e3))}function stopRemoteStatsWatchdog(){stalenessCheckInterval&&=(clearInterval(stalenessCheckInterval),null),remoteConnectionLost=!1}const AUDIO_LEVEL_THRESHOLD_TO_LOWER_HAND=.2;let holdRestoredUntilRemoteStats=!1;var ConferenceListener=class{onConferenceJoined(){useConferenceStore.setState({conferenceJoined:!0,conferenceStatus:`joined`,conferenceJoinedAt:Date.now()}),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionJoined}),eventBus.publish({type:INTERNAL_EVENTS.onSessionJoined})}async onConferenceLeft(){holdRestoredUntilRemoteStats=!1,stopRemoteStatsWatchdog(),useConferenceStore.setState({conferenceJoined:!1,conferenceStatus:`left`}),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionLeft}),await useConnectionStore.getState().disconnect()}onTrackAdded(e){e.isLocal()||onTrack(e)}async onUserJoined(e,k){let A=k.getId(),j=k.getDisplayName(),M=k.getRole();k.isHidden()||(eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${j} has joined the conference`}}),useParticipantStore.getState().addParticipant({name:j??`Unknown`,pid:A,ruid:`${A}-human`,role:M,isLocal:!1,sources:k.getSources(),type:`human`}),seedRemoteStatsTimestamp(A),startRemoteStatsWatchdog())}async onUserLeft(e,k){if(k.isHidden())return;let A=k.getId();eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${k.getDisplayName()} has left the conference`}}),useParticipantStore.getState().removeParticipant(A),removeRemoteStatsTimestamp(A),useConfigStore.getState().isPeerCall&&useParticipantStore.getState().participants.length===0&&(stopRemoteStatsWatchdog(),leaveSession())}onTrackRemoved(e){if(e.isLocal()){let k=getMediaType(e);getLocalTrack(k)?.originalTrack===e&&useTracksStore.getState().updateLocalTrack(k,{originalTrack:void 0})}else useTracksStore.getState().removeTrack(e);e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.NO_DATA_FROM_SOURCE),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED)}onConferenceJoinInProgress(){}onConferenceFailed(e,k,A){if(stopRemoteStatsWatchdog(),e===__cometchat_calls_lib_webrtc.default.errors.conference.CONFERENCE_DESTROYED){leaveSession({forceLeave:!0});return}useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:A?.toString()||`Unknown error`})}onRecorderStateChanged(e){if(e){let k=e.getID(),A=e.getError(),j=e.getMode(),M=e.getStatus();if(A===`unexpected-request`)return;if(k){let N=e.getInitiator();if(useConferenceStore.setState({recording:{status:M,mode:j,error:A,sessionId:k,initiator:N}}),N){let e=typeof N==`string`?N:N.getId(),A=useConferenceStore.getState().conference,j=useParticipantStore.getState().localParticipant;if(j.pid!==e)return;A.sendCommandOnce(M===`off`?`stopScreenRecording`:`START_SCREEN_RECORDING`,{attributes:{recordId:k,...j,id:e}})}}else A&&useConferenceStore.setState({recording:{status:M,mode:j,error:A}})}}onConnectionEstablished(){holdRestoredUntilRemoteStats=!1,reseedRemoteStatsTimestamps(),useConferenceStore.setState({conferenceStatus:`joined`}),setTimeout(setReceiverConstraints,500)}onConnectionInterrupted(){holdRestoredUntilRemoteStats=!1,useConferenceStore.setState({conferenceStatus:`interrupted`})}onConnectionRestored(){if(useConfigStore.getState().isPeerCall&&useParticipantStore.getState().participants.length===1){holdRestoredUntilRemoteStats=!0;return}useConferenceStore.setState({conferenceStatus:`restored`})}onP2PStatus(e,k){useConferenceStore.setState({p2p:k})}onTrackMuteChanged(e,k){if(e.isLocal()&&k){useTracksStore.getState().updateLocalTrack(getMediaType(e),{muted:e.isMuted()?1:0});let A=k.getDisplayName();A&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${A} has muted you.`}})}}onParticipantSourceUpdated(e){setReceiverConstraints()}onConferenceCreatedTimestamp(e){useConferenceStore.setState({conferenceStartedAt:e})}onDominantSpeakerChanged(e,k,A){useParticipantStore.setState({dominantSpeakers:[e,...k??[]]}),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onDominantSpeakerChanged,e),e===useParticipantStore.getState().localParticipant.pid&&lowerHandLocal()}onLocalStatsUpdated(e){let k=useParticipantStore.getState().localParticipant;e.connectionQuality&&useConferenceStore.setState(A=>{let j=new Map(A.connectionQuality);return j.set(k.pid,e.connectionQuality),{connectionQuality:j}})}onRemoteStatsUpdated(e,k){holdRestoredUntilRemoteStats&&(holdRestoredUntilRemoteStats=!1,useConferenceStore.setState({conferenceStatus:`restored`})),recordRemoteStatsTimestamp(e),k.connectionQuality&&useConferenceStore.setState(A=>{let j=new Map(A.connectionQuality);return j.set(e,k.connectionQuality),{connectionQuality:j}})}onParticipantPropertyChanged(e,k,A,j){let M=e.getId();M&&k===`raisedHand`&&(j?useConferenceStore.getState().raiseHand(M,parseInt(j,10)):useConferenceStore.getState().lowerHand(M))}onUserRoleChanged(e,k){if(typeof e==`string`&&(k===PARTICIPANT_ROLE.MODERATOR||k===PARTICIPANT_ROLE.NONE)){useParticipantStore.getState().updateParticipant(e,{role:k});let A=useParticipantStore.getState().localParticipant.pid;k===PARTICIPANT_ROLE.MODERATOR&&e===A&&useConfigStore.getState().autoStartRecording&&setTimeout(()=>{startRecording()},100)}}onTrackUnmuteRejected(e){if(!e.isLocal())return;let k=getMediaType(e);e.dispose().catch(()=>{}),useTracksStore.getState().updateLocalTrack(k,{originalTrack:void 0,muted:1}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`Your ${k} unmute was rejected.`}})}onTalkWhileMuted(){}onConferenceError(e){e instanceof Error?useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.message}):useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.toString()})}onTrackAudioLevelChanged(e,k){let A=useParticipantStore.getState().localParticipant;e!==A.pid||getLocalTrack(MEDIA_TYPE.AUDIO)?.muted||useConferenceStore.getState().raiseHandMap.has(A.pid)&&k>.2&&lowerHandLocal()}};const conferenceListener=new ConferenceListener,HumanParticipantSchema=valibot.object({name:valibot.string(),pid:valibot.string(),ruid:valibot.string(),role:valibot.picklist(Object.values(PARTICIPANT_ROLE)),uid:valibot.optional(valibot.string()),avatar:valibot.optional(valibot.string()),isLocal:valibot.boolean(),sources:valibot.optional(valibot.map(valibot.union([valibot.literal(`video`),valibot.literal(`audio`)]),valibot.map(valibot.string(),valibot.any()))),type:valibot.literal(`human`)}),UserInfoCommandSchema=valibot.pick(HumanParticipantSchema,[`avatar`,`uid`]),PEER_CALL_PC_STATS_INTERVAL_MS=4e3;function initializeLib(e){__cometchat_calls_lib_webrtc.default.init(e),__cometchat_calls_lib_webrtc.default.setLogLevel(__cometchat_calls_lib_webrtc.default.logLevels.ERROR)}function addConferenceListeners(e){e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_JOINED,conferenceListener.onUserJoined),e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_LEFT,conferenceListener.onUserLeft),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_ADDED,conferenceListener.onTrackAdded),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_REMOVED,conferenceListener.onTrackRemoved),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_JOIN_IN_PROGRESS,conferenceListener.onConferenceJoinInProgress),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_FAILED,conferenceListener.onConferenceFailed),e.on(__cometchat_calls_lib_webrtc.default.events.conference.RECORDER_STATE_CHANGED,conferenceListener.onRecorderStateChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_ESTABLISHED,conferenceListener.onConnectionEstablished),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_INTERRUPTED,conferenceListener.onConnectionInterrupted),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_RESTORED,conferenceListener.onConnectionRestored),e.on(__cometchat_calls_lib_webrtc.default.events.conference.P2P_STATUS,conferenceListener.onP2PStatus),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_MUTE_CHANGED,conferenceListener.onTrackMuteChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_JOINED,conferenceListener.onConferenceJoined),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_LEFT,conferenceListener.onConferenceLeft),e.on(__cometchat_calls_lib_webrtc.default.events.conference.PARTICIPANT_SOURCE_UPDATED,conferenceListener.onParticipantSourceUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_CREATED_TIMESTAMP,conferenceListener.onConferenceCreatedTimestamp),e.on(__cometchat_calls_lib_webrtc.default.events.conference.DOMINANT_SPEAKER_CHANGED,conferenceListener.onDominantSpeakerChanged),e.on(__cometchat_calls_lib_webrtc.default.events.connectionQuality.LOCAL_STATS_UPDATED,conferenceListener.onLocalStatsUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.connectionQuality.REMOTE_STATS_UPDATED,conferenceListener.onRemoteStatsUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.conference.PARTICIPANT_PROPERTY_CHANGED,conferenceListener.onParticipantPropertyChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_ROLE_CHANGED,conferenceListener.onUserRoleChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TALK_WHILE_MUTED,conferenceListener.onTalkWhileMuted),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_UNMUTE_REJECTED,conferenceListener.onTrackUnmuteRejected),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_AUDIO_LEVEL_CHANGED,conferenceListener.onTrackAudioLevelChanged),e.addCommandListener(CONFERENCE_COMMANDS.userInfo,(e,k)=>{let A=valibot.safeParse(UserInfoCommandSchema,safeParseJson(e.value));A.success&&useParticipantStore.getState().updateParticipant(k,{avatar:A.output.avatar,uid:A.output.uid})})}async function _createConference(){let e=useConfigStore.getState().sessionId,k=useConnectionStore.getState().connection;if(!k)throw Error(`No connection available`);if(useConnectionStore.getState().connectionStatus!==`connected`&&await waitForConnection(),useConferenceStore.getState().conference)return;let A=useConnectionStore.getState().connectionConfig;A&&useConfigStore.getState().isPeerCall&&(A.pcStatsInterval=PEER_CALL_PC_STATS_INTERVAL_MS);let j=k.initJitsiConference(e,A),M=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack,N=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;M&&j.addTrack(M),N&&j.addTrack(N),useParticipantStore.getState().updateLocalParticipant({pid:j.myUserId()}),addConferenceListeners(j),useConferenceStore.getState().conferenceWillJoin(j),j.setDisplayName(useParticipantStore.getState().localParticipant.name),j.join()}async function createConference(){if(!useConferenceStore.getState().conference){let e=await tryCatch(_createConference());e.error&&useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.error.message})}}function muteParticipant(e){useConferenceStore.getState().conference?.muteParticipant(e,`audio`)}function pauseParticipantVideo(e){useConferenceStore.getState().conference?.muteParticipant(e,`video`)}var Mutex=class{lock=Promise.resolve();async run(e){let k,A=new Promise(e=>{k=e}),j=this.lock;this.lock=j.then(()=>A),await j;try{return await e()}finally{k()}}};function runOnce(e){let k=!1,A;return function(...j){return k||(k=!0,A=e.apply(this,j)),A}}function areDevicesDifferent(e=[],k=[]){if(e.length!==k.length)return!0;for(let A of e)if(!k.find(({deviceId:e,groupId:k,kind:j,label:M})=>A.deviceId===e&&A.groupId===k&&A.kind===j&&A.label===M))return!0;return!1}function isLabelEmpty(){let e=useBaseStore.getState().audioInputDevices,k=useBaseStore.getState().videoInputDevices,A=[...e,...k],j=useConfigStore.getState().sessionType;return!!A.filter(e=>e.kind===`audioinput`||j===`VIDEO`).some(e=>e.label===``)}function updateInputOutputDevices(e=!1){if(e&&isLabelEmpty())return;let{mediaDevices:k}=__cometchat_calls_lib_webrtc.default;k.isDeviceChangeAvailable()&&k.enumerateDevices(e=>{let k=e.filter(e=>e.kind===`audioinput`&&e.deviceId!==``),A=e.filter(e=>e.kind===`audiooutput`&&e.deviceId!==``),j=e.filter(e=>e.kind===`videoinput`&&e.deviceId!==``);useBaseStore.setState({audioInputDevices:k,audioOutputDevices:A,videoInputDevices:j})})}function _initDeviceList(){let{mediaDevices:e}=__cometchat_calls_lib_webrtc.default;e.addEventListener(__cometchat_calls_lib_webrtc.default.events.mediaDevices.DEVICE_LIST_CHANGED,e=>{let k=useBaseStore.getState().audioInputDevices,A=useBaseStore.getState().audioOutputDevices,j=useBaseStore.getState().videoInputDevices,M=k.concat(A,j);setTimeout(()=>{areDevicesDifferent(M,e)&&updateInputOutputDevices()},0)}),updateInputOutputDevices()}const initDeviceList=runOnce(_initDeviceList);let isSessionStarted=!1,reconnectTimeoutId=null;const RECONNECT_DEBOUNCE_DELAY=3e3;initializeLib();function startSession(){if(!useConfigStore.getState().sessionId||isSessionStarted)return;initializeLib(useConfigStore.getState().isPeerCall?{pcStatsInterval:PEER_CALL_PC_STATS_INTERVAL_MS}:void 0),isSessionStarted=!0,createLocalTracks();let e=useConfigStore.getState().audioOutputDeviceId??useBaseStore.getState().audioOutputDevice?.deviceId;e&&updateAudioOutputDevice(e),eventBus.startEmitting();let k=tryCatchSync(()=>connect());if(k.error){useConnectionStore.getState().connectionFailed({name:`connection.otherError`,message:k.error.message});return}initDeviceList()}async function _leaveSession(){isSessionStarted!==!1&&(isSessionStarted=!1,await Promise.all([disposeLocalTracks(),useConferenceStore.getState().leaveConference()]),await useConnectionStore.getState().disconnect())}const sessionMutex=new Mutex;function leaveSession(e={}){return sessionMutex.run(async()=>{let k=useConfigStore.getState().isPeerCall;if(e.shouldEndSession||k&&!e.forceLeave){useConferenceStore.getState().endConference();return}useBaseStore.getState().clearIdealTimeoutTimer(),cancelPendingReconnect(),await _leaveSession(),resetAllStores()})}async function leaveSessionDueToIdleTimeout(){eventBus.publish({type:`onSessionTimedOut`}),await leaveSession()}async function reconnectSession(){return reconnectTimeoutId&&=(clearTimeout(reconnectTimeoutId),null),new Promise((e,k)=>{reconnectTimeoutId=setTimeout(async()=>{try{await _reconnectSession(),e()}catch(e){k(e)}finally{reconnectTimeoutId=null}},3e3)})}function cancelPendingReconnect(){reconnectTimeoutId&&=(clearTimeout(reconnectTimeoutId),null)}async function _reconnectSession(){if(useBaseStore.getState().connectionRetryCount>=3&&isSessionStarted===!0){await leaveSession();return}useBaseStore.getState().incrementConnectionRetryCount(),await _leaveSession(),useConnectionStore.getState().reset(),useConferenceStore.getState().reset(),useTracksStore.getState().reset(),startSession()}async function connect(e=!0){if(useConnectionStore.getState().connection){createConference();return}let k=useConnectionStore.getState().connectionConfig,A=useConnectionStore.getState().jwt,j=useConfigStore.getState().iAmRecorder;k&&j&&(k.p2p={enabled:!1});let M=new __cometchat_calls_lib_webrtc.default.JitsiConnection(null,A,k);useConnectionStore.getState().connectionWillConnect(M),M.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_ESTABLISHED,N),M.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_FAILED,P),M.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_DISCONNECTED,F),M.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.PROPERTIES_UPDATED,I);async function N(){M.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_ESTABLISHED,N),useConnectionStore.getState().connectionEstablished(M),eventBus.publish({type:INTERNAL_EVENTS.onConnectionEstablished}),e&&createConference()}function P(e,k,...A){L();let j={name:e,message:k,details:A[1],recoverable:!isFatalConnectionError({name:e})};useConnectionStore.getState().connectionFailed(j),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionFailed,payload:j}),isFatalConnectionError(j)?leaveSession():reconnectSession()}function F(){}function I(e){}function L(){M.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.PROPERTIES_UPDATED,I),M.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_FAILED,P),M.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_DISCONNECTED,F)}let R=localStorage.getItem(`xmpp_username_override`),z=localStorage.getItem(`xmpp_password_override`);R&&z?(M.addFeature(`http://jitsi.org/protocol/jibri`),M.connect({id:R,password:z})):M.connect()}function startScreenSharing(){let e=useBaseStore.getState().desktopSharingFrameRate;__cometchat_calls_lib_webrtc.default.createLocalTracks({devices:[`desktop`],desktopSharingFrameRate:e}).then(e=>{let k=e.find(e=>e.getType()===`video`),A=e.find(e=>e.getType()===`audio`);A&&A.dispose(),k&&k.getTrack().applyConstraints({width:{max:1920},height:{max:1080}}).finally(()=>onTrack(k))}).catch(e=>{e?.name!==`gum.screensharing_user_canceled`&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:e?.message||`An error occurred while starting screen share.`}})})}function stopScreenSharing(){useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.SCREENSHARE,{muted:1})}function addScreenShareParticipant(e){if(!e||e.isMuted())return;let k=useParticipantStore.getState().participants,A=useParticipantStore.getState().localParticipant,j=e.isLocal()?A:k.find(k=>k.pid===e.getParticipantId());j&&(useParticipantStore.getState().addVirtualParticipant({...j,type:`screen-share`,name:j.name,ruid:`${j.pid}-screen-share`}),useParticipantStore.getState().pinParticipant(j.pid,`screen-share`),e.isLocal()?eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onScreenShareStarted}):sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedScreenShare,j.pid))}function removeScreenShareParticipant(e){useParticipantStore.getState().removeVirtualParticipant(e,`screen-share`),useParticipantStore.getState().localParticipant.pid===e?eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onScreenShareStopped}):sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedScreenShare,e)}useBaseStore.subscribe(e=>e.desktopSharingFrameRate,e=>{useConferenceStore.getState().conference});const streamingStatusTimers=new Map;function onTrack(e){if(e.isLocal()){updateInputOutputDevices(!0);let k=getLocalTrack(e.getType())?.muted;useTracksStore.getState().updateLocalTrack(getMediaType(e),{originalTrack:e,...e.getVideoType()===`desktop`?{muted:0}:typeof k==`boolean`?{muted:k}:{}}),e.on(__cometchat_calls_lib_webrtc.default.events.track.LOCAL_TRACK_STOPPED,e=>{e.getVideoType()===`desktop`&&stopScreenSharing()})}else useTracksStore.getState().addTrack(e);e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED),e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED,e=>{e.isLocal()||useTracksStore.getState().updateTrack(e,{muted:e.isMuted()?1:0})}),e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED,k=>{useTracksStore.getState().updateTrack(e,{videoType:k,mediaType:k===`desktop`?`screenshare`:`video`})}),!e.isLocal()&&e.isVideoTrack()&&e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED,(e,k)=>{let A=e.getTrackId?.()??e.getId?.(),j=streamingStatusTimers.get(A);j&&(clearTimeout(j),streamingStatusTimers.delete(A));let M=useConferenceStore.getState().conference;k===`interrupted`&&M.isP2PActive()?streamingStatusTimers.set(A,setTimeout(()=>{streamingStatusTimers.delete(A),useTracksStore.getState().updateTrack(e,{streamingStatus:k})},4e3)):useTracksStore.getState().updateTrack(e,{streamingStatus:k})})}const RegionLiteralSchema=valibot.union([valibot.literal(`eu`),valibot.literal(`us`),valibot.literal(`in`),valibot.literal(`EU`),valibot.literal(`US`),valibot.literal(`IN`)]),RegionSchema=valibot.pipe(valibot.string(),valibot.transform(e=>e.toLowerCase()),RegionLiteralSchema),CallAppSettingsSchema=valibot.object({appId:valibot.string(),region:RegionSchema,authKey:valibot.optional(valibot.string()),adminHost:valibot.optional(valibot.string()),clientHost:valibot.optional(valibot.string()),host:valibot.optional(valibot.string()),disableSdkIdentification:valibot.optional(valibot.boolean())});function callAppSettingsFromSettings(e){let k=e.callsSDK??{},A={appId:e.appId,region:e.region};return e.credentials?.authKey&&(A.authKey=e.credentials.authKey),k.adminHost&&(A.adminHost=k.adminHost),k.clientHost&&(A.clientHost=k.clientHost),k.host&&(A.host=k.host),k.disableSdkIdentification!=null&&(A.disableSdkIdentification=!!k.disableSdkIdentification),A}const CometChatEvent=new Proxy(react_native.NativeModules.CometChatEvent??{},{get:(e,k)=>typeof e[k]==`function`?e[k]:()=>{}});eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionJoined,CometChatEvent.onSessionJoined),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionLeft,CometChatEvent.onSessionLeft),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionLost,CometChatEvent.onConnectionLost),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionRestored,CometChatEvent.onConnectionRestored),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionClosed,CometChatEvent.onConnectionClosed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionTimedOut,CometChatEvent.onSessionTimedOut),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioMuted,CometChatEvent.onAudioMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioUnMuted,CometChatEvent.onAudioUnMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onVideoPaused,CometChatEvent.onVideoPaused),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onVideoResumed,CometChatEvent.onVideoResumed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onRecordingStarted,CometChatEvent.onRecordingStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onRecordingStopped,CometChatEvent.onRecordingStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onStreamingStarted,CometChatEvent.onStreamingStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onStreamingStopped,CometChatEvent.onStreamingStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onScreenShareStarted,CometChatEvent.onScreenShareStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onScreenShareStopped,CometChatEvent.onScreenShareStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModeChanged,CometChatEvent.onAudioModeChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModesChanged,CometChatEvent.onAudioModesChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onCameraFacingChanged,CometChatEvent.onCameraFacingChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantJoined,CometChatEvent.onParticipantJoined),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantLeft,CometChatEvent.onParticipantLeft),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantAudioMuted,CometChatEvent.onParticipantAudioMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantAudioUnmuted,CometChatEvent.onParticipantAudioUnmuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantVideoPaused,CometChatEvent.onParticipantVideoPaused),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantVideoResumed,CometChatEvent.onParticipantVideoResumed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantHandRaised,CometChatEvent.onParticipantHandRaised),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantHandLowered,CometChatEvent.onParticipantHandLowered),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedScreenShare,CometChatEvent.onParticipantStartedScreenShare),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedScreenShare,CometChatEvent.onParticipantStoppedScreenShare),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedRecording,CometChatEvent.onParticipantStartedRecording),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedRecording,CometChatEvent.onParticipantStoppedRecording),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedStreaming,CometChatEvent.onParticipantStartedStreaming),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedStreaming,CometChatEvent.onParticipantStoppedStreaming),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onDominantSpeakerChanged,CometChatEvent.onDominantSpeakerChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantListChanged,CometChatEvent.onParticipantListChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onLeaveSessionButtonClicked,CometChatEvent.onLeaveSessionButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onRaiseHandButtonClicked,CometChatEvent.onRaiseHandButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onShareInviteButtonClicked,CometChatEvent.onShareInviteButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChangeLayoutButtonClicked,CometChatEvent.onChangeLayoutButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onParticipantListButtonClicked,CometChatEvent.onParticipantListButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onToggleAudioButtonClicked,CometChatEvent.onToggleAudioButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onToggleVideoButtonClicked,CometChatEvent.onToggleVideoButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onSwitchCameraButtonClicked,CometChatEvent.onSwitchCameraButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChatButtonClicked,CometChatEvent.onChatButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onRecordingToggleButtonClicked,CometChatEvent.onRecordingToggleButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onCallLayoutChanged,CometChatEvent.onCallLayoutChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListVisible,CometChatEvent.onParticipantListVisible),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListHidden,CometChatEvent.onParticipantListHidden),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutEnabled,CometChatEvent.onPictureInPictureLayoutEnabled),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutDisabled,CometChatEvent.onPictureInPictureLayoutDisabled);const constants$1={MUTE_AUDIO:`MUTE_AUDIO`,UNMUTE_AUDIO:`UNMUTE_AUDIO`,PAUSE_VIDEO:`PAUSE_VIDEO`,RESUME_VIDEO:`RESUME_VIDEO`,ENABLE_PICTURE_IN_PICTURE_LAYOUT:`ENABLE_PICTURE_IN_PICTURE_LAYOUT`,DISABLE_PICTURE_IN_PICTURE_LAYOUT:`DISABLE_PICTURE_IN_PICTURE_LAYOUT`,LEAVE_SESSION:`LEAVE_SESSION`,RAISE_HAND:`RAISE_HAND`,LOWER_HAND:`LOWER_HAND`,MUTE_PARTICIPANT:`MUTE_PARTICIPANT`,PAUSE_PARTICIPANT_VIDEO:`PAUSE_PARTICIPANT_VIDEO`,PIN_PARTICIPANT:`PIN_PARTICIPANT`,UNPIN_PARTICIPANT:`UNPIN_PARTICIPANT`,SET_AUDIO_MODE:`SET_AUDIO_MODE`,SET_LAYOUT:`SET_LAYOUT`,SWITCH_CAMERA:`SWITCH_CAMERA`,START_RECORDING:`START_RECORDING`,STOP_RECORDING:`STOP_RECORDING`,START_STREAMING:`START_STREAMING`,STOP_STREAMING:`STOP_STREAMING`,START_SCREEN_SHARE:`START_SCREEN_SHARE`,STOP_SCREEN_SHARE:`STOP_SCREEN_SHARE`,SET_CHAT_BUTTON_UNREAD_COUNT:`SET_CHAT_BUTTON_UNREAD_COUNT`};function setupNativeEventListeners(){let{CometChatEventEmitter:e}=react_native.NativeModules,k=react_native.Platform.select({default:e?new react_native.NativeEventEmitter(e):null,android:react_native.DeviceEventEmitter}),A=[];if(!k)return;let j=k.addListener(constants$1.MUTE_AUDIO,()=>{muteAudioTrack()});A.push(j);let M=k.addListener(constants$1.UNMUTE_AUDIO,()=>{unMuteAudioTrack()});A.push(M);let N=k.addListener(constants$1.PAUSE_VIDEO,()=>{pauseVideoTrack()});A.push(N);let P=k.addListener(constants$1.RESUME_VIDEO,()=>{resumeVideoTrack()});A.push(P);let F=k.addListener(constants$1.ENABLE_PICTURE_IN_PICTURE_LAYOUT,()=>{enablePictureInPictureLayout()});A.push(F);let I=k.addListener(constants$1.DISABLE_PICTURE_IN_PICTURE_LAYOUT,()=>{disablePictureInPictureLayout()});A.push(I);let L=k.addListener(constants$1.LEAVE_SESSION,()=>{leaveSession()});A.push(L);let R=k.addListener(constants$1.RAISE_HAND,()=>{});A.push(R);let z=k.addListener(constants$1.LOWER_HAND,()=>{});A.push(z);let B=k.addListener(constants$1.MUTE_PARTICIPANT,e=>{typeof e.pid==`string`&&muteParticipant(e.pid)});A.push(B);let V=k.addListener(constants$1.PAUSE_PARTICIPANT_VIDEO,e=>{typeof e.pid==`string`&&pauseParticipantVideo(e.pid)});A.push(V);let H=k.addListener(constants$1.PIN_PARTICIPANT,()=>{});A.push(H);let W=k.addListener(constants$1.UNPIN_PARTICIPANT,()=>{});A.push(W);let G=k.addListener(constants$1.SET_AUDIO_MODE,()=>{});A.push(G);let K=k.addListener(constants$1.SET_LAYOUT,()=>{});A.push(K);let q=k.addListener(constants$1.SWITCH_CAMERA,()=>{switchCamera()});A.push(q);let J=k.addListener(constants$1.START_RECORDING,()=>{});A.push(J);let Y=k.addListener(constants$1.STOP_RECORDING,()=>{});A.push(Y);let X=k.addListener(constants$1.START_STREAMING,e=>{typeof e.streamUrl==`string`&&typeof e.streamKey==`string`&&startStreaming(e.streamUrl,e.streamKey)});A.push(X);let Z=k.addListener(constants$1.STOP_STREAMING,()=>{stopStreaming()});A.push(Z);let Q=k.addListener(constants$1.START_SCREEN_SHARE,()=>{});A.push(Q);let $=k.addListener(constants$1.STOP_SCREEN_SHARE,()=>{});A.push($),k.addListener(constants$1.SET_CHAT_BUTTON_UNREAD_COUNT,e=>{typeof e.count==`number`&&setChatButtonUnreadCount(e.count)}),useBaseStore.getState().addSubscriptions(A)}setupNativeEventListeners();let AudioMode=function(e){return e[e.DEFAULT=0]=`DEFAULT`,e[e.AUDIO_CALL=1]=`AUDIO_CALL`,e[e.VIDEO_CALL=2]=`VIDEO_CALL`,e}({});const AudioModeModule=react_native.NativeModules.AudioMode,AudioModeEventEmitter=new react_native.NativeEventEmitter(AudioModeModule);var AudioModeModule_default=AudioModeModule;function requestAudioModeChange(e){let k=typeof e==`string`?e:e.type;if(k===`EARPIECE`&&useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO)return Promise.reject({errorCode:`ERROR_INVALID_AUDIO_MODE`,errorDescription:`EARPIECE is not allowed during a video call`});let A=useBaseStore.getState().audioModes,j=typeof e==`string`?A.find(k=>k.type===e):e;return j?Promise.resolve(AudioModeModule_default.setAudioDevice(j.uid||j.type)):Promise.reject({errorCode:`ERROR_AUDIO_MODE_UNAVAILABLE`,errorDescription:`Audio mode ${k} is not available`})}const MultitaskingCameraModule=react_native.NativeModules.MultitaskingCamera,isMultitaskingCameraAccessSupported=react_native.Platform.OS===`ios`&&MultitaskingCameraModule?.isSupported===!0;var MultitaskingCameraModule_default=MultitaskingCameraModule;const cameraSurvivesBackground=()=>isMultitaskingCameraAccessSupported&&useConfigStore.getState().enableIOSPictureInPicture;let appStateSubscription=null;eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount,()=>{appStateSubscription?.remove(),appStateSubscription=react_native.AppState.addEventListener(`change`,e=>{useBaseStore.setState({appState:e})})}),eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentWillUnmount,()=>{appStateSubscription?.remove(),appStateSubscription=null}),useBaseStore.subscribe(e=>e.appState,async e=>{if(!(!getIsConferenceJoined()||useConfigStore.getState().sessionType!==SESSION_TYPE.VIDEO))if(e===`active`)resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);else{if(await new Promise(e=>setTimeout(e,2e3)),useBaseStore.getState().isPIPLayoutEnabled||cameraSurvivesBackground())return;pauseVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND)}});const KeepAwakeModule=react_native.NativeModules.KeepAwakeModule;var KeepAwakeModule_default=KeepAwakeModule;useConferenceStore.subscribe(e=>e.conferenceStatus,e=>{e===`joined`||e===`restored`?KeepAwakeModule_default.activateKeepAwake():KeepAwakeModule_default.deactivateKeepAwake()});async function queryPermissions(){try{let[e,k]=await Promise.all([react_native_webrtc.permissions.query({name:`microphone`}),react_native_webrtc.permissions.query({name:`camera`})]);useTracksStore.setState(A=>({permissions:{...A.permissions,video:e===`granted`,audio:k===`granted`,initialized:!0}}))}catch{}}eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount,()=>{queryPermissions()}),eventBus.subscribe(INTERNAL_EVENTS.queryPermission,()=>{queryPermissions()});const spacing={base:2,1:4,2:8,3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,13:52,14:56,15:60,16:64,17:68,18:72,19:76,20:80,max:1e3},padding={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],7:spacing[7],8:spacing[8],9:spacing[9],10:spacing[10]},margin={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],7:spacing[7],8:spacing[8],9:spacing[9],10:spacing[10],11:spacing[11],12:spacing[12],13:spacing[13],14:spacing[14],15:spacing[15],16:spacing[16],17:spacing[17],18:spacing[18],19:spacing[19],20:spacing[20]},borderRadius={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],max:spacing.max},fontFamily={primary:`Roboto`},typography={title:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:32,lineHeight:38.4},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:32,lineHeight:38.4},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:32,lineHeight:38.4}},heading1:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:24,lineHeight:28.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:24,lineHeight:28.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:24,lineHeight:28.8}},heading2:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:20,lineHeight:24},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:20,lineHeight:24},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:20,lineHeight:24}},heading3:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:18,lineHeight:21.6},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:18,lineHeight:21.6},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:18,lineHeight:21.6}},heading4:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:16,lineHeight:19.2},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:16,lineHeight:19.2},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:16,lineHeight:19.2}},body:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:14,lineHeight:16.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:14,lineHeight:16.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:16.8}},caption1:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:12,lineHeight:14.4},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:12,lineHeight:14.4},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:12,lineHeight:14.4}},caption2:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:10,lineHeight:12},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:10,lineHeight:12},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:10,lineHeight:12}},button:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:14,lineHeight:16.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:14,lineHeight:16.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:16.8}},link:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:19.6}},colors={primary:`#6852d6`,extendedPrimary:{50:`#15102b`,100:`#1d173c`,200:`#251e4d`,300:`#2e245e`,400:`#362b6f`,500:`#3e3180`,600:`#473892`,700:`#4f3ea3`,800:`#5745b4`,900:`#7460d9`},neutral:{50:`#141414`,100:`#1a1a1a`,200:`#272727`,300:`#383838`,400:`#4c4c4c`,500:`#858585`,600:`#989898`,700:`#a8a8a8`,800:`#c8c8c8`,900:`#ffffff`},alert:{successBackground:`#ceecdf`,warningBackground:`#fff5cf`,errorBackground:`#f4d8d8`,permissionErrorColor:`#ff977d`,permissionErrorBackground:`#391716`,info:`#0d66bf`,warning:`#d08d04`,success:`#0b9f5d`,messageSeen:`#56e8a7`,error:`#c73c3e`,callControlActiveBackground:`#f4cccc`},static:{black:`#141414`,white:`#ffffff`},background:{1:`#141414`,2:`#1a1a1a`,3:`#272727`,4:`#383838`},border:{light:`#272727`,default:`#383838`,dark:`#4c4c4c`,highlight:`#6852d6`},text:{primary:`#ffffff`,secondary:`#989898`,tertiary:`#858585`,disabled:`#4c4c4c`,white:`#141414`,highlight:`#6852d6`},icon:{primary:`#ffffff`,secondary:`#858585`,tertiary:`#4c4c4c`,white:`#141414`,highlight:`#6852d6`},shimmer:{background:`#141414`,gradient:[`#383838`,`#272727`]},button:{primaryBackground:`#6852d6`,primaryText:`#ffffff`,primaryIcon:`#ffffff`,secondaryBackground:`#ffffff`,secondaryText:`#ffffff`,secondaryIcon:`#ffffff`,link:`#0d66bf`,fabBackground:`#6852d6`,fabIcon:`#ffffff`,whiteHover:`#1a1a1a`,whitePressed:`#383838`}},layout={participantsList:{width:360},callHeader:{height:56},callFooter:{height:88}},commonStyles=react_native.StyleSheet.create({titleBold:typography.title.bold,titleMedium:typography.title.medium,titleRegular:typography.title.regular,heading1Bold:typography.heading1.bold,heading1Medium:typography.heading1.medium,heading1Regular:typography.heading1.regular,heading2Bold:typography.heading2.bold,heading2Medium:typography.heading2.medium,heading2Regular:typography.heading2.regular,heading3Bold:typography.heading3.bold,heading3Medium:typography.heading3.medium,heading3Regular:typography.heading3.regular,heading4Bold:typography.heading4.bold,heading4Medium:typography.heading4.medium,heading4Regular:typography.heading4.regular,bodyBold:typography.body.bold,bodyMedium:typography.body.medium,bodyRegular:typography.body.regular,caption1Bold:typography.caption1.bold,caption1Medium:typography.caption1.medium,caption1Regular:typography.caption1.regular,caption2Bold:typography.caption2.bold,caption2Medium:typography.caption2.medium,caption2Regular:typography.caption2.regular,buttonBold:typography.button.bold,buttonMedium:typography.button.medium,buttonRegular:typography.button.regular,link:typography.link,backgroundPrimary:{backgroundColor:colors.background[1]},backgroundSecondary:{backgroundColor:colors.background[2]},backgroundTertiary:{backgroundColor:colors.background[3]},backgroundQuaternary:{backgroundColor:colors.background[4]},textPrimary:{color:colors.text.primary},textSecondary:{color:colors.text.secondary},textTertiary:{color:colors.text.tertiary},textDisabled:{color:colors.text.disabled},textHighlight:{color:colors.text.highlight},borderLight:{borderColor:colors.border.light},borderDefault:{borderColor:colors.border.default},borderDark:{borderColor:colors.border.dark},borderHighlight:{borderColor:colors.border.highlight},absoluteFill:{position:`absolute`,top:0,bottom:0,left:0,right:0},flex1:{flex:1},flexRow:{flexDirection:`row`},flexColumn:{flexDirection:`column`},center:{justifyContent:`center`,alignItems:`center`},spaceBetween:{justifyContent:`space-between`},spaceAround:{justifyContent:`space-around`},paddingSmall:{padding:padding[2]},paddingMedium:{padding:padding[4]},paddingLarge:{padding:padding[6]},marginSmall:{margin:margin[2]},marginMedium:{margin:margin[4]},marginLarge:{margin:margin[6]},radiusSmall:{borderRadius:borderRadius[2]},radiusMedium:{borderRadius:borderRadius[4]},radiusLarge:{borderRadius:borderRadius[6]}}),Avatar=({name:e,imageUrl:k,size:A,fontSize:j,containerStyle:M,textStyle:N})=>{let P=A?{width:A,height:A}:styles$30.avatarWrapper,F=j?{fontSize:j,lineHeight:j*1.2}:{},I=(0,react.useMemo)(()=>k?{}:{backgroundColor:getColorFromName(e)},[k,e]);return(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$30.avatarWrapper,I,P,M],children:k?(0,react_jsx_runtime.jsx)(react_native.Image,{source:{uri:k},style:styles$30.avatarImage,resizeMode:`cover`}):(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading2Bold,styles$30.avatarText,N,F],children:getAvatarTextInitials(e)})})},styles$30=react_native.StyleSheet.create({avatarWrapper:{overflow:`hidden`,backgroundColor:`#3a3a3a`,alignItems:`center`,justifyContent:`center`,width:48,height:48,borderRadius:1e3},avatarImage:{width:`100%`,height:`100%`},avatarText:{color:colors.text.primary}});var Avatar_native_default=Avatar;const PATH_MAP={"arrow-down-2":`M11.0046 5.20898V16.379L6.12461 11.499C5.73461 11.109 5.09461 11.109 4.70461 11.499C4.31461 11.889 4.31461 12.519 4.70461 12.909L11.2946 19.499C11.6846 19.889 12.3146 19.889 12.7046 19.499L19.2946 12.909C19.6846 12.519 19.6846 11.889 19.2946 11.499C18.9046 11.109 18.2746 11.109 17.8846 11.499L13.0046 16.379V5.20898C13.0046 4.65898 12.5546 4.20898 12.0046 4.20898C11.4546 4.20898 11.0046 4.65898 11.0046 5.20898Z`,"arrow-up":`M12.0005 10.4538L7.9275 14.527C7.789 14.6653 7.61492 14.7362 7.40525 14.7395C7.19575 14.7427 7.0185 14.6718 6.8735 14.527C6.72867 14.382 6.65625 14.2063 6.65625 14C6.65625 13.7937 6.72867 13.618 6.8735 13.473L11.3678 8.97876C11.5486 8.7981 11.7595 8.70776 12.0005 8.70776C12.2415 8.70776 12.4524 8.7981 12.6333 8.97876L17.1275 13.473C17.2658 13.6115 17.3367 13.7856 17.34 13.9953C17.3432 14.2048 17.2723 14.382 17.1275 14.527C16.9825 14.6718 16.8068 14.7443 16.6005 14.7443C16.3942 14.7443 16.2185 14.6718 16.0735 14.527L12.0005 10.4538Z`,bluetooth:`M17.65 6.99663L13.36 2.70663C12.73 2.07663 11.65 2.51663 11.65 3.40663V9.58663L7.76 5.69663C7.37 5.30663 6.74 5.30663 6.35 5.69663C5.96 6.08663 5.96 6.71663 6.35 7.10663L11.24 11.9966L6.35 16.8866C5.96 17.2766 5.96 17.9066 6.35 18.2966C6.74 18.6866 7.37 18.6866 7.76 18.2966L11.65 14.4066V20.5866C11.65 21.4766 12.73 21.9266 13.36 21.2966L17.65 16.9966C18.04 16.6066 18.04 15.9766 17.65 15.5866L14.06 11.9966L17.65 8.41663C18.04 8.02663 18.04 7.38663 17.65 6.99663ZM13.65 5.82663L15.53 7.70663L13.65 9.58663V5.82663ZM15.53 16.2866L13.65 18.1666V14.4066L15.53 16.2866Z`,"call-end":`M4.58108 16.0302L6.58108 14.4402C7.06108 14.0602 7.34108 13.4802 7.34108 12.8702V10.2702C10.3611 9.29016 13.6311 9.28016 16.6611 10.2702V12.8802C16.6611 13.4902 16.9411 14.0702 17.4211 14.4502L19.4111 16.0302C20.2111 16.6602 21.3511 16.6002 22.0711 15.8802L23.2911 14.6602C24.0911 13.8602 24.0911 12.5302 23.2411 11.7802C16.8311 6.12016 7.17108 6.12016 0.76108 11.7802C-0.0889204 12.5302 -0.0889204 13.8602 0.71108 14.6602L1.93108 15.8802C2.64108 16.6002 3.78108 16.6602 4.58108 16.0302Z`,car:`M18.92 5.01C18.72 4.42 18.16 4 17.5 4H6.5C5.84 4 5.29 4.42 5.08 5.01L3.11 10.68C3.04 10.89 3 11.11 3 11.34V18.5C3 19.33 3.67 20 4.5 20C5.33 20 6 19.33 6 18.5V18H18V18.5C18 19.32 18.67 20 19.5 20C20.32 20 21 19.33 21 18.5V11.34C21 11.12 20.96 10.89 20.89 10.68L18.92 5.01ZM6.5 15C5.67 15 5 14.33 5 13.5C5 12.67 5.67 12 6.5 12C7.33 12 8 12.67 8 13.5C8 14.33 7.33 15 6.5 15ZM17.5 15C16.67 15 16 14.33 16 13.5C16 12.67 16.67 12 17.5 12C18.33 12 19 12.67 19 13.5C19 14.33 18.33 15 17.5 15ZM5 10L6.27 6.18C6.41 5.78 6.79 5.5 7.22 5.5H16.78C17.21 5.5 17.59 5.78 17.73 6.18L19 10H5Z`,chat:`M20 2H4C2.9 2 2.01 2.9 2.01 4L2 22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2ZM7 9H17C17.55 9 18 9.45 18 10C18 10.55 17.55 11 17 11H7C6.45 11 6 10.55 6 10C6 9.45 6.45 9 7 9ZM13 14H7C6.45 14 6 13.55 6 13C6 12.45 6.45 12 7 12H13C13.55 12 14 12.45 14 13C14 13.55 13.55 14 13 14ZM17 8H7C6.45 8 6 7.55 6 7C6 6.45 6.45 6 7 6H17C17.55 6 18 6.45 18 7C18 7.55 17.55 8 17 8Z`,"check-fill":`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM9.29 16.29L5.7 12.7C5.31 12.31 5.31 11.68 5.7 11.29C6.09 10.9 6.72 10.9 7.11 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.7 16.29C10.32 16.68 9.68 16.68 9.29 16.29Z`,close:`M11.999 13.1163L6.89479 18.2203C6.73379 18.3815 6.54629 18.4614 6.33229 18.4601C6.11845 18.4586 5.93379 18.3773 5.77829 18.2163C5.61995 18.0552 5.54287 17.8697 5.54704 17.6601C5.5512 17.4502 5.62962 17.269 5.78229 17.1163L10.8823 11.9996L5.78229 6.88283C5.62962 6.73016 5.55329 6.54891 5.55329 6.33908C5.55329 6.12941 5.62962 5.944 5.78229 5.78283C5.93512 5.62183 6.11845 5.54058 6.33229 5.53908C6.54629 5.53775 6.73379 5.61483 6.89479 5.77033L11.999 10.8828L17.1115 5.77033C17.267 5.61483 17.4518 5.53775 17.6658 5.53908C17.8796 5.54058 18.0671 5.62183 18.2283 5.78283C18.381 5.944 18.4552 6.12941 18.451 6.33908C18.4469 6.54891 18.3685 6.73016 18.2158 6.88283L13.1158 11.9996L18.2158 17.1163C18.3685 17.269 18.4448 17.4502 18.4448 17.6601C18.4448 17.8697 18.3685 18.0552 18.2158 18.2163C18.063 18.3773 17.8796 18.4586 17.6658 18.4601C17.4518 18.4614 17.267 18.3815 17.1115 18.2203L11.999 13.1163Z`,earpiece:`M19.7885 11.7299C19.5858 11.7299 19.4076 11.658 19.2538 11.5144C19.0999 11.3709 19.0096 11.1927 18.9828 10.9799C18.7661 9.36569 18.0863 7.98719 16.9433 6.84436C15.8003 5.70136 14.4218 5.02153 12.8078 4.80486C12.5949 4.77786 12.4167 4.69003 12.273 4.54136C12.1295 4.39269 12.0578 4.21194 12.0578 3.99911C12.0578 3.78628 12.1321 3.60811 12.2808 3.46461C12.4294 3.32094 12.6051 3.26261 12.8078 3.28961C14.8436 3.51011 16.5792 4.33794 18.0145 5.77311C19.4497 7.20844 20.2775 8.94403 20.498 10.9799C20.525 11.1824 20.4667 11.358 20.323 11.5069C20.1795 11.6555 20.0013 11.7299 19.7885 11.7299ZM15.652 11.7299C15.4865 11.7299 15.3413 11.6741 15.2163 11.5626C15.0913 11.4511 14.9968 11.3024 14.9328 11.1164C14.7801 10.5754 14.5002 10.0981 14.0933 9.68461C13.6863 9.27111 13.2123 8.99136 12.6713 8.84536C12.4853 8.78119 12.3365 8.68661 12.225 8.56161C12.1135 8.43661 12.0578 8.28628 12.0578 8.11061C12.0578 7.86061 12.1439 7.65869 12.3163 7.50486C12.4888 7.35103 12.6846 7.30103 12.9038 7.35486C13.7794 7.55869 14.5339 7.97728 15.1673 8.61061C15.8006 9.24394 16.2224 10.0016 16.4328 10.8836C16.4866 11.1029 16.4324 11.2988 16.2703 11.4711C16.1081 11.6436 15.902 11.7299 15.652 11.7299ZM19.4403 20.4991C17.5558 20.4991 15.6625 20.0609 13.7605 19.1846C11.8587 18.3083 10.1097 17.0721 8.5135 15.4761C6.92383 13.8799 5.69083 12.1324 4.8145 10.2336C3.93817 8.33494 3.5 6.44336 3.5 4.55886C3.5 4.25886 3.6 4.00719 3.8 3.80386C4 3.60069 4.25 3.49911 4.55 3.49911H7.8115C8.064 3.49911 8.28675 3.58153 8.47975 3.74636C8.67275 3.91103 8.7955 4.11453 8.848 4.35686L9.42125 7.29911C9.46092 7.57211 9.45258 7.80669 9.39625 8.00286C9.33975 8.19903 9.23842 8.36378 9.09225 8.49711L6.78275 10.7454C7.15442 11.426 7.57908 12.0699 8.05675 12.6771C8.53425 13.2841 9.05125 13.8639 9.60775 14.4164C10.1564 14.9652 10.7398 15.4749 11.3578 15.9454C11.9757 16.4159 12.6431 16.8537 13.3598 17.2589L15.6038 14.9954C15.7603 14.8325 15.9498 14.7184 16.1723 14.6529C16.3946 14.5875 16.6257 14.5715 16.8655 14.6049L19.6423 15.1704C19.8948 15.237 20.1008 15.3659 20.2605 15.5569C20.4202 15.7479 20.5 15.9645 20.5 16.2069V19.4491C20.5 19.7491 20.3984 19.9991 20.1953 20.1991C19.9919 20.3991 19.7403 20.4991 19.4403 20.4991Z`,"empty-search":`M11.0001 11.6921C10.0348 11.6921 9.2101 11.3501 8.5261 10.6661C7.8421 9.98228 7.5001 9.15761 7.5001 8.19211C7.5001 7.22678 7.8421 6.40211 8.5261 5.71811C9.2101 5.03411 10.0348 4.69211 11.0001 4.69211C11.9654 4.69211 12.7901 5.03411 13.4741 5.71811C14.1581 6.40211 14.5001 7.22678 14.5001 8.19211C14.5001 9.15761 14.1581 9.98228 13.4741 10.6661C12.7901 11.3501 11.9654 11.6921 11.0001 11.6921ZM21.1308 22.1844L18.7271 19.7806C18.3899 19.9934 18.0341 20.1601 17.6596 20.2806C17.2853 20.4011 16.8988 20.4614 16.5001 20.4614C15.3976 20.4614 14.4617 20.0768 13.6923 19.3076C12.9232 18.5383 12.5386 17.6024 12.5386 16.4999C12.5386 15.3974 12.9232 14.4614 13.6923 13.6921C14.4617 12.9229 15.3976 12.5384 16.5001 12.5384C17.6026 12.5384 18.5385 12.9229 19.3078 13.6921C20.077 14.4614 20.4616 15.3974 20.4616 16.4999C20.4616 16.8985 20.4013 17.285 20.2808 17.6594C20.1603 18.0339 19.9937 18.3897 19.7808 18.7269L22.1846 21.1306C22.3231 21.2691 22.3939 21.4431 22.3971 21.6526C22.4003 21.8623 22.3294 22.0395 22.1846 22.1844C22.0398 22.3292 21.8642 22.4016 21.6578 22.4016C21.4513 22.4016 21.2757 22.3292 21.1308 22.1844ZM16.5001 18.9614C17.1938 18.9614 17.7774 18.7245 18.2511 18.2509C18.7248 17.7772 18.9616 17.1935 18.9616 16.4999C18.9616 15.8062 18.7248 15.2225 18.2511 14.7489C17.7774 14.2752 17.1938 14.0384 16.5001 14.0384C15.8064 14.0384 15.2228 14.2752 14.7491 14.7489C14.2754 15.2225 14.0386 15.8062 14.0386 16.4999C14.0386 17.1935 14.2754 17.7772 14.7491 18.2509C15.2228 18.7245 15.8064 18.9614 16.5001 18.9614ZM5.01935 19.3076C4.59751 19.3076 4.23885 19.1599 3.94335 18.8644C3.64785 18.5687 3.5001 18.21 3.5001 17.7884V17.0999C3.5001 16.6037 3.6306 16.1476 3.8916 15.7316C4.15243 15.3156 4.51043 14.9922 4.9656 14.7614C5.66426 14.4037 6.49018 14.0842 7.44335 13.8029C8.39651 13.5214 9.43726 13.3614 10.5656 13.3229C10.7591 13.3127 10.9058 13.3944 11.0058 13.5681C11.1058 13.7418 11.1174 13.9254 11.0406 14.1191C10.8764 14.5038 10.7518 14.8977 10.6666 15.3009C10.5813 15.704 10.5386 16.1114 10.5386 16.5229C10.5386 16.8472 10.5648 17.1741 10.6173 17.5036C10.67 17.8331 10.7592 18.1498 10.8848 18.4536C10.9592 18.6678 10.9396 18.8636 10.8261 19.0411C10.7126 19.2188 10.5488 19.3076 10.3348 19.3076H5.01935Z`,error:`M9.16602 12.5003H10.8327V14.167H9.16602V12.5003ZM9.16602 5.83366H10.8327V10.8337H9.16602V5.83366ZM9.99102 1.66699C5.39102 1.66699 1.66602 5.40033 1.66602 10.0003C1.66602 14.6003 5.39102 18.3337 9.99102 18.3337C14.5993 18.3337 18.3327 14.6003 18.3327 10.0003C18.3327 5.40033 14.5993 1.66699 9.99102 1.66699ZM9.99935 16.667C6.31602 16.667 3.33268 13.6837 3.33268 10.0003C3.33268 6.31699 6.31602 3.33366 9.99935 3.33366C13.6827 3.33366 16.666 6.31699 16.666 10.0003C16.666 13.6837 13.6827 16.667 9.99935 16.667Z`,headphones:`M3 12V19C3 20.1 3.9 21 5 21H7C8.1 21 9 20.1 9 19V15C9 13.9 8.1 13 7 13H5V12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12V13H17C15.9 13 15 13.9 15 15V19C15 20.1 15.9 21 17 21H19C20.1 21 21 20.1 21 19V12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12Z`,mic:`M12 14.5C13.66 14.5 15 13.16 15 11.5V5.5C15 3.84 13.66 2.5 12 2.5C10.34 2.5 9 3.84 9 5.5V11.5C9 13.16 10.34 14.5 12 14.5ZM11 5.5C11 4.95 11.45 4.5 12 4.5C12.55 4.5 13 4.95 13 5.5V11.5C13 12.05 12.55 12.5 12 12.5C11.45 12.5 11 12.05 11 11.5V5.5ZM17 11.5C17 14.26 14.76 16.5 12 16.5C9.24 16.5 7 14.26 7 11.5H5C5 15.03 7.61 17.93 11 18.42V21.5H13V18.42C16.39 17.93 19 15.03 19 11.5H17Z`,"mic-fill":`M11.999 14.5C13.659 14.5 14.999 13.16 14.999 11.5V5.5C14.999 3.84 13.659 2.5 11.999 2.5C10.339 2.5 8.99901 3.84 8.99901 5.5V11.5C8.99901 13.16 10.339 14.5 11.999 14.5ZM17.909 11.5C17.419 11.5 17.009 11.86 16.929 12.35C16.519 14.7 14.469 16.5 11.999 16.5C9.52901 16.5 7.47901 14.7 7.06901 12.35C6.98901 11.86 6.57901 11.5 6.08901 11.5C5.47901 11.5 4.99901 12.04 5.08901 12.64C5.57901 15.64 7.97901 17.99 10.999 18.42V20.5C10.999 21.05 11.449 21.5 11.999 21.5C12.549 21.5 12.999 21.05 12.999 20.5V18.42C16.019 17.99 18.419 15.64 18.909 12.64C19.009 12.04 18.519 11.5 17.909 11.5Z`,"mic-off":`M10.7219 5.38999C10.7219 4.72999 11.2619 4.18999 11.9219 4.18999C12.5819 4.18999 13.1219 4.72999 13.1219 5.38999L13.1119 9.29999L14.9219 11.09V5.48999C14.9219 3.82999 13.5819 2.48999 11.9219 2.48999C10.3819 2.48999 9.13188 3.64999 8.96187 5.13999L10.7219 6.89999V5.38999ZM18.9219 11.49H17.2219C17.2219 12.07 17.1219 12.62 16.9519 13.13L18.2219 14.4C18.6619 13.52 18.9219 12.53 18.9219 11.49ZM4.33187 3.34999L2.92188 4.75999L8.92188 10.76V11.49C8.92188 13.15 10.2619 14.49 11.9219 14.49C12.1519 14.49 12.3619 14.46 12.5719 14.41L14.2319 16.07C13.5219 16.4 12.7319 16.59 11.9219 16.59C9.16187 16.59 6.62187 14.49 6.62187 11.49H4.92188C4.92188 14.9 7.64188 17.72 10.9219 18.21V21.49H12.9219V18.21C13.8319 18.08 14.6919 17.76 15.4719 17.31L19.6719 21.51L21.0819 20.1L4.33187 3.34999Z`,"mic-off-fill":`M16.5203 13.9018C16.3446 13.8069 16.2282 13.6557 16.171 13.448C16.114 13.2403 16.133 13.0487 16.2278 12.873C16.3253 12.7025 16.4003 12.5211 16.4528 12.3287C16.5055 12.1364 16.5452 11.9416 16.572 11.7443C16.6195 11.5314 16.715 11.3542 16.8585 11.2125C17.0022 11.0708 17.1805 11 17.3933 11C17.6061 11 17.7817 11.0776 17.92 11.2327C18.0585 11.3877 18.1175 11.5717 18.097 11.7845C18.0599 12.0973 17.998 12.4067 17.9115 12.7125C17.825 13.0182 17.7042 13.3088 17.549 13.5845C17.4542 13.7667 17.3045 13.8888 17.1 13.951C16.8955 14.0132 16.7023 13.9968 16.5203 13.9018ZM12.8278 9.7385L9.67029 6.5615C9.50612 6.39733 9.37729 6.20408 9.28379 5.98175C9.19012 5.75925 9.14329 5.5275 9.14329 5.2865V5C9.14329 4.30133 9.38529 3.71 9.86929 3.226C10.3533 2.742 10.9446 2.5 11.6433 2.5C12.342 2.5 12.9333 2.742 13.4173 3.226C13.9013 3.71 14.1433 4.30133 14.1433 5V9.1865C14.1433 9.534 13.9855 9.77442 13.67 9.90775C13.3547 10.0411 13.074 9.98467 12.8278 9.7385ZM10.8933 20V17.4578C9.40479 17.2832 8.12912 16.6704 7.06629 15.6193C6.00346 14.5679 5.38104 13.2865 5.19904 11.775C5.17221 11.5622 5.22796 11.3798 5.36629 11.228C5.50479 11.076 5.68046 11 5.89329 11C6.10612 11 6.28429 11.0734 6.42779 11.2203C6.57146 11.3669 6.66696 11.5467 6.71429 11.7595C6.89646 12.984 7.45646 13.9968 8.39429 14.798C9.33212 15.5993 10.4151 16 11.6433 16C12.2868 16 12.8916 15.8852 13.4578 15.6557C14.0238 15.4262 14.5247 15.1083 14.9605 14.702L16.0298 15.771C15.5465 16.225 14.9965 16.5988 14.3798 16.8923C13.7631 17.1859 13.101 17.3744 12.3933 17.4578V20C12.3933 20.2128 12.3215 20.391 12.1778 20.5345C12.0343 20.6782 11.8561 20.75 11.6433 20.75C11.4305 20.75 11.2522 20.6782 11.1085 20.5345C10.965 20.391 10.8933 20.2128 10.8933 20ZM19.3395 21.1885L2.20479 4.05375C2.06629 3.91525 1.99546 3.74125 1.99229 3.53175C1.98912 3.32208 2.05996 3.14483 2.20479 3C2.34962 2.85517 2.52529 2.78275 2.73179 2.78275C2.93812 2.78275 3.11371 2.85517 3.25854 3L20.3933 20.1345C20.5318 20.273 20.6026 20.4471 20.6058 20.6568C20.609 20.8663 20.5381 21.0435 20.3933 21.1885C20.2485 21.3333 20.0728 21.4058 19.8663 21.4058C19.66 21.4058 19.4844 21.3333 19.3395 21.1885Z`,"mood-fill":`M15.406 10.8077C15.77 10.8077 16.0786 10.6803 16.3318 10.4255C16.5849 10.1708 16.7115 9.86158 16.7115 9.49775C16.7115 9.13392 16.5842 8.82542 16.3295 8.57225C16.0748 8.31892 15.7655 8.19225 15.4015 8.19225C15.0377 8.19225 14.7292 8.31967 14.476 8.5745C14.2228 8.82917 14.0962 9.13842 14.0962 9.50225C14.0962 9.86608 14.2236 10.1746 14.4783 10.4277C14.7329 10.6811 15.0422 10.8077 15.406 10.8077ZM8.5985 10.8077C8.96233 10.8077 9.27083 10.6803 9.524 10.4255C9.77717 10.1708 9.90375 9.86158 9.90375 9.49775C9.90375 9.13392 9.77642 8.82542 9.52175 8.57225C9.26708 8.31892 8.95783 8.19225 8.594 8.19225C8.23 8.19225 7.92142 8.31967 7.66825 8.5745C7.41508 8.82917 7.2885 9.13842 7.2885 9.50225C7.2885 9.86608 7.41583 10.1746 7.6705 10.4277C7.92517 10.6811 8.2345 10.8077 8.5985 10.8077ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5ZM12 17.1923C12.8975 17.1923 13.7254 16.9798 14.4837 16.5548C15.2421 16.1298 15.8578 15.5532 16.331 14.825C16.4257 14.643 16.4227 14.46 16.322 14.276C16.2215 14.092 16.0642 14 15.85 14H8.15C7.93583 14 7.7785 14.092 7.678 14.276C7.57733 14.46 7.57433 14.643 7.669 14.825C8.14217 15.5532 8.76183 16.1298 9.528 16.5548C10.294 16.9798 11.118 17.1923 12 17.1923Z`,more:`M12 8C13.1 8 14 7.1 14 6C14 4.9 13.1 4 12 4C10.9 4 10 4.9 10 6C10 7.1 10.9 8 12 8ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10ZM12 16C10.9 16 10 16.9 10 18C10 19.1 10.9 20 12 20C13.1 20 14 19.1 14 18C14 16.9 13.1 16 12 16Z`,"noise-reduction":[`M15.6204 16.45C15.9804 15.8 15.4704 15 14.7204 15C14.3804 15 14.0404 15.16 13.8804 15.47C13.7204 15.78 13.3804 16 13.0004 16C12.5704 16 12.1904 15.73 12.0504 15.32C11.9004 14.88 11.6504 14.24 11.1204 13.71L9.76039 12.35C9.28039 11.87 9.00039 11.19 9.00039 10.5C9.00039 9.12 10.1204 8 11.5004 8C12.4804 8 13.3404 8.57 13.7404 9.4C13.9204 9.76 14.2604 10 14.6504 10C15.4004 10 15.8704 9.21 15.5404 8.54C14.8204 7.04 13.2804 6 11.5004 6C8.61038 6 6.35038 8.74 7.17038 11.76C7.39038 12.56 7.85038 13.27 8.44038 13.86L9.71039 15.13C9.86039 15.29 9.99039 15.51 10.1104 15.84C10.5204 16.97 11.4904 17.88 12.6904 18C13.9504 18.11 15.0704 17.46 15.6204 16.45Z`,`M13.5004 14C14.3288 14 15.0004 13.3284 15.0004 12.5C15.0004 11.6716 14.3288 11 13.5004 11C12.672 11 12.0004 11.6716 12.0004 12.5C12.0004 13.3284 12.672 14 13.5004 14Z`,`M12.0004 4C12.5527 4 13.0004 3.55228 13.0004 3C13.0004 2.44772 12.5527 2 12.0004 2C11.4481 2 11.0004 2.44772 11.0004 3C11.0004 3.55228 11.4481 4 12.0004 4Z`,`M12.0004 22C12.5527 22 13.0004 21.5523 13.0004 21C13.0004 20.4477 12.5527 20 12.0004 20C11.4481 20 11.0004 20.4477 11.0004 21C11.0004 21.5523 11.4481 22 12.0004 22Z`,`M5.75038 7.01C6.09038 6.58 6.02039 5.95 5.59038 5.6C5.16038 5.26 4.53038 5.33 4.18038 5.77C3.84038 6.2 3.91038 6.83 4.34038 7.17C4.77039 7.51 5.40038 7.44 5.75038 7.01Z`,`M18.2504 16.99C17.9104 17.42 17.9804 18.05 18.4104 18.4C18.8404 18.75 19.4704 18.67 19.8204 18.24C20.1604 17.81 20.0904 17.18 19.6604 16.83C19.2304 16.49 18.6004 16.56 18.2504 16.99Z`,`M4.20038 13.78C4.08038 13.24 3.54038 12.9 3.00038 13.03C2.46038 13.16 2.12038 13.69 2.25038 14.23C2.37038 14.77 2.91038 15.11 3.45038 14.98C3.99038 14.86 4.32038 14.32 4.20038 13.78Z`,`M19.8004 10.22C19.9204 10.76 20.4604 11.1 21.0004 10.97C21.5404 10.84 21.8804 10.31 21.7504 9.77C21.6204 9.23 21.0904 8.89 20.5504 9.02C20.0104 9.14 19.6804 9.68 19.8004 10.22Z`,`M8.53038 19.21C8.03038 18.97 7.43038 19.18 7.20038 19.68C6.96038 20.18 7.17038 20.78 7.67038 21.01C8.17038 21.25 8.77038 21.04 9.00038 20.54C9.24038 20.05 9.03038 19.45 8.53038 19.21Z`,`M15.4704 4.79C15.9704 5.03 16.5704 4.82 16.8004 4.32C17.0404 3.82 16.8304 3.22 16.3304 2.99C15.8304 2.75 15.2304 2.96 15.0004 3.46C14.7604 3.95 14.9704 4.55 15.4704 4.79Z`,`M15.4704 19.21C14.9704 19.45 14.7604 20.05 15.0004 20.54C15.2404 21.03 15.8404 21.25 16.3304 21.01C16.8304 20.77 17.0404 20.17 16.8004 19.68C16.5704 19.18 15.9704 18.97 15.4704 19.21Z`,`M8.53038 4.79C9.03038 4.55 9.23038 3.96 9.00038 3.46C8.76039 2.96 8.16039 2.75 7.67038 2.99C7.18038 3.23 6.95039 3.83 7.19038 4.33C7.43038 4.83 8.03038 5.03 8.53038 4.79Z`,`M21.0004 13.03C20.4604 12.91 19.9304 13.24 19.8004 13.78C19.6804 14.32 20.0104 14.85 20.5504 14.98C21.0904 15.1 21.6204 14.77 21.7504 14.23C21.8704 13.69 21.5404 13.15 21.0004 13.03Z`,`M3.00038 10.97C3.54038 11.09 4.07038 10.76 4.20038 10.22C4.32038 9.68 3.99038 9.15 3.45038 9.02C2.91038 8.89 2.38038 9.23 2.25038 9.77C2.13038 10.31 2.46038 10.85 3.00038 10.97Z`,`M19.6604 7.17C20.0904 6.83 20.1604 6.2 19.8204 5.76C19.4804 5.32 18.8504 5.26 18.4104 5.6C17.9804 5.94 17.9104 6.57 18.2504 7.01C18.6004 7.44 19.2304 7.51 19.6604 7.17Z`,`M4.34038 16.83C3.91038 17.17 3.84038 17.8 4.18038 18.24C4.52038 18.67 5.15038 18.74 5.59038 18.4C6.02039 18.06 6.09038 17.43 5.75038 16.99C5.41038 16.55 4.77039 16.49 4.34038 16.83Z`],participants:`M1.79688 17.0837C1.79688 16.5683 1.92987 16.1084 2.19588 15.7039C2.46188 15.2994 2.81713 14.9847 3.26163 14.7599C4.21196 14.2951 5.16754 13.9367 6.12838 13.6847C7.08938 13.4328 8.14546 13.3069 9.29663 13.3069C10.448 13.3069 11.504 13.4328 12.4649 13.6847C13.4259 13.9367 14.3815 14.2951 15.3319 14.7599C15.7764 14.9847 16.1316 15.2994 16.3976 15.7039C16.6636 16.1084 16.7966 16.5683 16.7966 17.0837V17.7877C16.7966 18.1902 16.6489 18.544 16.3534 18.8492C16.0579 19.1543 15.6992 19.3069 15.2774 19.3069H3.31588C2.89421 19.3069 2.53563 19.1592 2.24013 18.8637C1.94463 18.568 1.79688 18.2093 1.79688 17.7877V17.0837ZM18.4101 19.3069C18.5358 19.0774 18.6316 18.8332 18.6976 18.5742C18.7636 18.3152 18.7966 18.053 18.7966 17.7877V16.9607C18.7966 16.3043 18.636 15.6787 18.3146 15.0839C17.9931 14.4892 17.5371 13.979 16.9466 13.5532C17.6171 13.6532 18.2537 13.8079 18.8564 14.0174C19.4589 14.2271 20.0339 14.4748 20.5814 14.7607C21.098 15.0363 21.497 15.3612 21.7784 15.7354C22.0597 16.1094 22.2004 16.5178 22.2004 16.9607V17.7877C22.2004 18.2093 22.0526 18.568 21.7571 18.8637C21.4616 19.1592 21.103 19.3069 20.6814 19.3069H18.4101ZM9.29663 11.6914C8.33413 11.6914 7.51021 11.3487 6.82488 10.6634C6.13954 9.97791 5.79688 9.15391 5.79688 8.19141C5.79688 7.22891 6.13954 6.40499 6.82488 5.71966C7.51021 5.03416 8.33413 4.69141 9.29663 4.69141C10.2591 4.69141 11.0831 5.03416 11.7686 5.71966C12.454 6.40499 12.7966 7.22891 12.7966 8.19141C12.7966 9.15391 12.454 9.97791 11.7686 10.6634C11.0831 11.3487 10.2591 11.6914 9.29663 11.6914ZM17.9311 8.19141C17.9311 9.15391 17.5885 9.97791 16.9031 10.6634C16.2178 11.3487 15.3939 11.6914 14.4314 11.6914C14.3185 11.6914 14.175 11.6786 14.0006 11.6529C13.8261 11.6272 13.6825 11.5991 13.5699 11.5684C13.9642 11.0942 14.2673 10.5682 14.4791 9.99041C14.6908 9.41257 14.7966 8.81257 14.7966 8.19041C14.7966 7.56807 14.6886 6.97032 14.4726 6.39716C14.2566 5.82416 13.9557 5.29666 13.5699 4.81466C13.7134 4.76332 13.857 4.72999 14.0006 4.71466C14.1441 4.69916 14.2877 4.69141 14.4314 4.69141C15.3939 4.69141 16.2178 5.03416 16.9031 5.71966C17.5885 6.40499 17.9311 7.22891 17.9311 8.19141Z`,pin:`M15.4994 5.6V12.8115L17.0647 14.377C17.139 14.4513 17.1949 14.535 17.2322 14.628C17.2694 14.7208 17.2879 14.8168 17.2879 14.916V15.3435C17.2879 15.5542 17.2151 15.7329 17.0694 15.8797C16.9239 16.0266 16.7435 16.1 16.5282 16.1H12.7494V21.4885C12.7494 21.701 12.6775 21.8791 12.5337 22.0227C12.3899 22.1664 12.2117 22.2382 11.9992 22.2382C11.7865 22.2382 11.6084 22.1664 11.4649 22.0227C11.3213 21.8791 11.2494 21.701 11.2494 21.4885V16.1H7.47069C7.25535 16.1 7.07494 16.0266 6.92944 15.8797C6.78377 15.7329 6.71094 15.5542 6.71094 15.3435V14.916C6.71094 14.8168 6.72952 14.7208 6.76669 14.628C6.80402 14.535 6.85985 14.4513 6.93419 14.377L8.49944 12.8115V5.6H8.24944C8.03694 5.6 7.85885 5.52808 7.71519 5.38425C7.57135 5.24041 7.49944 5.06225 7.49944 4.84975C7.49944 4.63708 7.57135 4.459 7.71519 4.3155C7.85885 4.17183 8.03694 4.1 8.24944 4.1H15.7494C15.9619 4.1 16.14 4.17192 16.2837 4.31575C16.4275 4.45958 16.4994 4.63775 16.4994 4.85025C16.4994 5.06292 16.4275 5.241 16.2837 5.3845C16.14 5.52817 15.9619 5.6 15.7494 5.6H15.4994Z`,"raise-hand":`M18.37 23.9949H11.82C10.74 23.9949 9.68 23.5449 8.93 22.7649L1.63 15.1549L3.7 13.3249C4.32 12.7749 5.23 12.6649 5.96 13.0549L8.37 14.3349V4.78488C8.37 3.40488 9.49 2.28488 10.87 2.28488C11.04 2.28488 11.21 2.30488 11.38 2.33488C11.47 1.03488 12.55 0.00488281 13.87 0.00488281C14.73 0.00488281 15.48 0.434883 15.93 1.09488C16.22 0.974883 16.54 0.914883 16.87 0.914883C18.25 0.914883 19.37 2.03488 19.37 3.41488V3.69488C19.53 3.66488 19.7 3.64488 19.87 3.64488C21.25 3.64488 22.37 4.76488 22.37 6.14488V19.9949C22.37 22.2049 20.58 23.9949 18.37 23.9949ZM4.51 15.2749L10.37 21.3749C10.75 21.7649 11.27 21.9949 11.81 21.9949H18.37C19.47 21.9949 20.37 21.0949 20.37 19.9949V6.14488C20.37 5.86488 20.15 5.64488 19.87 5.64488C19.59 5.64488 19.37 5.86488 19.37 6.14488V11.9949H17.37V3.41488C17.37 3.13488 17.15 2.91488 16.87 2.91488C16.59 2.91488 16.37 3.13488 16.37 3.41488V11.9949H14.37V2.50488C14.37 2.22488 14.15 2.00488 13.87 2.00488C13.59 2.00488 13.37 2.22488 13.37 2.50488V11.9949H11.37V4.78488C11.37 4.50488 11.15 4.28488 10.87 4.28488C10.59 4.28488 10.37 4.51488 10.37 4.78488V17.6549L5.02 14.8249L4.51 15.2749Z`,"raise-hand-fill":`M21.1818 4C20.3518 4 19.6818 4.67 19.6818 5.5V10.5C19.6818 10.78 19.4618 11 19.1818 11C18.9018 11 18.6818 10.78 18.6818 10.5V2.5C18.6818 1.67 18.0118 1 17.1818 1C16.3518 1 15.6818 1.67 15.6818 2.5V10.5C15.6818 10.78 15.4618 11 15.1818 11C14.9018 11 14.6818 10.78 14.6818 10.5V1.5C14.6818 0.67 14.0118 0 13.1818 0C12.3518 0 11.6818 0.67 11.6818 1.5V10.49C11.6818 10.77 11.4618 10.99 11.1818 10.99C10.9018 10.99 10.6818 10.77 10.6818 10.49V4.5C10.6818 3.67 10.0118 3 9.18176 3C8.35176 3 7.68176 3.67 7.68176 4.5V15.91L3.56176 13.56C2.98176 13.23 2.26176 13.32 1.78176 13.78C1.18176 14.36 1.16176 15.32 1.75176 15.91L8.53176 22.8C9.28176 23.57 10.3018 24 11.3818 24H18.6818C20.8918 24 22.6818 22.21 22.6818 20V5.5C22.6818 4.67 22.0118 4 21.1818 4Z`,"record-fill":`M12 16.5C13.2487 16.5 14.3108 16.0622 15.1865 15.1865C16.0622 14.3108 16.5 13.2487 16.5 12C16.5 10.7513 16.0622 9.68917 15.1865 8.8135C14.3108 7.93783 13.2487 7.5 12 7.5C10.7513 7.5 9.68917 7.93783 8.8135 8.8135C7.93783 9.68917 7.5 10.7513 7.5 12C7.5 13.2487 7.93783 14.3108 8.8135 15.1865C9.68917 16.0622 10.7513 16.5 12 16.5ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z`,"record-stop-fill":`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM15 16H9C8.45 16 8 15.55 8 15V9C8 8.45 8.45 8 9 8H15C15.55 8 16 8.45 16 9V15C16 15.55 15.55 16 15 16Z`,recording:[`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z`,`M12 17C14.7614 17 17 14.7614 17 12C17 9.23858 14.7614 7 12 7C9.23858 7 7 9.23858 7 12C7 14.7614 9.23858 17 12 17Z`],remove:`M12.0022 21.8335C10.6404 21.8335 9.36222 21.5752 8.16772 21.0587C6.97322 20.5421 5.9323 19.8407 5.04497 18.9545C4.15747 18.0683 3.45605 17.0284 2.94072 15.8347C2.42555 14.6409 2.16797 13.3631 2.16797 12.0012C2.16797 10.6394 2.42622 9.36124 2.94272 8.16674C3.45939 6.97224 4.1608 5.93133 5.04697 5.04399C5.93314 4.15649 6.97305 3.45508 8.16672 2.93974C9.36055 2.42458 10.6384 2.16699 12.0002 2.16699C13.3621 2.16699 14.6402 2.42524 15.8347 2.94174C17.0292 3.45841 18.0701 4.15983 18.9575 5.04599C19.845 5.93216 20.5464 6.97208 21.0617 8.16574C21.5769 9.35958 21.8345 10.6374 21.8345 11.9992C21.8345 13.3611 21.5762 14.6392 21.0597 15.8337C20.5431 17.0282 19.8416 18.0692 18.9555 18.9565C18.0693 19.844 17.0294 20.5454 15.8357 21.0607C14.6419 21.5759 13.3641 21.8335 12.0022 21.8335ZM12.0012 20.2502C12.9807 20.2502 13.9197 20.0877 14.8182 19.7627C15.7169 19.4377 16.5335 18.9669 17.268 18.3502L5.65472 6.73349C5.04689 7.47799 4.57764 8.29791 4.24697 9.19324C3.91647 10.0886 3.75122 11.0242 3.75122 12.0002C3.75122 14.3016 4.55089 16.2519 6.15022 17.8512C7.74955 19.4506 9.69989 20.2502 12.0012 20.2502ZM18.3312 17.267C18.9279 16.5337 19.3971 15.7175 19.7387 14.8185C20.0804 13.9195 20.2512 12.9801 20.2512 12.0002C20.2512 9.69891 19.4516 7.74858 17.8522 6.14924C16.2529 4.54991 14.3026 3.75024 12.0012 3.75024C11.0257 3.75024 10.0905 3.91549 9.19547 4.24599C8.30047 4.57666 7.48014 5.05033 6.73447 5.66699L18.3312 17.267Z`,"screen-share":`M11.1348 10.8075H13.1348V11.919C13.1348 12.0228 13.1799 12.094 13.2703 12.1325C13.3606 12.1708 13.4443 12.1516 13.5213 12.0747L15.2173 10.3785C15.3109 10.285 15.3578 10.178 15.3578 10.0575C15.3578 9.93697 15.3109 9.82989 15.2173 9.73622L13.5213 8.04022C13.4443 7.96322 13.3606 7.94397 13.2703 7.98247C13.1799 8.02097 13.1348 8.09214 13.1348 8.19597V9.30747H11.1348C10.3719 9.30747 9.72285 9.57505 9.18752 10.1102C8.65235 10.6456 8.38477 11.2946 8.38477 12.0575V13.3075C8.38477 13.5203 8.45652 13.6985 8.60002 13.842C8.74368 13.9856 8.92193 14.0575 9.13477 14.0575C9.34743 14.0575 9.5256 13.9856 9.66927 13.842C9.81277 13.6985 9.88452 13.5203 9.88452 13.3075V12.0575C9.88452 11.71 10.006 11.4147 10.249 11.1717C10.492 10.9289 10.7873 10.8075 11.1348 10.8075ZM2.13477 20.2305C1.92193 20.2305 1.74368 20.1586 1.60002 20.015C1.45652 19.8715 1.38477 19.6933 1.38477 19.4805C1.38477 19.2676 1.45652 19.0895 1.60002 18.946C1.74368 18.8023 1.92193 18.7305 2.13477 18.7305H21.8653C22.0781 18.7305 22.2563 18.8023 22.4 18.946C22.5435 19.0895 22.6153 19.2676 22.6153 19.4805C22.6153 19.6933 22.5435 19.8715 22.4 20.015C22.2563 20.1586 22.0781 20.2305 21.8653 20.2305H2.13477ZM4.30777 17.7305C3.8026 17.7305 3.37502 17.5555 3.02502 17.2055C2.67502 16.8555 2.50002 16.4279 2.50002 15.9227V5.53822C2.50002 5.03305 2.67502 4.60547 3.02502 4.25547C3.37502 3.90547 3.8026 3.73047 4.30777 3.73047H19.6923C20.1974 3.73047 20.625 3.90547 20.975 4.25547C21.325 4.60547 21.5 5.03305 21.5 5.53822V15.9227C21.5 16.4279 21.325 16.8555 20.975 17.2055C20.625 17.5555 20.1974 17.7305 19.6923 17.7305H4.30777Z`,"screen-share-stop":`M23 17.8602H21.8L23.59 19.6502C23.83 19.4702 24 19.1902 24 18.8602C24 18.3102 23.55 17.8602 23 17.8602ZM3.23 2.14016C2.84 1.75016 2.2 1.75016 1.81 2.14016C1.42 2.53016 1.42 3.16016 1.81 3.55016L2.65 4.41016C2.65 4.41016 1.99 4.98016 1.99 5.88016C2 6.78016 2 15.8602 2 15.8602L2.01 15.8702C2.01 16.9602 2.89 17.8502 3.98 17.8602H1C0.45 17.8602 0 18.3102 0 18.8602C0 19.4102 0.45 19.8602 1 19.8602H18.13L20.13 21.8602C20.52 22.2502 21.15 22.2502 21.54 21.8602C21.93 21.4702 21.93 20.8402 21.54 20.4502L3.23 2.14016ZM7 14.8602C7.31 13.3802 7.94 11.9302 9.08 10.8102L10.67 12.4002C9.13 12.7802 7.96 13.5702 7 14.8602ZM13 8.99016V8.01016C13 7.57016 13.52 7.35016 13.84 7.64016L15 8.73016L16.61 10.2302C16.82 10.4302 16.82 10.7602 16.61 10.9602L15.72 11.7902L21.3 17.3702C21.73 17.0002 22 16.4702 22 15.8602V5.86016C22 4.77016 21.11 3.88016 20.02 3.88016H7.8L12.94 9.01016C12.96 9.00016 12.98 8.99016 13 8.99016Z`,search:`M9.50244 15.7502C7.7266 15.7502 6.22369 15.1352 4.99369 13.9052C3.76352 12.675 3.14844 11.1847 3.14844 9.43419C3.14844 7.68369 3.76194 6.19319 4.98894 4.96269C6.21594 3.73219 7.70902 3.11694 9.46819 3.11694C11.2274 3.11694 12.7194 3.73228 13.9444 4.96294C15.1694 6.19361 15.7819 7.68553 15.7819 9.43869C15.7819 10.1464 15.6666 10.8287 15.4359 11.4857C15.2054 12.1425 14.8721 12.7474 14.4359 13.3002L20.3014 19.1204C20.4551 19.2743 20.5319 19.4635 20.5319 19.6882C20.5319 19.9129 20.4528 20.1058 20.2944 20.2669C20.1361 20.4279 19.9432 20.5084 19.7157 20.5084C19.4882 20.5084 19.3002 20.429 19.1517 20.2702L13.3067 14.4209C12.8124 14.8488 12.2363 15.1773 11.5784 15.4064C10.9204 15.6356 10.2284 15.7502 9.50244 15.7502ZM9.48194 14.1669C10.7929 14.1669 11.9068 13.7062 12.8234 12.7847C13.7401 11.8632 14.1984 10.7458 14.1984 9.43244C14.1984 8.11928 13.7401 7.00228 12.8234 6.08144C11.9068 5.16061 10.7915 4.70019 9.47769 4.70019C8.15452 4.70019 7.03277 5.16094 6.11244 6.08244C5.1921 7.00394 4.73194 8.12128 4.73194 9.43444C4.73194 10.7478 5.19235 11.8649 6.11319 12.7857C7.03402 13.7065 8.15694 14.1669 9.48194 14.1669Z`,settings:`M19.5006 12C19.5006 11.77 19.4906 11.55 19.4706 11.32L21.3306 9.91C21.7306 9.61 21.8406 9.05 21.5906 8.61L19.7206 5.38C19.4706 4.94 18.9306 4.76 18.4706 4.96L16.3206 5.87C15.9506 5.61 15.5606 5.38 15.1506 5.19L14.8606 2.88C14.8006 2.38 14.3706 2 13.8706 2H10.1406C9.63064 2 9.20064 2.38 9.14064 2.88L8.85064 5.19C8.44064 5.38 8.05064 5.61 7.68064 5.87L5.53064 4.96C5.07064 4.76 4.53064 4.94 4.28064 5.38L2.41064 8.62C2.16064 9.06 2.27064 9.61 2.67064 9.92L4.53064 11.33C4.51064 11.55 4.50064 11.77 4.50064 12C4.50064 12.23 4.51064 12.45 4.53064 12.68L2.67064 14.09C2.27064 14.39 2.16064 14.95 2.41064 15.39L4.28064 18.62C4.53064 19.06 5.07064 19.24 5.53064 19.04L7.68064 18.13C8.05064 18.39 8.44064 18.62 8.85064 18.81L9.14064 21.12C9.20064 21.62 9.63064 22 10.1306 22H13.8606C14.3606 22 14.7906 21.62 14.8506 21.12L15.1406 18.81C15.5506 18.62 15.9406 18.39 16.3106 18.13L18.4606 19.04C18.9206 19.24 19.4606 19.06 19.7106 18.62L21.5806 15.39C21.8306 14.95 21.7206 14.4 21.3206 14.09L19.4606 12.68C19.4906 12.45 19.5006 12.23 19.5006 12ZM12.0406 15.5C10.1106 15.5 8.54064 13.93 8.54064 12C8.54064 10.07 10.1106 8.5 12.0406 8.5C13.9706 8.5 15.5406 10.07 15.5406 12C15.5406 13.93 13.9706 15.5 12.0406 15.5Z`,share:`M18 16.1191C17.24 16.1191 16.56 16.4191 16.04 16.8891L8.91 12.7391C8.96 12.5091 9 12.2791 9 12.0391C9 11.7991 8.96 11.5691 8.91 11.3391L15.96 7.22906C16.5 7.72906 17.21 8.03906 18 8.03906C19.66 8.03906 21 6.69906 21 5.03906C21 3.37906 19.66 2.03906 18 2.03906C16.34 2.03906 15 3.37906 15 5.03906C15 5.27906 15.04 5.50906 15.09 5.73906L8.04 9.84906C7.5 9.34906 6.79 9.03906 6 9.03906C4.34 9.03906 3 10.3791 3 12.0391C3 13.6991 4.34 15.0391 6 15.0391C6.79 15.0391 7.5 14.7291 8.04 14.2291L15.16 18.3891C15.11 18.5991 15.08 18.8191 15.08 19.0391C15.08 20.6491 16.39 21.9591 18 21.9591C19.61 21.9591 20.92 20.6491 20.92 19.0391C20.92 17.4291 19.61 16.1191 18 16.1191Z`,sidebar:`M15 20H3C2.45 20 2 19.55 2 19V5C2 4.45 2.45 4 3 4H15C15.55 4 16 4.45 16 5V19C16 19.55 15.55 20 15 20ZM19 8H21C21.55 8 22 7.55 22 7V5C22 4.45 21.55 4 21 4H19C18.45 4 18 4.45 18 5V7C18 7.55 18.45 8 19 8ZM19 20H21C21.55 20 22 19.55 22 19V17C22 16.45 21.55 16 21 16H19C18.45 16 18 16.45 18 17V19C18 19.55 18.45 20 19 20ZM19 14H21C21.55 14 22 13.55 22 13V11C22 10.45 21.55 10 21 10H19C18.45 10 18 10.45 18 11V13C18 13.55 18.45 14 19 14Z`,signal:`M18 4C18.83 4 19.5 4.67 19.5 5.5V18.5C19.5 19.33 18.83 20 18 20C17.17 20 16.5 19.33 16.5 18.5V5.5C16.5 4.67 17.17 4 18 4ZM6 14C6.83 14 7.5 14.67 7.5 15.5V18.5C7.5 19.33 6.83 20 6 20C5.17 20 4.5 19.33 4.5 18.5V15.5C4.5 14.67 5.17 14 6 14ZM12 9C12.83 9 13.5 9.67 13.5 10.5V18.5C13.5 19.33 12.83 20 12 20C11.17 20 10.5 19.33 10.5 18.5V10.5C10.5 9.67 11.17 9 12 9Z`,"speaker-fill":`M3 10.002V14.002C3 14.552 3.45 15.002 4 15.002H7L10.29 18.292C10.92 18.922 12 18.472 12 17.582V6.41204C12 5.52204 10.92 5.07204 10.29 5.70204L7 9.00204H4C3.45 9.00204 3 9.45204 3 10.002ZM16.5 12.002C16.5 10.232 15.48 8.71204 14 7.97204V16.022C15.48 15.292 16.5 13.772 16.5 12.002ZM14 4.45204V4.65204C14 5.03204 14.25 5.36204 14.6 5.50204C17.18 6.53204 19 9.06204 19 12.002C19 14.942 17.18 17.472 14.6 18.502C14.24 18.642 14 18.972 14 19.352V19.552C14 20.182 14.63 20.622 15.21 20.402C18.6 19.112 21 15.842 21 12.002C21 8.16204 18.6 4.89204 15.21 3.60204C14.63 3.37204 14 3.82204 14 4.45204Z`,spotlight:`M2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6Z`,stats:`M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM8 17C7.45 17 7 16.55 7 16V11C7 10.45 7.45 10 8 10C8.55 10 9 10.45 9 11V16C9 16.55 8.55 17 8 17ZM12 17C11.45 17 11 16.55 11 16V8C11 7.45 11.45 7 12 7C12.55 7 13 7.45 13 8V16C13 16.55 12.55 17 12 17ZM16 17C15.45 17 15 16.55 15 16V14C15 13.45 15.45 13 16 13C16.55 13 17 13.45 17 14V16C17 16.55 16.55 17 16 17Z`,streaming:[`M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z`,`M7.5 8C6.5 9 6 10.5 6 12C6 13.5 6.5 15 7.5 16C7.1 16.4 6.6 16.4 6.2 16C4.9 14.7 4.2 13.4 4.2 12C4.2 10.6 4.9 9.3 6.2 8C6.6 7.6 7.1 7.6 7.5 8ZM4.5 6C3.1 7.5 2 9.5 2 12C2 14.5 3.1 16.5 4.5 18C4.1 18.4 3.6 18.4 3.2 18C1.5 16.2 0.5 14.2 0.5 12C0.5 9.8 1.5 7.8 3.2 6C3.6 5.6 4.1 5.6 4.5 6ZM16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16C16.9 16.4 17.4 16.4 17.8 16C19.1 14.7 19.8 13.4 19.8 12C19.8 10.6 19.1 9.3 17.8 8C17.4 7.6 16.9 7.6 16.5 8ZM19.5 6C20.9 7.5 22 9.5 22 12C22 14.5 20.9 16.5 19.5 18C19.9 18.4 20.4 18.4 20.8 18C22.5 16.2 23.5 14.2 23.5 12C23.5 9.8 22.5 7.8 20.8 6C20.4 5.6 19.9 5.6 19.5 6Z`],"streaming-stop":[`M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z`,`M7.5 8C6.5 9 6 10.5 6 12C6 13.5 6.5 15 7.5 16C7.1 16.4 6.6 16.4 6.2 16C4.9 14.7 4.2 13.4 4.2 12C4.2 10.6 4.9 9.3 6.2 8C6.6 7.6 7.1 7.6 7.5 8ZM4.5 6C3.1 7.5 2 9.5 2 12C2 14.5 3.1 16.5 4.5 18C4.1 18.4 3.6 18.4 3.2 18C1.5 16.2 0.5 14.2 0.5 12C0.5 9.8 1.5 7.8 3.2 6C3.6 5.6 4.1 5.6 4.5 6ZM16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16C16.9 16.4 17.4 16.4 17.8 16C19.1 14.7 19.8 13.4 19.8 12C19.8 10.6 19.1 9.3 17.8 8C17.4 7.6 16.9 7.6 16.5 8ZM19.5 6C20.9 7.5 22 9.5 22 12C22 14.5 20.9 16.5 19.5 18C19.9 18.4 20.4 18.4 20.8 18C22.5 16.2 23.5 14.2 23.5 12C23.5 9.8 22.5 7.8 20.8 6C20.4 5.6 19.9 5.6 19.5 6Z`,`M3.70711 2.29289C3.31658 1.90237 2.68342 1.90237 2.29289 2.29289C1.90237 2.68342 1.90237 3.31658 2.29289 3.70711L20.2929 21.7071C20.6834 22.0976 21.3166 22.0976 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L3.70711 2.29289Z`],"switch-camera":`M4.30775 20.5C3.80258 20.5 3.375 20.325 3.025 19.975C2.675 19.625 2.5 19.1974 2.5 18.6923V7.30775C2.5 6.80258 2.675 6.375 3.025 6.025C3.375 5.675 3.80258 5.5 4.30775 5.5H7.3615L8.66925 4.08275C8.83342 3.90192 9.03183 3.75958 9.2645 3.65575C9.49717 3.55192 9.74233 3.5 10 3.5H14C14.2577 3.5 14.5028 3.55192 14.7355 3.65575C14.9682 3.75958 15.1666 3.90192 15.3307 4.08275L16.6385 5.5H19.6923C20.1974 5.5 20.625 5.675 20.975 6.025C21.325 6.375 21.5 6.80258 21.5 7.30775V18.6923C21.5 19.1974 21.325 19.625 20.975 19.975C20.625 20.325 20.1974 20.5 19.6923 20.5H4.30775ZM15.6038 13.0345C15.5166 14.0333 15.1384 14.8863 14.4693 15.5933C13.8001 16.3003 12.977 16.6538 12 16.6538C11.8603 16.6538 11.7206 16.6438 11.5808 16.624C11.4411 16.6042 11.3013 16.5776 11.1615 16.5443C11.041 16.5173 10.9153 16.5204 10.7845 16.5538C10.6538 16.5871 10.5513 16.6506 10.477 16.7443C10.3513 16.8891 10.3119 17.057 10.3588 17.248C10.4054 17.439 10.5166 17.5666 10.6923 17.6308C10.9064 17.7141 11.1228 17.7708 11.3413 17.801C11.5599 17.8312 11.7795 17.8463 12 17.8463C13.3167 17.8463 14.4292 17.3748 15.3375 16.4318C16.2458 15.4888 16.7321 14.3461 16.7962 13.0038L17.2807 13.4443C17.4051 13.5519 17.5464 13.6042 17.7048 13.601C17.8631 13.5978 17.9961 13.5423 18.1038 13.4345C18.2281 13.3102 18.2928 13.1679 18.298 13.0078C18.3032 12.8474 18.2436 12.7051 18.1193 12.5808L16.8828 11.3443C16.7123 11.1738 16.5013 11.0885 16.25 11.0885C15.9987 11.0885 15.7878 11.1738 15.6173 11.3443L14.3807 12.5808C14.2564 12.7051 14.1943 12.8448 14.1943 13C14.1943 13.1552 14.2564 13.2949 14.3807 13.4193C14.5051 13.5436 14.6448 13.6058 14.8 13.6058C14.9552 13.6058 15.0949 13.5436 15.2193 13.4193L15.6038 13.0345ZM7.20375 12.9963L6.71925 12.5558C6.59492 12.4481 6.45358 12.3958 6.29525 12.399C6.13692 12.4022 6.00392 12.4577 5.89625 12.5655C5.77192 12.6898 5.70717 12.8321 5.702 12.9923C5.69683 13.1526 5.75642 13.2949 5.88075 13.4193L7.11725 14.6558C7.28775 14.8263 7.49867 14.9115 7.75 14.9115C8.00133 14.9115 8.21225 14.8263 8.38275 14.6558L9.61925 13.4193C9.74358 13.2949 9.80575 13.1552 9.80575 13C9.80575 12.8448 9.74358 12.7051 9.61925 12.5808C9.49492 12.4564 9.35517 12.3943 9.2 12.3943C9.04483 12.3943 8.90508 12.4564 8.78075 12.5808L8.39625 12.9655C8.48342 11.9667 8.86158 11.1138 9.53075 10.4068C10.1999 9.69975 11.023 9.34625 12 9.34625C12.1397 9.34625 12.2794 9.35617 12.4192 9.376C12.5589 9.39583 12.6954 9.42242 12.8288 9.45575C12.9493 9.48908 13.0765 9.48908 13.2105 9.45575C13.3445 9.42242 13.4487 9.35575 13.523 9.25575C13.6487 9.11092 13.6897 8.943 13.6462 8.752C13.6026 8.561 13.4929 8.43342 13.3173 8.36925C13.0968 8.29875 12.8788 8.24525 12.6635 8.20875C12.4482 8.17208 12.227 8.15375 12 8.15375C10.6833 8.15375 9.57083 8.62525 8.6625 9.56825C7.75417 10.5113 7.26792 11.6539 7.20375 12.9963Z`,"tile-fill":`M5 11C4.591 11 4.23875 10.8523 3.94325 10.5568C3.64775 10.2613 3.5 9.909 3.5 9.5V5C3.5 4.591 3.64775 4.23875 3.94325 3.94325C4.23875 3.64775 4.591 3.5 5 3.5H9.5C9.909 3.5 10.2613 3.64775 10.5568 3.94325C10.8523 4.23875 11 4.591 11 5V9.5C11 9.909 10.8523 10.2613 10.5568 10.5568C10.2613 10.8523 9.909 11 9.5 11H5ZM5 20.5C4.591 20.5 4.23875 20.3523 3.94325 20.0568C3.64775 19.7613 3.5 19.409 3.5 19V14.5C3.5 14.091 3.64775 13.7388 3.94325 13.4433C4.23875 13.1478 4.591 13 5 13H9.5C9.909 13 10.2613 13.1478 10.5568 13.4433C10.8523 13.7388 11 14.091 11 14.5V19C11 19.409 10.8523 19.7613 10.5568 20.0568C10.2613 20.3523 9.909 20.5 9.5 20.5H5ZM14.5 11C14.091 11 13.7388 10.8523 13.4433 10.5568C13.1478 10.2613 13 9.909 13 9.5V5C13 4.591 13.1478 4.23875 13.4433 3.94325C13.7388 3.64775 14.091 3.5 14.5 3.5H19C19.409 3.5 19.7613 3.64775 20.0568 3.94325C20.3523 4.23875 20.5 4.591 20.5 5V9.5C20.5 9.909 20.3523 10.2613 20.0568 10.5568C19.7613 10.8523 19.409 11 19 11H14.5ZM14.5 20.5C14.091 20.5 13.7388 20.3523 13.4433 20.0568C13.1478 19.7613 13 19.409 13 19V14.5C13 14.091 13.1478 13.7388 13.4433 13.4433C13.7388 13.1478 14.091 13 14.5 13H19C19.409 13 19.7613 13.1478 20.0568 13.4433C20.3523 13.7388 20.5 14.091 20.5 14.5V19C20.5 19.409 20.3523 19.7613 20.0568 20.0568C19.7613 20.3523 19.409 20.5 19 20.5H14.5Z`,unpin:`M14.1851 11.3595L7.56988 4.74425C7.49172 4.66608 7.43655 4.58658 7.40438 4.50575C7.37238 4.42508 7.35638 4.33791 7.35638 4.24425C7.35638 4.05458 7.42022 3.88308 7.54788 3.72975C7.67538 3.57658 7.8513 3.5 8.07563 3.5H15.7506C15.9631 3.5 16.1412 3.57216 16.2849 3.7165C16.4287 3.86066 16.5006 4.03941 16.5006 4.25275C16.5006 4.45341 16.4135 4.59991 16.2391 4.69225C16.0648 4.78458 15.902 4.88716 15.7506 5H15.5006V10.8077C15.5006 11.1531 15.343 11.3929 15.0276 11.5272C14.7121 11.6616 14.4313 11.6057 14.1851 11.3595ZM11.2506 21V15.5H8.17963C7.81247 15.5 7.51872 15.3717 7.29838 15.1152C7.07822 14.8589 6.96813 14.5731 6.96813 14.2577C6.96813 14.1001 6.99955 13.9438 7.06238 13.789C7.12522 13.6343 7.22647 13.4867 7.36613 13.3462L8.50063 12.2115V10.6385L2.65838 4.76525C2.51988 4.62691 2.44647 4.4555 2.43813 4.251C2.4298 4.0465 2.50388 3.866 2.66038 3.7095C2.80388 3.566 2.97888 3.49425 3.18538 3.49425C3.39172 3.49425 3.5673 3.56666 3.71213 3.7115L19.8891 19.8885C20.0378 20.0372 20.1111 20.2137 20.1091 20.4182C20.1073 20.6227 20.0288 20.8032 19.8736 20.9597C19.7185 21.1032 19.5428 21.1775 19.3466 21.1825C19.1506 21.1877 18.975 21.1127 18.8199 20.9575L13.3621 15.5H12.7506V21C12.7506 21.2125 12.6787 21.3906 12.5349 21.5342C12.391 21.6781 12.2129 21.75 12.0004 21.75C11.7877 21.75 11.6096 21.6781 11.4661 21.5342C11.3225 21.3906 11.2506 21.2125 11.2506 21Z`,video:`M15 8V16H5V8H15ZM16 6H4C3.45 6 3 6.45 3 7V17C3 17.55 3.45 18 4 18H16C16.55 18 17 17.55 17 17V13.5L21 17.5V6.5L17 10.5V7C17 6.45 16.55 6 16 6Z`,"video-fill":`M17.332 10.5V7C17.332 6.45 16.882 6 16.332 6H4.33203C3.78203 6 3.33203 6.45 3.33203 7V17C3.33203 17.55 3.78203 18 4.33203 18H16.332C16.882 18 17.332 17.55 17.332 17V13.5L19.622 15.79C20.252 16.42 21.332 15.97 21.332 15.08V8.91C21.332 8.02 20.252 7.57 19.622 8.2L17.332 10.5Z`,"video-off":`M9.98969 8.57005L7.98969 6.57005L3.83969 2.43005L2.42969 3.84005L5.15969 6.57005H4.42969C3.87969 6.57005 3.42969 7.02005 3.42969 7.57005V17.5701C3.42969 18.1201 3.87969 18.5701 4.42969 18.5701H16.4297C16.6397 18.5701 16.8197 18.4901 16.9797 18.3901L20.1597 21.5701L21.5697 20.1601L12.7097 11.3001L9.98969 8.57005ZM5.42969 16.5701V8.57005H7.15969L15.1597 16.5701H5.42969ZM15.4297 8.57005V11.1801L21.4297 17.1801V7.07005L17.4297 11.0701V7.57005C17.4297 7.02005 16.9797 6.57005 16.4297 6.57005H10.8197L12.8197 8.57005H15.4297Z`,"video-off-fill":`M17.768 10.8844L20.514 8.13811C20.6615 7.99061 20.8273 7.95378 21.0113 8.02761C21.1953 8.10128 21.2873 8.24194 21.2873 8.44961V15.5496C21.2873 15.7573 21.1953 15.8979 21.0113 15.9716C20.8273 16.0454 20.6615 16.0086 20.514 15.8611L17.6603 13.0074V13.1804C17.5578 13.4522 17.3523 13.6275 17.044 13.7064C16.7357 13.7852 16.4648 13.7079 16.2315 13.4746L8.79301 6.03611C8.64551 5.88878 8.56092 5.73144 8.53926 5.56411C8.51742 5.39678 8.54176 5.23103 8.61226 5.06686C8.68276 4.90286 8.78659 4.76728 8.92376 4.66011C9.06092 4.55311 9.23334 4.49961 9.44101 4.49961H15.9603C16.4654 4.49961 16.893 4.67461 17.243 5.02461C17.593 5.37461 17.768 5.80219 17.768 6.30736V10.8844ZM19.4448 21.6304L2.06026 4.24586C1.92192 4.10736 1.85109 3.93328 1.84776 3.72361C1.84459 3.51411 1.91542 3.33686 2.06026 3.19186C2.20526 3.04703 2.38092 2.97461 2.58726 2.97461C2.79359 2.97461 2.96926 3.04703 3.11426 3.19186L20.4988 20.5764C20.6373 20.7149 20.7081 20.8889 20.7113 21.0986C20.7144 21.3083 20.6436 21.4855 20.4988 21.6304C20.3539 21.7752 20.1783 21.8476 19.9718 21.8476C19.7654 21.8476 19.5898 21.7752 19.4448 21.6304ZM4.44101 4.51886L17.7488 17.8266C17.7168 18.2933 17.5305 18.6888 17.19 19.0131C16.8497 19.3374 16.4398 19.4996 15.9603 19.4996H4.57576C4.07059 19.4996 3.64301 19.3246 3.29301 18.9746C2.94301 18.6246 2.76801 18.197 2.76801 17.6919V6.30736C2.76801 5.82786 2.93017 5.41794 3.25451 5.07761C3.57884 4.73711 3.97434 4.55086 4.44101 4.51886Z`,"virtual-background":`M4 5C4 4.45 4.45 4 5 4H10C10.55 4 11 3.55 11 3C11 2.45 10.55 2 10 2H4C2.9 2 2 2.9 2 4V10C2 10.55 2.45 11 3 11C3.55 11 4 10.55 4 10V5ZM9.61 13.49L6.65 17.19C6.39 17.52 6.62 18 7.04 18H17C17.41 18 17.65 17.53 17.4 17.2L15.4 14.53C15.2 14.26 14.8 14.26 14.6 14.53L12.97 16.71L10.39 13.49C10.19 13.24 9.81 13.24 9.61 13.49ZM17 8.5C17 7.67 16.33 7 15.5 7C14.67 7 14 7.67 14 8.5C14 9.33 14.67 10 15.5 10C16.33 10 17 9.33 17 8.5ZM20 2H14C13.45 2 13 2.45 13 3C13 3.55 13.45 4 14 4H19C19.55 4 20 4.45 20 5V10C20 10.55 20.45 11 21 11C21.55 11 22 10.55 22 10V4C22 2.9 21.1 2 20 2ZM20 19C20 19.55 19.55 20 19 20H14C13.45 20 13 20.45 13 21C13 21.55 13.45 22 14 22H20C21.1 22 22 21.1 22 20V14C22 13.45 21.55 13 21 13C20.45 13 20 13.45 20 14V19ZM3 13C2.45 13 2 13.45 2 14V20C2 21.1 2.9 22 4 22H10C10.55 22 11 21.55 11 21C11 20.45 10.55 20 10 20H5C4.45 20 4 19.55 4 19V14C4 13.45 3.55 13 3 13Z`,wave:`M7.375 16.8077V7.19225C7.375 6.97975 7.44692 6.80167 7.59075 6.658C7.73458 6.51417 7.91275 6.44225 8.12525 6.44225C8.33792 6.44225 8.516 6.51417 8.6595 6.658C8.80317 6.80167 8.875 6.97975 8.875 7.19225V16.8077C8.875 17.0203 8.80308 17.1983 8.65925 17.342C8.51542 17.4858 8.33725 17.5577 8.12475 17.5577C7.91208 17.5577 7.734 17.4858 7.5905 17.342C7.44683 17.1983 7.375 17.0203 7.375 16.8077ZM11.25 20.75V3.25C11.25 3.0375 11.3219 2.85942 11.4658 2.71575C11.6096 2.57192 11.7878 2.5 12.0003 2.5C12.2129 2.5 12.391 2.57192 12.5345 2.71575C12.6782 2.85942 12.75 3.0375 12.75 3.25V20.75C12.75 20.9625 12.6781 21.1406 12.5343 21.2843C12.3904 21.4281 12.2122 21.5 11.9998 21.5C11.7871 21.5 11.609 21.4281 11.4655 21.2843C11.3218 21.1406 11.25 20.9625 11.25 20.75ZM3.5 12.9038V11.0962C3.5 10.8837 3.57192 10.7056 3.71575 10.5617C3.85958 10.4181 4.03775 10.3462 4.25025 10.3462C4.46292 10.3462 4.641 10.4181 4.7845 10.5617C4.92817 10.7056 5 10.8837 5 11.0962V12.9038C5 13.1163 4.92808 13.2944 4.78425 13.4383C4.64042 13.5819 4.46225 13.6538 4.24975 13.6538C4.03708 13.6538 3.859 13.5819 3.7155 13.4383C3.57183 13.2944 3.5 13.1163 3.5 12.9038ZM15.125 16.8077V7.19225C15.125 6.97975 15.1969 6.80167 15.3408 6.658C15.4846 6.51417 15.6628 6.44225 15.8753 6.44225C16.0879 6.44225 16.266 6.51417 16.4095 6.658C16.5532 6.80167 16.625 6.97975 16.625 7.19225V16.8077C16.625 17.0203 16.5531 17.1983 16.4093 17.342C16.2654 17.4858 16.0872 17.5577 15.8748 17.5577C15.6621 17.5577 15.484 17.4858 15.3405 17.342C15.1968 17.1983 15.125 17.0203 15.125 16.8077ZM19 12.9038V11.0962C19 10.8837 19.0719 10.7056 19.2158 10.5617C19.3596 10.4181 19.5378 10.3462 19.7502 10.3462C19.9629 10.3462 20.141 10.4181 20.2845 10.5617C20.4282 10.7056 20.5 10.8837 20.5 11.0962V12.9038C20.5 13.1163 20.4281 13.2944 20.2843 13.4383C20.1404 13.5819 19.9622 13.6538 19.7498 13.6538C19.5371 13.6538 19.359 13.5819 19.2155 13.4383C19.0718 13.2944 19 13.1163 19 12.9038Z`},Icon=({name:e,size:k=24,fill:A})=>{let j=typeof PATH_MAP[e]==`string`?[PATH_MAP[e]]:PATH_MAP[e];return(0,react_jsx_runtime.jsx)(react_native_svg.default,{width:k,height:k,viewBox:`0 0 24 24`,fill:`none`,children:j.map((e,k)=>(0,react_jsx_runtime.jsx)(react_native_svg.Path,{d:e,fill:A},k))})};var Icon_native_default=Icon;const POPUP_MENU_WIDTH=180,DISABLED_OPTION_OPACITY=.5,PopupMenu=({visible:e,onClose:k,options:A,anchorLayout:j})=>{let M=(0,react.useRef)(new react_native.Animated.Value(.7)).current,N=useBaseStore(e=>e.callContainerDimension);if(react.default.useEffect(()=>{e?react_native.Animated.spring(M,{toValue:1,useNativeDriver:!0,friction:12,tension:200}).start():M.setValue(.7)},[M,e]),!e||!j)return null;let{x:P,y:F,height:I}=j,L=N.width-180-10,R=N.height>>1<F;return(0,react_jsx_runtime.jsx)(react_native.Modal,{transparent:!0,animationType:`none`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],onRequestClose:k,children:(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$29.backdrop,onPress:k,testID:`cometchat-popup-menu-backdrop`,accessible:!1,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$29.menu,{[R?`bottom`:`top`]:R?N.height-(F-4):F+I+4,left:Math.min(L,P),transform:[{scale:M},{translateY:M.interpolate({inputRange:[.7,1],outputRange:[-40,0]})}]}],children:A.map((e,A)=>(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{onPress:A=>{if(e.selected){A.stopPropagation();return}e.onPress(),k()},activeOpacity:e.selected?DISABLED_OPTION_OPACITY:.2,style:[styles$29.menuItem,e.selected?styles$29.menuItemSelected:{}],testID:`cometchat-popup-menu-option-${A}`,accessible:!0,accessibilityLabel:e.label,children:[e.iconName&&(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e.iconName,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$29.menuText],children:e.label})]},A))})})})},styles$29=react_native.StyleSheet.create({backdrop:{flex:1},menu:{position:`absolute`,backgroundColor:`#141414`,borderWidth:1,borderColor:`#383838`,borderRadius:16,paddingVertical:8,width:180,shadowColor:`#000`,shadowOpacity:.3,shadowRadius:8,shadowOffset:{width:0,height:4},elevation:8,overflow:`hidden`},menuItem:{flexDirection:`row`,alignItems:`center`,paddingVertical:8,paddingHorizontal:16,height:40,gap:8},menuItemSelected:{opacity:DISABLED_OPTION_OPACITY},menuText:{color:`#FFFFFF`,flex:1},iconPlaceholder:{width:24,height:24,backgroundColor:`#858585`,borderRadius:4}});var Popup_default=PopupMenu;const styles$5=react_native.StyleSheet.create({participantItem:{flexDirection:`row`,alignItems:`center`,paddingVertical:12,paddingHorizontal:16,gap:12,backgroundColor:`#1A1A1A`},participantText:{flexDirection:`column`,alignItems:`flex-start`,gap:4,flexGrow:1,flexShrink:1},participantName:{color:`#ffffff`},participantDescription:{color:`#989898`},participantIcons:{flexDirection:`row`,alignItems:`center`,gap:12,flexShrink:0},avatar:{backgroundColor:`#3E3180`},moreButton:{width:28,height:28,justifyContent:`center`,alignItems:`center`,borderRadius:1e3,backgroundColor:`#262626`}}),MoreOptionButton=({ruid:e})=>{let[k,A]=(0,react.useState)(!1),j=(0,react.useRef)(null),[M,N]=(0,react.useState)({x:0,y:0,width:0,height:0}),P=useAllParticipants().find(k=>k.ruid===e),F=useLocalParticipant(),I=useIsParticipantPinned(P?.pid,P?.type),L=useTrackMuted(MEDIA_TYPE.AUDIO,P?.pid),R=(0,react.useMemo)(()=>{let e=[{label:I?`Unpin`:`Pin`,iconName:I?`unpin`:`pin`,onPress:()=>{I?unpinParticipant():pinParticipant(P.pid,P.type)}}];return P&&F.role===`moderator`&&P.pid!==F.pid&&(L||e.push({label:`Mute Audio`,iconName:`mic-off`,onPress:()=>{muteParticipant(P.pid)}})),e},[I,P,F.role,F.pid,L]);return P?(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{ref:j,style:styles$5.moreButton,onPress:()=>{j.current&&j.current.measureInWindow((e,k,j,M)=>{N({x:e,y:k,width:j,height:M}),A(!0)})},testID:`cometchat-participant-more-options-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`more`,size:20,fill:`#767676`})}),(0,react_jsx_runtime.jsx)(PopupMenu,{visible:k,anchorLayout:M,onClose:()=>A(!1),options:R})]}):null};var MoreOptionButton_default=MoreOptionButton;const LabelIcon=({type:e,muted:k,raisedHandTimestamp:A})=>e===`screen-share`?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`screen-share`,size:16,fill:`#858585`}):A?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`raise-hand-fill`,size:16,fill:`#141414`}):k?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`mic-off-fill`,size:16,fill:`#858585`}):(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`wave`,size:16,fill:`#0B9F5D`}),Label=({participant:e,style:k})=>{let{name:A,isLocal:j,type:M,pid:N}=e,P=useTrackMuted(MEDIA_TYPE.AUDIO,N),F=useRaisedHandTimestamp(N,M),I=useIsParticipantPinned(N,M);return(0,react_jsx_runtime.jsxs)(react_native.View,{style:[styles$28.userLabel,F?styles$28.userLabelRaisedHand:{},k],children:[I&&(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`pin`,size:16,fill:F?`#141414`:`#FFF`}),(0,react_jsx_runtime.jsx)(LabelIcon,{type:M,muted:P,raisedHandTimestamp:F}),(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.caption1Regular,styles$28.userName,F?styles$28.userNameRaisedHand:{}],numberOfLines:1,ellipsizeMode:`tail`,children:[A,` `,j&&`(You)`]})]})},styles$28=react_native.StyleSheet.create({userLabel:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,padding:4,position:`absolute`,left:4,bottom:4,backgroundColor:`#141414CC`,borderRadius:4,gap:2,maxWidth:`95%`},userLabelRaisedHand:{backgroundColor:`#FFFFFF`,borderRadius:1e3,shadowColor:`#000`,shadowOffset:{width:0,height:4},shadowOpacity:.2,shadowRadius:10,elevation:5},userName:{color:`#ffffff`,flexShrink:1},userNameRaisedHand:{color:`#141414`}});var Label_native_default=Label;const VideoNative=({videoTrack:e,style:k,objectFit:A=`cover`,mirror:j=!1,muted:M=!1,zOrder:N=0})=>{let[P,F]=(0,react.useState)(null),I=(0,react.useRef)(new react_native.Animated.Value(M?0:1)).current;return(0,react.useEffect)(()=>{e&&F(e.getOriginalStream())},[e]),(0,react.useEffect)(()=>{react_native.Animated.timing(I,{toValue:M?0:1,duration:300,useNativeDriver:!0}).start()},[M,I]),P?(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$27.videoContainer,{opacity:I}],children:(0,react_jsx_runtime.jsx)(react_native_webrtc.RTCView,{streamURL:P.toURL(),style:[styles$27.video,k],objectFit:A,mirror:j,zOrder:N})}):null},styles$27=react_native.StyleSheet.create({videoContainer:{height:`100%`,width:`100%`},video:{width:`100%`,height:`100%`}});var Video_native_default$1=VideoNative;const Tile=({participant:e,style:k,zOrder:A,showLabel:j=!0,disablePress:M=!1})=>{let{name:N,avatar:P,type:F,pid:I,ruid:L,isLocal:R}=e,z=useTrackByParticipantId(I,F===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO)?.originalTrack,V=useTrackMuted(F===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO,I),H=useEnableParticipantContextMenu(),W=useShouldMirrorLocalVideo(),[K,q]=react.default.useMemo(()=>{let e=react_native.StyleSheet.flatten(k),A=e?.width,j=e?.height;if(typeof A==`number`&&typeof j==`number`){let e=Math.min(Math.min(A,j)>>1,120);return[e,e>>1]}return[48,24]},[k]);return(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{activeOpacity:1,disabled:M,style:[styles$26.callScreen,k],testID:`cometchat-tile-${I}`,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$26.tileAvatar,children:(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:N,imageUrl:P,size:K,fontSize:q})}),(0,react_jsx_runtime.jsx)(Video_native_default$1,{videoTrack:z,objectFit:F===`screen-share`?`contain`:`cover`,muted:V,zOrder:A,mirror:R&&F!==`screen-share`&&W}),j&&(0,react_jsx_runtime.jsx)(Label_native_default,{participant:e}),H&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$26.rightTopButton,children:(0,react_jsx_runtime.jsx)(MoreOptionButton_default,{ruid:L})})]})},styles$26=react_native.StyleSheet.create({callScreen:{width:`100%`,height:`100%`,backgroundColor:`#272727`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,overflow:`hidden`},tileAvatar:{width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`,flexShrink:0},rightTopButton:{position:`absolute`,top:4,right:4}});var Tile_native_default=Tile;const Badge=({size:e=40,text:k})=>(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$25.overflowCircle,{width:e,height:e,borderRadius:e/2}],children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Medium,styles$25.overflowText],children:k})}),GroupAvatarTile=({startIndex:e=4,style:k})=>{let A=useAllParticipants(),j=A.length,M=Math.max(0,j-e-3),N=A.slice(e,e+(M===1?4:3));return(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{testID:`cometchat-group-avatar-tile`,style:[styles$25.container,k],onPress:toggleParticipantListVisible,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$25.row,children:N.slice(0,2).map(e=>(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:e.name,imageUrl:e.avatar},e.ruid))}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$25.row,children:[N[2]&&(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:N[2].name,imageUrl:N[2].avatar}),N[3]?(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:N[3].name,imageUrl:N[3].avatar}):null,M>1&&(0,react_jsx_runtime.jsx)(Badge,{size:40,text:`+${M}`})]})]})};var GroupAvatarTile_native_default=GroupAvatarTile;const styles$25=react_native.StyleSheet.create({container:{justifyContent:`center`,alignItems:`center`,gap:8,backgroundColor:`#272727`,borderRadius:8},row:{flexDirection:`row`,gap:8},overflowCircle:{backgroundColor:`#3E3180`,alignItems:`center`,justifyContent:`center`},overflowText:{color:`white`}}),useSidebarTileLayout=()=>{let e=useAllParticipants().length,k=useBaseStore(e=>e.mainAreaDimension);return react.default.useMemo(()=>{e>1&&e++;let A=k.width,j=k.height,M=0,N=0,P=1,F=1;return e===2?(M=k.width,N=9/16*M,j=k.height-8-N):e===3?(M=(k.width-8)/2,N=3/4*M,j=k.height-8-N,F=2):e===4?(M=(k.width-16)/3,N=M,j=k.height-8-N,F=3):e>=5&&(M=(k.width-8)/2,N=3/4*M,j=k.height-16-N*2,P=2,F=2),{tileWidthFirst:A,tileHeightFirst:j,tileWidthOther:M,tileHeightOther:N,numberOfRows:P,numberOfCols:F}},[e,k.width,k.height])};function SidebarLayout(){let e=useAllParticipants(),k=useSidebarTileLayout(),A=useMainParticipant(),j=e.length>1?[A].concat(e):[A];return(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-sidebar-layout`,style:styles$24.container,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:j[0],style:{width:k.tileWidthFirst,height:k.tileHeightFirst}}),k.numberOfRows>=1&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$24.row,children:j.slice(1,1+k.numberOfCols).map(e=>(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e,style:{width:k.tileWidthOther,height:k.tileHeightOther}},e.ruid))}),k.numberOfRows>=2&&(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$24.row,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:j[3],style:{width:k.tileWidthOther,height:k.tileHeightOther}},j[3].ruid),j.length===5&&(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:j[4],style:{width:k.tileWidthOther,height:k.tileHeightOther}},j[4].ruid),j.length>5&&(0,react_jsx_runtime.jsx)(GroupAvatarTile_native_default,{startIndex:3,style:{width:k.tileWidthOther,height:k.tileHeightOther}})]})]})}const styles$24=react_native.StyleSheet.create({container:{gap:8},row:{flexDirection:`row`,justifyContent:`center`,gap:8}});var SidebarLayout_native_default=SidebarLayout;const Pan=({layout:e,children:k,margin:A=8,disableDrag:j=!1})=>{let M=e.width/4,N=e.height/4,P=(0,react.useRef)(new react_native.Animated.ValueXY({x:e.width-M-A,y:e.height-N-A})).current,F=(0,react.useRef)(react_native.PanResponder.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:()=>{P.extractOffset()},onPanResponderMove:react_native.Animated.event([null,{dx:P.x,dy:P.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{P.flattenOffset()}})).current;return(0,react.useEffect)(()=>{P.setValue({x:e.width-M-A,y:e.height-N-A})},[e,P,M,N,A]),e.width<M+A*2||e.height<N+A*2?null:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{...j?{}:F.panHandlers,style:[styles$23.box,{width:M,height:N},{transform:[{translateX:P.x.interpolate({inputRange:[A,e.width-M-A],outputRange:[A,e.width-M-A],extrapolate:`clamp`})},{translateY:P.y.interpolate({inputRange:[A,e.height-N-A],outputRange:[A,e.height-N-A],extrapolate:`clamp`})}]}],children:k})},styles$23=react_native.StyleSheet.create({box:{position:`absolute`,borderRadius:10,overflow:`hidden`}}),Spotlight=()=>{let e=useMainParticipant(),k=useAllParticipants(),A=useBaseStore(e=>e.mainAreaDimension),j=useConfigStore(e=>e.enableSpotlightDrag),M=useConfigStore(e=>e.enableSpotlightSwap),N=[e],P=k.find(k=>k.ruid!==e.ruid);return P&&N.push(P),(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-spotlight-layout`,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:N[0],disablePress:!0},N[0].ruid),N[1]&&(0,react_jsx_runtime.jsx)(Pan,{disableDrag:!j,layout:{width:A.width,height:A.height},children:(0,react_jsx_runtime.jsx)(Tile_native_default,{showLabel:!1,disablePress:!M,participant:N[1],style:styles$22.panTile,zOrder:1},N[1].ruid)})]})},styles$22=react_native.StyleSheet.create({panTile:{borderColor:`#1A1A1A`,borderWidth:2}}),getTileDimensions=({layout:e,participantCount:k})=>{if(k<4)return{tileWidth:e.width,tileHeight:(e.height-8*(k-1))/k};let A=e.width/2;return{tileWidth:A,tileHeight:Math.max(e.height/Math.ceil(k/2),A*9/16)}};function TileLayout(){let e=useAllParticipants(),k=useBaseStore(e=>e.isPIPLayoutEnabled),A=useMainParticipant(),j=getTileDimensions({layout:useBaseStore(e=>e.mainAreaDimension),participantCount:k?1:e.length});return(0,react_jsx_runtime.jsx)(react_native.FlatList,{testID:`cometchat-tile-layout`,data:k?[A]:e,renderItem:({item:e})=>(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e,style:{width:j.tileWidth,height:j.tileHeight}}),keyExtractor:e=>e.ruid,contentContainerStyle:styles$21.contentContainerStyle,showsVerticalScrollIndicator:!1,onViewableItemsChanged:e=>{e.viewableItems.length},showsHorizontalScrollIndicator:!1,horizontal:!1,numColumns:e.length<4?1:2,...e.length<4?{}:{columnWrapperStyle:{gap:8}}},e.length<4?1:2)}const styles$21=react_native.StyleSheet.create({contentContainerStyle:{alignItems:`center`,gap:8,paddingHorizontal:20}});var TileLayout_default=TileLayout;function ProcessingOverlay({message:e,visible:k=!0,animated:A=!1}){let j=(0,react.useRef)(new react_native.Animated.Value(1)).current,[M,N]=(0,react.useState)(!0);return(0,react.useEffect)(()=>{k?(j.setValue(1),N(!0)):A?react_native.Animated.timing(j,{toValue:0,duration:300,useNativeDriver:!0}).start(()=>{N(!1)}):N(!1)},[j,k,A]),M?(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$20.overlay,{opacity:j}],children:[(0,react_jsx_runtime.jsx)(react_native.ActivityIndicator,{size:`large`,color:`#fff`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$20.text],children:e})]}):null}const styles$20=react_native.StyleSheet.create({overlay:{justifyContent:`center`,alignItems:`center`,backgroundColor:`#1A1A1A`,zIndex:2},text:{color:`#fff`,textAlign:`center`,margin:16}});function CallStage(){let e=useBaseStore(e=>e.mainAreaDimension),k=useLayout(),A=useIsReconnecting(),j=e.width>0&&e.height>0;return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$19.container,onLayout:e=>{useBaseStore.setState({mainAreaDimension:{width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}})},children:[k===LAYOUT.TILE&&j&&(0,react_jsx_runtime.jsx)(TileLayout_default,{}),k===LAYOUT.SPOTLIGHT&&j&&(0,react_jsx_runtime.jsx)(Spotlight,{}),k===LAYOUT.SIDEBAR&&j&&(0,react_jsx_runtime.jsx)(SidebarLayout_native_default,{}),A&&(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`You've been disconnected. Attempting to reconnect…`})]})}const styles$19=react_native.StyleSheet.create({container:{flex:1,marginHorizontal:20,marginVertical:8}});var CallStage_native_default=CallStage;const initialState={title:``,description:``,cancelText:``,confirmText:``,visible:!1,inputPlaceholder:``,inputValue:``,secondInputPlaceholder:``,secondInputValue:``},useConfirmationDialogStore=(0,zustand.create)((0,zustand_middleware.combine)(initialState,e=>({onCancel:()=>{e({visible:!1})},onConfirm:()=>{e({visible:!1})},onBackdropClick:()=>{e({visible:!1})},reset:()=>{e(initialState)}})));function reset(){useConfirmationDialogStore.setState(initialState),useConfirmationDialogStore.setState({onCancel:()=>{useConfirmationDialogStore.setState({visible:!1})},onConfirm:()=>{useConfirmationDialogStore.setState({visible:!1})},onBackdropClick:()=>{useConfirmationDialogStore.setState({visible:!1})}})}function showConfirmationDialog(e,k,A,j,M=()=>{},N=()=>{},P,F){useConfirmationDialogStore.setState({title:e,description:k,confirmText:A,cancelText:j,inputPlaceholder:P,inputValue:``,secondInputPlaceholder:F,secondInputValue:``,onConfirm:()=>{let{inputValue:e,secondInputValue:k}=useConfirmationDialogStore.getState();M(P?e.trim():void 0,F?k.trim():void 0),reset()},onCancel:()=>{N(),reset()},visible:!0})}const{width}=react_native.Dimensions.get(`window`),styles$18=react_native.StyleSheet.create({keyboardAvoidingView:{flex:1},backdrop:{flex:1,backgroundColor:`rgba(0, 0, 0, 0.8)`,justifyContent:`center`,alignItems:`center`,zIndex:1e3},dialog:{maxWidth:372,width:width*.9,backgroundColor:colors.background[1],borderWidth:1,borderColor:colors.border.default,borderRadius:spacing[3],paddingTop:padding[8],paddingHorizontal:padding[5],paddingBottom:padding[5],shadowColor:`#101828`,shadowOffset:{width:0,height:4},shadowOpacity:.08,shadowRadius:6,elevation:4},content:{alignItems:`center`,gap:spacing[5]},textContainer:{alignItems:`flex-start`,gap:spacing[2],width:`100%`},title:{...commonStyles.heading2Medium,color:colors.text.primary,textAlign:`center`,width:`100%`},description:{...commonStyles.bodyRegular,color:colors.text.secondary,textAlign:`center`,width:`100%`,lineHeight:16.8},input:{...commonStyles.bodyRegular,width:`100%`,height:40,borderWidth:1,borderColor:colors.border.default,borderRadius:borderRadius[2],paddingHorizontal:padding[3],color:colors.text.primary},buttonsContainer:{flexDirection:`row`,alignItems:`center`,gap:spacing[3],width:`100%`},button:{height:40,paddingVertical:padding[2],paddingHorizontal:padding[5],justifyContent:`center`,alignItems:`center`,borderRadius:borderRadius[2],flex:1,borderWidth:1},buttonSecondary:{backgroundColor:`transparent`,borderColor:colors.border.dark},buttonPrimary:{backgroundColor:colors.button.primaryBackground,borderColor:colors.button.primaryBackground},buttonDisabled:{opacity:.5},buttonText:{...commonStyles.buttonMedium,textAlign:`center`},buttonTextSecondary:{color:colors.button.secondaryText},buttonTextPrimary:{color:colors.button.primaryText}});function ConfirmationDialog(){let{title:e,description:k,cancelText:A,confirmText:j,onCancel:M,onConfirm:N,onBackdropClick:P,visible:F,inputPlaceholder:I,inputValue:L,secondInputPlaceholder:R,secondInputValue:z}=useConfirmationDialogStore(),B=!!I&&!L.trim(),V=()=>{P&&P()};return(0,react_jsx_runtime.jsx)(react_native.Modal,{visible:F,transparent:!0,animationType:`fade`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],onRequestClose:V,children:(0,react_jsx_runtime.jsx)(react_native.KeyboardAvoidingView,{style:styles$18.keyboardAvoidingView,behavior:react_native.Platform.OS===`ios`?`padding`:void 0,children:(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$18.backdrop,onPress:V,testID:`cometchat-confirmation-dialog-backdrop`,accessible:!1,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$18.dialog,children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.content,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.textContainer,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$18.title,children:e}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$18.description,children:k})]}),I?(0,react_jsx_runtime.jsx)(react_native.TextInput,{style:styles$18.input,placeholder:I,placeholderTextColor:colors.text.secondary,value:L,onChangeText:e=>useConfirmationDialogStore.setState({inputValue:e}),autoCapitalize:`none`,autoCorrect:!1,testID:`cometchat-confirmation-dialog-input`}):null,R?(0,react_jsx_runtime.jsx)(react_native.TextInput,{style:styles$18.input,placeholder:R,placeholderTextColor:colors.text.secondary,value:z,onChangeText:e=>useConfirmationDialogStore.setState({secondInputValue:e}),autoCapitalize:`none`,autoCorrect:!1,testID:`cometchat-confirmation-dialog-second-input`}):null,(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.buttonsContainer,children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$18.button,styles$18.buttonSecondary],onPress:M,testID:`cometchat-confirmation-dialog-cancel-button`,accessible:!0,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[styles$18.buttonText,styles$18.buttonTextSecondary],children:A})}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$18.button,styles$18.buttonPrimary,B&&styles$18.buttonDisabled],onPress:N,disabled:B,testID:`cometchat-confirmation-dialog-confirm-button`,accessible:!0,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[styles$18.buttonText,styles$18.buttonTextPrimary],children:j})})]})]})})})})})}const SCREEN_HEIGHT=react_native.Dimensions.get(`window`).height,BottomSheet=({children:e,isVisible:k,onClose:A,maxHeight:j=SCREEN_HEIGHT*.4,testID:M})=>{let N=SCREEN_HEIGHT-j,P=(0,react.useRef)(SCREEN_HEIGHT).current,F=(0,react.useRef)(new react_native.Animated.Value(P)).current,I=(0,react.useCallback)(e=>{let k=e===`up`?N:P;react_native.Animated.spring(F,{toValue:k,useNativeDriver:!0,bounciness:0}).start()},[F,P,N]);(0,react.useEffect)(()=>{I(k?`up`:`down`)},[k,I]);let L={transform:[{translateY:F}]};return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[k&&(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{onPress:A,testID:`cometchat-bottom-sheet-backdrop`,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:[commonStyles.absoluteFill,styles$17.backdrop]})}),(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{testID:M,style:[styles$17.bottomSheet,L,{height:j}],children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$17.draggableArea,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$17.dragHandle})}),(0,react_jsx_runtime.jsx)(react_native.ScrollView,{children:e})]})]})},styles$17=react_native.StyleSheet.create({backdrop:{backgroundColor:`rgba(0,0,0,0.5)`,zIndex:1},bottomSheet:{position:`absolute`,width:`100%`,backgroundColor:`#1A1A1A`,borderTopLeftRadius:16,borderTopRightRadius:16,paddingBottom:8,borderWidth:1,borderColor:`#383838`,zIndex:2,left:0,right:0,top:0,shadowColor:`#101828`,shadowOffset:{width:0,height:-6},shadowOpacity:.08,shadowRadius:10,elevation:8},draggableArea:{width:`100%`,alignItems:`center`,paddingVertical:10,borderTopLeftRadius:20,borderTopRightRadius:20},dragHandle:{width:32,height:4,backgroundColor:`#A1A1A1`,borderRadius:1e3}});var BottomSheet_native_default=BottomSheet;const DEFAULT_AUDIO_MODE_ICON=`speaker-fill`,AUDIO_MODE_TYPE_ICON_MAP={BLUETOOTH:`bluetooth`,CAR:`car`,EARPIECE:`earpiece`,HEADPHONES:`headphones`,SPEAKER:`speaker-fill`},getAudioModeIcon=e=>e&&AUDIO_MODE_TYPE_ICON_MAP[e]||`speaker-fill`,MenuItem=({iconName:e,label:k,onPress:A,selected:j=!1,disabled:M=!1,testID:N})=>(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{testID:N,disabled:M,onPress:()=>{hideAllBottomSheets(),A()},style:[styles$16.menuItem,j&&styles$16.menuItemSelected,M&&styles$16.menuItemDisabled],children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Regular,styles$16.menuLabel],children:k})]}),styles$16=react_native.StyleSheet.create({menuItem:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,paddingVertical:12,gap:8},menuItemSelected:{backgroundColor:`#383838`},menuItemDisabled:{opacity:.5},menuLabel:{color:colors.text.primary,textTransform:`capitalize`}});var MenuItem_native_default=MenuItem;const AudioModesMenu=({isVisible:e,onClose:k})=>{let A=useBaseStore(e=>e.audioModes),j=124+Math.max(A.length,1)*48;return(0,react_jsx_runtime.jsx)(BottomSheet_native_default,{maxHeight:j,isVisible:e,onClose:k,children:(0,react_jsx_runtime.jsxs)(react_native.ScrollView,{children:[A.length===0&&(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$15.noItemsText],children:`No audio modes available`}),A.map((e,k)=>(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-audio-${e.type.toLowerCase()}`,iconName:AUDIO_MODE_TYPE_ICON_MAP[e.type],label:e.type,selected:e.selected,onPress:()=>{requestAudioModeChange(e).catch(e=>void 0)}},k))]})})},styles$15=react_native.StyleSheet.create({noItemsText:{padding:16,textAlign:`center`,color:colors.text.secondary}});var AudioModesMenu_native_default=AudioModesMenu;const controlPaneStyles=react_native.StyleSheet.create({controlPane:{flexDirection:`row`,alignItems:`center`,justifyContent:`center`,paddingVertical:16,paddingHorizontal:20,gap:12},controlButton:{flex:1,maxWidth:72,height:56,borderRadius:28,backgroundColor:`#272727`,alignItems:`center`,justifyContent:`center`},leaveSessionButton:{backgroundColor:`#C73C3E`},toggledButton:{backgroundColor:colors.alert.errorBackground},activeButton:{backgroundColor:colors.static.white}}),AudioModeButton=()=>{let e=useConfigStore(e=>e.hideAudioModeButton),k=useBaseStore(e=>e.selectedAudioModeType);return e?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:controlPaneStyles.controlButton,onPress:toggleAudioModeMenuVisible,activeOpacity:.7,testID:`cometchat-audio-mode-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:getAudioModeIcon(k),fill:`#FFF`,size:24})})};var AudioModeButton_default=AudioModeButton;const AudioControl=()=>{let e=useTrackMuted(MEDIA_TYPE.AUDIO);return useHideMuteAudioButton()?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,e&&controlPaneStyles.toggledButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onToggleAudioButtonClicked}),toggleAudioTrack()},activeOpacity:.7,testID:`cometchat-audio-toggle-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e?`mic-off-fill`:`mic-fill`,fill:e?`#9F3032`:`#FFF`,size:24})})};var Audio_native_default=AudioControl;const VideoControl=()=>{let e=useHideToggleVideoButton(),k=useTrackMuted(MEDIA_TYPE.VIDEO);return e?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,k&&controlPaneStyles.toggledButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onToggleVideoButtonClicked}),toggleVideoTrack()},activeOpacity:.7,testID:`cometchat-video-toggle-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:k?`video-off-fill`:`video-fill`,fill:k?`#9F3032`:`#FFF`,size:24})})};var Video_native_default=VideoControl;const LeaveSessionButton=()=>useConfigStore(e=>e.hideLeaveSessionButton)?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,controlPaneStyles.leaveSessionButton],onPress:()=>{leaveSession(),eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onLeaveSessionButtonClicked})},activeOpacity:.7,testID:`cometchat-leave-session-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`call-end`,fill:`#FFF`,size:24})});var LeaveSessionButton_native_default=LeaveSessionButton;const MoreMenuButton=()=>(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:controlPaneStyles.controlButton,onPress:toggleMoreMenuVisible,activeOpacity:.7,testID:`cometchat-more-menu-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`more`,fill:`#FFF`,size:24})});var MoreMenuButton_default=MoreMenuButton;const ControlPane=()=>useConfigStore(e=>e.hideControlPanel)?null:(0,react_jsx_runtime.jsxs)(react_native.View,{style:controlPaneStyles.controlPane,testID:`cometchat-control-panel`,children:[(0,react_jsx_runtime.jsx)(Audio_native_default,{}),(0,react_jsx_runtime.jsx)(Video_native_default,{}),(0,react_jsx_runtime.jsx)(AudioModeButton_default,{}),(0,react_jsx_runtime.jsx)(MoreMenuButton_default,{}),(0,react_jsx_runtime.jsx)(LeaveSessionButton_native_default,{})]});var ControlPane_native_default=ControlPane;const ScreenShareButton=()=>{let e=useScreenShareRunning();return(0,react_jsx_runtime.jsx)(MenuItem_native_default,{iconName:e?`screen-share-stop`:`screen-share`,selected:e,label:e?`Stop screen sharing`:`Start Screen Sharing`,onPress:e?stopScreenSharing:startScreenSharing})};var ScreenShareButton_default=ScreenShareButton;const MoreMenu=({isVisible:e,onClose:k})=>{let A=useRaisedHandTimestamp(),j=useHideRecordingButton(),M=useHideStreamingButton(),{t:N}=useTranslation(),P=useIsRecording(),F=useIsStreaming(),I=useConferenceStore(e=>e.recording.status),L=useConfigStore(e=>e.hideRaiseHandButton),R=useConfigStore(e=>e.hideParticipantListButton),z=useHideScreenSharingButton(),V=0;j===!1&&V++,M===!1&&V++,L===!1&&V++,R===!1&&V++,z===!1&&V++;let H=124+Math.max(V,1)*48,W=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onRaiseHandButtonClicked}),toggleRaiseHand()},[]),K=(0,react.useCallback)(()=>{if(I!==`pending`)if(F)showConfirmationDialog(N(`controlPanel.streaming.stopStreaming`),N(`controlPanel.streaming.stopStreamingConfirmation`),N(`controlPanel.streaming.stopStreaming`),N(`controlPanel.streaming.cancel`),()=>stopStreaming());else{let{streamUrl:e,streamKey:k}=useConfigStore.getState();if(e){startStreaming(e,k??``);return}showConfirmationDialog(N(`controlPanel.streaming.startStreaming`),N(`controlPanel.streaming.startStreamingConfirmation`),N(`controlPanel.streaming.startStreaming`),N(`controlPanel.streaming.cancel`),(e,k)=>{e&&startStreaming(e,k??``)},()=>{},N(`controlPanel.streaming.streamUrlPlaceholder`),N(`controlPanel.streaming.streamKeyPlaceholder`))}},[F,I,N]),q=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onParticipantListButtonClicked}),toggleParticipantListVisible()},[]);return(0,react_jsx_runtime.jsx)(BottomSheet_native_default,{testID:`cometchat-more-menu-bottom-sheet`,maxHeight:H,isVisible:e,onClose:k,children:(0,react_jsx_runtime.jsxs)(react_native.ScrollView,{children:[V===0&&(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-more-menu-empty-state`,style:[commonStyles.bodyRegular,styles$14.noItemsText],children:`No options available`}),!z&&(0,react_jsx_runtime.jsx)(ScreenShareButton_default,{}),!L&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-raise-hand`,iconName:`raise-hand-fill`,label:A?`Lower Hand`:`Raise Hand`,onPress:W,selected:!!A}),!M&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:F?`cometchat-menu-item-stop-streaming`:`cometchat-menu-item-start-streaming`,iconName:F?`streaming-stop`:`streaming`,label:N(F?`controlPanel.streaming.stopStreaming`:`controlPanel.streaming.startStreaming`),disabled:I===`pending`,onPress:K}),!j&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:P?`cometchat-menu-item-stop-recording`:`cometchat-menu-item-start-recording`,iconName:P?`record-stop-fill`:`record-fill`,label:P?`Stop Recording`:`Start Recording`,onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onRecordingToggleButtonClicked}),showConfirmationDialog(N(P?`controlPanel.recording.stopRecording`:`controlPanel.recording.startRecording`),N(P?`controlPanel.recording.stopRecordingConfirmation`:`controlPanel.recording.startRecordingConfirmation`),N(P?`controlPanel.recording.stopRecording`:`controlPanel.recording.startRecording`),N(`controlPanel.recording.cancel`),()=>{toggleRecording()})}}),!R&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-participants`,iconName:`participants`,label:`Participants`,onPress:q})]})})},styles$14=react_native.StyleSheet.create({noItemsText:{padding:16,textAlign:`center`,color:`#888`}});var MoreMenu_native_default=MoreMenu;const FullScreenDialog=({children:e,visible:k=!1})=>{let[A,j]=(0,react.useState)(k),M=(0,react.useRef)(new react_native.Animated.Value(0)).current;return(0,react.useEffect)(()=>{k?(j(!0),react_native.Animated.timing(M,{toValue:1,duration:300,useNativeDriver:!0}).start()):react_native.Animated.timing(M,{toValue:0,duration:300,useNativeDriver:!0}).start(()=>{j(!1)})},[k,M]),A?(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$13.container,{opacity:M}],children:e}):null},styles$13=react_native.StyleSheet.create({container:{zIndex:1e3}});var FullScreenDialog_native_default=FullScreenDialog;const RecordingIndicator=({style:e})=>{let k=(0,react.useRef)(new react_native.Animated.Value(1)).current,A=(0,react.useRef)(new react_native.Animated.Value(.6)).current,j=useIsRecording(),M=useConfigStore(e=>e.hideRecordingStatusIndicator),{t:N}=useTranslation();return(0,react.useEffect)(()=>{if(!j)return;let e=react_native.Animated.loop(react_native.Animated.parallel([react_native.Animated.timing(k,{toValue:2.4,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0}),react_native.Animated.timing(A,{toValue:0,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>{e.stop(),k.setValue(1),A.setValue(.6)}},[j,k,A]),!j||M?null:(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-recording-indicator`,accessible:!0,accessibilityRole:`text`,accessibilityLiveRegion:`polite`,accessibilityLabel:N(`indicators.recording.tooltip`),style:[styles$12.container,e],children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$12.dotWrapper,children:[(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$12.ring,{opacity:A,transform:[{scale:k}]}]}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$12.dot})]}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption2Bold,styles$12.text],children:N(`indicators.recording.label`)})]})},DOT_SIZE$1=8,styles$12=react_native.StyleSheet.create({container:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,gap:spacing[1],paddingVertical:padding[1],paddingHorizontal:padding[2],backgroundColor:colors.background[3],borderRadius:borderRadius.max},dotWrapper:{width:8,height:8,alignItems:`center`,justifyContent:`center`},ring:{position:`absolute`,width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.error},dot:{width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.error},text:{color:colors.static.white,letterSpacing:.4,textTransform:`uppercase`}});var RecordingIndicator_native_default=RecordingIndicator;const StreamingIndicator=({style:e})=>{let k=(0,react.useRef)(new react_native.Animated.Value(1)).current,A=(0,react.useRef)(new react_native.Animated.Value(.6)).current,j=useIsStreaming(),M=useConfigStore(e=>e.hideStreamingStatusIndicator),{t:N}=useTranslation();return(0,react.useEffect)(()=>{if(!j)return;let e=react_native.Animated.loop(react_native.Animated.parallel([react_native.Animated.timing(k,{toValue:2.4,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0}),react_native.Animated.timing(A,{toValue:0,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>{e.stop(),k.setValue(1),A.setValue(.6)}},[j,k,A]),!j||M?null:(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-streaming-indicator`,accessible:!0,accessibilityRole:`text`,accessibilityLiveRegion:`polite`,accessibilityLabel:N(`indicators.streaming.tooltip`),style:[styles$11.container,e],children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$11.dotWrapper,children:[(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$11.ring,{opacity:A,transform:[{scale:k}]}]}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$11.dot})]}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption2Bold,styles$11.text],children:N(`indicators.streaming.label`)})]})},DOT_SIZE=8,styles$11=react_native.StyleSheet.create({container:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,gap:spacing[1],paddingVertical:padding[1],paddingHorizontal:padding[2],backgroundColor:colors.background[3],borderRadius:borderRadius.max},dotWrapper:{width:8,height:8,alignItems:`center`,justifyContent:`center`},ring:{position:`absolute`,width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.warning},dot:{width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.warning},text:{color:colors.static.white,letterSpacing:.4,textTransform:`uppercase`}});var StreamingIndicator_native_default=StreamingIndicator;const styles$8=react_native.StyleSheet.create({headerContainer:{flexDirection:`row`,alignItems:`center`,paddingVertical:8,paddingHorizontal:20,justifyContent:`space-between`,width:`100%`},meetingInfo:{flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,gap:4,flex:1},meetingTitle:{color:`#FFFFFF`},meetingTime:{color:`#FFFFFF`},sessionMeta:{flexDirection:`row`,alignItems:`center`,gap:8},iconControls:{flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,gap:12,flexShrink:0},iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},activeButton:{backgroundColor:`#383838`}}),ChangeLayout=()=>{let e=useConfigStore(e=>e.hideChangeLayoutButton),[k,A]=(0,react.useState)(!1),j=useLayout(),M=(0,react.useRef)(null),[N,P]=(0,react.useState)({x:0,y:0,width:0,height:0});if(e)return null;let F=()=>{M.current&&M.current.measureInWindow((e,k,j,M)=>{P({x:e,y:k,width:j,height:M}),A(!0)})};return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{ref:M,style:[styles$8.iconButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onChangeLayoutButtonClicked}),F()},testID:`cometchat-change-layout-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`tile-fill`,fill:`#FFFFFF`})}),(0,react_jsx_runtime.jsx)(PopupMenu,{visible:k,anchorLayout:N,onClose:()=>A(!1),options:[{label:`Tile View`,iconName:`tile-fill`,selected:j===LAYOUT.TILE,onPress:()=>{useBaseStore.setState({layout:LAYOUT.TILE})}},{label:`Sidebar View`,iconName:`sidebar`,selected:j===LAYOUT.SIDEBAR,onPress:()=>{useBaseStore.setState({layout:LAYOUT.SIDEBAR})}},{label:`Spotlight View`,iconName:`spotlight`,selected:j===LAYOUT.SPOTLIGHT,onPress:()=>{useBaseStore.setState({layout:LAYOUT.SPOTLIGHT})}}]})]})};var ChangeLayout_default=ChangeLayout;const ChatButton=()=>{let e=useHideChatButton(),k=useBaseStore(e=>e.chatButtonUnreadCount),A=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChatButtonClicked})},[]);return e?null:(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{style:[styles$10.iconButton],onPress:A,testID:`cometchat-chat-button`,children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`chat`,fill:`#FFFFFF`}),k>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$10.badge,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$10.badgeText,children:k>99?`99+`:k})})]})},styles$10=react_native.StyleSheet.create({iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},badge:{position:`absolute`,top:-1,right:-1,backgroundColor:colors.primary,borderRadius:borderRadius.max,minWidth:18,height:18,justifyContent:`center`,alignItems:`center`,paddingHorizontal:padding[1]},badgeText:{color:colors.static.white,textAlign:`center`,...commonStyles.caption1Bold}});var ChatButton_default=ChatButton;const SwitchCamera=()=>{let e=!!useTrackMuted(MEDIA_TYPE.VIDEO),k=useHideSwitchCameraButton(),A=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onSwitchCameraButtonClicked}),switchCamera()},[]);return k?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{testID:`cometchat-switch-camera-button`,disabled:e,style:[styles$9.iconButton,e&&styles$9.iconButtonDisabled],onPress:A,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`switch-camera`,fill:`#FFFFFF`})})},styles$9=react_native.StyleSheet.create({iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},iconButtonDisabled:{opacity:.5}});var SwitchCamera_default=SwitchCamera;const SessionTimer=()=>{let e=useSessionTimer();return useConfigStore(e=>e.hideSessionTimer)?null:(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-session-timer`,style:[commonStyles.caption1Regular,styles$8.meetingTime],children:miliSecondsToMMSS(e)})},Header=()=>{let e=useConfigStore(e=>e.title);return useConfigStore(e=>e.hideHeaderPanel)?null:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.headerContainer,testID:`cometchat-header-panel`,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.meetingInfo,children:[e&&(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-session-title`,style:[commonStyles.heading4Medium,styles$8.meetingTitle],numberOfLines:1,ellipsizeMode:`tail`,children:e}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.sessionMeta,children:[(0,react_jsx_runtime.jsx)(SessionTimer,{}),(0,react_jsx_runtime.jsx)(RecordingIndicator_native_default,{}),(0,react_jsx_runtime.jsx)(StreamingIndicator_native_default,{})]})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.iconControls,children:[(0,react_jsx_runtime.jsx)(SwitchCamera_default,{}),(0,react_jsx_runtime.jsx)(ChangeLayout_default,{}),(0,react_jsx_runtime.jsx)(ChatButton_default,{})]})]})};var Header_native_default=Header;const IdealTimeoutModal=({style:e={}})=>{let k=useBaseStore(e=>e.idleTimeoutModalVisible),A=useConfigStore(e=>e.idleTimeoutPeriodAfterPrompt),[j,M]=(0,react.useState)(A),N=miliSecondsToMMSS(j),P=(0,react.useRef)(new react_native.Animated.Value(0)).current,F=(0,react.useRef)(new react_native.Animated.Value(.8)).current,I=Math.ceil(j/6e4),L=()=>{useBaseStore.getState().restartIdealTimeoutTimer()};return(0,react.useEffect)(()=>{k?react_native.Animated.parallel([react_native.Animated.timing(P,{toValue:1,duration:300,useNativeDriver:!0}),react_native.Animated.spring(F,{toValue:1,tension:100,friction:8,useNativeDriver:!0})]).start():react_native.Animated.parallel([react_native.Animated.timing(P,{toValue:0,duration:200,useNativeDriver:!0}),react_native.Animated.timing(F,{toValue:.8,duration:200,useNativeDriver:!0})]).start()},[k,P,F]),(0,react.useEffect)(()=>{let e=setInterval(()=>{if(!k){clearInterval(e);return}M(k=>k<=1e3?(clearInterval(e),leaveSessionDueToIdleTimeout(),0):k-1e3)},1e3);return()=>clearInterval(e)},[k]),(0,react.useEffect)(()=>{k&&M(A)},[k,A]),k?(0,react_jsx_runtime.jsx)(react_native.Modal,{transparent:!0,visible:k,animationType:`none`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],statusBarTranslucent:!0,children:(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{onPress:()=>{L()},testID:`cometchat-idle-timeout-overlay`,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$7.overlay,{opacity:P}],children:(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{testID:`cometchat-idle-timeout-modal`,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$7.modal,e,{opacity:P,transform:[{scale:F}]}],children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.content,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$7.timerIcon,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading3Bold,styles$7.timerText],children:N})}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.textContent,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading2Medium,styles$7.title],children:`Are you still there?`}),(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.bodyRegular,styles$7.subtitle],children:[`You are the only one here, so this call will end in less than `,I,` minute`,I>1?`s`:``,`. Do you want to stay in this call?`]})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.actions,children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$7.button,styles$7.buttonSecondary],onPress:L,activeOpacity:.8,testID:`cometchat-idle-timeout-stay-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$7.buttonSecondaryText],children:`Stay on the call`})}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$7.button,styles$7.buttonPrimary],onPress:()=>leaveSession(),activeOpacity:.8,testID:`cometchat-idle-timeout-leave-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$7.buttonPrimaryText],children:`Leave now`})})]})]})})})})})}):null},styles$7=react_native.StyleSheet.create({overlay:{flex:1,backgroundColor:`rgba(0, 0, 0, 0.6)`,justifyContent:`center`,alignItems:`center`,paddingHorizontal:20},modal:{backgroundColor:`#141414`,borderRadius:20,borderWidth:1,borderColor:`#383838`,width:`100%`,maxWidth:372,paddingTop:32,paddingHorizontal:20,paddingBottom:20,shadowColor:`#000`,shadowOffset:{width:0,height:12},shadowOpacity:.08,shadowRadius:16,elevation:8},content:{alignItems:`center`,gap:20},timerIcon:{width:80,height:80,borderRadius:40,backgroundColor:`#473892`,justifyContent:`center`,alignItems:`center`},timerText:{color:`#FFFFFF`,textAlign:`center`},textContent:{alignItems:`center`,gap:8,width:`100%`},title:{color:`#FFFFFF`,textAlign:`center`,width:`100%`},subtitle:{color:`#B8B8B8`,textAlign:`center`,lineHeight:20,width:`100%`},actions:{flexDirection:`row`,alignItems:`center`,gap:12},button:{flex:1,height:40,justifyContent:`center`,alignItems:`center`,borderRadius:8},buttonSecondary:{backgroundColor:`transparent`,borderWidth:1,borderColor:`#383838`},buttonSecondaryText:{color:`#FFFFFF`},buttonPrimary:{backgroundColor:`#C73C3E`},buttonPrimaryText:{color:`#FFFFFF`}});var IdealTimeoutModal_native_default=IdealTimeoutModal;const ShareInviteButton=()=>useConfigStore(e=>e.hideShareInviteButton)?null:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$6.shareButtonContainer,children:(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{style:styles$6.shareButton,testID:`cometchat-share-invite-button`,onPress:()=>{eventBus.publish({type:`onShareInviteButtonClicked`})},children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`share`,size:24,fill:`#FFFFFF`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Medium,styles$6.shareButtonText],children:`Share Invite`})]})}),styles$6=react_native.StyleSheet.create({shareButtonContainer:{paddingHorizontal:16,paddingVertical:12},shareButton:{flexDirection:`row`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#8C78F0`,borderRadius:8,paddingVertical:12,paddingHorizontal:16,gap:8},shareButtonText:{color:`#FFFFFF`}});var ShareInviteButton_native_default=ShareInviteButton;const QUALITY_COLOR_MAP={1:`#C73C3E`,2:`#D08D04`,3:`#0B9F5D`,4:`#0B9F5D`},ConnectionQualityIndicator=({participantId:e})=>{let k=useConferenceStore(k=>k.connectionQuality.get(e));if(k===void 0)return null;let A=QUALITY_COLOR_MAP[(k>>5)+1];return(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`signal`,size:24,fill:A})};var ConnectionQualityIndicator_native_default=ConnectionQualityIndicator;const ParticipantItem=({participant:e})=>{let{pid:k,name:A,avatar:j,type:M,ruid:N}=e,P=useTrackMuted(MEDIA_TYPE.AUDIO,e.pid),F=e.type===`screen-share`?`Presentation`:``,I=P?`mic-off`:`mic`,L=P?`#858585`:`#6852D6`,R=useRaisedHandTimestamp(k,M);return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantItem,children:[(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:A,imageUrl:j,fontSize:18,size:48,containerStyle:styles$5.avatar,textStyle:commonStyles.heading3Bold}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantText,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$5.participantName],numberOfLines:1,ellipsizeMode:`tail`,children:A}),F&&(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption1Regular,styles$5.participantDescription],numberOfLines:1,ellipsizeMode:`tail`,children:F})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantIcons,children:[R?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`raise-hand-fill`,size:20,fill:`#fff`}):(0,react_jsx_runtime.jsx)(ConnectionQualityIndicator_native_default,{participantId:k}),(0,react_jsx_runtime.jsx)(Icon_native_default,{name:I,size:24,fill:L}),(0,react_jsx_runtime.jsx)(MoreOptionButton_default,{ruid:N})]})]})};var ParticipantItem_native_default=ParticipantItem;const ListEmptyComponent=()=>(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading3Bold,styles$4.noResults],children:`No participants found.`}),ParticipantList=()=>{let[e,k]=(0,react.useState)(``),A=useOrderedParticipants().filter(k=>k.name.toLowerCase().includes(e.toLowerCase()));return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.participantListContainer,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.participantListHeader,children:[(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.heading2Bold,styles$4.headerTitle],children:[`Participants (`,A.length,`)`]}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{onPress:toggleParticipantListVisible,accessibilityLabel:`Close participants list`,testID:`cometchat-participant-list-close-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`close`,size:24,fill:`#FFFFFF`})})]}),(0,react_jsx_runtime.jsx)(ShareInviteButton_native_default,{}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$4.searchContainer,children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.searchInputWrapper,children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`search`,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.TextInput,{placeholder:`Search Participant`,style:styles$4.searchInput,value:e,onChangeText:k,placeholderTextColor:`#858585`,testID:`cometchat-participant-search-input`})]})}),(0,react_jsx_runtime.jsx)(react_native.FlatList,{data:A,renderItem:({item:e})=>(0,react_jsx_runtime.jsx)(ParticipantItem_native_default,{participant:e}),keyExtractor:e=>e.ruid,ListEmptyComponent})]})},styles$4=react_native.StyleSheet.create({participantListContainer:{flex:1,backgroundColor:`#1A1A1A`},participantListHeader:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,padding:16,gap:12,borderBottomWidth:1,borderBottomColor:`#383838`},headerTitle:{color:`#ffffff`},searchContainer:{flexDirection:`row`,alignItems:`flex-start`,paddingVertical:12,paddingHorizontal:16},searchInputWrapper:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:12,gap:8,height:40,backgroundColor:`#272727`,borderWidth:1,borderColor:`#272727`,borderRadius:1e3,flex:1},searchInput:{...commonStyles.heading4Regular,flex:1,color:`#ffffff`},noResults:{padding:20,textAlign:`center`,width:`100%`,color:colors.text.primary}});var ParticipantList_native_default=ParticipantList;function PiPTile(){let e=useMainParticipant();return(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e})}var PiPTile_default=PiPTile;const styles$3=react_native.StyleSheet.create({containerTop:{position:`absolute`,top:spacing[4],left:spacing[4],right:spacing[4],zIndex:9999,alignItems:`center`,gap:spacing[2]},containerBottom:{position:`absolute`,bottom:spacing[4],left:spacing[4],right:spacing[4],zIndex:9999,alignItems:`center`,gap:spacing[2]},toast:{width:`100%`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingVertical:padding[3],paddingHorizontal:padding[4],borderRadius:borderRadius[2],borderWidth:1,shadowColor:`#000`,shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:6},toastInfo:{backgroundColor:colors.background[3],borderColor:colors.border.default},toastSuccess:{backgroundColor:`#0d2818`,borderColor:colors.alert.success},toastWarning:{backgroundColor:`#2b2000`,borderColor:colors.alert.warning},toastError:{backgroundColor:`#2b0f0f`,borderColor:colors.alert.error},message:{...commonStyles.bodyRegular,color:colors.text.primary,flex:1},actionButton:{marginLeft:spacing[3],paddingVertical:padding[1],paddingHorizontal:padding[3],borderRadius:borderRadius[1],backgroundColor:`transparent`},actionText:{...commonStyles.buttonMedium,color:colors.primary}}),SLIDE_IN_DURATION=300,SLIDE_OUT_DURATION=200,typeStyleMap={info:styles$3.toastInfo,success:styles$3.toastSuccess,warning:styles$3.toastWarning,error:styles$3.toastError};function ToastItemView({toast:e,onDismiss:k}){let A=(0,react.useRef)(new react_native.Animated.Value(0)).current,j=(0,react.useRef)(new react_native.Animated.Value(e.position===`top`?-20:20)).current,M=(0,react.useRef)(null),N=(0,react.useCallback)(()=>{react_native.Animated.parallel([react_native.Animated.timing(A,{toValue:0,duration:200,useNativeDriver:!0}),react_native.Animated.timing(j,{toValue:e.position===`top`?-20:20,duration:200,useNativeDriver:!0})]).start(()=>{k(e.id)})},[k,A,e.id,e.position,j]);return(0,react.useEffect)(()=>(react_native.Animated.parallel([react_native.Animated.timing(A,{toValue:1,duration:300,useNativeDriver:!0}),react_native.Animated.timing(j,{toValue:0,duration:300,useNativeDriver:!0})]).start(),e.duration>0&&Number.isFinite(e.duration)&&(M.current=setTimeout(N,e.duration)),()=>{M.current&&clearTimeout(M.current)}),[N,A,e.duration,j]),(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{style:[styles$3.toast,typeStyleMap[e.type],{opacity:A,transform:[{translateY:j}]}],children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$3.message,children:e.message}),e.action&&(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$3.actionButton,onPress:()=>{e.action?.onPress(),N()},testID:`cometchat-toast-action-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$3.actionText,children:e.action.label})})]})}function Toast(){let e=useToastStore(e=>e.toasts),k=useToastStore(e=>e.removeToast);(0,react.useEffect)(()=>eventBus.subscribe(INTERNAL_EVENTS.notification,e=>{useToastStore.getState().addToast({message:e.message,type:e.type,duration:e.duration??3e3,position:e.position??`bottom`,action:e.action})}),[]);let A=e.filter(e=>e.position===`top`),j=e.filter(e=>e.position===`bottom`);return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[A.length>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$3.containerTop,pointerEvents:`box-none`,children:A.map(e=>(0,react_jsx_runtime.jsx)(ToastItemView,{toast:e,onDismiss:k},e.id))}),j.length>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$3.containerBottom,pointerEvents:`box-none`,children:j.map(e=>(0,react_jsx_runtime.jsx)(ToastItemView,{toast:e,onDismiss:k},e.id))})]})}const IS_IOS=react_native.Platform.OS===`ios`,FALLBACK_HEIGHT=240,DEFAULT_PREFERRED_SIZE={width:720,height:1280},SystemPiPView=()=>{let e=useMainParticipant(),k=getParticipantMediaType(e),A=useTrackByParticipantId(e?.pid??``,k),j=useTrackMuted(k,e?.pid),M=e?.isLocal&&!(isMultitaskingCameraAccessSupported&&k===MEDIA_TYPE.VIDEO),N=j||M?void 0:A?.originalTrack,P=(0,react.useMemo)(()=>N?.getOriginalStream().toURL(),[N]),[F,I]=(0,react.useState)(DEFAULT_PREFERRED_SIZE),L=(0,react.useMemo)(()=>({width:240*F.width/F.height,height:240}),[F]);if(!e)return null;let R=(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$2.fallback,L],collapsable:!1,children:(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:e.name,imageUrl:e.avatar,size:60,fontSize:30})});return(0,react_jsx_runtime.jsx)(react_native_webrtc.RTCPIPView,{testID:`cometchat-ios-system-pip`,pointerEvents:`none`,streamURL:P,objectFit:`contain`,iosPIP:{enabled:!0,startAutomatically:!0,stopAutomatically:!0,preferredSize:F,fallbackView:R},onDimensionsChange:e=>{let{width:k,height:A}=e.nativeEvent;k>0&&A>0&&I(e=>e.width===k&&e.height===A?e:{width:k,height:A})},style:styles$2.anchor})},IOSSystemPiP=()=>{let e=useConfigStore(e=>e.enableIOSPictureInPicture);return IS_IOS&&e?(0,react_jsx_runtime.jsx)(SystemPiPView,{}):null},styles$2=react_native.StyleSheet.create({anchor:{...react_native.StyleSheet.absoluteFillObject,opacity:0},fallback:{alignItems:`center`,justifyContent:`center`,backgroundColor:`#272727`}});var IOSSystemPiP_native_default=IOSSystemPiP;function CallUI(e){let k=useBaseStore(e=>e.moreMenuVisible),A=useBaseStore(e=>e.participantListVisible),j=useBaseStore(e=>e.isPIPLayoutEnabled),M=useBaseStore(e=>e.audioModeMenuVisible),N=useConfigStore(e=>e.sessionType),P=useIsConferenceJoined(),F=useConfigStore(e=>e.unstable_headlessMode),I=e.sessionSettings.unstable_headlessMode??F,L=e.sessionSettings.sessionType??N,R=I&&L===SESSION_TYPE.VOICE;return(0,react.useEffect)(()=>{I&&SESSION_TYPE.VOICE},[I,L]),(0,react.useLayoutEffect)(()=>(eventBus.publish({type:INTERNAL_EVENTS.lifecycle.componentDidMount}),updateConfig(e.sessionSettings),()=>{eventBus.publish({type:INTERNAL_EVENTS.lifecycle.componentWillUnmount},!0)}),[e.sessionSettings]),(0,react.useEffect)(()=>{e.sessionSettings.sdkPlatform?useBaseStore.setState({sdkPlatform:e.sessionSettings.sdkPlatform}):useBaseStore.setState({sdkPlatform:react_native.Platform.OS===`ios`?`react-native-ios`:`react-native-android`}),useBaseStore.setState({platformVersion:react_native.Platform.Version}),startSession()},[e.sessionSettings.sdkPlatform]),(0,react.useEffect)(()=>{let e=AudioModeEventEmitter.addListener(AudioModeModule_default.DEVICE_CHANGE_EVENT,e=>{setAudioModes(e),useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO&&Array.isArray(e)&&e.some(e=>e.type===`EARPIECE`&&e.selected)&&requestAudioModeChange(`SPEAKER`).catch(e=>void 0)});return()=>{e.remove()}},[]),(0,react.useEffect)(()=>{let k=(e.sessionSettings.sessionType??N)===SESSION_TYPE.VOICE?AudioModeModule_default.AUDIO_CALL:AudioModeModule_default.VIDEO_CALL;AudioModeModule_default.setMode(k).catch(e=>void 0),react_native.Platform.OS===`android`&&e.sessionSettings.audioMode&&AudioModeModule_default.setAudioDevice(e.sessionSettings.audioMode)},[e.sessionSettings.audioMode,e.sessionSettings.sessionType,N]),(0,react.useEffect)(()=>()=>{AudioModeModule_default.setMode(AudioModeModule_default.DEFAULT).catch(e=>void 0)},[]),R?(0,react_jsx_runtime.jsx)(react_jsx_runtime.Fragment,{}):j?(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(IOSSystemPiP_native_default,{}),(0,react_jsx_runtime.jsx)(PiPTile_default,{})]}):(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(IOSSystemPiP_native_default,{}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$1.container,onLayout:e=>{useBaseStore.setState({callContainerDimension:{width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}})},children:[(0,react_jsx_runtime.jsx)(Header_native_default,{}),(0,react_jsx_runtime.jsx)(CallStage_native_default,{}),(0,react_jsx_runtime.jsx)(ControlPane_native_default,{}),(0,react_jsx_runtime.jsx)(FullScreenDialog_native_default,{visible:A,children:(0,react_jsx_runtime.jsx)(ParticipantList_native_default,{})}),(0,react_jsx_runtime.jsx)(MoreMenu_native_default,{isVisible:k,onClose:toggleMoreMenuVisible}),(0,react_jsx_runtime.jsx)(AudioModesMenu_native_default,{isVisible:M,onClose:toggleAudioModeMenuVisible}),(0,react_jsx_runtime.jsx)(IdealTimeoutModal_native_default,{}),(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`Connecting...`,visible:!P}),(0,react_jsx_runtime.jsx)(ConfirmationDialog,{}),(0,react_jsx_runtime.jsx)(Toast,{})]})]})}const styles$1=react_native.StyleSheet.create({container:{flex:1,backgroundColor:`#1A1A1A`}});var index_native_default=CallUI;const InfoView=({text:e})=>(0,react_jsx_runtime.jsx)(react_native.View,{style:styles.container,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles.message],children:e})}),styles=react_native.StyleSheet.create({container:{flex:1,width:`100%`,justifyContent:`center`,alignItems:`center`,backgroundColor:`#272727`,padding:20},message:{color:`#FFF`}});var InfoView_native_default=InfoView;const convertLegacyCallSettingsToV5Props=e=>{let k={},A=e;return typeof A.defaultLayout==`boolean`&&(k.hideControlPanel=!A.defaultLayout),typeof A.isAudioOnly==`boolean`&&(k.sessionType=A.isAudioOnly?`VOICE`:`VIDEO`),typeof A.ShowEndCallButton==`boolean`&&(k.hideLeaveSessionButton=!A.ShowEndCallButton),typeof A.ShowSwitchCameraButton==`boolean`&&(k.hideSwitchCameraButton=!A.ShowSwitchCameraButton),typeof A.ShowMuteAudioButton==`boolean`&&(k.hideToggleAudioButton=!A.ShowMuteAudioButton),typeof A.ShowPauseVideoButton==`boolean`&&(k.hideToggleVideoButton=!A.ShowPauseVideoButton),typeof A.ShowAudioModeButton==`boolean`&&(k.hideAudioModeButton=!A.ShowAudioModeButton),typeof A.StartAudioMuted==`boolean`&&(k.startAudioMuted=A.StartAudioMuted),typeof A.StartVideoMuted==`boolean`&&(k.startVideoPaused=A.StartVideoMuted),typeof A.ShowRecordingButton==`boolean`&&(k.hideRecordingButton=!A.ShowRecordingButton),typeof A.StartRecordingOnCallStart==`boolean`&&(k.autoStartRecording=A.StartRecordingOnCallStart),typeof A.enableDraggableVideoTile==`boolean`&&(k.enableSpotlightDrag=A.enableDraggableVideoTile),typeof A.EnableVideoTileClick==`boolean`&&(k.enableSpotlightSwap=A.EnableVideoTileClick),(A.defaultAudioMode===`BLUETOOTH`||A.defaultAudioMode===`EARPIECE`||A.defaultAudioMode===`HEADPHONES`||A.defaultAudioMode===`SPEAKER`)&&(k.audioMode=A.defaultAudioMode),typeof A.layout==`string`?k.layout=A.layout:(A.mode===`SPOTLIGHT`||A.mode===`SIDEBAR`)&&(k.layout=A.mode),A.idleTimeoutPeriod&&(k.idleTimeoutPeriodAfterPrompt=6e4,k.idleTimeoutPeriodBeforePrompt=Math.max((A.idleTimeoutPeriod-60)*1e3,6e4)),k},CometChatAPIErrorSchema=valibot.object({message:valibot.string(),devMessage:valibot.string(),source:valibot.string(),code:valibot.string()}),HTTPRequestConfigSchema=valibot.object({baseURL:valibot.string(),method:valibot.optional(valibot.union([valibot.literal(`GET`),valibot.literal(`POST`),valibot.literal(`PUT`),valibot.literal(`DELETE`)]),`GET`),endpoint:valibot.string(),headers:valibot.record(valibot.string(),valibot.string()),body:valibot.optional(valibot.unknown())});async function dispatchRequest({baseURL:e,method:k=`GET`,endpoint:A,headers:j,body:M}){let N=valibot.safeParse(HTTPRequestConfigSchema,{baseURL:e,method:k,endpoint:A,headers:j,body:M});if(!N.success)return{responseJson:null,error:{name:`VALIDATION_ERROR`,message:`Invalid request parameters: `+N.issues.map(e=>e.message).join(`, `),timestamp:Date.now()}};let P=`${e}/${A}`,F={method:k,headers:j};M&&k!==`GET`&&(F.body=typeof M==`string`?M:JSON.stringify(M));let{data:L,error:R}=await tryCatch(fetch(P,F));if(R)return{responseJson:null,error:{name:`NETWORK_ERROR`,message:`Network request failed: ${R.message}`,details:R,timestamp:Date.now()}};let{data:z,error:B}=await tryCatch(L.json());if(B)return{responseJson:null,error:{name:`UNKNOWN_ERROR`,message:`Failed to parse response JSON: ${B.message}`,timestamp:Date.now()}};if(z.error){let e=valibot.safeParse(CometChatAPIErrorSchema,z.error);return e.success?{responseJson:null,error:{name:`COMET_CHAT_API_ERROR`,message:e.output.message,details:e.output,timestamp:Date.now()}}:{responseJson:null,error:{name:`UNKNOWN_ERROR`,message:`Unknown API error format received from server`,timestamp:Date.now()}}}return{responseJson:z,error:null}}async function executeHTTPRequest(e){let{responseJson:k,error:A}=await dispatchRequest(e);return A?{data:null,error:A}:{data:k.data,error:null}}async function executeHTTPRequestWithMeta(e){let{responseJson:k,error:A}=await dispatchRequest(e);return A?{data:null,meta:null,error:A}:{data:k.data,meta:k.meta,error:null}}const VerifyTokenArgsSchema=valibot.object({appId:valibot.string(),region:valibot.string(),calltoken:valibot.string(),baseURL:valibot.string()}),VerifyTokenResponseSchema=InternalSettingSchema;async function callVerifyTokenAPI({appId:e,region:k,calltoken:A,baseURL:j}){let M=valibot.safeParse(VerifyTokenArgsSchema,{appId:e,region:k,calltoken:A,baseURL:j});if(!M.success)return{data:null,error:{name:`VALIDATION_ERROR`,message:M.issues.map(e=>e.message).join(`, `)}};let N=await executeHTTPRequest({baseURL:j,method:`GET`,endpoint:`call_tokens?configVersion=1`,headers:{calltoken:A,appId:e}});if(N.error)return N;let P=valibot.safeParse(VerifyTokenResponseSchema,N.data);return P.success?{data:P.output,error:null}:{data:null,error:{name:`BAD_RESPONSE`,message:P.issues.map(e=>e.message).join(`, `)}}}function AppReactNativeSDK(e){let[k,A]=react.default.useState(null),[j,M]=react.default.useState(null),N=(0,react.useMemo)(()=>e.sessionSettings??e.callSettings??{},[e.sessionSettings,e.callSettings]);(0,react.useEffect)(()=>eventBus.subscribe(`onConnectionClosed`,()=>{setTimeout(()=>{M(`The session has ended.`)},0)}),[]),(0,react.useEffect)(()=>{let e=[],k=N??{};return k.listener?.onUserJoined&&e.push(CometChatCalls.addEventListener(`onParticipantJoined`,k.listener.onUserJoined)),k.listener?.onUserLeft&&e.push(CometChatCalls.addEventListener(`onParticipantLeft`,k.listener.onUserLeft)),k.listener?.onUserListUpdated&&e.push(CometChatCalls.addEventListener(`onParticipantListChanged`,k.listener.onUserListUpdated)),k.listener?.onRecordingStarted&&e.push(CometChatCalls.addEventListener(`onRecordingStarted`,k.listener.onRecordingStarted)),k.listener?.onRecordingStopped&&e.push(CometChatCalls.addEventListener(`onRecordingStopped`,k.listener.onRecordingStopped)),k.listener?.onUserMuted&&e.push(CometChatCalls.addEventListener(`onParticipantAudioMuted`,k.listener.onUserMuted)),k.listener?.onCallEnded&&(e.push(CometChatCalls.addEventListener(`onSessionLeft`,k.listener.onCallEnded)),e.push(CometChatCalls.addEventListener(`onParticipantListChanged`,e=>{e.length===0&&k.listener.onCallEnded()}))),k.listener?.onCallEndButtonPressed&&e.push(CometChatCalls.addEventListener(`onLeaveSessionButtonClicked`,k.listener.onCallEndButtonPressed)),k.listener?.onSessionTimeout&&e.push(CometChatCalls.addEventListener(`onSessionTimedOut`,k.listener.onSessionTimeout)),()=>{e.forEach(e=>{e()})}},[N]),(0,react.useEffect)(()=>{callVerifyTokenAPI({appId:CometChatCalls.appSettings?.appId||``,region:CometChatCalls.appSettings?.region||``,calltoken:e.callToken,baseURL:CometChatCalls.getBaseURL?.()}).then(e=>{e.data?A(JSON.stringify(e)):e.error.message?M(e.error.message):M(`Token verification failed.`)}).catch(e=>{})},[e.callToken]);let P=(0,react.useMemo)(()=>({...N,...convertLegacyCallSettingsToV5Props(N??{}),internalSettings:k??``}),[N,k]);return j?(0,react_jsx_runtime.jsx)(InfoView_native_default,{text:j}):k?(0,react_jsx_runtime.jsx)(index_native_default,{sessionSettings:P}):(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`Authenticating...`,visible:!0})}const PLATFORM=`react-native`,INTEGRATION_SOURCE_MANUAL=`manual`,INTEGRATION_SOURCE_AI_AGENT=`ai-agent`,SESSION_HASH_KEY_SUFFIX=`cc_callssdk_session_hash`,INTEGRATION_SOURCE_KEY_SUFFIX=`cc_callssdk_integration_source`,DEVICE_ID_KEY_SUFFIX=`cc_callssdk_device_id`,REQUEST_TIMEOUT_MS=2e3;function isChatSdkPresent(){try{let e=typeof global<`u`?global:typeof globalThis<`u`?globalThis:void 0;return e?!!e.CometChat:!1}catch{return!1}}function shouldSelfReport(){return!isChatSdkPresent()}function publishCallSdkInfo(e){try{let k=typeof global<`u`?global:globalThis;if(!k)return;k.CometChatCallSDK={platform:PLATFORM,version:e}}catch{}}function computeSessionHash(e,k,A,j){let M=`${e}|${k}|${A}|${j}`,N=0;for(let e=0;e<M.length;e++)N=Math.imul(31,N)+M.charCodeAt(e)|0;return`cc_${(N>>>0).toString(16)}`}function storageKey(e,k){return`${e}:${k}`}const inMemoryHashByApp=new Map,inflightByKey=new Set;async function getStoredHash(e){try{return await __react_native_async_storage_async_storage.default.getItem(storageKey(e,SESSION_HASH_KEY_SUFFIX))??inMemoryHashByApp.get(e)??null}catch{return inMemoryHashByApp.get(e)??null}}async function storeHash(e,k){try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,SESSION_HASH_KEY_SUFFIX),k)}catch{inMemoryHashByApp.set(e,k)}}const inMemorySourceByApp=new Map;async function setIntegrationSource(e,k){if(e)try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,INTEGRATION_SOURCE_KEY_SUFFIX),k)}catch{inMemorySourceByApp.set(e,k)}}async function getStoredIntegrationSource(e){try{return await __react_native_async_storage_async_storage.default.getItem(storageKey(e,INTEGRATION_SOURCE_KEY_SUFFIX))||INTEGRATION_SOURCE_MANUAL}catch{return inMemorySourceByApp.get(e)??INTEGRATION_SOURCE_MANUAL}}const inMemoryDeviceIdByApp=new Map;async function getOrCreateDeviceId(e){try{let k=await __react_native_async_storage_async_storage.default.getItem(storageKey(e,DEVICE_ID_KEY_SUFFIX));if(k)return k}catch{}let k=inMemoryDeviceIdByApp.get(e);if(k)return k;let A=`rn_`+Math.random().toString(36).slice(2,11)+Date.now().toString(36);inMemoryDeviceIdByApp.set(e,A);try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,DEVICE_ID_KEY_SUFFIX),A)}catch{}return A}function isDebug(){try{return typeof __DEV__<`u`?!!__DEV__:!1}catch{return!1}}function getTimeZone(){try{let e=-new Date().getTimezoneOffset(),k=e>=0?`+`:`-`,A=Math.abs(e);return`${k}${String(Math.floor(A/60)).padStart(2,`0`)}:${String(A%60).padStart(2,`0`)}`}catch{return``}}function buildPayload(e,k,A,j,M){let N=``;try{let{width:e,height:k}=react_native.Dimensions.get(`screen`);N=`${e} × ${k}`}catch{}let P=typeof window<`u`&&window.navigator?.userAgent?window.navigator.userAgent:``;return{sessionId:k,data:{integrationSource:M,cometchat:{callssdk:{platform:PLATFORM,version:e.callsSdkVersion}},app:{debug:j},device:{id:A,platform:PLATFORM,language:getLocale(),resolution:N,userAgent:P,timezone:getTimeZone(),os:{name:react_native.Platform.OS,version:`${react_native.Platform.Version}`}}},generatedAt:Math.ceil(Date.now()/1e3)}}function getLocale(){try{let e=require(`react-native`).NativeModules;return react_native.Platform.OS===`ios`?e?.SettingsManager?.settings?.AppleLocale||e?.SettingsManager?.settings?.AppleLanguages?.[0]||``:e?.I18nManager?.localeIdentifier||``}catch{return``}}async function maybeSendIdentification(e){try{if(e.disableSdkIdentification||!shouldSelfReport()||!e.authToken||!e.appId)return;let k=getAppVersion(),A=isDebug(),j=computeSessionHash(e.appId,k,e.callsSdkVersion,A);if(await getStoredHash(e.appId)===j)return;let M=`${e.appId}:${j}`;if(inflightByKey.has(M))return;inflightByKey.add(M);try{let k=buildPayload(e,j,await getOrCreateDeviceId(e.appId),A,await getStoredIntegrationSource(e.appId)),{error:M}=await withTimeout(executeHTTPRequest({baseURL:e.apiclientBaseURL,method:`POST`,endpoint:`user_sessions`,headers:{"Content-Type":`application/json`,authToken:e.authToken,appId:e.appId},body:k}),2e3);M||await storeHash(e.appId,j)}finally{inflightByKey.delete(M)}}catch{}}function getAppVersion(){try{return(typeof global<`u`?global:globalThis)?.__CC_APP_VERSION__??``}catch{return``}}async function withTimeout(e,k){let A;try{return await Promise.race([e.then(e=>({error:e.error})),new Promise(e=>{A=setTimeout(()=>e({error:Error(`timeout`)}),k)})])}finally{A&&clearTimeout(A)}}const apiEndpoints={CALL_TOKENS:`call_tokens`,CALL_LIST:`calls`},APP_ID_SPACE=`__APP_ID__`,REGION_SPACE=`__REGION__`,BASE_URL=`https://${APP_ID_SPACE}.call-${REGION_SPACE}.cometchat.io/v3.0/`,postAPI=e=>new Promise(k=>{let A=new Headers;if(A.append(`content-Type`,`application/json`),A.append(`Accept`,`application/json`),typeof e.headers==`object`)for(let k in e.headers)A.append(k,e.headers[k]);let j={method:`POST`,headers:A,body:JSON.stringify(e.data)};fetch(e.url,j).then(e=>e.json()).then(e=>{k({error:null,data:e})}).catch(e=>{k({error:e,data:null})})}),getAPI=e=>new Promise(k=>{let A=new Headers;if(A.append(`Accept`,`application/json`),typeof e.headers==`object`)for(let k in e.headers)A.append(k,e.headers[k]);let j={method:`GET`,headers:A};fetch(e.url,j).then(e=>e.json()).then(e=>{k({error:null,data:e})}).catch(e=>{k({error:e,data:null})})});function encodeQueryData(e){let k=[];for(let A in e)k.push(encodeURIComponent(A)+`=`+encodeURIComponent(e[A]));return k.join(`&`)}var APIHandler=class{static appSettings;static setAppSettings(e){this.appSettings=e}static async generateToken(e,k,A){let j=BASE_URL.replace(APP_ID_SPACE,A.getAppId()).replace(REGION_SPACE,A.getRegion());return A.getHost()&&(j=A.getHost()),postAPI({url:`${j}${apiEndpoints.CALL_TOKENS}`,headers:{authToken:e},data:{sessionId:k}})}static async verifyToken(e,k){let A=BASE_URL.replace(APP_ID_SPACE,k.getAppId()).replace(REGION_SPACE,k.getRegion());return k.getHost()&&(A=k.getHost()),getAPI({url:`${A}${apiEndpoints.CALL_TOKENS}`,headers:{callToken:e}})}static async getCallLogList(e,k){let A=BASE_URL.replace(APP_ID_SPACE,this.appSettings.getAppId()).replace(REGION_SPACE,this.appSettings.getRegion());this.appSettings.getHost()&&(A=this.appSettings.getHost());let j=encodeQueryData(e.toMap());return getAPI({url:`${A}${apiEndpoints.CALL_LIST}?${j}`,headers:{authToken:k}})}static async getCallDetails(e,k){let A=BASE_URL.replace(APP_ID_SPACE,this.appSettings.getAppId()).replace(REGION_SPACE,this.appSettings.getRegion());return this.appSettings.getHost()&&(A=this.appSettings.getHost()),getAPI({url:`${A}${apiEndpoints.CALL_LIST}/${e}`,headers:{authToken:k}})}};const constants={DEFAULT_STORE:`cometchat`,MSG_VER_PRE:`store-ver-pre`,MSG_VER_POST:`store-ver-post`},ERROR_CODES={API_ERROR:{code:`API_ERROR`}},REGION={us:`us`,eu:`eu`,in:`in`,US:`us`,EU:`eu`,IN:`in`},DEFAULT_VALUES={ZERO:0,MSGS_LIMIT:30,MSGS_MAX_LIMIT:100,USERS_LIMIT:30,USERS_MAX_LIMIT:100,GROUPS_LIMIT:30,GROUPS_MAX_LIMIT:100,CONVERSATION_MAX_LIMIT:50,CALL_TIMEOUT:45,DEFAULT_MSG_ID:0,DEFAULT_MAX_TYPING_INDICATOR_LIMIT:5,REGION_DEFAULT:`eu`,REGION_DEFAULT_EU:`eu`,REGION_DEFAULT_US:`us`,REGION_DEFAULT_IN:`in`,REGION_DEFAULT_PRIVATE:`private`};let GroupType=function(e){return e.Public=`public`,e.Private=`private`,e.Protected=`protected`,e.Password=`password`,e}({});const GROUP_TYPE={PUBLIC:`public`,PRIVATE:`private`,PROTECTED:`password`,PASSWORD:`password`};let GroupMemberScope=function(e){return e.Admin=`admin`,e.Moderator=`moderator`,e.Member=`member`,e}({});const GROUP_MEMBER_SCOPE={ADMIN:`admin`,MODERATOR:`moderator`,PARTICIPANT:`participant`},APPINFO={platform:`REACT_NATIVE`,sdkVersion:`v3.0.11`,apiVersion:`v3.0`,sdkVersionWithUnderScore:`3_0_11`,userAgent:`cc_react_native_sdk`},SDKHeader={platform:`react-native`,sdkVersion:`3.0.11`,sdk:`%s@%s`},WS={CONVERSATION:{TYPE:{CHAT:`chat`,GROUP_CHAT:`groupchat`}}},ANALYTICS={analyticsHost:`metrics-%s.cometchat.io`,analyticsVersion:`v1`},LOCAL_STORE={COMMON_STORE:`common_store`,MESSAGE_LISTENERS_LIST:`message_listeners_list`,USERS_STORE:`users_store`,MESSAGES_STORE:`messages_store`,KEYS_STORE:`keys_store`,STORE_STRING:`%s:%s`,KEY_STRING:`%s/%s`,KEY_USER:`user`,KEY_APP_SETTINGS:`app_settings`,KEY_APP_ID:`appId`,KEY_DEVICE_ID:`deviceId`,KEY_MESSAGE_LISTENER_LIST:`all`},ResponseConstants={RESPONSE_KEYS:{KEY_DATA:`data`,KEY_META:`meta`,KEY_CURSOR:`cursor`,KEY_ACTION:`action`,KEY_MESSAGE:`message`,KEY_ERROR:`error`,KEY_ERROR_DETAILS:`details`,KEY_ERROR_CODE:`code`,KEY_ERROR_MESSAGE:`message`,KEY_AUTH_TOKEN:`authToken`,KEY_WS_CHANNEL:`wsChannel`,KEY_IDENTITY:`identity`,KEY_SERVICE:`identity`,KEY_ENTITIES:`entities`,KEY_ENTITITY:`entity`,KEY_ENTITYTYPE:`entityType`,KEY_ATTACHMENTS:`attachments`,CODE_REQUEST_OK:200,CODE_BAD_REQUEST:401,UNREAD_UNDELIVERED_KEYS:{ENTITY:`entity`,ENTITY_TYPE:`entityType`,ENTITY_Id:`entityId`,COUNT:`count`},GROUP_MEMBERS_RESPONSE:{SUCCESS:`success`,ERROR:`error`,MESSAGE:`message`},KEY_ENTITY_TYPE:{USER:`user`,GROUP:`group`}}},DELIVERY_RECEIPTS={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`type`,RECIPIENT:`recipient`,MESSAGE_ID:`messageId`,RECEIVED:`delivered`,DELIVERED_AT:`deliveredAt`,ID:`id`,TIME:`time`,DELIVERED_TO_ME_AT:`deliveredToMeAt`},READ_RECEIPTS={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`type`,RECIPIENT:`recipient`,MESSAGE_ID:`messageId`,READ:`read`,READ_AT:`readAt`,ID:`id`,TIME:`time`,READ_BY_ME_AT:`readByMeAt`},MessageConstatnts={TYPE:{TEXT:`text`,MEDIA:`media`,IMAGE:`image`,VIDEO:`video`,AUDIO:`audio`,FILE:`file`,CUSTOM:`custom`},CATEGORY:{MESSAGE:`message`,ACTION:`action`,CALL:`call`,CUSTOM:`custom`},RECEIVER_TYPE:{USER:`user`,GROUP:`group`},KEYS:{ATTATCHMENT:`attatchment`,ATTATCHMENTS:`attachments`,ACTION:`action`,TYPE:`type`,DATA:`data`,ID:`id`,MUID:`muid`,SENDER:`sender`,RECEIVER:`receiver`,RECEIVER_ID:`receiverId`,CATEGORY:`category`,RECEIVER_TYPE:`receiverType`,SENT_AT:`sentAt`,STATUS:`status`,TEXT:`text`,URL:`url`,METADATA:`metadata`,RECEIPTS:`receipts`,MY_RECEIPTS:`myReceipt`,CUSTOM_DATA:`customData`,CUSTOM_SUB_TYPE:`subType`,RESOURCE:`resource`},KNOWN_MEDIA_TYPE:{IMAGE:[],VIDEO:[],AUDIO:[],FILE:[]},PAGINATION:{AFFIX:{APPEND:`append`,PREPEND:`prepend`},CURSOR_FILEDS:{ID:`id`,SENT_AT:`sentAt`},CURSOR_AFFIX_DEFAULT:`prepend`,CURSOR_FIELD_DEFAULT:`sentAt`,KEYS:{PER_PAGE:`per_page`,CURSOR_AFFIX:`cursorAffix`,AFFIX:`affix`,CURSOR_FIELD:`cursorField`,CURSOR_VALUE:`cursorValue`,UID:`uid`,SENT_AT:`sentAt`,ID:`id`,CURRENT_PAGE:`page`,UNREAD:`unread`,HIDE_MESSAGES_FROM_BLOCKED_USER:`hideMessagesFromBlockedUsers`,SEARCH_KEY:`searchKey`,ONLY_UPDATES:`onlyUpdates`,UPDATED_AT:`updatedAt`,CATEGORY:`category`,CATEGORIES:`categories`,TYPE:`type`,TYPES:`types`,HIDE_REPLIES:`hideReplies`,HIDE_DELETED_MESSAGES:`hideDeleted`,WITH_TAGS:`withTags`,TAGS:`tags`}}},ATTACHMENTS_CONSTANTS={KEYS:{EXTENSION:`extension`,MIME_TYPE:`mimeType`,NAME:`name`,SIZE:`size`,URL:`url`}};let MessageCategory=function(e){return e.ACTION=`action`,e.MESSAGE=`message`,e.CALL=`call`,e.CUSTOM=`custom`,e}({});const TYPING_NOTIFICATION={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`receiverType`,META:`metadata`,KEYS:{TYPING_NOTIFICATION:`typingNotification`,TIMESTAMP:`timestamp`},ACTIONS:{STARTED:`started`,ENDED:`ended`}},ActionConstatnts={ACTION_SUBJECTS:{ACTION_ON:`on`,ACTION_BY:`by`,ACTION_FOR:`for`},ACTION_ENTITY_TYPE:{GROUP_USER:`groupuser`,USER:`user`,GROUP:`group`,MESSAGE:`message`},ACTION_KEYS:{ACTION_CREATED:`created`,ACTION_UPDATED:`updated`,ACTION_DELETED:`deleted`,ENTITIES:`entities`,ENTITY:`entity`,ENTITY_TYPE:`entityType`,TYPE_MEMBER_JOINED:`joined`,TYPE_MEMBER_LEFT:`left`,TYPE_MEMBER_KICKED:`kicked`,TYPE_MEMBER_BANNED:`banned`,TYPE_MEMBER_UNBANNED:`unbanned`,TYPE_MEMBER_INVITED:`invited`,TYPE_MEMBER_ADDED:`added`,ACTION_SCOPE_CHANGED:`scopeChanged`,ACTION_TYPE_USER:`user`,ACTION_TYPE_GROUP:`group`,ACTION_TYPE_GROUP_MEMBER:`groupMember`,TYPE_MESSAGE_EDITED:`edited`,TYPE_MESSAGE_DELETED:`deleted`,ACTION_TYPE_CALL:`call`,EXTRAS:`extras`,SCOPE:`scope`,NEW:`new`,OLD:`old`},ActionMessages:{ACTION_GROUP_JOINED_MESSAGE:`%s joined`,ACTION_GROUP_LEFT_MESSAGE:`%s left`,ACTION_MEMBER_KICKED_MESSAGE:`%s kicked %s`,ACTION_MEMBER_BANNED_MESSAGE:`%s banned %s`,ACTION_MEMBER_UNBANNED_MESSAGE:`%s unbanned %s`,ACTION_MEMBER_INVITED_MESSAGE:`%s banned %s`,ACTION_MESSAGE_EDITED_MESSAGE:` Message Edited`,ACTION_MESSAGE_DELETED_MESSAGE:`Message Deleted`,ACTION_MEMBER_SCOPE_CHANGED:`%s made %s %s`,ACTION_MEMBER_ADDED_TO_GROUP:`%s added %s`},ACTION_TYPE:{TYPE_MEMBER_JOINED:`joined`,TYPE_MEMBER_LEFT:`left`,TYPE_MEMBER_KICKED:`kicked`,TYPE_MEMBER_BANNED:`banned`,TYPE_MEMBER_UNBANNED:`unbanned`,TYPE_MEMBER_INVITED:`invited`,TYPE_MEMBER_SCOPE_CHANGED:`scopeChanged`,TYPE_MESSAGE:`message`,TYPE_MESSAGE_EDITED:`edited`,TYPE_MESSAGE_DELETED:`deleted`,TYPE_MEMBER_ADDED:`added`},ACTIONS:{MEMBER_ADDED:`added`,MEMBER_JOINED:`joined`,MEMBER_LEFT:`left`,MEMBER_KICKED:`kicked`,MEMBER_BANNED:`banned`,MEMBER_UNBANNED:`unbanned`,MEMBER_INVITED:`invited`,MEMBER_SCOPE_CHANGED:`scopeChanged`,MESSAGE_EDITED:`edited`,MESSSAGE_DELETED:`deleted`,TYPE_USER:`user`,TYPE_GROUP:`group`,TYPE_GROUP_MEMBER:`groupMember`}},BlockedUsersConstants={REQUEST_KEYS:{DIRECTIONS:{BOTH:`both`,HAS_BLOCKED_ME:`hasBlockedMe`,BLOCKED_BY_ME:`blockedByMe`}}},CallConstants={CALL_MODE:{DEFAULT:`DEFAULT`,SPOTLIGHT:`SPOTLIGHT`},AUDIO_MODE:{SPEAKER:`SPEAKER`,EARPIECE:`EARPIECE`,BLUETOOTH:`BLUETOOTH`,HEADPHONES:`HEADPHONES`},CALL_TYPE:{AUDIO:`audio`,VIDEO:`video`},RECEIVER_TYPE_GROUP:`group`,RECEIVER_TYPE_USER:`user`,CALL_KEYS:{CALL_DATA:`data`,CALL_ID:`id`,CALL_SESSION_ID:`sessionid`,CALL_RECEIVER:`receiver`,CALL_SENDER:`sender`,CALL_INITIATOR:`initiator`,CALL_RECEIVER_TYPE:`receiverType`,CALL_STATUS:`status`,CALL_TYPE:`type`,CALL_INITIATED_AT:`initiatedAt`,CALL_JOINED_AT:`joinedAt`,CALL_LEFT_AT:`leftAt`,CALL_METADATA:`metadata`,CALL_ENTITIES:`entities`,CALL_ENTITY_TYPE:`entityType`,CALL_ENTITY:`entity`,CALL_ENTITY_USER:`user`,CALL_ENTITY_GROUP:`group`},CALL_STATUS:{INITIATED:`initiated`,ONGOING:`ongoing`,UNANSWERED:`unanswered`,REJECTED:`rejected`,BUSY:`busy`,CANCELLED:`cancelled`,ENDED:`ended`},ZOOM_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},FULL_SCREEN_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},USER_LIST_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},NAME_LABEL_DEFAULT_PARAMS:{position:`bottom-left`,visible:!0,color:`#333333`},MAIN_VIDEO_CONTAINER_SETTINGS:{KEYS:{POSITION:`position`,VISIBILITY:`visibility`,COLOR:`color`}}},GroupConstants={KEYS:{NAME:`name`,GUID:`guid`,TYPE:`type`,PASSWORD:`password`,ICON:`icon`,DESCRIPTION:`description`,OWNER:`owner`,METADATA:`metadata`,CREATED_AT:`createdAt`,UPDATED_AT:`updatedAt`,HAS_JOINED:`hasJoined`,WS_CHANNEL:`wsChannel`,TAGS:`tags`}},GroupMemersConstans={KEYS:{SCOPE:`scope`,UID:`uid`,GUID:`guid`,USER:`user`,NAME:`name`}},UserConstants={UID:`uid`,NAME:`name`,AUTH_TOKEN:`authToken`,AVATAR:`avatar`,LAST_ACTIVE_AT:`lastActiveAt`,LINK:`link`,META_DATA:`metadata`,ROLE:`role`,STATUS:`status`,STATUS_MESSAGE:`statusMessage`,USER_NAME:`user_name`,TAGS:`tags`,SORT_BY:{NAME:`name`,STATUS:`status`},SORT_ORDER:{ASCENDING:`asc`,DESCENDING:`desc`}},Errors={ERROR_IO_EXCEPTION:`ERROR_IO_EXCEPTION`,ERROR_JSON_EXCEPTION:`ERROR_JSON_EXCEPTION`,ERROR_PASSWORD_MISSING:`ERROR_PASSWORD_MISSING`,ERROR_LIMIT_EXCEEDED:`ERROR_LIMIT_EXCEEDED`,ERROR_USER_NOT_LOGGED_IN:`ERROR_USER_NOT_LOGGED_IN`,ERROR_INVALID_GUID:`ERROR_INVALID_GUID`,ERROR_PASSWORD_MISSING_MESSAGE:`Password is mandatory for a password group`,ERROR_LIMIT_EXCEEDED_MESSAGE:`Limit Exceeded Max limit of %s`,ERROR_USER_NOT_LOGGED_IN_MESSAGE:`Please log in to CometChat before calling this method`,ERROR_INVALID_GUID_MESSAGE:`Please provide a valid GUID`,ERROR_DEFAULT_MESSAGE:`Something went wrong`,ERR_SETTINGS_HASH_OUTDATED:`ERR_SETTINGS_HASH_OUTDATED`,ERR_NO_AUTH:`ERR_NO_AUTH`},CALL_ERROR={CALL_ALREADY_INITIATED:{code:`CALL_ALREADY_INITIATED`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},ERROR_IN_CALLING:{code:`CALL_IN_PROGRESS`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},CANNOT_ACCEPT_CALL:{code:`OTHER_CALL_ONGOING`,name:`OTHER_CALL_ONGOING`,message:`There is already a call in progress`,details:{}},NOT_INITIALIZED:{code:`NOT_INITIALIZED`,name:`NOT_INITIALIZED`,message:`Please call the CometChat.init() method before calling any other methods related to CometChat.`,details:{}},NOT_LOGGED_IN:{code:`NOT_LOGGED_IN`,name:`NOT_LOGGED_IN`,message:`Please login before starting a call.`,details:{}},SESSION_ID_REQUIRED:{code:`SESSION_ID_REQUIRED`,name:`SESSION_ID_REQUIRED`,message:`Please make sure you are passing correct session id.`,details:{}},JWT_NOT_FOUND:{code:`JWT_NOT_FOUND`,name:`JWT_NOT_FOUND`,message:`There was some issue while fetching JWT from API.`,details:{}},MODULE_NOT_INSTALLED:{code:`ERROR_CALL_MODULE_NOT_FOUND`,name:`ERROR_CALL_MODULE_NOT_FOUND`,message:`CometChat Calling module not found. Please add the CometChat Calling dependency and try again.`,details:{}}},PARAMETER_ERROR={PARAMETER_REQUIRED:{code:`%s_NOT_PROVIDED`,name:`%s_NOT_PROVIDED`,message:`please provide the %s.`,details:{}}},GENERAL_ERROR={GENERIC_EXCEPTION:{code:`GENERIC_EXCEPTION`},INVALID_ARGUMENT_EXCEPTION:{code:`INVALID_ARGUMENT_EXCEPTION`},INVALID_PROP_EXCEPTION:{code:`INVALID_PROP_EXCEPTION`},API_ERROR:{code:`API_ERROR`},ERROR_PRESENTER_MODE:{code:`ERROR_PRESENTER_MODE`,message:`Presenter mode is disabled. To use presenter mode, please enable it from the CometChat Apps Dashboard`},UNKNOWN_API_ERROR:{code:`UNKNOWN_API_ERROR`,message:`There is an unknown issue with the API request. Please check your internet connection and verify the api call.`}},ReceiptErrors={MISSING_PARAMETERS:{code:`MISSING_PARAMETERS`,name:`MISSING_PARAMETERS`,message:`Expected 4 parameters received 3`,details:{}},INVALID_PARAMETER:{code:`INVALID_%s`,name:`INVALID_%s`,message:`%s`,details:{}},NO_WEBSOCKET_CONNECTION:{code:`NO_WEBSOCKET_CONNECTION`,name:`NO_WEBSOCKET_CONNECTION`,message:`Connection to our Websockets server is broken. Please retry after some time.`,details:{}},RECEIPTS_TEMPORARILY_BLOCKED:{code:`RECEIPTS_TEMPORARILY_BLOCKED`,name:`RECEIPTS_TEMPORARILY_BLOCKED`,message:`Due to high load. Receipts have been blocked for your app.`,details:{}},UNKNOWN_ERROR_OCCURRED:{code:`UNKNOWN_ERROR_OCCURRED`,name:`UNKNOWN_ERROR_OCCURRED`,message:`Unknown error occurred while marking a message as read.`,details:{}}},APP_SETTINGS={APP_SETTINGS:`app_settings`,KEYS:{CHAT_HOST:`CHAT_HOST`,CHAT_USE_SSL:`CHAT_USE_SSL`,GROUP_SERVICE:`GROUP_SERVICE`,CALL_SERVICE:`CALL_SERVICE`,CHAT_WS_PORT:`CHAT_WS_PORT`,CHAT_WSS_PORT:`CHAT_WSS_PORT`,CHAT_HTTP_BIND_PORT:`CHAT_HTTP_BIND_PORT`,CHAT_HTTPS_BIND_PORT:`CHAT_HTTPS_BIND_PORT`,ADMIN_API_HOST:`ADMIN_API_HOST`,CLIENT_API_HOST:`CLIENT_API_HOST`,WEBRTC_HOST:`WEBRTC_HOST`,WEBRTC_USE_SSL:`WEBRTC_USE_SSL`,WEBRTC_WS_PORT:`WEBRTC_WS_PORT`,WEBRTC_WSS_PORT:`WEBRTC_WSS_PORT`,WEBRTC_HTTP_BIND_PORT:`WEBRTC_HTTP_BIND_PORT`,WEBRTC_HTTPS_BIND_PORT:`WEBRTC_HTTPS_BIND_PORT`,EXTENSION_LIST:`extensions`,EXTENSION_KEYS:{ID:`id`,NAME:`name`},JID_HOST_OVERRIDE:`JID_HOST_OVERRIDE`,CHAT_HOST_OVERRIDE:`CHAT_HOST_OVERRIDE`,CHAT_HOST_APP_SPECIFIC:`CHAT_HOST_APP_SPECIFIC`,MODE:`MODE`,CONNECTION_TYPE:`connection_type`,DEFAULT_MODE:`DEFAULT`,LIMITED_TRANSIENT:`LIMITED_TRANSIENT`,NO_TRANSIENT:`NO_TRANSIENT`,POLLING_ENABLED:`POLLING_ENABLED`,POLLING_INTERVAL:`POLLING_INTERVAL`,ANALYTICS_PING_DISABLED:`ANALYTICS_PING_DISABLED`,ANALYTICS_HOST:`ANALYTICS_HOST`,ANALYTICS_VERSION:`ANALYTICS_VERSION`,ANALYTICS_USE_SSL:`ANALYTICS_USE_SSL`,SETTINGS_HASH:`settingsHash`,SETTINGS_HASH_RECEIVED_AT:`settingsHashReceivedAt`,DENY_FALLBACK_TO_POLLING:`DENY_FALLBACK_TO_POLLING`,APP_VERSION:`APP_VERSION`,MAIN_DOMAIN:`MAIN_DOMAIN`,CHAT_API_VERSION:`CHAT_API_VERSION`,WS_API_VERSION:`WS_API_VERSION`,REGION:`REGION`,EXTENSION_DOMAIN:`EXTENSION_DOMAIN`,WEBRTC_API_SUBDOMAIN:`WEBRTC_API_SUBDOMAIN`}},COMMON_UTILITY_CONSTANTS={TYPE_CONSTANTS:{BOOLEAN:`boolean`,STRING:`string`,OBJECT:`object`,NUMBER:`number`}},CONNECTION_STATUS={CONNECTED:`connected`,CONNECTING:`connecting`,DISCONNECTED:`disconnected`,FEATURE_THROTTLED:`featureThrottled`},API_ERROR_CODES={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:`AUTH_ERR_AUTH_TOKEN_NOT_FOUND`},PROSODY_API={DOMAIN_PREFIX:`xmpp`,PATH:{ROOM:`room`,ROOM_SIZE:`room-size`,SESSIONS:`sessions`},RESPONSE:{PARTICIPANTS:`participants`},QUERY_PARAMETERS:{DOMAIN:`domain`,ROOM:`room`}},ProsodyApiErrors={INVALID_SESSIONID:{code:`ERROR_INVALID_SESSIONID`,name:`ERROR_INVALID_SESSIONID`,message:`The provided sessionId cannot be null or empty. Please provide a valid sessionId.`,details:``},INVALID_TYPE:{code:`ERROR_INVALID_TYPE`,name:`ERROR_INVALID_TYPE`,message:`The provided type cannot be null or empty. Please provide a valid type.`,details:``}},JWT_API={KEYS:{PASSTHROUGH:`passthrough`,EXPAND:`expand`}},ONLINE_MEMBER_COUNT_API={ENDPOINTS:{GET_ONLINE_MEMBER_COUNT:`api/%s/online-members`},RESPONSE:{ONLINE_USERS_COUNT:`onlineUsersCount`,GROUPS:`groups`},ERRORS:{INVALID_GROUPLIST:{code:`ERROR_INVALID_GROUPLIST`,name:`ERROR_INVALID_GROUPLIST`,message:`Grouplist cannot be null or empty.`,details:``}}};function isFalsy(e){return e!=null&&(typeof e==`string`&&(e=e.trim()),typeof e==`object`&&Object.keys(e).length===0&&(e=void 0)),[``,0,`0`,!1,null,`null`,void 0,`undefined`].includes(e)}function isJSON(e){try{return JSON.stringify(e),!0}catch{return!1}}var Logger=class{static log(e,k){}static error(e,k){}static info(e,k){}};function throwGenericException(e){typeof e?.toString==`function`||typeof e==`string`||isJSON(e)}var OngoingCallListener=class{onUserJoined;onUserLeft;onUserListUpdated;onAudioModesUpdated;onCallEnded;onSessionTimeout;onCallEndButtonPressed;onError;onRecordingStarted;onRecordingStopped;onUserMuted;onCallSwitchedToVideo;constructor(e){isFalsy(e.onUserJoined)||(this.onUserJoined=e.onUserJoined),isFalsy(e.onUserLeft)||(this.onUserLeft=e.onUserLeft),isFalsy(e.onUserListUpdated)||(this.onUserListUpdated=e.onUserListUpdated),isFalsy(e.onAudioModesUpdated)||(this.onAudioModesUpdated=e.onAudioModesUpdated),isFalsy(e.onCallEnded)||(this.onCallEnded=e.onCallEnded),isFalsy(e.onSessionTimeout)||(this.onSessionTimeout=e.onSessionTimeout),isFalsy(e.onCallEndButtonPressed)||(this.onCallEndButtonPressed=e.onCallEndButtonPressed),isFalsy(e.onError)||(this.onError=e.onError),isFalsy(e.onRecordingStarted)||(this.onRecordingStarted=e.onRecordingStarted),isFalsy(e.onRecordingStopped)||(this.onRecordingStopped=e.onRecordingStopped),isFalsy(e.onUserMuted)||(this.onUserMuted=e.onUserMuted),isFalsy(e.onCallSwitchedToVideo)||(this.onCallSwitchedToVideo=e.onCallSwitchedToVideo)}},ListenerHandlers=class e{static callHandlers=[];static addCallEventListener(k,A){try{e.callHandlers=e?.callHandlers.filter(e=>e._name!=k),e.callHandlers=[...e.callHandlers,{_name:k,...new OngoingCallListener(A)}]}catch{}}static removeCallEventListener(k){try{e.callHandlers=e?.callHandlers.filter(e=>e._name!==k)}catch{}}},CometChatCallsException=class{code;message;details;constructor(e){`code`in e&&(this.code=e.code),`message`in e&&(this.message=e.message),`details`in e&&(this.details=e.details)}},CallAppSettings=class{appId;region;host;constructor(e){this.appId=e.appId,this.region=e.region,this.host=e.host}setAppId(e){return this.appId=e,this}setRegion(e){return this.region=e,this}setHost(e){return this.host=e,this}getAppId(){return this.appId}getRegion(){return this.region}getHost(){return this.host}},CallAppSettingsBuilder=class{appId;region;host;setAppId(e){return this.appId=e,this}setRegion(e){return this.region=e,this}setHost(e){return this.host=e,this}build(){return new CallAppSettings(this)}};function validateCallAppSettings(e){return new Promise((k,A)=>{let j=new CometChatCallsException({code:`INVALID_CALL_APP_SETTINGS`});if(!(e instanceof CallAppSettings)){j.message=`appSettings must be an instance of CallAppSettings class`,A(j);return}let M=e.getAppId(),N=e.getRegion(),P=e.getHost();if(typeof M!=`string`||M.length===0){j.message=`Invalid app id, please check your appSettings`,A(j);return}if(typeof N!=`string`||!REGION[N]){j.message=`Invalid region, please check your appSettings`,A(j);return}if(P!=null&&typeof P!=`string`){j.message=`Invalid host, please check your appSettings`,A(j);return}k(!0)})}const SERVER_ERRORS={AUTH_ERR:{code:`AUTH_ERR_AUTH_TOKEN_NOT_FOUND`,message:`The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again.`}},ERRORS={PARAMETER_MISSING:{code:`MISSING_PARAMETERS`,name:`Invalid or no parameter passed to the method.`}},INIT_ERROR={NO_APP_ID:{code:ERRORS.PARAMETER_MISSING.code,name:ERRORS.PARAMETER_MISSING.name,message:`AppID cannot be empty. Please specify a valid appID.`,details:{}}},GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:`ERR_EMPTY_GROUP_PASS`,details:void 0,message:`Password is mandatory to join a group.`,name:void 0}},USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:`EMPTY_USERS_LIST`,name:`EMPTY_USERS_LIST`,message:`The users list needs to have atleast one UID.`,details:{}}},MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:`REQUEST_IN_PROGRESS`,name:`REQUEST_IN_PROGRESS`,message:`Request in progress.`,details:{}},NOT_ENOUGH_PARAMS:{code:`NOT_ENOUGH_PARAMETERS`,name:`NOT_ENOUGH_PARAMETERS`,message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:`-1`,name:`%s_CUSTOM_DATA`,message:``,details:{}}},LOGIN_ERROR={NOT_INITIALIZED:{code:`-1`,name:`COMETCHAT_INITIALIZATION_NOT_DONE`,message:`please initialize the cometchat before using login method.`,details:{}},UNAUTHORISED:{code:401,name:`USER_NOT_AUTHORISED`,message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:`WS_CONNECTION_FAIL`,message:`WS Connection failed. %s`,details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:`WS_CONNECTION_FAIL`,message:`WS Connection failed. Trying to connect with port: %s`,details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:`WS_CONNECTION_FALLBACK_FAIL`,message:`WS Connection fallback failed. Trying to connect with port: %s`,details:{}},WS_AUTH_FAIL:{code:-1,name:`WS_AUTH_FAIL`,message:`WS username/password not correct.`,details:{}},NO_INTERNET:{code:-1,name:`NO_INTERNET_CONNECTION`,message:`You do not have internet connection.`,details:{}},REQUEST_IN_PROGRESS:{code:-1,name:`LOGIN_IN_PROGRESS`,message:`Please wait until the previous login request ends.`,details:{}}},TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:`TOO_MANY_REQUEST`,name:`TOO MANY REQUEST`,message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},FETCH_ERROR={ERROR_IN_API_CALL:{code:`FAILED_TO_FETCH`,name:`FAILED_TO_FETCH`,message:`There is an unknown issue with the API request. Please check your internet connection and verify the api call.`,details:{}}};var CallGroup=class e{guid;name;icon;constructor(e){Object.assign(this,e)}getGuid(){return this.guid}setGuid(e){this.guid=e}getName(){return this.name}setName(e){this.name=e}getIcon(){return this.icon}setIcon(e){this.icon=e}toString(){return`CallGroup{ guid='${this.guid}', name='${this.name}', icon='${this.icon}' }`}static getGroupFromJson(k){return new e(k)}},CallUser=class e{uid;name;avatar;constructor(e){Object.assign(this,e)}getUid(){return this.uid}setUid(e){this.uid=e}getName(){return this.name}setName(e){this.name=e}getAvatar(){return this.avatar}setAvatar(e){this.avatar=e}toString(){return`CallUser{ uid='${this.uid}', name='${this.name}', avatar='${this.avatar}' }`}static getUserFromJson(k){return new e(k)}},Participant=class e{uid;name;avatar;totalAudioMinutes;totalVideoMinutes;totalDurationInMinutes;deviceID;hasJoined;joinedAt;leftAt;mid;state;constructor(e){Object.assign(this,e)}getUid(){return this.uid}setUid(e){this.uid=e}getName(){return this.name}setName(e){this.name=e}getAvatar(){return this.avatar}setAvatar(e){this.avatar=e}getTotalAudioMinutes(){return this.totalAudioMinutes}setTotalAudioMinutes(e){this.totalAudioMinutes=e}getTotalVideoMinutes(){return this.totalVideoMinutes}setTotalVideoMinutes(e){this.totalVideoMinutes=e}getTotalDurationInMinutes(){return this.totalDurationInMinutes}setTotalDurationInMinutes(e){this.totalDurationInMinutes=e}getDeviceID(){return this.deviceID}setDeviceID(e){this.deviceID=e}getHasJoined(){return this.hasJoined}setHasJoined(e){this.hasJoined=e}getJoinedAt(){return this.joinedAt}setJoinedAt(e){this.joinedAt=e}getLeftAt(){return this.leftAt}setLeftAt(e){this.leftAt=e}getMid(){return this.mid}setMid(e){this.mid=e}getState(){return this.state}setState(e){this.state=e}static getParticipantFromJson(k){return new e(k)}},Recording=class e{rid;recording_url;startTime;endTime;duration;constructor(e){Object.assign(this,e)}getRid(){return this.rid}setRid(e){this.rid=e}getRecordingURL(){return this.recording_url}setRecordingURL(e){this.recording_url=e}getStartTime(){return this.startTime}setStartTime(e){this.startTime=e}getEndTime(){return this.endTime}setEndTime(e){this.endTime=e}getDuration(){return this.duration}setDuration(e){this.duration=e}static getRecordingFromJson(k){return new e(k)}},CallLog=class e{sessionId;totalAudioMinutes;totalVideoMinutes;totalDuration;hasRecording;initiatedAt;startedAt;callCategory;mode;initiator;receiver;receiverType;status;totalDurationInMinutes;totalParticipants;type;mid;endedAt;participants;recordings;constructor(e){Object.assign(this,e)}getSessionID(){return this.sessionId}setSessionID(e){this.sessionId=e}getTotalAudioMinutes(){return this.totalAudioMinutes}setTotalAudioMinutes(e){this.totalAudioMinutes=e}getTotalVideoMinutes(){return this.totalVideoMinutes}setTotalVideoMinutes(e){this.totalVideoMinutes=e}getTotalDuration(){return this.totalDuration}setTotalDuration(e){this.totalDuration=e}getHasRecording(){return this.hasRecording}setHasRecording(e){this.hasRecording=e}getInitiatedAt(){return this.initiatedAt}setInitiatedAt(e){this.initiatedAt=e}getStartedAt(){return this.startedAt}setStartedAt(e){this.startedAt=e}getMode(){return this.mode}setMode(e){this.mode=e}getCallCategory(){return this.callCategory}setCallCategory(e){this.callCategory=e}getInitiator(){return this.initiator}setInitiator(e){this.initiator=e}getReceiver(){return this.receiver}setReceiver(e){this.receiver=e}getReceiverType(){return this.receiverType}setReceiverType(e){this.receiverType=e}getStatus(){return this.status}setStatus(e){this.status=e}getTotalDurationInMinutes(){return this.totalDurationInMinutes}setTotalDurationInMinutes(e){this.totalDurationInMinutes=e}getTotalParticipants(){return this.totalParticipants}setTotalParticipants(e){this.totalParticipants=e}getType(){return this.type}setType(e){this.type=e}getMid(){return this.mid}setMid(e){this.mid=e}getEndedAt(){return this.endedAt}setEndedAt(e){this.endedAt=e}getParticipants(){return this.participants}setParticipants(e){this.participants=e}getRecordings(){return this.recordings}setRecordings(e){this.recordings=e}static callLogFromJson(k){let A=new e(k);if(k.participants&&(A.participants=k.participants.map(e=>Participant.getParticipantFromJson(e))),k.recordings&&(A.recordings=k.recordings.map(e=>Recording.getRecordingFromJson(e))),k.initiator&&k[CallConstants.CALL_KEYS.CALL_DATA]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR][CallConstants.CALL_KEYS.CALL_ENTITY]){let e=k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR][CallConstants.CALL_KEYS.CALL_ENTITY];A.initiator=CallUser.getUserFromJson(e)}if(k.receiver&&k[CallConstants.CALL_KEYS.CALL_DATA]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER]&&k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER][CallConstants.CALL_KEYS.CALL_ENTITY]){let e=k[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER][CallConstants.CALL_KEYS.CALL_ENTITY];k.receiverType==CallConstants.RECEIVER_TYPE_USER?A.receiver=CallUser.getUserFromJson(e):A.receiver=CallGroup.getGroupFromJson(e)}return A}},CallSettings=class{static POSITION_TOP_LEFT=`top-left`;static POSITION_TOP_RIGHT=`top-right`;static POSITION_BOTTOM_LEFT=`bottom-left`;static POSITION_BOTTOM_RIGHT=`bottom-right`;static ASPECT_RATIO_DEFAULT=`default`;static ASPECT_RATIO_CONTAIN=`contain`;static ASPECT_RATIO_COVER=`cover`;static POSITION={TOP_LEFT:`top-left`,TOP_RIGHT:`top-right`,BOTTOM_LEFT:`bottom-left`,BOTTOM_RIGHT:`bottom-right`};static ASPECT_RATIO={DEFAULT:`default`,CONTAIN:`contain`,COVER:`cover`};defaultLayout;isAudioOnly;listener;mode;ShowEndCallButton;ShowSwitchCameraButton;ShowMuteAudioButton;ShowPauseVideoButton;ShowAudioModeButton;StartAudioMuted;StartVideoMuted;defaultAudioMode;ShowSwitchToVideoCallButton;AvatarMode;ShowRecordingButton;idleTimeoutPeriod;StartRecordingOnCallStart;MainVideoContainerSetting;EnableVideoTileClick;enableDraggableVideoTile;constructor(e){this.defaultLayout=e.defaultLayout,this.isAudioOnly=e.isAudioOnly,this.listener=e.listener,this.mode=e.mode,this.ShowEndCallButton=e.ShowEndCallButton,this.ShowSwitchCameraButton=e.ShowSwitchCameraButton,this.ShowMuteAudioButton=e.ShowMuteAudioButton,this.ShowPauseVideoButton=e.ShowPauseVideoButton,this.ShowAudioModeButton=e.ShowAudioModeButton,this.StartAudioMuted=e.StartAudioMuted,this.StartVideoMuted=e.StartVideoMuted,this.defaultAudioMode=e.defaultAudioMode,this.ShowSwitchToVideoCallButton=e.ShowSwitchToVideoCallButton,this.AvatarMode=e.AvatarMode,this.ShowRecordingButton=e.ShowRecordingButton,this.idleTimeoutPeriod=e.idleTimeoutPeriod,this.StartRecordingOnCallStart=e.StartRecordingOnCallStart,this.MainVideoContainerSetting=e.MainVideoContainerSetting,this.EnableVideoTileClick=e.EnableVideoTileClick,this.enableDraggableVideoTile=e.enableDraggableVideoTile}isAudioOnlyCall(){return this.isAudioOnly}isDefaultLayoutEnabled(){return this.defaultLayout}getCallEventListener(){return this.listener}getMode(){return this.mode}isEndCallButtonEnabled(){return this.ShowEndCallButton}isSwitchCameraButtonEnabled(){return this.ShowSwitchCameraButton}isMuteAudioButtonEnabled(){return this.ShowMuteAudioButton}isPauseVideoButtonEnabled(){return this.ShowPauseVideoButton}isAudioModeButtonEnabled(){return this.ShowAudioModeButton}getStartWithAudioMuted(){return this.StartAudioMuted}getStartWithVideoMuted(){return this.StartVideoMuted}getDefaultAudioMode(){return this.defaultAudioMode}isAudioToVideoButtonEnabled(){return this.ShowSwitchToVideoCallButton}getAvatarMode(){return this.AvatarMode}isRecordingButtonEnabled(){return this.ShowRecordingButton}getIdleTimeoutPeriod(){return this.idleTimeoutPeriod}shouldStartRecordingOnCallStart(){return this.StartRecordingOnCallStart}getMainVideoContainerSetting(){return this.MainVideoContainerSetting}isVideoTileClickEnabled(){return this.EnableVideoTileClick}isVideoTileDragEnabled(){return this.enableDraggableVideoTile}},CallSettingsBuilder=class{defaultLayout=!0;isAudioOnly=!1;listener;mode=CallConstants.CALL_MODE.DEFAULT;ShowEndCallButton=!0;ShowSwitchCameraButton=!0;ShowMuteAudioButton=!0;ShowPauseVideoButton=!0;ShowAudioModeButton=!0;StartAudioMuted=!1;StartVideoMuted=!1;defaultAudioMode;ShowSwitchToVideoCallButton=!0;AvatarMode=`circle`;ShowRecordingButton=!1;idleTimeoutPeriod=180;StartRecordingOnCallStart=!1;MainVideoContainerSetting=new MainVideoContainerSetting;EnableVideoTileClick=!0;enableDraggableVideoTile=!0;enableDefaultLayout(e){return this.defaultLayout=e,this}setIsAudioOnlyCall(e){return this.isAudioOnly=e,this}setCallEventListener(e){return this.listener=e,this}setMode(e){return this.mode=e,this}showEndCallButton(e=!0){return this.ShowEndCallButton=e,this}showSwitchCameraButton(e=!0){return this.ShowSwitchCameraButton=e,this}showMuteAudioButton(e=!0){return this.ShowMuteAudioButton=e,this}showPauseVideoButton(e=!0){return this.ShowPauseVideoButton=e,this}showAudioModeButton(e=!0){return this.ShowAudioModeButton=e,this}startWithAudioMuted(e=!1){return this.StartAudioMuted=e,this}startWithVideoMuted(e=!1){return this.StartVideoMuted=e,this}setDefaultAudioMode(e){return this.defaultAudioMode=e,this}showSwitchToVideoCallButton(e=!0){return this.ShowSwitchToVideoCallButton=e,this}setAvatarMode(e=`circle`){return this.AvatarMode=e,this}showRecordingButton(e=!1){return this.ShowRecordingButton=e,this}setIdleTimeoutPeriod(e=180){return this.idleTimeoutPeriod=e,this}startRecordingOnCallStart(e=!1){return this.StartRecordingOnCallStart=e,this}setMainVideoContainerSetting(...e){return this}enableVideoTileClick(e=!0){return this.EnableVideoTileClick=e,this}enableVideoTileDrag(e=!0){return this.enableDraggableVideoTile=e,this}build(){return new CallSettings(this)}},MainVideoContainerSetting=class{videoFit=CallSettings.ASPECT_RATIO_CONTAIN;zoomButton=CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS;fullScreenButton=CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS;userListButton=CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS;nameLabel=CallConstants.NAME_LABEL_DEFAULT_PARAMS;setMainVideoAspectRatio(e=`contain`){this.videoFit=e}setFullScreenButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,k=!0){isFalsy(e)||(this.fullScreenButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),k!=null&&k!=null&&(this.fullScreenButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=k)}setNameLabelParams(e=CallSettings.POSITION_BOTTOM_LEFT,k=!0,A=`#333333`){isFalsy(e)||(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),k!=null&&k!=null&&(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=k),isFalsy(A)||(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=A)}setZoomButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,k=!0){isFalsy(e)||(this.zoomButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),k!=null&&k!=null&&(this.zoomButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=k)}setUserListButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,k=!0){isFalsy(e)||(this.userListButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),k!=null&&k!=null&&(this.userListButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=k)}},CallLogFilterParams=class{perPage=-1;page=-1;mode;type;status;direction;hasRecording;uid;guid;setDirection(e){this.direction=e}setStatus(e){this.status=e}setType(e){this.type=e}setPerPage(e){this.perPage=e}setPage(e){this.page=e}setMode(e){this.mode=e}setHasRecordings(e){this.hasRecording=e}setUid(e){this.uid=e}setGuid(e){this.guid=e}toMap(){let e={};return this.perPage!==-1&&(e.perPage=String(this.perPage)),this.page!==-1&&(e.page=String(this.page)),this.mode&&(e.mode=this.mode),this.type&&(e.type=this.type),this.status&&(e.status=this.status),this.direction&&(e.direction=this.direction),this.uid&&(e.uid=this.uid),this.guid&&(e.guid=this.guid),this.hasRecording!==null&&this.hasRecording!==void 0&&(e.hasRecording=this.hasRecording?`true`:`false`),e}},CallLogRequest=class{limit=30;totalPages=0;currentPage=0;callType;callStatus;hasRecording;callCategory;callDirection;uid;guid;authToken;inProgress=!1;updatedAt=0;onlyUpdates=0;timestamp=0;id=DEFAULT_VALUES.DEFAULT_MSG_ID;affix;lastAffix;currentMethod;paginationMeta={};constructor(e){this.limit=e.limit,this.callType=e.callType,this.callStatus=e.callStatus,this.hasRecording=e.hasRecording,this.callCategory=e.callCategory,this.callDirection=e.callDirection,this.uid=e.uid,this.guid=e.guid,this.authToken=e.authToken}fetchNext(){return this.makeAPICall(!0)}fetchPrevious(){return this.makeAPICall()}getCurrentPage(){return this.currentPage}getTotalPages(){return this.totalPages}makeAPICall(e){return new Promise(async(k,A)=>{try{if(e?this.totalPages!=0&&this.totalPages==this.currentPage:this.currentPage==1){this.inProgress=!1,k([]);return}if(this.inProgress){this.inProgress=!1,A(new CometChatCallsException(MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR));return}if(this.inProgress=!0,!this.authToken){this.inProgress=!1,A(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Auth Token` is required to use the 'fetchNext()' method."}));return}try{let j=await APIHandler.getCallLogList(this.getParams(e),this.authToken);if(j?.data?.error){this.inProgress=!1,A(new CometChatCallsException(j.data.error));return}k(this.getCallLogList(JSON.stringify(j.data))),this.inProgress=!1}catch(e){this.inProgress=!1,A(new CometChatCallsException(e))}}catch{this.inProgress=!1,A(new CometChatCallsException({code:`UNKNOWN ERROR`,message:`Unknown error`}))}})}getParams(e){let k=new CallLogFilterParams;return e?k.setPage(this.currentPage+1):k.setPage(this.currentPage-1),k.setPerPage(this.limit),this.hasRecording&&k.setHasRecordings(this.hasRecording),this.callStatus&&k.setStatus(this.callStatus),this.callType&&k.setType(this.callType),this.callCategory&&k.setMode(this.callCategory),this.callDirection&&k.setDirection(this.callDirection),this.uid&&k.setUid(this.uid),this.guid&&k.setGuid(this.guid),k}getCallLogList(e){let k=[],A=JSON.parse(e),j=A.meta;if(j.pagination){let e=j.pagination;e.total_pages&&(this.totalPages=e.total_pages,this.currentPage=e.current_page)}let M=A.data;for(let e=0;e<M.length;e++){let A=M[e],j=CallLog.callLogFromJson(A);k.push(j)}return k}},CallLogRequestBuilder=class{limit=30;callType;callStatus;hasRecording;callCategory;callDirection;uid;guid;authToken;setLimit(e){return this.limit=e,this}setCallType(e){return this.callType=e,this}setCallStatus(e){return this.callStatus=e,this}setHasRecording(e){return this.hasRecording=e,this}setCallCategory(e){return this.callCategory=e,this}setCallDirection(e){return this.callDirection=e,this}setUid(e){return this.uid=e,this}setGuid(e){return this.guid=e,this}setAuthToken(e){return this.authToken=e,this}build(){return new CallLogRequest(this)}},MessageComponent=class extends react.default.Component{constructor(e){super(e)}render(){return(0,react_jsx_runtime.jsx)(react_native.View,{style:{flex:1,backgroundColor:`#000`,justifyContent:`center`,alignItems:`center`,padding:20},children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:{color:`#FFF`},children:this.props.message})})}},PresenterSettings=class{static POSITION_TOP_LEFT=`top-left`;static POSITION_TOP_RIGHT=`top-right`;static POSITION_BOTTOM_LEFT=`bottom-left`;static POSITION_BOTTOM_RIGHT=`bottom-right`;static ASPECT_RATIO_DEFAULT=`default`;static ASPECT_RATIO_CONTAIN=`contain`;static ASPECT_RATIO_COVER=`cover`;static POSITION={TOP_LEFT:`top-left`,TOP_RIGHT:`top-right`,BOTTOM_LEFT:`bottom-left`,BOTTOM_RIGHT:`bottom-right`};static ASPECT_RATIO={DEFAULT:`default`,CONTAIN:`contain`,COVER:`cover`};defaultLayout;isAudioOnly;isPresenter;listener;ShowEndCallButton;ShowSwitchCameraButton;ShowMuteAudioButton;ShowPauseVideoButton;ShowAudioModeButton;StartAudioMuted;StartVideoMuted;defaultAudioMode;ShowRecordingButton;idleTimeoutPeriod;constructor(e){this.defaultLayout=e.defaultLayout,this.isAudioOnly=e.isAudioOnly,this.isPresenter=e.isPresenter,this.listener=e.listener,this.ShowEndCallButton=e.ShowEndCallButton,this.ShowSwitchCameraButton=e.ShowSwitchCameraButton,this.ShowMuteAudioButton=e.ShowMuteAudioButton,this.ShowPauseVideoButton=e.ShowPauseVideoButton,this.ShowAudioModeButton=e.ShowAudioModeButton,this.StartAudioMuted=e.StartAudioMuted,this.StartVideoMuted=e.StartVideoMuted,this.defaultAudioMode=e.defaultAudioMode,this.ShowRecordingButton=e.ShowRecordingButton,this.idleTimeoutPeriod=e.idleTimeoutPeriod}isAudioOnlyCall(){return this.isAudioOnly}getIsPresenter(){return this.isPresenter}isDefaultLayoutEnabled(){return this.defaultLayout}getCallEventListener(){return this.listener}isEndCallButtonEnabled(){return this.ShowEndCallButton}isSwitchCameraButtonEnabled(){return this.ShowSwitchCameraButton}isMuteAudioButtonEnabled(){return this.ShowMuteAudioButton}isPauseVideoButtonEnabled(){return this.ShowPauseVideoButton}isAudioModeButtonEnabled(){return this.ShowAudioModeButton}getStartWithAudioMuted(){return this.StartAudioMuted}getStartWithVideoMuted(){return this.StartVideoMuted}getDefaultAudioMode(){return this.defaultAudioMode}isRecordingButtonEnabled(){return this.ShowRecordingButton}getIdleTimeoutPeriod(){return this.idleTimeoutPeriod}},PresenterSettingsBuilder=class{defaultLayout=!0;isAudioOnly=!1;isPresenter=!1;listener;ShowEndCallButton=!0;ShowSwitchCameraButton=!0;ShowMuteAudioButton=!0;ShowPauseVideoButton=!0;ShowAudioModeButton=!0;StartAudioMuted=!1;StartVideoMuted=!1;defaultAudioMode;ShowRecordingButton=!1;idleTimeoutPeriod=180;enableDefaultLayout(e){return this.defaultLayout=e,this}setIsAudioOnlyCall(e){return this.isAudioOnly=e,this}setIsPresenter(e){return this.isPresenter=e,this}setCallEventListener(e){return this.listener=e,this}showEndCallButton(e=!0){return this.ShowEndCallButton=e,this}showSwitchCameraButton(e=!0){return this.ShowSwitchCameraButton=e,this}showMuteAudioButton(e=!0){return this.ShowMuteAudioButton=e,this}showPauseVideoButton(e=!0){return this.ShowPauseVideoButton=e,this}showAudioModeButton(e=!0){return this.ShowAudioModeButton=e,this}startWithAudioMuted(e=!1){return this.StartAudioMuted=e,this}startWithVideoMuted(e=!1){return this.StartVideoMuted=e,this}setDefaultAudioMode(e){return this.defaultAudioMode=e,this}showRecordingButton(e=!1){return this.ShowRecordingButton=e,this}setIdleTimeoutPeriod(e){return this.idleTimeoutPeriod=e,this}build(){return new PresenterSettings(this)}},CometChatCallsComponentCore=class extends react.default.Component{static ref=null;callsettings;constructor(e){if(super(e),this.state={shouldLoad:!1,errored:!1},this.callsettings=e.callSettings,!this.callsettings||!(this.callsettings instanceof CallSettings||this.callsettings instanceof PresenterSettings)){this.state={...this.state,errored:!0};return}validateCallAppSettings(CometChatCalls$1.getAppSettings()).then(()=>{if(typeof e.callToken!=`string`||e.callToken===``){let e=new CometChatCallsException({code:GENERAL_ERROR.INVALID_ARGUMENT_EXCEPTION.code,message:`Invalid callToken passed, please verify.`});this.callsettings.getCallEventListener()?.onError?.(e);return}APIHandler.verifyToken(e.callToken,CometChatCalls$1.getAppSettings()).then(k=>{if(k?.data?.error?.message){this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:k?.data?.error?.message}));return}if(this.callsettings.user={...k.data.data.payload.data.user,jwt:this.props.callToken},this.callsettings.sessionID=k.data.data.payload.room,this.callsettings.appId=k.data.data.payload.data.appId,this.callsettings.domain=k.data.data.settings.WEBRTC_HOST,typeof this.callsettings.analyticsSettings!=`object`&&(this.callsettings.analyticsSettings={}),k?.data?.data?.settings?.ANALYTICS_HOST&&(this.callsettings.analyticsSettings.ANALYTICS_HOST=k.data.data.settings.ANALYTICS_HOST),k?.data?.data?.settings?.ANALYTICS_VERSION&&(this.callsettings.analyticsSettings.ANALYTICS_VERSION=k.data.data.settings.ANALYTICS_VERSION),e.presenterMode)if(k?.data?.data?.settings?.PRESENTER_MODE_ENABLED===!0)this.setState({shouldLoad:!0,errored:!1});else{let e=new CometChatCallsException({code:GENERAL_ERROR.ERROR_PRESENTER_MODE.code,message:GENERAL_ERROR.ERROR_PRESENTER_MODE.message});this.callsettings.getCallEventListener()?.onError?.(e),ListenerHandlers?.callHandlers?.map(k=>{k?.onError?.(e)}),this.setState({shouldLoad:!1,errored:!0})}else this.setState({shouldLoad:!0,errored:!1})}).catch(e=>{this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:`Unknown API error`,details:e})),this.setState({errored:!0})})}).catch(e=>{this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:`Unknown API error`,details:e})),this.setState({errored:!0})})}render(){return this.state.errored?(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Something went wrong! Please check logs for more details.`}):this.state.shouldLoad?(0,react_jsx_runtime.jsx)(react_native.View,{style:{flex:1,backgroundColor:`#000`}}):(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Initializing...`})}},CometChatPresenterComponent=class extends react.default.Component{constructor(e){super(e),this.state={errored:!1},this.props.presenterSettings.mode=`PRESENTER`,this.props.presenterSettings instanceof PresenterSettings||(this.state={...this.state,errored:!0})}render(){return this.state.errored?(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Something went wrong! Please check logs for more details.`}):(0,react_jsx_runtime.jsx)(CometChatCallsComponentCore,{callSettings:this.props.presenterSettings,callToken:this.props.callToken,presenterMode:!0})}},CometChatCalls$1=class{static appSettings;static inProgress=!1;static CALL_MODE=CallConstants.CALL_MODE;static AUDIO_MODE=CallConstants.AUDIO_MODE;static addCallEventListener=ListenerHandlers.addCallEventListener;static removeCallEventListener=ListenerHandlers.removeCallEventListener;static OngoingCallListener=OngoingCallListener;static CallSettingsBuilder=CallSettingsBuilder;static CallSettings=CallSettings;static PresenterSettingsBuilder=PresenterSettingsBuilder;static PresenterSettings=PresenterSettings;static CallAppSettingsBuilder=CallAppSettingsBuilder;static CallAppSettings=CallAppSettings;static Component=CometChatCallsComponentCore;static PresenterComponent=CometChatPresenterComponent;static CallLogRequestBuilder=CallLogRequestBuilder;static CallLog=CallLog;static CallUser=CallUser;static CallGroup=CallGroup;static Participant=Participant;static Recording=Recording;static async generateToken(e,k){if(await validateCallAppSettings(this.appSettings),!k||!e)throw new CometChatCallsException({code:GENERAL_ERROR.INVALID_ARGUMENT_EXCEPTION.code,message:`Authtoken and session is required.`});let A=await APIHandler.generateToken(k,e,this.appSettings);if(!A?.data?.data)throw A?.data?.error?.message?new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:A?.data?.error?.message}):new CometChatCallsException({code:GENERAL_ERROR.UNKNOWN_API_ERROR.code,message:GENERAL_ERROR.UNKNOWN_API_ERROR.message});return A.data.data}static async init(e){await validateCallAppSettings(e),this.appSettings=e,APIHandler.setAppSettings(e)}static endSession(){try{CometChatCallsComponentCore?.ref?.endCall()}catch(e){Logger.log(`CometChatCalls :: endCall`,e),throwGenericException(e)}}static muteAudio(e){try{e?CometChatCallsComponentCore?.ref?.muteAudio():CometChatCallsComponentCore?.ref?.unmuteAudio()}catch(e){Logger.log(`CometChatCalls :: muteAudio`,e),throwGenericException(e)}}static pauseVideo(e){try{e?CometChatCallsComponentCore?.ref?.pauseVideo():CometChatCallsComponentCore?.ref?.unPauseVideo()}catch(e){Logger.log(`CometChatCalls :: pauseVideo`,e),throwGenericException(e)}}static resumeVideo(){try{CometChatCallsComponentCore?.ref?.unPauseVideo()}catch(e){Logger.log(`CometChatCalls :: resumeVideo`,e),throwGenericException(e)}}static setAudioMode(e){try{e&&CometChatCallsComponentCore?.ref?.setAudioMode(e)}catch(e){Logger.log(`CometChatCalls :: setAudioMode`,e),throwGenericException(e)}}static switchCamera(){try{CometChatCallsComponentCore?.ref?.switchCamera?.()}catch(e){Logger.log(`CometChatCalls :: switchCamera`,e),throwGenericException(e)}}static getAudioOutputModes(){try{return new Promise((e,k)=>{CometChatCallsComponentCore?.ref?.getAudioModes().then(k=>{e(k)},e=>{k(e)})})}catch(e){Logger.log(`CometChatCalls :: getAudioOutputModes`,e),throwGenericException(e)}}static switchToVideoCall(){try{CometChatCallsComponentCore?.ref?.switchToVideoCall()}catch(e){Logger.log(`CometChatCalls :: switchToVideoCall`,e),throwGenericException(e)}}static startRecording(){try{CometChatCallsComponentCore?.ref?.startRecording()}catch(e){Logger.log(`CometChatCalls :: startRecording`,e),throwGenericException(e)}}static stopRecording(){try{CometChatCallsComponentCore?.ref?.stopRecording()}catch(e){Logger.log(`CometChatCalls :: stopRecording`,e),throwGenericException(e)}}static getAppSettings(){return this.appSettings}static getCallDetails(e,k){return new Promise(async(A,j)=>{try{if(this.inProgress){j(new CometChatCallsException(MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),this.inProgress=!1;return}if(this.inProgress=!0,!k){this.inProgress=!1,j(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Auth Token` is required to use the 'fetchNext()' method."}));return}if(!e){this.inProgress=!1,j(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Session ID` is required to use the 'fetchNext()' method."}));return}try{let M=await APIHandler.getCallDetails(e,k);if(M?.data?.error){this.inProgress=!1,j(new CometChatCallsException(M.data.error));return}A((M?.data?.data||[]).map(e=>CallLog.callLogFromJson(e))),this.inProgress=!1}catch(e){this.inProgress=!1,j(new CometChatCallsException(e))}}catch{this.inProgress=!1,j(new CometChatCallsException({code:`UNKNOWN ERROR`,message:`Unknown error`}))}})}},RTCUser=class{uid;avatar=``;name;jwt;resource;constructor(e){isFalsy(e)||(this.uid=e.toString())}setUID(e){this.uid=e?e.toString():``}getUID(){return this.uid.toString()}setName(e){this.name=e?e.toString():``}getName(){return this.name.toString()}setAvatar(e){this.avatar=e?e.toString():``}getAvatar(){return this.avatar.toString()}setJWT(e){this.jwt=e?e.toString():``}getJWT(){return this.jwt.toString()}setResource(e){this.resource=e?e.toString():``}getResource(){return this.resource.toString()}};const addCallEventListener=ListenerHandlers.addCallEventListener,removeCallEventListener=ListenerHandlers.removeCallEventListener;var CometChatCalls=class extends SessionMethodsCore{static appSettings=null;static isInitialized=!1;static loginInProgress=!1;static loggedInUser=null;static loginListeners=new Map;static CALL_MODE=CallConstants.CALL_MODE;static AUDIO_MODE=CallConstants.AUDIO_MODE;static OngoingCallListener=OngoingCallListener;static CallSettingsBuilder=CallSettingsBuilder;static CallAppSettingsBuilder=CallAppSettingsBuilder;static Component=AppReactNativeSDK;static CallLogRequestBuilder=CallLogRequestBuilder;static CallLog=CallLog;static async init(e){let k=valibot.safeParse(CallAppSettingsSchema,e);return k.success?(await this.finalizeInit(k.output,INTEGRATION_SOURCE_MANUAL),{success:!0,error:null}):{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: ${k.issues.map(e=>e.message).join(`, `)}`,timestamp:Date.now()}}}static async finalizeInit(e,k){this.appSettings=e,this.isInitialized=!0,await setIntegrationSource(this.appSettings.appId,k),APIHandler.setAppSettings(new CallAppSettingsBuilder().setAppId(this.appSettings.appId).setRegion(this.appSettings.region).setHost(`${this.getBaseURL(`call`)}/`).build());let A=await this.getSavedUser();if(A){let e;if(typeof A==`string`)try{e=JSON.parse(A)}catch{e=A}else e=A;this.loggedInUser=e,this.reportSdkIdentification()}}static async initFromSettings(e){if(!e||!e.appId)return{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: appId is required`,timestamp:Date.now()}};let k=callAppSettingsFromSettings(e),A=valibot.safeParse(CallAppSettingsSchema,k);return A.success?(await this.finalizeInit(A.output,`ai-agent`),{success:!0,error:null}):{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: ${A.issues.map(e=>e.message).join(`, `)}`,timestamp:Date.now()}}}static async login(e,k){try{if(this.loginInProgress)throw{errorCode:`ERROR_LOGIN_IN_PROGRESS`,errorDescription:`Login is already in progress`};if(!e||e.trim()===``)throw{errorCode:`ERROR_INVALID_UID`,errorDescription:`UID cannot be empty`};if(e.includes(` `))throw{errorCode:`ERROR_UID_WITH_SPACE`,errorDescription:`UID cannot contain spaces`};let A=k||this.appSettings?.authKey;if(!A||A.trim()===``)throw{errorCode:`ERROR_API_KEY_NOT_FOUND`,errorDescription:`Auth Key cannot be empty`};if(!this.isInitialized)throw{errorCode:`ERROR_SDK_NOT_INITIALIZED`,errorDescription:`SDK not initialized. Call init() first`};if(this.loginInProgress=!0,this.loggedInUser&&this.loggedInUser.uid===e&&this.loggedInUser.authToken)return this.loginInProgress=!1,this.notifyLoginSuccess(this.loggedInUser),this.reportSdkIdentification(),this.loggedInUser;this.loggedInUser&&this.loggedInUser.uid!==e&&await this.logoutInternal();let j=await this.loginWithUID(e,A),M=await this.authenticateWithToken(j);return this.loginInProgress=!1,this.loggedInUser=M,await this.saveUser(M),this.notifyLoginSuccess(M),this.reportSdkIdentification(),M}catch(e){this.loginInProgress=!1;let k=this.createError(e);throw this.notifyLoginFailure(k),k}}static async loginWithAuthToken(e){try{if(this.loginInProgress)throw{errorCode:`ERROR_LOGIN_IN_PROGRESS`,errorDescription:`Login is already in progress`};if(!e||e.trim()===``)throw{errorCode:`ERROR_BLANK_AUTHTOKEN`,errorDescription:`Auth token cannot be empty`};if(e.includes(` `))throw{errorCode:`ERROR_AUTHTOKEN_WITH_SPACE`,errorDescription:`Auth token cannot contain spaces`};if(this.loginInProgress=!0,this.loggedInUser&&this.loggedInUser.authToken===e)return this.loginInProgress=!1,this.notifyLoginSuccess(this.loggedInUser),this.reportSdkIdentification(),this.loggedInUser;this.loggedInUser&&this.loggedInUser.authToken!==e&&await this.logoutInternal();let k=await this.authenticateWithToken(e);return this.loginInProgress=!1,this.loggedInUser=k,await this.saveUser(k),this.notifyLoginSuccess(k),this.reportSdkIdentification(),k}catch(e){this.loginInProgress=!1;let k=this.createError(e);throw this.notifyLoginFailure(k),k}}static async logout(){try{if(!this.loggedInUser)throw{errorCode:`ERROR_NO_USER_LOGGED_IN`,errorDescription:`No user is currently logged in`};return await this.logoutInternal(),this.notifyLogoutSuccess(),`Logout successful`}catch(e){let k=this.createError(e);throw this.notifyLogoutFailure(k),k}}static getLoggedInUser(){return this.loggedInUser&&typeof this.loggedInUser==`string`&&(this.loggedInUser=JSON.parse(this.loggedInUser)),this.loggedInUser}static getUserAuthToken(){return this.loggedInUser?.authToken||null}static isUserLoggedIn(){return this.loggedInUser!==null&&this.loggedInUser.authToken!==void 0}static addLoginListener(e,k){this.loginListeners.set(e,k)}static removeLoginListener(e){this.loginListeners.delete(e)}static async generateToken(e,k){try{if(!e||e.trim()===``)throw{errorCode:`ERROR_SESSION_ID_MISSING`,errorDescription:`Session ID cannot be empty`};let A=k||this.getUserAuthToken();if(!A)throw{errorCode:`ERROR_AUTH_TOKEN_MISSING`,errorDescription:`Auth token is required. Please login first or provide authToken.`};if(!this.isInitialized)throw{errorCode:`ERROR_SDK_NOT_INITIALIZED`,errorDescription:`SDK not initialized`};return{token:await this.callGenerateTokenAPI(e,A)}}catch(e){throw this.createError(e)}}static getBaseURL(e=`call`){return e===`call`&&this.appSettings?.host?this.appSettings.host:e===`api`&&this.appSettings?.adminHost?this.appSettings.adminHost:e===`apiclient`&&this.appSettings?.clientHost?this.appSettings.clientHost:`https://${this.appSettings?.appId||``}.${e}-${this.appSettings?.region||``}.cometchat.io/v3.0`}static reportSdkIdentification(){try{let e=this.appSettings?.appId,k=this.loggedInUser?.authToken;if(!e||!k||this.appSettings?.disableSdkIdentification)return;maybeSendIdentification({appId:e,apiclientBaseURL:this.getBaseURL(`apiclient`),authToken:k,callsSdkVersion:`5.0.4`,disableSdkIdentification:this.appSettings?.disableSdkIdentification})}catch{}}static async loginWithUID(e,k){let A=this.appSettings?.appId||``,j=await executeHTTPRequest({baseURL:this.getBaseURL(`api`),method:`POST`,endpoint:`users/${e}/auth_tokens`,headers:{"Content-Type":`application/json`,apiKey:k,appId:A},body:{platform:`react-native`,deviceId:this.generateDeviceId()}});if(j.error)throw Error(`Login failed: ${j.error.message}`);return j.data.authToken}static async authenticateWithToken(e){let k=this.appSettings?.appId||``,A=await executeHTTPRequest({baseURL:this.getBaseURL(`apiclient`),method:`PUT`,endpoint:`me`,headers:{"Content-Type":`application/json`,authToken:e,appId:k},body:{platform:`react-native`,deviceId:this.generateDeviceId()}});if(A.error)throw Error(`Authentication failed: ${A.error.message}`);let j=A.data;return{uid:j.uid,name:j.name,authToken:e,status:j.status||`online`,avatar:j.avatar||``,lastActiveAt:j.lastActiveAt||Date.now(),role:j.role||`default`,hasBlockedMe:!1,blockedByMe:!1,deactivatedAt:0,wsChannel:{identity:`[${k}]${j.uid}`},jwt:j.jwt}}static async logoutInternal(){if(this.loggedInUser?.authToken)try{await executeHTTPRequest({baseURL:this.getBaseURL(`apiclient`),method:`DELETE`,endpoint:`me`,headers:{authToken:this.loggedInUser.authToken,appId:this.appSettings?.appId||``}})}catch{}this.loggedInUser=null,await this.clearSavedUser()}static async callGenerateTokenAPI(e,k){let A=this.appSettings?.appId||``,j=await executeHTTPRequest({baseURL:this.getBaseURL(),method:`POST`,endpoint:`call_tokens`,headers:{"Content-Type":`application/json`,authToken:k,appId:A},body:{sessionId:e}});if(j.error)throw Error(`Token generation failed: ${j.error.message}`);return j.data.token}static getStorageKey(){return`${this.appSettings?.appId}:common_store/user`}static async saveUser(e){try{let k={hasBlockedMe:!1,blockedByMe:!1,deactivatedAt:0,...e,role:e.role||`default`,wsChannel:e.wsChannel||{identity:`[${this.appSettings?.appId}]${e.uid}`}};await __react_native_async_storage_async_storage.default.setItem(this.getStorageKey(),JSON.stringify(k))}catch{}}static async getSavedUser(){try{return await __react_native_async_storage_async_storage.default.getItem(this.getStorageKey())}catch{return null}}static async clearSavedUser(){try{await __react_native_async_storage_async_storage.default.removeItem(this.getStorageKey())}catch{}}static generateDeviceId(){return`rn_`+Math.random().toString(36).substring(2,11)}static createError(e){return e.errorCode&&e.errorDescription?e:{errorCode:`ERROR_UNKNOWN`,errorDescription:e.message||`An unknown error occurred`}}static notifyLoginSuccess(e){this.loginListeners.forEach(k=>{if(k.onLoginSuccess)try{k.onLoginSuccess(e)}catch{}})}static notifyLoginFailure(e){this.loginListeners.forEach(k=>{if(k.onLoginFailure)try{k.onLoginFailure(e)}catch{}})}static notifyLogoutSuccess(){this.loginListeners.forEach(e=>{if(e.onLogoutSuccess)try{e.onLogoutSuccess()}catch{}})}static notifyLogoutFailure(e){this.loginListeners.forEach(k=>{if(k.onLogoutFailure)try{k.onLogoutFailure(e)}catch{}})}static addEventListener(e,k,A){return eventBus.subscribe(e,k,A)}static setAudioMode(e){return requestAudioModeChange(e)}static enablePictureInPictureLayout(){enablePictureInPictureLayout()}static disablePictureInPictureLayout(){disablePictureInPictureLayout()}};publishCallSdkInfo(`5.0.4`),exports.CometChatCalls=CometChatCalls;
1
+ import"./polyfills";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(e,A,M,N)=>{if(A&&typeof A==`object`||typeof A==`function`)for(var P=__getOwnPropNames(A),F=0,I=P.length,L;F<I;F++)L=P[F],!__hasOwnProp.call(e,L)&&L!==M&&__defProp(e,L,{get:(e=>A[e]).bind(null,L),enumerable:!(N=__getOwnPropDesc(A,L))||N.enumerable});return e},__toESM=(O,k,j)=>(j=O==null?{}:__create(__getProtoOf(O)),__copyProps(k||!O||!O.__esModule?__defProp(j,`default`,{value:O,enumerable:!0}):j,O));let valibot=require(`valibot`);valibot=__toESM(valibot);let zustand=require(`zustand`),zustand_middleware=require(`zustand/middleware`),zustand_shallow=require(`zustand/shallow`),react=require(`react`);react=__toESM(react);let __cometchat_calls_lib_webrtc=require(`@cometchat/calls-lib-webrtc`);__cometchat_calls_lib_webrtc=__toESM(__cometchat_calls_lib_webrtc);let __react_native_async_storage_async_storage=require(`@react-native-async-storage/async-storage`);__react_native_async_storage_async_storage=__toESM(__react_native_async_storage_async_storage);let react_native=require(`react-native`),react_native_webrtc=require(`react-native-webrtc`),react_jsx_runtime=require(`react/jsx-runtime`),react_native_svg=require(`react-native-svg`);react_native_svg=__toESM(react_native_svg);var EventBus=class{actionListenersMap;emittingEvents=!1;constructor(){this.actionListenersMap=new Map}startEmitting(){this.emittingEvents=!0}stopEmitting(){this.emittingEvents=!1}publish(e,D=!1){let O=e.type.startsWith(`internal.`);if(!this.emittingEvents&&!D&&!O)return;let k=this.actionListenersMap.get(e.type);if(k)for(let D of k)typeof D==`function`&&(`payload`in e?D(e.payload):D())}subscribe(e,D,O){if(O?.signal?.aborted)return()=>{};this.actionListenersMap.get(e)||this.actionListenersMap.set(e,[]),this.actionListenersMap.get(e)?.push(D);let k=()=>{let O=this.actionListenersMap.get(e);O&&this.actionListenersMap.set(e,O.filter(e=>e!==D))};return O?.signal&&O.signal.addEventListener(`abort`,k,{once:!0}),k}};const eventBus=new EventBus,MIN_ASPECT_RATIO=3/4,MAX_ASPECT_RATIO=16/9,GRID_GAP=8,MIN_TILE_WIDTH=240,PARTICIPANT_ROLE={MODERATOR:`moderator`,NONE:`none`},MEDIA_TYPE={AUDIO:`audio`,VIDEO:`video`,SCREENSHARE:`screenshare`},LAYOUT={TILE:`TILE`,SIDEBAR:`SIDEBAR`,SPOTLIGHT:`SPOTLIGHT`},SESSION_TYPE={VOICE:`VOICE`,VIDEO:`VIDEO`},CAMERA_FACING={FRONT:`FRONT`,REAR:`REAR`},CAMERA_FACING_INTERNAL={USER:`user`,ENVIRONMENT:`environment`},VIDEO_PAUSE_AUTHORITY={USER:1,BACKGROUND:2,SCREEN_SHARE:4},CONFERENCE_COMMANDS={userInfo:`user-info`,initialConfig:`initial_config`},VIDEO_QUALITY_LEVELS={ULTRA:2160,HIGH:720,STANDARD:360,LOW:180,NONE:0},SDK_PLATFORM={WEB:`web`,ANDROID:`android`,IOS:`ios`,REACT_NATIVE_ANDROID:`react-native-android`,REACT_NATIVE_IOS:`react-native-ios`},EVENT_LISTENER_METHODS={SessionStatusListener:{onSessionJoined:`onSessionJoined`,onSessionLeft:`onSessionLeft`,onConnectionLost:`onConnectionLost`,onConnectionRestored:`onConnectionRestored`,onRemoteConnectionLost:`onRemoteConnectionLost`,onRemoteConnectionRestored:`onRemoteConnectionRestored`,onConnectionClosed:`onConnectionClosed`,onConnectionFailed:`onConnectionFailed`,onSessionTimedOut:`onSessionTimedOut`},MediaEventsListener:{onAudioMuted:`onAudioMuted`,onAudioUnMuted:`onAudioUnMuted`,onVideoPaused:`onVideoPaused`,onVideoResumed:`onVideoResumed`,onRecordingStarted:`onRecordingStarted`,onRecordingStopped:`onRecordingStopped`,onStreamingStarted:`onStreamingStarted`,onStreamingStopped:`onStreamingStopped`,onScreenShareStarted:`onScreenShareStarted`,onScreenShareStopped:`onScreenShareStopped`},ParticipantEventsListner:{onParticipantJoined:`onParticipantJoined`,onParticipantLeft:`onParticipantLeft`,onParticipantAudioMuted:`onParticipantAudioMuted`,onParticipantAudioUnmuted:`onParticipantAudioUnmuted`,onParticipantVideoPaused:`onParticipantVideoPaused`,onParticipantVideoResumed:`onParticipantVideoResumed`,onParticipantHandRaised:`onParticipantHandRaised`,onParticipantHandLowered:`onParticipantHandLowered`,onParticipantStartedScreenShare:`onParticipantStartedScreenShare`,onParticipantStoppedScreenShare:`onParticipantStoppedScreenShare`,onParticipantStartedRecording:`onParticipantStartedRecording`,onParticipantStoppedRecording:`onParticipantStoppedRecording`,onParticipantStartedStreaming:`onParticipantStartedStreaming`,onParticipantStoppedStreaming:`onParticipantStoppedStreaming`,onDominantSpeakerChanged:`onDominantSpeakerChanged`,onParticipantListChanged:`onParticipantListChanged`},ButtonClickListener:{onLeaveSessionButtonClicked:`onLeaveSessionButtonClicked`,onRaiseHandButtonClicked:`onRaiseHandButtonClicked`,onShareInviteButtonClicked:`onShareInviteButtonClicked`,onChangeLayoutButtonClicked:`onChangeLayoutButtonClicked`,onParticipantListButtonClicked:`onParticipantListButtonClicked`,onToggleAudioButtonClicked:`onToggleAudioButtonClicked`,onToggleVideoButtonClicked:`onToggleVideoButtonClicked`,onRecordingToggleButtonClicked:`onRecordingToggleButtonClicked`,onScreenShareButtonClicked:`onScreenShareButtonClicked`,onChatButtonClicked:`onChatButtonClicked`},CallLayoutListener:{onCallLayoutChanged:`onCallLayoutChanged`,onParticipantListVisible:`onParticipantListVisible`,onParticipantListHidden:`onParticipantListHidden`}},EVENT_LISTENER_METHODS_WEB={...EVENT_LISTENER_METHODS,MediaEventsListener:{...EVENT_LISTENER_METHODS.MediaEventsListener,onAudioInputDeviceChanged:`onAudioInputDeviceChanged`,onVideoInputDeviceChanged:`onVideoInputDeviceChanged`,onAudioOutputDeviceChanged:`onAudioOutputDeviceChanged`,onAudioInputDevicesChanged:`onAudioInputDevicesChanged`,onVideoInputDevicesChanged:`onVideoInputDevicesChanged`,onAudioOutputDevicesChanged:`onAudioOutputDevicesChanged`}},EVENT_LISTENER_METHODS_MOBILE={...EVENT_LISTENER_METHODS,MediaEventsListener:{...EVENT_LISTENER_METHODS.MediaEventsListener,onAudioModeChanged:`onAudioModeChanged`,onAudioModesChanged:`onAudioModesChanged`,onCameraFacingChanged:`onCameraFacingChanged`},ButtonClickListener:{...EVENT_LISTENER_METHODS.ButtonClickListener,onSwitchCameraButtonClicked:`onSwitchCameraButtonClicked`},CallLayoutListener:{...EVENT_LISTENER_METHODS.CallLayoutListener,onPictureInPictureLayoutEnabled:`onPictureInPictureLayoutEnabled`,onPictureInPictureLayoutDisabled:`onPictureInPictureLayoutDisabled`}},INTERNAL_EVENTS={connectionWillClose:`internal.sessionWillClose`,onConnectionEstablished:`internal.onConnectionEstablished`,onSessionJoined:`internal.onSessionJoined`,notification:`internal.notification`,queryPermission:`internal.queryPermission`,lifecycle:{componentDidMount:`internal.componentDidMount`,componentWillUnmount:`internal.componentWillUnmount`,SDKInitialized:`internal.SDKInitialized`}},CAPTION_LANGUAGES=[{code:`en-US`,label:`English (United States)`},{code:`de-DE`,label:`German (Germany)`},{code:`en-GB`,label:`English (United Kingdom)`},{code:`es-ES`,label:`Spanish (Spain)`},{code:`fr-FR`,label:`French (France)`},{code:`hi-IN`,label:`Hindi (India)`},{code:`hu-HU`,label:`Hungarian (Hungary)`},{code:`it-IT`,label:`Italian (Italy)`},{code:`ja-JP`,label:`Japanese (Japan)`},{code:`ko-KR`,label:`Korean (South Korea)`},{code:`lt-LT`,label:`Lithuanian (Lithuania)`},{code:`ms-MY`,label:`Malay (Malaysia)`},{code:`nl-NL`,label:`Dutch (Netherlands)`},{code:`pt-PT`,label:`Portuguese (Portugal)`},{code:`ru-RU`,label:`Russian (Russia)`},{code:`sv-SE`,label:`Swedish (Sweden)`},{code:`tr-TR`,label:`Turkish (Turkey)`},{code:`zh`,label:`Chinese Mandarin (Simplified, China)`},{code:`zh-TW`,label:`Chinese Mandarin (Traditional, Taiwan)`}];function calculateTileLayout(e,D,O){if(e<=0||D<=0||O<=0)throw Error(`Container dimensions and number of tiles must be positive`);let k=e*D/O;if(57600*MIN_ASPECT_RATIO,k<43200){let k=Math.max(2,Math.floor(e/240)),A=Math.ceil(O/k),j=(e-k*8)/k;return{rows:A,columns:k,tileWidth:j,tileHeight:j*MIN_ASPECT_RATIO,paddingVertical:0,allocatedWidth:e,allocatedHeight:D}}let A=Math.sqrt(O),j=Math.floor(A),M=Math.ceil(O/j),N=getCalculatedAspectRatio(e,D,M,j);if(N<MIN_ASPECT_RATIO)for(;N<MIN_ASPECT_RATIO&&M>1;)M--,j=Math.ceil(O/M),N=getCalculatedAspectRatio(e,D,M,j);else for(;N>MAX_ASPECT_RATIO&&M<O;)M++,j=Math.ceil(O/M),N=getCalculatedAspectRatio(e,D,M,j);Math.ceil(O/(M-1))===j&&M--;let P=M*8,F=j*8,I=(e-P)/M,L=(D-F)/j,R=0,z=I/L;z<9/16?(R=(L-I*MAX_ASPECT_RATIO)*j/2,L=I*MAX_ASPECT_RATIO):z>MAX_ASPECT_RATIO&&(I=L*MAX_ASPECT_RATIO);let B=I*M+P,V=L*j+F;return{rows:j,columns:M,tileWidth:I,tileHeight:L,paddingVertical:R,allocatedWidth:B,allocatedHeight:V}}function getCalculatedAspectRatio(e,D,O,k){let A=O*8,j=k*8;return(e-A)/O/((D-j)/k)}const getAvatarTextInitials=e=>e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2),miliSecondsToMMSS=e=>{let D=Math.floor(e/1e3),O=Math.floor(D/3600),k=Math.floor(D%3600/60),A=D%60,j=k.toString().padStart(2,`0`),M=A.toString().padStart(2,`0`);return O>0?`${O.toString().padStart(2,`0`)}:${j}:${M}`:`${j}:${M}`};function getHueFromName(e){let D=0;for(let O=0;O<e.length;O++)D=e.charCodeAt(O)+((D<<5)-D);return Math.abs(D)%360}function hsvToRgb(e,D,O){D/=100,O/=100;let k=O*D,A=k*(1-Math.abs(e/60%2-1)),j=O-k,M=0,N=0,P=0;return e>=0&&e<60?[M,N,P]=[k,A,0]:e>=60&&e<120?[M,N,P]=[A,k,0]:e>=120&&e<180?[M,N,P]=[0,k,A]:e>=180&&e<240?[M,N,P]=[0,A,k]:e>=240&&e<300?[M,N,P]=[A,0,k]:e>=300&&e<360&&([M,N,P]=[k,0,A]),`rgb(${Math.round((M+j)*255)}, ${Math.round((N+j)*255)}, ${Math.round((P+j)*255)})`}function getColorFromName(e){return hsvToRgb(getHueFromName(e),45,35)}function safeParseJson(e){try{return JSON.parse(e)}catch{return null}}const getMediaType=e=>e.getType()===`audio`?MEDIA_TYPE.AUDIO:e.getVideoType()===`desktop`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO;function differenceBy(e,D,O){let k=new Set(D.map(O));return e.filter(e=>!k.has(O(e)))}function sleep(e=1e3){return new Promise(D=>setTimeout(D,e))}function isArrayOfObjEqual(e,D){if(e.length!==D.length)return!1;for(let O=0;O<e.length;O++)if(!(0,zustand_shallow.shallow)(e[O],D[O]))return!1;return!0}function isDeviceEqual(e,D){return e?.deviceId===D?.deviceId&&e?.label===D?.label}function getDefaultDevice(e){return e.find(e=>e.deviceId===`default`)||e[0]}function waitForStoreState(e,D,O=5e3){return new Promise((k,A)=>{if(D(e.getState())){k();return}let j=setTimeout(()=>{M(),A(Error(`waitForStoreState timed out`))},O),M=e.subscribe(e=>{D(e)&&(clearTimeout(j),M(),k())})})}const FATAL_ERRORS=[`connection.droppedError`,`connection.otherError`,`connection.serverError`];function isFatalConnectionError(e){return FATAL_ERRORS.includes(e.name)}async function tryCatch(e,D){try{return{data:D==null?await e:await Promise.race([e,new Promise((e,O)=>setTimeout(()=>O(Error(`timeout`)),D))]),error:null}}catch(e){return{data:null,error:e}}}function tryCatchSync(e){try{return{data:e(),error:null}}catch(e){return{data:null,error:e}}}function debounce(e,D){let O=null;return(...k)=>{O&&clearTimeout(O),O=setTimeout(()=>{tryCatchSync(()=>e(...k))},D)}}var SessionMethodsCore=class{static muteAudio(e=!0){e?muteAudioTrack():unMuteAudioTrack()}static unmuteAudio(){unMuteAudioTrack()}static toggleAudio(){toggleAudioTrack()}static pauseVideo(e=!0){e?pauseVideoTrack():resumeVideoTrack()}static resumeVideo(){resumeVideoTrack()}static toggleVideo(){toggleVideoTrack()}static leaveSession(){leaveSession()}static endSessionForAll(){leaveSession({shouldEndSession:!0})}static raiseHand(){raisedHandLocal()}static lowerHand(){lowerHandLocal()}static toggleHand(){toggleRaiseHand()}static switchCamera(){switchCamera()}static setLayout(e){setLayout(e)}static startStreaming(e,D){startStreaming(e,D)}static stopStreaming(){stopStreaming()}static startRecording(){startRecording()}static stopRecording(){stopRecording()}static toggleRecording(){toggleRecording()}static startTranscription(){startTranscription()}static stopTranscription(){stopTranscription()}static pinParticipant(e,D){pinParticipant(e,D)}static unpinParticipant(){unpinParticipant()}static muteParticipant(e){muteParticipant(e)}static pauseParticipantVideo(e){pauseParticipantVideo(e)}static setChatButtonUnreadCount(e){setChatButtonUnreadCount(e)}static toggleParticipantList(){toggleParticipantList()}static showParticipantList(){showParticipantList()}static hideParticipantList(){hideParticipantList()}static switchToVideoCall(){}static endSession(){this.leaveSession()}static getCallDetails(e,D){throw Error(`This method is deprecated and not supported.`)}};function getRealDeviceId(e,D){if(e!==`default`)return e;let O=D===`audio`?useBaseStore.getState().audioInputDevices:useBaseStore.getState().videoInputDevices,k=O.find(e=>e.deviceId===`default`);return k?O.find(e=>e.deviceId!==`default`&&e.groupId===k.groupId)?.deviceId??e:e}async function createLocalTrackF(e,D=null,O=null,k={}){if(useConfigStore.getState().iAmRecorder)return;let{data:A,error:j}=await tryCatch(__cometchat_calls_lib_webrtc.default.createLocalTracks({devices:[e],cameraDeviceId:D,micDeviceId:D,timeout:O,...k}));if(j)throw j;return A[0]}async function createLocalTrack(e,D=null,O=CAMERA_FACING_INTERNAL.USER){let k=useBaseStore.getState().isMobile()?null:D,{data:A,error:j}=await tryCatch(createLocalTrackF(e,getRealDeviceId(k,e),null,{facingMode:O}));A?(k===`default`&&(A._realDeviceId=A.deviceId=`default`),onTrack(A)):(e===`video`?pauseVideoTrack():e===`audio`&&muteAudioTrack(),j instanceof Error&&j.name===`gum.permission_denied`&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for ${e} track. Please allow access to your device.`}}))}function createLocalTracks(){if(useConfigStore.getState().enableCompanionMode||createLocalTrack(`audio`,useConfigStore.getState().audioInputDeviceId??useBaseStore.getState().audioInputDevice?.deviceId),useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO){let e=useConfigStore.getState().videoInputDeviceId,D=useBaseStore.getState().videoInputDevice?.deviceId,O=useConfigStore.getState().initialCameraFacing,k=useBaseStore.getState().cameraFacing;e?createLocalTrack(`video`,e):O?createLocalTrack(`video`,null,k):createLocalTrack(`video`,D,k)}}function updateAudioInputDevice(e){useBaseStore.getState().audioInputDevices.filter(e=>e.deviceId!==``).length>0&&createLocalTrack(`audio`,e)}function updateAudioInputDeviceState(e,D=!1){useBaseStore.getState().isMobileSDK()||e&&useBaseStore.setState({audioInputDevice:{...e.toJSON(),skipSubscribe:D}})}async function updateVideoInputDevice(e,D){if(useBaseStore.getState().videoInputDevices.filter(e=>e.deviceId!==``).length>0)createLocalTrack(`video`,e,D);else if(e===null){let O=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;if(O){await O.dispose();let e=useConferenceStore.getState().conference;e&&e.replaceTrack(O,null)}createLocalTrack(`video`,e,D)}}function updateVideoInputDeviceState(e,D=!1){if(!useBaseStore.getState().isMobileSDK()&&e){let O=e.toJSON?e.toJSON():e;useBaseStore.setState({videoInputDevice:{...O,skipSubscribe:D}})}}function updateAudioOutputDevice(e){__cometchat_calls_lib_webrtc.default.mediaDevices.isDeviceChangeAvailable(`output`)&&__cometchat_calls_lib_webrtc.default.mediaDevices.setAudioOutputDevice(e).then(()=>{let D=useBaseStore.getState().audioOutputDevices.find(D=>D.deviceId===e);D&&useBaseStore.setState({audioOutputDevice:D})})}const MaxBitratesVideoSchema=valibot.object({low:valibot.optional(valibot.number()),standard:valibot.optional(valibot.number()),high:valibot.optional(valibot.number()),fullHd:valibot.optional(valibot.number()),ultraHd:valibot.optional(valibot.number()),ssHigh:valibot.optional(valibot.number())}),CodecConfigSchema=valibot.object({maxBitratesVideo:valibot.optional(MaxBitratesVideoSchema),scalabilityModeEnabled:valibot.optional(valibot.boolean()),useSimulcast:valibot.optional(valibot.boolean()),useKSVC:valibot.optional(valibot.boolean())}),VideoQualitySchema=valibot.object({codecPreferenceOrder:valibot.optional(valibot.array(valibot.string())),screenshareCodec:valibot.optional(valibot.string()),mobileScreenshareCodec:valibot.optional(valibot.string()),enableAdaptiveMode:valibot.optional(valibot.boolean()),av1:valibot.optional(CodecConfigSchema),h264:valibot.optional(CodecConfigSchema),vp8:valibot.optional(CodecConfigSchema),vp9:valibot.optional(CodecConfigSchema),minHeightForQualityLvl:valibot.optional(valibot.record(valibot.string(),valibot.string())),mobileCodecPreferenceOrder:valibot.optional(valibot.array(valibot.string()))}),UserSchema=valibot.object({uid:valibot.string(),name:valibot.string(),avatar:valibot.optional(valibot.string()),status:valibot.optional(valibot.string()),role:valibot.optional(valibot.string()),lastActiveAt:valibot.optional(valibot.number())}),SettingsSchema=valibot.object({WEBRTC_HOST:valibot.optional(valibot.string()),ANALYTICS_HOST:valibot.optional(valibot.string()),ANALYTICS_VERSION:valibot.optional(valibot.string()),PRESENTER_MODE_ENABLED:valibot.optional(valibot.boolean()),connectionConfig:valibot.object({audioQuality:valibot.optional(valibot.object({stereo:valibot.optional(valibot.boolean())})),bridgeChannel:valibot.optional(valibot.object({preferSctp:valibot.optional(valibot.boolean())})),constraints:valibot.optional(valibot.object({video:valibot.optional(valibot.object({height:valibot.optional(valibot.object({ideal:valibot.optional(valibot.number()),max:valibot.optional(valibot.number()),min:valibot.optional(valibot.number())})),width:valibot.optional(valibot.object({ideal:valibot.optional(valibot.number()),max:valibot.optional(valibot.number()),min:valibot.optional(valibot.number())}))}))})),e2ee:valibot.optional(valibot.array(valibot.unknown())),e2eping:valibot.optional(valibot.object({enabled:valibot.optional(valibot.boolean())})),flags:valibot.optional(valibot.object({receiveMultipleVideoStreams:valibot.optional(valibot.boolean()),sendMultipleVideoStreams:valibot.optional(valibot.boolean()),sourceNameSignaling:valibot.optional(valibot.boolean()),ssrcRewritingEnabled:valibot.optional(valibot.boolean())})),hosts:valibot.object({domain:valibot.optional(valibot.string()),muc:valibot.optional(valibot.string())}),hiddenDomain:valibot.optional(valibot.string()),bosh:valibot.optional(valibot.string()),websocket:valibot.optional(valibot.string()),serviceUrl:valibot.string(),p2p:valibot.object({enabled:valibot.boolean()}),resolution:valibot.optional(valibot.number()),videoQuality:valibot.optional(VideoQualitySchema),pcStatsInterval:valibot.optional(valibot.number())})}),InternalSettingSchema=valibot.object({callToken:valibot.string(),settings:SettingsSchema,sessionId:valibot.string(),user:UserSchema}),ParticipantSchema=valibot.object({pid:valibot.string(),name:valibot.string(),uid:valibot.string(),avatar:valibot.optional(valibot.string())});function sendParticipantEvent(e,D){let O=useParticipantStore.getState().getParticipantById(D);if(O){let D=valibot.safeParse(ParticipantSchema,O);D.success&&eventBus.publish({type:e,payload:D.output})}}function sendParticipantListChangedEvent(){let e=useParticipantStore.getState().participants,D=valibot.safeParse(valibot.array(ParticipantSchema),e);D.success&&eventBus.publish({type:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantListChanged,payload:D.output})}var en_US_default={header:{layouts:{tileView:`Tile View`,sideLayout:`Side Layout`,spotlight:`Spotlight`}},controlPanel:{audioControl:{muteMicrophone:`Mute microphone`,unmuteMicrophone:`Unmute microphone`,audioDeviceOptions:`Audio device options`,audioSettings:`Audio settings`},videoControl:{turnOffCamera:`Turn off camera`,turnOnCamera:`Turn on camera`,videoDeviceOptions:`Video device options`,videoSettings:`Video settings`},settingsDialog:{todo:`// TODO: Revisit this section`,title:`Settings`,tabs:{audio:`Audio`,video:`Video`,closedCaption:`Closed caption`},deviceLabels:{microphone:`Microphone`,speaker:`Speaker`,camera:`Camera`,frameRate:`Desktop sharing frame rate`},deviceStates:{noMicrophoneSelected:`No microphone selected`,noSpeakerSelected:`No speaker selected`,noCameraSelected:`No camera selected`},audioSettings:{enableNoiseReduction:`Enable noise reduction`},closedCaptionSettings:{language:`Language`,enableClosedCaptions:`Enable closed captions`},videoSettings:{mirrorMyVideo:`Mirror my video`,selectCameraToSeePreview:`Select a camera to see preview`,loadingCameraPreview:`Loading camera preview...`,frameRateUnit:`frames per second`,frameRateNotice:`You need to restart the screen share for the new settings to take effect.`},permissions:{errorTitle:`Some permissions are missing`,microphoneBlocked:`Access to your microphone is blocked. Please check your browser settings.`,cameraBlocked:`Access to your camera is blocked. Please check your browser settings.`,microphoneAndCameraBlocked:`Access to your microphone and camera is blocked. Please check your browser settings.`},buttons:{cancel:`Cancel`,done:`Done`}},recording:{startRecording:`Start recording`,stopRecording:`Stop recording`,startRecordingConfirmation:`Recording will capture video, audio, and screen sharing from this call.`,stopRecordingConfirmation:`Stopping will end the recording of video, audio, and screen sharing from this call.`,cancel:`Cancel`},streaming:{startStreaming:`Start streaming`,stopStreaming:`Stop streaming`,startStreamingConfirmation:`Enter the RTMP stream URL and stream key to start live streaming.`,stopStreamingConfirmation:`Are you sure you want to stop the live stream?`,streamUrlPlaceholder:`Enter stream URL`,streamKeyPlaceholder:`Enter stream key (optional)`,cancel:`Cancel`},raiseHand:`Raise hand`,lowerHand:`Lower hand`,startScreenSharing:`Start screen sharing`,stopScreenSharing:`Stop screen sharing`,moreOptions:`More options`,leaveSession:`Leave session`,reactions:`Reactions`},idealTimeout:{title:`Are you still there?`,subtitle:`You are the only one here, so this call will end in less than {minutes} minute{plural}. Do you want to stay in this call?`,buttons:{stayInCall:`Stay in the call`,leaveNow:`Leave now`}},participantList:{header:{title:`Participants`,closeButton:`Close participants list`},search:{placeholder:`Search Participant`},emptyState:{title:`No participants found`,subtitle:`No participants match your search`}},virtualBackground:{title:`Virtual Background`,addBackground:`Add Background`,noCameraFeed:`No camera feed detected`,buttons:{cancel:`Cancel`,done:`Done`}},indicators:{recording:{label:`REC`,tooltip:`This session is being recorded`},streaming:{label:`LIVE`,tooltip:`This session is being streamed`}},notifications:{recordingStarted:`The session is being recorded`,recordingStopped:`Recording has been stopped`,streamingStarted:`Live streaming has started`,streamingStopped:`Live streaming has stopped`},closedCaptions:{emptyState:`Waiting for people to speak…`},audioPlayback:{blockedTitle:`Tap to hear audio`,blockedSubtitle:`Your browser needs a tap before it can play the other participants' audio.`,blockedButton:`Enable audio`},general:{error:`Something went wrong, please try again.`},other:{}};const initialState$9={translations:{"en-US":en_US_default},currentLocale:`en-US`},useTranslationStore=(0,zustand.create)((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$9,e=>({reset:()=>e(initialState$9),setLocale:D=>e(()=>({currentLocale:D}))}))));function get(e,D){let O=D.split(`.`),k=e;for(let e of O){if(typeof k!=`object`||!k)return``;k=k[e]}return k}function translate(e){let{translations:D,currentLocale:O}=useTranslationStore.getState();return get(D,`${O}.${e}`)}const useTranslation=()=>{let{translations:e,currentLocale:D}=useTranslationStore();return{t:O=>get(e,`${D}.${O}`),currentLocale:D,translations:e}},initialState$8={sessionType:`VIDEO`,autoStartRecording:!1,autoStartTranscription:!1,layout:LAYOUT.TILE,hideRecordingButton:!0,hideStreamingButton:!0,hideVirtualBackgroundButton:!1,hideAudioModeButton:!1,hideSwitchCameraButton:!1,devSessionId:`dev-session`,iAmRecorder:!1,hideControlPanel:!1,hideHeaderPanel:!1,hideRaiseHandButton:!1,hideShareInviteButton:!0,hideChangeLayoutButton:!1,hideLeaveSessionButton:!1,hideToggleAudioButton:!1,hideParticipantListButton:!1,hideChatButton:!0,hideToggleVideoButton:!1,hideScreenSharingButton:!1,hideClosedCaptionButton:!0,hideTranscriptionButton:!0,captionLanguage:CAPTION_LANGUAGES[0].code,hideSessionTimer:!1,hideNetworkIndicator:!0,hideRecordingStatusIndicator:!1,hideStreamingStatusIndicator:!1,enableParticipantContextMenu:!0,displayName:``,startAudioMuted:!1,startVideoPaused:!1,title:``,enableNoiseReduction:!1,unstable_headlessMode:!1,idleTimeoutPeriodBeforePrompt:6e4,idleTimeoutPeriodAfterPrompt:18e4,enableSpotlightDrag:!0,enableSpotlightSwap:!0,enableIOSPictureInPicture:!1,showFrameRate:!1,enableCompanionMode:!1,isPeerCall:!1,enableNotifications:!0},useConfigStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$8,e=>({reset:()=>e(initialState$8)})))),setConfig=e=>{useConfigStore.setState(e)},initialLocalParticipant={avatar:void 0,isLocal:!0,name:``,pid:`local`,ruid:`local-human`,role:`none`,sources:new Map,type:`human`,uid:`unknown`},initialState$7={dominantSpeakers:[],localParticipant:initialLocalParticipant,participants:[],virtualParticipants:[]},useParticipantStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$7,(e,D)=>({addParticipant:D=>{e(e=>({participants:e.participants.some(e=>e.pid===D.pid)?e.participants.map(e=>e.pid===D.pid?{...e,...D}:e):[...e.participants,D]}))},addVirtualParticipant:D=>{e(e=>({virtualParticipants:e.virtualParticipants.some(e=>e.pid===D.pid&&e.type===D.type)?e.virtualParticipants.map(e=>e.pid===D.pid&&e.type===D.type?{...e,...D}:e):[...e.virtualParticipants,D]}))},clearParticipants:()=>e({participants:[],virtualParticipants:[]}),removeParticipant:D=>{let O=useParticipantStore.getState().participants.find(e=>e.pid===D);O&&(sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantLeft,O.pid),useParticipantStore.getState().pinnedParticipant?.pid===O.pid&&useParticipantStore.getState().unpinParticipant()),e(e=>({participants:e.participants.filter(e=>e.pid!==D)}))},removeVirtualParticipant:(D,O=`screen-share`)=>{let k=useParticipantStore.getState().pinnedParticipant;k?.pid===D&&k.type===O&&useParticipantStore.getState().unpinParticipant(),e(e=>({virtualParticipants:e.virtualParticipants.filter(e=>!(e.pid===D&&e.type===O))}))},updateLocalParticipant:D=>{e(e=>({localParticipant:{...e.localParticipant,...D}}))},updateParticipant:(D,O)=>{e(e=>D===e.localParticipant.pid?{localParticipant:{...e.localParticipant,...O}}:{participants:e.participants.map(e=>e.pid===D?{...e,...O}:e)})},updateParticipantRole:(D,O)=>{e(e=>({participants:e.participants.map(e=>e.pid===D?{...e,role:O}:e)}))},pinParticipant:(D,O)=>{let k=getAllParticipants().find(e=>e.pid===D&&e.type===O);k&&e({pinnedParticipant:k})},unpinParticipant:()=>{e({pinnedParticipant:void 0})},getParticipantById:e=>{let O=D().localParticipant;return e===O.pid?O:D().participants.find(D=>D.pid===e)},reset:()=>e(initialState$7)}))));function useAllParticipants(){let e=useParticipantStore(e=>e.localParticipant),D=useParticipantStore(e=>e.participants),O=useParticipantStore(e=>e.virtualParticipants),k=useConfigStore.getState().iAmRecorder;return(0,react.useMemo)(()=>k?[...O,...D]:[e,...O,...D],[k,e,D,O])}function getAllParticipants(){let e=useParticipantStore.getState().localParticipant,D=useParticipantStore.getState().participants;return[e,...useParticipantStore.getState().virtualParticipants,...D]}const updateDominantSpeakers=()=>{let e=useParticipantStore.getState().dominantSpeakers,D=useParticipantStore.getState().participants;useParticipantStore.setState({dominantSpeakers:e.filter(e=>D.some(D=>D.pid===e))})},sortParticipants=()=>{let{participants:e,dominantSpeakers:D}=useParticipantStore.getState(),O=D[0];if(!O||e.slice(0,4).some(e=>e.pid===O))return;let k=[...e].sort((e,O)=>{let k=D.indexOf(e.pid),A=D.indexOf(O.pid);return k===-1&&A===-1?0:k===-1?1:A===-1?-1:k-A});useParticipantStore.setState({participants:k})};useParticipantStore.subscribe(e=>e.dominantSpeakers,sortParticipants);const pinParticipant=(e,D)=>{useParticipantStore.getState().pinParticipant(e,D)},unpinParticipant=()=>{useParticipantStore.getState().unpinParticipant()},togglePinParticipant=(e,D)=>{let O=useParticipantStore.getState().pinnedParticipant;O?.pid===e&&O.type===D?useParticipantStore.getState().unpinParticipant():useParticipantStore.getState().pinParticipant(e,D)};useParticipantStore.subscribe(e=>e.virtualParticipants,e=>{e&&e.length>0?setLayout(LAYOUT.SIDEBAR,!0):useBaseStore.getState().sidebarLayoutSetProgrammatically&&setLayout(LAYOUT.TILE)}),useParticipantStore.subscribe(e=>e.participants.length,()=>{updateDominantSpeakers()}),useParticipantStore.subscribe(e=>e.participants.map(({pid:e,name:D,avatar:O,uid:k})=>({pid:e,name:D,avatar:O,uid:k})),()=>{sendParticipantListChangedEvent()},{equalityFn:isArrayOfObjEqual}),useParticipantStore.subscribe(e=>e.localParticipant.pid,e=>{useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{pid:e}),useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{pid:e})}),useParticipantStore.subscribe(e=>!!e.pinnedParticipant,e=>{e?useBaseStore.getState().layout===LAYOUT.TILE&&setLayout(LAYOUT.SIDEBAR,!0):useBaseStore.getState().sidebarLayoutSetProgrammatically&&setLayout(LAYOUT.TILE)}),useParticipantStore.subscribe(e=>e.participants.length,e=>{e===0?useBaseStore.getState().restartIdealTimeoutTimer():useBaseStore.getState().clearIdealTimeoutTimer()}),eventBus.subscribe(EVENT_LISTENER_METHODS.SessionStatusListener.onSessionJoined,()=>{useParticipantStore.getState().participants.length===0&&useBaseStore.getState().restartIdealTimeoutTimer()});const getMainParticipantFromState=e=>{let{pinnedParticipant:D,participants:O,virtualParticipants:k,dominantSpeakers:A,localParticipant:j}=e;if(D)return D;if(k.length>0)return k[0];for(let e of A){let D=O.find(D=>D.pid===e);if(D)return D}return O.length>0?O[0]:j},getParticipantMediaType=e=>e?.type===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO;useParticipantStore.subscribe(e=>e.participants.filter(e=>e.uid),(e,D)=>{e.length>D.length&&differenceBy(e,D,e=>e.uid).forEach(e=>{sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantJoined,e.pid)})});const MAX_TOASTS=3,initialState$6={toasts:[]};let counter=0;const useToastStore=(0,zustand.create)(e=>({...initialState$6,addToast:D=>{if(!getIsConferenceJoined()||!useConfigStore.getState().enableNotifications)return``;let O=D.id??`toast-${++counter}-${Date.now()}`,k={...D,id:O,createdAt:Date.now()};return e(e=>{let D=e.toasts.findIndex(e=>e.id===O);if(D!==-1){let O=[...e.toasts];return O[D]=k,{toasts:O}}let A=[...e.toasts,k];return A.length>3?{toasts:A.slice(-3)}:{toasts:A}}),O},removeToast:D=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==D)}))},clearAll:()=>{e(initialState$6)},reset:()=>{e(initialState$6)}}));function showToast(e){return useToastStore.getState().addToast({id:e.id,message:e.message,type:e.type??`info`,duration:e.duration??3e3,position:e.position??`bottom`,action:e.action})}const MAX_RECORDING_RETRIES=8,RECORDING_RETRY_BASE_DELAY=5e3;let recordingRetryAttempts=0,recordingRetryTimer=null;function clearRecordingRetry(){recordingRetryTimer&&=(clearTimeout(recordingRetryTimer),null),recordingRetryAttempts=0}function scheduleRecordingRetry(){if(recordingRetryTimer)return;if(recordingRetryAttempts>=8){clearRecordingRetry(),showToast({id:`recording-failed`,type:`error`,message:`Recording failed`});return}let e=5e3*2**Math.max(0,recordingRetryAttempts-2);recordingRetryAttempts+=1,recordingRetryTimer=setTimeout(()=>{recordingRetryTimer=null,startRecording()},e)}function sendInitialConfig(){let e=useConferenceStore.getState().conference;if(!e?.room)return;let D=useConfigStore.getState(),O=useParticipantStore.getState().localParticipant,k={session_id:D.sessionId,is_audio_only:String(D.sessionType===`VOICE`),is_audio_muted:String(D.startAudioMuted),is_video_muted:String(D.startVideoPaused),is_peer_call:String(D.isPeerCall),start_recording_on_call_start:String(D.autoStartRecording),uid:O.uid,platform:useBaseStore.getState().sdkPlatform,platform_version:useBaseStore.getState().platformVersion,user_agent:useBaseStore.getState().userAgent,meeting_id:e.room?.xmpp?.getJid?.()??D.sessionId,mode:D.layout,commit_id:`726fd05`};e.room.addOrReplaceInPresence(CONFERENCE_COMMANDS.initialConfig,{attributes:k})}const initialState$5={conference:null,conferenceJoined:!1,conferenceJoinedAt:null,conferenceStartedAt:null,conferenceStatus:`initial`,p2p:!1,connectionQuality:new Map,remoteStatsTimestamps:new Map,raiseHandMap:new Map,recording:{status:__cometchat_calls_lib_webrtc.default.constants.recording.status.OFF,mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE},isRecording:!1,isStreaming:!1},useConferenceStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$5,e=>({conferenceWillJoin:D=>{window?.APP!==void 0&&(window.APP.conference._room=D),e({conference:D,conferenceStatus:`joining`})},reset:()=>{clearRecordingRetry(),e(initialState$5)},raiseHand:(D,O)=>{e(e=>({raiseHandMap:new Map(e.raiseHandMap).set(D,O)})),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantHandRaised,D)},lowerHand:D=>{useConferenceStore.getState().raiseHandMap.has(D)&&(e(e=>{let O=new Map(e.raiseHandMap);return O.delete(D),{raiseHandMap:O}}),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantHandLowered,D))},leaveConference:async()=>{let e=useConferenceStore.getState().conference;if(e){let{error:D}=await tryCatch(e.leave(),500);D&&eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionLeft})}},endConference:async()=>{let e=useConferenceStore.getState().conference;if(e){let{error:D}=await tryCatch(e.end())}}})))),useSessionTimer=()=>{let[e,D]=(0,react.useState)(0),O=useConferenceStore(e=>e.conferenceStartedAt);return(0,react.useEffect)(()=>{let e=setInterval(()=>{if(!O){D(0);return}D(Math.max(Date.now()-O,0))},1e3);return()=>clearInterval(e)},[O]),e};function raisedHandLocal(){let e=useConferenceStore.getState().conference;if(e){let D=Date.now(),O=useParticipantStore.getState().localParticipant.pid;e?.setLocalParticipantProperty(`raisedHand`,D),useConferenceStore.getState().raiseHand(O,D)}}function lowerHandLocal(){let e=useConferenceStore.getState().conference;if(e){let D=useParticipantStore.getState().localParticipant.pid;e.setLocalParticipantProperty(`raisedHand`,0),useConferenceStore.getState().lowerHand(D)}}function toggleRaiseHand(){useConferenceStore.getState().conference?.getLocalParticipantProperty(`raisedHand`)?lowerHandLocal():raisedHandLocal()}const useIsRecording=()=>{let e=useConferenceStore(e=>e.isRecording);return!useConfigStore(e=>e.iAmRecorder)&&e},useIsStreaming=()=>{let e=useConferenceStore(e=>e.isStreaming);return!useConfigStore(e=>e.iAmRecorder)&&e};useConferenceStore.subscribe(e=>e.recording,e=>{let D=e.status,O=e.mode,k=e.error,A=e.initiator,j=!k&&A&&(D===__cometchat_calls_lib_webrtc.default.constants.recording.status.ON||D===__cometchat_calls_lib_webrtc.default.constants.recording.status.PENDING),M=__cometchat_calls_lib_webrtc.default.constants.recording.error;if(k){let e=O===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM,D=e?`streaming-failed`:`recording-failed`;k===M.UNEXPECTED_REQUEST||(k===M.RESOURCE_CONSTRAINT?e?showToast({id:D,type:`error`,message:`Streaming failed`}):(showToast({id:D,type:`error`,duration:0,message:`Recorders busy, retrying...`}),scheduleRecordingRetry()):k===M.SERVICE_UNAVAILABLE?showToast({id:D,type:`error`,message:e?`Streaming unavailable`:`Recording unavailable`}):showToast({id:D,type:`error`,message:e?`Streaming failed`:`Recording failed`}))}let N=j&&O===__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE,P=j&&O===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM;N&&(clearRecordingRetry(),useToastStore.getState().removeToast(`recording-failed`)),P&&useToastStore.getState().removeToast(`streaming-failed`),useConferenceStore.setState({isRecording:!!N,isStreaming:!!P})}),useConferenceStore.subscribe(e=>e.isRecording,e=>{let D=useConferenceStore.getState().recording.initiator?.getId?.(),O=useParticipantStore.getState().localParticipant.pid;e?(D&&D!==O?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedRecording,D):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onRecordingStarted}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.recordingStarted`)}})):(D&&D!==O?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedRecording,D):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onRecordingStopped}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.recordingStopped`)}}))});async function startRecording(){let{conference:e,isStreaming:D}=useConferenceStore.getState();if(!D&&e){let{data:D,error:O}=await tryCatch(e.startRecording({mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.FILE,appData:JSON.stringify({startedAt:Date.now()})}))}}async function stopActiveRecordingSession(){clearRecordingRetry();let{conference:e,recording:D}=useConferenceStore.getState();if(!e||!D.sessionId)return;let{error:O}=await tryCatch(e.stopRecording(D.sessionId))}async function stopRecording(){let{recording:e}=useConferenceStore.getState();e.mode!==__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM&&await stopActiveRecordingSession()}async function toggleRecording(){useConferenceStore.getState().isRecording?await stopRecording():await startRecording()}useConferenceStore.subscribe(e=>e.isStreaming,e=>{let D=useConferenceStore.getState().recording.initiator?.getId?.(),O=useParticipantStore.getState().localParticipant.pid;e?(useBaseStore.getState().clearIdealTimeoutTimer(),D&&D!==O?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedStreaming,D):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onStreamingStarted}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.streamingStarted`)}})):(useBaseStore.getState().restartIdealTimeoutTimer(),D&&D!==O?sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedStreaming,D):eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onStreamingStopped}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:translate(`notifications.streamingStopped`)}}))});async function startStreaming(e,D){let{conference:O,isRecording:k}=useConferenceStore.getState();if(k)return;let A=D?`${e.replace(/\/+$/,``)}/${D}`:e;if(O){let{error:e}=await tryCatch(O.startRecording({mode:__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM,streamId:A,appData:JSON.stringify({startedAt:Date.now()})}))}}async function stopStreaming(){let{recording:e}=useConferenceStore.getState();e.mode===__cometchat_calls_lib_webrtc.default.constants.recording.mode.STREAM&&await stopActiveRecordingSession()}const getIsConferenceJoined=()=>{let e=useConferenceStore.getState().conferenceStatus;return e===`joined`||e===`restored`};useConferenceStore.subscribe(e=>e.conferenceStatus,(e,D)=>{e===`interrupted`&&(D===`joined`||D===`restored`)?eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionLost}):D===`interrupted`&&(e===`joined`||e===`restored`)&&eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionRestored})}),useConferenceStore.subscribe(e=>e.conference,e=>{if(sendInitialConfig(),e){let D=useParticipantStore.getState().localParticipant;e.sendCommand(CONFERENCE_COMMANDS.userInfo,{value:JSON.stringify(D)})}});const initialState$4={tracks:[],permissions:{audio:!1,video:!1,initialized:!1}},useTracksStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$4,(e,D)=>({reset:()=>e({...initialState$4,permissions:D().permissions}),addTrack:D=>e(e=>{let O=D.isLocal(),k=(()=>D.getParticipantId()?D.getParticipantId():O?useParticipantStore.getState().localParticipant?.pid:D.getId())(),A={local:O,mediaType:getMediaType(D),pid:k,videoType:D.getVideoType(),muted:D.isMuted()?1:0,streamingStatus:`active`,originalTrack:D},j=e.tracks.findIndex(e=>e.pid===k&&e.mediaType===A.mediaType&&e.local===O&&e.originalTrack===D);if(j!==-1){let D=[...e.tracks];return D[j]=A,{tracks:D}}return{tracks:[A,...e.tracks]}}),removeTrack:D=>e(e=>({tracks:e.tracks.filter(e=>e.originalTrack!==D)})),updateTrack:(D,O)=>e(e=>({tracks:e.tracks.map(e=>e.originalTrack===D?{...e,mediaType:e.mediaType??getMediaType(D),videoType:e.videoType??D.getVideoType(),...O}:e)})),updateLocalTrack:(D,O)=>e(e=>{let k=e.tracks.find(e=>e.local&&e.mediaType===D);if(!k){let k=useParticipantStore.getState().localParticipant;return{tracks:[...e.tracks,{local:!0,mediaType:D,pid:k.pid,videoType:D===MEDIA_TYPE.SCREENSHARE?`desktop`:D===MEDIA_TYPE.VIDEO?`camera`:null,muted:O.muted??0,streamingStatus:`active`,...O}]}}return{tracks:e.tracks.map(e=>e===k?{...e,...O,mediaType:D,videoType:D===MEDIA_TYPE.SCREENSHARE?`desktop`:D===MEDIA_TYPE.VIDEO?`camera`:null}:e)}})})))),useTrackByParticipantId=(e,D=MEDIA_TYPE.VIDEO)=>{let O=useTracksStore(e=>e.tracks);return(0,react.useMemo)(()=>O.find(O=>O.pid===e&&O.mediaType===D),[O,e,D])},getTrackByParticipantId=(e,D=MEDIA_TYPE.VIDEO)=>useTracksStore.getState().tracks.find(O=>O.pid===e&&O.mediaType===D),useLocalTrack=(e=MEDIA_TYPE.VIDEO)=>{let D=useTracksStore(e=>e.tracks);return(0,react.useMemo)(()=>D.find(D=>D.local&&D.mediaType===e),[D,e])},getLocalTrack=(e=MEDIA_TYPE.VIDEO)=>useTracksStore.getState().tracks.find(D=>D.local&&D.mediaType===e),disposeLocalTracks=async()=>{let e=useTracksStore.getState().tracks.filter(e=>e.local),D=[];for(let{originalTrack:O}of e)O&&O.disposed!==!0&&D.push(tryCatch(O.dispose()));let O=await Promise.all(D);for(let{error:e}of O);},muteAudioTrack=()=>{useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:1})},unMuteAudioTrack=async()=>{let e=getLocalTrack(MEDIA_TYPE.AUDIO),D=useTracksStore.getState().permissions,O=useBaseStore.getState().isMobileSDK();if(!D.audio&&D.initialized&&!O){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for audio track. Please allow access to your device.`}}),eventBus.publish({type:INTERNAL_EVENTS.queryPermission});return}e?.originalTrack||(await createLocalTrack(`audio`),e=getLocalTrack(MEDIA_TYPE.AUDIO)),e?.originalTrack&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:0})},toggleAudioTrack=()=>{getLocalTrack(MEDIA_TYPE.AUDIO)?.muted?unMuteAudioTrack():muteAudioTrack()},pauseVideoTrack=(e=VIDEO_PAUSE_AUTHORITY.USER)=>{let D=(getLocalTrack(MEDIA_TYPE.VIDEO)?.muted||0)|e;useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:D})},resumeVideoTrack=async(e=VIDEO_PAUSE_AUTHORITY.USER)=>{let D=getLocalTrack(MEDIA_TYPE.VIDEO),O=useTracksStore.getState().permissions,k=useBaseStore.getState().isMobileSDK();if(!O.video&&O.initialized&&!k){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for video track. Please allow access to your device.`}}),eventBus.publish({type:INTERNAL_EVENTS.queryPermission});return}if(D?.originalTrack||(await createLocalTrack(MEDIA_TYPE.VIDEO),D=getLocalTrack(MEDIA_TYPE.VIDEO)),!D?.originalTrack)return;let A=D.muted&~e;useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:A})},toggleVideoTrack=()=>{getLocalTrack(MEDIA_TYPE.VIDEO)?.muted?resumeVideoTrack():pauseVideoTrack()};useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.muted,(e,D)=>{let O=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack;e&&O?O.mute():O&&O.unmute(),typeof e==`number`&&typeof D==`number`&&eventBus.publish({type:e?EVENT_LISTENER_METHODS.MediaEventsListener.onAudioMuted:EVENT_LISTENER_METHODS.MediaEventsListener.onAudioUnMuted})}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.muted,(e,D)=>{let O=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;e&&O?O.mute():O&&O.unmute(),typeof e==`number`&&typeof D==`number`&&eventBus.publish({type:e?EVENT_LISTENER_METHODS.MediaEventsListener.onVideoPaused:EVENT_LISTENER_METHODS.MediaEventsListener.onVideoResumed})}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&e.local)?.muted,e=>{let D=getLocalTrack(MEDIA_TYPE.SCREENSHARE)?.originalTrack;e&&D&&D.mute()}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.originalTrack,e=>{e&&(getLocalTrack(MEDIA_TYPE.AUDIO)?.muted?e.mute():e.unmute())}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.originalTrack,e=>{e&&(getLocalTrack(MEDIA_TYPE.VIDEO)?.muted?e.mute():e.unmute())}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.AUDIO&&e.local)?.originalTrack,(e,D)=>{let O=useConferenceStore.getState().conference;if(O&&(D&&e?O.replaceTrack(D,e):e?O.addTrack(e):D&&O.replaceTrack(D,null)),e){let D=e.getDeviceId();waitForStoreState(useBaseStore,e=>e.audioInputDevices.length>0).then(()=>{updateAudioInputDeviceState(useBaseStore.getState().audioInputDevices.find(e=>e.deviceId===D),!0)}).catch(()=>{updateAudioInputDeviceState(void 0,!0)})}}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.VIDEO&&e.local)?.originalTrack,(e,D)=>{let O=useConferenceStore.getState().conference;if(O&&(D&&e?O.replaceTrack(D,e):e?O.addTrack(e):D&&O.replaceTrack(D,null)),e){let D=e.getDeviceId();updateVideoInputDeviceState(useBaseStore.getState().videoInputDevices.find(e=>e.deviceId===D),!0)}}),useTracksStore.subscribe(e=>e.tracks.find(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&e.local)?.originalTrack,(e,D)=>{let O=useConferenceStore.getState().conference;O&&(D&&e?O.replaceTrack(D,e).then(()=>{D.removeAllListeners(),D.dispose()}):e&&O.addTrack(e))}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&!e.muted).length,()=>{let e=useTracksStore.getState().tracks.filter(e=>e.mediaType===MEDIA_TYPE.SCREENSHARE&&!e.muted),D=useParticipantStore.getState().virtualParticipants.filter(e=>e.type===`screen-share`),O=differenceBy(e,D,e=>e.pid);differenceBy(D,e,e=>e.pid).forEach(e=>{removeScreenShareParticipant(e.pid)}),O.forEach(e=>{e.originalTrack&&addScreenShareParticipant(e.originalTrack)})}),useTracksStore.subscribe(e=>e.permissions,(e,D)=>{let O=useConferenceStore.getState().conferenceStatus;if(!(O!==`joined`&&O!==`restored`)){if(e.audio===!1&&D.audio===!0){eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for audio track. Please allow access to your device.`}}),muteAudioTrack();let e=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack;e&&e.dispose().catch(()=>{})}e.video===!1&&D.video===!0&&(eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:`Permission denied for video track. Please allow access to your device.`}}),pauseVideoTrack())}}),useTracksStore.subscribe(e=>e.permissions.audio||e.permissions.video,e=>{e&&initDeviceList()}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.AUDIO&&!e.local).map(e=>({muted:e.muted,pid:e.pid})),(e,D)=>{D.forEach(D=>{let O=e.find(e=>e.pid===D.pid);O&&O.muted!==D.muted&&sendParticipantEvent(O.muted?EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantAudioMuted:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantAudioUnmuted,O.pid)})},{equalityFn:isArrayOfObjEqual}),useTracksStore.subscribe(e=>e.tracks.filter(e=>e.mediaType===MEDIA_TYPE.VIDEO&&!e.local).map(e=>({muted:e.muted,pid:e.pid})),(e,D)=>{D.forEach(D=>{let O=e.find(e=>e.pid===D.pid);O&&O.muted!==D.muted&&sendParticipantEvent(O.muted?EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantVideoPaused:EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantVideoResumed,O.pid)})},{equalityFn:isArrayOfObjEqual});function updateConfig(e){if(setConfig(e),e.layout&&setLayout(e.layout),typeof e.internalSettings==`string`){let D=safeParseJson(e.internalSettings);if(!D?.data)return;let O=valibot.safeParse(InternalSettingSchema,D.data);if(O.success){let e=useConfigStore.getState().displayName;useParticipantStore.getState().updateLocalParticipant({name:e||O.output.user.name,avatar:e?void 0:O.output.user.avatar,uid:O.output.user.uid}),useConfigStore.setState({sessionId:O.output.sessionId}),useConnectionStore.setState({jwt:O.output.callToken,connectionConfig:O.output.settings.connectionConfig})}}e.devSessionId&&useConfigStore.setState({sessionId:e.devSessionId}),e.initialCameraFacing&&useBaseStore.setState({cameraFacing:e.initialCameraFacing===CAMERA_FACING.REAR?CAMERA_FACING_INTERNAL.ENVIRONMENT:CAMERA_FACING_INTERNAL.USER}),e.displayName&&useParticipantStore.getState().updateLocalParticipant({name:e.displayName,avatar:void 0}),typeof e.startAudioMuted==`boolean`&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.AUDIO,{muted:e.startAudioMuted?1:0}),typeof e.startVideoPaused==`boolean`&&useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.VIDEO,{muted:e.startVideoPaused?VIDEO_PAUSE_AUTHORITY.USER:0}),typeof e.enableNoiseReduction==`boolean`&&useBaseStore.setState({enableNoiseReduction:e.enableNoiseReduction}),e.captionLanguage&&useTranscriptionStore.setState({captionLanguage:e.captionLanguage})}const initialState$3={audioModeMenuVisible:!1,audioModes:[],audioInputDevices:[],audioOutputDevices:[],videoInputDevices:[],cameraFacing:CAMERA_FACING_INTERNAL.USER,isPIPLayoutEnabled:!1,layout:LAYOUT.TILE,sidebarLayoutSetProgrammatically:!1,mainAreaDimension:{height:0,width:0},tileDimensions:{tileHeight:0,tileWidth:0},callContainerDimension:{height:0,width:0},moreMenuVisible:!1,participantListVisible:!1,subscriptions:[],connectionRetryCount:0,settingsDialogVisible:!1,settingsDialogTab:`audio`,virtualBackgroundDialogVisible:!1,idleTimeoutModalVisible:!1,mirrorLocalVideo:!0,isDesktopSharingEnabled:!1,isBlurSupported:!1,desktopSharingFrameRate:5,chatButtonUnreadCount:0,enableNoiseReduction:!0,sdkPlatform:SDK_PLATFORM.WEB,isMobileBrowser:!1,visibleParticipants:{startIndex:0,endIndex:0},sidebarVisibleParticipants:{startIndex:0,endIndex:0}},useBaseStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.persist)((0,zustand_middleware.combine)(initialState$3,(e,D)=>({addSubscriptions:e=>{useBaseStore.setState(D=>({subscriptions:[...D.subscriptions,...e]}))},reset:()=>e(e=>({...initialState$3,audioInputDevice:e.audioInputDevice,audioOutputDevice:e.audioOutputDevice,videoInputDevice:e.videoInputDevice,enableNoiseReduction:e.enableNoiseReduction,isMobileBrowser:e.isMobileBrowser})),toggleMoreMenuVisible:()=>e(e=>({moreMenuVisible:!e.moreMenuVisible})),toggleParticipantListVisible:()=>e(e=>({participantListVisible:!e.participantListVisible})),incrementConnectionRetryCount:()=>e(e=>({connectionRetryCount:e.connectionRetryCount+1})),isMobileSDK:()=>D().sdkPlatform!==`web`,isMobile:()=>{let e=D().sdkPlatform!==`web`,O=D().isMobileBrowser;return e||O},clearIdealTimeoutTimer:()=>{let O=D().idealTimeoutTimer;O&&(clearTimeout(O),e({idealTimeoutTimer:void 0,idleTimeoutModalVisible:!1}))},restartIdealTimeoutTimer:()=>{if(useBaseStore.getState().clearIdealTimeoutTimer(),useConfigStore.getState().iAmRecorder||useParticipantStore.getState().participants.length>0||!getIsConferenceJoined()||useConferenceStore.getState().isStreaming)return;let D=useConfigStore.getState().idleTimeoutPeriodBeforePrompt;e({idealTimeoutTimer:setTimeout(()=>{e({idleTimeoutModalVisible:!0})},D)})}})),{name:`base-store`,partialize:e=>({audioInputDevice:e.audioInputDevice,audioOutputDevice:e.audioOutputDevice,videoInputDevice:e.videoInputDevice,enableNoiseReduction:e.enableNoiseReduction})}))),toggleParticipantListVisible=useBaseStore.getState().toggleParticipantListVisible,hideParticipantList=()=>useBaseStore.setState({participantListVisible:!1}),showParticipantList=()=>useBaseStore.setState({participantListVisible:!0}),toggleParticipantList=()=>useBaseStore.setState(e=>({participantListVisible:!e.participantListVisible})),toggleMoreMenuVisible=useBaseStore.getState().toggleMoreMenuVisible,toggleAudioModeMenuVisible=()=>{useBaseStore.setState(e=>({audioModeMenuVisible:!e.audioModeMenuVisible}))},setLayout=(e,D=!1)=>{e!==LAYOUT.SIDEBAR&&useParticipantStore.setState({pinnedParticipant:void 0}),useBaseStore.setState({layout:e,sidebarLayoutSetProgrammatically:D})},hideAllBottomSheets=()=>{useBaseStore.setState({audioModeMenuVisible:!1,moreMenuVisible:!1})},enablePictureInPictureLayout=()=>useBaseStore.setState({isPIPLayoutEnabled:!0}),disablePictureInPictureLayout=()=>useBaseStore.setState({isPIPLayoutEnabled:!1}),showSettingsDialog=(e=`audio`)=>{useBaseStore.setState({settingsDialogVisible:!0,settingsDialogTab:e})},hideSettingsDialog=()=>{useBaseStore.setState({settingsDialogVisible:!1})},toggleSettingsDialog=()=>{useBaseStore.setState(e=>({settingsDialogVisible:!e.settingsDialogVisible}))},showVirtualBackgroundDialog=()=>{useBaseStore.setState({virtualBackgroundDialogVisible:!0,participantListVisible:!1})},hideVirtualBackgroundDialog=()=>{useBaseStore.setState({virtualBackgroundDialogVisible:!1})},toggleMirrorLocalVideo=()=>{useBaseStore.setState(e=>({mirrorLocalVideo:!e.mirrorLocalVideo}))},toggleEnableNoiseReduction=()=>{useBaseStore.setState(e=>({enableNoiseReduction:!e.enableNoiseReduction}))},setChatButtonUnreadCount=e=>{useBaseStore.setState({chatButtonUnreadCount:e})},setAudioModes=e=>{let D=useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO?e.filter(e=>e.type!==`EARPIECE`):e;useBaseStore.setState({audioModes:D.map(e=>e.uid?e:{...e,uid:e.type})})},getLayout=()=>useBaseStore.getState().layout;function initBaseStoreSubscriptions(){let e=[],D=useBaseStore.subscribe(e=>e.audioModes,e=>{if(eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModesChanged}),e.length>0){let D=e.find(e=>e.selected)??e[0];useBaseStore.setState({selectedAudioModeType:D.type})}});e.push(D);let O=useBaseStore.subscribe(e=>e.selectedAudioModeType,e=>{e&&eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModeChanged})});e.push(O);let k=useBaseStore.subscribe(e=>e.layout,e=>{eventBus.publish({payload:e,type:EVENT_LISTENER_METHODS.CallLayoutListener.onCallLayoutChanged})});e.push(k);let A=useBaseStore.subscribe(e=>e.participantListVisible,e=>{e?eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListVisible}):eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListHidden})});e.push(A);let j=useBaseStore.subscribe(e=>e.isPIPLayoutEnabled,e=>{e?eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutEnabled}):eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutDisabled})});e.push(j);let M=useBaseStore.subscribe(e=>e.cameraFacing,e=>{eventBus.publish({payload:e===CAMERA_FACING_INTERNAL.USER?CAMERA_FACING.FRONT:CAMERA_FACING.REAR,type:EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onCameraFacingChanged});let D=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;D&&D.getCameraFacingMode()!==e&&(useBaseStore.getState().isMobileBrowser?updateVideoInputDevice(null,e):D._switchCamera())});e.push(M);let N=useBaseStore.subscribe(e=>e.audioInputDevices,e=>{if(e.length>0){let D=useBaseStore.getState().audioInputDevice;D?e.some(e=>e.deviceId===D.deviceId&&e.label===D.label)||updateAudioInputDeviceState(getDefaultDevice(e)):updateAudioInputDeviceState(getDefaultDevice(e),!0)}});e.push(N);let P=useBaseStore.subscribe(e=>e.audioOutputDevices,e=>{if(e.length>0){let D=useBaseStore.getState().audioOutputDevice;D&&e.some(e=>e.deviceId===D.deviceId&&e.label===D.label)||useBaseStore.setState({audioOutputDevice:getDefaultDevice(e)})}});e.push(P);let F=useBaseStore.subscribe(e=>e.videoInputDevices,e=>{if(e.length>0){let D=useBaseStore.getState().videoInputDevice;D?e.some(e=>e.deviceId===D.deviceId&&e.label===D.label)||updateVideoInputDeviceState(getDefaultDevice(e)):updateVideoInputDeviceState(getDefaultDevice(e),!0)}});e.push(F),useBaseStore.subscribe(e=>e.previewVideoTrack,(e,D)=>{D&&D.disposed!==!0&&D.dispose()}),useBaseStore.getState().addSubscriptions(e)}initBaseStoreSubscriptions();const CONNECTION_TIMEOUT_MS=1e4,initialState$2={connection:void 0,connectionStatus:`initial`,error:void 0,timeEstablished:void 0},useConnectionStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)((0,zustand_middleware.combine)(initialState$2,e=>({connectionEstablished:D=>e({connection:D,connectionStatus:`connected`,error:void 0,timeEstablished:Date.now()}),connectionFailed:D=>e({connectionStatus:`error`,error:D,timeEstablished:void 0}),connectionWillConnect:D=>{window?.APP!==void 0&&(window.APP.connection=D),useConfigStore.getState().iAmRecorder&&D.addFeature(`http://jitsi.org/protocol/jibri`),e({connection:D,connectionStatus:`connecting`,error:void 0,timeEstablished:void 0})},disconnect:async()=>{let D=useConnectionStore.getState().connection,O=useConnectionStore.getState().connectionStatus;D&&O!==`disconnecting`&&(e({connectionStatus:`disconnecting`}),eventBus.publish({type:INTERNAL_EVENTS.connectionWillClose}),eventBus.stopEmitting(),await tryCatch(D.disconnect()),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed},!0),e(initialState$2))},reset:()=>e(initialState$2)}))));function waitForConnection(){let{connectionStatus:e}=useConnectionStore.getState();return e===`connected`?Promise.resolve():new Promise((e,D)=>{let O=setTimeout(()=>{k(),D(Error(`Connection timed out after ${CONNECTION_TIMEOUT_MS/1e3} seconds`))},CONNECTION_TIMEOUT_MS),k=useConnectionStore.subscribe(e=>e.connectionStatus,A=>{A===`connected`?(clearTimeout(O),k(),e()):A===`error`&&(clearTimeout(O),k(),D(useConnectionStore.getState().error))})})}const TRANSCRIBER_DIAL_NUMBER=`jitsi_meet_transcribe`,initialState$1={transcriptionsMessages:new Map,showLiveCaption:!1,isTranscribing:!1,transcriberJoined:!1,captionLanguage:CAPTION_LANGUAGES[0].code},useTranscriptionStore=(0,zustand.create)()((0,zustand_middleware.subscribeWithSelector)(e=>({...initialState$1,setTranscriptionMessage:(D,O)=>{e(e=>{let k=new Map(e.transcriptionsMessages);if(k.set(D,O),k.size>10){let e=k.keys().next().value;k.delete(e)}return{transcriptionsMessages:k}})},clearTranscriptionMessages:()=>{e({transcriptionsMessages:new Map})},toggleShowLiveCaption:()=>{e(e=>({showLiveCaption:!e.showLiveCaption}))},reset:()=>{e({...initialState$1,transcriptionsMessages:new Map})}})));function useTranscriptionMessages(){let e=useTranscriptionStore(e=>e.transcriptionsMessages);return(0,react.useMemo)(()=>Array.from(e.values()),[e])}function useShowLiveCaption(){let e=useTranscriptionStore(e=>e.transcriberJoined),D=useTranscriptionStore(e=>e.showLiveCaption);return e&&D}function toggleShowLiveCaption(){useTranscriptionStore.getState().toggleShowLiveCaption()}const useIsTranscribing=()=>useTranscriptionStore(e=>e.isTranscribing);useTranscriptionStore.subscribe(e=>e.isTranscribing,e=>{let D=useConferenceStore.getState().conference,O=useTranscriptionStore.getState().captionLanguage;D?.setLocalParticipantProperty(`transcription_language`,O),D?.setLocalParticipantProperty(`requestingTranscription`,e)}),useTranscriptionStore.subscribe(e=>e.captionLanguage,e=>{useConferenceStore.getState().conference?.setLocalParticipantProperty(`transcription_language`,e)});async function startTranscription(){useTranscriptionStore.setState({isTranscribing:!0});let e=useConferenceStore.getState().conference,D=useTranscriptionStore.getState().transcriberJoined;if(e&&!D)try{await e.dial(`jitsi_meet_transcribe`)}catch{useTranscriptionStore.setState({isTranscribing:!1})}}async function stopTranscription(){useTranscriptionStore.setState({isTranscribing:!1}),useTranscriptionStore.getState().clearTranscriptionMessages()}async function toggleTranscription(){useTranscriptionStore.getState().isTranscribing?await stopTranscription():await startTranscription()}const useHideMuteAudioButton=()=>{let e=useConfigStore(e=>e.hideToggleAudioButton),D=useConfigStore(e=>e.enableCompanionMode);return e||D},useHideToggleVideoButton=()=>{let e=useConfigStore(e=>e.hideToggleVideoButton),D=useConfigStore(e=>e.sessionType);return e||D!==SESSION_TYPE.VIDEO},useIsConferenceJoined=()=>{let e=useConferenceStore(e=>e.conferenceStatus);return e===`joined`||e===`restored`},useHideScreenSharingButton=()=>{let e=useConfigStore(e=>e.hideScreenSharingButton),D=useBaseStore(e=>e.sdkPlatform===`android`),O=useBaseStore(e=>e.isDesktopSharingEnabled),k=useIsConferenceJoined(),A=useBaseStore.getState().isMobileSDK();return e||A||!k||(D?!1:!O)},useHideSwitchCameraButton=()=>{let e=getLocalTrack(MEDIA_TYPE.VIDEO);return useConfigStore(e=>e.hideSwitchCameraButton)||!e?.originalTrack},useHideChatButton=()=>useConfigStore(e=>e.hideChatButton),useHideClosedCaptionButton=()=>{let e=useConfigStore(e=>e.hideClosedCaptionButton),D=useTranscriptionStore(e=>e.transcriberJoined);return e||!D},useHideTranscriptionButton=()=>{let e=useConfigStore(e=>e.hideTranscriptionButton),D=useTranscriptionStore(e=>e.transcriberJoined),O=useTranscriptionStore(e=>e.isTranscribing);return e||D&&!O},useLocalParticipant=e=>useParticipantStore(D=>e?e(D.localParticipant):D.localParticipant),useScreenShareRunning=()=>{let e=useLocalTrack(MEDIA_TYPE.SCREENSHARE);return e?.originalTrack&&!e.muted},useTrackMuted=(e,D)=>{let O=useLocalParticipant(),k=useTrackByParticipantId(D??O.pid,e);return e===MEDIA_TYPE.VIDEO&&k?.streamingStatus!==`active`?!0:k?!!k.muted:!0},useMainParticipant=()=>getMainParticipantFromState({pinnedParticipant:useParticipantStore(e=>e.pinnedParticipant),participants:useParticipantStore(e=>e.participants),virtualParticipants:useParticipantStore(e=>e.virtualParticipants),dominantSpeakers:useParticipantStore(e=>e.dominantSpeakers),localParticipant:useLocalParticipant()}),getMainParticipant=()=>{let e=useParticipantStore.getState();return getMainParticipantFromState({pinnedParticipant:e.pinnedParticipant,participants:e.participants,virtualParticipants:e.virtualParticipants,dominantSpeakers:e.dominantSpeakers,localParticipant:e.localParticipant})},useIsReconnecting=()=>{let e=useConnectionStore(e=>e.connectionStatus),D=useConferenceStore(e=>e.conferenceStatus),O=useConferenceStore(e=>e.p2p),[k,A]=(0,react.useState)(!0);(0,react.useEffect)(()=>{if(typeof window>`u`)return;let e=new AbortController,{signal:D}=e;return window.addEventListener(`online`,()=>A(!0),{signal:D}),window.addEventListener(`offline`,()=>A(!1),{signal:D}),()=>e.abort()},[]);let j=e===`connected`&&D===`interrupted`;return O&&j&&k?!1:j},useHideRecordingButton=()=>{let e=useConfigStore(e=>e.hideRecordingButton),D=useConferenceStore(e=>e.isStreaming),O=useIsConferenceJoined(),k=useLocalParticipant();return D||e||!O||k.role!==`moderator`},useHideStreamingButton=()=>{let e=useConfigStore(e=>e.hideStreamingButton),D=useConferenceStore(e=>e.isRecording),O=useIsConferenceJoined(),k=useLocalParticipant();return D||e||!O||k.role!==`moderator`},useHideVirtualBackgroundButton=()=>{let e=useConfigStore(e=>e.hideVirtualBackgroundButton),D=getLocalTrack(MEDIA_TYPE.VIDEO),O=useBaseStore(e=>e.isBlurSupported);return e||!D?.originalTrack||!O},useLayout=()=>useBaseStore(e=>e.layout),useEnableParticipantContextMenu=()=>{let e=useConfigStore(e=>e.enableParticipantContextMenu),D=useBaseStore(e=>e.isPIPLayoutEnabled);return useLayout()===LAYOUT.SPOTLIGHT||D?!1:e},useRaisedHandTimestamp=(e,D=`human`)=>{let O=useLocalParticipant(),k=useConferenceStore(D=>D.raiseHandMap.get(e??O.pid));return D===`human`?k:void 0},useIsParticipantPinned=(e,D)=>{let O=useParticipantStore(e=>e.pinnedParticipant);return!!(O&&O.pid===e&&O.type===D)},useOrderedParticipants=()=>{let e=useAllParticipants(),D=useConferenceStore(e=>e.raiseHandMap);return e.sort((e,O)=>{let k=D.get(e.pid),A=D.get(O.pid);return k&&!A?-1:!k&&A?1:e.name.localeCompare(O.name)})},useNonRecoverableError=()=>{let e=useConferenceStore(e=>e.conferenceError),D=useConnectionStore(e=>e.error);if(e)return e;if(D)return D.message||D.name},useIsSwitchCameraEnabledBrowser=()=>{let e=useBaseStore(e=>e.isMobileBrowser),D=getLocalTrack(MEDIA_TYPE.VIDEO);return e&&D?.originalTrack},useIsAudioInputSelectionSupported=()=>{let e=useTracksStore(e=>e.permissions.audio),D=useBaseStore(e=>e.audioInputDevices);return e&&D.length>0},useIsVideoInputSelectionSupported=()=>{let e=useTracksStore(e=>e.permissions.video),D=useBaseStore(e=>e.videoInputDevices);return e&&D.length>0},useShouldMirrorLocalVideo=()=>{let e=useBaseStore(e=>e.mirrorLocalVideo);return useBaseStore(e=>e.cameraFacing)===`user`&&e};function resetAllStores(){useBaseStore.getState().reset(),useConferenceStore.getState().reset(),useConfigStore.getState().reset(),useConnectionStore.getState().reset(),useParticipantStore.getState().reset(),useToastStore.getState().reset(),useTracksStore.getState().reset(),useTranscriptionStore.getState().reset()}const switchCamera=()=>{useBaseStore.setState(e=>({cameraFacing:e.cameraFacing===CAMERA_FACING_INTERNAL.USER?CAMERA_FACING_INTERNAL.ENVIRONMENT:CAMERA_FACING_INTERNAL.USER}))};function getNearestVideoQualityLevel(e){return e<=VIDEO_QUALITY_LEVELS.LOW?VIDEO_QUALITY_LEVELS.LOW:e<=VIDEO_QUALITY_LEVELS.STANDARD?VIDEO_QUALITY_LEVELS.STANDARD:VIDEO_QUALITY_LEVELS.HIGH}let backgroundOverrideSent=!1;function getSystemPiPSource(){if(!useConfigStore.getState().enableIOSPictureInPicture)return;let e=getMainParticipant(),D=getTrackByParticipantId(e.pid,getParticipantMediaType(e));if(!(!D||D.local))return D.originalTrack?.getSourceName?.()}function setReceiverConstraintsInternal(){let{sessionType:e,unstable_headlessMode:D}=useConfigStore.getState();if(D&&e===SESSION_TYPE.VOICE){useConferenceStore.getState().conference?.setReceiverConstraints({lastN:0});return}let{appState:O,isPIPLayoutEnabled:k}=useBaseStore.getState();if(O===`background`&&!k){let e=useConferenceStore.getState().conference;if(e){let D=useConfigStore.getState().enableIOSPictureInPicture,O=getSystemPiPSource();e.setReceiverConstraints({lastN:D?1:0,onStageSources:O?[O]:[]}),backgroundOverrideSent=!0}return}if(useBaseStore.getState().isMobileSDK()){backgroundOverrideSent&&=(useConferenceStore.getState().conference?.setReceiverConstraints({lastN:-1,onStageSources:[]}),!1);return}let A={constraints:{},defaultConstraints:{maxHeight:VIDEO_QUALITY_LEVELS.NONE},lastN:-1,onStageSources:[],selectedSources:[]},j=getLayout();if(j===`SPOTLIGHT`){let e=getMainParticipant().sources?.get(`video`);e&&Array.from(e.keys()).forEach(e=>{A.constraints[e]={maxHeight:720},A.onStageSources.push(e)})}else if(j===`TILE`){let e=getNearestVideoQualityLevel(useBaseStore.getState().tileDimensions.tileHeight),D=useBaseStore.getState().visibleParticipants;getAllParticipants().slice(D.startIndex,D.endIndex+1).forEach(D=>{let O=D.isLocal,k=D.sources?.get(`video`);!O&&k&&Array.from(k.keys()).forEach(D=>{A.constraints[D]={maxHeight:e}})})}else if(j===`SIDEBAR`){let{startIndex:e,endIndex:D}=useBaseStore.getState().sidebarVisibleParticipants;getAllParticipants().slice(e,D).forEach(e=>{let D=e.sources?.get(`video`);D&&Array.from(D.keys()).forEach(e=>{A.constraints[e]={maxHeight:180}})});let O=getMainParticipant().sources?.get(`video`);O&&Array.from(O.keys()).forEach(e=>{A.constraints[e]={maxHeight:720},A.onStageSources.push(e)})}let M=useConferenceStore.getState().conference;M&&(Object.keys(A.constraints).length>0||backgroundOverrideSent)&&(M.setReceiverConstraints(A),backgroundOverrideSent=!1)}const setReceiverConstraints=debounce(setReceiverConstraintsInternal,200);useBaseStore.subscribe(e=>e.visibleParticipants,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.sidebarVisibleParticipants,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.layout,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.appState,()=>{setReceiverConstraints()}),useBaseStore.subscribe(e=>e.isPIPLayoutEnabled,()=>{setReceiverConstraints()}),useTracksStore.subscribe(()=>useBaseStore.getState().appState===`background`?getSystemPiPSource():void 0,()=>{setReceiverConstraints()}),useParticipantStore.subscribe(e=>getMainParticipantFromState(e).ruid,()=>{let{appState:e,layout:D}=useBaseStore.getState();(e===`background`||D===`SPOTLIGHT`||D===`SIDEBAR`)&&setReceiverConstraints()});const REMOTE_STATS_STALE_THRESHOLD_MS=1e4,STALENESS_CHECK_INTERVAL_MS=4e3,REMOTE_STATS_SEED_BUFFER_MS=4e3;let stalenessCheckInterval=null,remoteConnectionLost=!1;function setRemoteStatsTimestamps(e){useConferenceStore.setState(D=>{let O=new Map(D.remoteStatsTimestamps);return e(O),{remoteStatsTimestamps:O}})}function seedRemoteStatsTimestamp(e){setRemoteStatsTimestamps(D=>D.set(e,Date.now()+REMOTE_STATS_SEED_BUFFER_MS))}function removeRemoteStatsTimestamp(e){setRemoteStatsTimestamps(D=>D.delete(e))}function reseedRemoteStatsTimestamps(){let e=Date.now()+REMOTE_STATS_SEED_BUFFER_MS;setRemoteStatsTimestamps(D=>{for(let O of D.keys())D.set(O,e)})}function isLocallyHealthy(){let e=useConferenceStore.getState().conferenceStatus;return e===`joined`||e===`restored`}function isRemotePeerStale(){if(!useConfigStore.getState().isPeerCall)return!1;let e=useParticipantStore.getState().participants;if(e.length===0)return!1;let D=useConferenceStore.getState().remoteStatsTimestamps,O=Date.now();return e.some(e=>O-(D.get(e.pid)??0)>=1e4)}function checkRemotePeerStale(){remoteConnectionLost||!isLocallyHealthy()||isRemotePeerStale()&&(remoteConnectionLost=!0,eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onRemoteConnectionLost}))}function recordRemoteStatsTimestamp(e){setRemoteStatsTimestamps(D=>D.set(e,Date.now())),!(!remoteConnectionLost||!isLocallyHealthy())&&(isRemotePeerStale()||(remoteConnectionLost=!1,eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onRemoteConnectionRestored})))}function startRemoteStatsWatchdog(){!useConfigStore.getState().isPeerCall||stalenessCheckInterval||(stalenessCheckInterval=setInterval(checkRemotePeerStale,4e3))}function stopRemoteStatsWatchdog(){stalenessCheckInterval&&=(clearInterval(stalenessCheckInterval),null),remoteConnectionLost=!1}const AUDIO_LEVEL_THRESHOLD_TO_LOWER_HAND=.2,TRANSCRIBER_DISPLAY_NAME=`Transcriber`,TRANSCRIBER_FEATURE=`http://jitsi.org/protocol/transcriber`;async function isTranscriber(e){return e.getDisplayName()===`Transcriber`?(await e.getFeatures()).has(`http://jitsi.org/protocol/transcriber`):!1}let holdRestoredUntilRemoteStats=!1;var ConferenceListener=class{onConferenceJoined(){useConferenceStore.setState({conferenceJoined:!0,conferenceStatus:`joined`,conferenceJoinedAt:Date.now()}),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionJoined}),eventBus.publish({type:INTERNAL_EVENTS.onSessionJoined}),useConfigStore.getState().autoStartTranscription&&setTimeout(()=>{startTranscription()},100)}async onConferenceLeft(){holdRestoredUntilRemoteStats=!1,stopRemoteStatsWatchdog(),useConferenceStore.setState({conferenceJoined:!1,conferenceStatus:`left`}),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onSessionLeft}),await useConnectionStore.getState().disconnect()}onTrackAdded(e){e.isLocal()||onTrack(e)}async onUserJoined(e,D){let O=D.getId(),k=D.getDisplayName(),A=D.getRole();if(await isTranscriber(D)){useTranscriptionStore.setState({transcriberJoined:!0});return}D.isHidden()||(eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${k} has joined the conference`}}),useParticipantStore.getState().addParticipant({name:k??`Unknown`,pid:O,ruid:`${O}-human`,role:A,isLocal:!1,sources:D.getSources(),type:`human`}),seedRemoteStatsTimestamp(O),startRemoteStatsWatchdog())}async onUserLeft(e,D){if(await isTranscriber(D)){useTranscriptionStore.setState({transcriberJoined:!1});return}if(D.isHidden())return;let O=D.getId();eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${D.getDisplayName()} has left the conference`}}),useParticipantStore.getState().removeParticipant(O),removeRemoteStatsTimestamp(O),useConfigStore.getState().isPeerCall&&useParticipantStore.getState().participants.length===0&&(stopRemoteStatsWatchdog(),leaveSession())}onTrackRemoved(e){if(e.isLocal()){let D=getMediaType(e);getLocalTrack(D)?.originalTrack===e&&useTracksStore.getState().updateLocalTrack(D,{originalTrack:void 0})}else useTracksStore.getState().removeTrack(e);e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.NO_DATA_FROM_SOURCE),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED)}onConferenceJoinInProgress(){}onConferenceFailed(e,D,O){if(stopRemoteStatsWatchdog(),e===__cometchat_calls_lib_webrtc.default.errors.conference.CONFERENCE_DESTROYED){leaveSession({forceLeave:!0});return}useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:O?.toString()||`Unknown error`})}onRecorderStateChanged(e){if(e){let D=e.getID(),O=e.getError(),k=e.getMode(),A=e.getStatus();if(O===`unexpected-request`)return;if(D){let j=e.getInitiator();if(useConferenceStore.setState({recording:{status:A,mode:k,error:O,sessionId:D,initiator:j}}),j){let e=typeof j==`string`?j:j.getId(),O=useConferenceStore.getState().conference,k=useParticipantStore.getState().localParticipant;if(k.pid!==e)return;O.sendCommandOnce(A===`off`?`stopScreenRecording`:`START_SCREEN_RECORDING`,{attributes:{recordId:D,...k,id:e}})}}else O&&useConferenceStore.setState({recording:{status:A,mode:k,error:O}})}}onConnectionEstablished(){holdRestoredUntilRemoteStats=!1,reseedRemoteStatsTimestamps(),useConferenceStore.setState({conferenceStatus:`joined`}),setTimeout(setReceiverConstraints,500)}onConnectionInterrupted(){holdRestoredUntilRemoteStats=!1,useConferenceStore.setState({conferenceStatus:`interrupted`})}onConnectionRestored(){if(useConfigStore.getState().isPeerCall&&useParticipantStore.getState().participants.length===1){holdRestoredUntilRemoteStats=!0;return}useConferenceStore.setState({conferenceStatus:`restored`})}onP2PStatus(e,D){useConferenceStore.setState({p2p:D})}onTrackMuteChanged(e,D){if(e.isLocal()&&D){useTracksStore.getState().updateLocalTrack(getMediaType(e),{muted:e.isMuted()?1:0});let O=D.getDisplayName();O&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`${O} has muted you.`}})}}onParticipantSourceUpdated(e){setReceiverConstraints()}onConferenceCreatedTimestamp(e){useConferenceStore.setState({conferenceStartedAt:e})}onDominantSpeakerChanged(e,D,O){useParticipantStore.setState({dominantSpeakers:[e,...D??[]]}),sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onDominantSpeakerChanged,e),e===useParticipantStore.getState().localParticipant.pid&&lowerHandLocal()}onLocalStatsUpdated(e){let D=useParticipantStore.getState().localParticipant;e.connectionQuality&&useConferenceStore.setState(O=>{let k=new Map(O.connectionQuality);return k.set(D.pid,e.connectionQuality),{connectionQuality:k}})}onRemoteStatsUpdated(e,D){holdRestoredUntilRemoteStats&&(holdRestoredUntilRemoteStats=!1,useConferenceStore.setState({conferenceStatus:`restored`})),recordRemoteStatsTimestamp(e),D.connectionQuality&&useConferenceStore.setState(O=>{let k=new Map(O.connectionQuality);return k.set(e,D.connectionQuality),{connectionQuality:k}})}onParticipantPropertyChanged(e,D,O,k){let A=e.getId();A&&D===`raisedHand`&&(k?useConferenceStore.getState().raiseHand(A,parseInt(k,10)):useConferenceStore.getState().lowerHand(A))}onUserRoleChanged(e,D){if(typeof e==`string`&&(D===PARTICIPANT_ROLE.MODERATOR||D===PARTICIPANT_ROLE.NONE)){useParticipantStore.getState().updateParticipant(e,{role:D});let O=useParticipantStore.getState().localParticipant.pid;D===PARTICIPANT_ROLE.MODERATOR&&e===O&&useConfigStore.getState().autoStartRecording&&setTimeout(()=>{startRecording()},100)}}onTrackUnmuteRejected(e){if(!e.isLocal())return;let D=getMediaType(e);e.dispose().catch(()=>{}),useTracksStore.getState().updateLocalTrack(D,{originalTrack:void 0,muted:1}),eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`info`,message:`Your ${D} unmute was rejected.`}})}onTalkWhileMuted(){}onEndpointMessageReceived(e,D){if(D?.type===`transcription-result`&&Array.isArray(D?.transcript)&&D.transcript.length>0){let e=D.transcript.map(e=>e?.text??``).join(` `).trim(),O=D.message_id;if(e&&O){let e=useParticipantStore.getState().getParticipantById(D.participant?.id),k={...D,participant:{...D.participant,avatar_url:e?.avatar}};useTranscriptionStore.getState().setTranscriptionMessage(O,k)}}}onConferenceError(e){e instanceof Error?useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.message}):useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.toString()})}onTrackAudioLevelChanged(e,D){let O=useParticipantStore.getState().localParticipant;e!==O.pid||getLocalTrack(MEDIA_TYPE.AUDIO)?.muted||useConferenceStore.getState().raiseHandMap.has(O.pid)&&D>.2&&lowerHandLocal()}};const conferenceListener=new ConferenceListener,HumanParticipantSchema=valibot.object({name:valibot.string(),pid:valibot.string(),ruid:valibot.string(),role:valibot.picklist(Object.values(PARTICIPANT_ROLE)),uid:valibot.optional(valibot.string()),avatar:valibot.optional(valibot.string()),isLocal:valibot.boolean(),sources:valibot.optional(valibot.map(valibot.union([valibot.literal(`video`),valibot.literal(`audio`)]),valibot.map(valibot.string(),valibot.any()))),type:valibot.literal(`human`)}),UserInfoCommandSchema=valibot.pick(HumanParticipantSchema,[`avatar`,`uid`]),PEER_CALL_PC_STATS_INTERVAL_MS=4e3;function initializeLib(e){__cometchat_calls_lib_webrtc.default.init(e),__cometchat_calls_lib_webrtc.default.setLogLevel(__cometchat_calls_lib_webrtc.default.logLevels.ERROR)}function addConferenceListeners(e){e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_JOINED,conferenceListener.onUserJoined),e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_LEFT,conferenceListener.onUserLeft),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_ADDED,conferenceListener.onTrackAdded),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_REMOVED,conferenceListener.onTrackRemoved),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_JOIN_IN_PROGRESS,conferenceListener.onConferenceJoinInProgress),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_FAILED,conferenceListener.onConferenceFailed),e.on(__cometchat_calls_lib_webrtc.default.events.conference.RECORDER_STATE_CHANGED,conferenceListener.onRecorderStateChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_ESTABLISHED,conferenceListener.onConnectionEstablished),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_INTERRUPTED,conferenceListener.onConnectionInterrupted),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONNECTION_RESTORED,conferenceListener.onConnectionRestored),e.on(__cometchat_calls_lib_webrtc.default.events.conference.P2P_STATUS,conferenceListener.onP2PStatus),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_MUTE_CHANGED,conferenceListener.onTrackMuteChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_JOINED,conferenceListener.onConferenceJoined),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_LEFT,conferenceListener.onConferenceLeft),e.on(__cometchat_calls_lib_webrtc.default.events.conference.PARTICIPANT_SOURCE_UPDATED,conferenceListener.onParticipantSourceUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.conference.CONFERENCE_CREATED_TIMESTAMP,conferenceListener.onConferenceCreatedTimestamp),e.on(__cometchat_calls_lib_webrtc.default.events.conference.DOMINANT_SPEAKER_CHANGED,conferenceListener.onDominantSpeakerChanged),e.on(__cometchat_calls_lib_webrtc.default.events.connectionQuality.LOCAL_STATS_UPDATED,conferenceListener.onLocalStatsUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.connectionQuality.REMOTE_STATS_UPDATED,conferenceListener.onRemoteStatsUpdated),e.on(__cometchat_calls_lib_webrtc.default.events.conference.PARTICIPANT_PROPERTY_CHANGED,conferenceListener.onParticipantPropertyChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.USER_ROLE_CHANGED,conferenceListener.onUserRoleChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TALK_WHILE_MUTED,conferenceListener.onTalkWhileMuted),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_UNMUTE_REJECTED,conferenceListener.onTrackUnmuteRejected),e.on(__cometchat_calls_lib_webrtc.default.events.conference.TRACK_AUDIO_LEVEL_CHANGED,conferenceListener.onTrackAudioLevelChanged),e.on(__cometchat_calls_lib_webrtc.default.events.conference.ENDPOINT_MESSAGE_RECEIVED,conferenceListener.onEndpointMessageReceived),e.addCommandListener(CONFERENCE_COMMANDS.userInfo,(e,D)=>{let O=valibot.safeParse(UserInfoCommandSchema,safeParseJson(e.value));O.success&&useParticipantStore.getState().updateParticipant(D,{avatar:O.output.avatar,uid:O.output.uid})})}async function _createConference(){let e=useConfigStore.getState().sessionId,D=useConnectionStore.getState().connection;if(!D)throw Error(`No connection available`);if(useConnectionStore.getState().connectionStatus!==`connected`&&await waitForConnection(),useConferenceStore.getState().conference)return;let O=useConnectionStore.getState().connectionConfig;O&&useConfigStore.getState().isPeerCall&&(O.pcStatsInterval=PEER_CALL_PC_STATS_INTERVAL_MS);let k=D.initJitsiConference(e,O),A=getLocalTrack(MEDIA_TYPE.AUDIO)?.originalTrack,j=getLocalTrack(MEDIA_TYPE.VIDEO)?.originalTrack;A&&k.addTrack(A),j&&k.addTrack(j),useParticipantStore.getState().updateLocalParticipant({pid:k.myUserId()}),addConferenceListeners(k),useConferenceStore.getState().conferenceWillJoin(k),k.setDisplayName(useParticipantStore.getState().localParticipant.name),k.join()}async function createConference(){if(!useConferenceStore.getState().conference){let e=await tryCatch(_createConference());e.error&&useConferenceStore.setState({conferenceStatus:`error`,conferenceJoined:!1,conferenceError:e.error.message})}}function muteParticipant(e){useConferenceStore.getState().conference?.muteParticipant(e,`audio`)}function pauseParticipantVideo(e){useConferenceStore.getState().conference?.muteParticipant(e,`video`)}var Mutex=class{lock=Promise.resolve();async run(e){let D,O=new Promise(e=>{D=e}),k=this.lock;this.lock=k.then(()=>O),await k;try{return await e()}finally{D()}}};function runOnce(e){let D=!1,O;return function(...k){return D||(D=!0,O=e.apply(this,k)),O}}function areDevicesDifferent(e=[],D=[]){if(e.length!==D.length)return!0;for(let O of e)if(!D.find(({deviceId:e,groupId:D,kind:k,label:A})=>O.deviceId===e&&O.groupId===D&&O.kind===k&&O.label===A))return!0;return!1}function isLabelEmpty(){let e=useBaseStore.getState().audioInputDevices,D=useBaseStore.getState().videoInputDevices,O=[...e,...D],k=useConfigStore.getState().sessionType;return!!O.filter(e=>e.kind===`audioinput`||k===`VIDEO`).some(e=>e.label===``)}function updateInputOutputDevices(e=!1){if(e&&isLabelEmpty())return;let{mediaDevices:D}=__cometchat_calls_lib_webrtc.default;D.isDeviceChangeAvailable()&&D.enumerateDevices(e=>{let D=e.filter(e=>e.kind===`audioinput`&&e.deviceId!==``),O=e.filter(e=>e.kind===`audiooutput`&&e.deviceId!==``),k=e.filter(e=>e.kind===`videoinput`&&e.deviceId!==``);useBaseStore.setState({audioInputDevices:D,audioOutputDevices:O,videoInputDevices:k})})}function _initDeviceList(){let{mediaDevices:e}=__cometchat_calls_lib_webrtc.default;e.addEventListener(__cometchat_calls_lib_webrtc.default.events.mediaDevices.DEVICE_LIST_CHANGED,e=>{let D=useBaseStore.getState().audioInputDevices,O=useBaseStore.getState().audioOutputDevices,k=useBaseStore.getState().videoInputDevices,A=D.concat(O,k);setTimeout(()=>{areDevicesDifferent(A,e)&&updateInputOutputDevices()},0)}),updateInputOutputDevices()}const initDeviceList=runOnce(_initDeviceList);let isSessionStarted=!1,reconnectTimeoutId=null;const RECONNECT_DEBOUNCE_DELAY=3e3;initializeLib();function startSession(){if(!useConfigStore.getState().sessionId||isSessionStarted)return;initializeLib(useConfigStore.getState().isPeerCall?{pcStatsInterval:PEER_CALL_PC_STATS_INTERVAL_MS}:void 0),isSessionStarted=!0,createLocalTracks();let e=useConfigStore.getState().audioOutputDeviceId??useBaseStore.getState().audioOutputDevice?.deviceId;e&&updateAudioOutputDevice(e),eventBus.startEmitting();let D=tryCatchSync(()=>connect());if(D.error){useConnectionStore.getState().connectionFailed({name:`connection.otherError`,message:D.error.message});return}initDeviceList()}async function _leaveSession(){isSessionStarted!==!1&&(isSessionStarted=!1,await Promise.all([disposeLocalTracks(),useConferenceStore.getState().leaveConference()]),await useConnectionStore.getState().disconnect())}const sessionMutex=new Mutex;function leaveSession(e={}){return sessionMutex.run(async()=>{let D=useConfigStore.getState().isPeerCall;if(e.shouldEndSession||D&&!e.forceLeave){useConferenceStore.getState().endConference();return}useBaseStore.getState().clearIdealTimeoutTimer(),cancelPendingReconnect(),await _leaveSession(),resetAllStores()})}async function leaveSessionDueToIdleTimeout(){eventBus.publish({type:`onSessionTimedOut`}),await leaveSession()}async function reconnectSession(){return reconnectTimeoutId&&=(clearTimeout(reconnectTimeoutId),null),new Promise((e,D)=>{reconnectTimeoutId=setTimeout(async()=>{try{await _reconnectSession(),e()}catch(e){D(e)}finally{reconnectTimeoutId=null}},3e3)})}function cancelPendingReconnect(){reconnectTimeoutId&&=(clearTimeout(reconnectTimeoutId),null)}async function _reconnectSession(){if(useBaseStore.getState().connectionRetryCount>=3&&isSessionStarted===!0){await leaveSession();return}useBaseStore.getState().incrementConnectionRetryCount(),await _leaveSession(),useConnectionStore.getState().reset(),useConferenceStore.getState().reset(),useTracksStore.getState().reset(),startSession()}async function connect(e=!0){if(useConnectionStore.getState().connection){createConference();return}let D=useConnectionStore.getState().connectionConfig,O=useConnectionStore.getState().jwt,k=useConfigStore.getState().iAmRecorder;D&&k&&(D.p2p={enabled:!1});let A=new __cometchat_calls_lib_webrtc.default.JitsiConnection(null,O,D);useConnectionStore.getState().connectionWillConnect(A),A.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_ESTABLISHED,j),A.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_FAILED,M),A.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_DISCONNECTED,N),A.addEventListener(__cometchat_calls_lib_webrtc.default.events.connection.PROPERTIES_UPDATED,P);async function j(){A.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_ESTABLISHED,j),useConnectionStore.getState().connectionEstablished(A),eventBus.publish({type:INTERNAL_EVENTS.onConnectionEstablished}),e&&createConference()}function M(e,D,...O){F();let k={name:e,message:D,details:O[1],recoverable:!isFatalConnectionError({name:e})};useConnectionStore.getState().connectionFailed(k),eventBus.publish({type:EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionFailed,payload:k}),isFatalConnectionError(k)?leaveSession():reconnectSession()}function N(){}function P(e){}function F(){A.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.PROPERTIES_UPDATED,P),A.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_FAILED,M),A.removeEventListener(__cometchat_calls_lib_webrtc.default.events.connection.CONNECTION_DISCONNECTED,N)}let I=localStorage.getItem(`xmpp_username_override`),L=localStorage.getItem(`xmpp_password_override`);I&&L?(A.addFeature(`http://jitsi.org/protocol/jibri`),A.connect({id:I,password:L})):A.connect()}function startScreenSharing(){let e=useBaseStore.getState().desktopSharingFrameRate;__cometchat_calls_lib_webrtc.default.createLocalTracks({devices:[`desktop`],desktopSharingFrameRate:e}).then(e=>{let D=e.find(e=>e.getType()===`video`),O=e.find(e=>e.getType()===`audio`);O&&O.dispose(),D&&D.getTrack().applyConstraints({width:{max:1920},height:{max:1080}}).finally(()=>onTrack(D))}).catch(e=>{e?.name!==`gum.screensharing_user_canceled`&&eventBus.publish({type:INTERNAL_EVENTS.notification,payload:{type:`error`,message:e?.message||`An error occurred while starting screen share.`}})})}function stopScreenSharing(){useTracksStore.getState().updateLocalTrack(MEDIA_TYPE.SCREENSHARE,{muted:1})}function addScreenShareParticipant(e){if(!e||e.isMuted())return;let D=useParticipantStore.getState().participants,O=useParticipantStore.getState().localParticipant,k=e.isLocal()?O:D.find(D=>D.pid===e.getParticipantId());k&&(useParticipantStore.getState().addVirtualParticipant({...k,type:`screen-share`,name:k.name,ruid:`${k.pid}-screen-share`}),useParticipantStore.getState().pinParticipant(k.pid,`screen-share`),e.isLocal()?eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onScreenShareStarted}):sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStartedScreenShare,k.pid))}function removeScreenShareParticipant(e){useParticipantStore.getState().removeVirtualParticipant(e,`screen-share`),useParticipantStore.getState().localParticipant.pid===e?eventBus.publish({type:EVENT_LISTENER_METHODS.MediaEventsListener.onScreenShareStopped}):sendParticipantEvent(EVENT_LISTENER_METHODS.ParticipantEventsListner.onParticipantStoppedScreenShare,e)}useBaseStore.subscribe(e=>e.desktopSharingFrameRate,e=>{useConferenceStore.getState().conference});const streamingStatusTimers=new Map;function onTrack(e){if(e.isLocal()){updateInputOutputDevices(!0);let D=getLocalTrack(e.getType())?.muted;useTracksStore.getState().updateLocalTrack(getMediaType(e),{originalTrack:e,...e.getVideoType()===`desktop`?{muted:0}:typeof D==`boolean`?{muted:D}:{}}),e.on(__cometchat_calls_lib_webrtc.default.events.track.LOCAL_TRACK_STOPPED,e=>{e.getVideoType()===`desktop`&&stopScreenSharing()})}else useTracksStore.getState().addTrack(e);e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED),e.removeAllListeners(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED),e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_MUTE_CHANGED,e=>{e.isLocal()||useTracksStore.getState().updateTrack(e,{muted:e.isMuted()?1:0})}),e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_VIDEOTYPE_CHANGED,D=>{useTracksStore.getState().updateTrack(e,{videoType:D,mediaType:D===`desktop`?`screenshare`:`video`})}),!e.isLocal()&&e.isVideoTrack()&&e.on(__cometchat_calls_lib_webrtc.default.events.track.TRACK_STREAMING_STATUS_CHANGED,(e,D)=>{let O=e.getTrackId?.()??e.getId?.(),k=streamingStatusTimers.get(O);k&&(clearTimeout(k),streamingStatusTimers.delete(O));let A=useConferenceStore.getState().conference;D===`interrupted`&&A.isP2PActive()?streamingStatusTimers.set(O,setTimeout(()=>{streamingStatusTimers.delete(O),useTracksStore.getState().updateTrack(e,{streamingStatus:D})},4e3)):useTracksStore.getState().updateTrack(e,{streamingStatus:D})})}const RegionLiteralSchema=valibot.union([valibot.literal(`eu`),valibot.literal(`us`),valibot.literal(`in`),valibot.literal(`EU`),valibot.literal(`US`),valibot.literal(`IN`)]),RegionSchema=valibot.pipe(valibot.string(),valibot.transform(e=>e.toLowerCase()),RegionLiteralSchema),CallAppSettingsSchema=valibot.object({appId:valibot.string(),region:RegionSchema,authKey:valibot.optional(valibot.string()),adminHost:valibot.optional(valibot.string()),clientHost:valibot.optional(valibot.string()),host:valibot.optional(valibot.string()),disableSdkIdentification:valibot.optional(valibot.boolean())});function callAppSettingsFromSettings(e){let D=e.callsSDK??{},O={appId:e.appId,region:e.region};return e.credentials?.authKey&&(O.authKey=e.credentials.authKey),D.adminHost&&(O.adminHost=D.adminHost),D.clientHost&&(O.clientHost=D.clientHost),D.host&&(O.host=D.host),D.disableSdkIdentification!=null&&(O.disableSdkIdentification=!!D.disableSdkIdentification),O}const CometChatEvent=new Proxy(react_native.NativeModules.CometChatEvent??{},{get:(e,D)=>typeof e[D]==`function`?e[D]:()=>{}});eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionJoined,CometChatEvent.onSessionJoined),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionLeft,CometChatEvent.onSessionLeft),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionLost,CometChatEvent.onConnectionLost),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionRestored,CometChatEvent.onConnectionRestored),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onConnectionClosed,CometChatEvent.onConnectionClosed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.SessionStatusListener.onSessionTimedOut,CometChatEvent.onSessionTimedOut),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioMuted,CometChatEvent.onAudioMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioUnMuted,CometChatEvent.onAudioUnMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onVideoPaused,CometChatEvent.onVideoPaused),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onVideoResumed,CometChatEvent.onVideoResumed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onRecordingStarted,CometChatEvent.onRecordingStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onRecordingStopped,CometChatEvent.onRecordingStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onStreamingStarted,CometChatEvent.onStreamingStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onStreamingStopped,CometChatEvent.onStreamingStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onScreenShareStarted,CometChatEvent.onScreenShareStarted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onScreenShareStopped,CometChatEvent.onScreenShareStopped),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModeChanged,CometChatEvent.onAudioModeChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onAudioModesChanged,CometChatEvent.onAudioModesChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.MediaEventsListener.onCameraFacingChanged,CometChatEvent.onCameraFacingChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantJoined,CometChatEvent.onParticipantJoined),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantLeft,CometChatEvent.onParticipantLeft),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantAudioMuted,CometChatEvent.onParticipantAudioMuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantAudioUnmuted,CometChatEvent.onParticipantAudioUnmuted),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantVideoPaused,CometChatEvent.onParticipantVideoPaused),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantVideoResumed,CometChatEvent.onParticipantVideoResumed),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantHandRaised,CometChatEvent.onParticipantHandRaised),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantHandLowered,CometChatEvent.onParticipantHandLowered),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedScreenShare,CometChatEvent.onParticipantStartedScreenShare),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedScreenShare,CometChatEvent.onParticipantStoppedScreenShare),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedRecording,CometChatEvent.onParticipantStartedRecording),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedRecording,CometChatEvent.onParticipantStoppedRecording),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStartedStreaming,CometChatEvent.onParticipantStartedStreaming),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantStoppedStreaming,CometChatEvent.onParticipantStoppedStreaming),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onDominantSpeakerChanged,CometChatEvent.onDominantSpeakerChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ParticipantEventsListner.onParticipantListChanged,CometChatEvent.onParticipantListChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onLeaveSessionButtonClicked,CometChatEvent.onLeaveSessionButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onRaiseHandButtonClicked,CometChatEvent.onRaiseHandButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onShareInviteButtonClicked,CometChatEvent.onShareInviteButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChangeLayoutButtonClicked,CometChatEvent.onChangeLayoutButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onParticipantListButtonClicked,CometChatEvent.onParticipantListButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onToggleAudioButtonClicked,CometChatEvent.onToggleAudioButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onToggleVideoButtonClicked,CometChatEvent.onToggleVideoButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onSwitchCameraButtonClicked,CometChatEvent.onSwitchCameraButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChatButtonClicked,CometChatEvent.onChatButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onRecordingToggleButtonClicked,CometChatEvent.onRecordingToggleButtonClicked),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onCallLayoutChanged,CometChatEvent.onCallLayoutChanged),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListVisible,CometChatEvent.onParticipantListVisible),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onParticipantListHidden,CometChatEvent.onParticipantListHidden),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutEnabled,CometChatEvent.onPictureInPictureLayoutEnabled),eventBus.subscribe(EVENT_LISTENER_METHODS_MOBILE.CallLayoutListener.onPictureInPictureLayoutDisabled,CometChatEvent.onPictureInPictureLayoutDisabled);const constants$1={MUTE_AUDIO:`MUTE_AUDIO`,UNMUTE_AUDIO:`UNMUTE_AUDIO`,PAUSE_VIDEO:`PAUSE_VIDEO`,RESUME_VIDEO:`RESUME_VIDEO`,ENABLE_PICTURE_IN_PICTURE_LAYOUT:`ENABLE_PICTURE_IN_PICTURE_LAYOUT`,DISABLE_PICTURE_IN_PICTURE_LAYOUT:`DISABLE_PICTURE_IN_PICTURE_LAYOUT`,LEAVE_SESSION:`LEAVE_SESSION`,RAISE_HAND:`RAISE_HAND`,LOWER_HAND:`LOWER_HAND`,MUTE_PARTICIPANT:`MUTE_PARTICIPANT`,PAUSE_PARTICIPANT_VIDEO:`PAUSE_PARTICIPANT_VIDEO`,PIN_PARTICIPANT:`PIN_PARTICIPANT`,UNPIN_PARTICIPANT:`UNPIN_PARTICIPANT`,SET_AUDIO_MODE:`SET_AUDIO_MODE`,SET_LAYOUT:`SET_LAYOUT`,SWITCH_CAMERA:`SWITCH_CAMERA`,START_RECORDING:`START_RECORDING`,STOP_RECORDING:`STOP_RECORDING`,START_STREAMING:`START_STREAMING`,STOP_STREAMING:`STOP_STREAMING`,START_TRANSCRIPTION:`START_TRANSCRIPTION`,STOP_TRANSCRIPTION:`STOP_TRANSCRIPTION`,START_SCREEN_SHARE:`START_SCREEN_SHARE`,STOP_SCREEN_SHARE:`STOP_SCREEN_SHARE`,SET_CHAT_BUTTON_UNREAD_COUNT:`SET_CHAT_BUTTON_UNREAD_COUNT`};function setupNativeEventListeners(){let{CometChatEventEmitter:e}=react_native.NativeModules,D=react_native.Platform.select({default:e?new react_native.NativeEventEmitter(e):null,android:react_native.DeviceEventEmitter}),O=[];if(!D)return;let k=D.addListener(constants$1.MUTE_AUDIO,()=>{muteAudioTrack()});O.push(k);let A=D.addListener(constants$1.UNMUTE_AUDIO,()=>{unMuteAudioTrack()});O.push(A);let j=D.addListener(constants$1.PAUSE_VIDEO,()=>{pauseVideoTrack()});O.push(j);let M=D.addListener(constants$1.RESUME_VIDEO,()=>{resumeVideoTrack()});O.push(M);let N=D.addListener(constants$1.ENABLE_PICTURE_IN_PICTURE_LAYOUT,()=>{enablePictureInPictureLayout()});O.push(N);let P=D.addListener(constants$1.DISABLE_PICTURE_IN_PICTURE_LAYOUT,()=>{disablePictureInPictureLayout()});O.push(P);let F=D.addListener(constants$1.LEAVE_SESSION,()=>{leaveSession()});O.push(F);let I=D.addListener(constants$1.RAISE_HAND,()=>{});O.push(I);let L=D.addListener(constants$1.LOWER_HAND,()=>{});O.push(L);let R=D.addListener(constants$1.MUTE_PARTICIPANT,e=>{typeof e.pid==`string`&&muteParticipant(e.pid)});O.push(R);let z=D.addListener(constants$1.PAUSE_PARTICIPANT_VIDEO,e=>{typeof e.pid==`string`&&pauseParticipantVideo(e.pid)});O.push(z);let B=D.addListener(constants$1.PIN_PARTICIPANT,()=>{});O.push(B);let H=D.addListener(constants$1.UNPIN_PARTICIPANT,()=>{});O.push(H);let U=D.addListener(constants$1.SET_AUDIO_MODE,()=>{});O.push(U);let W=D.addListener(constants$1.SET_LAYOUT,()=>{});O.push(W);let G=D.addListener(constants$1.SWITCH_CAMERA,()=>{switchCamera()});O.push(G);let K=D.addListener(constants$1.START_RECORDING,()=>{});O.push(K);let q=D.addListener(constants$1.STOP_RECORDING,()=>{});O.push(q);let J=D.addListener(constants$1.START_STREAMING,e=>{typeof e.streamUrl==`string`&&typeof e.streamKey==`string`&&startStreaming(e.streamUrl,e.streamKey)});O.push(J);let Y=D.addListener(constants$1.STOP_STREAMING,()=>{stopStreaming()});O.push(Y);let X=D.addListener(constants$1.START_TRANSCRIPTION,()=>{startTranscription()});O.push(X);let Z=D.addListener(constants$1.STOP_TRANSCRIPTION,()=>{stopTranscription()});O.push(Z);let Q=D.addListener(constants$1.START_SCREEN_SHARE,()=>{});O.push(Q);let $=D.addListener(constants$1.STOP_SCREEN_SHARE,()=>{});O.push($),D.addListener(constants$1.SET_CHAT_BUTTON_UNREAD_COUNT,e=>{typeof e.count==`number`&&setChatButtonUnreadCount(e.count)}),useBaseStore.getState().addSubscriptions(O)}setupNativeEventListeners();let AudioMode=function(e){return e[e.DEFAULT=0]=`DEFAULT`,e[e.AUDIO_CALL=1]=`AUDIO_CALL`,e[e.VIDEO_CALL=2]=`VIDEO_CALL`,e}({});const AudioModeModule=react_native.NativeModules.AudioMode,AudioModeEventEmitter=new react_native.NativeEventEmitter(AudioModeModule);var AudioModeModule_default=AudioModeModule;function requestAudioModeChange(e){let D=typeof e==`string`?e:e.type;if(D===`EARPIECE`&&useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO)return Promise.reject({errorCode:`ERROR_INVALID_AUDIO_MODE`,errorDescription:`EARPIECE is not allowed during a video call`});let O=useBaseStore.getState().audioModes,k=typeof e==`string`?O.find(D=>D.type===e):e;return k?Promise.resolve(AudioModeModule_default.setAudioDevice(k.uid||k.type)):Promise.reject({errorCode:`ERROR_AUDIO_MODE_UNAVAILABLE`,errorDescription:`Audio mode ${D} is not available`})}const MultitaskingCameraModule=react_native.NativeModules.MultitaskingCamera,isMultitaskingCameraAccessSupported=react_native.Platform.OS===`ios`&&MultitaskingCameraModule?.isSupported===!0;var MultitaskingCameraModule_default=MultitaskingCameraModule;const cameraSurvivesBackground=()=>isMultitaskingCameraAccessSupported&&useConfigStore.getState().enableIOSPictureInPicture;let appStateSubscription=null;eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount,()=>{appStateSubscription?.remove(),appStateSubscription=react_native.AppState.addEventListener(`change`,e=>{useBaseStore.setState({appState:e})})}),eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentWillUnmount,()=>{appStateSubscription?.remove(),appStateSubscription=null});let transitionGeneration=0;useBaseStore.subscribe(e=>e.appState,async e=>{let D=++transitionGeneration;if(!(!getIsConferenceJoined()||useConfigStore.getState().sessionType!==SESSION_TYPE.VIDEO)){if(e===`active`){resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);return}e===`background`&&(await new Promise(e=>setTimeout(e,2e3)),D===transitionGeneration&&(useBaseStore.getState().isPIPLayoutEnabled||cameraSurvivesBackground()||pauseVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND)))}});const KeepAwakeModule=react_native.NativeModules.KeepAwakeModule;var KeepAwakeModule_default=KeepAwakeModule;useConferenceStore.subscribe(e=>e.conferenceStatus,e=>{e===`joined`||e===`restored`?KeepAwakeModule_default.activateKeepAwake():KeepAwakeModule_default.deactivateKeepAwake()});async function queryPermissions(){try{let[e,D]=await Promise.all([react_native_webrtc.permissions.query({name:`microphone`}),react_native_webrtc.permissions.query({name:`camera`})]);useTracksStore.setState(O=>({permissions:{...O.permissions,video:e===`granted`,audio:D===`granted`,initialized:!0}}))}catch{}}eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount,()=>{queryPermissions()}),eventBus.subscribe(INTERNAL_EVENTS.queryPermission,()=>{queryPermissions()});const spacing={base:2,1:4,2:8,3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,13:52,14:56,15:60,16:64,17:68,18:72,19:76,20:80,max:1e3},padding={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],7:spacing[7],8:spacing[8],9:spacing[9],10:spacing[10]},margin={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],7:spacing[7],8:spacing[8],9:spacing[9],10:spacing[10],11:spacing[11],12:spacing[12],13:spacing[13],14:spacing[14],15:spacing[15],16:spacing[16],17:spacing[17],18:spacing[18],19:spacing[19],20:spacing[20]},borderRadius={base:spacing.base,1:spacing[1],2:spacing[2],3:spacing[3],4:spacing[4],5:spacing[5],6:spacing[6],max:spacing.max},fontFamily={primary:`Roboto`},typography={title:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:32,lineHeight:38.4},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:32,lineHeight:38.4},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:32,lineHeight:38.4}},heading1:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:24,lineHeight:28.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:24,lineHeight:28.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:24,lineHeight:28.8}},heading2:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:20,lineHeight:24},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:20,lineHeight:24},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:20,lineHeight:24}},heading3:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:18,lineHeight:21.6},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:18,lineHeight:21.6},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:18,lineHeight:21.6}},heading4:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:16,lineHeight:19.2},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:16,lineHeight:19.2},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:16,lineHeight:19.2}},body:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:14,lineHeight:16.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:14,lineHeight:16.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:16.8}},caption1:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:12,lineHeight:14.4},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:12,lineHeight:14.4},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:12,lineHeight:14.4}},caption2:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:10,lineHeight:12},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:10,lineHeight:12},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:10,lineHeight:12}},button:{bold:{fontFamily:fontFamily.primary,fontWeight:`700`,fontSize:14,lineHeight:16.8},medium:{fontFamily:fontFamily.primary,fontWeight:`500`,fontSize:14,lineHeight:16.8},regular:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:16.8}},link:{fontFamily:fontFamily.primary,fontWeight:`400`,fontSize:14,lineHeight:19.6}},colors={primary:`#6852d6`,extendedPrimary:{50:`#15102b`,100:`#1d173c`,200:`#251e4d`,300:`#2e245e`,400:`#362b6f`,500:`#3e3180`,600:`#473892`,700:`#4f3ea3`,800:`#5745b4`,900:`#7460d9`},neutral:{50:`#141414`,100:`#1a1a1a`,200:`#272727`,300:`#383838`,400:`#4c4c4c`,500:`#858585`,600:`#989898`,700:`#a8a8a8`,800:`#c8c8c8`,900:`#ffffff`},alert:{successBackground:`#ceecdf`,warningBackground:`#fff5cf`,errorBackground:`#f4d8d8`,permissionErrorColor:`#ff977d`,permissionErrorBackground:`#391716`,info:`#0d66bf`,warning:`#d08d04`,success:`#0b9f5d`,messageSeen:`#56e8a7`,error:`#c73c3e`,callControlActiveBackground:`#f4cccc`},static:{black:`#141414`,white:`#ffffff`},background:{1:`#141414`,2:`#1a1a1a`,3:`#272727`,4:`#383838`},border:{light:`#272727`,default:`#383838`,dark:`#4c4c4c`,highlight:`#6852d6`},text:{primary:`#ffffff`,secondary:`#989898`,tertiary:`#858585`,disabled:`#4c4c4c`,white:`#141414`,highlight:`#6852d6`},icon:{primary:`#ffffff`,secondary:`#858585`,tertiary:`#4c4c4c`,white:`#141414`,highlight:`#6852d6`},shimmer:{background:`#141414`,gradient:[`#383838`,`#272727`]},button:{primaryBackground:`#6852d6`,primaryText:`#ffffff`,primaryIcon:`#ffffff`,secondaryBackground:`#ffffff`,secondaryText:`#ffffff`,secondaryIcon:`#ffffff`,link:`#0d66bf`,fabBackground:`#6852d6`,fabIcon:`#ffffff`,whiteHover:`#1a1a1a`,whitePressed:`#383838`}},commonStyles=react_native.StyleSheet.create({titleBold:typography.title.bold,titleMedium:typography.title.medium,titleRegular:typography.title.regular,heading1Bold:typography.heading1.bold,heading1Medium:typography.heading1.medium,heading1Regular:typography.heading1.regular,heading2Bold:typography.heading2.bold,heading2Medium:typography.heading2.medium,heading2Regular:typography.heading2.regular,heading3Bold:typography.heading3.bold,heading3Medium:typography.heading3.medium,heading3Regular:typography.heading3.regular,heading4Bold:typography.heading4.bold,heading4Medium:typography.heading4.medium,heading4Regular:typography.heading4.regular,bodyBold:typography.body.bold,bodyMedium:typography.body.medium,bodyRegular:typography.body.regular,caption1Bold:typography.caption1.bold,caption1Medium:typography.caption1.medium,caption1Regular:typography.caption1.regular,caption2Bold:typography.caption2.bold,caption2Medium:typography.caption2.medium,caption2Regular:typography.caption2.regular,buttonBold:typography.button.bold,buttonMedium:typography.button.medium,buttonRegular:typography.button.regular,link:typography.link,backgroundPrimary:{backgroundColor:colors.background[1]},backgroundSecondary:{backgroundColor:colors.background[2]},backgroundTertiary:{backgroundColor:colors.background[3]},backgroundQuaternary:{backgroundColor:colors.background[4]},textPrimary:{color:colors.text.primary},textSecondary:{color:colors.text.secondary},textTertiary:{color:colors.text.tertiary},textDisabled:{color:colors.text.disabled},textHighlight:{color:colors.text.highlight},borderLight:{borderColor:colors.border.light},borderDefault:{borderColor:colors.border.default},borderDark:{borderColor:colors.border.dark},borderHighlight:{borderColor:colors.border.highlight},absoluteFill:{position:`absolute`,top:0,bottom:0,left:0,right:0},flex1:{flex:1},flexRow:{flexDirection:`row`},flexColumn:{flexDirection:`column`},center:{justifyContent:`center`,alignItems:`center`},spaceBetween:{justifyContent:`space-between`},spaceAround:{justifyContent:`space-around`},paddingSmall:{padding:padding[2]},paddingMedium:{padding:padding[4]},paddingLarge:{padding:padding[6]},marginSmall:{margin:margin[2]},marginMedium:{margin:margin[4]},marginLarge:{margin:margin[6]},radiusSmall:{borderRadius:borderRadius[2]},radiusMedium:{borderRadius:borderRadius[4]},radiusLarge:{borderRadius:borderRadius[6]}}),Avatar=({name:e,imageUrl:D,size:O,fontSize:k,containerStyle:A,textStyle:j})=>{let M=O?{width:O,height:O}:styles$31.avatarWrapper,N=k?{fontSize:k,lineHeight:k*1.2}:{},P=(0,react.useMemo)(()=>D?{}:{backgroundColor:getColorFromName(e)},[D,e]);return(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$31.avatarWrapper,P,M,A],children:D?(0,react_jsx_runtime.jsx)(react_native.Image,{source:{uri:D},style:styles$31.avatarImage,resizeMode:`cover`}):(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading2Bold,styles$31.avatarText,j,N],children:getAvatarTextInitials(e)})})},styles$31=react_native.StyleSheet.create({avatarWrapper:{overflow:`hidden`,backgroundColor:`#3a3a3a`,alignItems:`center`,justifyContent:`center`,width:48,height:48,borderRadius:1e3},avatarImage:{width:`100%`,height:`100%`},avatarText:{color:colors.text.primary}});var Avatar_native_default=Avatar;const PATH_MAP={"arrow-down-2":`M11.0046 5.20898V16.379L6.12461 11.499C5.73461 11.109 5.09461 11.109 4.70461 11.499C4.31461 11.889 4.31461 12.519 4.70461 12.909L11.2946 19.499C11.6846 19.889 12.3146 19.889 12.7046 19.499L19.2946 12.909C19.6846 12.519 19.6846 11.889 19.2946 11.499C18.9046 11.109 18.2746 11.109 17.8846 11.499L13.0046 16.379V5.20898C13.0046 4.65898 12.5546 4.20898 12.0046 4.20898C11.4546 4.20898 11.0046 4.65898 11.0046 5.20898Z`,"arrow-up":`M12.0005 10.4538L7.9275 14.527C7.789 14.6653 7.61492 14.7362 7.40525 14.7395C7.19575 14.7427 7.0185 14.6718 6.8735 14.527C6.72867 14.382 6.65625 14.2063 6.65625 14C6.65625 13.7937 6.72867 13.618 6.8735 13.473L11.3678 8.97876C11.5486 8.7981 11.7595 8.70776 12.0005 8.70776C12.2415 8.70776 12.4524 8.7981 12.6333 8.97876L17.1275 13.473C17.2658 13.6115 17.3367 13.7856 17.34 13.9953C17.3432 14.2048 17.2723 14.382 17.1275 14.527C16.9825 14.6718 16.8068 14.7443 16.6005 14.7443C16.3942 14.7443 16.2185 14.6718 16.0735 14.527L12.0005 10.4538Z`,bluetooth:`M17.65 6.99663L13.36 2.70663C12.73 2.07663 11.65 2.51663 11.65 3.40663V9.58663L7.76 5.69663C7.37 5.30663 6.74 5.30663 6.35 5.69663C5.96 6.08663 5.96 6.71663 6.35 7.10663L11.24 11.9966L6.35 16.8866C5.96 17.2766 5.96 17.9066 6.35 18.2966C6.74 18.6866 7.37 18.6866 7.76 18.2966L11.65 14.4066V20.5866C11.65 21.4766 12.73 21.9266 13.36 21.2966L17.65 16.9966C18.04 16.6066 18.04 15.9766 17.65 15.5866L14.06 11.9966L17.65 8.41663C18.04 8.02663 18.04 7.38663 17.65 6.99663ZM13.65 5.82663L15.53 7.70663L13.65 9.58663V5.82663ZM15.53 16.2866L13.65 18.1666V14.4066L15.53 16.2866Z`,"call-end":`M4.58108 16.0302L6.58108 14.4402C7.06108 14.0602 7.34108 13.4802 7.34108 12.8702V10.2702C10.3611 9.29016 13.6311 9.28016 16.6611 10.2702V12.8802C16.6611 13.4902 16.9411 14.0702 17.4211 14.4502L19.4111 16.0302C20.2111 16.6602 21.3511 16.6002 22.0711 15.8802L23.2911 14.6602C24.0911 13.8602 24.0911 12.5302 23.2411 11.7802C16.8311 6.12016 7.17108 6.12016 0.76108 11.7802C-0.0889204 12.5302 -0.0889204 13.8602 0.71108 14.6602L1.93108 15.8802C2.64108 16.6002 3.78108 16.6602 4.58108 16.0302Z`,car:`M18.92 5.01C18.72 4.42 18.16 4 17.5 4H6.5C5.84 4 5.29 4.42 5.08 5.01L3.11 10.68C3.04 10.89 3 11.11 3 11.34V18.5C3 19.33 3.67 20 4.5 20C5.33 20 6 19.33 6 18.5V18H18V18.5C18 19.32 18.67 20 19.5 20C20.32 20 21 19.33 21 18.5V11.34C21 11.12 20.96 10.89 20.89 10.68L18.92 5.01ZM6.5 15C5.67 15 5 14.33 5 13.5C5 12.67 5.67 12 6.5 12C7.33 12 8 12.67 8 13.5C8 14.33 7.33 15 6.5 15ZM17.5 15C16.67 15 16 14.33 16 13.5C16 12.67 16.67 12 17.5 12C18.33 12 19 12.67 19 13.5C19 14.33 18.33 15 17.5 15ZM5 10L6.27 6.18C6.41 5.78 6.79 5.5 7.22 5.5H16.78C17.21 5.5 17.59 5.78 17.73 6.18L19 10H5Z`,chat:`M20 2H4C2.9 2 2.01 2.9 2.01 4L2 22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2ZM7 9H17C17.55 9 18 9.45 18 10C18 10.55 17.55 11 17 11H7C6.45 11 6 10.55 6 10C6 9.45 6.45 9 7 9ZM13 14H7C6.45 14 6 13.55 6 13C6 12.45 6.45 12 7 12H13C13.55 12 14 12.45 14 13C14 13.55 13.55 14 13 14ZM17 8H7C6.45 8 6 7.55 6 7C6 6.45 6.45 6 7 6H17C17.55 6 18 6.45 18 7C18 7.55 17.55 8 17 8Z`,"check-fill":`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM9.29 16.29L5.7 12.7C5.31 12.31 5.31 11.68 5.7 11.29C6.09 10.9 6.72 10.9 7.11 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.7 16.29C10.32 16.68 9.68 16.68 9.29 16.29Z`,close:`M11.999 13.1163L6.89479 18.2203C6.73379 18.3815 6.54629 18.4614 6.33229 18.4601C6.11845 18.4586 5.93379 18.3773 5.77829 18.2163C5.61995 18.0552 5.54287 17.8697 5.54704 17.6601C5.5512 17.4502 5.62962 17.269 5.78229 17.1163L10.8823 11.9996L5.78229 6.88283C5.62962 6.73016 5.55329 6.54891 5.55329 6.33908C5.55329 6.12941 5.62962 5.944 5.78229 5.78283C5.93512 5.62183 6.11845 5.54058 6.33229 5.53908C6.54629 5.53775 6.73379 5.61483 6.89479 5.77033L11.999 10.8828L17.1115 5.77033C17.267 5.61483 17.4518 5.53775 17.6658 5.53908C17.8796 5.54058 18.0671 5.62183 18.2283 5.78283C18.381 5.944 18.4552 6.12941 18.451 6.33908C18.4469 6.54891 18.3685 6.73016 18.2158 6.88283L13.1158 11.9996L18.2158 17.1163C18.3685 17.269 18.4448 17.4502 18.4448 17.6601C18.4448 17.8697 18.3685 18.0552 18.2158 18.2163C18.063 18.3773 17.8796 18.4586 17.6658 18.4601C17.4518 18.4614 17.267 18.3815 17.1115 18.2203L11.999 13.1163Z`,"closed-caption":`M19 4H5C3.89 4 3 4.9 3 6V18C3 19.1 3.89 20 5 20H19C20.1 20 21 19.1 21 18V6C21 4.9 20.1 4 19 4ZM11 10.5C11 10.78 10.78 11 10.5 11H10C9.72 11 9.5 10.78 9.5 10.5H7.5V13.5H9.5C9.5 13.22 9.72 13 10 13H10.5C10.78 13 11 13.22 11 13.5V14C11 14.55 10.55 15 10 15H7C6.45 15 6 14.55 6 14V10C6 9.45 6.45 9 7 9H10C10.55 9 11 9.45 11 10V10.5ZM18 10.5C18 10.78 17.78 11 17.5 11H17C16.72 11 16.5 10.78 16.5 10.5H14.5V13.5H16.5C16.5 13.22 16.72 13 17 13H17.5C17.78 13 18 13.22 18 13.5V14C18 14.55 17.55 15 17 15H14C13.45 15 13 14.55 13 14V10C13 9.45 13.45 9 14 9H17C17.55 9 18 9.45 18 10V10.5Z`,earpiece:`M19.7885 11.7299C19.5858 11.7299 19.4076 11.658 19.2538 11.5144C19.0999 11.3709 19.0096 11.1927 18.9828 10.9799C18.7661 9.36569 18.0863 7.98719 16.9433 6.84436C15.8003 5.70136 14.4218 5.02153 12.8078 4.80486C12.5949 4.77786 12.4167 4.69003 12.273 4.54136C12.1295 4.39269 12.0578 4.21194 12.0578 3.99911C12.0578 3.78628 12.1321 3.60811 12.2808 3.46461C12.4294 3.32094 12.6051 3.26261 12.8078 3.28961C14.8436 3.51011 16.5792 4.33794 18.0145 5.77311C19.4497 7.20844 20.2775 8.94403 20.498 10.9799C20.525 11.1824 20.4667 11.358 20.323 11.5069C20.1795 11.6555 20.0013 11.7299 19.7885 11.7299ZM15.652 11.7299C15.4865 11.7299 15.3413 11.6741 15.2163 11.5626C15.0913 11.4511 14.9968 11.3024 14.9328 11.1164C14.7801 10.5754 14.5002 10.0981 14.0933 9.68461C13.6863 9.27111 13.2123 8.99136 12.6713 8.84536C12.4853 8.78119 12.3365 8.68661 12.225 8.56161C12.1135 8.43661 12.0578 8.28628 12.0578 8.11061C12.0578 7.86061 12.1439 7.65869 12.3163 7.50486C12.4888 7.35103 12.6846 7.30103 12.9038 7.35486C13.7794 7.55869 14.5339 7.97728 15.1673 8.61061C15.8006 9.24394 16.2224 10.0016 16.4328 10.8836C16.4866 11.1029 16.4324 11.2988 16.2703 11.4711C16.1081 11.6436 15.902 11.7299 15.652 11.7299ZM19.4403 20.4991C17.5558 20.4991 15.6625 20.0609 13.7605 19.1846C11.8587 18.3083 10.1097 17.0721 8.5135 15.4761C6.92383 13.8799 5.69083 12.1324 4.8145 10.2336C3.93817 8.33494 3.5 6.44336 3.5 4.55886C3.5 4.25886 3.6 4.00719 3.8 3.80386C4 3.60069 4.25 3.49911 4.55 3.49911H7.8115C8.064 3.49911 8.28675 3.58153 8.47975 3.74636C8.67275 3.91103 8.7955 4.11453 8.848 4.35686L9.42125 7.29911C9.46092 7.57211 9.45258 7.80669 9.39625 8.00286C9.33975 8.19903 9.23842 8.36378 9.09225 8.49711L6.78275 10.7454C7.15442 11.426 7.57908 12.0699 8.05675 12.6771C8.53425 13.2841 9.05125 13.8639 9.60775 14.4164C10.1564 14.9652 10.7398 15.4749 11.3578 15.9454C11.9757 16.4159 12.6431 16.8537 13.3598 17.2589L15.6038 14.9954C15.7603 14.8325 15.9498 14.7184 16.1723 14.6529C16.3946 14.5875 16.6257 14.5715 16.8655 14.6049L19.6423 15.1704C19.8948 15.237 20.1008 15.3659 20.2605 15.5569C20.4202 15.7479 20.5 15.9645 20.5 16.2069V19.4491C20.5 19.7491 20.3984 19.9991 20.1953 20.1991C19.9919 20.3991 19.7403 20.4991 19.4403 20.4991Z`,"empty-search":`M11.0001 11.6921C10.0348 11.6921 9.2101 11.3501 8.5261 10.6661C7.8421 9.98228 7.5001 9.15761 7.5001 8.19211C7.5001 7.22678 7.8421 6.40211 8.5261 5.71811C9.2101 5.03411 10.0348 4.69211 11.0001 4.69211C11.9654 4.69211 12.7901 5.03411 13.4741 5.71811C14.1581 6.40211 14.5001 7.22678 14.5001 8.19211C14.5001 9.15761 14.1581 9.98228 13.4741 10.6661C12.7901 11.3501 11.9654 11.6921 11.0001 11.6921ZM21.1308 22.1844L18.7271 19.7806C18.3899 19.9934 18.0341 20.1601 17.6596 20.2806C17.2853 20.4011 16.8988 20.4614 16.5001 20.4614C15.3976 20.4614 14.4617 20.0768 13.6923 19.3076C12.9232 18.5383 12.5386 17.6024 12.5386 16.4999C12.5386 15.3974 12.9232 14.4614 13.6923 13.6921C14.4617 12.9229 15.3976 12.5384 16.5001 12.5384C17.6026 12.5384 18.5385 12.9229 19.3078 13.6921C20.077 14.4614 20.4616 15.3974 20.4616 16.4999C20.4616 16.8985 20.4013 17.285 20.2808 17.6594C20.1603 18.0339 19.9937 18.3897 19.7808 18.7269L22.1846 21.1306C22.3231 21.2691 22.3939 21.4431 22.3971 21.6526C22.4003 21.8623 22.3294 22.0395 22.1846 22.1844C22.0398 22.3292 21.8642 22.4016 21.6578 22.4016C21.4513 22.4016 21.2757 22.3292 21.1308 22.1844ZM16.5001 18.9614C17.1938 18.9614 17.7774 18.7245 18.2511 18.2509C18.7248 17.7772 18.9616 17.1935 18.9616 16.4999C18.9616 15.8062 18.7248 15.2225 18.2511 14.7489C17.7774 14.2752 17.1938 14.0384 16.5001 14.0384C15.8064 14.0384 15.2228 14.2752 14.7491 14.7489C14.2754 15.2225 14.0386 15.8062 14.0386 16.4999C14.0386 17.1935 14.2754 17.7772 14.7491 18.2509C15.2228 18.7245 15.8064 18.9614 16.5001 18.9614ZM5.01935 19.3076C4.59751 19.3076 4.23885 19.1599 3.94335 18.8644C3.64785 18.5687 3.5001 18.21 3.5001 17.7884V17.0999C3.5001 16.6037 3.6306 16.1476 3.8916 15.7316C4.15243 15.3156 4.51043 14.9922 4.9656 14.7614C5.66426 14.4037 6.49018 14.0842 7.44335 13.8029C8.39651 13.5214 9.43726 13.3614 10.5656 13.3229C10.7591 13.3127 10.9058 13.3944 11.0058 13.5681C11.1058 13.7418 11.1174 13.9254 11.0406 14.1191C10.8764 14.5038 10.7518 14.8977 10.6666 15.3009C10.5813 15.704 10.5386 16.1114 10.5386 16.5229C10.5386 16.8472 10.5648 17.1741 10.6173 17.5036C10.67 17.8331 10.7592 18.1498 10.8848 18.4536C10.9592 18.6678 10.9396 18.8636 10.8261 19.0411C10.7126 19.2188 10.5488 19.3076 10.3348 19.3076H5.01935Z`,error:`M9.16602 12.5003H10.8327V14.167H9.16602V12.5003ZM9.16602 5.83366H10.8327V10.8337H9.16602V5.83366ZM9.99102 1.66699C5.39102 1.66699 1.66602 5.40033 1.66602 10.0003C1.66602 14.6003 5.39102 18.3337 9.99102 18.3337C14.5993 18.3337 18.3327 14.6003 18.3327 10.0003C18.3327 5.40033 14.5993 1.66699 9.99102 1.66699ZM9.99935 16.667C6.31602 16.667 3.33268 13.6837 3.33268 10.0003C3.33268 6.31699 6.31602 3.33366 9.99935 3.33366C13.6827 3.33366 16.666 6.31699 16.666 10.0003C16.666 13.6837 13.6827 16.667 9.99935 16.667Z`,headphones:`M3 12V19C3 20.1 3.9 21 5 21H7C8.1 21 9 20.1 9 19V15C9 13.9 8.1 13 7 13H5V12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12V13H17C15.9 13 15 13.9 15 15V19C15 20.1 15.9 21 17 21H19C20.1 21 21 20.1 21 19V12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12Z`,mic:`M12 14.5C13.66 14.5 15 13.16 15 11.5V5.5C15 3.84 13.66 2.5 12 2.5C10.34 2.5 9 3.84 9 5.5V11.5C9 13.16 10.34 14.5 12 14.5ZM11 5.5C11 4.95 11.45 4.5 12 4.5C12.55 4.5 13 4.95 13 5.5V11.5C13 12.05 12.55 12.5 12 12.5C11.45 12.5 11 12.05 11 11.5V5.5ZM17 11.5C17 14.26 14.76 16.5 12 16.5C9.24 16.5 7 14.26 7 11.5H5C5 15.03 7.61 17.93 11 18.42V21.5H13V18.42C16.39 17.93 19 15.03 19 11.5H17Z`,"mic-fill":`M11.999 14.5C13.659 14.5 14.999 13.16 14.999 11.5V5.5C14.999 3.84 13.659 2.5 11.999 2.5C10.339 2.5 8.99901 3.84 8.99901 5.5V11.5C8.99901 13.16 10.339 14.5 11.999 14.5ZM17.909 11.5C17.419 11.5 17.009 11.86 16.929 12.35C16.519 14.7 14.469 16.5 11.999 16.5C9.52901 16.5 7.47901 14.7 7.06901 12.35C6.98901 11.86 6.57901 11.5 6.08901 11.5C5.47901 11.5 4.99901 12.04 5.08901 12.64C5.57901 15.64 7.97901 17.99 10.999 18.42V20.5C10.999 21.05 11.449 21.5 11.999 21.5C12.549 21.5 12.999 21.05 12.999 20.5V18.42C16.019 17.99 18.419 15.64 18.909 12.64C19.009 12.04 18.519 11.5 17.909 11.5Z`,"mic-off":`M10.7219 5.38999C10.7219 4.72999 11.2619 4.18999 11.9219 4.18999C12.5819 4.18999 13.1219 4.72999 13.1219 5.38999L13.1119 9.29999L14.9219 11.09V5.48999C14.9219 3.82999 13.5819 2.48999 11.9219 2.48999C10.3819 2.48999 9.13188 3.64999 8.96187 5.13999L10.7219 6.89999V5.38999ZM18.9219 11.49H17.2219C17.2219 12.07 17.1219 12.62 16.9519 13.13L18.2219 14.4C18.6619 13.52 18.9219 12.53 18.9219 11.49ZM4.33187 3.34999L2.92188 4.75999L8.92188 10.76V11.49C8.92188 13.15 10.2619 14.49 11.9219 14.49C12.1519 14.49 12.3619 14.46 12.5719 14.41L14.2319 16.07C13.5219 16.4 12.7319 16.59 11.9219 16.59C9.16187 16.59 6.62187 14.49 6.62187 11.49H4.92188C4.92188 14.9 7.64188 17.72 10.9219 18.21V21.49H12.9219V18.21C13.8319 18.08 14.6919 17.76 15.4719 17.31L19.6719 21.51L21.0819 20.1L4.33187 3.34999Z`,"mic-off-fill":`M16.5203 13.9018C16.3446 13.8069 16.2282 13.6557 16.171 13.448C16.114 13.2403 16.133 13.0487 16.2278 12.873C16.3253 12.7025 16.4003 12.5211 16.4528 12.3287C16.5055 12.1364 16.5452 11.9416 16.572 11.7443C16.6195 11.5314 16.715 11.3542 16.8585 11.2125C17.0022 11.0708 17.1805 11 17.3933 11C17.6061 11 17.7817 11.0776 17.92 11.2327C18.0585 11.3877 18.1175 11.5717 18.097 11.7845C18.0599 12.0973 17.998 12.4067 17.9115 12.7125C17.825 13.0182 17.7042 13.3088 17.549 13.5845C17.4542 13.7667 17.3045 13.8888 17.1 13.951C16.8955 14.0132 16.7023 13.9968 16.5203 13.9018ZM12.8278 9.7385L9.67029 6.5615C9.50612 6.39733 9.37729 6.20408 9.28379 5.98175C9.19012 5.75925 9.14329 5.5275 9.14329 5.2865V5C9.14329 4.30133 9.38529 3.71 9.86929 3.226C10.3533 2.742 10.9446 2.5 11.6433 2.5C12.342 2.5 12.9333 2.742 13.4173 3.226C13.9013 3.71 14.1433 4.30133 14.1433 5V9.1865C14.1433 9.534 13.9855 9.77442 13.67 9.90775C13.3547 10.0411 13.074 9.98467 12.8278 9.7385ZM10.8933 20V17.4578C9.40479 17.2832 8.12912 16.6704 7.06629 15.6193C6.00346 14.5679 5.38104 13.2865 5.19904 11.775C5.17221 11.5622 5.22796 11.3798 5.36629 11.228C5.50479 11.076 5.68046 11 5.89329 11C6.10612 11 6.28429 11.0734 6.42779 11.2203C6.57146 11.3669 6.66696 11.5467 6.71429 11.7595C6.89646 12.984 7.45646 13.9968 8.39429 14.798C9.33212 15.5993 10.4151 16 11.6433 16C12.2868 16 12.8916 15.8852 13.4578 15.6557C14.0238 15.4262 14.5247 15.1083 14.9605 14.702L16.0298 15.771C15.5465 16.225 14.9965 16.5988 14.3798 16.8923C13.7631 17.1859 13.101 17.3744 12.3933 17.4578V20C12.3933 20.2128 12.3215 20.391 12.1778 20.5345C12.0343 20.6782 11.8561 20.75 11.6433 20.75C11.4305 20.75 11.2522 20.6782 11.1085 20.5345C10.965 20.391 10.8933 20.2128 10.8933 20ZM19.3395 21.1885L2.20479 4.05375C2.06629 3.91525 1.99546 3.74125 1.99229 3.53175C1.98912 3.32208 2.05996 3.14483 2.20479 3C2.34962 2.85517 2.52529 2.78275 2.73179 2.78275C2.93812 2.78275 3.11371 2.85517 3.25854 3L20.3933 20.1345C20.5318 20.273 20.6026 20.4471 20.6058 20.6568C20.609 20.8663 20.5381 21.0435 20.3933 21.1885C20.2485 21.3333 20.0728 21.4058 19.8663 21.4058C19.66 21.4058 19.4844 21.3333 19.3395 21.1885Z`,"mood-fill":`M15.406 10.8077C15.77 10.8077 16.0786 10.6803 16.3318 10.4255C16.5849 10.1708 16.7115 9.86158 16.7115 9.49775C16.7115 9.13392 16.5842 8.82542 16.3295 8.57225C16.0748 8.31892 15.7655 8.19225 15.4015 8.19225C15.0377 8.19225 14.7292 8.31967 14.476 8.5745C14.2228 8.82917 14.0962 9.13842 14.0962 9.50225C14.0962 9.86608 14.2236 10.1746 14.4783 10.4277C14.7329 10.6811 15.0422 10.8077 15.406 10.8077ZM8.5985 10.8077C8.96233 10.8077 9.27083 10.6803 9.524 10.4255C9.77717 10.1708 9.90375 9.86158 9.90375 9.49775C9.90375 9.13392 9.77642 8.82542 9.52175 8.57225C9.26708 8.31892 8.95783 8.19225 8.594 8.19225C8.23 8.19225 7.92142 8.31967 7.66825 8.5745C7.41508 8.82917 7.2885 9.13842 7.2885 9.50225C7.2885 9.86608 7.41583 10.1746 7.6705 10.4277C7.92517 10.6811 8.2345 10.8077 8.5985 10.8077ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5ZM12 17.1923C12.8975 17.1923 13.7254 16.9798 14.4837 16.5548C15.2421 16.1298 15.8578 15.5532 16.331 14.825C16.4257 14.643 16.4227 14.46 16.322 14.276C16.2215 14.092 16.0642 14 15.85 14H8.15C7.93583 14 7.7785 14.092 7.678 14.276C7.57733 14.46 7.57433 14.643 7.669 14.825C8.14217 15.5532 8.76183 16.1298 9.528 16.5548C10.294 16.9798 11.118 17.1923 12 17.1923Z`,more:`M12 8C13.1 8 14 7.1 14 6C14 4.9 13.1 4 12 4C10.9 4 10 4.9 10 6C10 7.1 10.9 8 12 8ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10ZM12 16C10.9 16 10 16.9 10 18C10 19.1 10.9 20 12 20C13.1 20 14 19.1 14 18C14 16.9 13.1 16 12 16Z`,"noise-reduction":[`M15.6204 16.45C15.9804 15.8 15.4704 15 14.7204 15C14.3804 15 14.0404 15.16 13.8804 15.47C13.7204 15.78 13.3804 16 13.0004 16C12.5704 16 12.1904 15.73 12.0504 15.32C11.9004 14.88 11.6504 14.24 11.1204 13.71L9.76039 12.35C9.28039 11.87 9.00039 11.19 9.00039 10.5C9.00039 9.12 10.1204 8 11.5004 8C12.4804 8 13.3404 8.57 13.7404 9.4C13.9204 9.76 14.2604 10 14.6504 10C15.4004 10 15.8704 9.21 15.5404 8.54C14.8204 7.04 13.2804 6 11.5004 6C8.61038 6 6.35038 8.74 7.17038 11.76C7.39038 12.56 7.85038 13.27 8.44038 13.86L9.71039 15.13C9.86039 15.29 9.99039 15.51 10.1104 15.84C10.5204 16.97 11.4904 17.88 12.6904 18C13.9504 18.11 15.0704 17.46 15.6204 16.45Z`,`M13.5004 14C14.3288 14 15.0004 13.3284 15.0004 12.5C15.0004 11.6716 14.3288 11 13.5004 11C12.672 11 12.0004 11.6716 12.0004 12.5C12.0004 13.3284 12.672 14 13.5004 14Z`,`M12.0004 4C12.5527 4 13.0004 3.55228 13.0004 3C13.0004 2.44772 12.5527 2 12.0004 2C11.4481 2 11.0004 2.44772 11.0004 3C11.0004 3.55228 11.4481 4 12.0004 4Z`,`M12.0004 22C12.5527 22 13.0004 21.5523 13.0004 21C13.0004 20.4477 12.5527 20 12.0004 20C11.4481 20 11.0004 20.4477 11.0004 21C11.0004 21.5523 11.4481 22 12.0004 22Z`,`M5.75038 7.01C6.09038 6.58 6.02039 5.95 5.59038 5.6C5.16038 5.26 4.53038 5.33 4.18038 5.77C3.84038 6.2 3.91038 6.83 4.34038 7.17C4.77039 7.51 5.40038 7.44 5.75038 7.01Z`,`M18.2504 16.99C17.9104 17.42 17.9804 18.05 18.4104 18.4C18.8404 18.75 19.4704 18.67 19.8204 18.24C20.1604 17.81 20.0904 17.18 19.6604 16.83C19.2304 16.49 18.6004 16.56 18.2504 16.99Z`,`M4.20038 13.78C4.08038 13.24 3.54038 12.9 3.00038 13.03C2.46038 13.16 2.12038 13.69 2.25038 14.23C2.37038 14.77 2.91038 15.11 3.45038 14.98C3.99038 14.86 4.32038 14.32 4.20038 13.78Z`,`M19.8004 10.22C19.9204 10.76 20.4604 11.1 21.0004 10.97C21.5404 10.84 21.8804 10.31 21.7504 9.77C21.6204 9.23 21.0904 8.89 20.5504 9.02C20.0104 9.14 19.6804 9.68 19.8004 10.22Z`,`M8.53038 19.21C8.03038 18.97 7.43038 19.18 7.20038 19.68C6.96038 20.18 7.17038 20.78 7.67038 21.01C8.17038 21.25 8.77038 21.04 9.00038 20.54C9.24038 20.05 9.03038 19.45 8.53038 19.21Z`,`M15.4704 4.79C15.9704 5.03 16.5704 4.82 16.8004 4.32C17.0404 3.82 16.8304 3.22 16.3304 2.99C15.8304 2.75 15.2304 2.96 15.0004 3.46C14.7604 3.95 14.9704 4.55 15.4704 4.79Z`,`M15.4704 19.21C14.9704 19.45 14.7604 20.05 15.0004 20.54C15.2404 21.03 15.8404 21.25 16.3304 21.01C16.8304 20.77 17.0404 20.17 16.8004 19.68C16.5704 19.18 15.9704 18.97 15.4704 19.21Z`,`M8.53038 4.79C9.03038 4.55 9.23038 3.96 9.00038 3.46C8.76039 2.96 8.16039 2.75 7.67038 2.99C7.18038 3.23 6.95039 3.83 7.19038 4.33C7.43038 4.83 8.03038 5.03 8.53038 4.79Z`,`M21.0004 13.03C20.4604 12.91 19.9304 13.24 19.8004 13.78C19.6804 14.32 20.0104 14.85 20.5504 14.98C21.0904 15.1 21.6204 14.77 21.7504 14.23C21.8704 13.69 21.5404 13.15 21.0004 13.03Z`,`M3.00038 10.97C3.54038 11.09 4.07038 10.76 4.20038 10.22C4.32038 9.68 3.99038 9.15 3.45038 9.02C2.91038 8.89 2.38038 9.23 2.25038 9.77C2.13038 10.31 2.46038 10.85 3.00038 10.97Z`,`M19.6604 7.17C20.0904 6.83 20.1604 6.2 19.8204 5.76C19.4804 5.32 18.8504 5.26 18.4104 5.6C17.9804 5.94 17.9104 6.57 18.2504 7.01C18.6004 7.44 19.2304 7.51 19.6604 7.17Z`,`M4.34038 16.83C3.91038 17.17 3.84038 17.8 4.18038 18.24C4.52038 18.67 5.15038 18.74 5.59038 18.4C6.02039 18.06 6.09038 17.43 5.75038 16.99C5.41038 16.55 4.77039 16.49 4.34038 16.83Z`],participants:`M1.79688 17.0837C1.79688 16.5683 1.92987 16.1084 2.19588 15.7039C2.46188 15.2994 2.81713 14.9847 3.26163 14.7599C4.21196 14.2951 5.16754 13.9367 6.12838 13.6847C7.08938 13.4328 8.14546 13.3069 9.29663 13.3069C10.448 13.3069 11.504 13.4328 12.4649 13.6847C13.4259 13.9367 14.3815 14.2951 15.3319 14.7599C15.7764 14.9847 16.1316 15.2994 16.3976 15.7039C16.6636 16.1084 16.7966 16.5683 16.7966 17.0837V17.7877C16.7966 18.1902 16.6489 18.544 16.3534 18.8492C16.0579 19.1543 15.6992 19.3069 15.2774 19.3069H3.31588C2.89421 19.3069 2.53563 19.1592 2.24013 18.8637C1.94463 18.568 1.79688 18.2093 1.79688 17.7877V17.0837ZM18.4101 19.3069C18.5358 19.0774 18.6316 18.8332 18.6976 18.5742C18.7636 18.3152 18.7966 18.053 18.7966 17.7877V16.9607C18.7966 16.3043 18.636 15.6787 18.3146 15.0839C17.9931 14.4892 17.5371 13.979 16.9466 13.5532C17.6171 13.6532 18.2537 13.8079 18.8564 14.0174C19.4589 14.2271 20.0339 14.4748 20.5814 14.7607C21.098 15.0363 21.497 15.3612 21.7784 15.7354C22.0597 16.1094 22.2004 16.5178 22.2004 16.9607V17.7877C22.2004 18.2093 22.0526 18.568 21.7571 18.8637C21.4616 19.1592 21.103 19.3069 20.6814 19.3069H18.4101ZM9.29663 11.6914C8.33413 11.6914 7.51021 11.3487 6.82488 10.6634C6.13954 9.97791 5.79688 9.15391 5.79688 8.19141C5.79688 7.22891 6.13954 6.40499 6.82488 5.71966C7.51021 5.03416 8.33413 4.69141 9.29663 4.69141C10.2591 4.69141 11.0831 5.03416 11.7686 5.71966C12.454 6.40499 12.7966 7.22891 12.7966 8.19141C12.7966 9.15391 12.454 9.97791 11.7686 10.6634C11.0831 11.3487 10.2591 11.6914 9.29663 11.6914ZM17.9311 8.19141C17.9311 9.15391 17.5885 9.97791 16.9031 10.6634C16.2178 11.3487 15.3939 11.6914 14.4314 11.6914C14.3185 11.6914 14.175 11.6786 14.0006 11.6529C13.8261 11.6272 13.6825 11.5991 13.5699 11.5684C13.9642 11.0942 14.2673 10.5682 14.4791 9.99041C14.6908 9.41257 14.7966 8.81257 14.7966 8.19041C14.7966 7.56807 14.6886 6.97032 14.4726 6.39716C14.2566 5.82416 13.9557 5.29666 13.5699 4.81466C13.7134 4.76332 13.857 4.72999 14.0006 4.71466C14.1441 4.69916 14.2877 4.69141 14.4314 4.69141C15.3939 4.69141 16.2178 5.03416 16.9031 5.71966C17.5885 6.40499 17.9311 7.22891 17.9311 8.19141Z`,pin:`M15.4994 5.6V12.8115L17.0647 14.377C17.139 14.4513 17.1949 14.535 17.2322 14.628C17.2694 14.7208 17.2879 14.8168 17.2879 14.916V15.3435C17.2879 15.5542 17.2151 15.7329 17.0694 15.8797C16.9239 16.0266 16.7435 16.1 16.5282 16.1H12.7494V21.4885C12.7494 21.701 12.6775 21.8791 12.5337 22.0227C12.3899 22.1664 12.2117 22.2382 11.9992 22.2382C11.7865 22.2382 11.6084 22.1664 11.4649 22.0227C11.3213 21.8791 11.2494 21.701 11.2494 21.4885V16.1H7.47069C7.25535 16.1 7.07494 16.0266 6.92944 15.8797C6.78377 15.7329 6.71094 15.5542 6.71094 15.3435V14.916C6.71094 14.8168 6.72952 14.7208 6.76669 14.628C6.80402 14.535 6.85985 14.4513 6.93419 14.377L8.49944 12.8115V5.6H8.24944C8.03694 5.6 7.85885 5.52808 7.71519 5.38425C7.57135 5.24041 7.49944 5.06225 7.49944 4.84975C7.49944 4.63708 7.57135 4.459 7.71519 4.3155C7.85885 4.17183 8.03694 4.1 8.24944 4.1H15.7494C15.9619 4.1 16.14 4.17192 16.2837 4.31575C16.4275 4.45958 16.4994 4.63775 16.4994 4.85025C16.4994 5.06292 16.4275 5.241 16.2837 5.3845C16.14 5.52817 15.9619 5.6 15.7494 5.6H15.4994Z`,"raise-hand":`M18.37 23.9949H11.82C10.74 23.9949 9.68 23.5449 8.93 22.7649L1.63 15.1549L3.7 13.3249C4.32 12.7749 5.23 12.6649 5.96 13.0549L8.37 14.3349V4.78488C8.37 3.40488 9.49 2.28488 10.87 2.28488C11.04 2.28488 11.21 2.30488 11.38 2.33488C11.47 1.03488 12.55 0.00488281 13.87 0.00488281C14.73 0.00488281 15.48 0.434883 15.93 1.09488C16.22 0.974883 16.54 0.914883 16.87 0.914883C18.25 0.914883 19.37 2.03488 19.37 3.41488V3.69488C19.53 3.66488 19.7 3.64488 19.87 3.64488C21.25 3.64488 22.37 4.76488 22.37 6.14488V19.9949C22.37 22.2049 20.58 23.9949 18.37 23.9949ZM4.51 15.2749L10.37 21.3749C10.75 21.7649 11.27 21.9949 11.81 21.9949H18.37C19.47 21.9949 20.37 21.0949 20.37 19.9949V6.14488C20.37 5.86488 20.15 5.64488 19.87 5.64488C19.59 5.64488 19.37 5.86488 19.37 6.14488V11.9949H17.37V3.41488C17.37 3.13488 17.15 2.91488 16.87 2.91488C16.59 2.91488 16.37 3.13488 16.37 3.41488V11.9949H14.37V2.50488C14.37 2.22488 14.15 2.00488 13.87 2.00488C13.59 2.00488 13.37 2.22488 13.37 2.50488V11.9949H11.37V4.78488C11.37 4.50488 11.15 4.28488 10.87 4.28488C10.59 4.28488 10.37 4.51488 10.37 4.78488V17.6549L5.02 14.8249L4.51 15.2749Z`,"raise-hand-fill":`M21.1818 4C20.3518 4 19.6818 4.67 19.6818 5.5V10.5C19.6818 10.78 19.4618 11 19.1818 11C18.9018 11 18.6818 10.78 18.6818 10.5V2.5C18.6818 1.67 18.0118 1 17.1818 1C16.3518 1 15.6818 1.67 15.6818 2.5V10.5C15.6818 10.78 15.4618 11 15.1818 11C14.9018 11 14.6818 10.78 14.6818 10.5V1.5C14.6818 0.67 14.0118 0 13.1818 0C12.3518 0 11.6818 0.67 11.6818 1.5V10.49C11.6818 10.77 11.4618 10.99 11.1818 10.99C10.9018 10.99 10.6818 10.77 10.6818 10.49V4.5C10.6818 3.67 10.0118 3 9.18176 3C8.35176 3 7.68176 3.67 7.68176 4.5V15.91L3.56176 13.56C2.98176 13.23 2.26176 13.32 1.78176 13.78C1.18176 14.36 1.16176 15.32 1.75176 15.91L8.53176 22.8C9.28176 23.57 10.3018 24 11.3818 24H18.6818C20.8918 24 22.6818 22.21 22.6818 20V5.5C22.6818 4.67 22.0118 4 21.1818 4Z`,"record-fill":`M12 16.5C13.2487 16.5 14.3108 16.0622 15.1865 15.1865C16.0622 14.3108 16.5 13.2487 16.5 12C16.5 10.7513 16.0622 9.68917 15.1865 8.8135C14.3108 7.93783 13.2487 7.5 12 7.5C10.7513 7.5 9.68917 7.93783 8.8135 8.8135C7.93783 9.68917 7.5 10.7513 7.5 12C7.5 13.2487 7.93783 14.3108 8.8135 15.1865C9.68917 16.0622 10.7513 16.5 12 16.5ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z`,"record-stop-fill":`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM15 16H9C8.45 16 8 15.55 8 15V9C8 8.45 8.45 8 9 8H15C15.55 8 16 8.45 16 9V15C16 15.55 15.55 16 15 16Z`,recording:[`M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z`,`M12 17C14.7614 17 17 14.7614 17 12C17 9.23858 14.7614 7 12 7C9.23858 7 7 9.23858 7 12C7 14.7614 9.23858 17 12 17Z`],remove:`M12.0022 21.8335C10.6404 21.8335 9.36222 21.5752 8.16772 21.0587C6.97322 20.5421 5.9323 19.8407 5.04497 18.9545C4.15747 18.0683 3.45605 17.0284 2.94072 15.8347C2.42555 14.6409 2.16797 13.3631 2.16797 12.0012C2.16797 10.6394 2.42622 9.36124 2.94272 8.16674C3.45939 6.97224 4.1608 5.93133 5.04697 5.04399C5.93314 4.15649 6.97305 3.45508 8.16672 2.93974C9.36055 2.42458 10.6384 2.16699 12.0002 2.16699C13.3621 2.16699 14.6402 2.42524 15.8347 2.94174C17.0292 3.45841 18.0701 4.15983 18.9575 5.04599C19.845 5.93216 20.5464 6.97208 21.0617 8.16574C21.5769 9.35958 21.8345 10.6374 21.8345 11.9992C21.8345 13.3611 21.5762 14.6392 21.0597 15.8337C20.5431 17.0282 19.8416 18.0692 18.9555 18.9565C18.0693 19.844 17.0294 20.5454 15.8357 21.0607C14.6419 21.5759 13.3641 21.8335 12.0022 21.8335ZM12.0012 20.2502C12.9807 20.2502 13.9197 20.0877 14.8182 19.7627C15.7169 19.4377 16.5335 18.9669 17.268 18.3502L5.65472 6.73349C5.04689 7.47799 4.57764 8.29791 4.24697 9.19324C3.91647 10.0886 3.75122 11.0242 3.75122 12.0002C3.75122 14.3016 4.55089 16.2519 6.15022 17.8512C7.74955 19.4506 9.69989 20.2502 12.0012 20.2502ZM18.3312 17.267C18.9279 16.5337 19.3971 15.7175 19.7387 14.8185C20.0804 13.9195 20.2512 12.9801 20.2512 12.0002C20.2512 9.69891 19.4516 7.74858 17.8522 6.14924C16.2529 4.54991 14.3026 3.75024 12.0012 3.75024C11.0257 3.75024 10.0905 3.91549 9.19547 4.24599C8.30047 4.57666 7.48014 5.05033 6.73447 5.66699L18.3312 17.267Z`,"screen-share":`M11.1348 10.8075H13.1348V11.919C13.1348 12.0228 13.1799 12.094 13.2703 12.1325C13.3606 12.1708 13.4443 12.1516 13.5213 12.0747L15.2173 10.3785C15.3109 10.285 15.3578 10.178 15.3578 10.0575C15.3578 9.93697 15.3109 9.82989 15.2173 9.73622L13.5213 8.04022C13.4443 7.96322 13.3606 7.94397 13.2703 7.98247C13.1799 8.02097 13.1348 8.09214 13.1348 8.19597V9.30747H11.1348C10.3719 9.30747 9.72285 9.57505 9.18752 10.1102C8.65235 10.6456 8.38477 11.2946 8.38477 12.0575V13.3075C8.38477 13.5203 8.45652 13.6985 8.60002 13.842C8.74368 13.9856 8.92193 14.0575 9.13477 14.0575C9.34743 14.0575 9.5256 13.9856 9.66927 13.842C9.81277 13.6985 9.88452 13.5203 9.88452 13.3075V12.0575C9.88452 11.71 10.006 11.4147 10.249 11.1717C10.492 10.9289 10.7873 10.8075 11.1348 10.8075ZM2.13477 20.2305C1.92193 20.2305 1.74368 20.1586 1.60002 20.015C1.45652 19.8715 1.38477 19.6933 1.38477 19.4805C1.38477 19.2676 1.45652 19.0895 1.60002 18.946C1.74368 18.8023 1.92193 18.7305 2.13477 18.7305H21.8653C22.0781 18.7305 22.2563 18.8023 22.4 18.946C22.5435 19.0895 22.6153 19.2676 22.6153 19.4805C22.6153 19.6933 22.5435 19.8715 22.4 20.015C22.2563 20.1586 22.0781 20.2305 21.8653 20.2305H2.13477ZM4.30777 17.7305C3.8026 17.7305 3.37502 17.5555 3.02502 17.2055C2.67502 16.8555 2.50002 16.4279 2.50002 15.9227V5.53822C2.50002 5.03305 2.67502 4.60547 3.02502 4.25547C3.37502 3.90547 3.8026 3.73047 4.30777 3.73047H19.6923C20.1974 3.73047 20.625 3.90547 20.975 4.25547C21.325 4.60547 21.5 5.03305 21.5 5.53822V15.9227C21.5 16.4279 21.325 16.8555 20.975 17.2055C20.625 17.5555 20.1974 17.7305 19.6923 17.7305H4.30777Z`,"screen-share-stop":`M23 17.8602H21.8L23.59 19.6502C23.83 19.4702 24 19.1902 24 18.8602C24 18.3102 23.55 17.8602 23 17.8602ZM3.23 2.14016C2.84 1.75016 2.2 1.75016 1.81 2.14016C1.42 2.53016 1.42 3.16016 1.81 3.55016L2.65 4.41016C2.65 4.41016 1.99 4.98016 1.99 5.88016C2 6.78016 2 15.8602 2 15.8602L2.01 15.8702C2.01 16.9602 2.89 17.8502 3.98 17.8602H1C0.45 17.8602 0 18.3102 0 18.8602C0 19.4102 0.45 19.8602 1 19.8602H18.13L20.13 21.8602C20.52 22.2502 21.15 22.2502 21.54 21.8602C21.93 21.4702 21.93 20.8402 21.54 20.4502L3.23 2.14016ZM7 14.8602C7.31 13.3802 7.94 11.9302 9.08 10.8102L10.67 12.4002C9.13 12.7802 7.96 13.5702 7 14.8602ZM13 8.99016V8.01016C13 7.57016 13.52 7.35016 13.84 7.64016L15 8.73016L16.61 10.2302C16.82 10.4302 16.82 10.7602 16.61 10.9602L15.72 11.7902L21.3 17.3702C21.73 17.0002 22 16.4702 22 15.8602V5.86016C22 4.77016 21.11 3.88016 20.02 3.88016H7.8L12.94 9.01016C12.96 9.00016 12.98 8.99016 13 8.99016Z`,search:`M9.50244 15.7502C7.7266 15.7502 6.22369 15.1352 4.99369 13.9052C3.76352 12.675 3.14844 11.1847 3.14844 9.43419C3.14844 7.68369 3.76194 6.19319 4.98894 4.96269C6.21594 3.73219 7.70902 3.11694 9.46819 3.11694C11.2274 3.11694 12.7194 3.73228 13.9444 4.96294C15.1694 6.19361 15.7819 7.68553 15.7819 9.43869C15.7819 10.1464 15.6666 10.8287 15.4359 11.4857C15.2054 12.1425 14.8721 12.7474 14.4359 13.3002L20.3014 19.1204C20.4551 19.2743 20.5319 19.4635 20.5319 19.6882C20.5319 19.9129 20.4528 20.1058 20.2944 20.2669C20.1361 20.4279 19.9432 20.5084 19.7157 20.5084C19.4882 20.5084 19.3002 20.429 19.1517 20.2702L13.3067 14.4209C12.8124 14.8488 12.2363 15.1773 11.5784 15.4064C10.9204 15.6356 10.2284 15.7502 9.50244 15.7502ZM9.48194 14.1669C10.7929 14.1669 11.9068 13.7062 12.8234 12.7847C13.7401 11.8632 14.1984 10.7458 14.1984 9.43244C14.1984 8.11928 13.7401 7.00228 12.8234 6.08144C11.9068 5.16061 10.7915 4.70019 9.47769 4.70019C8.15452 4.70019 7.03277 5.16094 6.11244 6.08244C5.1921 7.00394 4.73194 8.12128 4.73194 9.43444C4.73194 10.7478 5.19235 11.8649 6.11319 12.7857C7.03402 13.7065 8.15694 14.1669 9.48194 14.1669Z`,settings:`M19.5006 12C19.5006 11.77 19.4906 11.55 19.4706 11.32L21.3306 9.91C21.7306 9.61 21.8406 9.05 21.5906 8.61L19.7206 5.38C19.4706 4.94 18.9306 4.76 18.4706 4.96L16.3206 5.87C15.9506 5.61 15.5606 5.38 15.1506 5.19L14.8606 2.88C14.8006 2.38 14.3706 2 13.8706 2H10.1406C9.63064 2 9.20064 2.38 9.14064 2.88L8.85064 5.19C8.44064 5.38 8.05064 5.61 7.68064 5.87L5.53064 4.96C5.07064 4.76 4.53064 4.94 4.28064 5.38L2.41064 8.62C2.16064 9.06 2.27064 9.61 2.67064 9.92L4.53064 11.33C4.51064 11.55 4.50064 11.77 4.50064 12C4.50064 12.23 4.51064 12.45 4.53064 12.68L2.67064 14.09C2.27064 14.39 2.16064 14.95 2.41064 15.39L4.28064 18.62C4.53064 19.06 5.07064 19.24 5.53064 19.04L7.68064 18.13C8.05064 18.39 8.44064 18.62 8.85064 18.81L9.14064 21.12C9.20064 21.62 9.63064 22 10.1306 22H13.8606C14.3606 22 14.7906 21.62 14.8506 21.12L15.1406 18.81C15.5506 18.62 15.9406 18.39 16.3106 18.13L18.4606 19.04C18.9206 19.24 19.4606 19.06 19.7106 18.62L21.5806 15.39C21.8306 14.95 21.7206 14.4 21.3206 14.09L19.4606 12.68C19.4906 12.45 19.5006 12.23 19.5006 12ZM12.0406 15.5C10.1106 15.5 8.54064 13.93 8.54064 12C8.54064 10.07 10.1106 8.5 12.0406 8.5C13.9706 8.5 15.5406 10.07 15.5406 12C15.5406 13.93 13.9706 15.5 12.0406 15.5Z`,share:`M18 16.1191C17.24 16.1191 16.56 16.4191 16.04 16.8891L8.91 12.7391C8.96 12.5091 9 12.2791 9 12.0391C9 11.7991 8.96 11.5691 8.91 11.3391L15.96 7.22906C16.5 7.72906 17.21 8.03906 18 8.03906C19.66 8.03906 21 6.69906 21 5.03906C21 3.37906 19.66 2.03906 18 2.03906C16.34 2.03906 15 3.37906 15 5.03906C15 5.27906 15.04 5.50906 15.09 5.73906L8.04 9.84906C7.5 9.34906 6.79 9.03906 6 9.03906C4.34 9.03906 3 10.3791 3 12.0391C3 13.6991 4.34 15.0391 6 15.0391C6.79 15.0391 7.5 14.7291 8.04 14.2291L15.16 18.3891C15.11 18.5991 15.08 18.8191 15.08 19.0391C15.08 20.6491 16.39 21.9591 18 21.9591C19.61 21.9591 20.92 20.6491 20.92 19.0391C20.92 17.4291 19.61 16.1191 18 16.1191Z`,sidebar:`M15 20H3C2.45 20 2 19.55 2 19V5C2 4.45 2.45 4 3 4H15C15.55 4 16 4.45 16 5V19C16 19.55 15.55 20 15 20ZM19 8H21C21.55 8 22 7.55 22 7V5C22 4.45 21.55 4 21 4H19C18.45 4 18 4.45 18 5V7C18 7.55 18.45 8 19 8ZM19 20H21C21.55 20 22 19.55 22 19V17C22 16.45 21.55 16 21 16H19C18.45 16 18 16.45 18 17V19C18 19.55 18.45 20 19 20ZM19 14H21C21.55 14 22 13.55 22 13V11C22 10.45 21.55 10 21 10H19C18.45 10 18 10.45 18 11V13C18 13.55 18.45 14 19 14Z`,signal:`M18 4C18.83 4 19.5 4.67 19.5 5.5V18.5C19.5 19.33 18.83 20 18 20C17.17 20 16.5 19.33 16.5 18.5V5.5C16.5 4.67 17.17 4 18 4ZM6 14C6.83 14 7.5 14.67 7.5 15.5V18.5C7.5 19.33 6.83 20 6 20C5.17 20 4.5 19.33 4.5 18.5V15.5C4.5 14.67 5.17 14 6 14ZM12 9C12.83 9 13.5 9.67 13.5 10.5V18.5C13.5 19.33 12.83 20 12 20C11.17 20 10.5 19.33 10.5 18.5V10.5C10.5 9.67 11.17 9 12 9Z`,"speaker-fill":`M3 10.002V14.002C3 14.552 3.45 15.002 4 15.002H7L10.29 18.292C10.92 18.922 12 18.472 12 17.582V6.41204C12 5.52204 10.92 5.07204 10.29 5.70204L7 9.00204H4C3.45 9.00204 3 9.45204 3 10.002ZM16.5 12.002C16.5 10.232 15.48 8.71204 14 7.97204V16.022C15.48 15.292 16.5 13.772 16.5 12.002ZM14 4.45204V4.65204C14 5.03204 14.25 5.36204 14.6 5.50204C17.18 6.53204 19 9.06204 19 12.002C19 14.942 17.18 17.472 14.6 18.502C14.24 18.642 14 18.972 14 19.352V19.552C14 20.182 14.63 20.622 15.21 20.402C18.6 19.112 21 15.842 21 12.002C21 8.16204 18.6 4.89204 15.21 3.60204C14.63 3.37204 14 3.82204 14 4.45204Z`,spotlight:`M2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6Z`,stats:`M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM8 17C7.45 17 7 16.55 7 16V11C7 10.45 7.45 10 8 10C8.55 10 9 10.45 9 11V16C9 16.55 8.55 17 8 17ZM12 17C11.45 17 11 16.55 11 16V8C11 7.45 11.45 7 12 7C12.55 7 13 7.45 13 8V16C13 16.55 12.55 17 12 17ZM16 17C15.45 17 15 16.55 15 16V14C15 13.45 15.45 13 16 13C16.55 13 17 13.45 17 14V16C17 16.55 16.55 17 16 17Z`,streaming:[`M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z`,`M7.5 8C6.5 9 6 10.5 6 12C6 13.5 6.5 15 7.5 16C7.1 16.4 6.6 16.4 6.2 16C4.9 14.7 4.2 13.4 4.2 12C4.2 10.6 4.9 9.3 6.2 8C6.6 7.6 7.1 7.6 7.5 8ZM4.5 6C3.1 7.5 2 9.5 2 12C2 14.5 3.1 16.5 4.5 18C4.1 18.4 3.6 18.4 3.2 18C1.5 16.2 0.5 14.2 0.5 12C0.5 9.8 1.5 7.8 3.2 6C3.6 5.6 4.1 5.6 4.5 6ZM16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16C16.9 16.4 17.4 16.4 17.8 16C19.1 14.7 19.8 13.4 19.8 12C19.8 10.6 19.1 9.3 17.8 8C17.4 7.6 16.9 7.6 16.5 8ZM19.5 6C20.9 7.5 22 9.5 22 12C22 14.5 20.9 16.5 19.5 18C19.9 18.4 20.4 18.4 20.8 18C22.5 16.2 23.5 14.2 23.5 12C23.5 9.8 22.5 7.8 20.8 6C20.4 5.6 19.9 5.6 19.5 6Z`],"streaming-stop":[`M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z`,`M7.5 8C6.5 9 6 10.5 6 12C6 13.5 6.5 15 7.5 16C7.1 16.4 6.6 16.4 6.2 16C4.9 14.7 4.2 13.4 4.2 12C4.2 10.6 4.9 9.3 6.2 8C6.6 7.6 7.1 7.6 7.5 8ZM4.5 6C3.1 7.5 2 9.5 2 12C2 14.5 3.1 16.5 4.5 18C4.1 18.4 3.6 18.4 3.2 18C1.5 16.2 0.5 14.2 0.5 12C0.5 9.8 1.5 7.8 3.2 6C3.6 5.6 4.1 5.6 4.5 6ZM16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16C16.9 16.4 17.4 16.4 17.8 16C19.1 14.7 19.8 13.4 19.8 12C19.8 10.6 19.1 9.3 17.8 8C17.4 7.6 16.9 7.6 16.5 8ZM19.5 6C20.9 7.5 22 9.5 22 12C22 14.5 20.9 16.5 19.5 18C19.9 18.4 20.4 18.4 20.8 18C22.5 16.2 23.5 14.2 23.5 12C23.5 9.8 22.5 7.8 20.8 6C20.4 5.6 19.9 5.6 19.5 6Z`,`M3.70711 2.29289C3.31658 1.90237 2.68342 1.90237 2.29289 2.29289C1.90237 2.68342 1.90237 3.31658 2.29289 3.70711L20.2929 21.7071C20.6834 22.0976 21.3166 22.0976 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L3.70711 2.29289Z`],"switch-camera":`M4.30775 20.5C3.80258 20.5 3.375 20.325 3.025 19.975C2.675 19.625 2.5 19.1974 2.5 18.6923V7.30775C2.5 6.80258 2.675 6.375 3.025 6.025C3.375 5.675 3.80258 5.5 4.30775 5.5H7.3615L8.66925 4.08275C8.83342 3.90192 9.03183 3.75958 9.2645 3.65575C9.49717 3.55192 9.74233 3.5 10 3.5H14C14.2577 3.5 14.5028 3.55192 14.7355 3.65575C14.9682 3.75958 15.1666 3.90192 15.3307 4.08275L16.6385 5.5H19.6923C20.1974 5.5 20.625 5.675 20.975 6.025C21.325 6.375 21.5 6.80258 21.5 7.30775V18.6923C21.5 19.1974 21.325 19.625 20.975 19.975C20.625 20.325 20.1974 20.5 19.6923 20.5H4.30775ZM15.6038 13.0345C15.5166 14.0333 15.1384 14.8863 14.4693 15.5933C13.8001 16.3003 12.977 16.6538 12 16.6538C11.8603 16.6538 11.7206 16.6438 11.5808 16.624C11.4411 16.6042 11.3013 16.5776 11.1615 16.5443C11.041 16.5173 10.9153 16.5204 10.7845 16.5538C10.6538 16.5871 10.5513 16.6506 10.477 16.7443C10.3513 16.8891 10.3119 17.057 10.3588 17.248C10.4054 17.439 10.5166 17.5666 10.6923 17.6308C10.9064 17.7141 11.1228 17.7708 11.3413 17.801C11.5599 17.8312 11.7795 17.8463 12 17.8463C13.3167 17.8463 14.4292 17.3748 15.3375 16.4318C16.2458 15.4888 16.7321 14.3461 16.7962 13.0038L17.2807 13.4443C17.4051 13.5519 17.5464 13.6042 17.7048 13.601C17.8631 13.5978 17.9961 13.5423 18.1038 13.4345C18.2281 13.3102 18.2928 13.1679 18.298 13.0078C18.3032 12.8474 18.2436 12.7051 18.1193 12.5808L16.8828 11.3443C16.7123 11.1738 16.5013 11.0885 16.25 11.0885C15.9987 11.0885 15.7878 11.1738 15.6173 11.3443L14.3807 12.5808C14.2564 12.7051 14.1943 12.8448 14.1943 13C14.1943 13.1552 14.2564 13.2949 14.3807 13.4193C14.5051 13.5436 14.6448 13.6058 14.8 13.6058C14.9552 13.6058 15.0949 13.5436 15.2193 13.4193L15.6038 13.0345ZM7.20375 12.9963L6.71925 12.5558C6.59492 12.4481 6.45358 12.3958 6.29525 12.399C6.13692 12.4022 6.00392 12.4577 5.89625 12.5655C5.77192 12.6898 5.70717 12.8321 5.702 12.9923C5.69683 13.1526 5.75642 13.2949 5.88075 13.4193L7.11725 14.6558C7.28775 14.8263 7.49867 14.9115 7.75 14.9115C8.00133 14.9115 8.21225 14.8263 8.38275 14.6558L9.61925 13.4193C9.74358 13.2949 9.80575 13.1552 9.80575 13C9.80575 12.8448 9.74358 12.7051 9.61925 12.5808C9.49492 12.4564 9.35517 12.3943 9.2 12.3943C9.04483 12.3943 8.90508 12.4564 8.78075 12.5808L8.39625 12.9655C8.48342 11.9667 8.86158 11.1138 9.53075 10.4068C10.1999 9.69975 11.023 9.34625 12 9.34625C12.1397 9.34625 12.2794 9.35617 12.4192 9.376C12.5589 9.39583 12.6954 9.42242 12.8288 9.45575C12.9493 9.48908 13.0765 9.48908 13.2105 9.45575C13.3445 9.42242 13.4487 9.35575 13.523 9.25575C13.6487 9.11092 13.6897 8.943 13.6462 8.752C13.6026 8.561 13.4929 8.43342 13.3173 8.36925C13.0968 8.29875 12.8788 8.24525 12.6635 8.20875C12.4482 8.17208 12.227 8.15375 12 8.15375C10.6833 8.15375 9.57083 8.62525 8.6625 9.56825C7.75417 10.5113 7.26792 11.6539 7.20375 12.9963Z`,"tile-fill":`M5 11C4.591 11 4.23875 10.8523 3.94325 10.5568C3.64775 10.2613 3.5 9.909 3.5 9.5V5C3.5 4.591 3.64775 4.23875 3.94325 3.94325C4.23875 3.64775 4.591 3.5 5 3.5H9.5C9.909 3.5 10.2613 3.64775 10.5568 3.94325C10.8523 4.23875 11 4.591 11 5V9.5C11 9.909 10.8523 10.2613 10.5568 10.5568C10.2613 10.8523 9.909 11 9.5 11H5ZM5 20.5C4.591 20.5 4.23875 20.3523 3.94325 20.0568C3.64775 19.7613 3.5 19.409 3.5 19V14.5C3.5 14.091 3.64775 13.7388 3.94325 13.4433C4.23875 13.1478 4.591 13 5 13H9.5C9.909 13 10.2613 13.1478 10.5568 13.4433C10.8523 13.7388 11 14.091 11 14.5V19C11 19.409 10.8523 19.7613 10.5568 20.0568C10.2613 20.3523 9.909 20.5 9.5 20.5H5ZM14.5 11C14.091 11 13.7388 10.8523 13.4433 10.5568C13.1478 10.2613 13 9.909 13 9.5V5C13 4.591 13.1478 4.23875 13.4433 3.94325C13.7388 3.64775 14.091 3.5 14.5 3.5H19C19.409 3.5 19.7613 3.64775 20.0568 3.94325C20.3523 4.23875 20.5 4.591 20.5 5V9.5C20.5 9.909 20.3523 10.2613 20.0568 10.5568C19.7613 10.8523 19.409 11 19 11H14.5ZM14.5 20.5C14.091 20.5 13.7388 20.3523 13.4433 20.0568C13.1478 19.7613 13 19.409 13 19V14.5C13 14.091 13.1478 13.7388 13.4433 13.4433C13.7388 13.1478 14.091 13 14.5 13H19C19.409 13 19.7613 13.1478 20.0568 13.4433C20.3523 13.7388 20.5 14.091 20.5 14.5V19C20.5 19.409 20.3523 19.7613 20.0568 20.0568C19.7613 20.3523 19.409 20.5 19 20.5H14.5Z`,"transcription-start":[`M9.00195 13.2252C11.2111 13.2252 13.002 11.4343 13.002 9.2252C13.002 7.01606 11.2111 5.2252 9.00195 5.2252C6.79281 5.2252 5.00195 7.01606 5.00195 9.2252C5.00195 11.4343 6.79281 13.2252 9.00195 13.2252Z`,`M9.00195 15.2252C6.33195 15.2252 1.00195 16.5652 1.00195 19.2252V20.2252C1.00195 20.7752 1.45195 21.2252 2.00195 21.2252H16.002C16.552 21.2252 17.002 20.7752 17.002 20.2252V19.2252C17.002 16.5652 11.672 15.2252 9.00195 15.2252ZM15.472 7.9952C15.792 8.7852 15.792 9.6652 15.472 10.4552C15.282 10.9252 15.362 11.4552 15.722 11.8152L15.752 11.8452C16.332 12.4252 17.322 12.3052 17.702 11.5752C18.462 10.1252 18.462 8.4252 17.682 6.9152C17.302 6.1752 16.302 6.0352 15.712 6.6252L15.702 6.6352C15.362 6.9852 15.282 7.5252 15.472 7.9952ZM19.182 3.1152C18.782 3.5152 18.722 4.1352 19.052 4.5952C21.022 7.3352 21.012 11.0052 19.022 13.8452C18.702 14.2952 18.772 14.9152 19.162 15.3052L19.192 15.3352C19.682 15.8252 20.512 15.7852 20.932 15.2352C23.682 11.6952 23.692 6.8652 20.932 3.2152C20.512 2.6652 19.672 2.6252 19.182 3.1152Z`],"transcription-stop":`M15.72 6.63575C15.37 6.98575 15.28 7.51575 15.47 7.98575C15.77 8.73575 15.79 9.56575 15.52 10.3258C15.36 10.7858 15.46 11.3058 15.81 11.6458C16.41 12.2458 17.47 12.1158 17.83 11.3358C18.47 9.94575 18.43 8.34575 17.71 6.92575C17.31 6.17575 16.3 6.04575 15.72 6.63575ZM19.18 3.11575C18.78 3.51575 18.72 4.13575 19.05 4.59575C20.98 7.27575 21 10.8458 19.14 13.6658C18.83 14.1258 18.91 14.7458 19.3 15.1358C19.81 15.6458 20.68 15.5958 21.11 15.0058C23.68 11.4958 23.63 6.80575 20.94 3.23575C20.51 2.67575 19.68 2.61575 19.18 3.11575ZM9.43 5.26575L12.96 8.79575C12.76 6.93575 11.29 5.46575 9.43 5.26575ZM3.71 3.78575C3.32 4.17575 3.32 4.80575 3.71 5.19575L5.62 7.10575C5.06 7.99575 4.83 9.11575 5.15 10.3058C5.51 11.6358 6.59 12.7058 7.92 13.0758C9.11 13.4058 10.23 13.1658 11.12 12.6058L15.52 17.0058C13.74 15.8258 10.78 15.2258 9 15.2258C6.33 15.2258 1 16.5658 1 19.2258V20.2258C1 20.7758 1.45 21.2258 2 21.2258H16C16.55 21.2258 17 20.7758 17 20.2258V19.2258C17 18.8558 16.89 18.5258 16.71 18.2058L19.02 20.5158C19.41 20.9058 20.04 20.9058 20.43 20.5158C20.82 20.1258 20.82 19.4958 20.43 19.1058L5.12 3.78575C4.73 3.39575 4.1 3.39575 3.71 3.78575Z`,unpin:`M14.1851 11.3595L7.56988 4.74425C7.49172 4.66608 7.43655 4.58658 7.40438 4.50575C7.37238 4.42508 7.35638 4.33791 7.35638 4.24425C7.35638 4.05458 7.42022 3.88308 7.54788 3.72975C7.67538 3.57658 7.8513 3.5 8.07563 3.5H15.7506C15.9631 3.5 16.1412 3.57216 16.2849 3.7165C16.4287 3.86066 16.5006 4.03941 16.5006 4.25275C16.5006 4.45341 16.4135 4.59991 16.2391 4.69225C16.0648 4.78458 15.902 4.88716 15.7506 5H15.5006V10.8077C15.5006 11.1531 15.343 11.3929 15.0276 11.5272C14.7121 11.6616 14.4313 11.6057 14.1851 11.3595ZM11.2506 21V15.5H8.17963C7.81247 15.5 7.51872 15.3717 7.29838 15.1152C7.07822 14.8589 6.96813 14.5731 6.96813 14.2577C6.96813 14.1001 6.99955 13.9438 7.06238 13.789C7.12522 13.6343 7.22647 13.4867 7.36613 13.3462L8.50063 12.2115V10.6385L2.65838 4.76525C2.51988 4.62691 2.44647 4.4555 2.43813 4.251C2.4298 4.0465 2.50388 3.866 2.66038 3.7095C2.80388 3.566 2.97888 3.49425 3.18538 3.49425C3.39172 3.49425 3.5673 3.56666 3.71213 3.7115L19.8891 19.8885C20.0378 20.0372 20.1111 20.2137 20.1091 20.4182C20.1073 20.6227 20.0288 20.8032 19.8736 20.9597C19.7185 21.1032 19.5428 21.1775 19.3466 21.1825C19.1506 21.1877 18.975 21.1127 18.8199 20.9575L13.3621 15.5H12.7506V21C12.7506 21.2125 12.6787 21.3906 12.5349 21.5342C12.391 21.6781 12.2129 21.75 12.0004 21.75C11.7877 21.75 11.6096 21.6781 11.4661 21.5342C11.3225 21.3906 11.2506 21.2125 11.2506 21Z`,video:`M15 8V16H5V8H15ZM16 6H4C3.45 6 3 6.45 3 7V17C3 17.55 3.45 18 4 18H16C16.55 18 17 17.55 17 17V13.5L21 17.5V6.5L17 10.5V7C17 6.45 16.55 6 16 6Z`,"video-fill":`M17.332 10.5V7C17.332 6.45 16.882 6 16.332 6H4.33203C3.78203 6 3.33203 6.45 3.33203 7V17C3.33203 17.55 3.78203 18 4.33203 18H16.332C16.882 18 17.332 17.55 17.332 17V13.5L19.622 15.79C20.252 16.42 21.332 15.97 21.332 15.08V8.91C21.332 8.02 20.252 7.57 19.622 8.2L17.332 10.5Z`,"video-off":`M9.98969 8.57005L7.98969 6.57005L3.83969 2.43005L2.42969 3.84005L5.15969 6.57005H4.42969C3.87969 6.57005 3.42969 7.02005 3.42969 7.57005V17.5701C3.42969 18.1201 3.87969 18.5701 4.42969 18.5701H16.4297C16.6397 18.5701 16.8197 18.4901 16.9797 18.3901L20.1597 21.5701L21.5697 20.1601L12.7097 11.3001L9.98969 8.57005ZM5.42969 16.5701V8.57005H7.15969L15.1597 16.5701H5.42969ZM15.4297 8.57005V11.1801L21.4297 17.1801V7.07005L17.4297 11.0701V7.57005C17.4297 7.02005 16.9797 6.57005 16.4297 6.57005H10.8197L12.8197 8.57005H15.4297Z`,"video-off-fill":`M17.768 10.8844L20.514 8.13811C20.6615 7.99061 20.8273 7.95378 21.0113 8.02761C21.1953 8.10128 21.2873 8.24194 21.2873 8.44961V15.5496C21.2873 15.7573 21.1953 15.8979 21.0113 15.9716C20.8273 16.0454 20.6615 16.0086 20.514 15.8611L17.6603 13.0074V13.1804C17.5578 13.4522 17.3523 13.6275 17.044 13.7064C16.7357 13.7852 16.4648 13.7079 16.2315 13.4746L8.79301 6.03611C8.64551 5.88878 8.56092 5.73144 8.53926 5.56411C8.51742 5.39678 8.54176 5.23103 8.61226 5.06686C8.68276 4.90286 8.78659 4.76728 8.92376 4.66011C9.06092 4.55311 9.23334 4.49961 9.44101 4.49961H15.9603C16.4654 4.49961 16.893 4.67461 17.243 5.02461C17.593 5.37461 17.768 5.80219 17.768 6.30736V10.8844ZM19.4448 21.6304L2.06026 4.24586C1.92192 4.10736 1.85109 3.93328 1.84776 3.72361C1.84459 3.51411 1.91542 3.33686 2.06026 3.19186C2.20526 3.04703 2.38092 2.97461 2.58726 2.97461C2.79359 2.97461 2.96926 3.04703 3.11426 3.19186L20.4988 20.5764C20.6373 20.7149 20.7081 20.8889 20.7113 21.0986C20.7144 21.3083 20.6436 21.4855 20.4988 21.6304C20.3539 21.7752 20.1783 21.8476 19.9718 21.8476C19.7654 21.8476 19.5898 21.7752 19.4448 21.6304ZM4.44101 4.51886L17.7488 17.8266C17.7168 18.2933 17.5305 18.6888 17.19 19.0131C16.8497 19.3374 16.4398 19.4996 15.9603 19.4996H4.57576C4.07059 19.4996 3.64301 19.3246 3.29301 18.9746C2.94301 18.6246 2.76801 18.197 2.76801 17.6919V6.30736C2.76801 5.82786 2.93017 5.41794 3.25451 5.07761C3.57884 4.73711 3.97434 4.55086 4.44101 4.51886Z`,"virtual-background":`M4 5C4 4.45 4.45 4 5 4H10C10.55 4 11 3.55 11 3C11 2.45 10.55 2 10 2H4C2.9 2 2 2.9 2 4V10C2 10.55 2.45 11 3 11C3.55 11 4 10.55 4 10V5ZM9.61 13.49L6.65 17.19C6.39 17.52 6.62 18 7.04 18H17C17.41 18 17.65 17.53 17.4 17.2L15.4 14.53C15.2 14.26 14.8 14.26 14.6 14.53L12.97 16.71L10.39 13.49C10.19 13.24 9.81 13.24 9.61 13.49ZM17 8.5C17 7.67 16.33 7 15.5 7C14.67 7 14 7.67 14 8.5C14 9.33 14.67 10 15.5 10C16.33 10 17 9.33 17 8.5ZM20 2H14C13.45 2 13 2.45 13 3C13 3.55 13.45 4 14 4H19C19.55 4 20 4.45 20 5V10C20 10.55 20.45 11 21 11C21.55 11 22 10.55 22 10V4C22 2.9 21.1 2 20 2ZM20 19C20 19.55 19.55 20 19 20H14C13.45 20 13 20.45 13 21C13 21.55 13.45 22 14 22H20C21.1 22 22 21.1 22 20V14C22 13.45 21.55 13 21 13C20.45 13 20 13.45 20 14V19ZM3 13C2.45 13 2 13.45 2 14V20C2 21.1 2.9 22 4 22H10C10.55 22 11 21.55 11 21C11 20.45 10.55 20 10 20H5C4.45 20 4 19.55 4 19V14C4 13.45 3.55 13 3 13Z`,wave:`M7.375 16.8077V7.19225C7.375 6.97975 7.44692 6.80167 7.59075 6.658C7.73458 6.51417 7.91275 6.44225 8.12525 6.44225C8.33792 6.44225 8.516 6.51417 8.6595 6.658C8.80317 6.80167 8.875 6.97975 8.875 7.19225V16.8077C8.875 17.0203 8.80308 17.1983 8.65925 17.342C8.51542 17.4858 8.33725 17.5577 8.12475 17.5577C7.91208 17.5577 7.734 17.4858 7.5905 17.342C7.44683 17.1983 7.375 17.0203 7.375 16.8077ZM11.25 20.75V3.25C11.25 3.0375 11.3219 2.85942 11.4658 2.71575C11.6096 2.57192 11.7878 2.5 12.0003 2.5C12.2129 2.5 12.391 2.57192 12.5345 2.71575C12.6782 2.85942 12.75 3.0375 12.75 3.25V20.75C12.75 20.9625 12.6781 21.1406 12.5343 21.2843C12.3904 21.4281 12.2122 21.5 11.9998 21.5C11.7871 21.5 11.609 21.4281 11.4655 21.2843C11.3218 21.1406 11.25 20.9625 11.25 20.75ZM3.5 12.9038V11.0962C3.5 10.8837 3.57192 10.7056 3.71575 10.5617C3.85958 10.4181 4.03775 10.3462 4.25025 10.3462C4.46292 10.3462 4.641 10.4181 4.7845 10.5617C4.92817 10.7056 5 10.8837 5 11.0962V12.9038C5 13.1163 4.92808 13.2944 4.78425 13.4383C4.64042 13.5819 4.46225 13.6538 4.24975 13.6538C4.03708 13.6538 3.859 13.5819 3.7155 13.4383C3.57183 13.2944 3.5 13.1163 3.5 12.9038ZM15.125 16.8077V7.19225C15.125 6.97975 15.1969 6.80167 15.3408 6.658C15.4846 6.51417 15.6628 6.44225 15.8753 6.44225C16.0879 6.44225 16.266 6.51417 16.4095 6.658C16.5532 6.80167 16.625 6.97975 16.625 7.19225V16.8077C16.625 17.0203 16.5531 17.1983 16.4093 17.342C16.2654 17.4858 16.0872 17.5577 15.8748 17.5577C15.6621 17.5577 15.484 17.4858 15.3405 17.342C15.1968 17.1983 15.125 17.0203 15.125 16.8077ZM19 12.9038V11.0962C19 10.8837 19.0719 10.7056 19.2158 10.5617C19.3596 10.4181 19.5378 10.3462 19.7502 10.3462C19.9629 10.3462 20.141 10.4181 20.2845 10.5617C20.4282 10.7056 20.5 10.8837 20.5 11.0962V12.9038C20.5 13.1163 20.4281 13.2944 20.2843 13.4383C20.1404 13.5819 19.9622 13.6538 19.7498 13.6538C19.5371 13.6538 19.359 13.5819 19.2155 13.4383C19.0718 13.2944 19 13.1163 19 12.9038Z`},Icon=({name:e,size:D=24,fill:O})=>{let k=typeof PATH_MAP[e]==`string`?[PATH_MAP[e]]:PATH_MAP[e];return(0,react_jsx_runtime.jsx)(react_native_svg.default,{width:D,height:D,viewBox:`0 0 24 24`,fill:`none`,children:k.map((e,D)=>(0,react_jsx_runtime.jsx)(react_native_svg.Path,{d:e,fill:O},D))})};var Icon_native_default=Icon;const POPUP_MENU_WIDTH=180,DISABLED_OPTION_OPACITY=.5,PopupMenu=({visible:e,onClose:D,options:O,anchorLayout:k})=>{let A=(0,react.useRef)(new react_native.Animated.Value(.7)).current,j=useBaseStore(e=>e.callContainerDimension);if(react.default.useEffect(()=>{e?react_native.Animated.spring(A,{toValue:1,useNativeDriver:!0,friction:12,tension:200}).start():A.setValue(.7)},[A,e]),!e||!k)return null;let{x:M,y:N,height:P}=k,F=j.width-180-10,I=j.height>>1<N;return(0,react_jsx_runtime.jsx)(react_native.Modal,{transparent:!0,animationType:`none`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],onRequestClose:D,children:(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$30.backdrop,onPress:D,testID:`cometchat-popup-menu-backdrop`,accessible:!1,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$30.menu,{[I?`bottom`:`top`]:I?j.height-(N-4):N+P+4,left:Math.min(F,M),transform:[{scale:A},{translateY:A.interpolate({inputRange:[.7,1],outputRange:[-40,0]})}]}],children:O.map((e,O)=>(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{onPress:O=>{if(e.selected){O.stopPropagation();return}e.onPress(),D()},activeOpacity:e.selected?DISABLED_OPTION_OPACITY:.2,style:[styles$30.menuItem,e.selected?styles$30.menuItemSelected:{}],testID:`cometchat-popup-menu-option-${O}`,accessible:!0,accessibilityLabel:e.label,children:[e.iconName&&(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e.iconName,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$30.menuText],children:e.label})]},O))})})})},styles$30=react_native.StyleSheet.create({backdrop:{flex:1},menu:{position:`absolute`,backgroundColor:`#141414`,borderWidth:1,borderColor:`#383838`,borderRadius:16,paddingVertical:8,width:180,shadowColor:`#000`,shadowOpacity:.3,shadowRadius:8,shadowOffset:{width:0,height:4},elevation:8,overflow:`hidden`},menuItem:{flexDirection:`row`,alignItems:`center`,paddingVertical:8,paddingHorizontal:16,height:40,gap:8},menuItemSelected:{opacity:DISABLED_OPTION_OPACITY},menuText:{color:`#FFFFFF`,flex:1},iconPlaceholder:{width:24,height:24,backgroundColor:`#858585`,borderRadius:4}});var Popup_default=PopupMenu;const styles$5=react_native.StyleSheet.create({participantItem:{flexDirection:`row`,alignItems:`center`,paddingVertical:12,paddingHorizontal:16,gap:12,backgroundColor:`#1A1A1A`},participantText:{flexDirection:`column`,alignItems:`flex-start`,gap:4,flexGrow:1,flexShrink:1},participantName:{color:`#ffffff`},participantDescription:{color:`#989898`},participantIcons:{flexDirection:`row`,alignItems:`center`,gap:12,flexShrink:0},avatar:{backgroundColor:`#3E3180`},moreButton:{width:28,height:28,justifyContent:`center`,alignItems:`center`,borderRadius:1e3,backgroundColor:`#262626`}}),MoreOptionButton=({ruid:e})=>{let[D,O]=(0,react.useState)(!1),k=(0,react.useRef)(null),[A,j]=(0,react.useState)({x:0,y:0,width:0,height:0}),M=useAllParticipants().find(D=>D.ruid===e),N=useLocalParticipant(),P=useIsParticipantPinned(M?.pid,M?.type),F=useTrackMuted(MEDIA_TYPE.AUDIO,M?.pid),I=(0,react.useMemo)(()=>{let e=[{label:P?`Unpin`:`Pin`,iconName:P?`unpin`:`pin`,onPress:()=>{P?unpinParticipant():pinParticipant(M.pid,M.type)}}];return M&&N.role===`moderator`&&M.pid!==N.pid&&(F||e.push({label:`Mute Audio`,iconName:`mic-off`,onPress:()=>{muteParticipant(M.pid)}})),e},[P,M,N.role,N.pid,F]);return M?(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{ref:k,style:styles$5.moreButton,onPress:()=>{k.current&&k.current.measureInWindow((e,D,k,A)=>{j({x:e,y:D,width:k,height:A}),O(!0)})},testID:`cometchat-participant-more-options-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`more`,size:20,fill:`#767676`})}),(0,react_jsx_runtime.jsx)(PopupMenu,{visible:D,anchorLayout:A,onClose:()=>O(!1),options:I})]}):null};var MoreOptionButton_default=MoreOptionButton;const LabelIcon=({type:e,muted:D,raisedHandTimestamp:O})=>e===`screen-share`?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`screen-share`,size:16,fill:`#858585`}):O?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`raise-hand-fill`,size:16,fill:`#141414`}):D?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`mic-off-fill`,size:16,fill:`#858585`}):(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`wave`,size:16,fill:`#0B9F5D`}),Label=({participant:e,style:D})=>{let{name:O,isLocal:k,type:A,pid:j}=e,M=useTrackMuted(MEDIA_TYPE.AUDIO,j),N=useRaisedHandTimestamp(j,A),P=useIsParticipantPinned(j,A);return(0,react_jsx_runtime.jsxs)(react_native.View,{style:[styles$29.userLabel,N?styles$29.userLabelRaisedHand:{},D],children:[P&&(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`pin`,size:16,fill:N?`#141414`:`#FFF`}),(0,react_jsx_runtime.jsx)(LabelIcon,{type:A,muted:M,raisedHandTimestamp:N}),(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.caption1Regular,styles$29.userName,N?styles$29.userNameRaisedHand:{}],numberOfLines:1,ellipsizeMode:`tail`,children:[O,` `,k&&`(You)`]})]})},styles$29=react_native.StyleSheet.create({userLabel:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,padding:4,position:`absolute`,left:4,bottom:4,backgroundColor:`#141414CC`,borderRadius:4,gap:2,maxWidth:`95%`},userLabelRaisedHand:{backgroundColor:`#FFFFFF`,borderRadius:1e3,shadowColor:`#000`,shadowOffset:{width:0,height:4},shadowOpacity:.2,shadowRadius:10,elevation:5},userName:{color:`#ffffff`,flexShrink:1},userNameRaisedHand:{color:`#141414`}});var Label_native_default=Label;const VideoNative=({videoTrack:e,style:D,objectFit:O=`cover`,mirror:k=!1,muted:A=!1,zOrder:j=0})=>{let[M,N]=(0,react.useState)(null),P=(0,react.useRef)(new react_native.Animated.Value(A?0:1)).current;return(0,react.useEffect)(()=>{e&&N(e.getOriginalStream())},[e]),(0,react.useEffect)(()=>{react_native.Animated.timing(P,{toValue:A?0:1,duration:300,useNativeDriver:!0}).start()},[A,P]),M?(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$28.videoContainer,{opacity:P}],children:(0,react_jsx_runtime.jsx)(react_native_webrtc.RTCView,{streamURL:M.toURL(),style:[styles$28.video,D],objectFit:O,mirror:k,zOrder:j})}):null},styles$28=react_native.StyleSheet.create({videoContainer:{height:`100%`,width:`100%`},video:{width:`100%`,height:`100%`}});var Video_native_default$1=VideoNative;const Tile=({participant:e,style:D,zOrder:O,showLabel:k=!0,disablePress:A=!1})=>{let{name:j,avatar:M,type:N,pid:P,ruid:F,isLocal:I}=e,L=useTrackByParticipantId(P,N===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO)?.originalTrack,z=useTrackMuted(N===`screen-share`?MEDIA_TYPE.SCREENSHARE:MEDIA_TYPE.VIDEO,P),B=useEnableParticipantContextMenu(),H=useShouldMirrorLocalVideo(),[W,G]=react.default.useMemo(()=>{let e=react_native.StyleSheet.flatten(D),O=e?.width,k=e?.height;if(typeof O==`number`&&typeof k==`number`){let e=Math.min(Math.min(O,k)>>1,120);return[e,e>>1]}return[48,24]},[D]);return(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{activeOpacity:1,disabled:A,style:[styles$27.callScreen,D],testID:`cometchat-tile-${P}`,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$27.tileAvatar,children:(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:j,imageUrl:M,size:W,fontSize:G})}),(0,react_jsx_runtime.jsx)(Video_native_default$1,{videoTrack:L,objectFit:N===`screen-share`?`contain`:`cover`,muted:z,zOrder:O,mirror:I&&N!==`screen-share`&&H}),k&&(0,react_jsx_runtime.jsx)(Label_native_default,{participant:e}),B&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$27.rightTopButton,children:(0,react_jsx_runtime.jsx)(MoreOptionButton_default,{ruid:F})})]})},styles$27=react_native.StyleSheet.create({callScreen:{width:`100%`,height:`100%`,backgroundColor:`#272727`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,overflow:`hidden`},tileAvatar:{width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`,flexShrink:0},rightTopButton:{position:`absolute`,top:4,right:4}});var Tile_native_default=Tile;const Badge=({size:e=40,text:D})=>(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$26.overflowCircle,{width:e,height:e,borderRadius:e/2}],children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Medium,styles$26.overflowText],children:D})}),GroupAvatarTile=({startIndex:e=4,style:D})=>{let O=useAllParticipants(),k=O.length,A=Math.max(0,k-e-3),j=O.slice(e,e+(A===1?4:3));return(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{testID:`cometchat-group-avatar-tile`,style:[styles$26.container,D],onPress:toggleParticipantListVisible,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$26.row,children:j.slice(0,2).map(e=>(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:e.name,imageUrl:e.avatar},e.ruid))}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$26.row,children:[j[2]&&(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:j[2].name,imageUrl:j[2].avatar}),j[3]?(0,react_jsx_runtime.jsx)(Avatar_native_default,{size:40,name:j[3].name,imageUrl:j[3].avatar}):null,A>1&&(0,react_jsx_runtime.jsx)(Badge,{size:40,text:`+${A}`})]})]})};var GroupAvatarTile_native_default=GroupAvatarTile;const styles$26=react_native.StyleSheet.create({container:{justifyContent:`center`,alignItems:`center`,gap:8,backgroundColor:`#272727`,borderRadius:8},row:{flexDirection:`row`,gap:8},overflowCircle:{backgroundColor:`#3E3180`,alignItems:`center`,justifyContent:`center`},overflowText:{color:`white`}}),useSidebarTileLayout=()=>{let e=useAllParticipants().length,D=useBaseStore(e=>e.mainAreaDimension);return react.default.useMemo(()=>{e>1&&e++;let O=D.width,k=D.height,A=0,j=0,M=1,N=1;return e===2?(A=D.width,j=9/16*A,k=D.height-8-j):e===3?(A=(D.width-8)/2,j=3/4*A,k=D.height-8-j,N=2):e===4?(A=(D.width-16)/3,j=A,k=D.height-8-j,N=3):e>=5&&(A=(D.width-8)/2,j=3/4*A,k=D.height-16-j*2,M=2,N=2),{tileWidthFirst:O,tileHeightFirst:k,tileWidthOther:A,tileHeightOther:j,numberOfRows:M,numberOfCols:N}},[e,D.width,D.height])};function SidebarLayout(){let e=useAllParticipants(),D=useSidebarTileLayout(),O=useMainParticipant(),k=e.length>1?[O].concat(e):[O];return(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-sidebar-layout`,style:styles$25.container,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:k[0],style:{width:D.tileWidthFirst,height:D.tileHeightFirst}}),D.numberOfRows>=1&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$25.row,children:k.slice(1,1+D.numberOfCols).map(e=>(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e,style:{width:D.tileWidthOther,height:D.tileHeightOther}},e.ruid))}),D.numberOfRows>=2&&(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$25.row,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:k[3],style:{width:D.tileWidthOther,height:D.tileHeightOther}},k[3].ruid),k.length===5&&(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:k[4],style:{width:D.tileWidthOther,height:D.tileHeightOther}},k[4].ruid),k.length>5&&(0,react_jsx_runtime.jsx)(GroupAvatarTile_native_default,{startIndex:3,style:{width:D.tileWidthOther,height:D.tileHeightOther}})]})]})}const styles$25=react_native.StyleSheet.create({container:{gap:8},row:{flexDirection:`row`,justifyContent:`center`,gap:8}});var SidebarLayout_native_default=SidebarLayout;const Pan=({layout:e,children:D,margin:O=8,disableDrag:k=!1})=>{let A=e.width/4,j=e.height/4,M=(0,react.useRef)(new react_native.Animated.ValueXY({x:e.width-A-O,y:e.height-j-O})).current,N=(0,react.useRef)(react_native.PanResponder.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:()=>{M.extractOffset()},onPanResponderMove:react_native.Animated.event([null,{dx:M.x,dy:M.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{M.flattenOffset()}})).current;return(0,react.useEffect)(()=>{M.setValue({x:e.width-A-O,y:e.height-j-O})},[e,M,A,j,O]),e.width<A+O*2||e.height<j+O*2?null:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{...k?{}:N.panHandlers,style:[styles$24.box,{width:A,height:j},{transform:[{translateX:M.x.interpolate({inputRange:[O,e.width-A-O],outputRange:[O,e.width-A-O],extrapolate:`clamp`})},{translateY:M.y.interpolate({inputRange:[O,e.height-j-O],outputRange:[O,e.height-j-O],extrapolate:`clamp`})}]}],children:D})},styles$24=react_native.StyleSheet.create({box:{position:`absolute`,borderRadius:10,overflow:`hidden`}}),Spotlight=()=>{let e=useMainParticipant(),D=useAllParticipants(),O=useBaseStore(e=>e.mainAreaDimension),k=useConfigStore(e=>e.enableSpotlightDrag),A=useConfigStore(e=>e.enableSpotlightSwap),j=[e],M=D.find(D=>D.ruid!==e.ruid);return M&&j.push(M),(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-spotlight-layout`,children:[(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:j[0],disablePress:!0},j[0].ruid),j[1]&&(0,react_jsx_runtime.jsx)(Pan,{disableDrag:!k,layout:{width:O.width,height:O.height},children:(0,react_jsx_runtime.jsx)(Tile_native_default,{showLabel:!1,disablePress:!A,participant:j[1],style:styles$23.panTile,zOrder:1},j[1].ruid)})]})},styles$23=react_native.StyleSheet.create({panTile:{borderColor:`#1A1A1A`,borderWidth:2}}),getTileDimensions=({layout:e,participantCount:D})=>{if(D<4)return{tileWidth:e.width,tileHeight:(e.height-8*(D-1))/D};let O=e.width/2;return{tileWidth:O,tileHeight:Math.max(e.height/Math.ceil(D/2),O*9/16)}};function TileLayout(){let e=useAllParticipants(),D=useBaseStore(e=>e.isPIPLayoutEnabled),O=useMainParticipant(),k=getTileDimensions({layout:useBaseStore(e=>e.mainAreaDimension),participantCount:D?1:e.length});return(0,react_jsx_runtime.jsx)(react_native.FlatList,{testID:`cometchat-tile-layout`,data:D?[O]:e,renderItem:({item:e})=>(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e,style:{width:k.tileWidth,height:k.tileHeight}}),keyExtractor:e=>e.ruid,contentContainerStyle:styles$22.contentContainerStyle,showsVerticalScrollIndicator:!1,onViewableItemsChanged:e=>{e.viewableItems.length},showsHorizontalScrollIndicator:!1,horizontal:!1,numColumns:e.length<4?1:2,...e.length<4?{}:{columnWrapperStyle:{gap:8}}},e.length<4?1:2)}const styles$22=react_native.StyleSheet.create({contentContainerStyle:{alignItems:`center`,gap:8,paddingHorizontal:20}});var TileLayout_default=TileLayout;function ProcessingOverlay({message:e,visible:D=!0,animated:O=!1}){let k=(0,react.useRef)(new react_native.Animated.Value(1)).current,[A,j]=(0,react.useState)(!0);return(0,react.useEffect)(()=>{D?(k.setValue(1),j(!0)):O?react_native.Animated.timing(k,{toValue:0,duration:300,useNativeDriver:!0}).start(()=>{j(!1)}):j(!1)},[k,D,O]),A?(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$21.overlay,{opacity:k}],children:[(0,react_jsx_runtime.jsx)(react_native.ActivityIndicator,{size:`large`,color:`#fff`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$21.text],children:e})]}):null}const styles$21=react_native.StyleSheet.create({overlay:{justifyContent:`center`,alignItems:`center`,backgroundColor:`#1A1A1A`,zIndex:2},text:{color:`#fff`,textAlign:`center`,margin:16}});function CallStage(){let e=useBaseStore(e=>e.mainAreaDimension),D=useLayout(),O=useIsReconnecting(),k=e.width>0&&e.height>0;return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$20.container,onLayout:e=>{useBaseStore.setState({mainAreaDimension:{width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}})},children:[D===LAYOUT.TILE&&k&&(0,react_jsx_runtime.jsx)(TileLayout_default,{}),D===LAYOUT.SPOTLIGHT&&k&&(0,react_jsx_runtime.jsx)(Spotlight,{}),D===LAYOUT.SIDEBAR&&k&&(0,react_jsx_runtime.jsx)(SidebarLayout_native_default,{}),O&&(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`You've been disconnected. Attempting to reconnect…`})]})}const styles$20=react_native.StyleSheet.create({container:{flex:1,marginHorizontal:20,marginVertical:8}});var CallStage_native_default=CallStage;const STICK_TO_BOTTOM_THRESHOLD=24,MAINTAIN_VISIBLE_CONTENT_POSITION={minIndexForVisible:0,autoscrollToTopThreshold:24},Separator=()=>(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$19.separator});function ClosedCaptions(){let e=useTranscriptionMessages(),D=useShowLiveCaption(),{t:O}=useTranslation(),k=(0,react.useRef)(null),[A,j]=(0,react.useState)(!1),M=(0,react.useMemo)(()=>e.slice().reverse(),[e]),N=(0,react.useCallback)(e=>{let D=e.nativeEvent.contentOffset.y>24;j(e=>e===D?e:D)},[]),P=(0,react.useCallback)(()=>{k.current?.scrollToOffset({offset:0,animated:!0}),j(!1)},[]),F=(0,react.useCallback)(({item:e})=>{let D=e.participant?.name??``,O=e.transcript.map(e=>e.text).join(` `);return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$19.row,children:[(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:D,imageUrl:e.participant?.avatar_url,size:40}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$19.content,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption1Regular,styles$19.name],numberOfLines:1,children:D}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Regular,styles$19.text],children:O})]})]})},[]);return D?(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$19.wrapper,children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$19.container,children:[M.length<1?(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$19.panel,styles$19.empty],children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Regular,styles$19.emptyText],children:O(`closedCaptions.emptyState`)})}):(0,react_jsx_runtime.jsx)(react_native.FlatList,{ref:k,style:styles$19.panel,contentContainerStyle:styles$19.listContent,data:M,inverted:!0,keyExtractor:e=>e.message_id,renderItem:F,ItemSeparatorComponent:Separator,onScrollEndDrag:N,onMomentumScrollEnd:N,showsVerticalScrollIndicator:!0,maintainVisibleContentPosition:MAINTAIN_VISIBLE_CONTENT_POSITION}),A&&(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:styles$19.scrollButton,onPress:P,activeOpacity:.7,accessibilityLabel:`Scroll to latest caption`,testID:`cometchat-closed-captions-scroll-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`arrow-down-2`,size:24,fill:colors.static.white})})]})}):null}const styles$19=react_native.StyleSheet.create({wrapper:{width:`100%`,paddingHorizontal:16},container:{position:`relative`,width:`100%`,alignSelf:`center`},panel:{width:`100%`,height:160,backgroundColor:colors.background[1],borderRadius:12,overflow:`hidden`},listContent:{paddingVertical:8,paddingHorizontal:16},separator:{height:12},empty:{alignItems:`center`,justifyContent:`center`,paddingHorizontal:16},emptyText:{color:colors.text.secondary,textAlign:`center`},row:{flexDirection:`row`,alignItems:`flex-start`,width:`100%`,gap:12},content:{flex:1,minHeight:38,flexDirection:`column`,alignItems:`flex-start`},name:{width:`100%`,color:colors.text.secondary},text:{width:`100%`,color:colors.text.primary},scrollButton:{position:`absolute`,width:32,height:32,right:4,bottom:4,alignItems:`center`,justifyContent:`center`,backgroundColor:colors.primary,borderRadius:8}});var ClosedCaptions_native_default=ClosedCaptions;const initialState={title:``,description:``,cancelText:``,confirmText:``,visible:!1,inputPlaceholder:``,inputValue:``,secondInputPlaceholder:``,secondInputValue:``},useConfirmationDialogStore=(0,zustand.create)((0,zustand_middleware.combine)(initialState,e=>({onCancel:()=>{e({visible:!1})},onConfirm:()=>{e({visible:!1})},onBackdropClick:()=>{e({visible:!1})},reset:()=>{e(initialState)}})));function reset(){useConfirmationDialogStore.setState(initialState),useConfirmationDialogStore.setState({onCancel:()=>{useConfirmationDialogStore.setState({visible:!1})},onConfirm:()=>{useConfirmationDialogStore.setState({visible:!1})},onBackdropClick:()=>{useConfirmationDialogStore.setState({visible:!1})}})}function showConfirmationDialog(e,D,O,k,A=()=>{},j=()=>{},M,N){useConfirmationDialogStore.setState({title:e,description:D,confirmText:O,cancelText:k,inputPlaceholder:M,inputValue:``,secondInputPlaceholder:N,secondInputValue:``,onConfirm:()=>{let{inputValue:e,secondInputValue:D}=useConfirmationDialogStore.getState();A(M?e.trim():void 0,N?D.trim():void 0),reset()},onCancel:()=>{j(),reset()},visible:!0})}const{width}=react_native.Dimensions.get(`window`),styles$18=react_native.StyleSheet.create({keyboardAvoidingView:{flex:1},backdrop:{flex:1,backgroundColor:`rgba(0, 0, 0, 0.8)`,justifyContent:`center`,alignItems:`center`,zIndex:1e3},dialog:{maxWidth:372,width:width*.9,backgroundColor:colors.background[1],borderWidth:1,borderColor:colors.border.default,borderRadius:spacing[3],paddingTop:padding[8],paddingHorizontal:padding[5],paddingBottom:padding[5],shadowColor:`#101828`,shadowOffset:{width:0,height:4},shadowOpacity:.08,shadowRadius:6,elevation:4},content:{alignItems:`center`,gap:spacing[5]},textContainer:{alignItems:`flex-start`,gap:spacing[2],width:`100%`},title:{...commonStyles.heading2Medium,color:colors.text.primary,textAlign:`center`,width:`100%`},description:{...commonStyles.bodyRegular,color:colors.text.secondary,textAlign:`center`,width:`100%`,lineHeight:16.8},input:{...commonStyles.bodyRegular,width:`100%`,height:40,borderWidth:1,borderColor:colors.border.default,borderRadius:borderRadius[2],paddingHorizontal:padding[3],color:colors.text.primary},buttonsContainer:{flexDirection:`row`,alignItems:`center`,gap:spacing[3],width:`100%`},button:{height:40,paddingVertical:padding[2],paddingHorizontal:padding[5],justifyContent:`center`,alignItems:`center`,borderRadius:borderRadius[2],flex:1,borderWidth:1},buttonSecondary:{backgroundColor:`transparent`,borderColor:colors.border.dark},buttonPrimary:{backgroundColor:colors.button.primaryBackground,borderColor:colors.button.primaryBackground},buttonDisabled:{opacity:.5},buttonText:{...commonStyles.buttonMedium,textAlign:`center`},buttonTextSecondary:{color:colors.button.secondaryText},buttonTextPrimary:{color:colors.button.primaryText}});function ConfirmationDialog(){let{title:e,description:D,cancelText:O,confirmText:k,onCancel:A,onConfirm:j,onBackdropClick:M,visible:N,inputPlaceholder:P,inputValue:F,secondInputPlaceholder:I,secondInputValue:L}=useConfirmationDialogStore(),R=!!P&&!F.trim(),z=()=>{M&&M()};return(0,react_jsx_runtime.jsx)(react_native.Modal,{visible:N,transparent:!0,animationType:`fade`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],onRequestClose:z,children:(0,react_jsx_runtime.jsx)(react_native.KeyboardAvoidingView,{style:styles$18.keyboardAvoidingView,behavior:react_native.Platform.OS===`ios`?`padding`:void 0,children:(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$18.backdrop,onPress:z,testID:`cometchat-confirmation-dialog-backdrop`,accessible:!1,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$18.dialog,children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.content,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.textContainer,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$18.title,children:e}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$18.description,children:D})]}),P?(0,react_jsx_runtime.jsx)(react_native.TextInput,{style:styles$18.input,placeholder:P,placeholderTextColor:colors.text.secondary,value:F,onChangeText:e=>useConfirmationDialogStore.setState({inputValue:e}),autoCapitalize:`none`,autoCorrect:!1,testID:`cometchat-confirmation-dialog-input`}):null,I?(0,react_jsx_runtime.jsx)(react_native.TextInput,{style:styles$18.input,placeholder:I,placeholderTextColor:colors.text.secondary,value:L,onChangeText:e=>useConfirmationDialogStore.setState({secondInputValue:e}),autoCapitalize:`none`,autoCorrect:!1,testID:`cometchat-confirmation-dialog-second-input`}):null,(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$18.buttonsContainer,children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$18.button,styles$18.buttonSecondary],onPress:A,testID:`cometchat-confirmation-dialog-cancel-button`,accessible:!0,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[styles$18.buttonText,styles$18.buttonTextSecondary],children:O})}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$18.button,styles$18.buttonPrimary,R&&styles$18.buttonDisabled],onPress:j,disabled:R,testID:`cometchat-confirmation-dialog-confirm-button`,accessible:!0,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[styles$18.buttonText,styles$18.buttonTextPrimary],children:k})})]})]})})})})})}const SCREEN_HEIGHT=react_native.Dimensions.get(`window`).height,BottomSheet=({children:e,isVisible:D,onClose:O,maxHeight:k=SCREEN_HEIGHT*.4,testID:A})=>{let j=SCREEN_HEIGHT-k,M=(0,react.useRef)(SCREEN_HEIGHT).current,N=(0,react.useRef)(new react_native.Animated.Value(M)).current,P=(0,react.useCallback)(e=>{let D=e===`up`?j:M;react_native.Animated.spring(N,{toValue:D,useNativeDriver:!0,bounciness:0}).start()},[N,M,j]);(0,react.useEffect)(()=>{P(D?`up`:`down`)},[D,P]);let F={transform:[{translateY:N}]};return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[D&&(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{onPress:O,testID:`cometchat-bottom-sheet-backdrop`,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:[commonStyles.absoluteFill,styles$17.backdrop]})}),(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{testID:A,style:[styles$17.bottomSheet,F,{height:k}],children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$17.draggableArea,children:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$17.dragHandle})}),(0,react_jsx_runtime.jsx)(react_native.ScrollView,{children:e})]})]})},styles$17=react_native.StyleSheet.create({backdrop:{backgroundColor:`rgba(0,0,0,0.5)`,zIndex:1},bottomSheet:{position:`absolute`,width:`100%`,backgroundColor:`#1A1A1A`,borderTopLeftRadius:16,borderTopRightRadius:16,paddingBottom:8,borderWidth:1,borderColor:`#383838`,zIndex:2,left:0,right:0,top:0,shadowColor:`#101828`,shadowOffset:{width:0,height:-6},shadowOpacity:.08,shadowRadius:10,elevation:8},draggableArea:{width:`100%`,alignItems:`center`,paddingVertical:10,borderTopLeftRadius:20,borderTopRightRadius:20},dragHandle:{width:32,height:4,backgroundColor:`#A1A1A1`,borderRadius:1e3}});var BottomSheet_native_default=BottomSheet;const DEFAULT_AUDIO_MODE_ICON=`speaker-fill`,AUDIO_MODE_TYPE_ICON_MAP={BLUETOOTH:`bluetooth`,CAR:`car`,EARPIECE:`earpiece`,HEADPHONES:`headphones`,SPEAKER:`speaker-fill`},getAudioModeIcon=e=>e&&AUDIO_MODE_TYPE_ICON_MAP[e]||`speaker-fill`,MenuItem=({iconName:e,label:D,onPress:O,selected:k=!1,disabled:A=!1,testID:j})=>(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{testID:j,disabled:A,onPress:()=>{hideAllBottomSheets(),O()},style:[styles$16.menuItem,k&&styles$16.menuItemSelected,A&&styles$16.menuItemDisabled],children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Regular,styles$16.menuLabel],children:D})]}),styles$16=react_native.StyleSheet.create({menuItem:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:16,paddingVertical:12,gap:8},menuItemSelected:{backgroundColor:`#383838`},menuItemDisabled:{opacity:.5},menuLabel:{color:colors.text.primary,textTransform:`capitalize`}});var MenuItem_native_default=MenuItem;const AudioModesMenu=({isVisible:e,onClose:D})=>{let O=useBaseStore(e=>e.audioModes),k=124+Math.max(O.length,1)*48;return(0,react_jsx_runtime.jsx)(BottomSheet_native_default,{maxHeight:k,isVisible:e,onClose:D,children:(0,react_jsx_runtime.jsxs)(react_native.ScrollView,{children:[O.length===0&&(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles$15.noItemsText],children:`No audio modes available`}),O.map((e,D)=>(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-audio-${e.type.toLowerCase()}`,iconName:AUDIO_MODE_TYPE_ICON_MAP[e.type],label:e.type,selected:e.selected,onPress:()=>{requestAudioModeChange(e).catch(e=>void 0)}},D))]})})},styles$15=react_native.StyleSheet.create({noItemsText:{padding:16,textAlign:`center`,color:colors.text.secondary}});var AudioModesMenu_native_default=AudioModesMenu;const controlPaneStyles=react_native.StyleSheet.create({controlPane:{flexDirection:`row`,alignItems:`center`,justifyContent:`center`,paddingVertical:16,paddingHorizontal:20,gap:12},controlButton:{flex:1,maxWidth:72,height:56,borderRadius:28,backgroundColor:`#272727`,alignItems:`center`,justifyContent:`center`},leaveSessionButton:{backgroundColor:`#C73C3E`},toggledButton:{backgroundColor:colors.alert.errorBackground},activeButton:{backgroundColor:colors.static.white}}),AudioModeButton=()=>{let e=useConfigStore(e=>e.hideAudioModeButton),D=useBaseStore(e=>e.selectedAudioModeType);return e?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:controlPaneStyles.controlButton,onPress:toggleAudioModeMenuVisible,activeOpacity:.7,testID:`cometchat-audio-mode-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:getAudioModeIcon(D),fill:`#FFF`,size:24})})};var AudioModeButton_default=AudioModeButton;const AudioControl=()=>{let e=useTrackMuted(MEDIA_TYPE.AUDIO);return useHideMuteAudioButton()?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,e&&controlPaneStyles.toggledButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onToggleAudioButtonClicked}),toggleAudioTrack()},activeOpacity:.7,testID:`cometchat-audio-toggle-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:e?`mic-off-fill`:`mic-fill`,fill:e?`#9F3032`:`#FFF`,size:24})})};var Audio_native_default=AudioControl;const VideoControl=()=>{let e=useHideToggleVideoButton(),D=useTrackMuted(MEDIA_TYPE.VIDEO);return e?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,D&&controlPaneStyles.toggledButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onToggleVideoButtonClicked}),toggleVideoTrack()},activeOpacity:.7,testID:`cometchat-video-toggle-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:D?`video-off-fill`:`video-fill`,fill:D?`#9F3032`:`#FFF`,size:24})})};var Video_native_default=VideoControl;const LeaveSessionButton=()=>useConfigStore(e=>e.hideLeaveSessionButton)?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[controlPaneStyles.controlButton,controlPaneStyles.leaveSessionButton],onPress:()=>{leaveSession(),eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onLeaveSessionButtonClicked})},activeOpacity:.7,testID:`cometchat-leave-session-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`call-end`,fill:`#FFF`,size:24})});var LeaveSessionButton_native_default=LeaveSessionButton;const MoreMenuButton=()=>(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:controlPaneStyles.controlButton,onPress:toggleMoreMenuVisible,activeOpacity:.7,testID:`cometchat-more-menu-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`more`,fill:`#FFF`,size:24})});var MoreMenuButton_default=MoreMenuButton;const ControlPane=()=>useConfigStore(e=>e.hideControlPanel)?null:(0,react_jsx_runtime.jsxs)(react_native.View,{style:controlPaneStyles.controlPane,testID:`cometchat-control-panel`,children:[(0,react_jsx_runtime.jsx)(Audio_native_default,{}),(0,react_jsx_runtime.jsx)(Video_native_default,{}),(0,react_jsx_runtime.jsx)(AudioModeButton_default,{}),(0,react_jsx_runtime.jsx)(MoreMenuButton_default,{}),(0,react_jsx_runtime.jsx)(LeaveSessionButton_native_default,{})]});var ControlPane_native_default=ControlPane;const ScreenShareButton=()=>{let e=useScreenShareRunning();return(0,react_jsx_runtime.jsx)(MenuItem_native_default,{iconName:e?`screen-share-stop`:`screen-share`,selected:e,label:e?`Stop screen sharing`:`Start Screen Sharing`,onPress:e?stopScreenSharing:startScreenSharing})};var ScreenShareButton_default=ScreenShareButton;const MoreMenu=({isVisible:e,onClose:D})=>{let O=useRaisedHandTimestamp(),k=useHideRecordingButton(),A=useHideStreamingButton(),{t:j}=useTranslation(),M=useIsRecording(),N=useIsStreaming(),P=useConferenceStore(e=>e.recording.status),F=useHideTranscriptionButton(),I=useHideClosedCaptionButton(),L=useShowLiveCaption(),z=useIsTranscribing(),B=useConfigStore(e=>e.hideRaiseHandButton),H=useConfigStore(e=>e.hideParticipantListButton),W=useHideScreenSharingButton(),G=0;k===!1&&G++,A===!1&&G++,F===!1&&G++,I===!1&&G++,B===!1&&G++,H===!1&&G++,W===!1&&G++;let q=124+Math.max(G,1)*48,J=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onRaiseHandButtonClicked}),toggleRaiseHand()},[]),Y=(0,react.useCallback)(()=>{if(P!==`pending`)if(N)showConfirmationDialog(j(`controlPanel.streaming.stopStreaming`),j(`controlPanel.streaming.stopStreamingConfirmation`),j(`controlPanel.streaming.stopStreaming`),j(`controlPanel.streaming.cancel`),()=>stopStreaming());else{let{streamUrl:e,streamKey:D}=useConfigStore.getState();if(e){startStreaming(e,D??``);return}showConfirmationDialog(j(`controlPanel.streaming.startStreaming`),j(`controlPanel.streaming.startStreamingConfirmation`),j(`controlPanel.streaming.startStreaming`),j(`controlPanel.streaming.cancel`),(e,D)=>{e&&startStreaming(e,D??``)},()=>{},j(`controlPanel.streaming.streamUrlPlaceholder`),j(`controlPanel.streaming.streamKeyPlaceholder`))}},[N,P,j]),X=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onParticipantListButtonClicked}),toggleParticipantListVisible()},[]);return(0,react_jsx_runtime.jsx)(BottomSheet_native_default,{testID:`cometchat-more-menu-bottom-sheet`,maxHeight:q,isVisible:e,onClose:D,children:(0,react_jsx_runtime.jsxs)(react_native.ScrollView,{children:[G===0&&(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-more-menu-empty-state`,style:[commonStyles.bodyRegular,styles$14.noItemsText],children:`No options available`}),!W&&(0,react_jsx_runtime.jsx)(ScreenShareButton_default,{}),!B&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-raise-hand`,iconName:`raise-hand-fill`,label:O?`Lower Hand`:`Raise Hand`,onPress:J,selected:!!O}),!A&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:N?`cometchat-menu-item-stop-streaming`:`cometchat-menu-item-start-streaming`,iconName:N?`streaming-stop`:`streaming`,label:j(N?`controlPanel.streaming.stopStreaming`:`controlPanel.streaming.startStreaming`),disabled:P===`pending`,onPress:Y}),!k&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:M?`cometchat-menu-item-stop-recording`:`cometchat-menu-item-start-recording`,iconName:M?`record-stop-fill`:`record-fill`,label:M?`Stop Recording`:`Start Recording`,onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onRecordingToggleButtonClicked}),showConfirmationDialog(j(M?`controlPanel.recording.stopRecording`:`controlPanel.recording.startRecording`),j(M?`controlPanel.recording.stopRecordingConfirmation`:`controlPanel.recording.startRecordingConfirmation`),j(M?`controlPanel.recording.stopRecording`:`controlPanel.recording.startRecording`),j(`controlPanel.recording.cancel`),()=>{toggleRecording()})}}),!F&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:z?`cometchat-menu-item-stop-transcription`:`cometchat-menu-item-start-transcription`,iconName:z?`transcription-stop`:`transcription-start`,label:z?`Stop Transcription`:`Start Transcription`,onPress:toggleTranscription}),!I&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-closed-caption`,iconName:`closed-caption`,label:L?`Hide Captions`:`Show Captions`,onPress:toggleShowLiveCaption,selected:L}),!H&&(0,react_jsx_runtime.jsx)(MenuItem_native_default,{testID:`cometchat-menu-item-participants`,iconName:`participants`,label:`Participants`,onPress:X})]})})},styles$14=react_native.StyleSheet.create({noItemsText:{padding:16,textAlign:`center`,color:`#888`}});var MoreMenu_native_default=MoreMenu;const FullScreenDialog=({children:e,visible:D=!1})=>{let[O,k]=(0,react.useState)(D),A=(0,react.useRef)(new react_native.Animated.Value(0)).current;return(0,react.useEffect)(()=>{D?(k(!0),react_native.Animated.timing(A,{toValue:1,duration:300,useNativeDriver:!0}).start()):react_native.Animated.timing(A,{toValue:0,duration:300,useNativeDriver:!0}).start(()=>{k(!1)})},[D,A]),O?(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[commonStyles.absoluteFill,styles$13.container,{opacity:A}],children:e}):null},styles$13=react_native.StyleSheet.create({container:{zIndex:1e3}});var FullScreenDialog_native_default=FullScreenDialog;const RecordingIndicator=({style:e})=>{let D=(0,react.useRef)(new react_native.Animated.Value(1)).current,O=(0,react.useRef)(new react_native.Animated.Value(.6)).current,k=useIsRecording(),A=useConfigStore(e=>e.hideRecordingStatusIndicator),{t:j}=useTranslation();return(0,react.useEffect)(()=>{if(!k)return;let e=react_native.Animated.loop(react_native.Animated.parallel([react_native.Animated.timing(D,{toValue:2.4,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0}),react_native.Animated.timing(O,{toValue:0,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>{e.stop(),D.setValue(1),O.setValue(.6)}},[k,D,O]),!k||A?null:(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-recording-indicator`,accessible:!0,accessibilityRole:`text`,accessibilityLiveRegion:`polite`,accessibilityLabel:j(`indicators.recording.tooltip`),style:[styles$12.container,e],children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$12.dotWrapper,children:[(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$12.ring,{opacity:O,transform:[{scale:D}]}]}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$12.dot})]}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption2Bold,styles$12.text],children:j(`indicators.recording.label`)})]})},DOT_SIZE$1=8,styles$12=react_native.StyleSheet.create({container:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,gap:spacing[1],paddingVertical:padding[1],paddingHorizontal:padding[2],backgroundColor:colors.background[3],borderRadius:borderRadius.max},dotWrapper:{width:8,height:8,alignItems:`center`,justifyContent:`center`},ring:{position:`absolute`,width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.error},dot:{width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.error},text:{color:colors.static.white,letterSpacing:.4,textTransform:`uppercase`}});var RecordingIndicator_native_default=RecordingIndicator;const StreamingIndicator=({style:e})=>{let D=(0,react.useRef)(new react_native.Animated.Value(1)).current,O=(0,react.useRef)(new react_native.Animated.Value(.6)).current,k=useIsStreaming(),A=useConfigStore(e=>e.hideStreamingStatusIndicator),{t:j}=useTranslation();return(0,react.useEffect)(()=>{if(!k)return;let e=react_native.Animated.loop(react_native.Animated.parallel([react_native.Animated.timing(D,{toValue:2.4,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0}),react_native.Animated.timing(O,{toValue:0,duration:1600,easing:react_native.Easing.out(react_native.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>{e.stop(),D.setValue(1),O.setValue(.6)}},[k,D,O]),!k||A?null:(0,react_jsx_runtime.jsxs)(react_native.View,{testID:`cometchat-streaming-indicator`,accessible:!0,accessibilityRole:`text`,accessibilityLiveRegion:`polite`,accessibilityLabel:j(`indicators.streaming.tooltip`),style:[styles$11.container,e],children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$11.dotWrapper,children:[(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$11.ring,{opacity:O,transform:[{scale:D}]}]}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$11.dot})]}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption2Bold,styles$11.text],children:j(`indicators.streaming.label`)})]})},DOT_SIZE=8,styles$11=react_native.StyleSheet.create({container:{flexDirection:`row`,alignItems:`center`,alignSelf:`flex-start`,gap:spacing[1],paddingVertical:padding[1],paddingHorizontal:padding[2],backgroundColor:colors.background[3],borderRadius:borderRadius.max},dotWrapper:{width:8,height:8,alignItems:`center`,justifyContent:`center`},ring:{position:`absolute`,width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.warning},dot:{width:8,height:8,borderRadius:8/2,backgroundColor:colors.alert.warning},text:{color:colors.static.white,letterSpacing:.4,textTransform:`uppercase`}});var StreamingIndicator_native_default=StreamingIndicator;const styles$8=react_native.StyleSheet.create({headerContainer:{flexDirection:`row`,alignItems:`center`,paddingVertical:8,paddingHorizontal:20,justifyContent:`space-between`,width:`100%`},meetingInfo:{flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,gap:4,flex:1},meetingTitle:{color:`#FFFFFF`},meetingTime:{color:`#FFFFFF`},sessionMeta:{flexDirection:`row`,alignItems:`center`,gap:8},iconControls:{flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,gap:12,flexShrink:0},iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},activeButton:{backgroundColor:`#383838`}}),ChangeLayout=()=>{let e=useConfigStore(e=>e.hideChangeLayoutButton),[D,O]=(0,react.useState)(!1),k=useLayout(),A=(0,react.useRef)(null),[j,M]=(0,react.useState)({x:0,y:0,width:0,height:0});if(e)return null;let N=()=>{A.current&&A.current.measureInWindow((e,D,k,A)=>{M({x:e,y:D,width:k,height:A}),O(!0)})};return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{ref:A,style:[styles$8.iconButton],onPress:()=>{eventBus.publish({type:EVENT_LISTENER_METHODS.ButtonClickListener.onChangeLayoutButtonClicked}),N()},testID:`cometchat-change-layout-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`tile-fill`,fill:`#FFFFFF`})}),(0,react_jsx_runtime.jsx)(PopupMenu,{visible:D,anchorLayout:j,onClose:()=>O(!1),options:[{label:`Tile View`,iconName:`tile-fill`,selected:k===LAYOUT.TILE,onPress:()=>{useBaseStore.setState({layout:LAYOUT.TILE})}},{label:`Sidebar View`,iconName:`sidebar`,selected:k===LAYOUT.SIDEBAR,onPress:()=>{useBaseStore.setState({layout:LAYOUT.SIDEBAR})}},{label:`Spotlight View`,iconName:`spotlight`,selected:k===LAYOUT.SPOTLIGHT,onPress:()=>{useBaseStore.setState({layout:LAYOUT.SPOTLIGHT})}}]})]})};var ChangeLayout_default=ChangeLayout;const ChatButton=()=>{let e=useHideChatButton(),D=useBaseStore(e=>e.chatButtonUnreadCount),O=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onChatButtonClicked})},[]);return e?null:(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{style:[styles$10.iconButton],onPress:O,testID:`cometchat-chat-button`,children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`chat`,fill:`#FFFFFF`}),D>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$10.badge,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$10.badgeText,children:D>99?`99+`:D})})]})},styles$10=react_native.StyleSheet.create({iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},badge:{position:`absolute`,top:-1,right:-1,backgroundColor:colors.primary,borderRadius:borderRadius.max,minWidth:18,height:18,justifyContent:`center`,alignItems:`center`,paddingHorizontal:padding[1]},badgeText:{color:colors.static.white,textAlign:`center`,...commonStyles.caption1Bold}});var ChatButton_default=ChatButton;const SwitchCamera=()=>{let e=!!useTrackMuted(MEDIA_TYPE.VIDEO),D=useHideSwitchCameraButton(),O=(0,react.useCallback)(()=>{eventBus.publish({type:EVENT_LISTENER_METHODS_MOBILE.ButtonClickListener.onSwitchCameraButtonClicked}),switchCamera()},[]);return D?null:(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{testID:`cometchat-switch-camera-button`,disabled:e,style:[styles$9.iconButton,e&&styles$9.iconButtonDisabled],onPress:O,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`switch-camera`,fill:`#FFFFFF`})})},styles$9=react_native.StyleSheet.create({iconButton:{justifyContent:`center`,alignItems:`center`,width:40,height:40,backgroundColor:`#272727`,borderRadius:1e3,flexShrink:0},iconButtonDisabled:{opacity:.5}});var SwitchCamera_default=SwitchCamera;const SessionTimer=()=>{let e=useSessionTimer();return useConfigStore(e=>e.hideSessionTimer)?null:(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-session-timer`,style:[commonStyles.caption1Regular,styles$8.meetingTime],children:miliSecondsToMMSS(e)})},Header=()=>{let e=useConfigStore(e=>e.title);return useConfigStore(e=>e.hideHeaderPanel)?null:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.headerContainer,testID:`cometchat-header-panel`,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.meetingInfo,children:[e&&(0,react_jsx_runtime.jsx)(react_native.Text,{testID:`cometchat-session-title`,style:[commonStyles.heading4Medium,styles$8.meetingTitle],numberOfLines:1,ellipsizeMode:`tail`,children:e}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.sessionMeta,children:[(0,react_jsx_runtime.jsx)(SessionTimer,{}),(0,react_jsx_runtime.jsx)(RecordingIndicator_native_default,{}),(0,react_jsx_runtime.jsx)(StreamingIndicator_native_default,{})]})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$8.iconControls,children:[(0,react_jsx_runtime.jsx)(SwitchCamera_default,{}),(0,react_jsx_runtime.jsx)(ChangeLayout_default,{}),(0,react_jsx_runtime.jsx)(ChatButton_default,{})]})]})};var Header_native_default=Header;const IdealTimeoutModal=({style:e={}})=>{let D=useBaseStore(e=>e.idleTimeoutModalVisible),O=useConfigStore(e=>e.idleTimeoutPeriodAfterPrompt),[k,A]=(0,react.useState)(O),j=miliSecondsToMMSS(k),M=(0,react.useRef)(new react_native.Animated.Value(0)).current,N=(0,react.useRef)(new react_native.Animated.Value(.8)).current,P=Math.ceil(k/6e4),F=()=>{useBaseStore.getState().restartIdealTimeoutTimer()};return(0,react.useEffect)(()=>{D?react_native.Animated.parallel([react_native.Animated.timing(M,{toValue:1,duration:300,useNativeDriver:!0}),react_native.Animated.spring(N,{toValue:1,tension:100,friction:8,useNativeDriver:!0})]).start():react_native.Animated.parallel([react_native.Animated.timing(M,{toValue:0,duration:200,useNativeDriver:!0}),react_native.Animated.timing(N,{toValue:.8,duration:200,useNativeDriver:!0})]).start()},[D,M,N]),(0,react.useEffect)(()=>{let e=setInterval(()=>{if(!D){clearInterval(e);return}A(D=>D<=1e3?(clearInterval(e),leaveSessionDueToIdleTimeout(),0):D-1e3)},1e3);return()=>clearInterval(e)},[D]),(0,react.useEffect)(()=>{D&&A(O)},[D,O]),D?(0,react_jsx_runtime.jsx)(react_native.Modal,{transparent:!0,visible:D,animationType:`none`,supportedOrientations:[`portrait`,`landscape-left`,`landscape-right`],statusBarTranslucent:!0,children:(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{onPress:()=>{F()},testID:`cometchat-idle-timeout-overlay`,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$7.overlay,{opacity:M}],children:(0,react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback,{testID:`cometchat-idle-timeout-modal`,children:(0,react_jsx_runtime.jsx)(react_native.Animated.View,{style:[styles$7.modal,e,{opacity:M,transform:[{scale:N}]}],children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.content,children:[(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$7.timerIcon,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading3Bold,styles$7.timerText],children:j})}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.textContent,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading2Medium,styles$7.title],children:`Are you still there?`}),(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.bodyRegular,styles$7.subtitle],children:[`You are the only one here, so this call will end in less than `,P,` minute`,P>1?`s`:``,`. Do you want to stay in this call?`]})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$7.actions,children:[(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$7.button,styles$7.buttonSecondary],onPress:F,activeOpacity:.8,testID:`cometchat-idle-timeout-stay-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$7.buttonSecondaryText],children:`Stay on the call`})}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{style:[styles$7.button,styles$7.buttonPrimary],onPress:()=>leaveSession(),activeOpacity:.8,testID:`cometchat-idle-timeout-leave-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$7.buttonPrimaryText],children:`Leave now`})})]})]})})})})})}):null},styles$7=react_native.StyleSheet.create({overlay:{flex:1,backgroundColor:`rgba(0, 0, 0, 0.6)`,justifyContent:`center`,alignItems:`center`,paddingHorizontal:20},modal:{backgroundColor:`#141414`,borderRadius:20,borderWidth:1,borderColor:`#383838`,width:`100%`,maxWidth:372,paddingTop:32,paddingHorizontal:20,paddingBottom:20,shadowColor:`#000`,shadowOffset:{width:0,height:12},shadowOpacity:.08,shadowRadius:16,elevation:8},content:{alignItems:`center`,gap:20},timerIcon:{width:80,height:80,borderRadius:40,backgroundColor:`#473892`,justifyContent:`center`,alignItems:`center`},timerText:{color:`#FFFFFF`,textAlign:`center`},textContent:{alignItems:`center`,gap:8,width:`100%`},title:{color:`#FFFFFF`,textAlign:`center`,width:`100%`},subtitle:{color:`#B8B8B8`,textAlign:`center`,lineHeight:20,width:`100%`},actions:{flexDirection:`row`,alignItems:`center`,gap:12},button:{flex:1,height:40,justifyContent:`center`,alignItems:`center`,borderRadius:8},buttonSecondary:{backgroundColor:`transparent`,borderWidth:1,borderColor:`#383838`},buttonSecondaryText:{color:`#FFFFFF`},buttonPrimary:{backgroundColor:`#C73C3E`},buttonPrimaryText:{color:`#FFFFFF`}});var IdealTimeoutModal_native_default=IdealTimeoutModal;const ShareInviteButton=()=>useConfigStore(e=>e.hideShareInviteButton)?null:(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$6.shareButtonContainer,children:(0,react_jsx_runtime.jsxs)(react_native.TouchableOpacity,{style:styles$6.shareButton,testID:`cometchat-share-invite-button`,onPress:()=>{eventBus.publish({type:`onShareInviteButtonClicked`})},children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`share`,size:24,fill:`#FFFFFF`}),(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading4Medium,styles$6.shareButtonText],children:`Share Invite`})]})}),styles$6=react_native.StyleSheet.create({shareButtonContainer:{paddingHorizontal:16,paddingVertical:12},shareButton:{flexDirection:`row`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#8C78F0`,borderRadius:8,paddingVertical:12,paddingHorizontal:16,gap:8},shareButtonText:{color:`#FFFFFF`}});var ShareInviteButton_native_default=ShareInviteButton;const QUALITY_COLOR_MAP={1:`#C73C3E`,2:`#D08D04`,3:`#0B9F5D`,4:`#0B9F5D`},ConnectionQualityIndicator=({participantId:e})=>{let D=useConferenceStore(D=>D.connectionQuality.get(e));if(D===void 0)return null;let O=QUALITY_COLOR_MAP[(D>>5)+1];return(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`signal`,size:24,fill:O})};var ConnectionQualityIndicator_native_default=ConnectionQualityIndicator;const ParticipantItem=({participant:e})=>{let{pid:D,name:O,avatar:k,type:A,ruid:j}=e,M=useTrackMuted(MEDIA_TYPE.AUDIO,e.pid),N=e.type===`screen-share`?`Presentation`:``,P=M?`mic-off`:`mic`,F=M?`#858585`:`#6852D6`,I=useRaisedHandTimestamp(D,A);return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantItem,children:[(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:O,imageUrl:k,fontSize:18,size:48,containerStyle:styles$5.avatar,textStyle:commonStyles.heading3Bold}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantText,children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyMedium,styles$5.participantName],numberOfLines:1,ellipsizeMode:`tail`,children:O}),N&&(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.caption1Regular,styles$5.participantDescription],numberOfLines:1,ellipsizeMode:`tail`,children:N})]}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$5.participantIcons,children:[I?(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`raise-hand-fill`,size:20,fill:`#fff`}):(0,react_jsx_runtime.jsx)(ConnectionQualityIndicator_native_default,{participantId:D}),(0,react_jsx_runtime.jsx)(Icon_native_default,{name:P,size:24,fill:F}),(0,react_jsx_runtime.jsx)(MoreOptionButton_default,{ruid:j})]})]})};var ParticipantItem_native_default=ParticipantItem;const ListEmptyComponent=()=>(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.heading3Bold,styles$4.noResults],children:`No participants found.`}),ParticipantList=()=>{let[e,D]=(0,react.useState)(``),O=useOrderedParticipants().filter(D=>D.name.toLowerCase().includes(e.toLowerCase()));return(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.participantListContainer,children:[(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.participantListHeader,children:[(0,react_jsx_runtime.jsxs)(react_native.Text,{style:[commonStyles.heading2Bold,styles$4.headerTitle],children:[`Participants (`,O.length,`)`]}),(0,react_jsx_runtime.jsx)(react_native.TouchableOpacity,{onPress:toggleParticipantListVisible,accessibilityLabel:`Close participants list`,testID:`cometchat-participant-list-close-button`,children:(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`close`,size:24,fill:`#FFFFFF`})})]}),(0,react_jsx_runtime.jsx)(ShareInviteButton_native_default,{}),(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$4.searchContainer,children:(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$4.searchInputWrapper,children:[(0,react_jsx_runtime.jsx)(Icon_native_default,{name:`search`,size:24,fill:`#858585`}),(0,react_jsx_runtime.jsx)(react_native.TextInput,{placeholder:`Search Participant`,style:styles$4.searchInput,value:e,onChangeText:D,placeholderTextColor:`#858585`,testID:`cometchat-participant-search-input`})]})}),(0,react_jsx_runtime.jsx)(react_native.FlatList,{data:O,renderItem:({item:e})=>(0,react_jsx_runtime.jsx)(ParticipantItem_native_default,{participant:e}),keyExtractor:e=>e.ruid,ListEmptyComponent})]})},styles$4=react_native.StyleSheet.create({participantListContainer:{flex:1,backgroundColor:`#1A1A1A`},participantListHeader:{flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,padding:16,gap:12,borderBottomWidth:1,borderBottomColor:`#383838`},headerTitle:{color:`#ffffff`},searchContainer:{flexDirection:`row`,alignItems:`flex-start`,paddingVertical:12,paddingHorizontal:16},searchInputWrapper:{flexDirection:`row`,alignItems:`center`,paddingHorizontal:12,gap:8,height:40,backgroundColor:`#272727`,borderWidth:1,borderColor:`#272727`,borderRadius:1e3,flex:1},searchInput:{...commonStyles.heading4Regular,flex:1,color:`#ffffff`},noResults:{padding:20,textAlign:`center`,width:`100%`,color:colors.text.primary}});var ParticipantList_native_default=ParticipantList;function PiPTile(){let e=useMainParticipant();return(0,react_jsx_runtime.jsx)(Tile_native_default,{participant:e})}var PiPTile_default=PiPTile;const styles$3=react_native.StyleSheet.create({containerTop:{position:`absolute`,top:spacing[4],left:spacing[4],right:spacing[4],zIndex:9999,alignItems:`center`,gap:spacing[2]},containerBottom:{position:`absolute`,bottom:spacing[4],left:spacing[4],right:spacing[4],zIndex:9999,alignItems:`center`,gap:spacing[2]},toast:{width:`100%`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,paddingVertical:padding[3],paddingHorizontal:padding[4],borderRadius:borderRadius[2],borderWidth:1,shadowColor:`#000`,shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:6},toastInfo:{backgroundColor:colors.background[3],borderColor:colors.border.default},toastSuccess:{backgroundColor:`#0d2818`,borderColor:colors.alert.success},toastWarning:{backgroundColor:`#2b2000`,borderColor:colors.alert.warning},toastError:{backgroundColor:`#2b0f0f`,borderColor:colors.alert.error},message:{...commonStyles.bodyRegular,color:colors.text.primary,flex:1},actionButton:{marginLeft:spacing[3],paddingVertical:padding[1],paddingHorizontal:padding[3],borderRadius:borderRadius[1],backgroundColor:`transparent`},actionText:{...commonStyles.buttonMedium,color:colors.primary}}),SLIDE_IN_DURATION=300,SLIDE_OUT_DURATION=200,typeStyleMap={info:styles$3.toastInfo,success:styles$3.toastSuccess,warning:styles$3.toastWarning,error:styles$3.toastError};function ToastItemView({toast:e,onDismiss:D}){let O=(0,react.useRef)(new react_native.Animated.Value(0)).current,k=(0,react.useRef)(new react_native.Animated.Value(e.position===`top`?-20:20)).current,A=(0,react.useRef)(null),j=(0,react.useCallback)(()=>{react_native.Animated.parallel([react_native.Animated.timing(O,{toValue:0,duration:200,useNativeDriver:!0}),react_native.Animated.timing(k,{toValue:e.position===`top`?-20:20,duration:200,useNativeDriver:!0})]).start(()=>{D(e.id)})},[D,O,e.id,e.position,k]);return(0,react.useEffect)(()=>(react_native.Animated.parallel([react_native.Animated.timing(O,{toValue:1,duration:300,useNativeDriver:!0}),react_native.Animated.timing(k,{toValue:0,duration:300,useNativeDriver:!0})]).start(),e.duration>0&&Number.isFinite(e.duration)&&(A.current=setTimeout(j,e.duration)),()=>{A.current&&clearTimeout(A.current)}),[j,O,e.duration,k]),(0,react_jsx_runtime.jsxs)(react_native.Animated.View,{style:[styles$3.toast,typeStyleMap[e.type],{opacity:O,transform:[{translateY:k}]}],children:[(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$3.message,children:e.message}),e.action&&(0,react_jsx_runtime.jsx)(react_native.Pressable,{style:styles$3.actionButton,onPress:()=>{e.action?.onPress(),j()},testID:`cometchat-toast-action-button`,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:styles$3.actionText,children:e.action.label})})]})}function Toast(){let e=useToastStore(e=>e.toasts),D=useToastStore(e=>e.removeToast);(0,react.useEffect)(()=>eventBus.subscribe(INTERNAL_EVENTS.notification,e=>{useToastStore.getState().addToast({message:e.message,type:e.type,duration:e.duration??3e3,position:e.position??`bottom`,action:e.action})}),[]);let O=e.filter(e=>e.position===`top`),k=e.filter(e=>e.position===`bottom`);return(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[O.length>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$3.containerTop,pointerEvents:`box-none`,children:O.map(e=>(0,react_jsx_runtime.jsx)(ToastItemView,{toast:e,onDismiss:D},e.id))}),k.length>0&&(0,react_jsx_runtime.jsx)(react_native.View,{style:styles$3.containerBottom,pointerEvents:`box-none`,children:k.map(e=>(0,react_jsx_runtime.jsx)(ToastItemView,{toast:e,onDismiss:D},e.id))})]})}const IS_IOS=react_native.Platform.OS===`ios`,FALLBACK_HEIGHT=240,DEFAULT_PREFERRED_SIZE={width:720,height:1280},SystemPiPView=()=>{let e=useMainParticipant(),D=getParticipantMediaType(e),O=useTrackByParticipantId(e?.pid??``,D),k=useTrackMuted(D,e?.pid),A=e?.isLocal&&!(isMultitaskingCameraAccessSupported&&D===MEDIA_TYPE.VIDEO),j=k||A?void 0:O?.originalTrack,M=(0,react.useMemo)(()=>j?.getOriginalStream().toURL(),[j]),[N,P]=(0,react.useState)(DEFAULT_PREFERRED_SIZE),F=(0,react.useMemo)(()=>({width:240*N.width/N.height,height:240}),[N]);if(!e)return null;let I=(0,react_jsx_runtime.jsx)(react_native.View,{style:[styles$2.fallback,F],collapsable:!1,children:(0,react_jsx_runtime.jsx)(Avatar_native_default,{name:e.name,imageUrl:e.avatar,size:60,fontSize:30})});return(0,react_jsx_runtime.jsx)(react_native_webrtc.RTCPIPView,{testID:`cometchat-ios-system-pip`,pointerEvents:`none`,streamURL:M,objectFit:`contain`,iosPIP:{enabled:!0,startAutomatically:!0,stopAutomatically:!0,preferredSize:N,fallbackView:I},onDimensionsChange:e=>{let{width:D,height:O}=e.nativeEvent;D>0&&O>0&&P(e=>e.width===D&&e.height===O?e:{width:D,height:O})},style:styles$2.anchor})},IOSSystemPiP=()=>{let e=useConfigStore(e=>e.enableIOSPictureInPicture);return IS_IOS&&e?(0,react_jsx_runtime.jsx)(SystemPiPView,{}):null},styles$2=react_native.StyleSheet.create({anchor:{...react_native.StyleSheet.absoluteFillObject,opacity:0},fallback:{alignItems:`center`,justifyContent:`center`,backgroundColor:`#272727`}});var IOSSystemPiP_native_default=IOSSystemPiP;function CallUI(e){let D=useBaseStore(e=>e.moreMenuVisible),O=useBaseStore(e=>e.participantListVisible),k=useBaseStore(e=>e.isPIPLayoutEnabled),A=useBaseStore(e=>e.audioModeMenuVisible),j=useConfigStore(e=>e.sessionType),M=useIsConferenceJoined(),N=useConfigStore(e=>e.unstable_headlessMode),P=e.sessionSettings.unstable_headlessMode??N,F=e.sessionSettings.sessionType??j,I=P&&F===SESSION_TYPE.VOICE;return(0,react.useEffect)(()=>{P&&SESSION_TYPE.VOICE},[P,F]),(0,react.useLayoutEffect)(()=>(eventBus.publish({type:INTERNAL_EVENTS.lifecycle.componentDidMount}),updateConfig(e.sessionSettings),()=>{eventBus.publish({type:INTERNAL_EVENTS.lifecycle.componentWillUnmount},!0)}),[e.sessionSettings]),(0,react.useEffect)(()=>{e.sessionSettings.sdkPlatform?useBaseStore.setState({sdkPlatform:e.sessionSettings.sdkPlatform}):useBaseStore.setState({sdkPlatform:react_native.Platform.OS===`ios`?`react-native-ios`:`react-native-android`}),useBaseStore.setState({platformVersion:react_native.Platform.Version}),startSession()},[e.sessionSettings.sdkPlatform]),(0,react.useEffect)(()=>{let e=AudioModeEventEmitter.addListener(AudioModeModule_default.DEVICE_CHANGE_EVENT,e=>{setAudioModes(e),useConfigStore.getState().sessionType===SESSION_TYPE.VIDEO&&Array.isArray(e)&&e.some(e=>e.type===`EARPIECE`&&e.selected)&&requestAudioModeChange(`SPEAKER`).catch(e=>void 0)});return()=>{e.remove()}},[]),(0,react.useEffect)(()=>{let D=(e.sessionSettings.sessionType??j)===SESSION_TYPE.VOICE?AudioModeModule_default.AUDIO_CALL:AudioModeModule_default.VIDEO_CALL;AudioModeModule_default.setMode(D).catch(e=>void 0),react_native.Platform.OS===`android`&&e.sessionSettings.audioMode&&AudioModeModule_default.setAudioDevice(e.sessionSettings.audioMode)},[e.sessionSettings.audioMode,e.sessionSettings.sessionType,j]),(0,react.useEffect)(()=>()=>{AudioModeModule_default.setMode(AudioModeModule_default.DEFAULT).catch(e=>void 0)},[]),I?(0,react_jsx_runtime.jsx)(react_jsx_runtime.Fragment,{}):k?(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(IOSSystemPiP_native_default,{}),(0,react_jsx_runtime.jsx)(PiPTile_default,{})]}):(0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment,{children:[(0,react_jsx_runtime.jsx)(IOSSystemPiP_native_default,{}),(0,react_jsx_runtime.jsxs)(react_native.View,{style:styles$1.container,onLayout:e=>{useBaseStore.setState({callContainerDimension:{width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}})},children:[(0,react_jsx_runtime.jsx)(Header_native_default,{}),(0,react_jsx_runtime.jsx)(CallStage_native_default,{}),(0,react_jsx_runtime.jsx)(ClosedCaptions_native_default,{}),(0,react_jsx_runtime.jsx)(ControlPane_native_default,{}),(0,react_jsx_runtime.jsx)(FullScreenDialog_native_default,{visible:O,children:(0,react_jsx_runtime.jsx)(ParticipantList_native_default,{})}),(0,react_jsx_runtime.jsx)(MoreMenu_native_default,{isVisible:D,onClose:toggleMoreMenuVisible}),(0,react_jsx_runtime.jsx)(AudioModesMenu_native_default,{isVisible:A,onClose:toggleAudioModeMenuVisible}),(0,react_jsx_runtime.jsx)(IdealTimeoutModal_native_default,{}),(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`Connecting...`,visible:!M}),(0,react_jsx_runtime.jsx)(ConfirmationDialog,{}),(0,react_jsx_runtime.jsx)(Toast,{})]})]})}const styles$1=react_native.StyleSheet.create({container:{flex:1,backgroundColor:`#1A1A1A`}});var index_native_default=CallUI;const InfoView=({text:e})=>(0,react_jsx_runtime.jsx)(react_native.View,{style:styles.container,children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:[commonStyles.bodyRegular,styles.message],children:e})}),styles=react_native.StyleSheet.create({container:{flex:1,width:`100%`,justifyContent:`center`,alignItems:`center`,backgroundColor:`#272727`,padding:20},message:{color:`#FFF`}});var InfoView_native_default=InfoView;const convertLegacyCallSettingsToV5Props=e=>{let D={},O=e;return typeof O.defaultLayout==`boolean`&&(D.hideControlPanel=!O.defaultLayout),typeof O.isAudioOnly==`boolean`&&(D.sessionType=O.isAudioOnly?`VOICE`:`VIDEO`),typeof O.ShowEndCallButton==`boolean`&&(D.hideLeaveSessionButton=!O.ShowEndCallButton),typeof O.ShowSwitchCameraButton==`boolean`&&(D.hideSwitchCameraButton=!O.ShowSwitchCameraButton),typeof O.ShowMuteAudioButton==`boolean`&&(D.hideToggleAudioButton=!O.ShowMuteAudioButton),typeof O.ShowPauseVideoButton==`boolean`&&(D.hideToggleVideoButton=!O.ShowPauseVideoButton),typeof O.ShowAudioModeButton==`boolean`&&(D.hideAudioModeButton=!O.ShowAudioModeButton),typeof O.StartAudioMuted==`boolean`&&(D.startAudioMuted=O.StartAudioMuted),typeof O.StartVideoMuted==`boolean`&&(D.startVideoPaused=O.StartVideoMuted),typeof O.ShowRecordingButton==`boolean`&&(D.hideRecordingButton=!O.ShowRecordingButton),typeof O.StartRecordingOnCallStart==`boolean`&&(D.autoStartRecording=O.StartRecordingOnCallStart),typeof O.enableDraggableVideoTile==`boolean`&&(D.enableSpotlightDrag=O.enableDraggableVideoTile),typeof O.EnableVideoTileClick==`boolean`&&(D.enableSpotlightSwap=O.EnableVideoTileClick),(O.defaultAudioMode===`BLUETOOTH`||O.defaultAudioMode===`EARPIECE`||O.defaultAudioMode===`HEADPHONES`||O.defaultAudioMode===`SPEAKER`)&&(D.audioMode=O.defaultAudioMode),typeof O.layout==`string`?D.layout=O.layout:(O.mode===`SPOTLIGHT`||O.mode===`SIDEBAR`)&&(D.layout=O.mode),O.idleTimeoutPeriod&&(D.idleTimeoutPeriodAfterPrompt=6e4,D.idleTimeoutPeriodBeforePrompt=Math.max((O.idleTimeoutPeriod-60)*1e3,6e4)),D};var CometChatCallsException=class{code;message;details;constructor(e){`code`in e&&(this.code=e.code),`message`in e&&(this.message=e.message),`details`in e&&(this.details=e.details)}};const CometChatAPIErrorSchema=valibot.object({message:valibot.string(),devMessage:valibot.string(),source:valibot.string(),code:valibot.string()}),HTTPRequestConfigSchema=valibot.object({baseURL:valibot.string(),method:valibot.optional(valibot.union([valibot.literal(`GET`),valibot.literal(`POST`),valibot.literal(`PUT`),valibot.literal(`DELETE`)]),`GET`),endpoint:valibot.string(),headers:valibot.record(valibot.string(),valibot.string()),body:valibot.optional(valibot.unknown())});async function dispatchRequest({baseURL:e,method:D=`GET`,endpoint:O,headers:k,body:A}){let j=valibot.safeParse(HTTPRequestConfigSchema,{baseURL:e,method:D,endpoint:O,headers:k,body:A});if(!j.success)return{responseJson:null,error:{name:`VALIDATION_ERROR`,message:`Invalid request parameters: `+j.issues.map(e=>e.message).join(`, `),timestamp:Date.now()}};let M=`${e}/${O}`,N={method:D,headers:k};A&&D!==`GET`&&(N.body=typeof A==`string`?A:JSON.stringify(A));let{data:F,error:I}=await tryCatch(fetch(M,N));if(I)return{responseJson:null,error:{name:`NETWORK_ERROR`,message:`Network request failed: ${I.message}`,details:I,timestamp:Date.now()}};let{data:L,error:R}=await tryCatch(F.json());if(R)return{responseJson:null,error:{name:`UNKNOWN_ERROR`,message:`Failed to parse response JSON: ${R.message}`,timestamp:Date.now()}};if(L.error){let e=valibot.safeParse(CometChatAPIErrorSchema,L.error);return e.success?{responseJson:null,error:{name:`COMET_CHAT_API_ERROR`,message:e.output.message,details:e.output,timestamp:Date.now()}}:{responseJson:null,error:{name:`UNKNOWN_ERROR`,message:`Unknown API error format received from server`,timestamp:Date.now()}}}return{responseJson:L,error:null}}async function executeHTTPRequest(e){let{responseJson:D,error:O}=await dispatchRequest(e);return O?{data:null,error:O}:{data:D.data,error:null}}async function executeHTTPRequestWithMeta(e){let{responseJson:D,error:O}=await dispatchRequest(e);return O?{data:null,meta:null,error:O}:{data:D.data,meta:D.meta,error:null}}const VerifyTokenArgsSchema=valibot.object({appId:valibot.string(),region:valibot.string(),calltoken:valibot.string(),baseURL:valibot.string()}),VerifyTokenResponseSchema=InternalSettingSchema;async function callVerifyTokenAPI({appId:e,region:D,calltoken:O,baseURL:k}){let A=valibot.safeParse(VerifyTokenArgsSchema,{appId:e,region:D,calltoken:O,baseURL:k});if(!A.success)return{data:null,error:{name:`VALIDATION_ERROR`,message:A.issues.map(e=>e.message).join(`, `)}};let j=await executeHTTPRequest({baseURL:k,method:`GET`,endpoint:`call_tokens?configVersion=1`,headers:{calltoken:O,appId:e}});if(j.error)return j;let M=valibot.safeParse(VerifyTokenResponseSchema,j.data);return M.success?{data:M.output,error:null}:{data:null,error:{name:`BAD_RESPONSE`,message:M.issues.map(e=>e.message).join(`, `)}}}function AppReactNativeSDK(e){let[D,O]=react.default.useState(null),[k,A]=react.default.useState(null),j=(0,react.useMemo)(()=>e.sessionSettings??e.callSettings??{},[e.sessionSettings,e.callSettings]);(0,react.useEffect)(()=>eventBus.subscribe(`onConnectionClosed`,()=>{setTimeout(()=>{A(`The session has ended.`)},0)}),[]),(0,react.useEffect)(()=>{let e=[],D=j??{};return D.listener?.onUserJoined&&e.push(CometChatCalls.addEventListener(`onParticipantJoined`,D.listener.onUserJoined)),D.listener?.onUserLeft&&e.push(CometChatCalls.addEventListener(`onParticipantLeft`,D.listener.onUserLeft)),D.listener?.onUserListUpdated&&e.push(CometChatCalls.addEventListener(`onParticipantListChanged`,D.listener.onUserListUpdated)),D.listener?.onRecordingStarted&&e.push(CometChatCalls.addEventListener(`onRecordingStarted`,D.listener.onRecordingStarted)),D.listener?.onRecordingStopped&&e.push(CometChatCalls.addEventListener(`onRecordingStopped`,D.listener.onRecordingStopped)),D.listener?.onUserMuted&&e.push(CometChatCalls.addEventListener(`onParticipantAudioMuted`,D.listener.onUserMuted)),D.listener?.onAudioModesUpdated&&e.push(CometChatCalls.addEventListener(`onAudioModesChanged`,D.listener.onAudioModesUpdated)),D.listener?.onCallEnded&&(e.push(CometChatCalls.addEventListener(`onSessionLeft`,D.listener.onCallEnded)),e.push(CometChatCalls.addEventListener(`onParticipantListChanged`,e=>{e.length===0&&D.listener.onCallEnded()}))),D.listener?.onCallEndButtonPressed&&e.push(CometChatCalls.addEventListener(`onLeaveSessionButtonClicked`,D.listener.onCallEndButtonPressed)),D.listener?.onSessionTimeout&&e.push(CometChatCalls.addEventListener(`onSessionTimedOut`,D.listener.onSessionTimeout)),D.listener?.onError&&e.push(CometChatCalls.addEventListener(`onConnectionFailed`,e=>{D.listener.onError(new CometChatCallsException({code:e.name,message:e.message,details:e.details}))})),()=>{e.forEach(e=>{e()})}},[j]),(0,react.useEffect)(()=>{callVerifyTokenAPI({appId:CometChatCalls.appSettings?.appId||``,region:CometChatCalls.appSettings?.region||``,calltoken:e.callToken,baseURL:CometChatCalls.getBaseURL?.()}).then(e=>{e.data?O(JSON.stringify(e)):e.error.message?A(e.error.message):A(`Token verification failed.`)}).catch(e=>{})},[e.callToken]);let M=(0,react.useMemo)(()=>({...j,...convertLegacyCallSettingsToV5Props(j??{}),internalSettings:D??``}),[j,D]);return k?(0,react_jsx_runtime.jsx)(InfoView_native_default,{text:k}):D?(0,react_jsx_runtime.jsx)(index_native_default,{sessionSettings:M}):(0,react_jsx_runtime.jsx)(ProcessingOverlay,{message:`Authenticating...`,visible:!0})}const PLATFORM=`react-native`,INTEGRATION_SOURCE_MANUAL=`manual`,INTEGRATION_SOURCE_AI_AGENT=`ai-agent`,SESSION_HASH_KEY_SUFFIX=`cc_callssdk_session_hash`,INTEGRATION_SOURCE_KEY_SUFFIX=`cc_callssdk_integration_source`,DEVICE_ID_KEY_SUFFIX=`cc_callssdk_device_id`,REQUEST_TIMEOUT_MS=2e3;function isChatSdkPresent(){try{let e=typeof global<`u`?global:typeof globalThis<`u`?globalThis:void 0;return e?!!e.CometChat:!1}catch{return!1}}function shouldSelfReport(){return!isChatSdkPresent()}function publishCallSdkInfo(e){try{let D=typeof global<`u`?global:globalThis;if(!D)return;D.CometChatCallSDK={platform:PLATFORM,version:e}}catch{}}function computeSessionHash(e,D,O,k){let A=`${e}|${D}|${O}|${k}`,j=0;for(let e=0;e<A.length;e++)j=Math.imul(31,j)+A.charCodeAt(e)|0;return`cc_${(j>>>0).toString(16)}`}function storageKey(e,D){return`${e}:${D}`}const inMemoryHashByApp=new Map,inflightByKey=new Set;async function getStoredHash(e){try{return await __react_native_async_storage_async_storage.default.getItem(storageKey(e,SESSION_HASH_KEY_SUFFIX))??inMemoryHashByApp.get(e)??null}catch{return inMemoryHashByApp.get(e)??null}}async function storeHash(e,D){try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,SESSION_HASH_KEY_SUFFIX),D)}catch{inMemoryHashByApp.set(e,D)}}const inMemorySourceByApp=new Map;async function setIntegrationSource(e,D){if(e)try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,INTEGRATION_SOURCE_KEY_SUFFIX),D)}catch{inMemorySourceByApp.set(e,D)}}async function getStoredIntegrationSource(e){try{return await __react_native_async_storage_async_storage.default.getItem(storageKey(e,INTEGRATION_SOURCE_KEY_SUFFIX))||INTEGRATION_SOURCE_MANUAL}catch{return inMemorySourceByApp.get(e)??INTEGRATION_SOURCE_MANUAL}}const inMemoryDeviceIdByApp=new Map;async function getOrCreateDeviceId(e){try{let D=await __react_native_async_storage_async_storage.default.getItem(storageKey(e,DEVICE_ID_KEY_SUFFIX));if(D)return D}catch{}let D=inMemoryDeviceIdByApp.get(e);if(D)return D;let O=`rn_`+Math.random().toString(36).slice(2,11)+Date.now().toString(36);inMemoryDeviceIdByApp.set(e,O);try{await __react_native_async_storage_async_storage.default.setItem(storageKey(e,DEVICE_ID_KEY_SUFFIX),O)}catch{}return O}function isDebug(){try{return typeof __DEV__<`u`?!!__DEV__:!1}catch{return!1}}function getTimeZone(){try{let e=-new Date().getTimezoneOffset(),D=e>=0?`+`:`-`,O=Math.abs(e);return`${D}${String(Math.floor(O/60)).padStart(2,`0`)}:${String(O%60).padStart(2,`0`)}`}catch{return``}}function buildPayload(e,D,O,k,A){let j=``;try{let{width:e,height:D}=react_native.Dimensions.get(`screen`);j=`${e} × ${D}`}catch{}let M=typeof window<`u`&&window.navigator?.userAgent?window.navigator.userAgent:``;return{sessionId:D,data:{integrationSource:A,cometchat:{callssdk:{platform:PLATFORM,version:e.callsSdkVersion}},app:{debug:k},device:{id:O,platform:PLATFORM,language:getLocale(),resolution:j,userAgent:M,timezone:getTimeZone(),os:{name:react_native.Platform.OS,version:`${react_native.Platform.Version}`}}},generatedAt:Math.ceil(Date.now()/1e3)}}function getLocale(){try{let e=require(`react-native`).NativeModules;return react_native.Platform.OS===`ios`?e?.SettingsManager?.settings?.AppleLocale||e?.SettingsManager?.settings?.AppleLanguages?.[0]||``:e?.I18nManager?.localeIdentifier||``}catch{return``}}async function maybeSendIdentification(e){try{if(e.disableSdkIdentification||!shouldSelfReport()||!e.authToken||!e.appId)return;let D=getAppVersion(),O=isDebug(),k=computeSessionHash(e.appId,D,e.callsSdkVersion,O);if(await getStoredHash(e.appId)===k)return;let A=`${e.appId}:${k}`;if(inflightByKey.has(A))return;inflightByKey.add(A);try{let D=buildPayload(e,k,await getOrCreateDeviceId(e.appId),O,await getStoredIntegrationSource(e.appId)),{error:A}=await withTimeout(executeHTTPRequest({baseURL:e.apiclientBaseURL,method:`POST`,endpoint:`user_sessions`,headers:{"Content-Type":`application/json`,authToken:e.authToken,appId:e.appId},body:D}),2e3);A||await storeHash(e.appId,k)}finally{inflightByKey.delete(A)}}catch{}}function getAppVersion(){try{return(typeof global<`u`?global:globalThis)?.__CC_APP_VERSION__??``}catch{return``}}async function withTimeout(e,D){let O;try{return await Promise.race([e.then(e=>({error:e.error})),new Promise(e=>{O=setTimeout(()=>e({error:Error(`timeout`)}),D)})])}finally{O&&clearTimeout(O)}}const apiEndpoints={CALL_TOKENS:`call_tokens`,CALL_LIST:`calls`},APP_ID_SPACE=`__APP_ID__`,REGION_SPACE=`__REGION__`,BASE_URL=`https://${APP_ID_SPACE}.call-${REGION_SPACE}.cometchat.io/v3.0/`,postAPI=e=>new Promise(D=>{let O=new Headers;if(O.append(`content-Type`,`application/json`),O.append(`Accept`,`application/json`),typeof e.headers==`object`)for(let D in e.headers)O.append(D,e.headers[D]);let k={method:`POST`,headers:O,body:JSON.stringify(e.data)};fetch(e.url,k).then(e=>e.json()).then(e=>{D({error:null,data:e})}).catch(e=>{D({error:e,data:null})})}),getAPI=e=>new Promise(D=>{let O=new Headers;if(O.append(`Accept`,`application/json`),typeof e.headers==`object`)for(let D in e.headers)O.append(D,e.headers[D]);let k={method:`GET`,headers:O};fetch(e.url,k).then(e=>e.json()).then(e=>{D({error:null,data:e})}).catch(e=>{D({error:e,data:null})})});function encodeQueryData(e){let D=[];for(let O in e)D.push(encodeURIComponent(O)+`=`+encodeURIComponent(e[O]));return D.join(`&`)}var APIHandler=class{static appSettings;static setAppSettings(e){this.appSettings=e}static async generateToken(e,D,O){let k=BASE_URL.replace(APP_ID_SPACE,O.getAppId()).replace(REGION_SPACE,O.getRegion());return O.getHost()&&(k=O.getHost()),postAPI({url:`${k}${apiEndpoints.CALL_TOKENS}`,headers:{authToken:e},data:{sessionId:D}})}static async verifyToken(e,D){let O=BASE_URL.replace(APP_ID_SPACE,D.getAppId()).replace(REGION_SPACE,D.getRegion());return D.getHost()&&(O=D.getHost()),getAPI({url:`${O}${apiEndpoints.CALL_TOKENS}`,headers:{callToken:e}})}static async getCallLogList(e,D){let O=BASE_URL.replace(APP_ID_SPACE,this.appSettings.getAppId()).replace(REGION_SPACE,this.appSettings.getRegion());this.appSettings.getHost()&&(O=this.appSettings.getHost());let k=encodeQueryData(e.toMap());return getAPI({url:`${O}${apiEndpoints.CALL_LIST}?${k}`,headers:{authToken:D}})}static async getCallDetails(e,D){let O=BASE_URL.replace(APP_ID_SPACE,this.appSettings.getAppId()).replace(REGION_SPACE,this.appSettings.getRegion());return this.appSettings.getHost()&&(O=this.appSettings.getHost()),getAPI({url:`${O}${apiEndpoints.CALL_LIST}/${e}`,headers:{authToken:D}})}};const constants={DEFAULT_STORE:`cometchat`,MSG_VER_PRE:`store-ver-pre`,MSG_VER_POST:`store-ver-post`},ERROR_CODES={API_ERROR:{code:`API_ERROR`}},REGION={us:`us`,eu:`eu`,in:`in`,US:`us`,EU:`eu`,IN:`in`},DEFAULT_VALUES={ZERO:0,MSGS_LIMIT:30,MSGS_MAX_LIMIT:100,USERS_LIMIT:30,USERS_MAX_LIMIT:100,GROUPS_LIMIT:30,GROUPS_MAX_LIMIT:100,CONVERSATION_MAX_LIMIT:50,CALL_TIMEOUT:45,DEFAULT_MSG_ID:0,DEFAULT_MAX_TYPING_INDICATOR_LIMIT:5,REGION_DEFAULT:`eu`,REGION_DEFAULT_EU:`eu`,REGION_DEFAULT_US:`us`,REGION_DEFAULT_IN:`in`,REGION_DEFAULT_PRIVATE:`private`};let GroupType=function(e){return e.Public=`public`,e.Private=`private`,e.Protected=`protected`,e.Password=`password`,e}({});const GROUP_TYPE={PUBLIC:`public`,PRIVATE:`private`,PROTECTED:`password`,PASSWORD:`password`};let GroupMemberScope=function(e){return e.Admin=`admin`,e.Moderator=`moderator`,e.Member=`member`,e}({});const GROUP_MEMBER_SCOPE={ADMIN:`admin`,MODERATOR:`moderator`,PARTICIPANT:`participant`},APPINFO={platform:`REACT_NATIVE`,sdkVersion:`v3.0.11`,apiVersion:`v3.0`,sdkVersionWithUnderScore:`3_0_11`,userAgent:`cc_react_native_sdk`},SDKHeader={platform:`react-native`,sdkVersion:`3.0.11`,sdk:`%s@%s`},WS={CONVERSATION:{TYPE:{CHAT:`chat`,GROUP_CHAT:`groupchat`}}},ANALYTICS={analyticsHost:`metrics-%s.cometchat.io`,analyticsVersion:`v1`},LOCAL_STORE={COMMON_STORE:`common_store`,MESSAGE_LISTENERS_LIST:`message_listeners_list`,USERS_STORE:`users_store`,MESSAGES_STORE:`messages_store`,KEYS_STORE:`keys_store`,STORE_STRING:`%s:%s`,KEY_STRING:`%s/%s`,KEY_USER:`user`,KEY_APP_SETTINGS:`app_settings`,KEY_APP_ID:`appId`,KEY_DEVICE_ID:`deviceId`,KEY_MESSAGE_LISTENER_LIST:`all`},ResponseConstants={RESPONSE_KEYS:{KEY_DATA:`data`,KEY_META:`meta`,KEY_CURSOR:`cursor`,KEY_ACTION:`action`,KEY_MESSAGE:`message`,KEY_ERROR:`error`,KEY_ERROR_DETAILS:`details`,KEY_ERROR_CODE:`code`,KEY_ERROR_MESSAGE:`message`,KEY_AUTH_TOKEN:`authToken`,KEY_WS_CHANNEL:`wsChannel`,KEY_IDENTITY:`identity`,KEY_SERVICE:`identity`,KEY_ENTITIES:`entities`,KEY_ENTITITY:`entity`,KEY_ENTITYTYPE:`entityType`,KEY_ATTACHMENTS:`attachments`,CODE_REQUEST_OK:200,CODE_BAD_REQUEST:401,UNREAD_UNDELIVERED_KEYS:{ENTITY:`entity`,ENTITY_TYPE:`entityType`,ENTITY_Id:`entityId`,COUNT:`count`},GROUP_MEMBERS_RESPONSE:{SUCCESS:`success`,ERROR:`error`,MESSAGE:`message`},KEY_ENTITY_TYPE:{USER:`user`,GROUP:`group`}}},DELIVERY_RECEIPTS={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`type`,RECIPIENT:`recipient`,MESSAGE_ID:`messageId`,RECEIVED:`delivered`,DELIVERED_AT:`deliveredAt`,ID:`id`,TIME:`time`,DELIVERED_TO_ME_AT:`deliveredToMeAt`},READ_RECEIPTS={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`type`,RECIPIENT:`recipient`,MESSAGE_ID:`messageId`,READ:`read`,READ_AT:`readAt`,ID:`id`,TIME:`time`,READ_BY_ME_AT:`readByMeAt`},MessageConstatnts={TYPE:{TEXT:`text`,MEDIA:`media`,IMAGE:`image`,VIDEO:`video`,AUDIO:`audio`,FILE:`file`,CUSTOM:`custom`},CATEGORY:{MESSAGE:`message`,ACTION:`action`,CALL:`call`,CUSTOM:`custom`},RECEIVER_TYPE:{USER:`user`,GROUP:`group`},KEYS:{ATTATCHMENT:`attatchment`,ATTATCHMENTS:`attachments`,ACTION:`action`,TYPE:`type`,DATA:`data`,ID:`id`,MUID:`muid`,SENDER:`sender`,RECEIVER:`receiver`,RECEIVER_ID:`receiverId`,CATEGORY:`category`,RECEIVER_TYPE:`receiverType`,SENT_AT:`sentAt`,STATUS:`status`,TEXT:`text`,URL:`url`,METADATA:`metadata`,RECEIPTS:`receipts`,MY_RECEIPTS:`myReceipt`,CUSTOM_DATA:`customData`,CUSTOM_SUB_TYPE:`subType`,RESOURCE:`resource`},KNOWN_MEDIA_TYPE:{IMAGE:[],VIDEO:[],AUDIO:[],FILE:[]},PAGINATION:{AFFIX:{APPEND:`append`,PREPEND:`prepend`},CURSOR_FILEDS:{ID:`id`,SENT_AT:`sentAt`},CURSOR_AFFIX_DEFAULT:`prepend`,CURSOR_FIELD_DEFAULT:`sentAt`,KEYS:{PER_PAGE:`per_page`,CURSOR_AFFIX:`cursorAffix`,AFFIX:`affix`,CURSOR_FIELD:`cursorField`,CURSOR_VALUE:`cursorValue`,UID:`uid`,SENT_AT:`sentAt`,ID:`id`,CURRENT_PAGE:`page`,UNREAD:`unread`,HIDE_MESSAGES_FROM_BLOCKED_USER:`hideMessagesFromBlockedUsers`,SEARCH_KEY:`searchKey`,ONLY_UPDATES:`onlyUpdates`,UPDATED_AT:`updatedAt`,CATEGORY:`category`,CATEGORIES:`categories`,TYPE:`type`,TYPES:`types`,HIDE_REPLIES:`hideReplies`,HIDE_DELETED_MESSAGES:`hideDeleted`,WITH_TAGS:`withTags`,TAGS:`tags`}}},ATTACHMENTS_CONSTANTS={KEYS:{EXTENSION:`extension`,MIME_TYPE:`mimeType`,NAME:`name`,SIZE:`size`,URL:`url`}};let MessageCategory=function(e){return e.ACTION=`action`,e.MESSAGE=`message`,e.CALL=`call`,e.CUSTOM=`custom`,e}({});const TYPING_NOTIFICATION={RECEIVER_ID:`receiverId`,RECEIVER_TYPE:`receiverType`,META:`metadata`,KEYS:{TYPING_NOTIFICATION:`typingNotification`,TIMESTAMP:`timestamp`},ACTIONS:{STARTED:`started`,ENDED:`ended`}},ActionConstatnts={ACTION_SUBJECTS:{ACTION_ON:`on`,ACTION_BY:`by`,ACTION_FOR:`for`},ACTION_ENTITY_TYPE:{GROUP_USER:`groupuser`,USER:`user`,GROUP:`group`,MESSAGE:`message`},ACTION_KEYS:{ACTION_CREATED:`created`,ACTION_UPDATED:`updated`,ACTION_DELETED:`deleted`,ENTITIES:`entities`,ENTITY:`entity`,ENTITY_TYPE:`entityType`,TYPE_MEMBER_JOINED:`joined`,TYPE_MEMBER_LEFT:`left`,TYPE_MEMBER_KICKED:`kicked`,TYPE_MEMBER_BANNED:`banned`,TYPE_MEMBER_UNBANNED:`unbanned`,TYPE_MEMBER_INVITED:`invited`,TYPE_MEMBER_ADDED:`added`,ACTION_SCOPE_CHANGED:`scopeChanged`,ACTION_TYPE_USER:`user`,ACTION_TYPE_GROUP:`group`,ACTION_TYPE_GROUP_MEMBER:`groupMember`,TYPE_MESSAGE_EDITED:`edited`,TYPE_MESSAGE_DELETED:`deleted`,ACTION_TYPE_CALL:`call`,EXTRAS:`extras`,SCOPE:`scope`,NEW:`new`,OLD:`old`},ActionMessages:{ACTION_GROUP_JOINED_MESSAGE:`%s joined`,ACTION_GROUP_LEFT_MESSAGE:`%s left`,ACTION_MEMBER_KICKED_MESSAGE:`%s kicked %s`,ACTION_MEMBER_BANNED_MESSAGE:`%s banned %s`,ACTION_MEMBER_UNBANNED_MESSAGE:`%s unbanned %s`,ACTION_MEMBER_INVITED_MESSAGE:`%s banned %s`,ACTION_MESSAGE_EDITED_MESSAGE:` Message Edited`,ACTION_MESSAGE_DELETED_MESSAGE:`Message Deleted`,ACTION_MEMBER_SCOPE_CHANGED:`%s made %s %s`,ACTION_MEMBER_ADDED_TO_GROUP:`%s added %s`},ACTION_TYPE:{TYPE_MEMBER_JOINED:`joined`,TYPE_MEMBER_LEFT:`left`,TYPE_MEMBER_KICKED:`kicked`,TYPE_MEMBER_BANNED:`banned`,TYPE_MEMBER_UNBANNED:`unbanned`,TYPE_MEMBER_INVITED:`invited`,TYPE_MEMBER_SCOPE_CHANGED:`scopeChanged`,TYPE_MESSAGE:`message`,TYPE_MESSAGE_EDITED:`edited`,TYPE_MESSAGE_DELETED:`deleted`,TYPE_MEMBER_ADDED:`added`},ACTIONS:{MEMBER_ADDED:`added`,MEMBER_JOINED:`joined`,MEMBER_LEFT:`left`,MEMBER_KICKED:`kicked`,MEMBER_BANNED:`banned`,MEMBER_UNBANNED:`unbanned`,MEMBER_INVITED:`invited`,MEMBER_SCOPE_CHANGED:`scopeChanged`,MESSAGE_EDITED:`edited`,MESSSAGE_DELETED:`deleted`,TYPE_USER:`user`,TYPE_GROUP:`group`,TYPE_GROUP_MEMBER:`groupMember`}},BlockedUsersConstants={REQUEST_KEYS:{DIRECTIONS:{BOTH:`both`,HAS_BLOCKED_ME:`hasBlockedMe`,BLOCKED_BY_ME:`blockedByMe`}}},CallConstants={CALL_MODE:{DEFAULT:`DEFAULT`,SPOTLIGHT:`SPOTLIGHT`},AUDIO_MODE:{SPEAKER:`SPEAKER`,EARPIECE:`EARPIECE`,BLUETOOTH:`BLUETOOTH`,HEADPHONES:`HEADPHONES`},CALL_TYPE:{AUDIO:`audio`,VIDEO:`video`},RECEIVER_TYPE_GROUP:`group`,RECEIVER_TYPE_USER:`user`,CALL_KEYS:{CALL_DATA:`data`,CALL_ID:`id`,CALL_SESSION_ID:`sessionid`,CALL_RECEIVER:`receiver`,CALL_SENDER:`sender`,CALL_INITIATOR:`initiator`,CALL_RECEIVER_TYPE:`receiverType`,CALL_STATUS:`status`,CALL_TYPE:`type`,CALL_INITIATED_AT:`initiatedAt`,CALL_JOINED_AT:`joinedAt`,CALL_LEFT_AT:`leftAt`,CALL_METADATA:`metadata`,CALL_ENTITIES:`entities`,CALL_ENTITY_TYPE:`entityType`,CALL_ENTITY:`entity`,CALL_ENTITY_USER:`user`,CALL_ENTITY_GROUP:`group`},CALL_STATUS:{INITIATED:`initiated`,ONGOING:`ongoing`,UNANSWERED:`unanswered`,REJECTED:`rejected`,BUSY:`busy`,CANCELLED:`cancelled`,ENDED:`ended`},ZOOM_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},FULL_SCREEN_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},USER_LIST_BUTTON_DEFAULT_PARAMS:{position:`bottom-right`,visible:!0},NAME_LABEL_DEFAULT_PARAMS:{position:`bottom-left`,visible:!0,color:`#333333`},MAIN_VIDEO_CONTAINER_SETTINGS:{KEYS:{POSITION:`position`,VISIBILITY:`visibility`,COLOR:`color`}}},GroupConstants={KEYS:{NAME:`name`,GUID:`guid`,TYPE:`type`,PASSWORD:`password`,ICON:`icon`,DESCRIPTION:`description`,OWNER:`owner`,METADATA:`metadata`,CREATED_AT:`createdAt`,UPDATED_AT:`updatedAt`,HAS_JOINED:`hasJoined`,WS_CHANNEL:`wsChannel`,TAGS:`tags`}},GroupMemersConstans={KEYS:{SCOPE:`scope`,UID:`uid`,GUID:`guid`,USER:`user`,NAME:`name`}},UserConstants={UID:`uid`,NAME:`name`,AUTH_TOKEN:`authToken`,AVATAR:`avatar`,LAST_ACTIVE_AT:`lastActiveAt`,LINK:`link`,META_DATA:`metadata`,ROLE:`role`,STATUS:`status`,STATUS_MESSAGE:`statusMessage`,USER_NAME:`user_name`,TAGS:`tags`,SORT_BY:{NAME:`name`,STATUS:`status`},SORT_ORDER:{ASCENDING:`asc`,DESCENDING:`desc`}},Errors={ERROR_IO_EXCEPTION:`ERROR_IO_EXCEPTION`,ERROR_JSON_EXCEPTION:`ERROR_JSON_EXCEPTION`,ERROR_PASSWORD_MISSING:`ERROR_PASSWORD_MISSING`,ERROR_LIMIT_EXCEEDED:`ERROR_LIMIT_EXCEEDED`,ERROR_USER_NOT_LOGGED_IN:`ERROR_USER_NOT_LOGGED_IN`,ERROR_INVALID_GUID:`ERROR_INVALID_GUID`,ERROR_PASSWORD_MISSING_MESSAGE:`Password is mandatory for a password group`,ERROR_LIMIT_EXCEEDED_MESSAGE:`Limit Exceeded Max limit of %s`,ERROR_USER_NOT_LOGGED_IN_MESSAGE:`Please log in to CometChat before calling this method`,ERROR_INVALID_GUID_MESSAGE:`Please provide a valid GUID`,ERROR_DEFAULT_MESSAGE:`Something went wrong`,ERR_SETTINGS_HASH_OUTDATED:`ERR_SETTINGS_HASH_OUTDATED`,ERR_NO_AUTH:`ERR_NO_AUTH`},CALL_ERROR$1={CALL_ALREADY_INITIATED:{code:`CALL_ALREADY_INITIATED`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},ERROR_IN_CALLING:{code:`CALL_IN_PROGRESS`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},CANNOT_ACCEPT_CALL:{code:`OTHER_CALL_ONGOING`,name:`OTHER_CALL_ONGOING`,message:`There is already a call in progress`,details:{}},NOT_INITIALIZED:{code:`NOT_INITIALIZED`,name:`NOT_INITIALIZED`,message:`Please call the CometChat.init() method before calling any other methods related to CometChat.`,details:{}},NOT_LOGGED_IN:{code:`NOT_LOGGED_IN`,name:`NOT_LOGGED_IN`,message:`Please login before starting a call.`,details:{}},SESSION_ID_REQUIRED:{code:`SESSION_ID_REQUIRED`,name:`SESSION_ID_REQUIRED`,message:`Please make sure you are passing correct session id.`,details:{}},JWT_NOT_FOUND:{code:`JWT_NOT_FOUND`,name:`JWT_NOT_FOUND`,message:`There was some issue while fetching JWT from API.`,details:{}},MODULE_NOT_INSTALLED:{code:`ERROR_CALL_MODULE_NOT_FOUND`,name:`ERROR_CALL_MODULE_NOT_FOUND`,message:`CometChat Calling module not found. Please add the CometChat Calling dependency and try again.`,details:{}}},PARAMETER_ERROR={PARAMETER_REQUIRED:{code:`%s_NOT_PROVIDED`,name:`%s_NOT_PROVIDED`,message:`please provide the %s.`,details:{}}},GENERAL_ERROR={GENERIC_EXCEPTION:{code:`GENERIC_EXCEPTION`},INVALID_ARGUMENT_EXCEPTION:{code:`INVALID_ARGUMENT_EXCEPTION`},INVALID_PROP_EXCEPTION:{code:`INVALID_PROP_EXCEPTION`},API_ERROR:{code:`API_ERROR`},ERROR_PRESENTER_MODE:{code:`ERROR_PRESENTER_MODE`,message:`Presenter mode is disabled. To use presenter mode, please enable it from the CometChat Apps Dashboard`},UNKNOWN_API_ERROR:{code:`UNKNOWN_API_ERROR`,message:`There is an unknown issue with the API request. Please check your internet connection and verify the api call.`}},ReceiptErrors={MISSING_PARAMETERS:{code:`MISSING_PARAMETERS`,name:`MISSING_PARAMETERS`,message:`Expected 4 parameters received 3`,details:{}},INVALID_PARAMETER:{code:`INVALID_%s`,name:`INVALID_%s`,message:`%s`,details:{}},NO_WEBSOCKET_CONNECTION:{code:`NO_WEBSOCKET_CONNECTION`,name:`NO_WEBSOCKET_CONNECTION`,message:`Connection to our Websockets server is broken. Please retry after some time.`,details:{}},RECEIPTS_TEMPORARILY_BLOCKED:{code:`RECEIPTS_TEMPORARILY_BLOCKED`,name:`RECEIPTS_TEMPORARILY_BLOCKED`,message:`Due to high load. Receipts have been blocked for your app.`,details:{}},UNKNOWN_ERROR_OCCURRED:{code:`UNKNOWN_ERROR_OCCURRED`,name:`UNKNOWN_ERROR_OCCURRED`,message:`Unknown error occurred while marking a message as read.`,details:{}}},APP_SETTINGS={APP_SETTINGS:`app_settings`,KEYS:{CHAT_HOST:`CHAT_HOST`,CHAT_USE_SSL:`CHAT_USE_SSL`,GROUP_SERVICE:`GROUP_SERVICE`,CALL_SERVICE:`CALL_SERVICE`,CHAT_WS_PORT:`CHAT_WS_PORT`,CHAT_WSS_PORT:`CHAT_WSS_PORT`,CHAT_HTTP_BIND_PORT:`CHAT_HTTP_BIND_PORT`,CHAT_HTTPS_BIND_PORT:`CHAT_HTTPS_BIND_PORT`,ADMIN_API_HOST:`ADMIN_API_HOST`,CLIENT_API_HOST:`CLIENT_API_HOST`,WEBRTC_HOST:`WEBRTC_HOST`,WEBRTC_USE_SSL:`WEBRTC_USE_SSL`,WEBRTC_WS_PORT:`WEBRTC_WS_PORT`,WEBRTC_WSS_PORT:`WEBRTC_WSS_PORT`,WEBRTC_HTTP_BIND_PORT:`WEBRTC_HTTP_BIND_PORT`,WEBRTC_HTTPS_BIND_PORT:`WEBRTC_HTTPS_BIND_PORT`,EXTENSION_LIST:`extensions`,EXTENSION_KEYS:{ID:`id`,NAME:`name`},JID_HOST_OVERRIDE:`JID_HOST_OVERRIDE`,CHAT_HOST_OVERRIDE:`CHAT_HOST_OVERRIDE`,CHAT_HOST_APP_SPECIFIC:`CHAT_HOST_APP_SPECIFIC`,MODE:`MODE`,CONNECTION_TYPE:`connection_type`,DEFAULT_MODE:`DEFAULT`,LIMITED_TRANSIENT:`LIMITED_TRANSIENT`,NO_TRANSIENT:`NO_TRANSIENT`,POLLING_ENABLED:`POLLING_ENABLED`,POLLING_INTERVAL:`POLLING_INTERVAL`,ANALYTICS_PING_DISABLED:`ANALYTICS_PING_DISABLED`,ANALYTICS_HOST:`ANALYTICS_HOST`,ANALYTICS_VERSION:`ANALYTICS_VERSION`,ANALYTICS_USE_SSL:`ANALYTICS_USE_SSL`,SETTINGS_HASH:`settingsHash`,SETTINGS_HASH_RECEIVED_AT:`settingsHashReceivedAt`,DENY_FALLBACK_TO_POLLING:`DENY_FALLBACK_TO_POLLING`,APP_VERSION:`APP_VERSION`,MAIN_DOMAIN:`MAIN_DOMAIN`,CHAT_API_VERSION:`CHAT_API_VERSION`,WS_API_VERSION:`WS_API_VERSION`,REGION:`REGION`,EXTENSION_DOMAIN:`EXTENSION_DOMAIN`,WEBRTC_API_SUBDOMAIN:`WEBRTC_API_SUBDOMAIN`}},COMMON_UTILITY_CONSTANTS={TYPE_CONSTANTS:{BOOLEAN:`boolean`,STRING:`string`,OBJECT:`object`,NUMBER:`number`}},CONNECTION_STATUS={CONNECTED:`connected`,CONNECTING:`connecting`,DISCONNECTED:`disconnected`,FEATURE_THROTTLED:`featureThrottled`},API_ERROR_CODES$1={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:`AUTH_ERR_AUTH_TOKEN_NOT_FOUND`},PROSODY_API={DOMAIN_PREFIX:`xmpp`,PATH:{ROOM:`room`,ROOM_SIZE:`room-size`,SESSIONS:`sessions`},RESPONSE:{PARTICIPANTS:`participants`},QUERY_PARAMETERS:{DOMAIN:`domain`,ROOM:`room`}},ProsodyApiErrors={INVALID_SESSIONID:{code:`ERROR_INVALID_SESSIONID`,name:`ERROR_INVALID_SESSIONID`,message:`The provided sessionId cannot be null or empty. Please provide a valid sessionId.`,details:``},INVALID_TYPE:{code:`ERROR_INVALID_TYPE`,name:`ERROR_INVALID_TYPE`,message:`The provided type cannot be null or empty. Please provide a valid type.`,details:``}},JWT_API={KEYS:{PASSTHROUGH:`passthrough`,EXPAND:`expand`}},ONLINE_MEMBER_COUNT_API={ENDPOINTS:{GET_ONLINE_MEMBER_COUNT:`api/%s/online-members`},RESPONSE:{ONLINE_USERS_COUNT:`onlineUsersCount`,GROUPS:`groups`},ERRORS:{INVALID_GROUPLIST:{code:`ERROR_INVALID_GROUPLIST`,name:`ERROR_INVALID_GROUPLIST`,message:`Grouplist cannot be null or empty.`,details:``}}};function isFalsy(e){return e!=null&&(typeof e==`string`&&(e=e.trim()),typeof e==`object`&&Object.keys(e).length===0&&(e=void 0)),[``,0,`0`,!1,null,`null`,void 0,`undefined`].includes(e)}function isJSON(e){try{return JSON.stringify(e),!0}catch{return!1}}var Logger=class{static log(e,D){}static error(e,D){}static info(e,D){}};function throwGenericException(e){typeof e?.toString==`function`||typeof e==`string`||isJSON(e)}var OngoingCallListener=class{onUserJoined;onUserLeft;onUserListUpdated;onAudioModesUpdated;onCallEnded;onSessionTimeout;onCallEndButtonPressed;onError;onRecordingStarted;onRecordingStopped;onUserMuted;onCallSwitchedToVideo;constructor(e){isFalsy(e.onUserJoined)||(this.onUserJoined=e.onUserJoined),isFalsy(e.onUserLeft)||(this.onUserLeft=e.onUserLeft),isFalsy(e.onUserListUpdated)||(this.onUserListUpdated=e.onUserListUpdated),isFalsy(e.onAudioModesUpdated)||(this.onAudioModesUpdated=e.onAudioModesUpdated),isFalsy(e.onCallEnded)||(this.onCallEnded=e.onCallEnded),isFalsy(e.onSessionTimeout)||(this.onSessionTimeout=e.onSessionTimeout),isFalsy(e.onCallEndButtonPressed)||(this.onCallEndButtonPressed=e.onCallEndButtonPressed),isFalsy(e.onError)||(this.onError=e.onError),isFalsy(e.onRecordingStarted)||(this.onRecordingStarted=e.onRecordingStarted),isFalsy(e.onRecordingStopped)||(this.onRecordingStopped=e.onRecordingStopped),isFalsy(e.onUserMuted)||(this.onUserMuted=e.onUserMuted),isFalsy(e.onCallSwitchedToVideo)||(this.onCallSwitchedToVideo=e.onCallSwitchedToVideo)}},ListenerHandlers=class e{static callHandlers=[];static addCallEventListener(D,O){try{e.callHandlers=e?.callHandlers.filter(e=>e._name!=D),e.callHandlers=[...e.callHandlers,{_name:D,...new OngoingCallListener(O)}]}catch{}}static removeCallEventListener(D){try{e.callHandlers=e?.callHandlers.filter(e=>e._name!==D)}catch{}}},CallAppSettings=class{appId;region;host;constructor(e){this.appId=e.appId,this.region=e.region,this.host=e.host}setAppId(e){return this.appId=e,this}setRegion(e){return this.region=e,this}setHost(e){return this.host=e,this}getAppId(){return this.appId}getRegion(){return this.region}getHost(){return this.host}},CallAppSettingsBuilder=class{appId;region;host;setAppId(e){return this.appId=e,this}setRegion(e){return this.region=e,this}setHost(e){return this.host=e,this}build(){return new CallAppSettings(this)}};function validateCallAppSettings(e){return new Promise((D,O)=>{let k=new CometChatCallsException({code:`INVALID_CALL_APP_SETTINGS`});if(!(e instanceof CallAppSettings)){k.message=`appSettings must be an instance of CallAppSettings class`,O(k);return}let A=e.getAppId(),j=e.getRegion(),M=e.getHost();if(typeof A!=`string`||A.length===0){k.message=`Invalid app id, please check your appSettings`,O(k);return}if(typeof j!=`string`||!REGION[j]){k.message=`Invalid region, please check your appSettings`,O(k);return}if(M!=null&&typeof M!=`string`){k.message=`Invalid host, please check your appSettings`,O(k);return}D(!0)})}const SERVER_ERRORS={AUTH_ERR:{code:`AUTH_ERR_AUTH_TOKEN_NOT_FOUND`,message:`The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again.`}},ERRORS={PARAMETER_MISSING:{code:`MISSING_PARAMETERS`,name:`Invalid or no parameter passed to the method.`}},INIT_ERROR={NO_APP_ID:{code:ERRORS.PARAMETER_MISSING.code,name:ERRORS.PARAMETER_MISSING.name,message:`AppID cannot be empty. Please specify a valid appID.`,details:{}}},GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:`ERR_EMPTY_GROUP_PASS`,details:void 0,message:`Password is mandatory to join a group.`,name:void 0}},USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:`EMPTY_USERS_LIST`,name:`EMPTY_USERS_LIST`,message:`The users list needs to have atleast one UID.`,details:{}}},MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:`REQUEST_IN_PROGRESS`,name:`REQUEST_IN_PROGRESS`,message:`Request in progress.`,details:{}},NOT_ENOUGH_PARAMS:{code:`NOT_ENOUGH_PARAMETERS`,name:`NOT_ENOUGH_PARAMETERS`,message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:`-1`,name:`%s_CUSTOM_DATA`,message:``,details:{}}},LOGIN_ERROR={NOT_INITIALIZED:{code:`-1`,name:`COMETCHAT_INITIALIZATION_NOT_DONE`,message:`please initialize the cometchat before using login method.`,details:{}},UNAUTHORISED:{code:401,name:`USER_NOT_AUTHORISED`,message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:`WS_CONNECTION_FAIL`,message:`WS Connection failed. %s`,details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:`WS_CONNECTION_FAIL`,message:`WS Connection failed. Trying to connect with port: %s`,details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:`WS_CONNECTION_FALLBACK_FAIL`,message:`WS Connection fallback failed. Trying to connect with port: %s`,details:{}},WS_AUTH_FAIL:{code:-1,name:`WS_AUTH_FAIL`,message:`WS username/password not correct.`,details:{}},NO_INTERNET:{code:-1,name:`NO_INTERNET_CONNECTION`,message:`You do not have internet connection.`,details:{}},REQUEST_IN_PROGRESS:{code:-1,name:`LOGIN_IN_PROGRESS`,message:`Please wait until the previous login request ends.`,details:{}}},TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:`TOO_MANY_REQUEST`,name:`TOO MANY REQUEST`,message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},FETCH_ERROR={ERROR_IN_API_CALL:{code:`FAILED_TO_FETCH`,name:`FAILED_TO_FETCH`,message:`There is an unknown issue with the API request. Please check your internet connection and verify the api call.`,details:{}}};var CallGroup=class e{guid;name;icon;constructor(e){Object.assign(this,e)}getGuid(){return this.guid}setGuid(e){this.guid=e}getName(){return this.name}setName(e){this.name=e}getIcon(){return this.icon}setIcon(e){this.icon=e}toString(){return`CallGroup{ guid='${this.guid}', name='${this.name}', icon='${this.icon}' }`}static getGroupFromJson(D){return new e(D)}},CallUser=class e{uid;name;avatar;constructor(e){Object.assign(this,e)}getUid(){return this.uid}setUid(e){this.uid=e}getName(){return this.name}setName(e){this.name=e}getAvatar(){return this.avatar}setAvatar(e){this.avatar=e}toString(){return`CallUser{ uid='${this.uid}', name='${this.name}', avatar='${this.avatar}' }`}static getUserFromJson(D){return new e(D)}},Participant=class e{uid;name;avatar;totalAudioMinutes;totalVideoMinutes;totalDurationInMinutes;deviceID;hasJoined;joinedAt;leftAt;mid;state;constructor(e){Object.assign(this,e)}getUid(){return this.uid}setUid(e){this.uid=e}getName(){return this.name}setName(e){this.name=e}getAvatar(){return this.avatar}setAvatar(e){this.avatar=e}getTotalAudioMinutes(){return this.totalAudioMinutes}setTotalAudioMinutes(e){this.totalAudioMinutes=e}getTotalVideoMinutes(){return this.totalVideoMinutes}setTotalVideoMinutes(e){this.totalVideoMinutes=e}getTotalDurationInMinutes(){return this.totalDurationInMinutes}setTotalDurationInMinutes(e){this.totalDurationInMinutes=e}getDeviceID(){return this.deviceID}setDeviceID(e){this.deviceID=e}getHasJoined(){return this.hasJoined}setHasJoined(e){this.hasJoined=e}getJoinedAt(){return this.joinedAt}setJoinedAt(e){this.joinedAt=e}getLeftAt(){return this.leftAt}setLeftAt(e){this.leftAt=e}getMid(){return this.mid}setMid(e){this.mid=e}getState(){return this.state}setState(e){this.state=e}static getParticipantFromJson(D){return new e(D)}},Recording=class e{rid;recording_url;startTime;endTime;duration;constructor(e){Object.assign(this,e)}getRid(){return this.rid}setRid(e){this.rid=e}getRecordingURL(){return this.recording_url}setRecordingURL(e){this.recording_url=e}getStartTime(){return this.startTime}setStartTime(e){this.startTime=e}getEndTime(){return this.endTime}setEndTime(e){this.endTime=e}getDuration(){return this.duration}setDuration(e){this.duration=e}static getRecordingFromJson(D){return new e(D)}},Transcription=class e{tid;mid;roomName;startTime;endTime;transcriptDate;transcriptUrl;constructor(e){Object.assign(this,e)}getTid(){return this.tid}setTid(e){this.tid=e}getMid(){return this.mid}setMid(e){this.mid=e}getRoomName(){return this.roomName}setRoomName(e){this.roomName=e}getStartTime(){return this.startTime}setStartTime(e){this.startTime=e}getEndTime(){return this.endTime}setEndTime(e){this.endTime=e}getTranscriptDate(){return this.transcriptDate}setTranscriptDate(e){this.transcriptDate=e}getTranscriptURL(){return this.transcriptUrl}setTranscriptURL(e){this.transcriptUrl=e}static getTranscriptionFromJson(D){return new e(D)}},CallLog=class e{sessionId;totalAudioMinutes;totalVideoMinutes;totalDuration;hasRecording;initiatedAt;startedAt;callCategory;mode;initiator;receiver;receiverType;status;totalDurationInMinutes;totalParticipants;type;mid;endedAt;participants;recordings;transcriptions;constructor(e){Object.assign(this,e)}getSessionID(){return this.sessionId}setSessionID(e){this.sessionId=e}getTotalAudioMinutes(){return this.totalAudioMinutes}setTotalAudioMinutes(e){this.totalAudioMinutes=e}getTotalVideoMinutes(){return this.totalVideoMinutes}setTotalVideoMinutes(e){this.totalVideoMinutes=e}getTotalDuration(){return this.totalDuration}setTotalDuration(e){this.totalDuration=e}getHasRecording(){return this.hasRecording}setHasRecording(e){this.hasRecording=e}getInitiatedAt(){return this.initiatedAt}setInitiatedAt(e){this.initiatedAt=e}getStartedAt(){return this.startedAt}setStartedAt(e){this.startedAt=e}getMode(){return this.mode}setMode(e){this.mode=e}getCallCategory(){return this.callCategory}setCallCategory(e){this.callCategory=e}getInitiator(){return this.initiator}setInitiator(e){this.initiator=e}getReceiver(){return this.receiver}setReceiver(e){this.receiver=e}getReceiverType(){return this.receiverType}setReceiverType(e){this.receiverType=e}getStatus(){return this.status}setStatus(e){this.status=e}getTotalDurationInMinutes(){return this.totalDurationInMinutes}setTotalDurationInMinutes(e){this.totalDurationInMinutes=e}getTotalParticipants(){return this.totalParticipants}setTotalParticipants(e){this.totalParticipants=e}getType(){return this.type}setType(e){this.type=e}getMid(){return this.mid}setMid(e){this.mid=e}getEndedAt(){return this.endedAt}setEndedAt(e){this.endedAt=e}getParticipants(){return this.participants}setParticipants(e){this.participants=e}getRecordings(){return this.recordings}setRecordings(e){this.recordings=e}getTranscriptions(){return this.transcriptions??[]}setTranscriptions(e){this.transcriptions=e}static callLogFromJson(D){let O=new e(D);if(D.participants&&(O.participants=D.participants.map(e=>Participant.getParticipantFromJson(e))),D.recordings&&(O.recordings=D.recordings.map(e=>Recording.getRecordingFromJson(e))),D.transcriptions&&(O.transcriptions=D.transcriptions.map(e=>Transcription.getTranscriptionFromJson(e))),D.initiator&&D[CallConstants.CALL_KEYS.CALL_DATA]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR][CallConstants.CALL_KEYS.CALL_ENTITY]){let e=D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_INITIATOR][CallConstants.CALL_KEYS.CALL_ENTITY];O.initiator=CallUser.getUserFromJson(e)}if(D.receiver&&D[CallConstants.CALL_KEYS.CALL_DATA]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER]&&D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER][CallConstants.CALL_KEYS.CALL_ENTITY]){let e=D[CallConstants.CALL_KEYS.CALL_DATA][CallConstants.CALL_KEYS.CALL_ENTITIES][CallConstants.CALL_KEYS.CALL_RECEIVER][CallConstants.CALL_KEYS.CALL_ENTITY];D.receiverType==CallConstants.RECEIVER_TYPE_USER?O.receiver=CallUser.getUserFromJson(e):O.receiver=CallGroup.getGroupFromJson(e)}return O}},CallSettings=class{static POSITION_TOP_LEFT=`top-left`;static POSITION_TOP_RIGHT=`top-right`;static POSITION_BOTTOM_LEFT=`bottom-left`;static POSITION_BOTTOM_RIGHT=`bottom-right`;static ASPECT_RATIO_DEFAULT=`default`;static ASPECT_RATIO_CONTAIN=`contain`;static ASPECT_RATIO_COVER=`cover`;static POSITION={TOP_LEFT:`top-left`,TOP_RIGHT:`top-right`,BOTTOM_LEFT:`bottom-left`,BOTTOM_RIGHT:`bottom-right`};static ASPECT_RATIO={DEFAULT:`default`,CONTAIN:`contain`,COVER:`cover`};defaultLayout;isAudioOnly;listener;mode;ShowEndCallButton;ShowSwitchCameraButton;ShowMuteAudioButton;ShowPauseVideoButton;ShowAudioModeButton;StartAudioMuted;StartVideoMuted;defaultAudioMode;ShowSwitchToVideoCallButton;AvatarMode;ShowRecordingButton;idleTimeoutPeriod;StartRecordingOnCallStart;MainVideoContainerSetting;EnableVideoTileClick;enableDraggableVideoTile;constructor(e){this.defaultLayout=e.defaultLayout,this.isAudioOnly=e.isAudioOnly,this.listener=e.listener,this.mode=e.mode,this.ShowEndCallButton=e.ShowEndCallButton,this.ShowSwitchCameraButton=e.ShowSwitchCameraButton,this.ShowMuteAudioButton=e.ShowMuteAudioButton,this.ShowPauseVideoButton=e.ShowPauseVideoButton,this.ShowAudioModeButton=e.ShowAudioModeButton,this.StartAudioMuted=e.StartAudioMuted,this.StartVideoMuted=e.StartVideoMuted,this.defaultAudioMode=e.defaultAudioMode,this.ShowSwitchToVideoCallButton=e.ShowSwitchToVideoCallButton,this.AvatarMode=e.AvatarMode,this.ShowRecordingButton=e.ShowRecordingButton,this.idleTimeoutPeriod=e.idleTimeoutPeriod,this.StartRecordingOnCallStart=e.StartRecordingOnCallStart,this.MainVideoContainerSetting=e.MainVideoContainerSetting,this.EnableVideoTileClick=e.EnableVideoTileClick,this.enableDraggableVideoTile=e.enableDraggableVideoTile}isAudioOnlyCall(){return this.isAudioOnly}isDefaultLayoutEnabled(){return this.defaultLayout}getCallEventListener(){return this.listener}getMode(){return this.mode}isEndCallButtonEnabled(){return this.ShowEndCallButton}isSwitchCameraButtonEnabled(){return this.ShowSwitchCameraButton}isMuteAudioButtonEnabled(){return this.ShowMuteAudioButton}isPauseVideoButtonEnabled(){return this.ShowPauseVideoButton}isAudioModeButtonEnabled(){return this.ShowAudioModeButton}getStartWithAudioMuted(){return this.StartAudioMuted}getStartWithVideoMuted(){return this.StartVideoMuted}getDefaultAudioMode(){return this.defaultAudioMode}isAudioToVideoButtonEnabled(){return this.ShowSwitchToVideoCallButton}getAvatarMode(){return this.AvatarMode}isRecordingButtonEnabled(){return this.ShowRecordingButton}getIdleTimeoutPeriod(){return this.idleTimeoutPeriod}shouldStartRecordingOnCallStart(){return this.StartRecordingOnCallStart}getMainVideoContainerSetting(){return this.MainVideoContainerSetting}isVideoTileClickEnabled(){return this.EnableVideoTileClick}isVideoTileDragEnabled(){return this.enableDraggableVideoTile}},CallSettingsBuilder=class{defaultLayout=!0;isAudioOnly=!1;listener;mode=CallConstants.CALL_MODE.DEFAULT;ShowEndCallButton=!0;ShowSwitchCameraButton=!0;ShowMuteAudioButton=!0;ShowPauseVideoButton=!0;ShowAudioModeButton=!0;StartAudioMuted=!1;StartVideoMuted=!1;defaultAudioMode;ShowSwitchToVideoCallButton=!0;AvatarMode=`circle`;ShowRecordingButton=!1;idleTimeoutPeriod=180;StartRecordingOnCallStart=!1;MainVideoContainerSetting=new MainVideoContainerSetting;EnableVideoTileClick=!0;enableDraggableVideoTile=!0;enableDefaultLayout(e){return this.defaultLayout=e,this}setIsAudioOnlyCall(e){return this.isAudioOnly=e,this}setCallEventListener(e){return this.listener=e,this}setMode(e){return this.mode=e,this}showEndCallButton(e=!0){return this.ShowEndCallButton=e,this}showSwitchCameraButton(e=!0){return this.ShowSwitchCameraButton=e,this}showMuteAudioButton(e=!0){return this.ShowMuteAudioButton=e,this}showPauseVideoButton(e=!0){return this.ShowPauseVideoButton=e,this}showAudioModeButton(e=!0){return this.ShowAudioModeButton=e,this}startWithAudioMuted(e=!1){return this.StartAudioMuted=e,this}startWithVideoMuted(e=!1){return this.StartVideoMuted=e,this}setDefaultAudioMode(e){return this.defaultAudioMode=e,this}showSwitchToVideoCallButton(e=!0){return this.ShowSwitchToVideoCallButton=e,this}setAvatarMode(e=`circle`){return this.AvatarMode=e,this}showRecordingButton(e=!1){return this.ShowRecordingButton=e,this}setIdleTimeoutPeriod(e=180){return this.idleTimeoutPeriod=e,this}startRecordingOnCallStart(e=!1){return this.StartRecordingOnCallStart=e,this}setMainVideoContainerSetting(...e){return this}enableVideoTileClick(e=!0){return this.EnableVideoTileClick=e,this}enableVideoTileDrag(e=!0){return this.enableDraggableVideoTile=e,this}build(){return new CallSettings(this)}},MainVideoContainerSetting=class{videoFit=CallSettings.ASPECT_RATIO_CONTAIN;zoomButton=CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS;fullScreenButton=CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS;userListButton=CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS;nameLabel=CallConstants.NAME_LABEL_DEFAULT_PARAMS;setMainVideoAspectRatio(e=`contain`){this.videoFit=e}setFullScreenButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,D=!0){isFalsy(e)||(this.fullScreenButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),D!=null&&D!=null&&(this.fullScreenButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=D)}setNameLabelParams(e=CallSettings.POSITION_BOTTOM_LEFT,D=!0,O=`#333333`){isFalsy(e)||(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),D!=null&&D!=null&&(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=D),isFalsy(O)||(this.nameLabel[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=O)}setZoomButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,D=!0){isFalsy(e)||(this.zoomButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),D!=null&&D!=null&&(this.zoomButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=D)}setUserListButtonParams(e=CallSettings.POSITION_BOTTOM_RIGHT,D=!0){isFalsy(e)||(this.userListButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),D!=null&&D!=null&&(this.userListButton[CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=D)}},CallLogFilterParams=class{perPage=-1;page=-1;mode;type;status;direction;hasRecording;hasTranscriptions;uid;guid;setDirection(e){this.direction=e}setStatus(e){this.status=e}setType(e){this.type=e}setPerPage(e){this.perPage=e}setPage(e){this.page=e}setMode(e){this.mode=e}setHasRecordings(e){this.hasRecording=e}setHasTranscriptions(e){this.hasTranscriptions=e}setUid(e){this.uid=e}setGuid(e){this.guid=e}toMap(){let e={};return this.perPage!==-1&&(e.perPage=String(this.perPage)),this.page!==-1&&(e.page=String(this.page)),this.mode&&(e.mode=this.mode),this.type&&(e.type=this.type),this.status&&(e.status=this.status),this.direction&&(e.direction=this.direction),this.uid&&(e.uid=this.uid),this.guid&&(e.guid=this.guid),this.hasRecording!==null&&this.hasRecording!==void 0&&(e.hasRecording=this.hasRecording?`true`:`false`),this.hasTranscriptions&&(e.hasTranscriptions=`1`),e}},CallLogRequest=class{limit=30;totalPages=0;currentPage=0;callType;callStatus;hasRecording;hasTranscriptions;callCategory;callDirection;uid;guid;authToken;inProgress=!1;updatedAt=0;onlyUpdates=0;timestamp=0;id=DEFAULT_VALUES.DEFAULT_MSG_ID;affix;constructor(e){this.limit=e.limit,this.callType=e.callType,this.callStatus=e.callStatus,this.hasRecording=e.hasRecording,this.hasTranscriptions=e.hasTranscriptions,this.callCategory=e.callCategory,this.callDirection=e.callDirection,this.uid=e.uid,this.guid=e.guid,this.authToken=e.authToken}fetchNext(){return this.makeAPICall(!0)}fetchPrevious(){return this.makeAPICall()}getCurrentPage(){return this.currentPage}getTotalPages(){return this.totalPages}makeAPICall(e){return new Promise(async(D,O)=>{try{if(e?this.totalPages!=0&&this.totalPages==this.currentPage:this.currentPage==1){this.inProgress=!1,D([]);return}if(this.inProgress){this.inProgress=!1,O(new CometChatCallsException(MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR));return}if(this.inProgress=!0,!this.authToken){this.inProgress=!1,O(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Auth Token` is required to use the 'fetchNext()' method."}));return}try{let k=await APIHandler.getCallLogList(this.getParams(e),this.authToken);if(k?.data?.error){this.inProgress=!1,O(new CometChatCallsException(k.data.error));return}D(this.getCallLogList(JSON.stringify(k.data))),this.inProgress=!1}catch(e){this.inProgress=!1,O(new CometChatCallsException(e))}}catch{this.inProgress=!1,O(new CometChatCallsException({code:`UNKNOWN ERROR`,message:`Unknown error`}))}})}getParams(e){let D=new CallLogFilterParams;return e?D.setPage(this.currentPage+1):D.setPage(this.currentPage-1),D.setPerPage(this.limit),this.hasRecording&&D.setHasRecordings(this.hasRecording),this.hasTranscriptions&&D.setHasTranscriptions(this.hasTranscriptions),this.callStatus&&D.setStatus(this.callStatus),this.callType&&D.setType(this.callType),this.callCategory&&D.setMode(this.callCategory),this.callDirection&&D.setDirection(this.callDirection),this.uid&&D.setUid(this.uid),this.guid&&D.setGuid(this.guid),D}getCallLogList(e){let D=[],O=JSON.parse(e),k=O.meta;if(k.pagination){let e=k.pagination;e.total_pages&&(this.totalPages=e.total_pages,this.currentPage=e.current_page)}let A=O.data;for(let e=0;e<A.length;e++){let O=A[e],k=CallLog.callLogFromJson(O);D.push(k)}return D}},CallLogRequestBuilder=class{limit=30;callType;callStatus;hasRecording;hasTranscriptions;callCategory;callDirection;uid;guid;authToken;setLimit(e){return this.limit=e,this}setCallType(e){return this.callType=e,this}setCallStatus(e){return this.callStatus=e,this}setHasRecording(e){return this.hasRecording=e,this}setHasTranscriptions(e){return this.hasTranscriptions=e,this}setCallCategory(e){return this.callCategory=e,this}setCallDirection(e){return this.callDirection=e,this}setUid(e){return this.uid=e,this}setGuid(e){return this.guid=e,this}setAuthToken(e){return this.authToken=e,this}build(){return new CallLogRequest(this)}},MessageComponent=class extends react.default.Component{constructor(e){super(e)}render(){return(0,react_jsx_runtime.jsx)(react_native.View,{style:{flex:1,backgroundColor:`#000`,justifyContent:`center`,alignItems:`center`,padding:20},children:(0,react_jsx_runtime.jsx)(react_native.Text,{style:{color:`#FFF`},children:this.props.message})})}},PresenterSettings=class{static POSITION_TOP_LEFT=`top-left`;static POSITION_TOP_RIGHT=`top-right`;static POSITION_BOTTOM_LEFT=`bottom-left`;static POSITION_BOTTOM_RIGHT=`bottom-right`;static ASPECT_RATIO_DEFAULT=`default`;static ASPECT_RATIO_CONTAIN=`contain`;static ASPECT_RATIO_COVER=`cover`;static POSITION={TOP_LEFT:`top-left`,TOP_RIGHT:`top-right`,BOTTOM_LEFT:`bottom-left`,BOTTOM_RIGHT:`bottom-right`};static ASPECT_RATIO={DEFAULT:`default`,CONTAIN:`contain`,COVER:`cover`};defaultLayout;isAudioOnly;isPresenter;listener;ShowEndCallButton;ShowSwitchCameraButton;ShowMuteAudioButton;ShowPauseVideoButton;ShowAudioModeButton;StartAudioMuted;StartVideoMuted;defaultAudioMode;ShowRecordingButton;idleTimeoutPeriod;constructor(e){this.defaultLayout=e.defaultLayout,this.isAudioOnly=e.isAudioOnly,this.isPresenter=e.isPresenter,this.listener=e.listener,this.ShowEndCallButton=e.ShowEndCallButton,this.ShowSwitchCameraButton=e.ShowSwitchCameraButton,this.ShowMuteAudioButton=e.ShowMuteAudioButton,this.ShowPauseVideoButton=e.ShowPauseVideoButton,this.ShowAudioModeButton=e.ShowAudioModeButton,this.StartAudioMuted=e.StartAudioMuted,this.StartVideoMuted=e.StartVideoMuted,this.defaultAudioMode=e.defaultAudioMode,this.ShowRecordingButton=e.ShowRecordingButton,this.idleTimeoutPeriod=e.idleTimeoutPeriod}isAudioOnlyCall(){return this.isAudioOnly}getIsPresenter(){return this.isPresenter}isDefaultLayoutEnabled(){return this.defaultLayout}getCallEventListener(){return this.listener}isEndCallButtonEnabled(){return this.ShowEndCallButton}isSwitchCameraButtonEnabled(){return this.ShowSwitchCameraButton}isMuteAudioButtonEnabled(){return this.ShowMuteAudioButton}isPauseVideoButtonEnabled(){return this.ShowPauseVideoButton}isAudioModeButtonEnabled(){return this.ShowAudioModeButton}getStartWithAudioMuted(){return this.StartAudioMuted}getStartWithVideoMuted(){return this.StartVideoMuted}getDefaultAudioMode(){return this.defaultAudioMode}isRecordingButtonEnabled(){return this.ShowRecordingButton}getIdleTimeoutPeriod(){return this.idleTimeoutPeriod}},PresenterSettingsBuilder=class{defaultLayout=!0;isAudioOnly=!1;isPresenter=!1;listener;ShowEndCallButton=!0;ShowSwitchCameraButton=!0;ShowMuteAudioButton=!0;ShowPauseVideoButton=!0;ShowAudioModeButton=!0;StartAudioMuted=!1;StartVideoMuted=!1;defaultAudioMode;ShowRecordingButton=!1;idleTimeoutPeriod=180;enableDefaultLayout(e){return this.defaultLayout=e,this}setIsAudioOnlyCall(e){return this.isAudioOnly=e,this}setIsPresenter(e){return this.isPresenter=e,this}setCallEventListener(e){return this.listener=e,this}showEndCallButton(e=!0){return this.ShowEndCallButton=e,this}showSwitchCameraButton(e=!0){return this.ShowSwitchCameraButton=e,this}showMuteAudioButton(e=!0){return this.ShowMuteAudioButton=e,this}showPauseVideoButton(e=!0){return this.ShowPauseVideoButton=e,this}showAudioModeButton(e=!0){return this.ShowAudioModeButton=e,this}startWithAudioMuted(e=!1){return this.StartAudioMuted=e,this}startWithVideoMuted(e=!1){return this.StartVideoMuted=e,this}setDefaultAudioMode(e){return this.defaultAudioMode=e,this}showRecordingButton(e=!1){return this.ShowRecordingButton=e,this}setIdleTimeoutPeriod(e){return this.idleTimeoutPeriod=e,this}build(){return new PresenterSettings(this)}},CometChatCallsComponentCore=class extends react.default.Component{static ref=null;callsettings;constructor(e){if(super(e),this.state={shouldLoad:!1,errored:!1},this.callsettings=e.callSettings,!this.callsettings||!(this.callsettings instanceof CallSettings||this.callsettings instanceof PresenterSettings)){this.state={...this.state,errored:!0};return}validateCallAppSettings(CometChatCalls$1.getAppSettings()).then(()=>{if(typeof e.callToken!=`string`||e.callToken===``){let e=new CometChatCallsException({code:GENERAL_ERROR.INVALID_ARGUMENT_EXCEPTION.code,message:`Invalid callToken passed, please verify.`});this.callsettings.getCallEventListener()?.onError?.(e);return}APIHandler.verifyToken(e.callToken,CometChatCalls$1.getAppSettings()).then(D=>{if(D?.data?.error?.message){this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:D?.data?.error?.message}));return}if(this.callsettings.user={...D.data.data.payload.data.user,jwt:this.props.callToken},this.callsettings.sessionID=D.data.data.payload.room,this.callsettings.appId=D.data.data.payload.data.appId,this.callsettings.domain=D.data.data.settings.WEBRTC_HOST,typeof this.callsettings.analyticsSettings!=`object`&&(this.callsettings.analyticsSettings={}),D?.data?.data?.settings?.ANALYTICS_HOST&&(this.callsettings.analyticsSettings.ANALYTICS_HOST=D.data.data.settings.ANALYTICS_HOST),D?.data?.data?.settings?.ANALYTICS_VERSION&&(this.callsettings.analyticsSettings.ANALYTICS_VERSION=D.data.data.settings.ANALYTICS_VERSION),e.presenterMode)if(D?.data?.data?.settings?.PRESENTER_MODE_ENABLED===!0)this.setState({shouldLoad:!0,errored:!1});else{let e=new CometChatCallsException({code:GENERAL_ERROR.ERROR_PRESENTER_MODE.code,message:GENERAL_ERROR.ERROR_PRESENTER_MODE.message});this.callsettings.getCallEventListener()?.onError?.(e),ListenerHandlers?.callHandlers?.map(D=>{D?.onError?.(e)}),this.setState({shouldLoad:!1,errored:!0})}else this.setState({shouldLoad:!0,errored:!1})}).catch(e=>{this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:`Unknown API error`,details:e})),this.setState({errored:!0})})}).catch(e=>{this.callsettings.getCallEventListener()?.onError?.(new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:`Unknown API error`,details:e})),this.setState({errored:!0})})}render(){return this.state.errored?(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Something went wrong! Please check logs for more details.`}):this.state.shouldLoad?(0,react_jsx_runtime.jsx)(react_native.View,{style:{flex:1,backgroundColor:`#000`}}):(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Initializing...`})}},CometChatPresenterComponent=class extends react.default.Component{constructor(e){super(e),this.state={errored:!1},this.props.presenterSettings.mode=`PRESENTER`,this.props.presenterSettings instanceof PresenterSettings||(this.state={...this.state,errored:!0})}render(){return this.state.errored?(0,react_jsx_runtime.jsx)(MessageComponent,{message:`Something went wrong! Please check logs for more details.`}):(0,react_jsx_runtime.jsx)(CometChatCallsComponentCore,{callSettings:this.props.presenterSettings,callToken:this.props.callToken,presenterMode:!0})}},CometChatCalls$1=class{static appSettings;static inProgress=!1;static CALL_MODE=CallConstants.CALL_MODE;static AUDIO_MODE=CallConstants.AUDIO_MODE;static addCallEventListener=ListenerHandlers.addCallEventListener;static removeCallEventListener=ListenerHandlers.removeCallEventListener;static OngoingCallListener=OngoingCallListener;static CallSettingsBuilder=CallSettingsBuilder;static CallSettings=CallSettings;static PresenterSettingsBuilder=PresenterSettingsBuilder;static PresenterSettings=PresenterSettings;static CallAppSettingsBuilder=CallAppSettingsBuilder;static CallAppSettings=CallAppSettings;static Component=CometChatCallsComponentCore;static PresenterComponent=CometChatPresenterComponent;static CallLogRequestBuilder=CallLogRequestBuilder;static CallLog=CallLog;static CallUser=CallUser;static CallGroup=CallGroup;static Participant=Participant;static Recording=Recording;static async generateToken(e,D){if(await validateCallAppSettings(this.appSettings),!D||!e)throw new CometChatCallsException({code:GENERAL_ERROR.INVALID_ARGUMENT_EXCEPTION.code,message:`Authtoken and session is required.`});let O=await APIHandler.generateToken(D,e,this.appSettings);if(!O?.data?.data)throw O?.data?.error?.message?new CometChatCallsException({code:GENERAL_ERROR.API_ERROR.code,message:O?.data?.error?.message}):new CometChatCallsException({code:GENERAL_ERROR.UNKNOWN_API_ERROR.code,message:GENERAL_ERROR.UNKNOWN_API_ERROR.message});return O.data.data}static async init(e){await validateCallAppSettings(e),this.appSettings=e,APIHandler.setAppSettings(e)}static endSession(){try{CometChatCallsComponentCore?.ref?.endCall()}catch(e){Logger.log(`CometChatCalls :: endCall`,e),throwGenericException(e)}}static muteAudio(e){try{e?CometChatCallsComponentCore?.ref?.muteAudio():CometChatCallsComponentCore?.ref?.unmuteAudio()}catch(e){Logger.log(`CometChatCalls :: muteAudio`,e),throwGenericException(e)}}static pauseVideo(e){try{e?CometChatCallsComponentCore?.ref?.pauseVideo():CometChatCallsComponentCore?.ref?.unPauseVideo()}catch(e){Logger.log(`CometChatCalls :: pauseVideo`,e),throwGenericException(e)}}static resumeVideo(){try{CometChatCallsComponentCore?.ref?.unPauseVideo()}catch(e){Logger.log(`CometChatCalls :: resumeVideo`,e),throwGenericException(e)}}static setAudioMode(e){try{e&&CometChatCallsComponentCore?.ref?.setAudioMode(e)}catch(e){Logger.log(`CometChatCalls :: setAudioMode`,e),throwGenericException(e)}}static switchCamera(){try{CometChatCallsComponentCore?.ref?.switchCamera?.()}catch(e){Logger.log(`CometChatCalls :: switchCamera`,e),throwGenericException(e)}}static getAudioOutputModes(){try{return new Promise((e,D)=>{CometChatCallsComponentCore?.ref?.getAudioModes().then(D=>{e(D)},e=>{D(e)})})}catch(e){Logger.log(`CometChatCalls :: getAudioOutputModes`,e),throwGenericException(e)}}static switchToVideoCall(){try{CometChatCallsComponentCore?.ref?.switchToVideoCall()}catch(e){Logger.log(`CometChatCalls :: switchToVideoCall`,e),throwGenericException(e)}}static startRecording(){try{CometChatCallsComponentCore?.ref?.startRecording()}catch(e){Logger.log(`CometChatCalls :: startRecording`,e),throwGenericException(e)}}static stopRecording(){try{CometChatCallsComponentCore?.ref?.stopRecording()}catch(e){Logger.log(`CometChatCalls :: stopRecording`,e),throwGenericException(e)}}static getAppSettings(){return this.appSettings}static getCallDetails(e,D){return new Promise(async(O,k)=>{try{if(this.inProgress){k(new CometChatCallsException(MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),this.inProgress=!1;return}if(this.inProgress=!0,!D){this.inProgress=!1,k(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Auth Token` is required to use the 'fetchNext()' method."}));return}if(!e){this.inProgress=!1,k(new CometChatCallsException({code:MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS.code,message:"`Session ID` is required to use the 'fetchNext()' method."}));return}try{let A=await APIHandler.getCallDetails(e,D);if(A?.data?.error){this.inProgress=!1,k(new CometChatCallsException(A.data.error));return}O((A?.data?.data||[]).map(e=>CallLog.callLogFromJson(e))),this.inProgress=!1}catch(e){this.inProgress=!1,k(new CometChatCallsException(e))}}catch{this.inProgress=!1,k(new CometChatCallsException({code:`UNKNOWN ERROR`,message:`Unknown error`}))}})}},RTCUser=class{uid;avatar=``;name;jwt;resource;constructor(e){isFalsy(e)||(this.uid=e.toString())}setUID(e){this.uid=e?e.toString():``}getUID(){return this.uid.toString()}setName(e){this.name=e?e.toString():``}getName(){return this.name.toString()}setAvatar(e){this.avatar=e?e.toString():``}getAvatar(){return this.avatar.toString()}setJWT(e){this.jwt=e?e.toString():``}getJWT(){return this.jwt.toString()}setResource(e){this.resource=e?e.toString():``}getResource(){return this.resource.toString()}};const addCallEventListener=ListenerHandlers.addCallEventListener,removeCallEventListener=ListenerHandlers.removeCallEventListener,CallConstants$1={CALL_MODE:{DEFAULT:`DEFAULT`,SPOTLIGHT:`SPOTLIGHT`,SINGLE:`SINGLE`,TILE:`TILE`,GRID:`GRID`},CALL_TYPE:{AUDIO:`audio`,VIDEO:`video`},RECEIVER_TYPE_GROUP:`group`,RECEIVER_TYPE_USER:`user`,CALL_KEYS:{CALL_DATA:`data`,CALL_ID:`id`,CALL_SESSION_ID:`sessionid`,CALL_RECEIVER:`receiver`,CALL_SENDER:`sender`,CALL_RECEIVER_TYPE:`receiverType`,CALL_STATUS:`status`,CALL_TYPE:`type`,CALL_INITIATED_AT:`initiatedAt`,CALL_JOINED_AT:`joinedAt`,CALL_LEFT_AT:`leftAt`,CALL_METADATA:`metadata`,CALL_ENTITIES:`entities`,CALL_ENTITY_TYPE:`entityType`,CALL_ENTITY:`entity`,CALL_ENTITY_USER:`user`,CALL_ENTITY_GROUP:`group`},CALL_STATUS:{INITIATED:`initiated`,ONGOING:`ongoing`,UNANSWERED:`unanswered`,REJECTED:`rejected`,BUSY:`busy`,CANCELLED:`cancelled`,ENDED:`ended`},AUDIO_INPUT_DEVICES:`audioInputDevices`,AUDIO_OUTPUT_DEVICES:`audioOutputDevices`,VIDEO_INPUT_DEVICES:`videoInputDevices`,POST_MESSAGES:{TYPES:{ACTION_MESSAGE:`cometchat_action_message`,HANGUP:`hangup`,COMETCHAT_RTC_SETTINGS:`cometchat_rtc_settings`},ACTIONS:{USER_JOINED:`onUserJoined`,USER_LEFT:`onUserLeft`,USER_LIST_CHANGED:`onUserListChanged`,INITIAL_DEVICE_LIST:`initialDeviceList`,DEVICE_CHANGE:`onDeviceChange`,LOAD:`LOAD`,CHANGE_AUDIO_INPUT:`changeAudioInput`,CHANGE_AUDIO_OUTPUT:`changeAudioOutput`,CHANGE_VIDEO_INPUT:`changeVideoInput`,MUTE_AUDIO:`muteAudio`,UNMUTE_AUDIO:`unmuteAudio`,PAUSE_VIDEO:`pauseVideo`,UNPAUSE_VIDEO:`unPauseVideo`,SWITCH_MODE:`switchMode`,START_SCREENSHARE:`startScreenShare`,STOP_SCREENSHARE:`stopScreenShare`,END_CALL:`endCall`,START_RECORDING:`startRecording`,STOP_RECORDING:`stopRecording`,RECORDING_TOGGLED:`onRecordingToggled`,USER_MUTED:`onUserMuted`,SCREEN_SHARE_STARTED:`SCREEN_SHARE_STARTED`,SCREEN_SHARE_STOPPED:`SCREEN_SHARE_ENDED`}},MEDIA_DEVICE:{ID:`id`,NAME:`name`,ACTIVE:`active`}},CALL_ERROR={CALL_ALREADY_INITIATED:{code:`CALL_ALREADY_INITIATED`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},ERROR_IN_CALLING:{code:`CALL_IN_PROGRESS`,name:`CALL_ALREADY_INITIATED`,message:`There is already call in progress`,details:{}},CANNOT_ACCEPT_CALL:{code:`CALL_IN_PROGRESS`,name:`CALL_IN_PROGRESS`,message:`There is already a call in progress`,details:{}},NOT_INITIALIZED:{code:`NOT_INITIALIZED`,name:`NOT_INITIALIZED`,message:`Please call the CometChat.init() method before calling any other methods related to CometChat.`,details:{}},NOT_LOGGED_IN:{code:`NOT_LOGGED_IN`,name:`NOT_LOGGED_IN`,message:`Please login before starting a call.`,details:{}},SESSION_ID_REQUIRED:{code:`SESSION_ID_REQUIRED`,name:`SESSION_ID_REQUIRED`,message:`Please make sure you are passing correct session id.`,details:{}},CALL_SETTINGS_REQUIRED:{code:`CALL_SETTINGS_REQUIRED`,name:`CALL_SETTINGS_REQUIRED`,message:`Please make sure you are passing the call settings object.`,details:{}},JWT_NOT_FOUND:{code:`JWT_NOT_FOUND`,name:`JWT_NOT_FOUND`,message:`There was some issue while fetching JWT from API.`,details:{}}},API_ERROR_CODES={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:`AUTH_ERR_AUTH_TOKEN_NOT_FOUND`};function getFacadeContext(){let e=CometChatCalls;return{callsBaseURL:e.getBaseURL(`call`),appId:e.appSettings?.appId,isInitialized:e.isInitialized}}function isInitialized(){return getFacadeContext().isInitialized===!0}function getAuthToken(){return CometChatCalls.getUserAuthToken()}function normalizeTranscript(e){return!e||typeof e!=`object`?{}:{...e}}function fetchTranscriptsPage(e,D,O){let{callsBaseURL:k,appId:A}=getFacadeContext(),j=getAuthToken();return executeHTTPRequestWithMeta({baseURL:k,method:`GET`,endpoint:`calls/${encodeURIComponent(e)}/transcriptions?perPage=${O}&page=${D}`,headers:{appId:A??``,authToken:j??``,"Content-Type":`application/json`,Accept:`application/json`}})}const DEFAULT_LIMIT=30,MIN_LIMIT=1,MAX_LIMIT=1e3;function transportErrorToException(e){if(e.name===`COMET_CHAT_API_ERROR`){let D=e.details;return new CometChatCallsException({code:D?.code??`COMET_CHAT_API_ERROR`,message:D?.message??e.message,details:e.details})}return new CometChatCallsException({code:e.name,message:e.message,details:e.details})}var TranscriptRequest=class{sessionId;limit;totalPages=null;currentPage=0;inProgress=!1;constructor(e){this.sessionId=e.sessionId,this.limit=e.limit}fetchNext(){return this.makeAPICall(!0)}fetchPrevious(){return this.makeAPICall(!1)}async makeAPICall(e){if(e){if(this.totalPages!==null&&this.currentPage>=this.totalPages)return[]}else if(this.currentPage<=1)return[];if(this.inProgress)throw new CometChatCallsException(MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR);if(!getAuthToken())throw new CometChatCallsException(CALL_ERROR.NOT_LOGGED_IN);let D=e?this.currentPage+1:this.currentPage-1;this.inProgress=!0;try{let{data:e,meta:O,error:k}=await fetchTranscriptsPage(this.sessionId,D,this.limit);if(k)throw transportErrorToException(k);if(!Array.isArray(e))throw new CometChatCallsException({code:`BAD_RESPONSE`,message:"Malformed response: `data` is missing or not an array."});return this.updatePagination(O,D),e.map(normalizeTranscript)}finally{this.inProgress=!1}}updatePagination(e,D){let O=e&&typeof e==`object`?e.pagination:void 0;O&&typeof O==`object`?(typeof O.total_pages==`number`&&(this.totalPages=O.total_pages),this.currentPage=typeof O.current_page==`number`?O.current_page:D):(this.currentPage=D,this.totalPages===null&&(this.totalPages=D))}},TranscriptRequestBuilder=class{sessionId=``;limit=30;setSessionId(e){return this.sessionId=e,this}setLimit(e){return typeof e==`number`&&Number.isFinite(e)&&(this.limit=Math.min(1e3,Math.max(1,Math.floor(e)))),this}build(){if(!isInitialized())throw new CometChatCallsException(CALL_ERROR.NOT_INITIALIZED);if(!this.sessionId||this.sessionId.trim()===``)throw new CometChatCallsException(CALL_ERROR.SESSION_ID_REQUIRED);return new TranscriptRequest(this)}},CometChatCalls=class extends SessionMethodsCore{static appSettings=null;static isInitialized=!1;static loginInProgress=!1;static loggedInUser=null;static loginListeners=new Map;static CALL_MODE=CallConstants.CALL_MODE;static AUDIO_MODE=CallConstants.AUDIO_MODE;static OngoingCallListener=OngoingCallListener;static CallSettingsBuilder=CallSettingsBuilder;static CallAppSettingsBuilder=CallAppSettingsBuilder;static Component=AppReactNativeSDK;static CallLogRequestBuilder=CallLogRequestBuilder;static CallLog=CallLog;static Transcription=Transcription;static TranscriptRequestBuilder=TranscriptRequestBuilder;static async init(e){let D=valibot.safeParse(CallAppSettingsSchema,e);return D.success?(await this.finalizeInit(D.output,INTEGRATION_SOURCE_MANUAL),{success:!0,error:null}):{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: ${D.issues.map(e=>e.message).join(`, `)}`,timestamp:Date.now()}}}static async finalizeInit(e,D){this.appSettings=e,this.isInitialized=!0,await setIntegrationSource(this.appSettings.appId,D),APIHandler.setAppSettings(new CallAppSettingsBuilder().setAppId(this.appSettings.appId).setRegion(this.appSettings.region).setHost(`${this.getBaseURL(`call`)}/`).build());let O=await this.getSavedUser();if(O){let e;if(typeof O==`string`)try{e=JSON.parse(O)}catch{e=O}else e=O;this.loggedInUser=e,this.reportSdkIdentification()}}static async initFromSettings(e){if(!e||!e.appId)return{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: appId is required`,timestamp:Date.now()}};let D=callAppSettingsFromSettings(e),O=valibot.safeParse(CallAppSettingsSchema,D);return O.success?(await this.finalizeInit(O.output,`ai-agent`),{success:!0,error:null}):{success:!1,error:{name:`VALIDATION_ERROR`,message:`Invalid app settings: ${O.issues.map(e=>e.message).join(`, `)}`,timestamp:Date.now()}}}static async login(e,D){try{if(this.loginInProgress)throw{errorCode:`ERROR_LOGIN_IN_PROGRESS`,errorDescription:`Login is already in progress`};if(!e||e.trim()===``)throw{errorCode:`ERROR_INVALID_UID`,errorDescription:`UID cannot be empty`};if(e.includes(` `))throw{errorCode:`ERROR_UID_WITH_SPACE`,errorDescription:`UID cannot contain spaces`};let O=D||this.appSettings?.authKey;if(!O||O.trim()===``)throw{errorCode:`ERROR_API_KEY_NOT_FOUND`,errorDescription:`Auth Key cannot be empty`};if(!this.isInitialized)throw{errorCode:`ERROR_SDK_NOT_INITIALIZED`,errorDescription:`SDK not initialized. Call init() first`};if(this.loginInProgress=!0,this.loggedInUser&&this.loggedInUser.uid===e&&this.loggedInUser.authToken)return this.loginInProgress=!1,this.notifyLoginSuccess(this.loggedInUser),this.reportSdkIdentification(),this.loggedInUser;this.loggedInUser&&this.loggedInUser.uid!==e&&await this.logoutInternal();let k=await this.loginWithUID(e,O),A=await this.authenticateWithToken(k);return this.loginInProgress=!1,this.loggedInUser=A,await this.saveUser(A),this.notifyLoginSuccess(A),this.reportSdkIdentification(),A}catch(e){this.loginInProgress=!1;let D=this.createError(e);throw this.notifyLoginFailure(D),D}}static async loginWithAuthToken(e){try{if(this.loginInProgress)throw{errorCode:`ERROR_LOGIN_IN_PROGRESS`,errorDescription:`Login is already in progress`};if(!e||e.trim()===``)throw{errorCode:`ERROR_BLANK_AUTHTOKEN`,errorDescription:`Auth token cannot be empty`};if(e.includes(` `))throw{errorCode:`ERROR_AUTHTOKEN_WITH_SPACE`,errorDescription:`Auth token cannot contain spaces`};if(this.loginInProgress=!0,this.loggedInUser&&this.loggedInUser.authToken===e)return this.loginInProgress=!1,this.notifyLoginSuccess(this.loggedInUser),this.reportSdkIdentification(),this.loggedInUser;this.loggedInUser&&this.loggedInUser.authToken!==e&&await this.logoutInternal();let D=await this.authenticateWithToken(e);return this.loginInProgress=!1,this.loggedInUser=D,await this.saveUser(D),this.notifyLoginSuccess(D),this.reportSdkIdentification(),D}catch(e){this.loginInProgress=!1;let D=this.createError(e);throw this.notifyLoginFailure(D),D}}static async logout(){try{if(!this.loggedInUser)throw{errorCode:`ERROR_NO_USER_LOGGED_IN`,errorDescription:`No user is currently logged in`};return await this.logoutInternal(),this.notifyLogoutSuccess(),`Logout successful`}catch(e){let D=this.createError(e);throw this.notifyLogoutFailure(D),D}}static getLoggedInUser(){return this.loggedInUser&&typeof this.loggedInUser==`string`&&(this.loggedInUser=JSON.parse(this.loggedInUser)),this.loggedInUser}static getUserAuthToken(){return this.loggedInUser?.authToken||null}static isUserLoggedIn(){return this.loggedInUser!==null&&this.loggedInUser.authToken!==void 0}static addLoginListener(e,D){this.loginListeners.set(e,D)}static removeLoginListener(e){this.loginListeners.delete(e)}static async generateToken(e,D){try{if(!e||e.trim()===``)throw{errorCode:`ERROR_SESSION_ID_MISSING`,errorDescription:`Session ID cannot be empty`};let O=D||this.getUserAuthToken();if(!O)throw{errorCode:`ERROR_AUTH_TOKEN_MISSING`,errorDescription:`Auth token is required. Please login first or provide authToken.`};if(!this.isInitialized)throw{errorCode:`ERROR_SDK_NOT_INITIALIZED`,errorDescription:`SDK not initialized`};return{token:await this.callGenerateTokenAPI(e,O)}}catch(e){throw this.createError(e)}}static getBaseURL(e=`call`){return e===`call`&&this.appSettings?.host?this.appSettings.host:e===`api`&&this.appSettings?.adminHost?this.appSettings.adminHost:e===`apiclient`&&this.appSettings?.clientHost?this.appSettings.clientHost:`https://${this.appSettings?.appId||``}.${e}-${this.appSettings?.region||``}.cometchat.io/v3.0`}static reportSdkIdentification(){try{let e=this.appSettings?.appId,D=this.loggedInUser?.authToken;if(!e||!D||this.appSettings?.disableSdkIdentification)return;maybeSendIdentification({appId:e,apiclientBaseURL:this.getBaseURL(`apiclient`),authToken:D,callsSdkVersion:`5.0.6`,disableSdkIdentification:this.appSettings?.disableSdkIdentification})}catch{}}static async loginWithUID(e,D){let O=this.appSettings?.appId||``,k=await executeHTTPRequest({baseURL:this.getBaseURL(`api`),method:`POST`,endpoint:`users/${e}/auth_tokens`,headers:{"Content-Type":`application/json`,apiKey:D,appId:O},body:{platform:`react-native`,deviceId:this.generateDeviceId()}});if(k.error)throw Error(`Login failed: ${k.error.message}`);return k.data.authToken}static async authenticateWithToken(e){let D=this.appSettings?.appId||``,O=await executeHTTPRequest({baseURL:this.getBaseURL(`apiclient`),method:`PUT`,endpoint:`me`,headers:{"Content-Type":`application/json`,authToken:e,appId:D},body:{platform:`react-native`,deviceId:this.generateDeviceId()}});if(O.error)throw Error(`Authentication failed: ${O.error.message}`);let k=O.data;return{uid:k.uid,name:k.name,authToken:e,status:k.status||`online`,avatar:k.avatar||``,lastActiveAt:k.lastActiveAt||Date.now(),role:k.role||`default`,hasBlockedMe:!1,blockedByMe:!1,deactivatedAt:0,wsChannel:{identity:`[${D}]${k.uid}`},jwt:k.jwt}}static async logoutInternal(){if(this.loggedInUser?.authToken)try{await executeHTTPRequest({baseURL:this.getBaseURL(`apiclient`),method:`DELETE`,endpoint:`me`,headers:{authToken:this.loggedInUser.authToken,appId:this.appSettings?.appId||``}})}catch{}this.loggedInUser=null,await this.clearSavedUser()}static async callGenerateTokenAPI(e,D){let O=this.appSettings?.appId||``,k=await executeHTTPRequest({baseURL:this.getBaseURL(),method:`POST`,endpoint:`call_tokens`,headers:{"Content-Type":`application/json`,authToken:D,appId:O},body:{sessionId:e}});if(k.error)throw Error(`Token generation failed: ${k.error.message}`);return k.data.token}static getStorageKey(){return`${this.appSettings?.appId}:common_store/user`}static async saveUser(e){try{let D={hasBlockedMe:!1,blockedByMe:!1,deactivatedAt:0,...e,role:e.role||`default`,wsChannel:e.wsChannel||{identity:`[${this.appSettings?.appId}]${e.uid}`}};await __react_native_async_storage_async_storage.default.setItem(this.getStorageKey(),JSON.stringify(D))}catch{}}static async getSavedUser(){try{return await __react_native_async_storage_async_storage.default.getItem(this.getStorageKey())}catch{return null}}static async clearSavedUser(){try{await __react_native_async_storage_async_storage.default.removeItem(this.getStorageKey())}catch{}}static generateDeviceId(){return`rn_`+Math.random().toString(36).substring(2,11)}static createError(e){return e.errorCode&&e.errorDescription?e:{errorCode:`ERROR_UNKNOWN`,errorDescription:e.message||`An unknown error occurred`}}static notifyLoginSuccess(e){this.loginListeners.forEach(D=>{if(D.onLoginSuccess)try{D.onLoginSuccess(e)}catch{}})}static notifyLoginFailure(e){this.loginListeners.forEach(D=>{if(D.onLoginFailure)try{D.onLoginFailure(e)}catch{}})}static notifyLogoutSuccess(){this.loginListeners.forEach(e=>{if(e.onLogoutSuccess)try{e.onLogoutSuccess()}catch{}})}static notifyLogoutFailure(e){this.loginListeners.forEach(D=>{if(D.onLogoutFailure)try{D.onLogoutFailure(e)}catch{}})}static addEventListener(e,D,O){return eventBus.subscribe(e,D,O)}static setAudioMode(e){return requestAudioModeChange(e)}static enablePictureInPictureLayout(){enablePictureInPictureLayout()}static disablePictureInPictureLayout(){disablePictureInPictureLayout()}};publishCallSdkInfo(`5.0.6`),exports.CometChatCalls=CometChatCalls;