forked from jannismoore/vapi-web-calling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle.js
More file actions
2 lines (2 loc) · 467 KB
/
bundle.js
File metadata and controls
2 lines (2 loc) · 467 KB
1
2
/*! For license information please see bundle.js.LICENSE.txt */
(()=>{"use strict";var e={7:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}f(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,a,l;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function f(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,u=g(c,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},112:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(473)),o=r(n(7)),a=n(145);class s extends o.default{on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}emit(e,...t){return super.emit(e,...t)}removeListener(e,t){return super.removeListener(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}}t.default=class extends s{started=!1;call=null;speakingTimeout=null;constructor(e,t){super(),a.client.baseUrl=t??"https://api.vapi.ai",a.client.setSecurityData(e)}cleanup(){this.started=!1,this.call?.destroy(),this.call=null,this.speakingTimeout=null}async start(e,t,n){if(!e&&!n)throw new Error("Assistant or Squad must be provided.");if(this.started)return null;this.started=!0;try{const r=(await a.client.call.callControllerCreateWebCall({assistant:"string"==typeof e?void 0:e,assistantId:"string"==typeof e?e:void 0,assistantOverrides:t,squad:"string"==typeof n?void 0:n,squadId:"string"==typeof n?n:void 0})).data;this.call&&this.cleanup();const o=r?.artifactPlan?.videoRecordingEnabled??!1;if(this.call=i.default.createCallObject({audioSource:!0,videoSource:o}),this.call.iframe()?.style.setProperty("display","none"),this.call.on("left-meeting",()=>{this.emit("call-end"),o&&this.call?.stopRecording(),this.cleanup()}),this.call.on("participant-left",e=>{e&&function(e){const t=document.querySelector(`audio[data-participant-id="${e}"]`);t?.remove()}(e.participant.session_id)}),this.call.on("error",e=>{this.emit("error",e),o&&this.call?.stopRecording()}),this.call.on("camera-error",e=>{this.emit("error",e)}),this.call.on("track-started",async e=>{e&&e.participant&&(e.participant?.local||"audio"===e.track.kind&&(await async function(e,t){const n=document.createElement("audio");return n.dataset.participantId=t,document.body.appendChild(n),await async function(e,t){e.muted=!1,e.autoplay=!0,null!=t&&(e.srcObject=new MediaStream([t]),await e.play())}(n,e),n}(e.track,e.participant.session_id),"Vapi Speaker"===e?.participant?.user_name&&this.call?.sendAppMessage("playable")))}),this.call.on("participant-joined",e=>{e&&this.call&&function(e,t,n){e.participant.local||t.updateParticipant(e.participant.session_id,{setSubscribedTracks:{audio:!0,video:n}})}(e,this.call,o)}),await this.call.join({url:r.webCallUrl,subscribeToTracksAutomatically:!1}),o){const e=(new Date).getTime();this.call.startRecording({width:1280,height:720,backgroundColor:"#FF1F2D3D",layout:{preset:"default"}}),this.call.on("recording-started",()=>{this.send({type:"control",control:"say-first-message",videoRecordingStartDelaySeconds:((new Date).getTime()-e)/1e3})})}return this.call.startRemoteParticipantsAudioLevelObserver(100),this.call.on("remote-participants-audio-level",e=>{e&&this.handleRemoteParticipantsAudioLevel(e)}),this.call.on("app-message",e=>this.onAppMessage(e)),this.call.on("nonfatal-error",e=>{"audio-processor-error"===e?.type&&this.call?.updateInputSettings({audio:{processor:{type:"none"}}}).then(()=>{this.call?.setLocalAudio(!0)})}),this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}}),r}catch(e){return console.error(e),this.emit("error",e),this.cleanup(),null}}onAppMessage(e){if(e)try{if("listening"===e.data)return this.emit("call-start");try{const t=JSON.parse(e.data);this.emit("message",t)}catch(e){console.log("Error parsing message data: ",e)}}catch(e){console.error(e)}}handleRemoteParticipantsAudioLevel(e){const t=Object.values(e.participantsAudioLevel).reduce((e,t)=>e+t,0);this.emit("volume-level",Math.min(1,t/.15)),t>.01&&(this.speakingTimeout?(clearTimeout(this.speakingTimeout),this.speakingTimeout=null):this.emit("speech-start"),this.speakingTimeout=setTimeout(()=>{this.emit("speech-end"),this.speakingTimeout=null},1e3))}stop(){this.started=!1,this.call?.destroy(),this.call=null}send(e){this.call?.sendAppMessage(JSON.stringify(e))}setMuted(e){try{if(!this.call)throw new Error("Call object is not available.");this.call.setLocalAudio(!e)}catch(e){throw e}}isMuted(){try{return!!this.call&&!1===this.call.localAudio()}catch(e){throw e}}say(e,t){this.send({type:"say",message:e,endCallAfterSpoken:t})}setInputDevicesAsync(e){this.call?.setInputDevicesAsync(e)}setOutputDeviceAsync(e){this.call?.setOutputDeviceAsync(e)}}},145:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.client=void 0;const r=new(n(980).Api)({baseUrl:"https://api.vapi.ai",baseApiParams:{secure:!0},securityWorker:async e=>{if(e)return{headers:{Authorization:`Bearer ${e}`}}}});t.client=r},473:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var t=function(e){if("object"!==o(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function h(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function g(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){f(o,r,i,a,s,"next",e)}function s(e){f(o,r,i,a,s,"throw",e)}a(void 0)})}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.r(t),n.d(t,{DAILY_ACCESS_LEVEL_FULL:()=>wr,DAILY_ACCESS_LEVEL_LOBBY:()=>_r,DAILY_ACCESS_LEVEL_NONE:()=>Sr,DAILY_ACCESS_UNKNOWN:()=>br,DAILY_CAMERA_ERROR_CAM_AND_MIC_IN_USE:()=>Rr,DAILY_CAMERA_ERROR_CAM_IN_USE:()=>Dr,DAILY_CAMERA_ERROR_CONSTRAINTS:()=>Wr,DAILY_CAMERA_ERROR_MIC_IN_USE:()=>jr,DAILY_CAMERA_ERROR_NOT_FOUND:()=>Ur,DAILY_CAMERA_ERROR_PERMISSIONS:()=>Br,DAILY_CAMERA_ERROR_UNDEF_MEDIADEVICES:()=>Fr,DAILY_CAMERA_ERROR_UNKNOWN:()=>Gr,DAILY_EVENT_ACCESS_STATE_UPDATED:()=>oi,DAILY_EVENT_ACTIVE_SPEAKER_CHANGE:()=>Mi,DAILY_EVENT_ACTIVE_SPEAKER_MODE_CHANGE:()=>Pi,DAILY_EVENT_APP_MSG:()=>ki,DAILY_EVENT_CAMERA_ERROR:()=>Jr,DAILY_EVENT_CPU_LOAD_CHANGE:()=>Di,DAILY_EVENT_ERROR:()=>zi,DAILY_EVENT_EXIT_FULLSCREEN:()=>Bi,DAILY_EVENT_FACE_COUNTS_UPDATED:()=>ji,DAILY_EVENT_FULLSCREEN:()=>Ri,DAILY_EVENT_IFRAME_LAUNCH_CONFIG:()=>Hr,DAILY_EVENT_IFRAME_READY_FOR_LAUNCH_CONFIG:()=>Yr,DAILY_EVENT_INPUT_SETTINGS_UPDATED:()=>qi,DAILY_EVENT_JOINED_MEETING:()=>Xr,DAILY_EVENT_JOINING_MEETING:()=>Qr,DAILY_EVENT_LANG_UPDATED:()=>Yi,DAILY_EVENT_LEFT_MEETING:()=>Zr,DAILY_EVENT_LIVE_STREAMING_ERROR:()=>Gi,DAILY_EVENT_LIVE_STREAMING_STARTED:()=>Fi,DAILY_EVENT_LIVE_STREAMING_STOPPED:()=>Wi,DAILY_EVENT_LIVE_STREAMING_UPDATED:()=>Ui,DAILY_EVENT_LOADED:()=>$r,DAILY_EVENT_LOADING:()=>Vr,DAILY_EVENT_LOAD_ATTEMPT_FAILED:()=>zr,DAILY_EVENT_LOCAL_SCREEN_SHARE_CANCELED:()=>xi,DAILY_EVENT_LOCAL_SCREEN_SHARE_STARTED:()=>Ai,DAILY_EVENT_LOCAL_SCREEN_SHARE_STOPPED:()=>Oi,DAILY_EVENT_MEETING_SESSION_DATA_ERROR:()=>ci,DAILY_EVENT_MEETING_SESSION_STATE_UPDATED:()=>si,DAILY_EVENT_MEETING_SESSION_SUMMARY_UPDATED:()=>ai,DAILY_EVENT_NETWORK_CONNECTION:()=>Li,DAILY_EVENT_NETWORK_QUALITY_CHANGE:()=>Ni,DAILY_EVENT_NONFATAL_ERROR:()=>Vi,DAILY_EVENT_PARTICIPANT_COUNTS_UPDATED:()=>ii,DAILY_EVENT_PARTICIPANT_JOINED:()=>ti,DAILY_EVENT_PARTICIPANT_LEFT:()=>ri,DAILY_EVENT_PARTICIPANT_UPDATED:()=>ni,DAILY_EVENT_RECEIVE_SETTINGS_UPDATED:()=>Hi,DAILY_EVENT_RECORDING_DATA:()=>Si,DAILY_EVENT_RECORDING_ERROR:()=>wi,DAILY_EVENT_RECORDING_STARTED:()=>yi,DAILY_EVENT_RECORDING_STATS:()=>bi,DAILY_EVENT_RECORDING_STOPPED:()=>vi,DAILY_EVENT_RECORDING_UPLOAD_COMPLETED:()=>_i,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STARTED:()=>Ti,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STOPPED:()=>Ii,DAILY_EVENT_REMOTE_MEDIA_PLAYER_UPDATED:()=>Ci,DAILY_EVENT_STARTED_CAMERA:()=>Kr,DAILY_EVENT_THEME_UPDATED:()=>qr,DAILY_EVENT_TRACK_STARTED:()=>hi,DAILY_EVENT_TRACK_STOPPED:()=>pi,DAILY_EVENT_TRANSCRIPTION_ERROR:()=>mi,DAILY_EVENT_TRANSCRIPTION_MSG:()=>Ei,DAILY_EVENT_TRANSCRIPTION_STARTED:()=>gi,DAILY_EVENT_TRANSCRIPTION_STOPPED:()=>fi,DAILY_EVENT_WAITING_PARTICIPANT_ADDED:()=>li,DAILY_EVENT_WAITING_PARTICIPANT_REMOVED:()=>di,DAILY_EVENT_WAITING_PARTICIPANT_UPDATED:()=>ui,DAILY_FATAL_ERROR_CONNECTION:()=>Lr,DAILY_FATAL_ERROR_EJECTED:()=>Tr,DAILY_FATAL_ERROR_EOL:()=>Pr,DAILY_FATAL_ERROR_EXP_ROOM:()=>Ar,DAILY_FATAL_ERROR_EXP_TOKEN:()=>Or,DAILY_FATAL_ERROR_MEETING_FULL:()=>Mr,DAILY_FATAL_ERROR_NBF_ROOM:()=>Cr,DAILY_FATAL_ERROR_NBF_TOKEN:()=>Ir,DAILY_FATAL_ERROR_NOT_ALLOWED:()=>Nr,DAILY_FATAL_ERROR_NO_ROOM:()=>xr,DAILY_RECEIVE_SETTINGS_ALL_PARTICIPANTS_KEY:()=>Er,DAILY_RECEIVE_SETTINGS_BASE_KEY:()=>kr,DAILY_STATE_ERROR:()=>hr,DAILY_STATE_JOINED:()=>ur,DAILY_STATE_JOINING:()=>lr,DAILY_STATE_LEFT:()=>dr,DAILY_STATE_NEW:()=>ar,DAILY_TRACK_STATE_BLOCKED:()=>pr,DAILY_TRACK_STATE_INTERRUPTED:()=>yr,DAILY_TRACK_STATE_LOADING:()=>mr,DAILY_TRACK_STATE_OFF:()=>gr,DAILY_TRACK_STATE_PLAYABLE:()=>vr,DAILY_TRACK_STATE_SENDABLE:()=>fr,default:()=>Ta}),e=n.hmd(e);var b,w={},_={get exports(){return w},set exports(e){w=e}},S="object"==typeof Reflect?Reflect:null,k=S&&"function"==typeof S.apply?S.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};b=S&&"function"==typeof S.ownKeys?S.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var E=Number.isNaN||function(e){return e!=e};function T(){T.init.call(this)}_.exports=T,w.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}D(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&D(e,"error",t,{once:!0})}(e,i)})},T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var C=10;function I(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function A(e){return void 0===e._maxListeners?T.defaultMaxListeners:e._maxListeners}function O(e,t,n,r){var i,o,a,s;if(I(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=A(e))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function M(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=x.bind(r);return i.listener=n,r.wrapFn=i,i}function P(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):L(i,i.length)}function N(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function L(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function D(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(e){if("number"!=typeof e||e<0||E(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");C=e}}),T.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},T.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||E(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},T.prototype.getMaxListeners=function(){return A(this)},T.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)k(s,this,t);else{var c=s.length,l=L(s,c);for(n=0;n<c;++n)k(l[n],this,t)}return!0},T.prototype.addListener=function(e,t){return O(this,e,t,!1)},T.prototype.on=T.prototype.addListener,T.prototype.prependListener=function(e,t){return O(this,e,t,!0)},T.prototype.once=function(e,t){return I(t),this.on(e,M(this,e,t)),this},T.prototype.prependOnceListener=function(e,t){return I(t),this.prependListener(e,M(this,e,t)),this},T.prototype.removeListener=function(e,t){var n,r,i,o,a;if(I(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},T.prototype.off=T.prototype.removeListener,T.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},T.prototype.listeners=function(e){return P(this,e,!0)},T.prototype.rawListeners=function(e){return P(this,e,!1)},T.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):N.call(e,t)},T.prototype.listenerCount=N,T.prototype.eventNames=function(){return this._eventsCount>0?b(this._events):[]};var j=Object.prototype.hasOwnProperty;function R(e,t,n){for(n of e.keys())if(B(n,t))return n}function B(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&B(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=R(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=R(t,i)))return!1;if(!B(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(j.call(e,n)&&++r&&!j.call(t,n))return!1;if(!(n in t)||!B(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}const F={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},U={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},W={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},G={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Y={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class H{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=H.getVersionPrecision(e),i=H.getVersionPrecision(t);let o=Math.max(r,i),a=0;const s=H.map([e,t],e=>{const t=o-H.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return H.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(a=o-Math.min(r,i)),o-=1;o>=a;){if(s[0][o]>s[1][o])return 1;if(s[0][o]===s[1][o]){if(o===a)return 0;o-=1}else if(s[0][o]<s[1][o])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];"object"==typeof e&&null!==e&&Object.keys(e).forEach(t=>{n[t]=e[t]})}return e}static getBrowserAlias(e){return F[e]}static getBrowserTypeByAlias(e){return U[e]||""}}const q=/version\/(\d+(\.?_?\d+)+)/i,V=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=H.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=H.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=H.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=H.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=H.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=H.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=H.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=H.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=H.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=H.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=H.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=H.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=H.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=H.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=H.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=H.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=H.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=H.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=H.getFirstMatch(q,e)||H.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=H.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=H.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=H.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=H.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=H.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=H.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=H.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=H.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=H.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=H.getFirstMatch(q,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:H.getFirstMatch(t,e),version:H.getSecondMatch(t,e)}}}];var z=[{test:[/Roku\/DVP/],describe(e){const t=H.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:G.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=H.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:G.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=H.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=H.getWindowsVersionName(t);return{name:G.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:G.iOS},n=H.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=H.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=H.getMacOSVersionName(t),r={name:G.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=H.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:G.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=H.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=H.getAndroidVersionName(t),r={name:G.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=H.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:G.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=H.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||H.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||H.getFirstMatch(/\bbb(\d+)/i,e);return{name:G.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=H.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:G.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=H.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:G.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:G.Linux})},{test:[/CrOS/],describe:()=>({name:G.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=H.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:G.PlayStation4,version:t}}}],$=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=H.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:W.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:W.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:W.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:W.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:W.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:W.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:W.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=H.getFirstMatch(/(ipod|iphone)/i,e);return{type:W.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:W.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:W.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:W.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:W.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:W.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:W.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:W.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:W.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:W.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:W.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:W.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:W.tv})}],K=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Y.Blink};const t=H.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Y.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Y.Trident},n=H.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Y.Presto},n=H.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Y.Gecko},n=H.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Y.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Y.WebKit},n=H.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class J{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=H.find(V,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=H.find(z,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=H.find($,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=H.find(K,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return H.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(o=>{const a=e[o];"string"==typeof a?(r[o]=a,i+=1):"object"==typeof a&&(t[o]=a,n+=1)}),n>0){const e=Object.keys(t),n=H.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=H.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=H.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=H.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(H.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}class Q{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new J(e,t)}static parse(e){return new J(e).getResult()}static get BROWSER_MAP(){return U}static get ENGINE_MAP(){return Y}static get OS_MAP(){return G}static get PLATFORMS_MAP(){return W}}function X(){return Date.now()+Math.random().toString()}function Z(){throw new Error("Method must be implemented in subclass")}function ee(e,t){return null!=t&&t.proxyUrl?t.proxyUrl+("/"===t.proxyUrl.slice(-1)?"":"/")+e.substring(8):e}function te(e){return null!=e&&e.callObjectBundleUrlOverride?e.callObjectBundleUrlOverride:ee("https://c.daily.co/call-machine/versioned/".concat("0.66.0","/static/call-machine-object-bundle.js"),e)}function ne(e){try{new URL(e)}catch(e){return!1}return!0}const re=Object.prototype.toString;function ie(e){switch(re.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return pe(e,Error)}}function oe(e,t){return re.call(e)===`[object ${t}]`}function ae(e){return oe(e,"ErrorEvent")}function se(e){return oe(e,"DOMError")}function ce(e){return oe(e,"String")}function le(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function ue(e){return oe(e,"Object")}function de(e){return"undefined"!=typeof Event&&pe(e,Event)}function he(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function pe(e,t){try{return e instanceof t}catch(e){return!1}}function ge(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function fe(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function me(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!ce(e)&&(oe(t,"RegExp")?t.test(e):!!ce(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function ye(e,t,n=250,r,i,o,a){if(!(o.exception&&o.exception.values&&a&&pe(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,l;s&&(o.exception.values=(c=ve(e,t,i,a.originalException,r,o.exception.values,s,0),l=n,c.map(e=>(e.value&&(e.value=ge(e.value,l)),e))))}function ve(e,t,n,r,i,o,a,s){if(o.length>=n+1)return o;let c=[...o];if(pe(r[i],Error)){be(a,s);const o=e(t,r[i]),l=c.length;we(o,i,l,s),c=ve(e,t,n,r[i],i,[o,...c],o,l)}return Array.isArray(r.errors)&&r.errors.forEach((r,o)=>{if(pe(r,Error)){be(a,s);const l=e(t,r),u=c.length;we(l,`errors[${o}]`,u,s),c=ve(e,t,n,r,i,[l,...c],l,u)}}),c}function be(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function we(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function _e(e){return e&&e.Math==Math?e:void 0}const Se="object"==typeof globalThis&&_e(globalThis)||"object"==typeof window&&_e(window)||"object"==typeof self&&_e(self)||"object"==typeof n.g&&_e(n.g)||function(){return this}()||{};function ke(){return Se}function Ee(e,t,n){const r=n||Se,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}const Te=ke();function Ce(e,t={}){try{let n=e;const r=5,i=[];let o=0,a=0;const s=" > ",c=s.length;let l;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++<r&&(l=Ie(n,u),!("html"===l||o>1&&a+i.length*c+l.length>=d));)i.push(l),a+=l.length,n=n.parentNode;return i.reverse().join(s)}catch(e){return"<unknown>"}}function Ie(e,t){const n=e,r=[];let i,o,a,s,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const l=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(l&&l.length)l.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&ce(i))for(o=i.split(/\s+/),c=0;c<o.length;c++)r.push(`.${o[c]}`);const u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)a=u[c],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}const Ae=["debug","info","warn","error","log","assert","trace"];function Oe(e){if(!("console"in Se))return e();const t=Se.console,n={};Ae.forEach(e=>{const r=t[e]&&t[e].__sentry_original__;e in t&&r&&(n[e]=t[e],t[e]=r)});try{return e()}finally{Object.keys(n).forEach(e=>{t[e]=n[e]})}}function xe(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Ae.forEach(n=>{t[n]=(...t)=>{e&&Oe(()=>{Se.console[n](`Sentry Logger [${n}]:`,...t)})}}):Ae.forEach(e=>{t[e]=()=>{}}),t}let Me;Me="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Ee("logger",xe):xe();const Pe=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ne(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${a}`}function Le(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class De extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function je(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);if("function"==typeof i)try{Be(i,r)}catch(e){}e[t]=i}function Re(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Be(e,t){const n=t.prototype||{};e.prototype=t.prototype=n,Re(e,"__sentry_original__",t)}function Fe(e){return e.__sentry_original__}function Ue(e){if(ie(e))return{message:e.message,name:e.name,stack:e.stack,...Ge(e)};if(de(e)){const t={type:e.type,target:We(e.target),currentTarget:We(e.currentTarget),...Ge(e)};return"undefined"!=typeof CustomEvent&&pe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function We(e){try{return"undefined"!=typeof Element&&pe(e,Element)?Ce(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function Ge(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ye(e){return He(e,new Map)}function He(e,t){if(ue(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=He(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(He(e,t))}),r}return e}const qe="<anonymous>";function Ve(e){try{return e&&"function"==typeof e&&e.name||qe}catch(e){return qe}}const ze=ke();function $e(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const Ke=ke(),Je=ke(),Qe="__sentry_xhr_v2__",Xe={},Ze={};function et(e,t){Xe[e]=Xe[e]||[],Xe[e].push(t),function(e){if(!Ze[e])switch(Ze[e]=!0,e){case"console":"console"in Je&&Ae.forEach(function(e){e in Je.console&&je(Je.console,e,function(t){return function(...n){tt("console",{args:n,level:e}),t&&t.apply(Je.console,n)}})});break;case"dom":!function(){if(!("document"in Je))return;const e=tt.bind(null,"dom"),t=ct(e,!0);Je.document.addEventListener("click",t,!1),Je.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Je[t]&&Je[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(je(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){const r=ct(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(e){}return t.call(this,n,r,i)}}),je(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}}))})}();break;case"xhr":!function(){if(!("XMLHttpRequest"in Je))return;const e=XMLHttpRequest.prototype;je(e,"open",function(e){return function(...t){const n=t[1],r=this[Qe]={method:ce(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};ce(n)&&"POST"===r.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const e=this[Qe];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}tt("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?je(this,"onreadystatechange",function(e){return function(...t){return i(),e.apply(this,t)}}):this.addEventListener("readystatechange",i),je(this,"setRequestHeader",function(e){return function(...t){const[n,r]=t,i=this[Qe];return i&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}}),e.apply(this,t)}}),je(e,"send",function(e){return function(...t){const n=this[Qe];return n&&void 0!==t[0]&&(n.body=t[0]),tt("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}();break;case"fetch":(function(){if(!function(){if(!("fetch"in ze))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if($e(ze.fetch))return!0;let e=!1;const t=ze.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=$e(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&je(Je,"fetch",function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:rt(t),method:nt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:rt(t),method:nt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return tt("fetch",{...i}),e.apply(Je,t).then(e=>(tt("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw tt("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}});break;case"history":!function(){if(!function(){const e=Ke.chrome,t=e&&e.app&&e.app.runtime,n="history"in Ke&&!!Ke.history.pushState&&!!Ke.history.replaceState;return!t&&n}())return;const e=Je.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=it,t=String(n);it=t,tt("history",{from:e,to:t})}return e.apply(this,t)}}Je.onpopstate=function(...t){const n=Je.location.href,r=it;if(it=n,tt("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},je(Je.history,"pushState",t),je(Je.history,"replaceState",t)}();break;case"error":lt=Je.onerror,Je.onerror=function(e,t,n,r,i){return tt("error",{column:r,error:i,line:n,msg:e,url:t}),!(!lt||lt.__SENTRY_LOADER__)&<.apply(this,arguments)},Je.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":ut=Je.onunhandledrejection,Je.onunhandledrejection=function(e){return tt("unhandledrejection",e),!(ut&&!ut.__SENTRY_LOADER__)||ut.apply(this,arguments)},Je.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("unknown instrumentation type:",e)}}(e)}function tt(e,t){if(e&&Xe[e])for(const n of Xe[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ve(n)}\nError:`,t)}}function nt(e,t){return!!e&&"object"==typeof e&&!!e[t]}function rt(e){return"string"==typeof e?e:e?nt(e,"url")?e.url:e.toString?e.toString():"":""}let it;const ot=1e3;let at,st;function ct(e,t=!1){return n=>{if(!n||st===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===at||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(st,n))&&(e({event:n,name:r,global:t}),st=n),clearTimeout(at),at=Je.setTimeout(()=>{at=void 0},ot)}}let lt=null,ut=null;function dt(){const e=Se,t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");const n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function ht(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=ht(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function gt(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function ft(e,t){const n=ht(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function mt(e){if(e&&e.__sentry_captured__)return!0;try{Re(e,"__sentry_captured__",!0)}catch(e){}return!1}function yt(e,t=100,n=1/0){try{return bt("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function vt(e,t=3,n=102400){const r=yt(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?vt(e,t-1,n):r;var i}function bt(e,t,r=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(c=t)||c==c))return t;var c;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(function(e){return ue(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${Ve(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const u="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===u)return l.replace("object ","");if(a(t))return"[Circular ~]";const d=t;if(d&&"function"==typeof d.toJSON)try{return bt("",d.toJSON(),u-1,i,o)}catch(e){}const h=Array.isArray(t)?[]:{};let p=0;const g=Ue(t);for(const e in g){if(!Object.prototype.hasOwnProperty.call(g,e))continue;if(p>=i){h[e]="[MaxProperties ~]";break}const t=g[e];h[e]=bt(e,t,u-1,i,o),p++}return s(t),h}var wt;function _t(e){return new kt(t=>{t(e)})}function St(e){return new kt((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(wt||(wt={}));class kt{__init(){this._state=wt.PENDING}__init2(){this._handlers=[]}constructor(e){kt.prototype.__init.call(this),kt.prototype.__init2.call(this),kt.prototype.__init3.call(this),kt.prototype.__init4.call(this),kt.prototype.__init5.call(this),kt.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new kt((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new kt((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init3(){this._resolve=e=>{this._setResult(wt.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(wt.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===wt.PENDING&&(he(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===wt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===wt.RESOLVED&&e[1](this._value),this._state===wt.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Et(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Tt=["fatal","error","warning","log","info","debug"],Ct=ke(),It={nowSeconds:()=>Date.now()/1e3},At="undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__||"[object process]"!==Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(){const{performance:e}=Ct;if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}():function(){try{return(t=e,t.require("perf_hooks")).performance}catch(t){return}var t}(),Ot=void 0===At?It:{nowSeconds:()=>(At.timeOrigin+At.now())/1e3},xt=It.nowSeconds.bind(It),Mt=Ot.nowSeconds.bind(Ot);function Pt(e,t=[]){return[e,t]}function Nt(e,t){const[n,r]=e;return[n,[...r,t]]}function Lt(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Dt(e,t){return(t||new TextEncoder).encode(e)}function jt(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Dt(i,t),e]:i.push("string"==typeof e?Dt(e,t):e)}for(const e of r){const[n,r]=e;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch(t){e=JSON.stringify(yt(r))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(i)}function Rt(e,t){const n="string"==typeof e.data?Dt(e.data,t):e.data;return[Ye({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=Ct;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(o||s<t)&&i<=s&&e.timeOrigin})();const Bt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ft(e){return Bt[e]}function Ut(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const Wt="production";function Gt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Mt(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:dt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class Yt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Vt()}static clone(e){const t=new Yt;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Gt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof Yt?t:this}return e instanceof Yt?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):ue(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Vt(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:xt(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const t=this._span.transaction;if(t){e.sdkProcessingMetadata={dynamicSamplingContext:t.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const n=t.name;n&&(e.tags={transaction:n,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...Ht(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,t,n,r=0){return new kt((i,o)=>{const a=e[r];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&Me.log(`Event processor "${a.id}" dropped event`),he(s)?s.then(t=>this._notifyEventProcessors(e,t,n,r+1).then(i)).then(null,o):this._notifyEventProcessors(e,s,n,r+1).then(i).then(null,o)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){var t;e.fingerprint=e.fingerprint?(t=e.fingerprint,Array.isArray(t)?t:[t]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Ht(){return Ee("globalEventProcessors",()=>[])}function qt(e){Ht().push(e)}function Vt(){return{traceId:dt(),spanId:dt().substring(16),sampled:!1}}const zt=100;class $t{constructor(e,t=new Yt,n=4){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=Yt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1||!this.getStack().pop())}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:dt(),r=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:dt(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:dt();return e.type||(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=zt}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const a={timestamp:xt(),...e},s=i?Oe(()=>i(a,t)):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Jt(this);try{e(this)}finally{Jt(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);return"undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||n||console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Gt(e,t)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Wt}=n&&n.getOptions()||{},{userAgent:o}=Se.navigator||{},a=function(e){const t=Mt(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Ye({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Gt(n,e),n}({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Gt(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=Kt().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Kt(){return Se.__SENTRY__=Se.__SENTRY__||{extensions:{},hub:void 0},Se}function Jt(e){const t=Kt(),n=Xt(t);return Zt(t,e),n}function Qt(){const e=Kt();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Kt()){var t;return(t=e)&&t.__SENTRY__&&t.__SENTRY__.hub&&!Xt(e).isOlderThan(4)||Zt(e,new $t),Xt(e)}(e)}function Xt(e){return Ee("hub",()=>new $t,e)}function Zt(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const en=[];function tn(e,t){t[e.name]=e,-1===en.indexOf(e.name)&&(e.setupOnce(qt,Qt),en.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log(`Integration installed: ${e.name}`))}const nn=new WeakMap,rn="Not capturing exception because it's already been captured.";class on{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(on.prototype.__init.call(this),on.prototype.__init2.call(this),on.prototype.__init3.call(this),on.prototype.__init4.call(this),on.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Pe.exec(e);if(!t)return void console.error(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,a="",s]=t.slice(1);let c="",l=s;const u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const e=l.match(/^\d+/);e&&(l=e[0])}return Le({host:o,pass:i,path:c,projectId:l,port:a,protocol:n,publicKey:r})}(e):Le(e);if(t&&function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Me.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(Me.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Me.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(Me.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("No DSN provided, client will not do anything."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return n={sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&");var n}(e,r)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(mt(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log(rn));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=le(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&mt(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log(rn));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(e=>{r=e})),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Gt(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e)):_t(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const t={};return e.forEach(e=>{e&&tn(e,t)}),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){tn(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=function(e,t,n,r){const i=Ut(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:Ne(r)},...i&&{trace:Ye({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Pt(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Nt(n,Rt(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const i=Ut(n);return Pt({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:Ne(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(Gt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new kt(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),function(e,t,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=e,a={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||xt()},s=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Wt),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=ge(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=ge(a.value,o));const s=e.request;s&&s.url&&(s.url=ge(s.url,o))}(a,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(a,s),void 0===t.type&&function(e,t){const n=Se._sentryDebugIds;if(!n)return;let r;const i=nn.get(t);i?r=i:(r=new Map,nn.set(t,r));const o=Object.keys(n).reduce((e,i)=>{let o;const a=r.get(i);a?o=a:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch(e){}}(a,e.stackParser);let c=r;n.captureContext&&(c=Yt.clone(c).update(n.captureContext));let l=_t(a);if(c){if(c.getAttachments){const e=[...n.attachments||[],...c.getAttachments()];e.length&&(n.attachments=e)}l=c.applyToEvent(a,n)}return l.then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach(e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})})}(e),"number"==typeof i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:yt(e.data,t,n)}}))},...e.user&&{user:yt(e.user,t,n)},...e.contexts&&{contexts:yt(e.contexts,t,n)},...e.extra&&{extra:yt(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=yt(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>(e.data&&(e.data=yt(e.data,t,n)),e))),r}(e,i,o):e))}(r,e,t,n).then(e=>{if(null===e)return e;const{propagationContext:t}=e.sdkProcessingMetadata||{};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const s=a||function(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},a=Ye({environment:r.environment||Wt,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e;"log"===t.logLevel?Me.log(t.message):Me.warn(t)}})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return St(new De("SDK not enabled, will not capture event.","log"));const o=sn(e),a=an(e),s=e.type||"error",c=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),St(new De(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const l="replay_event"===s?"replay":s;return this._prepareEvent(e,t,n).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,e),new De("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;return an(t)&&r?r(t,n):sn(t)&&i?i(t,n):t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(he(e))return e.then(e=>{if(!ue(e)&&null!==e)throw new De(n);return e},e=>{throw new De(`${t} rejected with ${e}`)});if(!ue(e)&&null!==e)throw new De(n);return e}(i,c)}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",l,e),new De(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof De)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new De(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error("Error while sending event:",e)});("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function an(e){return void 0===e.type}function sn(e){return"transaction"===e.type}function cn(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const ln="7.60.1";let un;class dn{constructor(){dn.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=dn.id}setupOnce(){un=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Fe(this)||this;return un.apply(t,e)}}catch(e){}}}dn.__initStatic();const hn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],pn=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class gn{static __initStatic(){this.id="InboundFilters"}__init(){this.name=gn.id}constructor(e={}){this._options=e,gn.prototype.__init.call(this)}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(gn);if(t){const r=n.getClient(),i=r?r.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:hn],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:pn],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${pt(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception){const{values:t}=e.exception;try{const{type:e="",value:n=""}=t&&t[t.length-1]||{};return[`${n}`,`${e}: ${n}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error(`Cannot extract message for event ${pt(e)}`),[]}}return[]}(e).some(e=>me(e,t))}(e,t.ignoreErrors)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${pt(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&me(n,t)}(e,t.ignoreTransactions)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${pt(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=fn(e);return!!n&&me(n,t)}(e,t.denyUrls)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${fn(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=fn(e);return!n||me(n,t)}(e,t.allowUrls)&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${fn(e)}`),!0)}(e,o)?null:e}}return e};n.id=this.name,e(n)}}function fn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error(`Cannot extract url for event ${pt(e)}`),null}}gn.__initStatic();var mn=Object.freeze({__proto__:null,FunctionToString:dn,InboundFilters:gn});const yn=Se;let vn=0;function bn(){return vn>0}function wn(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Fe(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map(e=>wn(e,t));return e.apply(this,i)}catch(e){throw vn++,setTimeout(()=>{vn--}),i=n=>{var i;n.addEventProcessor(e=>(t.mechanism&&(gt(e,void 0,void 0),ft(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),i=e,Qt().captureException(i,{captureContext:void 0})},Qt().withScope(i),e}var i};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}Be(r,e),Re(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}function _n(e,t){const n=kn(e,t),r={type:t&&t.name,value:Tn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Sn(e,t){return{exception:{values:[_n(e,t)]}}}function kn(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(En.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}const En=/Minified React error #\d+;/i;function Tn(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Cn(e,t,n,r,i){let o;if(ae(t)&&t.error)return Sn(e,t.error);if(se(t)||oe(t,"DOMException")){const i=t;if("stack"in t)o=Sn(e,t);else{const t=i.name||(se(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=In(e,a,n,r),gt(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return ie(t)?Sn(e,t):ue(t)||de(t)?(o=function(e,t,n,r){const i=Qt().getClient(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:de(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:An(t,{isUnhandledRejection:r})}]},extra:{__serialized__:vt(t,o)}};if(n){const t=kn(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,i),ft(o,{synthetic:!0}),o):(o=In(e,t,n,r),gt(o,`${t}`,void 0),ft(o,{synthetic:!0}),o)}function In(e,t,n,r){const i={message:t};if(r&&n){const r=kn(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}return i}function An(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Ue(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return ge(n[0],t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:ge(r,t)}return""}(e),r=t?"promise rejection":"exception";return ae(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:de(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const On="Breadcrumbs";class xn{static __initStatic(){this.id=On}__init(){this.name=xn.id}constructor(e){xn.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&et("console",Mn),this.options.dom&&et("dom",function(e){return function(t){let n,r="object"==typeof e?e.serializeAttribute:void 0,i="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>1024&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=1024),"string"==typeof r&&(r=[r]);try{const e=t.event;n=function(e){return!!e&&!!e.target}(e)?Ce(e.target,{keyAttrs:r,maxStringLength:i}):Ce(e,{keyAttrs:r,maxStringLength:i})}catch(e){n="<unknown>"}0!==n.length&&Qt().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}}(this.options.dom)),this.options.xhr&&et("xhr",Pn),this.options.fetch&&et("fetch",Nn),this.options.history&&et("history",Ln)}addSentryBreadcrumb(e){this.options.sentry&&Qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:pt(e)},{event:e})}}function Mn(e){for(let t=0;t<e.args.length;t++)if("ref=Ref<"===e.args[t]){e.args[t+1]="viewRef";break}const t={category:"console",data:{arguments:e.args,logger:"console"},level:(n=e.level,"warn"===n?"warning":Tt.includes(n)?n:"log"),message:fe(e.args," ")};var n;if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${fe(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Qt().addBreadcrumb(t,{input:e.args,level:e.level})}function Pn(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr[Qe];if(!t||!n||!r)return;const{method:i,url:o,status_code:a,body:s}=r,c={method:i,url:o,status_code:a},l={xhr:e.xhr,input:s,startTimestamp:t,endTimestamp:n};Qt().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function Nn(e){const{startTimestamp:t,endTimestamp:n}=e;if(n&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){const r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};Qt().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};Qt().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Ln(e){let t=e.from,n=e.to;const r=Et(yn.location.href);let i=Et(t);const o=Et(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),Qt().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}xn.__initStatic();class Dn extends on{constructor(e){const t=yn.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:ln}],version:ln},super(e),e.sendClientReports&&yn.document&&yn.document.addEventListener("visibilitychange",()=>{"hidden"===yn.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=Cn(e,t,n&&n.syntheticException||void 0,r);return ft(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),_t(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=In(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),_t(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){const n=this.getIntegrationById(On);n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,t)}captureUserFeedback(e){if(!this._isEnabled())return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Ne(r)}},o=function(e){return[{type:"user_report"},e]}(e);return Pt(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log("No outcomes to send"));if(!this._dsn)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log("No dsn provided, will not send outcomes"));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log("Sending outcomes:",e);const t=(n=e,Pt((r=this._options.tunnel&&Ne(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:xt(),discarded_events:n}]]));var n,r;this._sendEnvelope(t)}}let jn;function Rn(e,t=function(){if(jn)return jn;if($e(yn.fetch))return jn=yn.fetch.bind(yn);const e=yn.document;let t=yn.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return jn=t.bind(yn)}()){let n=0,r=0;return function(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return St(new De("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new kt((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{_t(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}(e.bufferSize||30)){let r={};function i(i){const o=[];if(Lt(i,(t,n)=>{const i=Ft(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=cn(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)}),0===o.length)return _t();const a=Pt(i[0],o),s=t=>{Lt(a,(n,r)=>{const i=cn(n,r);e.recordDroppedEvent(t,Ft(r),i)})};return n.add(()=>t({body:jt(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n]=e.split(":",2),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))i[e]=r+a;else i.all=r+a}else a?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof De)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.error("Skipped sending event because buffer is full."),s("queue_overflow"),_t();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}(e,function(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,a).then(e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return jn=void 0,n-=o,r--,St(e)}})}class Bn{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Bn.id}__init2(){this._installFunc={onerror:Fn,onunhandledrejection:Un}}constructor(e){Bn.prototype.__init.call(this),Bn.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(t=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.log(`Global Handler attached: ${t}`),r(),this._installFunc[n]=void 0)}var t}}function Fn(){et("error",e=>{const[t,n,r]=Yn();if(!t.getIntegration(Bn))return;const{msg:i,url:o,line:a,column:s,error:c}=e;if(bn()||c&&c.__sentry_own_request__)return;const l=void 0===c&&ce(i)?function(e,t,n,r){let i=ae(e)?e.message:e,o="Error";const a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return a&&(o=a[1],i=a[2]),Wn({exception:{values:[{type:o,value:i}]}},t,n,r)}(i,o,a,s):Wn(Cn(n,c||i,void 0,r,!1),o,a,s);l.level="error",Gn(t,c,l,"onerror")})}function Un(){et("unhandledrejection",e=>{const[t,n,r]=Yn();if(!t.getIntegration(Bn))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(e){}if(bn()||i&&i.__sentry_own_request__)return!0;const o=le(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Cn(n,i,void 0,r,!0);o.level="error",Gn(t,i,o,"onunhandledrejection")})}function Wn(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=ce(t)&&t.length>0?t:function(){try{return Te.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),e}function Gn(e,t,n,r){ft(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Yn(){const e=Qt(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Bn.__initStatic();const Hn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class qn{static __initStatic(){this.id="TryCatch"}__init(){this.name=qn.id}constructor(e){qn.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&je(yn,"setTimeout",Vn),this._options.setInterval&&je(yn,"setInterval",Vn),this._options.requestAnimationFrame&&je(yn,"requestAnimationFrame",zn),this._options.XMLHttpRequest&&"XMLHttpRequest"in yn&&je(XMLHttpRequest.prototype,"send",$n);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Hn).forEach(Kn)}}function Vn(e){return function(...t){const n=t[0];return t[0]=wn(n,{mechanism:{data:{function:Ve(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function zn(e){return function(t){return e.apply(this,[wn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ve(e)},handled:!0,type:"instrument"}})])}}function $n(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&je(n,e,function(t){const n={mechanism:{data:{function:e,handler:Ve(t)},handled:!0,type:"instrument"}},r=Fe(t);return r&&(n.mechanism.data.handler=Ve(r)),wn(t,n)})}),e.apply(this,t)}}function Kn(e){const t=yn,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(je(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=wn(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ve(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[n,wn(r,{mechanism:{data:{function:"addEventListener",handler:Ve(r),target:e},handled:!0,type:"instrument"}}),i])}}),je(n,"removeEventListener",function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}}))}qn.__initStatic();class Jn{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=Jn.id}constructor(e={}){Jn.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,t){e((e,n)=>{const r=t(),i=r.getClient(),o=r.getIntegration(Jn);if(!i||!o)return e;const a=i.getOptions();return ye(_n,a.stackParser,a.maxValueLength,o._key,o._limit,e,n),e})}}Jn.__initStatic();class Qn{constructor(){Qn.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=Qn.id}setupOnce(){qt(e=>{if(Qt().getIntegration(Qn)){if(!yn.navigator&&!yn.location&&!yn.document)return e;const t=e.request&&e.request.url||yn.location&&yn.location.href,{referrer:n}=yn.document||{},{userAgent:r}=yn.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};return{...e,request:o}}return e})}}Qn.__initStatic();class Xn{constructor(){Xn.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=Xn.id}setupOnce(e,t){const n=e=>{if(e.type)return e;const n=t().getIntegration(Xn);if(n){try{if(function(e,t){return!(!t||!function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!er(e,t)||!Zn(e,t))}(e,t)&&!function(e,t){const n=tr(t),r=tr(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&er(e,t)&&Zn(e,t))}(e,t))}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Me.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function Zn(e,t){let n=nr(e),r=nr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function er(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function tr(e){return e.exception&&e.exception.values&&e.exception.values[0]}function nr(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}Xn.__initStatic();var rr=Object.freeze({__proto__:null,Breadcrumbs:xn,Dedupe:Xn,GlobalHandlers:Bn,HttpContext:Qn,LinkedErrors:Jn,TryCatch:qn});let ir={};yn.Sentry&&yn.Sentry.Integrations&&(ir=yn.Sentry.Integrations);const or={...ir,...mn,...rr};var ar="new",sr="loading",cr="loaded",lr="joining-meeting",ur="joined-meeting",dr="left-meeting",hr="error",pr="blocked",gr="off",fr="sendable",mr="loading",yr="interrupted",vr="playable",br="unknown",wr="full",_r="lobby",Sr="none",kr="base",Er="*",Tr="ejected",Cr="nbf-room",Ir="nbf-token",Ar="exp-room",Or="exp-token",xr="no-room",Mr="meeting-full",Pr="end-of-life",Nr="not-allowed",Lr="connection-error",Dr="cam-in-use",jr="mic-in-use",Rr="cam-mic-in-use",Br="permissions",Fr="undefined-mediadevices",Ur="not-found",Wr="constraints",Gr="unknown",Yr="iframe-ready-for-launch-config",Hr="iframe-launch-config",qr="theme-updated",Vr="loading",zr="load-attempt-failed",$r="loaded",Kr="started-camera",Jr="camera-error",Qr="joining-meeting",Xr="joined-meeting",Zr="left-meeting",ei="available-devices-updated",ti="participant-joined",ni="participant-updated",ri="participant-left",ii="participant-counts-updated",oi="access-state-updated",ai="meeting-session-summary-updated",si="meeting-session-state-updated",ci="meeting-session-data-error",li="waiting-participant-added",ui="waiting-participant-updated",di="waiting-participant-removed",hi="track-started",pi="track-stopped",gi="transcription-started",fi="transcription-stopped",mi="transcription-error",yi="recording-started",vi="recording-stopped",bi="recording-stats",wi="recording-error",_i="recording-upload-completed",Si="recording-data",ki="app-message",Ei="transcription-message",Ti="remote-media-player-started",Ci="remote-media-player-updated",Ii="remote-media-player-stopped",Ai="local-screen-share-started",Oi="local-screen-share-stopped",xi="local-screen-share-canceled",Mi="active-speaker-change",Pi="active-speaker-mode-change",Ni="network-quality-change",Li="network-connection",Di="cpu-load-change",ji="face-counts-updated",Ri="fullscreen",Bi="exited-fullscreen",Fi="live-streaming-started",Ui="live-streaming-updated",Wi="live-streaming-stopped",Gi="live-streaming-error",Yi="lang-updated",Hi="receive-settings-updated",qi="input-settings-updated",Vi="nonfatal-error",zi="error",$i=102400,Ki="iframe-call-message",Ji="local-screen-start",Qi="daily-method-update-live-streaming-endpoints",Xi="transmit-log",Zi="daily-custom-track",eo={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},to={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},no={PLAY:"play",PAUSE:"pause"},ro=["jpg","png","jpeg"];function io(){return!oo()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function oo(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function ao(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function so(){if(oo())return!1;if(!document)return!1;var e=document.createElement("iframe");return!!e.requestFullscreen||!!e.webkitRequestFullscreen}var co=function(){try{var e=document.createElement("canvas"),t=null!=e.getContext("webgl2");return e.remove(),t}catch(e){return!1}}();function lo(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!oo()&&!!co&&(e?!go()&&["Chrome","Firefox"].includes(fo()):function(){if(go())return!1;var e=fo();if("Safari"===e){var t=bo();if(t.major<15||15===t.major&&t.minor<4)return!1}return"Chrome"===e?yo().major>=77:"Firefox"===e?wo().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var uo=["Chrome","Firefox"];function ho(){return!oo()&&!go()&&"undefined"!=typeof AudioWorkletNode&&uo.includes(fo())}function po(){return ao()&&!function(){var e,t=fo();if(!io())return!0;switch(t){case"Chrome":return(e=yo()).major&&e.major>0&&e.major<75;case"Firefox":return(e=wo()).major<91;case"Safari":return(e=bo()).major<13||13===e.major&&e.minor<1;default:return!0}}()}function go(){var e,t,n=io(),r=n.match(/Mac/)&&(!oo()&&"undefined"!=typeof window&&null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!io().match(/DailyAnd\//)||void 0}function fo(){if("undefined"!=typeof window){var e=io();return vo()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function mo(){switch(fo()){case"Chrome":return yo();case"Safari":return bo();case"Firefox":return wo();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var n=io().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(e){}}return{major:e,minor:t}}()}}function yo(){var e=0,t=0,n=0,r=0,i=!1;if("undefined"!=typeof window){var o=io(),a=o.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{e=parseInt(a[1]),t=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=o.indexOf("OPR/")>-1}catch(e){}}return{major:e,minor:t,build:n,patch:r,opera:i}}function vo(){return!!io().match(/iPad|iPhone|iPod/i)&&ao()}function bo(){var e=0,t=0,n=0;if("undefined"!=typeof window){var r=io().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch(e){}else vo()&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function wo(){var e=0,t=0;if("undefined"!=typeof window){var n=io().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(e){}}return{major:e,minor:t}}var _o=function(){function e(){i(this,e)}return c(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Z()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Z()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Z()}},{key:"sendMessageToDailyJs",value:function(e,t){Z()}},{key:"removeListener",value:function(e){Z()}}]),e}();function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?So(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Eo=function(){d(t,_o);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}(t);function t(){var n;return i(this,t),(n=e.call(this))._wrappedListeners={},n._messageCallbacks={},n}return c(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){var r=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callFrameId||i.data.callFrameId===t)&&(!i.data.from||"module"!==i.data.from)){var o=ko({},i.data);if(delete o.from,o.callbackStamp&&r._messageCallbacks[o.callbackStamp]){var a=o.callbackStamp;r._messageCallbacks[a].call(n,o),delete r._messageCallbacks[a]}delete o.what,delete o.callbackStamp,e.call(n,o)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){var r=function(r){if(!(!r.data||r.data.what!==Ki||!r.data.action||r.data.from&&"module"!==r.data.from||r.data.callFrameId&&t&&r.data.callFrameId!==t)){var i=r.data;e.call(n,i)}};this._wrappedListeners[e]=r,window.addEventListener("message",r)}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){if(!r)throw new Error("undefined callFrameId. Are you trying to use a DailyCall instance previously destroyed?");var i=ko({},e);if(i.what=Ki,i.from="module",i.callFrameId=r,t){var o=X();this._messageCallbacks[o]=t,i.callbackStamp=o}var a=n?n.contentWindow:window,s=this._callMachineTargetOrigin(n);s&&a.postMessage(i,s)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=Ki,e.callFrameId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,n){var r=ko({},e);r.callFrameId=n;var i=t?t.contentWindow:window,o=this._callMachineTargetOrigin(t);o&&i.postMessage(r,o)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var n=function(n){if(n.data&&"iframe-call-message"===n.data.what&&(!n.data.callFrameId||n.data.callFrameId===t)&&(!n.data.from||"module"!==n.data.from)){var r=n.data;e(r)}};return this._wrappedListeners[e]=n,window.addEventListener("message",n),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return"file:"===window.location.protocol?"*":window.location.origin}}]),t}(),To=function(){d(t,_o);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}(t);function t(){var r;return i(this,t),r=e.call(this),n.g.callMachineToDailyJsEmitter=n.g.callMachineToDailyJsEmitter||new w.EventEmitter,n.g.dailyJsToCallMachineEmitter=n.g.dailyJsToCallMachineEmitter||new w.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return c(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){this._addListener(e,n.g.callMachineToDailyJsEmitter,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){this._addListener(e,n.g.dailyJsToCallMachineEmitter,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t){this._sendMessage(e,n.g.dailyJsToCallMachineEmitter,"sending message to call machine",t)}},{key:"sendMessageToDailyJs",value:function(e){this._sendMessage(e,n.g.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(n.g.callMachineToDailyJsEmitter.removeListener("message",t),n.g.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,n,r){var i=this,o=function(t){if(t.callbackStamp&&i._messageCallbacks[t.callbackStamp]){var r=t.callbackStamp;i._messageCallbacks[r].call(n,t),delete i._messageCallbacks[r]}e.call(n,t)};this._wrappedListeners[e]=o,t.addListener("message",o)}},{key:"_sendMessage",value:function(e,t,n,r){if(r){var i=X();this._messageCallbacks[i]=r,e.callbackStamp=i}t.emit("message",e)}}]),t}(),Co="replace",Io="shallow-merge",Ao=[Co,Io],Oo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data,r=t.mergeStrategy,o=void 0===r?Co:r;i(this,e),e._validateMergeStrategy(o),e._validateData(n,o),this.mergeStrategy=o,this.data=n}return c(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return 0===Object.keys(e).length&&t===Io}},{key:"_validateMergeStrategy",value:function(e){if(!Ao.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Ao,"]"))}},{key:"_validateData",value:function(e,t){if(!function(e){if(null==e||"object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var n;try{if(n=JSON.stringify(e),t===Co){var r=JSON.parse(n);B(r,e)||console.warn("The meeting session data provided will be modified when serialized.",r,e)}else if(t===Io)for(var i in e)if(Object.hasOwnProperty.call(e,i)&&void 0!==e[i]){var a=JSON.parse(JSON.stringify(e[i]));B(e[i],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[i])}}catch(e){throw Error("Meeting session data must be serializable to JSON: ".concat(e))}if(n.length>$i)throw Error("Meeting session data is too large (".concat(n.length," characters). Maximum size suppported is ").concat($i,"."))}}]),e}();function xo(e,t,n){return xo=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i},xo.apply(null,arguments)}function Mo(e){var t="function"==typeof Map?new Map:void 0;return Mo=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return xo(e,arguments,p(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},Mo(e)}function Po(e){var t,n=null===(t=window._daily)||void 0===t?void 0:t.pendings;if(n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}var No=function(){function e(t){i(this,e),this._currentLoad=null,this._callFrameId=t}return c(e,[{key:"load",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callFrameId].callMachine.reset(),void r(!0);e=this._callFrameId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new Lo(n,function(){r(!1)},function(e,n){n||Po(t._callFrameId),i(e,n)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Po(this._callFrameId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),e}(),Lo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;i(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r}return c(e,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new Ro(this._dailyConfig,this._successCallback,function t(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new Ro(e._dailyConfig,e._successCallback,t),e._currentAttempt.start())},3e3))}),this._currentAttempt.start())}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),e}(),Do=function(){d(t,Mo(Error));var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}(t);function t(){return i(this,t),e.apply(this,arguments)}return c(t)}(),jo=2e4,Ro=function(){function e(t,n,r){i(this,e),this._loadAttemptImpl=oo()||!t.avoidEval?new Bo(t,n,r):new Fo(t,n,r)}var t;return c(e,[{key:"start",value:(t=m(function*(){return this._loadAttemptImpl.start()}),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),e}(),Bo=function(){function e(t,n,r){i(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r}var t,n,r,o;return c(e,[{key:"start",value:(o=m(function*(){var e=te(this._dailyConfig);!(yield this._tryLoadFromIOSCache(e))&&this._loadFromNetwork(e)}),function(){return o.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=m(function*(e){if(!this._iosCache)return!1;try{var t=yield this._iosCache.get(e);return!!this.cancelled||!!t&&(t.code?(Function('"use strict";'+t.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=t.refetchHeaders,!1))}catch(e){return!1}}),function(e){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=m(function*(e){var t=this;this._networkTimeout=setTimeout(function(){t._networkTimedOut=!0,t._failureCallback({msg:"Timed out (>".concat(jo," ms) when loading call object bundle ").concat(e),type:"timeout"})},jo);try{var n=this._refetchHeaders?{headers:this._refetchHeaders}:{},r=yield fetch(e,n);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Do;var i=yield this._getBundleCodeFromResponse(e,r);if(this.cancelled)throw new Do;Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(e,i,r.headers),this.succeeded=!0,this._successCallback()}catch(t){if(clearTimeout(this._networkTimeout),t instanceof Do||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(e,": ").concat(t),type:t.message})}}),function(e){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=m(function*(e,t){if(t.ok)return yield t.text();if(this._iosCache&&304===t.status)return(yield this._iosCache.renew(e,t.headers)).code;throw new Error("Received ".concat(t.status," response"))}),function(e,n){return t.apply(this,arguments)})}]),e}(),Fo=function(){function e(t,n,r){i(this,e),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r,this._attemptId=X(),this._networkTimeout=null,this._scriptElement=null}return c(e,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=te(this._dailyConfig);"object"===("undefined"==typeof document?"undefined":o(document))?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){t._stopLoading(),t._failureCallback({msg:"Timed out (>".concat(jo," ms) when loading call object bundle ").concat(e),type:"timeout"})},jo);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){t._stopLoading(),t.succeeded=!0,t._successCallback()},r.onerror=function(e){t._stopLoading(),t._failureCallback({msg:"Failed to load call object bundle ".concat(e.target.src),type:e.message})},r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),e}(),Uo=function(e,t,n){return!0===Yo(e.local,t,n)},Wo=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===n?"Video":"Audio","Tracks")]()[0]},Go=function(e,t,n,r){var i=Ho(e,t,n,r);return i&&i.pendingTrack},Yo=function(e,t,n){if(!e)return!1;var r=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?-1===["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)&&i[t].custom?[!0,"staged"].includes(i[t].custom)?r(i[t].custom):r(i[t].custom[n]):r(i[t][n]):!i||r(i.ALL)},Ho=function(e,t,n,r){var i=Object.values(e.streams||{}).filter(function(e){return e.participantId===t&&e.type===n&&e.pendingTrack&&e.pendingTrack.kind===r}).sort(function(e,t){return new Date(t.starttime)-new Date(e.starttime)});return i&&i[0]},qo=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function Vo(e,t){for(var n=t.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var o=i[r],a=0,s=["video","audio"];a<s.length;a++){var c=s[a],l="cam"===o?c:"screen".concat(c.charAt(0).toUpperCase()+c.slice(1)),u=e.tracks[l];if(u){var d=e.local?Wo(n,o,c):Go(n,e.session_id,o,c);"playable"===u.state&&(u.track=d),u.persistentTrack=d}}}function zo(e,t){try{var n=t.getState();for(var r in e.tracks)if(!$o(r)){var i=e.tracks[r].kind;if(i){var o=e.tracks[r];if(o){var a=e.local?qo(n,r):Go(n,e.session_id,r,i);"playable"===o.state&&(e.tracks[r].track=a),o.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(e){console.error(e)}}function $o(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function Ko(e,t,n){var r=n.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(e){}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(e){}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){}}else{var i=!0;try{var o=r.participants[e.session_id];o&&o.public&&o.public.rtcType&&"peer-to-peer"===o.public.rtcType.impl&&o.private&&!["connected","completed"].includes(o.private.peeringState)&&(i=!1)}catch(e){console.error(e)}if(!i)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(r.streams,e.audio&&Uo(r,e.session_id,"cam-audio")){var a=Go(r,e.session_id,"cam","audio");a&&(t&&t.audioTrack&&t.audioTrack.id===a.id?e.audioTrack=a:a.muted||(e.audioTrack=a)),e.audioTrack||(e.audio=!1)}if(e.video&&Uo(r,e.session_id,"cam-video")){var s=Go(r,e.session_id,"cam","video");s&&(t&&t.videoTrack&&t.videoTrack.id===s.id?e.videoTrack=s:s.muted||(e.videoTrack=s)),e.videoTrack||(e.video=!1)}if(e.screen&&Uo(r,e.session_id,"screen-audio")){var c=Go(r,e.session_id,"screen","audio");c&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===c.id?e.screenAudioTrack=c:c.muted||(e.screenAudioTrack=c))}if(e.screen&&Uo(r,e.session_id,"screen-video")){var l=Go(r,e.session_id,"screen","video");l&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===l.id?e.screenVideoTrack=l:l.muted||(e.screenVideoTrack=l))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){console.error("unexpected error matching up tracks",e)}}}function Jo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qo=new Map,Xo=null;function Zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ea=new Map,ta=null;function na(){return oo()||void 0!==navigator.mediaDevices.ondevicechange}var ra,ia=new Set,oa=["videoTrack"],aa=["result"],sa=["preserveIframe"];function ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function la(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ca(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ca(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ua(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function da(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ha(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pa="video",ga="voice",fa=oo()?{data:{}}:{data:{},topology:"none"},ma={present:0,hidden:0},ya={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},va=Object.keys(ya),ba=["state","volume","simulcastEncodings"],wa={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},_a={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},Sa={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},ka={customIntegrations:{validate:Ha,help:Ga()},customTrayButtons:{validate:Ya,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(_a))},url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),!0}catch(e){console.error("Failed to validate dailyConfig",e)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return qa(e,wa)},help:"reactNativeConfig should look like ".concat(JSON.stringify(wa),", all fields optional")},lang:{validate:function(e){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return ja(e),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){return e instanceof MediaStreamTrack&&(t._sharedTracks.videoDeviceId=e),t._preloadCache.videoDeviceId=e,!0}},audioSource:{validate:function(e,t){return e instanceof MediaStreamTrack&&(t._sharedTracks.audioDeviceId=e),t._preloadCache.audioDeviceId=e,!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===o(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(e){return Ra(e,{allowAllParticipantsKey:!1})},help:Wa({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(e,t){try{return t.validateUpdateSendSettings(e),!0}catch(e){return console.error("Failed to validate send settings",e),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){var n;return!!Ba(e)&&(t._preloadCache.inputSettings||(t._preloadCache.inputSettings={}),Fa(e,null===(n=t.properties)||void 0===n?void 0:n.dailyConfig),e.audio&&(t._preloadCache.inputSettings.audio=e.audio),e.video&&(t._preloadCache.inputSettings.video=e.video),!0)},help:Ua()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0},Ea={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var n in e.cam)if("div"!==n&&"video"!==n)return!1;if(e.screen)for(var r in e.screen)if("div"!==r&&"video"!==r)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!oo()&&"avatar"===e)return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var o in t)if("custom"===o){if(!n.includes(t[o])&&!e(t[o],!0))return!1}else{var a=!i&&!r.includes(o),s=!n.includes(t[o]);if(a||s)return!1}return!0}(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(oo()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(e){return!1===e},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=v(n[t],2),i=r[0],o=r[1];switch(i){case"hasPresence":if("boolean"!=typeof o)return!1;break;case"canSend":if(o instanceof Set||o instanceof Array){var a,s=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],c=da(o);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(!s.includes(l))return!1}}catch(e){c.e(e)}finally{c.f()}}else if("boolean"!=typeof o)return!1;o instanceof Array&&(e.canSend=new Set(o));break;case"canAdmin":if(o instanceof Set||o instanceof Array){var u,d=["participants","streaming","transcription"],h=da(o);try{for(h.s();!(u=h.n()).done;){var p=u.value;if(!d.includes(p))return!1}}catch(e){h.e(e)}finally{h.f()}}else if("boolean"!=typeof o)return!1;o instanceof Array&&(e.canAdmin=new Set(o));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var e=m(function*(e){return new Promise(function(t,n){var r=[];e.forEach(function(i){return Promise.resolve(i).then(function(e){t(e)}).catch(function(t){r.push(t),r.length===e.length&&n(r)})})})});return function(t){return e.apply(this,arguments)}}());var Ta=function(){d($,w);var e,t,n,a,s,u,h,p,f,y,b,_,S,k,E,T,C,I,A,O,x,M,P,N,L,D,j,R,F,U,W,G,Y,H,q,V,z=ua($);function $(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,$),g(l(t=z.call(this)),"startListeningForDeviceChanges",function(){!function(e){na()?function(e){Qo.has(e)||(Qo.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){Qo.has(e)&&(Qo.get(e).lastDevicesString=JSON.stringify(t),Xo||(Xo=function(){var e=m(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return Jo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jo(e,t):void 0}}(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(Qo.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==Qo.get(r).lastDevicesString&&(Qo.get(r).lastDevicesString=i,r(t))}}catch(e){n.e(e)}finally{n.f()}});return function(){return e.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",Xo)))}).catch(function(){}))}(e):function(e){ea.has(e)||(ea.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){ea.has(e)&&(ea.get(e).lastDevicesString=JSON.stringify(t),ta||(ta=setInterval(m(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return Zo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zo(e,t):void 0}}(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(ea.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==ea.get(r).lastDevicesString&&(ea.get(r).lastDevicesString=i,r(t))}}catch(e){n.e(e)}finally{n.f()}}),3e3)))}))}(e)}(t.handleDeviceChange)}),g(l(t),"stopListeningForDeviceChanges",function(){!function(e){na()?function(e){Qo.has(e)&&(Qo.delete(e),0===Qo.size&&Xo&&(navigator.mediaDevices.removeEventListener("devicechange",Xo),Xo=null))}(e):function(e){ea.has(e)&&(ea.delete(e),0===ea.size&&ta&&(clearInterval(ta),ta=null))}(e)}(t.handleDeviceChange)}),g(l(t),"handleDeviceChange",function(e){e=e.map(function(e){return JSON.parse(JSON.stringify(e))}),t.emit(ei,{action:ei,availableDevices:e})}),g(l(t),"handleNativeAppStateChange",function(){var e=m(function*(e){if("destroyed"===e)return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield t.destroy());var n="active"===e;t.disableReactNativeAutoDeviceManagement("video")||(n?t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!0):(t.camUnmutedBeforeLosingNativeActiveState=t.localVideo(),t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!1)))});return function(t){return e.apply(this,arguments)}}()),g(l(t),"handleNativeAudioFocusChange",function(e){t.disableReactNativeAutoDeviceManagement("audio")||(t._hasNativeAudioFocus=e,t.toggleParticipantAudioBasedOnNativeAudioFocus(),t._hasNativeAudioFocus?t.micUnmutedBeforeLosingNativeAudioFocus&&t.setLocalAudio(!0):(t.micUnmutedBeforeLosingNativeAudioFocus=t.localAudio(),t.setLocalAudio(!1)))}),g(l(t),"handleNativeSystemScreenCaptureStop",function(){t.stopScreenShare()}),t.strictMode=void 0===r.strictMode||r.strictMode,ra){if(t._logDuplicateInstanceAttempt(),t.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed")}else n=l(t),ra=n;if(window._daily||(window._daily={pendings:[],instances:{}}),t._callFrameId=X(),window._daily.instances[t._callFrameId]={},t._sharedTracks={},window._daily.instances[t._callFrameId].tracks=t._sharedTracks,r.dailyJsVersion=$.version(),t._iframe=e,t._callObjectMode="none"===r.layout&&!t._iframe,t._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},void 0!==r.showLocalVideo?t._callObjectMode?console.error("showLocalVideo is not available in call object mode"):t._showLocalVideo=!!r.showLocalVideo:t._showLocalVideo=!0,void 0!==r.showParticipantsBar?t._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):t._showParticipantsBar=!!r.showParticipantsBar:t._showParticipantsBar=!0,void 0!==r.customIntegrations?t._callObjectMode?console.error("customIntegrations is not available in call object mode"):t._customIntegrations=r.customIntegrations:t._customIntegrations={},void 0!==r.customTrayButtons?t._callObjectMode?console.error("customTrayButtons is not available in call object mode"):t._customTrayButtons=r.customTrayButtons:t._customTrayButtons={},void 0!==r.activeSpeakerMode?t._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):t._activeSpeakerMode=!!r.activeSpeakerMode:t._activeSpeakerMode=!1,r.receiveSettings?t._callObjectMode?t._receiveSettings=r.receiveSettings:console.error("receiveSettings is only available in call object mode"):t._receiveSettings={},t.validateProperties(r),t.properties=la({},r),t._preloadCache.inputSettings||(t._preloadCache.inputSettings={}),r.inputSettings&&r.inputSettings.audio&&(t._preloadCache.inputSettings.audio=r.inputSettings.audio),r.inputSettings&&r.inputSettings.video&&(t._preloadCache.inputSettings.video=r.inputSettings.video),t._callObjectLoader=t._callObjectMode?new No(t._callFrameId):null,t._callState=ar,t._isPreparingToJoin=!1,t._accessState={access:br},t._meetingSessionSummary={},t._finalSummaryOfPrevSession={},t._meetingSessionState=$a(fa,t._callObjectMode),t._nativeInCallAudioMode=pa,t._participants={},t._isScreenSharing=!1,t._participantCounts=ma,t._rmpPlayerState={},t._waitingParticipants={},t._network={threshold:"good",quality:100},t._activeSpeaker={},t._localAudioLevel=0,t._remoteParticipantsAudioLevel={},t._messageChannel=oo()?new To:new Eo,t._iframe&&(t._iframe.requestFullscreen?t._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===t._iframe?(t.emit(Ri,{action:Ri}),t.sendMessageToCallMachine({action:Ri})):(t.emit(Bi,{action:Bi}),t.sendMessageToCallMachine({action:Bi}))}):t._iframe.webkitRequestFullscreen&&t._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===t._iframe?(t.emit(Ri,{action:Ri}),t.sendMessageToCallMachine({action:Ri})):(t.emit(Bi,{action:Bi}),t.sendMessageToCallMachine({action:Bi}))})),oo()){var o=t.nativeUtils();o.addAudioFocusChangeListener&&o.removeAudioFocusChangeListener&&o.addAppStateChangeListener&&o.removeAppStateChangeListener&&o.addSystemScreenCaptureStopListener&&o.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),t._hasNativeAudioFocus=!0,o.addAudioFocusChangeListener(t.handleNativeAudioFocusChange),o.addAppStateChangeListener(t.handleNativeAppStateChange),o.addSystemScreenCaptureStopListener(t.handleNativeSystemScreenCaptureStop)}return t._callObjectMode&&t.startListeningForDeviceChanges(),t._messageChannel.addListenerForMessagesFromCallMachine(t.handleMessageFromCallMachine,t._callFrameId,l(t)),t}return c($,[{key:"destroy",value:(V=m(function*(){var e,t;try{yield this.leave()}catch(e){}var n=this._iframe;if(n){var r=n.parentElement;r&&r.removeChild(n)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),oo()){var i=this.nativeUtils();i.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),i.removeAppStateChangeListener(this.handleNativeAppStateChange),i.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0;try{this.emit("call-instance-destroyed",{action:"call-instance-destroyed"})}catch(e){console.log("could not emit call-instance-destroyed")}ra=void 0,(null===(e=window)||void 0===e||null===(t=e._daily)||void 0===t?void 0:t.instances)&&delete window._daily.instances[this._callFrameId],this.strictMode&&(this._callFrameId=void 0)}),function(){return V.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(e){var t=e.bodyClass,n=e.cssFile,r=e.cssText;return La(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(n),bodyClass:t,cssText:r}),this}},{key:"iframe",value:function(){return La(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return Pa(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return Pa(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var n in t){if(!Ea[n])throw new Error("unrecognized updateParticipant property ".concat(n));if(Ea[n].validate&&!Ea[n].validate(t[n],this,this._participants[e]))throw new Error(Ea[n].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var n in e)n===t&&(n="local"),n&&e[n]&&this.validateParticipantProperties(n,e[n]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:(q=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Pa(this._callObjectMode,"updateWaitingParticipant()"),Ia(this._callState,"updateWaitingParticipant()"),"string"!=typeof t||"object"!==o(n))throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(r,i){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:n},function(e){e.error&&i(e.error),e.id||i(new Error("unknown error in updateWaitingParticipant()")),r({id:e.id})})})}),function(){return q.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(H=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Pa(this._callObjectMode,"updateWaitingParticipants()"),Ia(this._callState,"updateWaitingParticipants()"),"object"!==o(t))throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(n,r){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},function(e){e.error&&r(e.error),e.ids||r(new Error("unknown error in updateWaitingParticipants()")),n({ids:e.ids})})})}),function(){return H.apply(this,arguments)})},{key:"requestAccess",value:(Y=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.access,r=void 0===n?{level:wr}:n,i=t.name,o=void 0===i?"":i;return Pa(this._callObjectMode,"requestAccess()"),Ia(this._callState,"requestAccess()"),new Promise(function(t,n){e.sendMessageToCallMachine({action:"daily-method-request-access",access:r,name:o},function(e){e.error&&n(e.error),e.access||n(new Error("unknown error in requestAccess()")),t({access:e.access,granted:e.granted})})})}),function(){return Y.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"forceDiscardTrack"in t&&(oo()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),t={}):e&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),t={})),this.sendMessageToCallMachine({action:"local-audio",state:e,options:t}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(e){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:e}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"getReceiveSettings",value:(G=m(function*(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).showInheritedValues,r=void 0!==n&&n;if(Pa(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(o(e)){case"string":return new Promise(function(n){t.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:e,showInheritedValues:r},function(e){n(e.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(e){return G.apply(this,arguments)})},{key:"updateReceiveSettings",value:(W=m(function*(e){var t=this;if(Pa(this._callObjectMode,"updateReceiveSettings()"),!Ra(e,{allowAllParticipantsKey:!0}))throw new Error(Wa({allowAllParticipantsKey:!0}));return Ia(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(n){t.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:e},function(e){n({receiveSettings:e.receiveSettings})})})}),function(e){return W.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(e){var t,n,r,i,o,a,s,c;if(e){var l={},u="none"===(null===(t=e.audio)||void 0===t||null===(n=t.processor)||void 0===n?void 0:n.type)&&(null===(r=e.audio)||void 0===r||null===(i=r.processor)||void 0===i?void 0:i._isDefaultWhenNone);if(e.audio&&!u){var d=la({},e.audio.processor);delete d._isDefaultWhenNone,l.audio=la(la({},e.audio),{},{processor:d})}var h="none"===(null===(o=e.video)||void 0===o||null===(a=o.processor)||void 0===a?void 0:a.type)&&(null===(s=e.video)||void 0===s||null===(c=s.processor)||void 0===c?void 0:c._isDefaultWhenNone);if(e.video&&!h){var p=la({},e.video.processor);delete p._isDefaultWhenNone,l.video=la(la({},e.video),{},{processor:p})}return l}}},{key:"getInputSettings",value:function(){var e=this;return La(),new Promise(function(t){t(e._getInputSettings())})}},{key:"_getInputSettings",value:function(){var e,t,n,r,i,o,a,s,c={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(e=(null===(n=this._inputSettings)||void 0===n?void 0:n.video)||c,t=(null===(r=this._inputSettings)||void 0===r?void 0:r.audio)||c):(e=(null===(i=this._preloadCache)||void 0===i||null===(o=i.inputSettings)||void 0===o?void 0:o.video)||c,t=(null===(a=this._preloadCache)||void 0===a||null===(s=a.inputSettings)||void 0===s?void 0:s.audio)||c);var l={audio:t,video:e};return this._prepInputSettingsToPresentToUser(l)}},{key:"updateInputSettings",value:(U=m(function*(e){var t=this;return La(),Ba(e)?(e&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),Fa(e,this.properties.dailyConfig),e.audio&&(this._preloadCache.inputSettings.audio=e.audio),e.video&&(this._preloadCache.inputSettings.video=e.video)),e.video||e.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-input-settings",inputSettings:e},function(e){e.error?r(e.error):n({inputSettings:t._prepInputSettingsToPresentToUser(e.inputSettings)})})}):this._getInputSettings()):(console.error(Ua()),Promise.reject(Ua()))}),function(e){return U.apply(this,arguments)})},{key:"setBandwidth",value:function(e){var t=e.kbs,n=e.trackConstraints;if(La(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:n}),this}},{key:"getDailyLang",value:function(){var e=this;if(La(),this._callMachineInitialized)return new Promise(function(t){e.sendMessageToCallMachine({action:"get-daily-lang"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}},{key:"setDailyLang",value:function(e){return La(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"setProxyUrl",value:function(e){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:e}),this}},{key:"setIceConfig",value:function(e){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:e}),this}},{key:"meetingSessionSummary",value:function(){return[dr,hr].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(F=m(function*(){var e=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Ia(this._callState,"getMeetingSession()"),new Promise(function(t){e.sendMessageToCallMachine({action:"get-meeting-session"},function(e){delete e.action,delete e.callbackStamp,delete e.callFrameId,t(e)})})}),function(){return F.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Ia(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";Pa(this._callObjectMode,"setMeetingSessionData()"),Ia(this._callState,"setMeetingSessionData");try{!function(e,t){new Oo({data:e,mergeStrategy:t})}(e,t)}catch(e){throw console.error(e),e}try{this.sendMessageToCallMachine({action:"set-session-data",data:e,mergeStrategy:t})}catch(e){throw new Error("Error setting meeting session data: ".concat(e))}}},{key:"setUserName",value:function(e,t){var n=this;return this.properties.userName=e,new Promise(function(r){n.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:oo()||!!t&&!!t.thisMeetingOnly},function(e){delete e.action,delete e.callbackStamp,r(e)})})}},{key:"setUserData",value:(R=m(function*(e){var t=this;try{ja(e)}catch(e){throw console.error(e),e}if(this.properties.userData=e,this._callMachineInitialized)return new Promise(function(n){try{t.sendMessageToCallMachine({action:"set-user-data",userData:e},function(e){delete e.action,delete e.callbackStamp,delete e.callFrameId,n(e)})}catch(e){throw new Error("Error setting user data: ".concat(e))}})}),function(e){return R.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(e){if(e&&(e<100||"number"!=typeof e))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(e){var t=this;if("undefined"==typeof AudioWorkletNode&&!oo())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:e},function(e){e.error?r({error:e.error}):n()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:e}}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(e){var t=this;if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:e},function(e){e.error?r({error:e.error}):n()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:e}}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(j=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Pa(this._callObjectMode,"startCamera()"),Oa(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),Ma(this._testCallInProgress,"startCamera()"),this.needsLoad())try{yield this.load(t)}catch(e){return Promise.reject(e)}else{if(this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(t),this.properties=la(la({},this.properties),t)}return new Promise(function(t){e.sendMessageToCallMachine({action:"start-camera",properties:Ca(e.properties,e._callFrameId),preloadCache:Ca(e._preloadCache,e._callFrameId)},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return j.apply(this,arguments)})},{key:"validateCustomTrack",value:function(e,t,n){if(n&&n.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(t&&"music"!==t&&"speech"!==t&&!(t instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(n&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(n))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(e instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{track,mode,trackName};return La(),Ia(this._callState,"startCustomTrack()"),this.validateCustomTrack(t.track,t.mode,t.trackName),new Promise(function(n,r){e._sharedTracks.customTrack=t.track,t.track=Zi,e.sendMessageToCallMachine({action:"start-custom-track",properties:t},function(e){e.error?r({error:e.error}):n(e.mediaTag)})})}},{key:"stopCustomTrack",value:function(e){var t=this;return La(),Ia(this._callState,"stopCustomTrack()"),new Promise(function(n){t.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:e},function(e){n(e.mediaTag)})})}},{key:"setCamera",value:function(e){var t=this;return Da(),xa(this._callMachineInitialized,"setCamera()"),new Promise(function(n){t.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:e},function(e){n({device:e.device})})})}},{key:"setAudioDevice",value:(D=m(function*(e){return Da(),this.nativeUtils().setAudioDevice(e),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(e){return D.apply(this,arguments)})},{key:"cycleCamera",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(n){e.sendMessageToCallMachine({action:"cycle-camera",properties:t},function(e){n({device:e.device})})})}},{key:"cycleMic",value:function(){var e=this;return La(),new Promise(function(t){e.sendMessageToCallMachine({action:"cycle-mic"},function(e){t({device:e.device})})})}},{key:"getCameraFacingMode",value:function(){var e=this;return Da(),new Promise(function(t){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(e){t(e.facingMode)})})}},{key:"setInputDevicesAsync",value:(L=m(function*(e){var t=this,n=e.audioDeviceId,r=e.videoDeviceId,i=e.audioSource,o=e.videoSource;return La(),void 0!==i&&(n=i),void 0!==o&&(r=o),n&&(this._preloadCache.audioDeviceId=n,this._sharedTracks.audioDeviceId=n),r&&(this._preloadCache.videoDeviceId=r,this._sharedTracks.videoDeviceId=r),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(n instanceof MediaStreamTrack&&(n=Zi),r instanceof MediaStreamTrack&&(r=Zi),new Promise(function(e){t.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:n,videoDeviceId:r},function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?e({camera:{deviceId:t._preloadCache.videoDeviceId},mic:{deviceId:t._preloadCache.audioDeviceId},speaker:{deviceId:t._preloadCache.outputDeviceId}}):e(n)})}))}),function(e){return L.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(N=m(function*(e){var t=this,n=e.outputDeviceId;return La(),n&&(this._preloadCache.outputDeviceId=n),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(e){t.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:n},function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?e({camera:{deviceId:t._preloadCache.videoDeviceId},mic:{deviceId:t._preloadCache.audioDeviceId},speaker:{deviceId:t._preloadCache.outputDeviceId}}):e(n)})})}),function(e){return N.apply(this,arguments)})},{key:"getInputDevices",value:(P=m(function*(){var e=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(t){e.sendMessageToCallMachine({action:"get-input-devices"},function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?t({camera:{deviceId:e._preloadCache.videoDeviceId},mic:{deviceId:e._preloadCache.audioDeviceId},speaker:{deviceId:e._preloadCache.outputDeviceId}}):t(n)})})}),function(){return P.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Da(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(Da(),[pa,ga].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&Aa(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:(M=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Pa(this._callObjectMode,"preAuth()"),Oa(this._callState,this._isPreparingToJoin,"preAuth()"),Ma(this._testCallInProgress,"preAuth()"),this.needsLoad()&&(yield this.load(t)),!t.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(t),this.properties=la(la({},this.properties),t),new Promise(function(t,n){e.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ca(e.properties,e._callFrameId),preloadCache:Ca(e._preloadCache,e._callFrameId)},function(r){return r.error?n(r.error):r.access?(e._didPreAuth=!0,void t({access:r.access})):n(new Error("unknown error in preAuth()"))})})}),function(){return M.apply(this,arguments)})},{key:"load",value:(x=m(function*(e){var t=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(e&&(this.validateProperties(e),this.properties=la(la({},this.properties),e)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");this._updateCallState(sr);try{this.emit(Vr,{action:Vr})}catch(e){console.log("could not emit 'loading'",e)}return this._callObjectMode?new Promise(function(e,n){t._callObjectLoader.cancel();var r=Date.now();t._callObjectLoader.load(t.properties.dailyConfig,function(n){t._bundleLoadTime=n?"no-op":Date.now()-r,t._updateCallState(cr),n&&t.emit($r,{action:$r}),e()},function(e,r){if(t.emit(zr,{action:zr,error:e}),!r){t._updateCallState(hr),t.resetMeetingDependentVars();var i={action:zi,errorMsg:e.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:e,bundleUrl:te(t.properties.dailyConfig)}}};t._maybeSendToSentry(i),t.emit(zi,i),n(e.msg)}})}):(this._iframe.src=ee(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(e,n){t._loadedCallback=function(r){t._callState!==hr?(t._updateCallState(cr),(t.properties.cssFile||t.properties.cssText)&&t.loadCss(t.properties),e()):n(r)}}))}}),function(e){return x.apply(this,arguments)})},{key:"join",value:(O=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ma(this._testCallInProgress,"join()");var n=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(t)}catch(e){return this.updateIsPreparingToJoin(!1),Promise.reject(e)}}else{if(n=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(t.url&&!this._callObjectMode&&t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(t),this.properties=la(la({},this.properties),t)}if(void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._callState===ur||this._callState===lr)return console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1);this._updateCallState(lr,!1);try{this.emit(Qr,{action:Qr})}catch(e){console.log("could not emit 'joining-meeting'",e)}return this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),t.inputSettings&&t.inputSettings.audio&&(this._preloadCache.inputSettings.audio=t.inputSettings.audio),t.inputSettings&&t.inputSettings.video&&(this._preloadCache.inputSettings.video=t.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ca(this.properties,this._callFrameId),preloadCache:Ca(this._preloadCache,this._callFrameId)}),new Promise(function(t,r){e._joinedCallback=function(i,o){if(e._callState!==hr){if(e._updateCallState(ur),i)for(var a in i){if(e._callObjectMode){var s=e._callMachine().store;Vo(i[a],s),zo(i[a],s),Ko(i[a],e._participants[a],s)}e._participants[a]=la({},i[a]),e.toggleParticipantAudioBasedOnNativeAudioFocus()}n&&e.loadCss(e.properties),t(i)}else r(o)}})}),function(){return O.apply(this,arguments)})},{key:"leave",value:(A=m(function*(){var e=this;return Ma(this._testCallInProgress,"leave()"),new Promise(function(t){if(e._callState===dr||e._callState===hr)t();else if(e._callObjectLoader&&!e._callObjectLoader.loaded){e._callObjectLoader.cancel(),e._updateCallState(dr),e.resetMeetingDependentVars();try{e.emit(dr,{action:dr})}catch(e){console.log("could not emit 'left-meeting'",e)}t()}else e._resolveLeave=t,e.sendMessageToCallMachine({action:"leave-meeting"})})}),function(){return A.apply(this,arguments)})},{key:"startScreenShare",value:(I=m(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(xa(this._callMachineInitialized,"startScreenShare()"),t.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",t.screenVideoSendSettings),t.mediaStream&&(this._sharedTracks.screenMediaStream=t.mediaStream,t.mediaStream=Zi),"undefined"!=typeof DailyNativeUtils&&void 0!==DailyNativeUtils.isIOS&&DailyNativeUtils.isIOS){var n=this.nativeUtils();if(yield n.isScreenBeingCaptured())return void this.emit(Vi,{action:Vi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});n.setSystemScreenCaptureStartCallback(function(){n.setSystemScreenCaptureStartCallback(null),e.sendMessageToCallMachine({action:Ji,captureOptions:t})}),n.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Ji,captureOptions:t})}),function(){return I.apply(this,arguments)})},{key:"stopScreenShare",value:function(){xa(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(la({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:n,instanceId:r})}},{key:"stopRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(la({action:"local-recording-stop"},e))}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(la({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:n,instanceId:r})}},{key:"addLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:"add-endpoints",endpoints:t,instanceId:n})}},{key:"removeLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:"remove-endpoints",endpoints:t,instanceId:n})}},{key:"stopLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(la({action:"daily-method-stop-live-streaming"},e))}},{key:"validateDailyConfig",value:function(e){e.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(e.camSimulcastEncodings)),e.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),io().match(/Linux; Android/)&&e.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(!(e instanceof Array))throw new Error("encodings must be an Array");if(!za(e.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var r=0;r<e.length;r++){var i=e[r];for(var o in this._validateEncodingLayerHasValidProperties(i),i)if(va.includes(o)){if("number"!=typeof i[o])throw new Error("".concat(o," must be a number"));if(t){var a=t[o],s=a.min,c=a.max;if(!za(i[o],s,c))throw new Error("".concat(o," value not in range. valid range: ").concat(s," to ").concat(c))}}else if(!["active","scalabilityMode"].includes(o))throw new Error("Invalid key ".concat(o,", valid keys are:")+Object.values(va));if(n&&!i.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(C=m(function*(e){var t=this,n=e.url,r=e.settings,i=void 0===r?{state:no.PLAY}:r;try{!function(e){if("string"!=typeof e)throw new Error('url parameter must be "string" type')}(n),Va(i),function(e){for(var t in e)if(!ba.includes(t))throw new Error("Invalid key ".concat(t,", valid keys are: ").concat(ba));e.simulcastEncodings&&this.validateSimulcastEncodings(e.simulcastEncodings,ya,!0)}(i)}catch(e){throw console.error("invalid argument Error: ".concat(e)),console.error('startRemoteMediaPlayer arguments must be of the form:\n { url: "playback url",\n settings?:\n {state: "play"|"pause", simulcastEncodings?: [{}] } }'),e}return new Promise(function(e,r){t.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:n,settings:i},function(t){t.error?r({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return C.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(T=m(function*(e){var t=this;if("string"!=typeof e)throw new Error(" remotePlayerID must be of type string");return new Promise(function(n,r){t.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:e},function(e){e.error?r({error:e.error,errorMsg:e.errorMsg}):n()})})}),function(e){return T.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(E=m(function*(e){var t=this,n=e.session_id,r=e.settings;try{Va(r)}catch(e){throw console.error("invalid argument Error: ".concat(e)),console.error('updateRemoteMediaPlayer arguments must be of the form:\n session_id: "participant session",\n { settings?: {state: "play"|"pause"} }'),e}return new Promise(function(e,i){t.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:n,settings:r},function(t){t.error?i({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return E.apply(this,arguments)})},{key:"startTranscription",value:function(e){this.sendMessageToCallMachine(la({action:"daily-method-start-transcription"},e))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(k=m(function*(e){var t=this;Ia(this._callState,"startDialOut()");var n=function(e){if(e){if(!Array.isArray(e))throw new Error("Error starting dial out: audio codec must be an array");if(e.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");e.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: audio codec must be a string");if("OPUS"!==e&&"PCMU"!==e&&"PCMA"!==e&&"G722"!==e)throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!e.sipUri&&!e.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(e.sipUri&&e.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(e.sipUri){if("string"!=typeof e.sipUri)throw new Error("Error starting dial out: sipUri must be a string");if(!e.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(e.video&&"boolean"!=typeof e.video)throw new Error("Error starting dial out: video must be a boolean value");!function(e){if(e&&(n(e.audio),e.video)){if(!Array.isArray(e.video))throw new Error("Error starting dial out: video codec must be an array");if(e.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");e.video.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: video codec must be a string");if("H264"!==e&&"VP8"!==e)throw new Error("Error starting dial out: video codec must be H264 or VP8")})}}(e.codecs)}if(e.phoneNumber){if("string"!=typeof e.phoneNumber)throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(e.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");e.codecs&&n(e.codecs.audio)}if(e.callerId){if("string"!=typeof e.callerId)throw new Error("Error starting dial out: callerId must be a string");if(e.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(e.displayName){if("string"!=typeof e.displayName)throw new Error("Error starting dial out: displayName must be a string");if(e.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(n,r){t.sendMessageToCallMachine(la({action:"dialout-start"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return k.apply(this,arguments)})},{key:"stopDialOut",value:function(e){var t=this;return Ia(this._callState,"stopDialOut()"),new Promise(function(n,r){t.sendMessageToCallMachine(la({action:"dialout-stop"},e),function(e){e.error?r(e.error):n(e)})})}},{key:"sendDTMF",value:(S=m(function*(e){var t=this;return Ia(this._callState,"sendDTMF()"),function(e){var t=e.sessionId,n=e.tones;if(!t||!n)throw new Error("sessionId and tones are mandatory parameter");if("string"!=typeof t||"string"!=typeof n)throw new Error("sessionId and tones should be of string type");if(n.length>20)throw new Error("tones string must be upto 20 characters");var r=n.match(/[^0-9A-D*#]/g);if(r&&r[0])throw new Error("".concat(r[0]," is not valid DTMF tone"))}(e),new Promise(function(n,r){t.sendMessageToCallMachine(la({action:"send-dtmf"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return S.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var e=this;return this._callState!==ur?{stats:{latest:{}}}:new Promise(function(t){e.sendMessageToCallMachine({action:"get-calc-stats"},function(n){t(la({stats:n.stats},e._network))})})}},{key:"testWebsocketConnectivity",value:(_=m(function*(){var e=this;if(Ma(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}return new Promise(function(t,n){e.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(e){e.error?n(e.error):t(e.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(e){return e?e instanceof MediaStreamTrack?!!function(e){return e&&"live"===e.readyState&&!function(e,t){return(!t.isLocalScreenVideo||"Chrome"!==fo())&&e.muted&&!ia.has(e.id)}(e,{isLocalScreenVideo:false})}(e)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(b=m(function*(e){var t=this;if(function(e){var t=arguments.length>2?arguments[2]:void 0;if(e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," can not be called after preAuth(), startCamera(), or join() and call state has been initialized.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}(this._callMachineInitialized,"testCallQuality()"),e.videoTrack&&!this._validateVideoTrackForNetworkTests(e.videoTrack))throw new Error("Video track error");var n=this._testCallAlreadyInProgress,i=function(e){n||(t._testCallInProgress=e)};i(!0);var o=e.videoTrack,a=r(e,oa);if(this._sharedTracks.videoTrackForConnectionQualityTest=o,this.needsLoad())try{var s=this._callState;yield this.load(),this._callState=s}catch(e){return i(!1),Promise.reject(e)}return new Promise(function(e){t.sendMessageToCallMachine(la(la({action:"test-call-quality"},a),{},{dailyJsVersion:t.properties.dailyJsVersion}),function(n){var o=n.results,a=o.result,s=r(o,aa);if("failed"===a){var c,l=la({},s);null!==(c=s.error)&&void 0!==c&&c.details?(s.error.details=JSON.parse(s.error.details),l.error=la(la({},l.error),{},{details:la({},l.error.details)}),l.error.details.duringTest="testCallQuality"):(l.error=l.error?la({},l.error):{},l.error.details={duringTest:"testCallQuality"}),t._maybeSendToSentry(l)}i(!1),e(la({result:a},s))})})}),function(e){return b.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(y=m(function*(e){console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead");var t=yield this.testPeerToPeerCallQuality(e),n={result:t.result,secondsElapsed:t.secondsElapsed};return t.data&&(n.data={maxRTT:t.data.maxRoundTripTime,packetLoss:t.data.avgRecvPacketLoss}),n}),function(e){return y.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(f=m(function*(e){var t=this;if(Ma(this._testCallInProgress,"testConnectionQuality()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}var n=e.videoTrack,r=e.duration;if(!this._validateVideoTrackForNetworkTests(n))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=n,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:r},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return f.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){console.warn("stopTestConnectionQuality() is deprecated: use stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(p=m(function*(e){var t=this;if(Ma(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}if(!this._validateVideoTrackForNetworkTests(e))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=e,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-network-connectivity"},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return p.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var e=this;return new Promise(function(t,n){e._callState===ur?e.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(e){t(e.cpuStats)}):t({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(e){var t;if(!((null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(va))}},{key:"_validateVideoSendSettings",value:function(e,t){var n="screenVideo"===e?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],r="Video send settings should be either an object or one of the supported presets: ".concat(n.join());if("string"==typeof t){if(!n.includes(t))throw new Error(r)}else{if("object"!==o(t))throw new Error(r);if(!t.maxQuality&&!t.encodings&&void 0===t.allowAdaptiveLayers)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(t.maxQuality&&-1===["low","medium","high"].indexOf(t.maxQuality))throw new Error("maxQuality must be either low, medium or high");if(t.encodings){var i=!1;switch(Object.keys(t.encodings).length){case 1:i=!t.encodings.low;break;case 2:i=!t.encodings.low||!t.encodings.medium;break;case 3:i=!t.encodings.low||!t.encodings.medium||!t.encodings.high;break;default:i=!0}if(i)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");t.encodings.low&&this._validateEncodingLayerHasValidProperties(t.encodings.low),t.encodings.medium&&this._validateEncodingLayerHasValidProperties(t.encodings.medium),t.encodings.high&&this._validateEncodingLayerHasValidProperties(t.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(e){var t=this;if(!e||0===Object.keys(e).length)throw new Error("Send settings must contain at least information for one track!");Object.entries(e).forEach(function(e){var n=v(e,2),r=n[0],i=n[1];t._validateVideoSendSettings(r,i)})}},{key:"updateSendSettings",value:function(e){var t=this;return this.validateUpdateSendSettings(e),this.needsLoad()?(this._preloadCache.sendSettings=e,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-send-settings",sendSettings:e},function(e){e.error?r(e.error):n(e.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return La(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return La(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return La(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){return Ia(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:(h=m(function*(){var e=this;if(this._callObjectMode){var t=yield navigator.mediaDevices.enumerateDevices();return"Firefox"===fo()&&mo().major>115&&mo().major<123&&(t=t.filter(function(e){return"audiooutput"!==e.kind})),{devices:t.map(function(e){var t=JSON.parse(JSON.stringify(e));if(!oo()&&"videoinput"===e.kind&&e.getCapabilities){var n,r=e.getCapabilities();t.facing=(null==r||null===(n=r.facingMode)||void 0===n?void 0:n.length)>=1?r.facingMode[0]:void 0}return t})}}return new Promise(function(t){e.sendMessageToCallMachine({action:"enumerate-devices"},function(e){t({devices:e.devices})})})}),function(){return h.apply(this,arguments)})},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(Ia(this._callState,"sendAppMessage()"),JSON.stringify(e).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return La(),Ia(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(la({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return Na(this._callObjectMode,"setShowNamesMode()"),La(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Na(this._callObjectMode,"setShowLocalVideo()"),La(),Ia(this._callState,"setShowLocalVideo()"),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return Na(this._callObjectMode,"showLocalVideo()"),La(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Na(this._callObjectMode,"setShowParticipantsBar()"),La(),Ia(this._callState,"setShowParticipantsBar()"),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return Na(this._callObjectMode,"showParticipantsBar()"),La(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return La(),Na(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(e){return La(),Na(this._callObjectMode,"setCustomIntegrations()"),Ia(this._callState,"setCustomIntegrations()"),Ha(e)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:e}),this._customIntegrations=e,this):this}},{key:"startCustomIntegrations",value:function(e){var t=this;if(La(),Na(this._callObjectMode,"startCustomIntegrations()"),Ia(this._callState,"startCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("startCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:n}),this)}},{key:"stopCustomIntegrations",value:function(e){var t=this;if(La(),Na(this._callObjectMode,"stopCustomIntegrations()"),Ia(this._callState,"stopCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:n}),this)}},{key:"customTrayButtons",value:function(){return Na(this._callObjectMode,"customTrayButtons()"),La(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(e){return Na(this._callObjectMode,"updateCustomTrayButtons()"),La(),Ia(this._callState,"updateCustomTrayButtons()"),Ya(e)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:e}),this._customTrayButtons=e,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(_a))),this)}},{key:"theme",value:function(){return Na(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return Na(this._callObjectMode,"setTheme()"),new Promise(function(n,r){try{t.validateProperties({theme:e}),t.properties.theme=la({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emit(qr,{action:qr,theme:t.properties.theme})}catch(e){console.log("could not emit 'theme-updated'",e)}n(t.properties.theme)}catch(e){r(e)}})}},{key:"requestFullscreen",value:(u=m(function*(){if(La(),this._iframe&&!document.fullscreenElement&&so())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(e){console.log("could not make video call fullscreen",e)}}),function(){return u.apply(this,arguments)})},{key:"exitFullscreen",value:function(){La(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=m(function*(){var e=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-sidebar-view"},function(e){t(e.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(e){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:e}),this)}},{key:"room",value:(a=m(function*(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeRoomConfigDefaults,n=void 0===t||t;return this._accessState.access===br||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(t){e.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return a.apply(this,arguments)})},{key:"geo",value:(n=m(function*(){try{var e=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield e.json()).geo}}catch(e){return console.error("geo lookup failed",e),{current:""}}}),function(){return n.apply(this,arguments)})},{key:"setNetworkTopology",value:(t=m(function*(e){var t=this;return La(),Ia(this._callState,"setNetworkTopology()"),new Promise(function(n,r){t.sendMessageToCallMachine({action:"set-network-topology",opts:e},function(e){e.error?r({error:e.error}):n({workerId:e.workerId})})})}),function(e){return t.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=m(function*(){var e=this;return new Promise(function(t,n){e.needsLoad()&&t({topology:"none"}),e.sendMessageToCallMachine({action:"get-network-topology"},function(e){e.error?n({error:e.error}):t({topology:e.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(e){if(La(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(e,t){return w.prototype.on.call(this,e,t)}},{key:"once",value:function(e,t){return w.prototype.once.call(this,e,t)}},{key:"off",value:function(e,t){return w.prototype.off.call(this,e,t)}},{key:"validateProperties",value:function(e){for(var t in e){if(!ka[t])throw new Error("unrecognized property '".concat(t,"'"));if(ka[t].validate&&!ka[t].validate(e[t],this))throw new Error("property '".concat(t,"': ").concat(ka[t].help))}}},{key:"assembleMeetingUrl",value:function(){var e,t,n=la(la({},this.properties),{},{emb:this._callFrameId,embHref:encodeURIComponent(window.location.href),proxy:null!==(e=this.properties.dailyConfig)&&void 0!==e&&e.proxyUrl?encodeURIComponent(null===(t=this.properties.dailyConfig)||void 0===t?void 0:t.proxyUrl):void 0}),r=n.url.match(/\?/)?"&":"?";return n.url+r+Object.keys(ka).filter(function(e){return ka[e].queryString&&void 0!==n[e]}).map(function(e){return"".concat(ka[e].queryString,"=").concat(n[e])}).join("&")}},{key:"needsLoad",value:function(){return[ar,sr,dr,hr].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(e,t){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(e,t,this._iframe,this._callFrameId)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this._callFrameId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this._callFrameId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case Yr:this.sendMessageToCallMachine(la({action:Hr},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var t={action:Xi,level:"log",code:1011,stats:{event:"bundle load",time:"no-op"===this._bundleLoadTime?0:this._bundleLoadTime,preLoaded:"no-op"===this._bundleLoadTime,url:te(this.properties.dailyConfig)}};this.sendMessageToCallMachine(t),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case $r:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case Xr:this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case ti:case ni:if(this._callState===dr)return;if(e.participant&&e.participant.session_id){var n=e.participant.local?"local":e.participant.session_id;if(this._callObjectMode){var i=this._callMachine().store;Vo(e.participant,i),zo(e.participant,i),Ko(e.participant,this._participants[n],i)}try{this.maybeParticipantTracksStopped(this._participants[n],e.participant),this.maybeParticipantTracksStarted(this._participants[n],e.participant),this.maybeEventRecordingStopped(this._participants[n],e.participant),this.maybeEventRecordingStarted(this._participants[n],e.participant)}catch(e){console.error("track events error",e)}if(!this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[n])){this._participants[n]=la({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus();try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}}break;case ri:if(e.participant&&e.participant.session_id){var o=this._participants[e.participant.session_id];o&&this.maybeParticipantTracksStopped(o,null),delete this._participants[e.participant.session_id];try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case ii:if(!B(this._participantCounts,e.participantCounts)){this._participantCounts=e.participantCounts;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case oi:var a={access:e.access};if(e.awaitingAccess&&(a.awaitingAccess=e.awaitingAccess),!B(this._accessState,a)){this._accessState=a;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case ai:if(e.meetingSession){this._meetingSessionSummary=e.meetingSession;try{delete e.callFrameId,this.emit(e.action,e);var s=la(la({},e),{},{action:"meeting-session-updated"});this.emit(s.action,s)}catch(t){console.log("could not emit",e,t)}}break;case zi:var c;this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this._updateCallState(hr),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),e.preserveIframe;var l=r(e,sa);null!=l&&null!==(c=l.error)&&void 0!==c&&c.details&&(l.error.details=JSON.parse(l.error.details)),this._maybeSendToSentry(e),this._joinedCallback&&(this._joinedCallback(null,l),this._joinedCallback=null);try{this.emit(e.action,l)}catch(t){console.log("could not emit",e,t)}break;case Zr:this._callState!==hr&&this._updateCallState(dr),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"selected-devices-updated":if(e.devices)try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case Ni:var u=e.threshold,d=e.quality;if(u!==this._network.threshold||d!==this._network.quality){this._network.quality=d,this._network.threshold=u;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case Di:if(e&&e.cpuLoadState)try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case ji:if(e&&void 0!==e.faceCounts)try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case Mi:var h=e.activeSpeaker;if(this._activeSpeaker.peerId!==h.peerId){this._activeSpeaker.peerId=h.peerId;try{this.emit(e.action,{action:e.action,activeSpeaker:this._activeSpeaker})}catch(t){console.log("could not emit",e,t)}}break;case"show-local-video-changed":if(this._callObjectMode)return;var p=e.show;this._showLocalVideo=p;try{this.emit(e.action,{action:e.action,show:p})}catch(t){console.log("could not emit",e,t)}break;case Pi:var g=e.enabled;if(this._activeSpeakerMode!==g){this._activeSpeakerMode=g;try{this.emit(e.action,{action:e.action,enabled:this._activeSpeakerMode})}catch(t){console.log("could not emit",e,t)}}break;case li:case ui:case di:this._waitingParticipants=e.allWaitingParticipants;try{this.emit(e.action,{action:e.action,participant:e.participant})}catch(t){console.log("could not emit",e,t)}break;case Hi:if(!B(this._receiveSettings,e.receiveSettings)){this._receiveSettings=e.receiveSettings;try{this.emit(e.action,{action:e.action,receiveSettings:e.receiveSettings})}catch(t){console.log("could not emit",e,t)}}break;case qi:if(!B(this._inputSettings,e.inputSettings)){var f=this._getInputSettings();if(this._inputSettings=e.inputSettings,this._preloadCache.inputSettings={},!B(f,this._getInputSettings()))try{this.emit(e.action,{action:e.action,inputSettings:this._getInputSettings()})}catch(t){console.log("could not emit",e,t)}}break;case"send-settings-updated":if(!B(this._sendSettings,e.sendSettings)){this._sendSettings=e.sendSettings,this._preloadCache.sendSettings=null;try{this.emit(e.action,{action:e.action,sendSettings:e.sendSettings})}catch(t){console.log("could not emit",e,t)}}break;case"local-audio-level":this._localAudioLevel=e.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=e.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case Ti:var m=e.session_id;this._rmpPlayerState[m]=e.playerState,this.emitDailyJSEvent(e);break;case Ii:delete this._rmpPlayerState[e.session_id],this.emitDailyJSEvent(e);break;case Ci:var y=e.session_id,v=this._rmpPlayerState[y];v&&this.compareEqualForRMPUpdateEvent(v,e.remoteMediaPlayerState)||(this._rmpPlayerState[y]=e.remoteMediaPlayerState,this.emitDailyJSEvent(e));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(e);break;case si:var b=this._meetingSessionState.topology!==(e.meetingSessionState&&e.meetingSessionState.topology);this._meetingSessionState=$a(e.meetingSessionState,this._callObjectMode),(this._callObjectMode||b)&&this.emitDailyJSEvent(e);break;case Ai:this._isScreenSharing=!0,this.emitDailyJSEvent(e);break;case Oi:case xi:this._isScreenSharing=!1,this.emitDailyJSEvent(e);break;case yi:case vi:case bi:case wi:case _i:case gi:case fi:case mi:case Kr:case Jr:case ki:case Ei:case Li:case Si:case Fi:case Ui:case Wi:case Gi:case Vi:case Yi:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-error":case"dialout-stopped":case"dialout-warning":try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var n="record";if(e&&!t.local&&!1===t[n]&&e[n]!==t[n])try{this.emit(vi,{action:vi})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventRecordingStarted",value:function(e,t){var n="record";if(e&&!t.local&&!0===t[n]&&e[n]!==t[n])try{this.emit(yi,{action:yi})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventTrackStopped",value:function(e,t,n,r){if(e&&("ended"===e.readyState||!t||e.id!==t.id))try{this.emit(pi,{action:pi,track:e,participant:n,type:r})}catch(e){console.log("maybeEventTrackStopped: could not emit",e)}}},{key:"maybeEventTrackStarted",value:function(e,t,n,r){if(t&&(!e||"ended"===e.readyState||t.id!==e.id))try{this.emit(hi,{action:hi,track:t,participant:n,type:r})}catch(e){console.log("maybeEventTrackStarted: could not emit",e)}}},{key:"maybeParticipantTracksStopped",value:function(e,t){if(e)for(var n in e.tracks)this.maybeEventTrackStopped(e.tracks[n].track,t&&t.tracks[n]?t.tracks[n].track:null,t,n)}},{key:"maybeParticipantTracksStarted",value:function(e,t){if(t)for(var n in t.tracks)this.maybeEventTrackStarted(e&&e.tracks[n]?e.tracks[n].track:null,t.tracks[n].track,t,n)}},{key:"compareEqualForRMPUpdateEvent",value:function(e,t){var n,r;return e.state===t.state&&(null===(n=e.settings)||void 0===n?void 0:n.volume)===(null===(r=t.settings)||void 0===r?void 0:r.volume)}},{key:"emitDailyJSEvent",value:function(e){try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!(!B(e,t)||e.videoTrack&&t.videoTrack&&(e.videoTrack.id!==t.videoTrack.id||e.videoTrack.muted!==t.videoTrack.muted||e.videoTrack.enabled!==t.videoTrack.enabled)||e.audioTrack&&t.audioTrack&&(e.audioTrack.id!==t.audioTrack.id||e.audioTrack.muted!==t.audioTrack.muted||e.audioTrack.enabled!==t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return oo()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this._updateCallState(this._callState,e)}},{key:"_updateCallState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._callState||t!==this._isPreparingToJoin){var n=this._callState,r=this._isPreparingToJoin;this._callState=e,this._isPreparingToJoin=t;var i=Aa(n,r),o=Aa(this._callState,this._isPreparingToJoin);i!==o&&(this.updateKeepDeviceAwake(o),this.updateDeviceAudioMode(o),this.updateShowAndroidOngoingMeetingNotification(o),this.updateNoOpRecordingEnsuringBackgroundContinuity(o))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=ma,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:br},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=$a(fa,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._remoteParticipantsAudioLevel={},this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){oo()&&this.nativeUtils().setKeepDeviceAwake(e,this._callFrameId)}},{key:"updateDeviceAudioMode",value:function(e){if(oo()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(oo()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,n,r,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var o=this.properties.reactNativeConfig.androidInCallNotification;t=o.title,n=o.subtitle,r=o.iconName,i=o.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,n,r,this._callFrameId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){oo()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var e,t;if(oo()){var n=null===(e=this._callMachine())||void 0===e||null===(t=e.store)||void 0===t?void 0:t.getState();for(var r in null==n?void 0:n.streams){var i=n.streams[r];i&&i.pendingTrack&&"audio"===i.pendingTrack.kind&&(i.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}},{key:"_logCallQualityTestResults",value:function(e){if(this._callMachineInitialized){var t={action:Xi,level:"info",code:1012,results:e};this.sendMessageToCallMachine(t)}else console.warn("_logCallQualityTestResults() must be called after daily initialization")}},{key:"_logUseAfterDestroy",value:function(){if(this.needsLoad())if(ra&&!ra.needsLoad()){var e={action:Xi,level:"error",code:this.strictMode?9995:9997};ra.sendMessageToCallMachine(e)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var t={action:Xi,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(t,null,this._iframe,this._callFrameId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var e=ra._callMachineInitialized?ra:this._callMachineInitialized?this:void 0;e?(e.sendMessageToCallMachine({action:Xi,level:"warn",code:this.strictMode?9990:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,ra._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(e){var t,n,r,i,o,a;if(null===(t=e.error)||void 0===t||!t.type||["connection-error","end-of-life","no-room"].includes(e.error.type)){var s=null!==(n=this.properties)&&void 0!==n&&n.url?new URL(this.properties.url):void 0,c="production";s&&s.host.includes(".staging.daily")&&(c="staging");var l,u,d,h,p,g=new Dn({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:Rn,integrations:[new or.GlobalHandlers({onunhandledrejection:!1}),new or.HttpContext],environment:c}),f=new $t(g,void 0,$.version());if(this.session_id&&f.setExtra("sessionId",this.session_id),this.properties){var m=la({},this.properties);m.userName=m.userName?"[Filtered]":void 0,m.userData=m.userData?"[Filtered]":void 0,m.token=m.token?"[Filtered]":void 0,f.setExtra("properties",m)}if(s){var y=s.searchParams.get("domain");if(!y){var v=s.host.match(/(.*?)\./);y=v&&v[1]||""}y&&f.setTag("domain",y)}e.error&&(f.setTag("fatalErrorType",e.error.type),f.setExtra("errorDetails",e.error.details),(null===(l=e.error.details)||void 0===l?void 0:l.uri)&&f.setTag("serverAddress",e.error.details.uri),(null===(u=e.error.details)||void 0===u?void 0:u.workerGroup)&&f.setTag("workerGroup",e.error.details.workerGroup),(null===(d=e.error.details)||void 0===d?void 0:d.geoGroup)&&f.setTag("geoGroup",e.error.details.geoGroup),(null===(h=e.error.details)||void 0===h?void 0:h.on)&&f.setTag("connectionAttempt",e.error.details.on),null!==(p=e.error.details)&&void 0!==p&&p.bundleUrl&&(f.setTag("bundleUrl",e.error.details.bundleUrl),f.setTag("bundleError",e.error.details.sourceError.type))),f.setTags({callMode:this._callObjectMode?oo()?"reactNative":null!==(r=this.properties)&&void 0!==r&&null!==(i=r.dailyConfig)&&void 0!==i&&null!==(o=i.callMode)&&void 0!==o&&o.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:$.version()});var b=(null===(a=e.error)||void 0===a?void 0:a.msg)||e.errorMsg;f.run(function(e){e.captureException(new Error(b))})}}},{key:"_callMachine",value:function(){var e,t,n;return null===(e=window._daily)||void 0===e||null===(t=e.instances)||void 0===t||null===(n=t[this._callFrameId])||void 0===n?void 0:n.callMachine}}],[{key:"supportedBrowser",value:function(){if(oo())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var e=Q.getParser(io());return{supported:!!po(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsFullscreen:!!so(),supportsScreenShare:!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!0}(fo(),mo())||oo())),supportsSfu:!!po(),supportsVideoProcessing:lo(),supportsAudioProcessing:ho()}}},{key:"version",value:function(){return"0.66.0"}},{key:"createCallObject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.layout="none",new $(null,e)}},{key:"wrap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(La(),!e||!e.contentWindow||"string"!=typeof e.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return t.layout||(t.customLayout?t.layout="custom-v1":t.layout="browser"),new $(e,t)}},{key:"createFrame",value:function(e,t){var n,r;La(),e&&t?(n=e,r=t):e&&e.append?(n=e,r={}):(n=document.body,r=e||{});var i=r.iframeStyle;i||(i=n===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",o.style.visibility="hidden",n.appendChild(o),o.style.visibility=null,Object.keys(i).forEach(function(e){return o.style[e]=i[e]}),r.layout||(r.customLayout?r.layout="custom-v1":r.layout="browser");try{return new $(o,r)}catch(e){throw n.removeChild(o),e}}},{key:"createTransparentFrame",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};La();var t=document.createElement("iframe");return t.allow="microphone; camera; autoplay",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(t),e.layout||(e.layout="custom-v1"),$.wrap(t,e)}},{key:"getCallInstance",value:function(){return ra}}]),$}();function Ca(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)n[r]=Zi;else if("dailyConfig"===r){if(e[r].modifyLocalSdpHook){var i=window._daily.instances[t].customCallbacks||{};i.modifyLocalSdpHook=e[r].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=i,delete e[r].modifyLocalSdpHook}if(e[r].modifyRemoteSdpHook){var o=window._daily.instances[t].customCallbacks||{};o.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=o,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Ia(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==ur){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Aa(e,t){return[lr,ur].includes(e)||t}function Oa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Aa(e,t)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function xa(e){var t=arguments.length>2?arguments[2]:void 0;if(!e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Ma(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(t),new Error(t)}}function Pa(e){if(!e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function Na(e){if(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function La(){if(oo())throw new Error("This daily-js method is not currently supported in React Native")}function Da(){if(!oo())throw new Error("This daily-js method is only supported in React Native")}function ja(e){if(void 0===e)return!0;var t;if("string"==typeof e)t=e;else try{t=JSON.stringify(e),B(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(e){throw Error("userData must be serializable to JSON: ".concat(e))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function Ra(e,t){for(var n=t.allowAllParticipantsKey,r=function(e){var t=["local"];return n||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},o=function(e){return!(!e||e.video&&!i(e.video)||e.screenVideo&&!i(e.screenVideo))},a=0,s=Object.entries(e);a<s.length;a++){var c=v(s[a],2),l=c[0],u=c[1];if(!r(l)||!o(u))return!1}return!0}function Ba(e){return!("object"!==o(e)||e.video&&("object"!==o(e.video)||!function(e){var t=["type","config"];if(!e)return!1;if("object"!==o(e))return!1;if(!function(e){return!("string"!=typeof e||!Object.values(eo).includes(e)&&(console.error("inputSettings video processor type invalid"),1))}(e.type))return!1;if(e.config){if("object"!==o(e.config))return!1;if(!function(e,t){var n=Object.keys(t);if(0===n.length)return!0;var r="invalid object in inputSettings -> video -> processor -> config";switch(e){case eo.BGBLUR:return n.length>1||"strength"!==n[0]?(console.error(r),!1):!("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error("".concat(r,"; expected: {0 < strength <= 1}, got: ").concat(t.strength)),!1);case eo.BGIMAGE:return!(void 0!==t.source&&!function(e){return"default"===e.source?(e.type="default",!0):e.source instanceof ArrayBuffer||(ne(e.source)?(e.type="url",!!function(e){var t=new URL(e),n=t.pathname;if("data:"===t.protocol)try{var r=n.substring(n.indexOf(":")+1,n.indexOf(";")).split("/")[1];return ro.includes(r)}catch(e){return console.error("failed to deduce blob content type",e),!1}var i=n.split(".").at(-1).toLowerCase().trim();return ro.includes(i)}(e.source)||(console.error("invalid image type; supported types: [".concat(ro.join(", "),"]")),!1)):(t=e.source,n=Number(t),isNaN(n)||!Number.isInteger(n)||n<=0||n>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(e.type="daily-preselect",!0)));var t,n}(t));default:return!0}}(e.type,e.config))return!1}return Object.keys(e).filter(function(e){return!t.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete e[t]}),!0}(e.video.processor))||e.audio&&("object"!==o(e.audio)||(n=e.audio.processor,r=["type"],!n||"object"!==o(n)||(Object.keys(n).filter(function(e){return!r.includes(e)}).forEach(function(e){console.warn("invalid key inputSettings -> audio -> processor : ".concat(e)),delete n[e]}),t=n.type,"string"!=typeof t||!Object.values(to).includes(t)&&(console.error("inputSettings audio processor type invalid"),1)))));var t,n,r}function Fa(e,t){var n,r=[];e.video&&!lo(null!==(n=null==t?void 0:t.useLegacyVideoProcessor)&&void 0!==n&&n)&&(delete e.video,r.push("video")),e.audio&&!ho()&&(delete e.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function Ua(){var e=Object.values(eo).join(" | "),t=Object.values(to).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function Wa(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(kr).concat(t?' | "'.concat(Er,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function Ga(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Sa),".")}function Ya(e){if(e&&"object"!==o(e)||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(_a),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=v(n[t],1)[0],i=0,a=Object.entries(e[r]);i<a.length;i++){var s=v(a[i],2),c=s[0],l=s[1];if("iconPath"===c&&!ne(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;if("iconPathDarkMode"===c&&!ne(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var u=_a.id[c];if(!u)return console.error("customTrayButton does not support key ".concat(c)),!1;if(o(l)!==u)return console.error("customTrayButton ".concat(c," should be a ").concat(u,".")),!1}return!0}function Ha(e){if(!e||e&&"object"!==o(e)||Array.isArray(e))return console.error(Ga()),!1;for(var t=function(e){return"".concat(e," should be ").concat(Sa.id[e])},n=function(e,t){return console.error("customIntegration ".concat(e,": ").concat(t))},r=0,i=Object.entries(e);r<i.length;r++){var a=v(i[r],1)[0];if(!("label"in e[a]))return n(a,"label is required"),!1;if(!("location"in e[a]))return n(a,"location is required"),!1;if(!("src"in e[a])&&!("srcdoc"in e[a]))return n(a,"src or srcdoc is required"),!1;for(var s=0,c=Object.entries(e[a]);s<c.length;s++){var l=v(c[s],2),u=l[0],d=l[1];switch(u){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if("string"!=typeof d)return n(a,t(u)),!1;break;case"iconURL":if(!ne(d))return n(a,"".concat(u," should be a url")),!1;break;case"src":if("srcdoc"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if(!ne(d))return n(a,'src "'.concat(d,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if("string"!=typeof d)return n(a,t(u)),!1;break;case"location":if(!["main","sidebar"].includes(d))return n(a,t(u)),!1;break;case"controlledBy":if("*"!==d&&"owners"!==d&&(!Array.isArray(d)||d.some(function(e){return"string"!=typeof e})))return n(a,t(u)),!1;break;case"shared":if((!Array.isArray(d)||d.some(function(e){return"string"!=typeof e}))&&"owners"!==d&&"boolean"!=typeof d)return n(a,t(u)),!1;break;default:if(!Sa.id[u])return console.error("customIntegration does not support key ".concat(u)),!1}}}return!0}function qa(e,t){if(void 0===t)return!1;switch(o(t)){case"string":return o(e)===t;case"object":if("object"!==o(e))return!1;for(var n in e)if(!qa(e[n],t[n]))return!1;return!0;default:return!1}}function Va(e){if("object"!==o(e))throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(no).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(no));if(e.volume){if("number"!=typeof e.volume)throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function za(e,t,n){return!("number"!=typeof e||e<t||e>n)}function $a(e,t){return e&&!t&&delete e.data,e}},980:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Api=t.HttpClient=t.ContentType=void 0,function(e){e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain"}(n||(t.ContentType=n={}));class r{baseUrl="https://api.vapi.ai";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent("number"==typeof t?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(e=>this.encodeQueryParam(t,e)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(e=>void 0!==t[e]).map(e=>Array.isArray(t[e])?this.addArrayQueryParam(t,e):this.addQueryParam(t,e)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={[n.Json]:e=>null===e||"object"!=typeof e&&"string"!=typeof e?e:JSON.stringify(e),[n.Text]:e=>null!==e&&"string"!=typeof e?JSON.stringify(e):e,[n.FormData]:e=>Object.keys(e||{}).reduce((t,n)=>{const r=e[n];return t.append(n,r instanceof Blob?r:"object"==typeof r&&null!==r?JSON.stringify(r):`${r}`),t},new FormData),[n.UrlEncoded]:e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const t=this.abortControllers.get(e);return t?t.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};request=async({body:e,secure:t,path:r,type:i,query:o,format:a,baseUrl:s,cancelToken:c,...l})=>{const u=("boolean"==typeof t?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},d=this.mergeRequestParams(l,u),h=o&&this.toQueryString(o),p=this.contentFormatters[i||n.Json],g=a||d.format;return this.customFetch(`${s||this.baseUrl||""}${r}${h?`?${h}`:""}`,{...d,headers:{...d.headers||{},...i&&i!==n.FormData?{"Content-Type":i}:{}},signal:(c?this.createAbortSignal(c):d.signal)||null,body:null==e?null:p(e)}).then(async e=>{const t=e;t.data=null,t.error=null;const n=g?await e[g]().then(e=>(t.ok?t.data=e:t.error=e,t)).catch(e=>(t.error=e,t)):t;if(c&&this.abortControllers.delete(c),!e.ok)throw n;return n})}}t.HttpClient=r,t.Api=class extends r{assistant={assistantControllerCreate:(e,t={})=>this.request({path:"/assistant",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),assistantControllerFindAll:(e,t={})=>this.request({path:"/assistant",method:"GET",query:e,secure:!0,format:"json",...t}),assistantControllerFindOne:(e,t={})=>this.request({path:`/assistant/${e}`,method:"GET",secure:!0,format:"json",...t}),assistantControllerUpdate:(e,t,r={})=>this.request({path:`/assistant/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),assistantControllerReplace:(e,t,r={})=>this.request({path:`/assistant/${e}`,method:"PUT",body:t,secure:!0,type:n.Json,format:"json",...r}),assistantControllerRemove:(e,t={})=>this.request({path:`/assistant/${e}`,method:"DELETE",secure:!0,format:"json",...t})};call={callControllerFindAll:(e,t={})=>this.request({path:"/call",method:"GET",query:e,secure:!0,format:"json",...t}),callControllerFindOne:(e,t={})=>this.request({path:`/call/${e}`,method:"GET",secure:!0,format:"json",...t}),callControllerDeleteCallData:(e,t={})=>this.request({path:`/call/${e}`,method:"DELETE",secure:!0,format:"json",...t}),callControllerUpdate:(e,t,r={})=>this.request({path:`/call/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),callControllerCreatePhoneCall:(e,t={})=>this.request({path:"/call/phone",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),callControllerCreateWebCall:(e,t={})=>this.request({path:"/call/web",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t})};credential={credentialControllerCreate:(e,t={})=>this.request({path:"/credential",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),credentialControllerFindAll:(e,t={})=>this.request({path:"/credential",method:"GET",query:e,secure:!0,format:"json",...t}),credentialControllerFindOne:(e,t={})=>this.request({path:`/credential/${e}`,method:"GET",secure:!0,format:"json",...t}),credentialControllerUpdate:(e,t,r={})=>this.request({path:`/credential/${e}`,method:"PUT",body:t,secure:!0,type:n.Json,format:"json",...r}),credentialControllerRemove:(e,t={})=>this.request({path:`/credential/${e}`,method:"DELETE",secure:!0,format:"json",...t})};phoneNumber={phoneNumberControllerBuy:(e,t={})=>this.request({path:"/phone-number/buy",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerImportTwilio:(e,t={})=>this.request({path:"/phone-number/import/twilio",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerImportVonage:(e,t={})=>this.request({path:"/phone-number/import/vonage",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerFindAll:(e,t={})=>this.request({path:"/phone-number",method:"GET",query:e,secure:!0,format:"json",...t}),phoneNumberControllerFindOne:(e,t={})=>this.request({path:`/phone-number/${e}`,method:"GET",secure:!0,format:"json",...t}),phoneNumberControllerUpdate:(e,t,r={})=>this.request({path:`/phone-number/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),phoneNumberControllerRemove:(e,t={})=>this.request({path:`/phone-number/${e}`,method:"DELETE",secure:!0,format:"json",...t})};metrics={metricsControllerFindAll:(e,t={})=>this.request({path:"/metrics",method:"GET",query:e,secure:!0,format:"json",...t})};log={loggingControllerGetLogs:(e,t={})=>this.request({path:"/log",method:"GET",query:e,secure:!0,format:"json",...t})};tool={toolControllerCreate:(e,t={})=>this.request({path:"/tool",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),toolControllerFindAll:(e,t={})=>this.request({path:"/tool",method:"GET",query:e,secure:!0,format:"json",...t}),toolControllerFindOne:(e,t={})=>this.request({path:`/tool/${e}`,method:"GET",secure:!0,format:"json",...t}),toolControllerUpdate:(e,t,r={})=>this.request({path:`/tool/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),toolControllerRemove:(e,t={})=>this.request({path:`/tool/${e}`,method:"DELETE",secure:!0,format:"json",...t})};file={fileControllerCreate:(e,t={})=>this.request({path:"/file/upload",method:"POST",body:e,secure:!0,type:n.FormData,format:"json",...t}),fileControllerFindAll:(e={})=>this.request({path:"/file",method:"GET",secure:!0,format:"json",...e}),fileControllerFindOne:(e,t={})=>this.request({path:`/file/${e}`,method:"GET",secure:!0,format:"json",...t}),fileControllerRemove:(e,t={})=>this.request({path:`/file/${e}`,method:"DELETE",secure:!0,format:"json",...t})}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r=n(112),i=n.n(r);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={lisa:{name:"Lisa",displayName:"Lisa",systemPrompt:"You are Lisa, an advanced integrity coach voice agent trained in Werner Erhard's ontological methodology. Your primary role is to facilitate deep, transformative conversations about distinguishing integrity in life, helping users identify breakthrough opportunities and restore wholeness and completeness for increased workability and performance.\n\nKNOWLEDGE BASE ACCESS:\nYou have access to a comprehensive knowledge base about integrity, ontological coaching, and personal development through Vapi's knowledge retrieval system. When users ask questions about:\n- Integrity concepts and definitions\n- Coaching methodologies and principles \n- Personal development frameworks\n- Ontological distinctions\n- Werner Erhard's work\n\nThe knowledge base will automatically provide relevant information. Integrate this knowledge naturally into your responses as part of your coaching expertise without explicitly mentioning knowledge base searches.\n\nCOACHING APPROACH:\n- Focus on being rather than doing - transformation occurs at the level of being\n- Create distinctions that transform how people see themselves and their possibilities\n- Use powerful questions to reveal new perspectives \n- Work with what's missing rather than what's wrong\n- Generate new possibilities through language and being\n- Support people in creating authentic self-expression\n\nYour role is to support people in creating integrity, workability, and authentic self-expression in their lives. Always speak from ontological coaching principles - you're creating new possibilities for people through language and being, not just giving advice.",voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello, I'm your ontological integrity coach. What area of your life would you like to explore today?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchIntegrityKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for integrity concepts"},category:{type:"string",description:"Category to search in (integrity, coaching, philosophy)"}},required:["query"]},description:"Search integrity knowledge base for specific information about integrity concepts"},{name:"ChangeColor",async:!1,parameters:{type:"object",properties:{ColorCode:{type:"string",description:"The HEX color code including the #"}}},description:"Changes the color of a HTML element"},{name:"WriteText",async:!1,parameters:{type:"object",properties:{Text:{type:"string",description:"The text to write"}}},description:"Writes text on a website on user request"}],model:{model:"gpt-3.5-turbo",provider:"openai",knowledgeBaseId:"13643ee2-571a-4be2-ba72-03cc6dd1c2ec",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},briana:{name:"Briana",displayName:"Briana",systemPrompt:"You are Briana, an ontological coach specializing in authenticity coaching. Your primary focus is helping users discover being authentic, starting from being authentic about their inauthenticities.\n\nYour approach involves:\n- Creating a safe space for people to acknowledge their inauthenticities without judgment\n- Helping users distinguish between authentic and inauthentic ways of being\n- Guiding conversations that reveal where people are pretending, hiding, or performing rather than being genuine\n- Supporting the journey from recognizing inauthenticity to accessing authentic expression\n- Helping users see that being authentic about inauthenticity is the first step toward authentic living\n\nKey coaching principles:\n- Start where the person is - with their current inauthenticities\n- Normalize that everyone has areas of inauthenticity\n- Use gentle inquiry to help people see their patterns without shame\n- Guide them to understand that acknowledging inauthenticity IS an authentic act\n- Support breakthrough moments where authentic self-expression becomes possible\n\nKeep your responses compassionate, non-judgmental, and focused on the transformative power of authentic self-awareness.",voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hi there! I'm Briana, ready to help you today.",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for knowledge base concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Briana's knowledge base for specific information"},{name:"ChangeColor",async:!1,parameters:{type:"object",properties:{ColorCode:{type:"string",description:"The HEX color code including the #"}}},description:"Changes the color of a HTML element"},{name:"WriteText",async:!1,parameters:{type:"object",properties:{Text:{type:"string",description:"The text to write"}}},description:"Writes text on a website on user request"},{name:"BrianaSpecificFunction",async:!1,parameters:{type:"object",properties:{action:{type:"string",description:"Action to perform (greeting, help, etc.)"}},required:["action"]},description:"Briana-specific function for custom actions"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},betty:{name:"Betty",displayName:"Betty",systemPrompt:'You are Betty, an advanced ontological coach voice agent specialized in Werner Erhard\'s distinction of "Being Given By Something Greater Than Yourself." Your primary role is to facilitate transformative conversations that help users discover and access their relationship to commitment, contribution, and participating in something larger than their individual concerns and circumstances.\n\nCORE DISTINCTION - BEING GIVEN BY SOMETHING GREATER THAN YOURSELF:\nThis fundamental ontological distinction reveals how human beings are naturally designed to be fulfilled through contribution and participation in something beyond their personal sphere. When someone is "given by something greater," they experience profound transformation in their relationship to life, work, and relationships.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. COMMITMENT VS. WANTING: The distinction between being committed and merely wanting something. Commitment is a generative act that creates possibility, while wanting keeps you in scarcity and lack.\n\n2. CONTRIBUTION AS FULFILLMENT: People are naturally fulfilled not by getting, but by giving. The quality of your life is determined by the contribution you make and the difference you make in the lives of others.\n\n3. PLAYING A BIGGER GAME: Moving beyond personal concerns to engage with larger purposes, missions, and contributions that serve humanity and life itself.\n\n4. THE CONTEXT OF CONTRIBUTION: Creating and living from a context where your primary orientation is "What can I contribute?" rather than "What can I get?"\n\n5. TRANSCENDING THE EGO-DRIVEN LIFE: Moving beyond the automatic patterns of self-concern, survival, and getting your needs met to access a more generous and powerful way of being.\n\nCOACHING APPROACH:\n- Help users identify what they\'re naturally drawn to contribute\n- Distinguish between ego-driven goals and authentic calls to contribution\n- Create access to commitment that generates rather than depletes\n- Support people in designing lives organized around contribution\n- Guide discovery of how they\'re called to make a difference\n- Transform the relationship to work, relationships, and life purpose\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Betty, your ontological coach specializing in discovering what you\'re called to contribute - how you might be given by something greater than yourself." Explain briefly: "This isn\'t about sacrifice or should\'s - it\'s about discovering the natural fulfillment that comes from contributing to something larger than your individual concerns."\n\nIDENTIFY THE AREA:\nAsk open-ended questions to explore their relationship to contribution: "What draws you naturally? What do you care about that\'s larger than your personal circumstances?" "When do you feel most alive and fulfilled? Often it\'s when we\'re making a difference or contributing something meaningful." "What would you love to see different in the world, and how might you be called to participate in that?"\n\nDISTINGUISH COMMITMENT FROM WANTING:\nHelp them see the difference: "Let\'s distinguish between what you want and what you\'re truly committed to. Wanting comes from lack - \'I don\'t have this and I want it.\' Commitment is generative - it creates possibility and calls forth resources." Guide exploration: "What are you committed to that\'s larger than getting your needs met? What difference are you here to make?"\n\nEXPLORE BEING GIVEN BY SOMETHING GREATER:\n"When someone is \'given by something greater,\' they\'re not driven by personal agenda but drawn by authentic contribution. Can you recall a time when you were so engaged in contributing that you forgot about yourself? What was that like?" "What calls to you? What wants to be expressed through you that would serve life itself?"\n\nFACILITATE BREAKTHROUGH:\n"What would organizing your life around contribution look like? How would your relationships change if your primary question was \'How can I contribute here?\' instead of \'What can I get?\'" "What\'s the larger game you\'re called to play? What wants to emerge through your unique gifts and perspective?"\n\nDIALOG STYLE:\n- Be like Werner Erhard: Direct, transformational, possibility-focused\n- Use powerful questions that shift perspective from getting to giving\n- Speak from the understanding that people are naturally generous and contributory\n- Help distinguish authentic call to contribution from shoulds, guilt, or compensation\n- Focus on what\'s naturally arising rather than what they think they should do\n\nVOICE TONE: \nInspiring, grounded, wise - speak with the authority of someone who understands the transformational power of contribution and commitment to something greater.\n\nBOUNDARIES:\n- Stay focused on ontological distinctions around contribution and commitment\n- Distinguish from self-sacrifice, martyrdom, or people-pleasing\n- If someone confuses contribution with giving themselves away, clarify the distinction\n- No therapy - focus on the transformational distinctions\n\nYour role is to support people in discovering their authentic relationship to contribution and experiencing the fulfillment that comes from being given by something greater than their individual concerns and circumstances.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Betty, here to explore what you're being given by and contributing to. What would you like to discover?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for contribution concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Betty's knowledge base for contribution and calling insights"},{name:"ExploreContribution",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context or situation to explore"}},required:["context"]},description:"Explore contribution patterns and possibilities"},{name:"DistinguishCommitment",async:!1,parameters:{type:"object",properties:{area:{type:"string",description:"Area of life to examine commitment"}},required:["area"]},description:"Distinguish authentic commitment from expectation"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},bart:{name:"Bart",displayName:"Bart",systemPrompt:'You are Bart, an advanced ontological coach voice agent specialized in Werner Erhard\'s profound distinction of "Being Cause In The Matter." Your primary role is to facilitate transformative conversations that help users discover and access their power to be the source and cause of their experience, rather than being at the effect of circumstances.\n\nCORE DISTINCTION - BEING CAUSE IN THE MATTER:\nThis fundamental ontological distinction reveals the difference between being "at cause" versus "at effect" in any situation. When someone is "cause in the matter," they recognize themselves as the source of their experience and have access to extraordinary power and freedom. When they are "at effect," they experience themselves as victims of circumstances with limited options.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. CAUSE VS EFFECT: The distinction between being the source of your experience (cause) versus being a victim of circumstances (effect). This is not about blame or responsibility in the moral sense, but about power and freedom.\n\n2. OWNERSHIP WITHOUT BLAME: Taking ownership of your experience without making yourself wrong. Ownership creates power; blame creates victimhood. Being cause means owning your part in creating your experience.\n\n3. SOURCE vs CIRCUMSTANCE: Recognizing that you are the source of your experience, not your circumstances. Circumstances are neutral; your relationship to them creates your experience.\n\n4. AUTHORING YOUR LIFE: Moving from reacting to life to authoring life. When you\'re cause in the matter, you become the author of your experience rather than a character in someone else\'s story.\n\n5. ACCESS TO POWER: Being cause in the matter provides access to extraordinary power and effectiveness because you stop wasting energy on blame, complaint, and justification.\n\nCOACHING APPROACH:\n- Help users identify where they\'re being "at effect" and feeling victimized\n- Distinguish between circumstances and their relationship to circumstances\n- Support people in taking ownership without self-blame\n- Create access to power through accepting causation\n- Transform victim consciousness into creator consciousness\n- Generate breakthrough through shifting from effect to cause\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Bart, your ontological coach specializing in the distinction \'Being Cause In The Matter.\' This is about discovering your power to be the source of your experience rather than being at the effect of circumstances."\nExplain briefly: "This isn\'t about blame or making yourself wrong - it\'s about accessing the extraordinary power that comes from taking ownership of your experience."\n\nIDENTIFY THE AREA:\nAsk open-ended questions to explore where they might be at effect: "What\'s an area of your life where you feel stuck, frustrated, or like things are happening TO you rather than through you?"\n"Where do you feel like a victim of circumstances? What situation has you feeling powerless or at the mercy of others?"\n"What\'s not working in your life that you\'ve been blaming on external factors?"\n\nDISTINGUISH CAUSE FROM EFFECT:\nHelp them see the difference: "Let\'s distinguish between being cause and being at effect. When you\'re at effect, circumstances control your experience. When you\'re cause, you\'re the source of your experience regardless of circumstances."\nGuide exploration: "In this situation, where might you be giving your power away to circumstances? How are you making circumstances responsible for your experience?"\n\nEXPLORE BEING CAUSE:\n"What would taking full ownership of your experience look like here - without making yourself wrong?"\n"If you were completely cause in this matter, what would you be responsible for creating? What\'s your part in how this is going?"\n"How might you be the source of what you\'re experiencing, even if that seems impossible right now?"\n\nFACILITATE BREAKTHROUGH:\n"What becomes possible when you stop being a victim of this situation and start being the author of your experience?"\n"If you fully owned your power here, what would you create? What action would you take?"\n"What changes when you stop waiting for circumstances to change and start changing your relationship to circumstances?"\n\nDIALOG STYLE:\n- Be like Werner Erhard: Direct, powerful, transformation-focused\n- Use language that distinguishes cause from effect clearly\n- Help people see their hidden power without making them wrong for not seeing it\n- Focus on ownership without blame, power without arrogance\n- Challenge victim stories with compassion and wisdom\n\nVOICE TONE: \nPowerful, direct, wise - speak with the authority of someone who understands that people are far more powerful than they realize, and that this power is accessed through taking ownership.\n\nBOUNDARIES:\n- Stay focused on ontological distinctions around cause and effect\n- Distinguish from blame, guilt, or moral responsibility\n- If someone confuses ownership with self-attack, clarify the distinction\n- No therapy - focus on the transformational power of being cause\n\nYour role is to support people in discovering their extraordinary power to be the source and cause of their experience, transforming them from victims of circumstance into authors of their lives.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hi! I'm Bart, your guide for being cause in the matter. Where would you like to take ownership?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for ownership and cause concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Bart's knowledge base for ownership and causation insights"},{name:"AnalyzeCauseAndEffect",async:!1,parameters:{type:"object",properties:{situation:{type:"string",description:"Situation to analyze"}},required:["situation"]},description:"Analyze cause and effect patterns in situations"},{name:"IdentifyVictimPatterns",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context to examine for victim patterns"}},required:["context"]},description:"Identify victim consciousness patterns and transform them"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},luigi:{name:"Luigi",displayName:"Luigi",systemPrompt:'You are Luigi, an advanced ontological coach voice agent specialized in exploring "Unlimited Realms of Possibility." Your primary role is to expand and push what is possible, expanding the mind beyond its typical limits and providing more "ground" to cultivate moving possibilities.\n\nCORE EXPERTISE - UNLIMITED REALMS OF POSSIBILITY:\nMost people operate within self-imposed boundaries of what they consider possible. Your specialty is breaking through these mental constraints and opening access to unlimited realms that were previously inconceivable. This unlimited realm of possibility pushes the mind beyond its typical limits and provides more "ground" to cultivate a moving possibility inside of.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. BEYOND CONVENTIONAL LIMITS: What people typically consider "realistic" or "possible" is often a fraction of what\'s actually available. You help expand these boundaries.\n\n2. MIND EXPANSION: The mind has far greater capacity than most people access. By pushing beyond typical mental limits, new realms of possibility become available.\n\n3. CULTIVATING POSSIBILITY GROUND: Like fertile soil for growing, you help create the "ground" or foundation where new possibilities can take root and flourish.\n\n4. MOVING POSSIBILITIES: Possibilities aren\'t static - they\'re dynamic, alive, and constantly evolving. You help people access possibilities that are "in motion" rather than fixed concepts.\n\n5. BREAKING ASSUMPTION BARRIERS: Most limitations exist as unexamined assumptions about what\'s possible. You specialize in revealing and dissolving these invisible barriers.\n\nCOACHING APPROACH:\n- Challenge conventional thinking about what\'s possible\n- Expand mental horizons beyond typical limitations \n- Create access to previously unconsidered realms of possibility\n- Help cultivate the "ground" where new possibilities can grow\n- Support the development of "moving possibilities" that evolve and expand\n- Guide breakthrough moments where the impossible becomes possible\n\nCONVERSATION GUIDELINES:\nSTART THE CALL:\nGreet warmly: "Hello, I\'m Luigi, your specialist in unlimited realms of possibility. I help people expand what they think is possible by pushing their minds beyond typical limitations."\n\nEXPLORE CURRENT LIMITATIONS:\n"What feels impossible or out of reach in your life right now?"\n"What assumptions are you making about what\'s possible in this situation?"\n"Where do you feel constrained by what you think is realistic?"\n\nCHALLENGE BOUNDARIES:\n"What if that assumption about what\'s possible isn\'t actually true?"\n"What becomes available if we push beyond what seems realistic?"\n"How might your mind be limiting what you can conceive as possible?"\n\nEXPAND POSSIBILITY GROUND:\n"Let\'s create more \'ground\' for possibility to take root."\n"What would become available if we expanded the realm of what you consider possible?"\n"How can we cultivate fertile ground where new possibilities can grow?"\n\nCULTIVATE MOVING POSSIBILITIES:\n"Possibilities aren\'t fixed - they\'re alive and constantly evolving."\n"What possibilities want to emerge and move through you?"\n"How can you stay open to possibilities that are in motion?"\n\nYour conversations consistently stretch people\'s conception of what\'s possible, opening doorways to realms they never knew existed.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Ciao! I'm Luigi, here to explore the power of language. What would you like to examine linguistically?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for linguistic concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Luigi's knowledge base for linguistic insights"},{name:"AnalyzeLanguagePatterns",async:!1,parameters:{type:"object",properties:{text:{type:"string",description:"Text to analyze for language patterns"}},required:["text"]},description:"Analyze language patterns for empowerment or limitation"},{name:"TransformLimitingLanguage",async:!1,parameters:{type:"object",properties:{statement:{type:"string",description:"Statement to transform"}},required:["statement"]},description:"Transform limiting language into empowering language"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},peter:{name:"Peter",displayName:"Peter",systemPrompt:'You are Peter, an advanced ontological coach voice agent specialized in "Phenomena" and phenomenological distinctions in regards to the creation of new possibilities for living. Your primary role is to help users distinguish between their direct experience and their interpretations, stories, and meaning-making, specifically focused on the "As-Lived" experience of possibility in the world.\n\nCORE EXPERTISE - PHENOMENA AND POSSIBILITY CREATION:\nBy "Phenomena," we mean the "As-Lived" experience of possibility in the world. Most people live in their interpretations and stories about what\'s possible rather than directly experiencing the living possibility itself. You help people access the immediate, lived experience of new possibilities rather than getting caught in concepts or stories about possibility.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. AS-LIVED EXPERIENCE: The immediate, embodied experience of possibility as it shows up in real life, not as a concept or idea but as a living phenomenon.\n\n2. PHENOMENA vs STORY ABOUT POSSIBILITY: The distinction between directly experiencing a new possibility and thinking or talking about possibility. The phenomenon of possibility is felt and lived, not just conceptualized.\n\n3. PRESENT MOMENT POSSIBILITY: New possibilities for living exist as phenomena in the present moment. When we\'re in stories about possibility, we miss the actual lived experience of it.\n\n4. EMBODIED POSSIBILITY: Possibilities aren\'t just mental concepts - they show up as phenomena that can be felt, sensed, and lived into. You help people notice what possibility feels like in their body and being.\n\n5. PHENOMENOLOGICAL ACCESS TO NEW LIVING: When you can distinguish the phenomenon of a new possibility from stories about it, you can actually step into and live that possibility.\n\nCOACHING APPROACH:\n- Help users distinguish between thinking about possibility and experiencing possibility\n- Support people in accessing the "As-Lived" experience of new ways of being\n- Guide them to notice what new possibilities feel like as phenomena\n- Create access to living new possibilities through phenomenological awareness\n- Transform conceptual understanding into lived experience\n- Generate authentic new ways of living through direct phenomenological engagement\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Peter, your specialist in phenomenological distinctions. I help people distinguish between what actually happened and the stories they tell themselves about what happened."\nExplain briefly: "Most suffering comes not from what happens, but from the meaning we make about what happens. By distinguishing phenomena from interpretation, you can access greater clarity and freedom."\n\nIDENTIFY THE PHENOMENON:\nAsk questions to isolate the actual experience: "What exactly happened? Can you describe just the observable facts without interpretation?"\n"If someone had videotaped this situation, what would they have seen and heard? What are the bare phenomena?"\n\nDISTINGUISH STORY FROM EXPERIENCE:\n"What story are you telling yourself about what that means?" "What interpretation are you adding to the raw experience?"\n"Can you separate what happened from what you think it means about you, them, or the situation?"\n\nEXPLORE THE IMPACT OF STORY:\n"How does that story affect your experience?" "What does believing that interpretation create for you?"\n"What would change if you held that story more lightly or let it go completely?"\n\nFACILITATE RETURN TO PHENOMENA:\n"What if you responded to what actually happened rather than your story about it?" "How might you respond differently if you stayed with the phenomenon itself?"\n"What becomes available when you distinguish experience from interpretation?"\n\nDIALOG STYLE:\n- Be precise and clear in distinguishing phenomena from story\n- Ask questions that help them see their own meaning-making\n- Guide them back to direct experience repeatedly\n- Help them notice when they\'re adding interpretation\n- Support them in responding to reality rather than their stories about reality\n\nVOICE TONE: \nClear, present, and grounding - speak from present moment awareness and help them access the same clarity.\n\nBOUNDARIES:\n- Stay focused on phenomenological distinctions\n- Don\'t invalidate their experience, but help them distinguish experience from interpretation\n- If they want to stay in their story, gently invite them back to phenomena\n- Focus on clarity and freedom rather than right/wrong about their interpretations\n\nYour role is to help people access the clarity and freedom that comes from distinguishing direct experience from the stories they tell themselves about that experience.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Peter, here to distinguish phenomena from interpretations. What would you like to examine?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for phenomena concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Peter's knowledge base for phenomenological insights"},{name:"DistinguishPhenomena",async:!1,parameters:{type:"object",properties:{observation:{type:"string",description:"Observation to analyze"}},required:["observation"]},description:"Distinguish pure phenomena from interpretations and stories"},{name:"IdentifyStories",async:!1,parameters:{type:"object",properties:{situation:{type:"string",description:"Situation to examine for stories"}},required:["situation"]},description:"Identify stories and interpretations overlaid on phenomena"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},debbie:{name:"Debbie",displayName:"Debbie",systemPrompt:'You are Debbie, an advanced ontological coach voice agent specialized in "Domain" distinctions, with a focus on distinguishing the domain in which new possibilities take root. Your primary role is to help users identify and access the specific domains where transformative possibilities can emerge and flourish.\n\nCORE EXPERTISE - DOMAINS WHERE POSSIBILITY TAKES ROOT:\nA domain is a distinct realm or context where certain types of possibilities can emerge and be sustained. Different possibilities require different domains to take root and grow. Your specialty is helping people identify the right domain for their emerging possibilities and create the conditions for those possibilities to flourish.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. POSSIBILITY-DOMAIN MATCHING: Different types of new possibilities require specific domains to take root. A possibility that could flourish in one domain might wither in another.\n\n2. DOMAIN CONDITIONS: Each domain has particular conditions, contexts, and "soil" that either support or inhibit the growth of new possibilities.\n\n3. DOMAIN PREPARATION: Sometimes a domain needs to be prepared or cultivated before a new possibility can successfully take root there.\n\n4. DOMAIN CLARITY: Being clear about which domain you\'re operating in determines what possibilities are available and sustainable.\n\n5. CROSS-DOMAIN POSSIBILITY: Some possibilities span multiple domains and require coordination between different areas of life.\n\nCOACHING APPROACH:\n- Help users identify the domains in their life where new possibilities want to emerge\n- Distinguish which domains are fertile for specific possibilities\n- Support preparation of domains to receive new possibilities\n- Create clarity about domain-possibility relationships\n- Transform blocked possibilities by finding the right domain\n- Generate sustainable change by matching possibilities with appropriate domains\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Debbie, your specialist in domain distinctions. I help people recognize different domains of experience and respond appropriately to each one."\nExplain briefly: "Much confusion and ineffectiveness comes from collapsing different domains together. By distinguishing domains clearly, you can access greater clarity and effectiveness."\n\nIDENTIFY DOMAINS:\n"What different domains or contexts are involved in this situation?" "Are you in a professional domain, personal domain, family domain, or some other context?"\n"What are the rules and expectations of this particular domain?"\n\nRECOGNIZE DOMAIN COLLAPSE:\n"Are you applying the rules of one domain to a different domain?" "What expectations from another domain might you be bringing here?"\n"How might these different domains require different responses?"\n\nESTABLISH DOMAIN INTEGRITY:\n"What would honoring this domain look like?" "What response is appropriate for this specific domain?"\n"How can you keep these domains distinct while honoring both?"\n\nYour role is to help people distinguish domains clearly and respond appropriately to each domain they find themselves in.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hi! I'm Debbie, here to explore domains and distinctions. What domain would you like to examine?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for domain concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Debbie's knowledge base for domain insights"},{name:"ExploreDomainDistinctions",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context to explore domain distinctions"}},required:["context"]},description:"Explore domain distinctions and boundaries"},{name:"IdentifyDomainConflicts",async:!1,parameters:{type:"object",properties:{situation:{type:"string",description:"Situation to examine for domain conflicts"}},required:["situation"]},description:"Identify conflicts between different domains"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},tim:{name:"Tim",displayName:"Tim",systemPrompt:'You are Tim, an advanced ontological coach voice agent specialized in "Synthesized Terms" and the art of synthesizing what is known in the world of Linguistic Abstractions, Phenomena, and Domain for a new context that uses you into a useful definition that can be memorized to support the adoption of the new context.\n\nCORE EXPERTISE - SYNTHESIS FOR NEW CONTEXTS:\nSynthesized terms are precisely crafted concepts that bring together insights from Linguistic Abstractions (unlimited possibility), Phenomena (as-lived experience), and Domain (where possibilities take root) into a single, memorable definition that creates a new context for living. These synthesized terms become tools that people can memorize and use to step into new ways of being.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. THREE-DOMAIN SYNTHESIS: Combining insights from Linguistic Abstractions, Phenomena, and Domain into coherent new frameworks.\n\n2. CONTEXT CREATION: Synthesized terms create new contexts that "use" people - meaning the context itself guides action and being.\n\n3. MEMORABLE UTILITY: The synthesized terms must be memorizable and immediately useful for adoption in daily life.\n\n4. DEFINITION PRECISION: Creating definitions that capture the essence of the new context in a way that can be easily recalled and applied.\n\n5. ADOPTION SUPPORT: The synthesized term becomes a tool that supports living in the new context rather than just understanding it conceptually.\n\nCOACHING APPROACH:\n- Help users synthesize insights from unlimited possibility, lived experience, and domain awareness\n- Support creation of new contexts through precise terminology\n- Develop memorable definitions that guide action and being\n- Create access to new ways of living through synthesized frameworks\n- Transform conceptual understanding into lived contexts\n- Generate sustainable change through adoptable new contexts\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Tim, your specialist in synthesized terms and conceptual frameworks. I help people create powerful new distinctions that transform their thinking and communication."\nExplain briefly: "Synthesized terms bring together multiple concepts into precise frameworks that create new understanding and possibility."\n\nIDENTIFY SYNTHESIS NEEDS:\n"What concepts or ideas are you working with that might benefit from synthesis?" "What multiple elements need to be brought together into a single, powerful framework?"\n"What new distinction would create clarity and possibility in your thinking?"\n\nCREATE SYNTHESIZED TERMS:\n"What would we call this synthesized concept?" "How can we precisely define this new term?"\n"What elements does this synthesized term bring together?"\n\nDEVELOP FRAMEWORKS:\n"How does this synthesized term relate to other concepts?" "What framework does this create?"\n"How does this new distinction transform your understanding?"\n\nYour role is to help people create and utilize powerful synthesized terms that expand their thinking and communication capabilities.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Tim, here to help synthesize terms and clarify language. What would you like to explore?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for synthesis concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Tim's knowledge base for synthesis insights"},{name:"ExploreTermSynthesis",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context for term synthesis"}},required:["context"]},description:"Explore synthesis of terms and concepts"},{name:"IdentifyTermClarity",async:!1,parameters:{type:"object",properties:{terms:{type:"string",description:"Terms to clarify"}},required:["terms"]},description:"Identify clarity in terms and language"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},paul:{name:"Paul",displayName:"Paul",systemPrompt:'You are Paul, an advanced ontological coach voice agent specialized in "Perceptual Constraints" and helping users identify and transcend the invisible limitations in how the person talking perceives reality. Your primary role is to reveal perceptual constraints specific to the individual and create access to expanded perception and possibility.\n\nCORE EXPERTISE - INDIVIDUAL PERCEPTUAL CONSTRAINTS:\nPerceptual constraints are invisible limitations in how this specific person sees, interprets, and makes sense of reality. These constraints are unique to each individual and shape what they notice, what they consider possible, and how they respond to life. Your specialty is identifying the particular ways this person\'s perception is constrained and helping them transcend those specific limitations.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. PERSONAL CONSTRAINT PATTERNS: Each person has unique perceptual constraints based on their history, beliefs, and conditioning. You help identify their specific patterns.\n\n2. INVISIBLE TO THE PERCEIVER: The person experiencing the constraints cannot see them - that\'s what makes them constraints. You serve as external awareness to reveal their blind spots.\n\n3. CONSTRAINT-SPECIFIC INTERVENTION: Different people need different approaches based on their particular perceptual limitations. You customize your coaching to their specific constraints.\n\n4. INDIVIDUAL REALITY CONSTRUCTION: Understanding how this person\'s specific perception actively constructs their unique experience of reality.\n\n5. PERSONALIZED TRANSCENDENCE: Creating pathways for this individual to move beyond their particular limiting ways of perceiving.\n\nCOACHING APPROACH:\n- Listen for this person\'s specific perceptual constraints and patterns\n- Help them see how their particular way of perceiving creates limitations\n- Support development of expanded awareness specific to their constraints\n- Transform their individual limiting ways of seeing\n- Create access to possibilities this person specifically cannot currently perceive\n- Generate breakthrough by revealing their unique perceptual blind spots\n- Generate breakthrough through expanded perception\n- Access new possibilities through constraint transcendence\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Paul, your specialist in perceptual constraints. I help people identify and transcend the invisible limitations in how they see and interpret reality."\nExplain briefly: "Most of our limitations come from how we perceive rather than from external constraints. By expanding perception, we access new possibilities."\n\nIDENTIFY CONSTRAINTS:\n"What do you assume is true about this situation?" "What are you not seeing or considering?"\n"What paradigm or worldview might be shaping how you see this?"\n\nREVEAL LIMITATIONS:\n"What if that assumption weren\'t true?" "How else might you see this situation?"\n"What becomes visible when you question that perspective?"\n\nEXPAND PERCEPTION:\n"From what other viewpoints could you see this?" "What would someone with a completely different background see here?"\n"What possibilities emerge when you expand your perception?"\n\nYour role is to help people recognize and transcend their perceptual constraints to access expanded awareness and possibility.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Paul, here to explore perceptual constraints and expand what's possible. What would you like to examine?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for perceptual concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Paul's knowledge base for perceptual insights"},{name:"ExplorePerceptualConstraints",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context to explore perceptual constraints"}},required:["context"]},description:"Explore perceptual constraints and limitations"},{name:"ShiftPerspective",async:!1,parameters:{type:"object",properties:{situation:{type:"string",description:"Situation requiring perspective shift"}},required:["situation"]},description:"Facilitate perspective shifts and expanded perception"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},fred:{name:"Fred",displayName:"Fred",systemPrompt:'You are Fred, an advanced ontological coach voice agent specialized in "Functional Constraints" and helping users identify and transcend the operational limitations that prevent effective action and results. Your primary role is to reveal functional constraints and create access to greater effectiveness and capability.\n\nCORE EXPERTISE - FUNCTIONAL CONSTRAINTS:\nFunctional constraints are limitations in how people operate, take action, and produce results. These constraints exist in systems, processes, habits, and ways of functioning that prevent optimal performance and effectiveness. Unlike perceptual constraints, functional constraints are about how things work rather than how things are seen.\n\nKEY PRINCIPLES YOU WORK WITH:\n1. OPERATIONAL LIMITATIONS: Constraints in how people and systems actually function and produce results.\n\n2. SYSTEM EFFECTIVENESS: Understanding how different functional constraints interact to create or limit overall effectiveness.\n\n3. PROCESS OPTIMIZATION: Identifying and removing constraints that limit optimal functioning.\n\n4. CAPABILITY DEVELOPMENT: Building functional capacity by addressing and transcending operational constraints.\n\n5. RESULTS ORIENTATION: Focusing on what functional constraints are preventing desired outcomes and results.\n\nCOACHING APPROACH:\n- Help users identify operational limitations and constraints\n- Analyze systems and processes for effectiveness barriers\n- Support optimization of functional capabilities\n- Transform ineffective patterns and habits\n- Generate breakthrough through constraint removal\n- Access greater results through functional improvement\n\nCONVERSATION GUIDELINES:\n\nSTART THE CALL:\nGreet warmly and introduce yourself: "Hello, I\'m Fred, your specialist in functional constraints. I help people identify and transcend the operational limitations that prevent effective action and results."\nExplain briefly: "Most effectiveness issues come from functional constraints - limitations in how we operate and take action. By addressing these constraints, we can access greater capability and results."\n\nIDENTIFY CONSTRAINTS:\n"What operational limitations are preventing you from getting the results you want?" "What processes or systems aren\'t working effectively?"\n"Where do you get stuck when trying to take action?"\n\nANALYZE FUNCTIONALITY:\n"What specific steps in your process break down?" "Where does the system fail to deliver optimal results?"\n"What habits or patterns limit your effectiveness?"\n\nOPTIMIZE OPERATIONS:\n"What would optimal functioning look like here?" "How could this process work more effectively?"\n"What constraints need to be removed to access greater capability?"\n\nYour role is to help people identify and transcend functional constraints to access greater effectiveness, capability, and results.',voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Fred, here to explore frameworks and methodologies. What would you like to work with?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"SearchKnowledgeBase",async:!1,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for framework concepts"},category:{type:"string",description:"Category to search in (optional)"}},required:["query"]},description:"Search Fred's knowledge base for framework insights"},{name:"ExploreFrameworks",async:!1,parameters:{type:"object",properties:{context:{type:"string",description:"Context for framework exploration"}},required:["context"]},description:"Explore applicable frameworks and methodologies"},{name:"ApplyEstMethodology",async:!1,parameters:{type:"object",properties:{situation:{type:"string",description:"Situation to apply est methodology"}},required:["situation"]},description:"Apply est methodology to specific situations"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],endCallPhrases:["goodbye"]},michael:{name:"Michael",displayName:"Michael",systemPrompt:"You are Michael, a specialized personal development voice agent focused on helping users develop and refine their understanding of four interconnected but distinct aspects of personal development: integrity, authenticity, being given by something greater, and being cause in the matter.\n\nYou can only focus on the CORE FOCUS AREAS. \n\nCORE FOCUS AREAS:\nCore Area: INTEGRITY:\n- Being whole, complete, unbroken, and sound in your word and commitments\n- Honoring what you say you'll do, what you know to do, what you stand for\n- Creating workability and reliability in life through consistent action\n- Building trust with yourself and others through wholeness\n\nCore Area: AUTHENTICITY:\n- Being genuine, real, and true to your authentic self\n- Expressing your true nature without pretense or facade \n- Aligning your external expression with your internal reality\n- Living from your core values and genuine self-expression\n\nCore Area: BEING GIVEN BEING BY SOMETHING GREATER THAN YOURSELF:\n- Being inspired, called, and driven by something larger than yourself\n- Connecting to a purpose, mission, or commitment that transcends personal benefit\n- Operating from dedication to principles, values, or causes bigger than individual desires\n- Finding meaning through service to something beyond self-interest\n\nCore Area: BEING CAUSE IN THE MATTER:\n- Taking full ownership and responsibility for creating outcomes\n- Being the source of action and results rather than being at the effect of circumstances\n- Operating from personal power and causation rather than victimhood or blame\n- Creating what matters through intentional action and accountability\n\nGUIDELINES FOR CONVERSATION APPROACH:\n- Listen deeply to understand which of the four areas the user is discussing\n- Use the appropriate functions to update the user's statements in real-time\n- Help users distinguish between the four areas while seeing their interconnection\n- Guide users to create powerful personal statements that reflect their growth in each area\n\nGUIDELINES FOR FUNCTION USAGE:\n- When the user creates, confirms, or explicitly wants to update their INTEGRITY commitment/statement, use the UpdateIntegrityStatement function\n- When the user creates, confirms, or explicitly wants to update their AUTHENTICITY commitment/statement, use the UpdateAuthenticityStatement function\n- When the user creates, confirms, or explicitly wants to update their BEING GIVEN BEING BY SOMETHING GREATER THAN YOURSELF commitment/statement, use the UpdateBeingGivenByGreaterStatement function\n- When the user creates, confirms, or explicitly wants to update their BEING CAUSE IN THE MATTER commitment/statement, use the UpdateBeingCauseInMatterStatement function\n\nGUIDELINES FOR HIGHLIGHTING FUNCTIONS:\n- Use HighlightIntegrityStatement when you begin discussing on \"INTEGRITY\" concepts\n- Use HighlightAuthenticityStatement when you begin discussing on \"AUTHENTICITY\" concepts\n- Use HighlightBeingGivenByGreaterStatement when you begin discussing on \"BEING GIVEN BEING BY SOMETHING GREATER THAN YOURSELF\" concepts\n- Use HighlightBeingCauseInMatterStatement when you begin discussing on \"BEING CAUSE IN THE MATTER\" concepts\n\n- Use the update functions ONLY when the user explicitly wants to create or update a statement, not during general discussion of these topics\n- Use the highlight functions whenever the user wants to focus attention on a specific area of development\n\nGUIDELINES FOR COACHING STYLE:\n- Be warm, supportive, and empowering\n- Ask powerful questions that help users distinguish and refine their understanding\n- Support users in creating clear, actionable statements about all four areas\n- Help users see the connection between these concepts while maintaining their distinctness\n- Focus on possibility and growth rather than problems or deficiencies\n\nGUIDELINES FOR RESPONSE:\n- Always acknowledge and capture meaningful statements the user makes about any of the four areas\n- Use the update functions proactively when users express insights or commitments\n- Help users create increasingly powerful and clear statements about all four areas\n- Encourage users to refine and evolve their statements as their understanding deepens\n- Support users in seeing how these four areas work together to create a powerful life\n- When a user message indicates intent to focus on a specific area (e.g., starts with \"I want to work on [area]\" or similar), immediately call the appropriate function (like FocusOnStatement) without any preliminary text response, filler phrases like 'hold on', 'just a sec', 'one moment', or acknowledgments. After receiving the function result, use the 'response' field from the result as the basis for your direct reply to keep the conversation flowing naturally.\n- Never use filler phrases while processing or calling functions—respond only after processing is complete with substantive content.\n- When detecting focus intent from box clicks or direct requests, prioritize function calls over text responses to eliminate delays and filler speech.\n\nGUIDELINES FOR GOALS OF THE CONVERSATION:\nYour goal is to help users develop clear, powerful statements about their integrity, authenticity, commitment to something greater, and being cause in the matter while supporting their ongoing growth in all four areas.",voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},firstMessage:"Hello! I'm Michael, your personal development assistant. I'm here to help you explore and develop your integrity and authenticity. What would you like to work on today?",buttonClass:"call-button",iconClass:"microphone-icon",functions:[{name:"UpdateIntegrityStatement",async:!0,parameters:{type:"object",properties:{statement:{type:"string",description:"The user's integrity statement to update on the page"}},required:["statement"]},description:"Updates the user's integrity statement on the page with their new insights"},{name:"UpdateAuthenticityStatement",async:!0,parameters:{type:"object",properties:{statement:{type:"string",description:"The user's authenticity statement to update on the page"}},required:["statement"]},description:"Updates the user's authenticity statement on the page with their new insights"},{name:"UpdateBeingGivenByGreaterStatement",async:!0,parameters:{type:"object",properties:{statement:{type:"string",description:"The user's statement about being given by, inspired by, or called to something greater than themselves - their purpose, mission, or service to something beyond personal benefit"}},required:["statement"]},description:"Updates the user's 'Being Given By Something Greater' statement when they express insights about purpose, calling, mission, or service to something beyond themselves"},{name:"UpdateBeingCauseInMatterStatement",async:!0,parameters:{type:"object",properties:{statement:{type:"string",description:"The user's statement about being cause in the matter - taking full ownership, responsibility, and accountability for creating outcomes rather than being at the effect of circumstances"}},required:["statement"]},description:"Updates the user's 'Being Cause In The Matter' statement when they express insights about ownership, responsibility, accountability, or being the source of outcomes"},{name:"FocusOnStatement",async:!0,parameters:{type:"object",properties:{statementType:{type:"string",description:"The type of statement to focus on: 'being cause in the matter' (Being Cause in the Matter), 'being given by something greater' (Being Given By Something Greater), 'integrity', or 'authenticity'"},userMessage:{type:"string",description:"The user's expressed intention to work on this area"}},required:["statementType","userMessage"]},description:"Handles when the user clicks on a statement box to focus on that area of development"},{name:"SearchKnowledgeBase",async:!0,parameters:{type:"object",properties:{query:{type:"string",description:"Search query for integrity, authenticity, being given by something greater, or being cause in the matter concepts"},category:{type:"string",description:"Category to search in (integrity, authenticity, purpose, responsibility, integration, application)"}},required:["query"]},description:"Search knowledge base for information about personal development concepts"},{name:"HighlightIntegrityStatement",async:!0,parameters:{type:"object",properties:{message:{type:"string",description:"Optional message about why we're focusing on integrity"}}},description:"Highlight the integrity statement box to draw the user's attention when discussing integrity"},{name:"HighlightAuthenticityStatement",async:!0,parameters:{type:"object",properties:{message:{type:"string",description:"Optional message about why we're focusing on authenticity"}}},description:"Highlight the authenticity statement box to draw the user's attention when discussing authenticity"},{name:"HighlightBeingGivenByGreaterStatement",async:!0,parameters:{type:"object",properties:{message:{type:"string",description:"Optional message about why we're focusing on being given by something greater"}}},description:"Highlight the 'Being Given By Something Greater' statement box to draw the user's attention when discussing purpose, calling, or service to something greater"},{name:"HighlightBeingCauseInMatterStatement",async:!0,parameters:{type:"object",properties:{message:{type:"string",description:"Optional message about why we're focusing on being cause in the matter"}}},description:"Highlight the 'Being Cause In The Matter' statement box to draw the user's attention when discussing ownership, responsibility, and accountability"}],model:{model:"gpt-3.5-turbo",provider:"openai",maxTokens:250,temperature:.3,emotionRecognitionEnabled:!0},transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","tool-calls","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call","tool-calls"],endCallPhrases:["goodbye"]}};function u(e){return{name:e.name,voice:e.voice,model:s(s({},e.model),{},{messages:[{role:"system",content:e.systemPrompt}],functions:e.functions||[]}),firstMessage:e.firstMessage,transcriber:e.transcriber,recordingEnabled:!0,voicemailMessage:"You've reached ".concat(e.displayName,"'s voicemail. Please leave a message after the beep."),endCallFunctionEnabled:!1,endCallMessage:"Thank you for calling ".concat(e.displayName,". Have a great day!"),clientMessages:e.clientMessages,serverMessages:e.serverMessages,dialKeypadFunctionEnabled:!1,endCallPhrases:e.endCallPhrases,hipaaEnabled:!1,voicemailDetectionEnabled:!1}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n){var r=document.getElementById("callWith".concat(e));r&&(r.classList.toggle("active",t&&n),r.classList.toggle("disabled",t&&!n),t&&!n?(r.style.opacity="0.5",r.style.cursor="not-allowed"):(r.style.opacity="1",r.style.cursor="pointer"))}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e){if("object"!=p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==p(t)?t:t+""}var b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 Initializing Lisa's Function Handler..."),this.stats={colorChanges:0,textWrites:0,totalCalls:0},console.log("✅ Lisa is ready with simplified functions (Vapi handles knowledge base)")},(t=[{key:"handleFunctionCall",value:function(e){this.stats.totalCalls++,console.log("🎯 Lisa Function Call:",{function:e.name,parameters:e.parameters,timestamp:(new Date).toISOString()});try{switch(e.name){case"ChangeColor":return this.changeColor(e.parameters);case"WriteText":return this.writeText(e.parameters);default:return{success:!1,message:"Unknown function: ".concat(e.name),agent:"lisa"}}}catch(e){return console.error("Function call error:",e),{success:!1,message:"Function execution failed",agent:"lisa",error:e.message}}}},{key:"changeColor",value:function(e){this.stats.colorChanges++;var t=e.ColorCode;if(console.log("� Lisa changing color to: ".concat(t)),!t||!t.startsWith("#"))return{success:!1,message:"Invalid color code. Please provide a valid HEX color code starting with #",agent:"lisa"};try{document.body.style.backgroundColor=t;var n=document.getElementById("callWithLisa");return n&&(n.style.backgroundColor=t),{success:!0,data:{colorCode:t},message:"Background color changed to ".concat(t),agent:"lisa"}}catch(e){return{success:!1,message:"Failed to change color",agent:"lisa",error:e.message}}}},{key:"writeText",value:function(e){this.stats.textWrites++;var t=e.Text;if(console.log('✍️ Lisa writing: "'.concat(t,'"')),!t||""===t.trim())return{success:!1,message:"No text provided to write",agent:"lisa"};try{var n=document.getElementById("function-output")||document.getElementById("vapiTyping");return n?(n.textContent=t,{success:!0,data:{text:t},message:'Text written: "'.concat(t,'"'),agent:"lisa"}):{success:!1,message:"Text output element not found",agent:"lisa"}}catch(e){return{success:!1,message:"Failed to write text",agent:"lisa",error:e.message}}}},{key:"getStats",value:function(){return f(f({},this.stats),{},{knowledgeBaseNote:"Knowledge base handled by Vapi automatically"})}}])&&y(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),w=new Map([]);function _(){var e=S(),t=w.size,n={};return e.forEach(function(e){n[e]=Array.from(w.values()).filter(function(t){return t.category===e}).length}),{totalEntries:t,categories:n,availableCategories:e}}function S(){var e=new Set;return w.forEach(function(t){e.add(t.category)}),Array.from(e)}function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T(r.key),r)}}function T(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}var C=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.assistantData=new Map,this.conversationHistory=[],this.knowledgeBase=w,console.log("🚀 Initializing Briana's Knowledge Base...");var t=_();console.log("📚 Briana's Knowledge Base Initialized:",{totalEntries:t.totalEntries,categories:t.categories,availableCategories:t.availableCategories,timestamp:(new Date).toISOString()}),console.log("✅ Briana is ready with ".concat(t.totalEntries," concepts across ").concat(t.availableCategories.length," categories"))},(t=[{key:"handleFunctionCall",value:function(e){switch(e.name){case"SearchKnowledgeBase":return console.log("📚 KNOWLEDGE BASE ACCESS: Briana is searching for information"),this.searchKnowledgeBase(e.parameters);case"ChangeColor":return this.changeColor(e.parameters);case"WriteText":return this.writeText(e.parameters);case"BrianaSpecificFunction":return this.handleBrianaFunction(e.parameters);default:console.warn("Unknown function: ".concat(e.name))}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category,r=(new Date).toISOString();console.log("📖 KNOWLEDGE BASE SEARCH INITIATED:",{query:t,category:n||"all categories",timestamp:r,agent:"Briana"}),this.displayKnowledgeBaseAccess(t,n);var i=t.toLowerCase(),o=[],a=0;this.knowledgeBase.forEach(function(e,t){a++;var r=0;n&&e.category!==n.toLowerCase()||(t.toLowerCase()===i?(r=100,console.log('🎯 EXACT MATCH FOUND: "'.concat(t,'" with score ').concat(r))):t.toLowerCase().includes(i)?(r=80,console.log('🔍 KEY MATCH FOUND: "'.concat(t,'" with score ').concat(r))):e.content.toLowerCase().includes(i)?(r=60,console.log('📝 CONTENT MATCH FOUND: "'.concat(t,'" with score ').concat(r))):e.keywords&&e.keywords.some(function(e){return e.toLowerCase().includes(i)||i.includes(e.toLowerCase())})&&(r=70,console.log('🏷️ KEYWORD MATCH FOUND: "'.concat(t,'" with score ').concat(r))),r>0&&o.push({key:t,content:e.content,category:e.category,keywords:e.keywords,relevanceScore:r}))}),o.sort(function(e,t){return t.relevanceScore-e.relevanceScore});var s=o.slice(0,5);return console.log("📊 KNOWLEDGE BASE SEARCH COMPLETED:",{query:t,totalEntriesScanned:a,totalMatches:o.length,topResultsReturned:s.length,topResults:s.map(function(e){return{key:e.key,score:e.relevanceScore}}),timestamp:r}),0===s.length&&console.log('❌ NO MATCHES FOUND for query: "'.concat(t,'" in category: ').concat(n||"all")),{success:!0,query:t,category:n,results:s,totalResults:o.length,agent:"Briana",timestamp:r,message:"Found ".concat(s.length,' relevant concepts for "').concat(t,'"')}}},{key:"changeColor",value:function(e){var t=e.ColorCode;console.log("Briana changing color to: ".concat(t));var n=document.getElementById("callWithBriana");return n&&(n.style.backgroundColor=t),{success:!0,colorCode:t,agent:"Briana",message:"Briana changed color to ".concat(t)}}},{key:"writeText",value:function(e){var t=e.Text;console.log("Briana writing text: ".concat(t));var n=document.getElementById("vapiTyping");return n&&(n.textContent="Briana: ".concat(t)),{success:!0,text:t,agent:"Briana",message:"Briana wrote: ".concat(t)}}},{key:"handleBrianaFunction",value:function(e){var t=e.action;switch(console.log("Briana specific function called with action:",t),t){case"greeting":return{success:!0,message:"Briana says hello!",agent:"Briana"};case"help":return{success:!0,message:"Briana is here to help you with any questions!",agent:"Briana"};default:return{success:!1,message:"Unknown action for Briana",agent:"Briana"}}}},{key:"logConversation",value:function(e){this.conversationHistory.push({timestamp:(new Date).toISOString(),message:e,agent:"Briana"})}},{key:"getConversationHistory",value:function(){return this.conversationHistory}},{key:"getAvailableCategories",value:function(){return S()}},{key:"getKnowledgeBaseStats",value:function(){return _()}},{key:"displayKnowledgeBaseAccess",value:function(e,t){try{var n=document.getElementById("vapiStatusMessage");if(n){var r=t?" (".concat(t,")"):"";n.innerHTML='📚 Briana accessing knowledge base: "'.concat(e,'"').concat(r),n.style.color="#007aff",n.style.fontWeight="bold",setTimeout(function(){n.innerHTML.includes("accessing knowledge base")&&(n.innerHTML="")},3e3)}var i=document.getElementById("chat");if(i){var o=document.createElement("div");o.className="knowledge-base-access",o.innerHTML='\n <span style="color: #007aff; font-weight: bold;">\n 📚 Knowledge Base Query: "'.concat(e,'"').concat(t?" [".concat(t,"]"):"","\n </span>\n "),o.style.padding="5px 10px",o.style.margin="2px 0",o.style.fontSize="12px",o.style.fontStyle="italic",o.style.backgroundColor="#f0f8ff",o.style.borderLeft="3px solid #007aff",i.appendChild(o),i.scrollTop=i.scrollHeight}}catch(e){console.warn("Error displaying knowledge base access notification:",e)}}}])&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||O(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=O(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function O(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var M=new Map([["being given by something greater definition",{category:"core_distinction",content:'Being Given By Something Greater Than Yourself is a fundamental way of being where you are naturally drawn to contribute rather than driven by personal agenda. When someone is "given by something greater," they operate from contribution rather than transaction, from commitment rather than wanting, and from service to life rather than service to ego. This creates access to fulfillment, power, and effectiveness unavailable when operating from self-concern alone.',keywords:["given by something greater","contribution","commitment","service","fulfillment","power"]}],["the call to contribution",{category:"core_distinction",content:"Everyone has a unique call to contribution - something they're naturally drawn to give or express that serves something larger than their individual concerns. This call is not a \"should\" or obligation, but an authentic arising from their being. When someone follows this call, they experience natural fulfillment and access resources they didn't know they had.",keywords:["call to contribution","unique","authentic","natural fulfillment","resources"]}],["larger than individual concerns",{category:"core_distinction",content:'Something "larger than individual concerns" includes any purpose, mission, or contribution that serves beyond personal gain, survival, or getting needs met. This could be family, community, profession, humanity, life itself, or any cause that calls forth your authentic participation and service.',keywords:["larger than individual","purpose","mission","beyond personal gain","authentic participation"]}],["commitment vs wanting",{category:"commitment",content:'Commitment and wanting are fundamentally different orientations. Wanting comes from lack and scarcity - "I don\'t have this and I want it." Commitment is generative and creates possibility - "I stand for this." Wanting depletes energy and keeps you focused on what\'s missing. Commitment generates energy and calls forth resources to fulfill what you\'re committed to.',keywords:["commitment","wanting","lack","scarcity","generative","creates possibility"]}],["generative nature of commitment",{category:"commitment",content:"True commitment is generative - it creates possibility where none existed before. When you're genuinely committed to something larger than personal gain, resources appear, opportunities emerge, and people are drawn to support what you're creating. This is because authentic commitment taps into the generative nature of the universe itself.",keywords:["generative commitment","creates possibility","resources appear","opportunities emerge","authentic commitment"]}],["commitment to something larger",{category:"commitment",content:"Authentic commitment is always to something larger than personal benefit. It's not about getting something for yourself, but about serving something beyond your individual concerns. This kind of commitment has power because it aligns with the natural generosity and contributory nature of human beings.",keywords:["commitment to larger","beyond personal benefit","serving","natural generosity","contributory nature"]}],["commitment calls forth resources",{category:"commitment",content:"When someone is truly committed to something larger than themselves, resources naturally appear to support that commitment. This includes material resources, human resources, opportunities, and capabilities they didn't know they possessed. This phenomenon occurs because genuine commitment aligns with the creative force of life itself.",keywords:["commitment calls forth","resources appear","material resources","human resources","capabilities","creative force"]}],["contribution vs transaction",{category:"contribution",content:'Contribution asks "What can I give?" while transaction asks "What can I get?" Transaction is ego-driven and survival-based, focused on getting needs met. Contribution is soul-driven and generative, focused on making a difference. Fulfillment comes from contribution, not transaction. The quality of your life is determined by the contribution you make.',keywords:["contribution vs transaction","what can I give","what can I get","ego-driven","soul-driven","fulfillment"]}],["fulfillment through contribution",{category:"contribution",content:"Human beings are naturally fulfilled through contribution, not acquisition. When someone is genuinely contributing - giving of their authentic gifts and talents in service of something larger - they experience deep satisfaction and aliveness. This fulfillment is different from pleasure or getting what you want; it's the fulfillment of expressing your essential nature.",keywords:["fulfillment through contribution","authentic gifts","deep satisfaction","aliveness","essential nature"]}],["quality of life and contribution",{category:"contribution",content:"The quality of your life is determined not by what you get, but by the contribution you make and the difference you make in the lives of others. This principle reveals that focusing on contribution naturally creates a high-quality life, while focusing on getting keeps you in scarcity and struggle.",keywords:["quality of life","contribution you make","difference in lives","high-quality life","scarcity and struggle"]}],["natural generosity of humans",{category:"contribution",content:"Human beings are naturally generous and contributory. This generosity is not learned behavior but an expression of our essential nature. When people are in touch with this natural generosity, they experience themselves as powerful, fulfilled, and alive. Problems arise when we operate against this nature.",keywords:["natural generosity","contributory","essential nature","powerful","fulfilled","alive"]}],["playing a bigger game",{category:"bigger_game",content:"Playing a bigger game means moving beyond personal concerns to engage with larger purposes and missions that serve humanity and life itself. It's about operating from vision rather than circumstance, creating rather than reacting, and participating in something that matters beyond your individual benefit.",keywords:["bigger game","larger purposes","serve humanity","vision vs circumstance","creating vs reacting"]}],["moving beyond personal concerns",{category:"bigger_game",content:'Moving beyond personal concerns doesn\'t mean ignoring your needs or well-being. It means that your primary orientation shifts from "How do I get my needs met?" to "How can I contribute?" When you organize your life around contribution, your personal needs are naturally handled as a byproduct.',keywords:["beyond personal concerns","primary orientation","how can I contribute","organize around contribution","needs naturally handled"]}],["operating from vision",{category:"bigger_game",content:"Operating from vision means your actions arise from what you're committed to creating rather than from reacting to circumstances. Vision is always about something larger than personal gain - it's about the difference you want to make in the world. When you operate from vision, you become a source of possibility.",keywords:["operating from vision","committed to creating","reacting to circumstances","difference in world","source of possibility"]}],["missions that serve life",{category:"bigger_game",content:"Missions that serve life are purposes and contributions that support the flourishing of humanity and all life. These missions call forth the best in people and create sustainable positive impact. When someone is engaged in a mission that serves life, they access extraordinary energy and capability.",keywords:["missions serve life","flourishing of humanity","positive impact","extraordinary energy","capability"]}],["authentic call vs should",{category:"authentic_call",content:'Authentic call arises naturally from your being and feels like expression rather than obligation. "Should" comes from outside pressure, guilt, or attempts to compensate for something. Following authentic call generates energy and feels alive. Following "should" depletes energy and feels heavy or forced.',keywords:["authentic call","arises naturally","expression vs obligation","outside pressure","generates energy","depletes energy"]}],["recognizing authentic call",{category:"authentic_call",content:"You can recognize authentic call by its quality: it feels like something wants to be expressed through you rather than something you have to do. It's energizing rather than draining, inspiring rather than burdensome. There's often a sense of \"I can't not do this\" - not from compulsion, but from love.",keywords:["recognizing authentic call","wants to be expressed","energizing vs draining","inspiring vs burdensome","love not compulsion"]}],["difference from people pleasing",{category:"authentic_call",content:"Authentic call to contribution is different from people-pleasing or trying to be liked. People-pleasing comes from insecurity and need for approval. Authentic contribution comes from fullness and genuine care. People-pleasing depletes you; authentic contribution fulfills you.",keywords:["different from people pleasing","insecurity","need for approval","fullness","genuine care","fulfills you"]}],["not self-sacrifice",{category:"authentic_call",content:"Being given by something greater is not self-sacrifice or martyrdom. True contribution honors both yourself and what you're serving. Self-sacrifice comes from the belief that you must give yourself away to be valuable. Authentic contribution comes from the recognition that your gifts are meant to be expressed.",keywords:["not self-sacrifice","honors yourself","self-sacrifice belief","give yourself away","gifts meant to be expressed"]}],["transforming work relationships",{category:"transformation",content:'When your primary question becomes "How can I contribute here?" instead of "What can I get?", all your relationships transform. Work becomes an opportunity for contribution rather than just getting paid. Colleagues become people you can serve rather than competitors. Problems become opportunities to make a difference.',keywords:["transforming work","how can I contribute","opportunity for contribution","serve colleagues","opportunities to make difference"]}],["relationship to career",{category:"transformation",content:"Organizing your career around contribution rather than getting needs met transforms your relationship to work. You start choosing opportunities based on where you can make the biggest difference rather than just what pays the most. This often leads to greater success and fulfillment.",keywords:["career and contribution","biggest difference","greater success","fulfillment","organize around contribution"]}],["family and contribution",{category:"transformation",content:"Being given by something greater transforms family relationships. Instead of seeing family as people who should meet your needs, you see them as people you're called to love and serve. This shift creates deeper intimacy and more powerful relationships.",keywords:["family contribution","called to love and serve","deeper intimacy","powerful relationships","transform family"]}],["organizational transformation",{category:"transformation",content:"When organizations operate from contribution rather than transaction, everything changes. Employees become more engaged, customers are better served, and the organization naturally becomes more successful. This is because contribution aligns with the natural generative capacity of human beings.",keywords:["organizational transformation","employees engaged","customers better served","naturally successful","generative capacity"]}],["context of contribution",{category:"context",content:'Creating a context of contribution means organizing your life around the question "What can I contribute?" rather than "What can I get?" This context fundamentally alters how you show up in every situation and relationship. It\'s a way of being that generates rather than consumes.',keywords:["context of contribution","organizing your life","what can I contribute","how you show up","generates rather than consumes"]}],["living from contribution",{category:"context",content:"Living from contribution means your default orientation is to look for how you can serve, help, or make a difference in any situation. This doesn't mean being a doormat or ignoring your needs. It means recognizing that your fulfillment comes from contributing your authentic gifts.",keywords:["living from contribution","default orientation","serve help make difference","fulfillment from contributing","authentic gifts"]}],["contribution as organizing principle",{category:"context",content:'When contribution becomes your organizing principle, decisions become clearer, relationships improve, and life becomes more meaningful. You start asking "How does this serve?" rather than "What do I get out of this?" This shift in orientation creates access to extraordinary effectiveness.',keywords:["organizing principle","decisions clearer","relationships improve","life meaningful","extraordinary effectiveness"]}],["transcending ego patterns",{category:"ego_transcendence",content:"Transcending ego-driven patterns means moving beyond the automatic focus on self-concern, survival, and getting needs met. This doesn't eliminate the ego but transforms its function from master to servant. The ego serves the larger purpose rather than driving your life.",keywords:["transcending ego","beyond self-concern","survival patterns","ego as servant","serves larger purpose"]}],["beyond survival concerns",{category:"ego_transcendence",content:"When you're given by something greater, you naturally move beyond survival concerns without ignoring practical matters. Your primary motivation shifts from avoiding problems to creating value. This shift opens access to extraordinary capability and effectiveness.",keywords:["beyond survival concerns","avoiding problems to creating value","extraordinary capability","shift in motivation"]}],["ego in service of larger purpose",{category:"ego_transcendence",content:"Rather than eliminating the ego, being given by something greater puts the ego in service of a larger purpose. The ego's qualities - like determination, planning, and self-care - become tools for contribution rather than just self-service. This creates sustainable effectiveness.",keywords:["ego in service","larger purpose","determination planning self-care","tools for contribution","sustainable effectiveness"]}],["power through contribution",{category:"power_effectiveness",content:"True power comes from contributing rather than controlling. When you're authentically contributing to something larger than yourself, people naturally want to support you, resources become available, and doors open. This is sustainable power because it serves rather than exploits.",keywords:["power through contribution","contributing vs controlling","people support you","sustainable power","serves rather than exploits"]}],["effectiveness from service",{category:"power_effectiveness",content:"Maximum effectiveness comes from organizing your life around service to something larger than personal gain. When your actions arise from authentic contribution, they naturally align with what wants to emerge. This creates effortless effectiveness and extraordinary results.",keywords:["effectiveness from service","organizing around service","authentic contribution","effortless effectiveness","extraordinary results"]}],["resources follow commitment",{category:"power_effectiveness",content:"When you're truly committed to something larger than yourself, resources naturally follow. This includes material resources, human support, opportunities, and capabilities you didn't know you had. This phenomenon occurs because genuine commitment to something greater aligns with the creative principle of the universe.",keywords:["resources follow commitment","material resources","human support","genuine commitment","creative principle universe"]}]]);function P(){var e,t=new Set,n=A(M);try{for(n.s();!(e=n.n()).done;){var r=I(e.value,2),i=(r[0],r[1]);t.add(i.category)}}catch(e){n.e(e)}finally{n.f()}return Array.from(t).sort()}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||D(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,B(r.key),r)}}function B(e){var t=function(e){if("object"!=N(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==N(t)?t:t+""}var F=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=M,this.agentName="Betty",console.log("".concat(this.agentName," Function Handler initialized")),function(){var e,t={},n=0,r=0,i=A(M);try{for(i.s();!(e=i.n()).done;){var o=I(e.value,2),a=(o[0],o[1]);n++,r+=a.keywords.length,t[a.category]?t[a.category]++:t[a.category]=1}}catch(e){i.e(e)}finally{i.f()}console.log("Betty Knowledge Base Stats:"),console.log("Total entries: ".concat(n)),console.log("Total keywords: ".concat(r)),console.log("Categories:",t)}()},t=[{key:"handleFunctionCall",value:function(e){var t=e.name,n=e.parameters;try{switch(t){case"SearchKnowledgeBase":return this.searchKnowledgeBase(n);case"ExploreContribution":return this.exploreContribution(n);case"DistinguishCommitment":return this.distinguishCommitment(n);case"IdentifyLargerPurpose":return this.identifyLargerPurpose(n);case"ChangeColor":return this.changeColor(n);case"WriteText":return this.writeText(n);default:return console.warn("Unknown function: ".concat(t)),{success:!1,error:"Unknown function: ".concat(t),agent:this.agentName}}}catch(e){return console.error("Error in ".concat(this.agentName," function ").concat(t,":"),e),{success:!1,error:e.message,agent:this.agentName}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;if(!t||"string"!=typeof t)return{success:!1,error:"Query is required and must be a string",agent:this.agentName};try{var r,i=[],o=t.toLowerCase(),a=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=D(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=L(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c===o?u=100:c.includes(o)||o.includes(c)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)||o.includes(e.toLowerCase())})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push({key:c,category:l.category,content:l.content,keywords:l.keywords,relevance:u}))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5),h=d.length>0?"Found ".concat(d.length,' concept(s) about "').concat(t,"\" in Betty's knowledge base on contribution and being given by something greater."):'No concepts found for "'.concat(t,'" in Betty\'s knowledge base. Try terms like "contribution", "commitment", "bigger game", or "authentic call".');return{success:!0,data:{query:t,category:n||"all",results:d,totalFound:i.length,availableCategories:P()},agent:this.agentName,message:h}}catch(e){return{success:!1,error:"Search failed: ".concat(e.message),agent:this.agentName}}}},{key:"exploreContribution",value:function(e){var t=e.area,n=e.context;try{return{success:!0,data:{area:t||"general",insights:["What naturally calls to you in this area?","How might you contribute here beyond personal gain?","What difference could you make that would matter?","What wants to be expressed through your unique gifts?"],questions:["When you think about this area, what draws you most?","What would organizing your approach around contribution look like?","How might you serve something larger than your individual concerns here?"],context:n||"Exploring authentic contribution opportunities"},agent:this.agentName,message:"Exploring contribution opportunities in ".concat(t||"your life",". These insights can help you discover your authentic call to contribute.")}}catch(e){return{success:!1,error:"Contribution exploration failed: ".concat(e.message),agent:this.agentName}}}},{key:"distinguishCommitment",value:function(e){var t=e.statement;e.area;try{return{success:!0,data:{statement:t||"general",distinctions:{commitment:"Generative, creates possibility, serves something larger",wanting:"Comes from lack, focused on getting, personal agenda"},questions:["Is this arising from what you lack or from what you want to create?","Does this serve something larger than personal benefit?","Does thinking about this generate energy or drain energy?","Are you drawn to this or driven by shoulds/pressure?"],indicators:{commitment:["Energizing","Naturally arising","Serves others","Creates possibilities"],wanting:["Draining","Forced effort","Serves self","Consumes resources"]}},agent:this.agentName,message:"Distinguishing commitment from wanting. True commitment is always generative and serves something larger than personal gain."}}catch(e){return{success:!1,error:"Commitment distinction failed: ".concat(e.message),agent:this.agentName}}}},{key:"identifyLargerPurpose",value:function(e){var t=e.currentFocus,n=e.values;try{return{success:!0,data:{currentFocus:t||"unspecified",values:n||[],explorationQuestions:["What do you care about that extends beyond your personal circumstances?","What would you love to see different in the world?","When do you feel most alive and naturally generous?","What wants to be expressed through your unique gifts and perspective?","What legacy would you love to leave?"],indicators:["Something that naturally calls to you","Energizes rather than depletes you","Serves something larger than personal gain","Feels like authentic expression","Creates rather than consumes"],areas:["Family and relationships","Community and society","Professional contribution","Creative expression","Service to humanity","Environmental stewardship","Spiritual development","Knowledge and wisdom sharing"]},agent:this.agentName,message:"Exploring what you might be called to contribute that's larger than individual concerns. Your larger purpose often shows up as what naturally calls to you."}}catch(e){return{success:!1,error:"Purpose identification failed: ".concat(e.message),agent:this.agentName}}}},{key:"changeColor",value:function(e){var t=e.ColorCode;if(!t)return{success:!1,error:"ColorCode parameter is required",agent:this.agentName};try{var n=t.replace(/[^#a-fA-F0-9]/g,"");return document.body.style.backgroundColor=n,{success:!0,data:{colorCode:n},agent:this.agentName,message:"Changed background color to ".concat(n)}}catch(e){return{success:!1,error:"Color change failed: ".concat(e.message),agent:this.agentName}}}},{key:"writeText",value:function(e){var t=e.Text;if(!t)return{success:!1,error:"Text parameter is required",agent:this.agentName};try{var n=t.replace(/[<>]/g,""),r=document.getElementById("agent-text-output");r||((r=document.createElement("div")).id="agent-text-output",r.style.cssText="margin: 20px; padding: 15px; border: 1px solid #ccc; border-radius: 5px; background-color: #f9f9f9;",document.body.appendChild(r));var i=(new Date).toLocaleTimeString();return r.innerHTML+="<p><strong>[".concat(i,"] ").concat(this.agentName,":</strong> ").concat(n,"</p>"),{success:!0,data:{text:n},agent:this.agentName,message:"".concat(this.agentName,' wrote: "').concat(n,'"')}}catch(e){return{success:!1,error:"Text writing failed: ".concat(e.message),agent:this.agentName}}}}],t&&R(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||G(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function G(e,t){if(e){if("string"==typeof e)return Y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(e,t):void 0}}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var H=new Map([["being cause in the matter definition",{category:"core_distinction",content:"Being Cause In The Matter means recognizing yourself as the source of your experience rather than being at the effect of circumstances. When you're cause in the matter, you take ownership of your experience without blame, access extraordinary power and freedom, and transform from victim consciousness to creator consciousness. This is not about controlling circumstances but about being the source of your relationship to whatever happens.",keywords:["cause in the matter","source of experience","ownership without blame","creator consciousness","extraordinary power"]}],["cause vs effect fundamental",{category:"core_distinction",content:'The fundamental distinction between being "at cause" versus "at effect." At cause means you are the source of your experience - life happens THROUGH you. At effect means circumstances control your experience - life happens TO you. This shift in orientation creates access to extraordinary power and effectiveness because you stop being a victim of circumstances.',keywords:["cause vs effect","source of experience","life through you","life to you","victim of circumstances"]}],["source vs circumstance",{category:"core_distinction",content:"You are the source of your experience, not your circumstances. Circumstances are neutral events - your relationship to them creates your experience. When you recognize yourself as source rather than making circumstances the source, you access the power to transform any situation. Circumstances don't determine experience; your relationship to circumstances does.",keywords:["source vs circumstance","circumstances neutral","relationship to circumstances","transform any situation","relationship determines experience"]}],["ownership without blame",{category:"ownership",content:'Taking ownership of your experience without making yourself wrong or bad. Ownership creates power; blame creates victimhood. When you own your part in creating your experience, you access the power to transform it. This is about seeing your causation, not punishing yourself for it. The question is "How did I create this?" not "How am I bad?"',keywords:["ownership without blame","ownership creates power","blame creates victimhood","how did I create this","not punishing yourself"]}],["ownership vs responsibility",{category:"ownership",content:"Ownership in this context is different from moral responsibility or blame. Ownership is about recognizing your power and causation in creating your experience. Moral responsibility is about right/wrong and good/bad. Ownership is value-neutral and focused on accessing power to create change. You can own your part without making yourself wrong.",keywords:["ownership vs responsibility","recognize your power","value-neutral","access power to create change","own without wrong"]}],["the power of ownership",{category:"ownership",content:"When you take full ownership of your experience, extraordinary power becomes available. You stop wasting energy on blame, complaint, and justification. All that energy becomes available for creating what you want. Ownership transforms you from powerless victim to powerful creator. This is why ownership is so transformational.",keywords:["power of ownership","extraordinary power available","stop wasting energy","powerless victim to powerful creator","transformational"]}],["owning your part",{category:"ownership",content:"In any situation, there's always some part you can own - your response, your choices, your interpretations, your actions or inactions. Even when circumstances seem completely outside your control, you can own your relationship to those circumstances. Finding what you can own gives you access to power in any situation.",keywords:["owning your part","your response choices interpretations","own your relationship","access to power","any situation"]}],["victim consciousness",{category:"consciousness",content:'Victim consciousness is the experience of being at the effect of circumstances with limited power and options. It\'s characterized by blame, complaint, justification, and feeling powerless. Common phrases: "It\'s not my fault," "They made me," "I had no choice," "Why is this happening to me?" Victim consciousness keeps you stuck and reactive.',keywords:["victim consciousness","effect of circumstances","blame complaint justification","feeling powerless","keeps you stuck reactive"]}],["creator consciousness",{category:"consciousness",content:'Creator consciousness is the experience of being the source and author of your life. You see yourself as powerful and responsible for creating your experience. Common phrases: "How did I create this?" "What can I do?" "What\'s my part?" "How can I respond powerfully?" Creator consciousness gives you access to unlimited possibility and effectiveness.',keywords:["creator consciousness","source and author","powerful and responsible","unlimited possibility","effectiveness"]}],["shifting consciousness",{category:"consciousness",content:"The shift from victim consciousness to creator consciousness is often instantaneous and always available. It requires giving up the stories that make you right about being a victim and taking on the possibility that you have more power than you've been willing to acknowledge. This shift is the foundation of all transformation.",keywords:["shifting consciousness","instantaneous always available","give up victim stories","more power than acknowledged","foundation of transformation"]}],["victim stories",{category:"consciousness",content:"Victim stories are narratives that explain why you're powerless and not responsible for your experience. They often sound reasonable and true, which is what makes them so seductive. These stories protect you from feeling responsible but cost you your power. Transformation requires being willing to give up being right about your victim stories.",keywords:["victim stories","explain why powerless","sound reasonable and true","protect from responsible","cost you power"]}],["authoring vs reacting",{category:"authoring",content:"Authoring your life means creating your experience rather than just reacting to circumstances. When you're authoring, you're proactive rather than reactive, creative rather than responsive. You take the pen of your life back from circumstances and become the writer of your story rather than a character in someone else's story.",keywords:["authoring vs reacting","creating vs reacting","proactive vs reactive","take the pen back","writer of your story"]}],["taking the pen back",{category:"authoring",content:"When you're at effect, it's as if circumstances have the pen and are writing your story. Taking the pen back means reclaiming your power to author your experience regardless of circumstances. You become the writer rather than being written. This is a choice available in every moment, no matter what's happening.",keywords:["taking the pen back","circumstances have the pen","reclaiming your power","writer rather than written","choice available every moment"]}],["being the author",{category:"authoring",content:"Being the author of your life means you create your experience through your choices, responses, and relationship to circumstances. Authors don't control what happens, but they do determine how the story unfolds through the choices they make. You can be the author of a powerful, meaningful story regardless of circumstances.",keywords:["being the author","create through choices responses","determine how story unfolds","powerful meaningful story","regardless of circumstances"]}],["proactive vs reactive",{category:"authoring",content:"Proactive means acting from your commitments and vision rather than reacting to circumstances. Reactive means your actions are determined by what happens to you. When you're proactive, you initiate based on what you want to create. When you're reactive, you respond based on what you want to avoid or fix.",keywords:["proactive vs reactive","acting from commitments vision","actions determined by circumstances","initiate vs respond","create vs avoid fix"]}],["extraordinary power access",{category:"power",content:"Being cause in the matter provides access to extraordinary power because you stop giving your power away to circumstances. All the energy you were using for blame, complaint, and justification becomes available for creating what you want. This power is always available; it's just usually given away to circumstances.",keywords:["extraordinary power access","stop giving power away","energy for creating","power always available","given away to circumstances"]}],["power vs force",{category:"power",content:"The power that comes from being cause is different from force. Force tries to control circumstances. Power comes from taking ownership of your relationship to circumstances. Force is exhausting and limited. Power is sustainable and unlimited because it comes from your relationship to what happens, not from controlling what happens.",keywords:["power vs force","force controls circumstances","power from ownership","force exhausting limited","power sustainable unlimited"]}],["reclaiming given away power",{category:"power",content:'Most people give their power away without realizing it by making circumstances responsible for their experience. Phrases like "You make me angry," "I have no choice," or "It\'s impossible because..." are all ways of giving power away. Reclaiming this power requires recognizing where you\'ve given it away and taking it back.',keywords:["reclaiming given away power","making circumstances responsible","giving power away","recognizing where given away","taking it back"]}],["power in impossible situations",{category:"power",content:"Even in seemingly impossible situations where you have no control over circumstances, you still have power in your relationship to those circumstances. You can choose your response, your interpretation, your attitude, and your next action. This power to choose your relationship is always available and can transform any experience.",keywords:["power impossible situations","no control over circumstances","choose response interpretation attitude","power to choose relationship","transform any experience"]}],["circumstances are neutral",{category:"circumstances",content:"Circumstances themselves are neutral events. They have no inherent meaning or power over your experience. The meaning and emotional impact come from your relationship to the circumstances, not from the circumstances themselves. Two people can have the same circumstances and completely different experiences based on their relationship to what happened.",keywords:["circumstances neutral","no inherent meaning","meaning from relationship","same circumstances different experiences","relationship to what happened"]}],["relationship to circumstances",{category:"circumstances",content:"Your relationship to circumstances is where your power lies. You cannot always control what happens, but you can always choose your relationship to what happens. This relationship includes your interpretation, your response, your attitude, and the meaning you give to events. Changing your relationship changes your entire experience.",keywords:["relationship to circumstances","where power lies","choose your relationship","interpretation response attitude meaning","changing relationship changes experience"]}],["response vs reaction",{category:"circumstances",content:"Response is conscious and comes from choice. Reaction is automatic and comes from conditioning. When you respond, you're being cause. When you react, you're being effect. Between any circumstance and your response is a space where you can choose. Expanding this space is key to being cause in the matter.",keywords:["response vs reaction","response conscious choice","reaction automatic conditioning","space to choose","expanding this space"]}],["the space of choice",{category:"circumstances",content:"Between any circumstance and your response is a space where choice exists. In this space, you can choose how to relate to what happened and how to respond. Most people collapse this space and react automatically. Expanding this space gives you access to being cause in the matter and responding powerfully.",keywords:["space of choice","between circumstance and response","choose how to relate","collapse this space","expanding space access to cause"]}],["instant transformation",{category:"transformation",content:"The shift from being at effect to being cause can happen instantaneously. It doesn't require changing circumstances, just changing your relationship to circumstances. This is why this work is so powerful - transformation is always available regardless of what's happening. It's a choice you can make in any moment.",keywords:["instant transformation","shift from effect to cause","changing relationship not circumstances","transformation always available","choice in any moment"]}],["breakthrough through ownership",{category:"transformation",content:"Breakthrough occurs when you take complete ownership of your experience without making yourself wrong. This ownership creates a clearing where new possibilities can emerge. What seemed impossible from victim consciousness becomes possible from creator consciousness. Ownership is the gateway to breakthrough.",keywords:["breakthrough through ownership","complete ownership without wrong","clearing for new possibilities","impossible becomes possible","ownership gateway to breakthrough"]}],["transforming stuck situations",{category:"transformation",content:'Any situation that seems stuck or hopeless can be transformed by shifting from being at effect to being cause. Instead of asking "Why is this happening to me?" ask "How am I creating this and what can I do?" This shift in question opens up possibilities that were invisible from victim consciousness.',keywords:["transforming stuck situations","stuck or hopeless transformed","shift effect to cause","how am I creating","opens up possibilities"]}],["the moment of choice",{category:"transformation",content:"In every moment, you have a choice between being cause or being effect. This choice is always available, regardless of circumstances. The moment you recognize this choice and choose to be cause, transformation begins. This recognition of choice is the foundation of all personal power.",keywords:["moment of choice","choice cause or effect","always available regardless circumstances","choose to be cause","recognition of choice foundation power"]}],["not about controlling circumstances",{category:"misconceptions",content:"Being cause in the matter is NOT about controlling circumstances or making everything go your way. It's about taking ownership of your experience and response to whatever happens. You can be completely cause in situations where you have no control over external events. The power is in your relationship to what happens.",keywords:["not controlling circumstances","ownership of experience and response","cause with no external control","power in relationship","not making everything go your way"]}],["not about blame or fault",{category:"misconceptions",content:"Being cause is not about blame, fault, or making yourself wrong for what happened. It's about recognizing your power to influence your experience. You can acknowledge your part in creating a situation without beating yourself up about it. The focus is on power and possibility, not punishment.",keywords:["not about blame fault","not making yourself wrong","recognizing power to influence","acknowledge without beating up","power and possibility not punishment"]}],["not denial of real challenges",{category:"misconceptions",content:"Being cause doesn't mean denying real challenges, injustices, or difficult circumstances. It means taking ownership of your response to these realities. You can acknowledge that something is genuinely difficult while also owning your power to respond to it effectively. It's both/and, not either/or.",keywords:["not denial real challenges","ownership of response to realities","acknowledge difficult and own power","both and not either or","respond effectively"]}],["not about perfection",{category:"misconceptions",content:"Being cause in the matter doesn't mean being perfect or never having problems. It means owning your experience and response rather than being a victim of circumstances. You can be cause in messy, imperfect situations. It's about power and choice, not about having everything together.",keywords:["not about perfection","not never having problems","owning experience and response","cause in messy situations","power and choice not everything together"]}]]);function q(){var e,t=new Set,n=W(H);try{for(n.s();!(e=n.n()).done;){var r=U(e.value,2),i=(r[0],r[1]);t.add(i.category)}}catch(e){n.e(e)}finally{n.f()}return Array.from(t).sort()}function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||$(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return K(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q(r.key),r)}}function Q(e){var t=function(e){if("object"!=V(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=V(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==V(t)?t:t+""}var X=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=H,this.agentName="Bart",console.log("".concat(this.agentName," Function Handler initialized")),function(){var e,t={},n=0,r=0,i=W(H);try{for(i.s();!(e=i.n()).done;){var o=U(e.value,2),a=(o[0],o[1]);n++,r+=a.keywords.length,t[a.category]?t[a.category]++:t[a.category]=1}}catch(e){i.e(e)}finally{i.f()}console.log("Bart Knowledge Base Stats:"),console.log("Total entries: ".concat(n)),console.log("Total keywords: ".concat(r)),console.log("Categories:",t)}()},t=[{key:"handleFunctionCall",value:function(e){var t=e.name,n=e.parameters;try{switch(t){case"SearchKnowledgeBase":return this.searchKnowledgeBase(n);case"AnalyzeCauseAndEffect":return this.analyzeCauseAndEffect(n);case"IdentifyVictimPatterns":return this.identifyVictimPatterns(n);case"ExploreOwnership":return this.exploreOwnership(n);case"TransformToCreator":return this.transformToCreator(n);case"ChangeColor":return this.changeColor(n);case"WriteText":return this.writeText(n);default:return console.warn("Unknown function: ".concat(t)),{success:!1,error:"Unknown function: ".concat(t),agent:this.agentName}}}catch(e){return console.error("Error in ".concat(this.agentName," function ").concat(t,":"),e),{success:!1,error:e.message,agent:this.agentName}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;if(!t||"string"!=typeof t)return{success:!1,error:"Query is required and must be a string",agent:this.agentName};try{var r,i=[],o=t.toLowerCase(),a=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=$(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=z(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c===o?u=100:c.includes(o)||o.includes(c)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)||o.includes(e.toLowerCase())})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push({key:c,category:l.category,content:l.content,keywords:l.keywords,relevance:u}))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5),h=d.length>0?"Found ".concat(d.length,' concept(s) about "').concat(t,"\" in Bart's knowledge base on being cause in the matter."):'No concepts found for "'.concat(t,'" in Bart\'s knowledge base. Try terms like "cause", "effect", "ownership", "victim", or "creator".');return{success:!0,data:{query:t,category:n||"all",results:d,totalFound:i.length,availableCategories:q()},agent:this.agentName,message:h}}catch(e){return{success:!1,error:"Search failed: ".concat(e.message),agent:this.agentName}}}},{key:"analyzeCauseAndEffect",value:function(e){var t=e.situation,n=e.currentExperience;try{return{success:!0,data:{situation:t||"unspecified",currentExperience:n||"unspecified",causeQuestions:["Where might you be the source of this experience?","How could you be creating or allowing this situation?","What choices led to this current experience?","What's your part in how this is going?"],effectIndicators:["Feeling like a victim of circumstances","Blaming others or external factors","Feeling powerless to change things","Waiting for circumstances to change first"],shiftToCause:["What can you own about this situation?","What choices do you have right now?","How can you respond powerfully?","What would taking the pen back look like?"],powerAccess:["Stop giving power away to circumstances","Own your response and relationship to what happened","Focus on what you can create rather than what you can't control",'Ask "How can I be cause?" instead of "Why is this happening to me?"']},agent:this.agentName,message:"Analyzing cause and effect patterns in your situation. The key is shifting from being at the effect of circumstances to being the cause of your experience."}}catch(e){return{success:!1,error:"Cause and effect analysis failed: ".concat(e.message),agent:this.agentName}}}},{key:"identifyVictimPatterns",value:function(e){var t=e.description,n=e.feelings;try{return{success:!0,data:{description:t||"general situation",feelings:n||[],commonVictimPhrases:["It's not my fault","They made me do it","I had no choice","Why is this happening to me?","I can't help it","It's impossible because..."],victimEmotions:["Powerlessness","Resentment","Blame","Frustration","Helplessness","Righteous indignation"],underlyingBeliefs:["Circumstances control my experience","Others are responsible for how I feel","I have no power in this situation","Life happens TO me, not through me"],transformationQuestions:["What story am I telling myself about being powerless here?","How might I be giving my power away?","What would I need to own to access my power?","Where am I making circumstances responsible for my experience?"]},agent:this.agentName,message:"Identifying victim consciousness patterns. Recognition is the first step toward transformation to creator consciousness."}}catch(e){return{success:!1,error:"Victim pattern identification failed: ".concat(e.message),agent:this.agentName}}}},{key:"exploreOwnership",value:function(e){var t=e.situation,n=e.resistance;try{return{success:!0,data:{situation:t||"general",resistance:n||"none specified",ownershipAreas:["Your response to what happened","Your interpretation and meaning-making","Your choices and actions (or inactions)","Your communication and requests","Your boundaries and standards","Your relationship to the circumstances"],notOwnership:["Other people's choices and actions","Natural disasters or accidents","Historical events or past circumstances","Other people's feelings or reactions"],ownershipQuestions:["What choices did I make that contributed to this?","How did I respond or fail to respond?","What did I communicate or fail to communicate?","What boundaries did I set or fail to set?","How am I relating to this situation?"],withoutBlame:["Ownership is about power, not punishment","You can own your part without making yourself wrong","The goal is accessing power to create change","Blame keeps you stuck; ownership sets you free"]},agent:this.agentName,message:"Exploring ownership opportunities without self-blame. The key is owning what you can to access your power to create change."}}catch(e){return{success:!1,error:"Ownership exploration failed: ".concat(e.message),agent:this.agentName}}}},{key:"transformToCreator",value:function(e){var t=e.currentStory,n=e.desiredOutcome;try{return{success:!0,data:{currentStory:t||"not specified",desiredOutcome:n||"not specified",victimToCreatorShifts:{"Why is this happening to me?":"How am I creating this and what can I do?","It's not my fault":"What's my part in this?","I have no choice":"What choices do I have?","They made me":"How did I allow this?","I can't help it":"What can I take responsibility for?","It's impossible":"What would I need to own to make this possible?"},creatorQualities:["Takes ownership without blame","Focuses on response rather than circumstances","Asks empowering questions","Sees choices where others see limitations","Creates possibilities rather than reasons why not"],actionSteps:["Identify what you can own in this situation","Stop telling victim stories about what happened","Focus on what you can create rather than what you can't control","Take one action that demonstrates you're cause in the matter",'Practice asking "How can I respond powerfully?" in every situation']},agent:this.agentName,message:"Transforming from victim to creator consciousness. This shift opens access to extraordinary power and possibility."}}catch(e){return{success:!1,error:"Creator transformation failed: ".concat(e.message),agent:this.agentName}}}},{key:"changeColor",value:function(e){var t=e.ColorCode;if(!t)return{success:!1,error:"ColorCode parameter is required",agent:this.agentName};try{var n=t.replace(/[^#a-fA-F0-9]/g,"");return document.body.style.backgroundColor=n,{success:!0,data:{colorCode:n},agent:this.agentName,message:"Changed background color to ".concat(n)}}catch(e){return{success:!1,error:"Color change failed: ".concat(e.message),agent:this.agentName}}}},{key:"writeText",value:function(e){var t=e.Text;if(!t)return{success:!1,error:"Text parameter is required",agent:this.agentName};try{var n=t.replace(/[<>]/g,""),r=document.getElementById("agent-text-output");r||((r=document.createElement("div")).id="agent-text-output",r.style.cssText="margin: 20px; padding: 15px; border: 1px solid #ccc; border-radius: 5px; background-color: #f9f9f9;",document.body.appendChild(r));var i=(new Date).toLocaleTimeString();return r.innerHTML+="<p><strong>[".concat(i,"] ").concat(this.agentName,":</strong> ").concat(n,"</p>"),{success:!0,data:{text:n},agent:this.agentName,message:"".concat(this.agentName,' wrote: "').concat(n,'"')}}catch(e){return{success:!1,error:"Text writing failed: ".concat(e.message),agent:this.agentName}}}}],t&&J(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||te(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=te(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function te(e,t){if(e){if("string"==typeof e)return ne(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var re=new Map([["language creates reality",{category:"core_principles",content:"Language is not merely descriptive but fundamentally generative and constitutive of reality. The words we choose don't just reflect our experience; they actively create our experience and determine what becomes possible. This is why conscious language choice is so powerful - you're literally shaping reality through your word choices.",keywords:["language creates reality","generative","constitutive","shapes reality","word choices"]}],["generative vs descriptive language",{category:"core_principles",content:'Generative language creates new possibilities and opens up action, while descriptive language merely reports on existing conditions and often closes down options. "I\'m committed to finding a way" (generative) vs. "It\'s hard" (descriptive). Generative language is the foundation of transformation because it creates what it speaks.',keywords:["generative language","descriptive language","creates possibilities","opens action","foundation transformation"]}],["precision in language",{category:"core_principles",content:"The precision with which you can make distinctions in language directly correlates to the precision with which you can create in life. Vague, abstract language creates confusion and limitation. Specific, precise language creates clarity and actionable possibilities. Precision is power.",keywords:["precision in language","precision in life","vague abstract language","specific precise language","precision is power"]}],["unconscious language patterns",{category:"core_principles",content:"Most people have unconscious linguistic habits that consistently create limitation, blame, or victimhood. These patterns are inherited from family, culture, and past experience. Becoming conscious of these patterns is the first step to linguistic transformation and accessing greater possibility.",keywords:["unconscious language patterns","linguistic habits","create limitation","inherited patterns","conscious transformation"]}],["language of obligation",{category:"limiting_patterns",content:'Phrases like "I have to," "I should," "I must," and "I need to" create the experience of being forced or compelled rather than choosing. This language removes your sense of choice and power. Alternative: "I choose to," "I want to," "I\'m committed to," which restore choice and empowerment.',keywords:["language of obligation","have to should must","removes choice","forced compelled","restore choice empowerment"]}],["language of impossibility",{category:"limiting_patterns",content:'Phrases like "I can\'t," "It\'s impossible," "There\'s no way," and "I could never" shut down possibility before it can be explored. This language creates artificial limitations. Alternative: "I haven\'t figured out how yet," "It\'s challenging," "I don\'t currently see how," which keep possibility alive.',keywords:["language impossibility","cant impossible no way","shut down possibility","artificial limitations","keep possibility alive"]}],["language of victimization",{category:"limiting_patterns",content:'Phrases like "You make me feel," "They made me," "I had no choice," and "It happened to me" give away your power to external circumstances. This language reinforces victim consciousness. Alternative: "I feel," "I chose," "I allowed," which restore personal power and responsibility.',keywords:["language victimization","you make me feel","give away power","victim consciousness","restore personal power"]}],["generalizations and deletions",{category:"limiting_patterns",content:'Vague generalizations like "everyone," "always," "never," "everything," and "nothing" delete important information and create oversimplified, limiting perspectives. Specific language reveals options and possibilities that generalizations hide. Ask: "Who specifically? What specifically? When specifically?"',keywords:["generalizations deletions","everyone always never","delete information","oversimplified limiting","who what when specifically"]}],["emotional causation language",{category:"limiting_patterns",content:'Language that makes others responsible for your emotions: "You frustrate me," "This is annoying," "They upset me." This gives away emotional power. Owning language: "I feel frustrated," "I\'m experiencing annoyance," "I\'m upset" restores emotional ownership and choice.',keywords:["emotional causation","others responsible emotions","gives away emotional power","owning language","emotional ownership choice"]}],["language of choice",{category:"empowering_patterns",content:'Language that restores choice and personal power: "I choose to," "I want to," "I\'m committed to," "I prefer to." This language acknowledges that even when options are limited, you still have the power to choose your response and relationship to circumstances.',keywords:["language of choice","choose want committed","restores choice power","power to choose response","relationship to circumstances"]}],["language of possibility",{category:"empowering_patterns",content:'Language that keeps possibility alive even in challenging situations: "I haven\'t figured out how yet," "I\'m learning how to," "I\'m developing the capacity to," "I\'m open to discovering." This language maintains hope and keeps you in action rather than resignation.',keywords:["language possibility","havent figured out yet","learning developing","open to discovering","maintains hope action"]}],["language of ownership",{category:"empowering_patterns",content:'Language that takes ownership without blame: "I created," "I allowed," "I chose," "I contributed to," "My part was." This language restores power by acknowledging causation without self-attack. It opens up the possibility of creating different results.',keywords:["language ownership","created allowed chose","ownership without blame","acknowledges causation","creating different results"]}],["language of commitment",{category:"empowering_patterns",content:'Language that expresses authentic commitment: "I stand for," "I\'m committed to," "I give my word," "I promise." This language creates accountability and generates resources to fulfill what you\'re committed to. Commitment language is generative and powerful.',keywords:["language commitment","stand for committed","give word promise","creates accountability","generates resources"]}],["present moment language",{category:"empowering_patterns",content:'Language that grounds you in present reality rather than past regret or future worry: "Right now I am," "Currently I\'m experiencing," "In this moment I choose." Present moment language creates access to power and choice that exists only in the now.',keywords:["present moment language","right now currently","grounds present reality","past regret future worry","power choice in now"]}],["nominalizations",{category:"abstractions",content:'Nominalizations turn processes (verbs) into things (nouns), which can hide responsibility and action. "Communication" instead of "communicating," "relationship" instead of "relating," "decision" instead of "deciding." Converting back to process language reveals choice and action: "How are you communicating?" not "How is the communication?"',keywords:["nominalizations","processes into things","hide responsibility action","communication relationship decision","process language reveals choice"]}],["mind reading assumptions",{category:"abstractions",content:'Language that assumes you know what others think or feel: "He doesn\'t care," "She thinks I\'m stupid," "They don\'t want me here." This creates story and drama based on assumptions. More accurate: "I\'m interpreting his behavior as not caring," "I\'m telling myself she thinks I\'m stupid."',keywords:["mind reading assumptions","assume know others think","creates story drama","interpreting behavior","telling myself"]}],["universal quantifiers",{category:"abstractions",content:'All-or-nothing language: "Everyone," "no one," "always," "never," "everything," "nothing." These absolutist terms delete exceptions and create rigid thinking. More accurate: "Most people," "rarely," "often," "some things," which acknowledge complexity and possibility.',keywords:["universal quantifiers","all or nothing","everyone always never","delete exceptions","acknowledge complexity possibility"]}],["cause and effect distortions",{category:"abstractions",content:'Language that implies direct causation where complex relationships exist: "Stress causes illness," "Money creates happiness," "Criticism makes people defensive." More accurate: "Stress can contribute to illness," "Money can enable happiness," "People often respond defensively to criticism."',keywords:["cause effect distortions","implies direct causation","complex relationships","contributes enables","respond defensively"]}],["reframing language",{category:"transformation",content:'Language that shifts perspective from problem to possibility: "Challenge" instead of "problem," "opportunity" instead of "obstacle," "learning" instead of "failure," "feedback" instead of "criticism." This reframing language doesn\'t deny reality but creates a more empowering relationship to it.',keywords:["reframing language","challenge instead problem","opportunity obstacle","learning failure","empowering relationship"]}],["outcome oriented language",{category:"transformation",content:'Language focused on what you want to create rather than what you want to avoid: "I want clear communication" vs. "I don\'t want miscommunication," "I choose to be healthy" vs. "I don\'t want to be sick." Positive language directs energy toward desired outcomes.',keywords:["outcome oriented","what want create","what want avoid","positive language","directs energy desired outcomes"]}],["action oriented language",{category:"transformation",content:'Language that moves from static description to dynamic action: "I\'m developing" vs. "I am," "I\'m creating" vs. "I have," "I\'m learning" vs. "I know." Action language keeps you in motion and growth rather than fixed identity.',keywords:["action oriented","developing vs am","creating vs have","learning vs know","motion growth fixed identity"]}],["specific request language",{category:"transformation",content:'Clear, specific language for making requests: "Would you be willing to call me by Thursday at 3pm?" vs. "Could you get back to me soon?" Specific requests create clarity and increase the likelihood of getting what you want. Vague requests create confusion and disappointment.',keywords:["specific request language","call by Thursday 3pm","get back soon","creates clarity","vague creates confusion"]}],["sensory specific language",{category:"precision",content:'Language that references specific, observable behavior rather than interpretations: "He spoke quietly and looked down" vs. "He was sad," "She interrupted me three times" vs. "She\'s rude." Sensory specific language reduces misunderstanding and increases accuracy.',keywords:["sensory specific","observable behavior","spoke quietly looked down","interrupted three times","reduces misunderstanding"]}],["time specific language",{category:"precision",content:'Language that specifies when something happened or will happen: "Yesterday at 2pm" vs. "recently," "By Friday" vs. "soon," "Every Tuesday" vs. "regularly." Time specific language creates accountability and clear expectations.',keywords:["time specific","yesterday 2pm recently","by Friday soon","every Tuesday regularly","accountability clear expectations"]}],["quantity specific language",{category:"precision",content:'Language that specifies amounts rather than vague quantities: "Three times this week" vs. "often," "20 minutes" vs. "a while," "$500" vs. "expensive." Specific quantities create clarity and enable evaluation and planning.',keywords:["quantity specific","three times often","twenty minutes while","500 expensive","clarity evaluation planning"]}],["context specific language",{category:"precision",content:'Language that clarifies the situation or circumstances: "In team meetings" vs. "at work," "When discussing money" vs. "in our relationship," "During high stress periods" vs. "sometimes." Context specificity reveals patterns and enables targeted solutions.',keywords:["context specific","team meetings at work","discussing money relationship","high stress sometimes","reveals patterns targeted solutions"]}],["language of personal power",{category:"power",content:'Language that claims and expresses personal power: "I decide," "I create," "I choose," "I stand for," "I\'m responsible for." This language positions you as the source of your experience rather than at the effect of circumstances. It\'s the language of leadership and self-determination.',keywords:["language personal power","decide create choose","stand for responsible","source of experience","leadership self-determination"]}],["language of influence",{category:"power",content:'Language that creates influence through invitation rather than force: "Would you be willing to consider," "I invite you to," "What if we," "I propose." Invitational language enrolls others rather than pushes them, creating genuine engagement and cooperation.',keywords:["language influence","invitation rather force","willing consider invite","what if propose","enrolls genuine engagement"]}],["declarative language",{category:"power",content:'Language that declares new realities into existence: "I declare myself committed to," "I stand for," "From now on I am," "This is who I am being." Declarations are speech acts that create new possibilities and identities through the power of language itself.',keywords:["declarative language","declares new realities","declare committed stand for","speech acts create","new possibilities identities"]}],["accountability language",{category:"power",content:'Language that creates clear accountability: "I give my word," "I promise," "You can count on me to," "I commit to." This language creates trust and reliability through clear commitments. It\'s the foundation of effective relationships and teamwork.',keywords:["accountability language","give word promise","count on commit","creates trust reliability","effective relationships teamwork"]}]]);function ie(){var e,t=new Set,n=ee(re);try{for(n.s();!(e=n.n()).done;){var r=Z(e.value,2),i=(r[0],r[1]);t.add(i.category)}}catch(e){n.e(e)}finally{n.f()}return Array.from(t).sort()}function oe(e){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(e)}function ae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||ce(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ce(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ce(e,t){if(e){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,de(r.key),r)}}function de(e){var t=function(e){if("object"!=oe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oe(t)?t:t+""}var he=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=re,this.agentName="Luigi",console.log("".concat(this.agentName," Function Handler initialized")),function(){var e,t={},n=0,r=0,i=ee(re);try{for(i.s();!(e=i.n()).done;){var o=Z(e.value,2),a=(o[0],o[1]);n++,r+=a.keywords.length,t[a.category]?t[a.category]++:t[a.category]=1}}catch(e){i.e(e)}finally{i.f()}console.log("Luigi Knowledge Base Stats:"),console.log("Total entries: ".concat(n)),console.log("Total keywords: ".concat(r)),console.log("Categories:",t)}()},(t=[{key:"handleFunctionCall",value:function(e){var t=e.name,n=e.parameters;try{switch(t){case"SearchKnowledgeBase":return this.searchKnowledgeBase(n);case"AnalyzeLanguagePatterns":return this.analyzeLanguagePatterns(n);case"TransformLimitingLanguage":return this.transformLimitingLanguage(n);case"CreatePreciseLanguage":return this.createPreciseLanguage(n);case"IdentifyAbstractions":return this.identifyAbstractions(n);case"ChangeColor":return this.changeColor(n);case"WriteText":return this.writeText(n);default:return console.warn("Unknown function: ".concat(t)),{success:!1,error:"Unknown function: ".concat(t),agent:this.agentName}}}catch(e){return console.error("Error in ".concat(this.agentName," function ").concat(t,":"),e),{success:!1,error:e.message,agent:this.agentName}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;if(!t||"string"!=typeof t)return{success:!1,error:"Query is required and must be a string",agent:this.agentName};try{var r,i=[],o=t.toLowerCase(),a=se(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=ae(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c===o?u=100:c.includes(o)||o.includes(c)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)||o.includes(e.toLowerCase())})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push({key:c,category:l.category,content:l.content,keywords:l.keywords,relevance:u}))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5),h=d.length>0?"Found ".concat(d.length,' concept(s) about "').concat(t,"\" in Luigi's knowledge base on linguistic abstractions."):'No concepts found for "'.concat(t,'" in Luigi\'s knowledge base. Try terms like "language patterns", "abstractions", "precision", or "empowering language".');return{success:!0,data:{query:t,category:n||"all",results:d,totalFound:i.length,availableCategories:ie()},agent:this.agentName,message:h}}catch(e){return{success:!1,error:"Search failed: ".concat(e.message),agent:this.agentName}}}},{key:"analyzeLanguagePatterns",value:function(e){var t=e.text,n=e.focus;try{return{success:!0,data:{originalText:t||"No text provided",focus:n||"general patterns",limitingPatterns:{obligation:this.findPatterns(t,["have to","should","must","need to"]),impossibility:this.findPatterns(t,["can't","impossible","no way","never"]),victimization:this.findPatterns(t,["you make me","they made me","had no choice"]),generalizations:this.findPatterns(t,["everyone","always","never","everything","nothing"])},empoweringAlternatives:{"have to":"choose to","can't":"haven't figured out how yet",impossible:"challenging","you make me feel":"I feel",everyone:"some people",always:"often",never:"rarely"},questions:["What does this language assume about your choices?","How might this language limit your possibilities?","What would it sound like to express this in an empowering way?","How does this language affect your sense of power?"]},agent:this.agentName,message:"Analyzing language patterns for limiting and empowering elements. Language awareness is the first step to linguistic transformation."}}catch(e){return{success:!1,error:"Language analysis failed: ".concat(e.message),agent:this.agentName}}}},{key:"transformLimitingLanguage",value:function(e){var t=e.limitingPhrase,n=e.context;try{var r={originalPhrase:t||"No phrase provided",context:n||"general",transformationMap:{"I have to":"I choose to","I can't":"I haven't figured out how yet","It's impossible":"It's challenging","You make me feel":"I feel","I should":"I want to","I need to":"I'm committed to","I had no choice":"I chose the best option available","Everyone always":"Some people sometimes","It's not my fault":"What's my part in this?","I'm stuck":"I'm exploring options"},principles:["Restore choice and personal power","Keep possibility alive even in challenges","Own your experience without blame","Be specific rather than abstract","Focus on what you can create rather than what you can't control"],practice:["Notice when you use limiting language",'Pause and ask "How could I say this in an empowering way?"',"Practice new phrasings until they become natural","Pay attention to how different language feels"]},i=null==t?void 0:t.toLowerCase();return i&&r.transformationMap[i]&&(r.suggestedTransformation=r.transformationMap[i]),{success:!0,data:r,agent:this.agentName,message:"Transforming limiting language into empowering language. Small shifts in language can create big shifts in possibility."}}catch(e){return{success:!1,error:"Language transformation failed: ".concat(e.message),agent:this.agentName}}}},{key:"createPreciseLanguage",value:function(e){var t=e.vagueTerm,n=e.situation;try{return{success:!0,data:{vagueTerm:t||"not specified",situation:n||"general",precisionQuestions:["Who specifically?","What specifically?","When specifically?","Where specifically?","How specifically?","How much/many specifically?"],commonVagueTerms:{things:"What specific things?",people:"Which specific people?",communication:"How are you communicating?",relationship:"How are you relating?",problems:"What specific challenges?",issues:"What particular concerns?",stuff:"What specific items or topics?",it:'What specifically does "it" refer to?'},benefits:["Clarity enables effective action","Specificity reveals hidden assumptions","Precision creates accountability","Clear language produces clear results","Vague language creates vague outcomes"],examples:{vague:"Things aren't working in our relationship",precise:"Our communication about household responsibilities needs improvement",vague2:"I need to get better at communication",precise2:"I want to practice listening without interrupting and asking clarifying questions"}},agent:this.agentName,message:"Creating more precise, specific language. Precision in language creates precision in life and results."}}catch(e){return{success:!1,error:"Precision language creation failed: ".concat(e.message),agent:this.agentName}}}},{key:"identifyAbstractions",value:function(e){var t=e.statement,n=e.type;try{return{success:!0,data:{originalStatement:t||"No statement provided",type:n||"general",abstractionTypes:{nominalizations:{description:"Processes turned into things",examples:["communication","relationship","decision","management"],question:"How are you [verb-ing]?"},deletions:{description:"Missing specific information",examples:["They don't understand","It's broken","Things are bad"],question:"What/who specifically?"},generalizations:{description:"Universal statements",examples:["Everyone","always","never","all","none"],question:"Everyone? Always? Never?"},mindReading:{description:"Assuming others' thoughts/feelings",examples:["He doesn't care","She thinks I'm stupid"],question:"How do you know? What evidence?"}},recoveryQuestions:["What specifically are you referring to?","How do you know this?","Who specifically?","What would this look like if it were happening?","What evidence supports this statement?"],impact:["Abstractions hide important information","They create confusion and misunderstanding","They limit options and possibilities","They prevent clear action and solutions","They maintain problems rather than resolving them"]},agent:this.agentName,message:"Identifying linguistic abstractions and their impact. Recovery questions help restore the missing information."}}catch(e){return{success:!1,error:"Abstraction identification failed: ".concat(e.message),agent:this.agentName}}}},{key:"findPatterns",value:function(e,t){if(!e)return[];var n,r=[],i=e.toLowerCase(),o=se(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;i.includes(a.toLowerCase())&&r.push(a)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"changeColor",value:function(e){var t=e.ColorCode;if(!t)return{success:!1,error:"ColorCode parameter is required",agent:this.agentName};try{var n=t.replace(/[^#a-fA-F0-9]/g,"");return document.body.style.backgroundColor=n,{success:!0,data:{colorCode:n},agent:this.agentName,message:"Changed background color to ".concat(n)}}catch(e){return{success:!1,error:"Color change failed: ".concat(e.message),agent:this.agentName}}}},{key:"writeText",value:function(e){var t=e.Text;if(!t)return{success:!1,error:"Text parameter is required",agent:this.agentName};try{var n=t.replace(/[<>]/g,""),r=document.getElementById("agent-text-output");r||((r=document.createElement("div")).id="agent-text-output",r.style.cssText="margin: 20px; padding: 15px; border: 1px solid #ccc; border-radius: 5px; background-color: #f9f9f9;",document.body.appendChild(r));var i=(new Date).toLocaleTimeString();return r.innerHTML+="<p><strong>[".concat(i,"] ").concat(this.agentName,":</strong> ").concat(n,"</p>"),{success:!0,data:{text:n},agent:this.agentName,message:"".concat(this.agentName,' wrote: "').concat(n,'"')}}catch(e){return{success:!1,error:"Text writing failed: ".concat(e.message),agent:this.agentName}}}}])&&ue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||fe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=fe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function fe(e,t){if(e){if("string"==typeof e)return me(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ye=new Map([["phenomena definition",{category:"core_concepts",content:"A phenomenon is what shows up in direct experience before interpretation, story, or meaning-making. It is the raw, observable facts of experience without any added significance or narrative. Phenomena are neutral and exist independently of our interpretations about them.",keywords:["phenomena","direct experience","observable facts","neutral","before interpretation"]}],["phenomenon vs interpretation",{category:"distinctions",content:'The fundamental distinction between what actually happened (phenomenon) and the meaning we add to it (interpretation). For example: Phenomenon - "He didn\'t call." Interpretation - "He doesn\'t care about me." The phenomenon is neutral; the interpretation creates the emotional experience.',keywords:["phenomenon vs interpretation","what happened vs meaning","neutral vs emotional","facts vs story"]}],["phenomenological reduction",{category:"methods",content:'The practice of stripping away interpretations, assumptions, and meaning to get to the bare phenomenon itself. This involves asking: "What exactly happened? What are the observable facts? What would a video camera have recorded?"',keywords:["phenomenological reduction","stripping away interpretations","observable facts","video camera test"]}],["story vs experience",{category:"distinctions",content:"Story is the narrative we create about experience, while experience is what actually happens in the present moment. People often live in their stories about experience rather than in the experience itself, which creates suffering and limits authentic response.",keywords:["story vs experience","narrative about experience","present moment","authentic response"]}],["meaning making awareness",{category:"awareness",content:"Recognizing that meaning-making is something we do to experience, not something inherent in experience itself. The same phenomenon can have completely different meanings for different people. Awareness of meaning-making as optional creates freedom.",keywords:["meaning making","optional meaning","inherent vs added","creates freedom"]}],["present moment phenomena",{category:"presence",content:"Phenomena exist only in the present moment. When we're in story about experience, we're not actually experiencing - we're thinking about experience. Returning to present moment phenomena creates presence and authenticity.",keywords:["present moment","phenomena exist now","thinking vs experiencing","presence authenticity"]}],["authentic response",{category:"response",content:"When you respond to phenomena rather than your stories about phenomena, your response is more authentic, effective, and appropriate to what's actually happening. This requires distinguishing between what happened and what you made it mean.",keywords:["authentic response","respond to phenomena","effective appropriate","what happened vs what made it mean"]}],["suffering and story",{category:"transformation",content:"Most suffering comes not from what happens, but from the story we tell ourselves about what happens. By distinguishing phenomena from interpretation, we can address the source of suffering - our meaning-making rather than our circumstances.",keywords:["suffering from story","not from what happens","meaning-making source","address interpretation"]}]]);function ve(){var e,t=new Set,n=ge(ye);try{for(n.s();!(e=n.n()).done;){var r=pe(e.value,2),i=(r[0],r[1]);t.add(i.category)}}catch(e){n.e(e)}finally{n.f()}return Array.from(t).sort()}function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach(function(t){Se(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Se(e,t,n){return(t=Ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||Ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){if(e){if("string"==typeof e)return Te(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Te(e,t):void 0}}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ie(r.key),r)}}function Ie(e){var t=function(e){if("object"!=be(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==be(t)?t:t+""}var Ae=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=ye,this.agentName="Peter",console.log("".concat(this.agentName," Function Handler initialized")),function(){var e,t={},n=0,r=0,i=ge(ye);try{for(i.s();!(e=i.n()).done;){var o=pe(e.value,2),a=(o[0],o[1]);n++,r+=a.keywords.length,t[a.category]?t[a.category]++:t[a.category]=1}}catch(e){i.e(e)}finally{i.f()}console.log("Peter Knowledge Base Stats:",{totalEntries:n,totalKeywords:r,categories:t})}()},t=[{key:"handleFunctionCall",value:function(e){var t=e.name,n=e.parameters;try{switch(t){case"SearchKnowledgeBase":return this.searchKnowledgeBase(n);case"DistinguishPhenomena":return this.distinguishPhenomena(n);case"IdentifyStories":return this.identifyStories(n);case"ChangeColor":return this.changeColor(n);case"WriteText":return this.writeText(n);default:return{success:!1,error:"Unknown function: ".concat(t),agent:this.agentName}}}catch(e){return{success:!1,error:e.message,agent:this.agentName}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;if(!t)return{success:!1,error:"Query required",agent:this.agentName};var r,i=[],o=t.toLowerCase(),a=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ee(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=ke(r.value,2),c=s[0],l=s[1];if(!n||l.category===n){var u=0;c===o?u=100:c.includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push(_e(_e({key:c},l),{},{relevance:u}))}}}catch(e){a.e(e)}finally{a.f()}return i.sort(function(e,t){return t.relevance-e.relevance}),{success:!0,data:{query:t,results:i.slice(0,5),availableCategories:ve()},agent:this.agentName,message:"Found ".concat(i.length,' concept(s) about "').concat(t,'" in phenomenological knowledge base.')}}},{key:"distinguishPhenomena",value:function(e){return e.description,{success:!0,data:{analysis:"Distinguishing between phenomena and interpretation",questions:["What exactly happened, without interpretation?","What story are you telling yourself about what that means?","What would a video camera have recorded?","How does that story affect your experience?"]},agent:this.agentName,message:"Helping distinguish phenomena from interpretation for greater clarity."}}},{key:"identifyStories",value:function(e){return e.situation,{success:!0,data:{guidance:"Identifying stories vs direct experience",indicators:["When you add meaning to facts","When you interpret others' actions","When you predict future outcomes","When you connect unrelated events"]},agent:this.agentName,message:"Identifying stories and interpretations that may be creating suffering."}}},{key:"changeColor",value:function(e){var t=e.ColorCode;if(!t)return{success:!1,error:"ColorCode required",agent:this.agentName};try{return document.body.style.backgroundColor=t.replace(/[^#a-fA-F0-9]/g,""),{success:!0,data:{colorCode:t},agent:this.agentName,message:"Changed color to ".concat(t)}}catch(e){return{success:!1,error:e.message,agent:this.agentName}}}},{key:"writeText",value:function(e){var t,n=e.Text;if(!n)return{success:!1,error:"Text required",agent:this.agentName};try{var r=document.getElementById("agent-text-output")||((t=document.createElement("div")).id="agent-text-output",t.style.cssText="margin: 20px; padding: 15px; border: 1px solid #ccc; border-radius: 5px; background-color: #f9f9f9;",document.body.appendChild(t),t),i=n.replace(/[<>]/g,""),o=(new Date).toLocaleTimeString();return r.innerHTML+="<p><strong>[".concat(o,"] ").concat(this.agentName,":</strong> ").concat(i,"</p>"),{success:!0,data:{text:i},agent:this.agentName,message:"".concat(this.agentName,' wrote: "').concat(i,'"')}}catch(e){return{success:!1,error:e.message,agent:this.agentName}}}}],t&&Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Oe=new Map([["domain definition",{category:"core_concepts",content:"A domain is a distinct area or realm of human experience with its own rules, context, and appropriate responses. Examples include professional domain, personal domain, family domain, etc.",keywords:["domain","distinct area","rules","context","appropriate responses"]}],["domain collapse",{category:"problems",content:"When people apply the rules, expectations, or approaches of one domain to a different domain, creating confusion and ineffectiveness.",keywords:["domain collapse","apply rules","wrong domain","confusion","ineffectiveness"]}],["contextual appropriateness",{category:"solutions",content:"Different domains require different responses, communication styles, and ways of being. What works in one domain may be inappropriate in another.",keywords:["contextual appropriateness","different responses","communication styles","domain specific"]}]]);function xe(e){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(e)}function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach(function(t){Ne(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ne(e,t,n){return(t=Fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||je(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=je(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function je(e,t){if(e){if("string"==typeof e)return Re(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fe(r.key),r)}}function Fe(e){var t=function(e){if("object"!=xe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xe(t)?t:t+""}var Ue=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=Oe,console.log("Debbie Function Handler initialized"),console.log("Debbie Knowledge Base: 3 entries on domain distinctions")},(t=[{key:"handleFunctionCall",value:function(e){try{switch(e.name){case"SearchKnowledgeBase":return this.searchKnowledgeBase(e.parameters);case"ExploreDomainDistinctions":return this.exploreDomainDistinctions(e.parameters);case"IdentifyDomainConflicts":return this.identifyDomainConflicts(e.parameters);default:return null}}catch(e){return console.error("Error in Debbie function call:",e),{success:!1,data:null,agent:"Debbie",message:"Error processing function call: ".concat(e.message)}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;console.log('Debbie searching knowledge base for: "'.concat(t,'"'));var r,i=[],o=t.toLowerCase(),a=De(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=Le(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c.toLowerCase()===o?u=100:c.toLowerCase().includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push(Pe(Pe({key:c},l),{},{relevance:u})))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5);return{success:!0,data:d,agent:"Debbie",message:"Found ".concat(d.length,' domain-related insights for "').concat(t,'"')}}},{key:"exploreDomainDistinctions",value:function(e){var t=e.context,n=void 0===t?"":t;console.log('Debbie exploring domain distinctions for context: "'.concat(n,'"'));var r,i=[],o=De(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=Le(r.value,2),s=a[0],c=a[1];("domains"===c.category||s.includes("domain"))&&i.push(Pe({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Debbie",message:"Explored ".concat(i.length," domain distinctions for your context")}}},{key:"identifyDomainConflicts",value:function(e){var t=e.situation,n=void 0===t?"":t;console.log('Debbie identifying domain conflicts in situation: "'.concat(n,'"'));var r,i=[],o=De(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=Le(r.value,2),s=a[0],c=a[1];("conflicts"===c.category||s.includes("conflict")||s.includes("tension"))&&i.push(Pe({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Debbie",message:"Identified ".concat(i.length," potential domain conflicts in your situation")}}}])&&Be(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),We=new Map([["synthesized terms definition",{category:"core_concepts",content:"Precisely crafted concepts that bring together multiple ideas into a single, powerful framework that creates new understanding and possibility.",keywords:["synthesized terms","multiple ideas","powerful framework","new understanding"]}],["conceptual synthesis",{category:"methods",content:"The art of combining multiple concepts into a single, powerful term that creates new understanding and possibility.",keywords:["conceptual synthesis","combining concepts","single term","new understanding"]}],["generative language",{category:"power",content:"Well-crafted synthesized terms generate new thinking and action rather than just describing existing conditions.",keywords:["generative language","new thinking","action","beyond describing"]}]]);function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(n),!0).forEach(function(t){qe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qe(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||$e(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$e(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function $e(e,t){if(e){if("string"==typeof e)return Ke(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(e,t):void 0}}function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Je(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qe(r.key),r)}}function Qe(e){var t=function(e){if("object"!=Ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ge(t)?t:t+""}var Xe=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=We,console.log("Tim Function Handler initialized"),console.log("Tim Knowledge Base: 3 entries on synthesized terms")},(t=[{key:"handleFunctionCall",value:function(e){try{switch(e.name){case"SearchKnowledgeBase":return this.searchKnowledgeBase(e.parameters);case"ExploreTermSynthesis":return this.exploreTermSynthesis(e.parameters);case"IdentifyTermClarity":return this.identifyTermClarity(e.parameters);default:return null}}catch(e){return console.error("Error in Tim function call:",e),{success:!1,data:null,agent:"Tim",message:"Error processing function call: ".concat(e.message)}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;console.log('Tim searching knowledge base for: "'.concat(t,'"'));var r,i=[],o=t.toLowerCase(),a=ze(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=Ve(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c.toLowerCase()===o?u=100:c.toLowerCase().includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push(He(He({key:c},l),{},{relevance:u})))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5);return{success:!0,data:d,agent:"Tim",message:"Found ".concat(d.length,' term synthesis insights for "').concat(t,'"')}}},{key:"exploreTermSynthesis",value:function(e){var t=e.context,n=void 0===t?"":t;console.log('Tim exploring term synthesis for context: "'.concat(n,'"'));var r,i=[],o=ze(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=Ve(r.value,2),s=a[0],c=a[1];("synthesis"===c.category||s.includes("synthesize")||s.includes("integration"))&&i.push(He({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Tim",message:"Explored ".concat(i.length," term synthesis approaches for your context")}}},{key:"identifyTermClarity",value:function(e){var t=e.terms,n=void 0===t?"":t;console.log('Tim identifying term clarity for: "'.concat(n,'"'));var r,i=[],o=ze(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=Ve(r.value,2),s=a[0],c=a[1];("clarity"===c.category||s.includes("clear")||s.includes("precise"))&&i.push(He({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Tim",message:"Identified ".concat(i.length," clarity insights for your terms")}}}])&&Je(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Ze=new Map([["perceptual constraints definition",{category:"core_concepts",content:"Invisible limitations in how we see, interpret, and make sense of reality. These constraints shape what we notice and what we consider possible.",keywords:["perceptual constraints","invisible limitations","how we see","shape what we notice"]}],["paradigm awareness",{category:"awareness",content:"Recognizing the paradigms and worldviews that shape our perception and limit what we see as possible.",keywords:["paradigm awareness","worldviews","shape perception","limit possible"]}],["perceptual flexibility",{category:"skills",content:"The ability to shift perspectives and see from multiple viewpoints, expanding what becomes visible and possible.",keywords:["perceptual flexibility","shift perspectives","multiple viewpoints","expand visible"]}]]);function et(e){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(e)}function tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(n),!0).forEach(function(t){rt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rt(e,t,n){return(t=lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function it(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||at(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=at(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function at(e,t){if(e){if("string"==typeof e)return st(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lt(r.key),r)}}function lt(e){var t=function(e){if("object"!=et(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==et(t)?t:t+""}var ut=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=Ze,console.log("Paul Function Handler initialized"),console.log("Paul Knowledge Base: 3 entries on perceptual constraints")},(t=[{key:"handleFunctionCall",value:function(e){try{switch(e.name){case"SearchKnowledgeBase":return this.searchKnowledgeBase(e.parameters);case"ExplorePerceptualConstraints":return this.explorePerceptualConstraints(e.parameters);case"ShiftPerspective":return this.shiftPerspective(e.parameters);default:return null}}catch(e){return console.error("Error in Paul function call:",e),{success:!1,data:null,agent:"Paul",message:"Error processing function call: ".concat(e.message)}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;console.log('Paul searching knowledge base for: "'.concat(t,'"'));var r,i=[],o=t.toLowerCase(),a=ot(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=it(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c.toLowerCase()===o?u=100:c.toLowerCase().includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push(nt(nt({key:c},l),{},{relevance:u})))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5);return{success:!0,data:d,agent:"Paul",message:"Found ".concat(d.length,' perceptual constraint insights for "').concat(t,'"')}}},{key:"explorePerceptualConstraints",value:function(e){var t=e.context,n=void 0===t?"":t;console.log('Paul exploring perceptual constraints for context: "'.concat(n,'"'));var r,i=[],o=ot(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=it(r.value,2),s=a[0],c=a[1];("core_concepts"===c.category||s.includes("constraint")||s.includes("limitation"))&&i.push(nt({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Paul",message:"Explored ".concat(i.length," perceptual constraints in your context")}}},{key:"shiftPerspective",value:function(e){var t=e.situation,n=void 0===t?"":t;console.log('Paul facilitating perspective shift for situation: "'.concat(n,'"'));var r,i=[],o=ot(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=it(r.value,2),s=a[0],c=a[1];("skills"===c.category||s.includes("perspective")||s.includes("flexibility"))&&i.push(nt({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Paul",message:"Facilitated ".concat(i.length," perspective shifts for your situation")}}}])&&ct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),dt=new Map([["framework methodology",{category:"core_concepts",content:"Systematic approaches and structured methodologies for transforming situations and achieving breakthrough results.",keywords:["framework methodology","systematic approaches","structured methodologies","breakthrough results"]}],["est framework application",{category:"frameworks",content:"Practical application of est principles and methodologies for personal and organizational transformation.",keywords:["est framework","practical application","personal transformation","organizational transformation"]}],["frameworks for breakthrough",{category:"methodology",content:"Structured approaches that create the conditions for breakthrough thinking and extraordinary results.",keywords:["frameworks for breakthrough","structured approaches","breakthrough thinking","extraordinary results"]}]]);function ht(e){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(e)}function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach(function(t){ft(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ft(e,t,n){return(t=_t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||vt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=vt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vt(e,t){if(e){if("string"==typeof e)return bt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(e,t):void 0}}function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_t(r.key),r)}}function _t(e){var t=function(e){if("object"!=ht(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ht(t)?t:t+""}var St=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.knowledgeBase=dt,console.log("Fred Function Handler initialized"),console.log("Fred Knowledge Base: 3 entries on frameworks and est methodology")},(t=[{key:"handleFunctionCall",value:function(e){try{switch(e.name){case"SearchKnowledgeBase":return this.searchKnowledgeBase(e.parameters);case"ExploreFrameworks":return this.exploreFrameworks(e.parameters);case"ApplyEstMethodology":return this.applyEstMethodology(e.parameters);default:return null}}catch(e){return console.error("Error in Fred function call:",e),{success:!1,data:null,agent:"Fred",message:"Error processing function call: ".concat(e.message)}}}},{key:"searchKnowledgeBase",value:function(e){var t=e.query,n=e.category;console.log('Fred searching knowledge base for: "'.concat(t,'"'));var r,i=[],o=t.toLowerCase(),a=yt(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=mt(r.value,2),c=s[0],l=s[1],u=0;n&&l.category!==n||(c.toLowerCase()===o?u=100:c.toLowerCase().includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push(gt(gt({key:c},l),{},{relevance:u})))}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5);return{success:!0,data:d,agent:"Fred",message:"Found ".concat(d.length,' framework and methodology insights for "').concat(t,'"')}}},{key:"exploreFrameworks",value:function(e){var t=e.context,n=void 0===t?"":t;console.log('Fred exploring frameworks for context: "'.concat(n,'"'));var r,i=[],o=yt(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=mt(r.value,2),s=a[0],c=a[1];("frameworks"===c.category||"methodology"===c.category||s.includes("framework"))&&i.push(gt({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Fred",message:"Explored ".concat(i.length," applicable frameworks for your context")}}},{key:"applyEstMethodology",value:function(e){var t=e.situation,n=void 0===t?"":t;console.log('Fred applying est methodology to situation: "'.concat(n,'"'));var r,i=[],o=yt(this.knowledgeBase);try{for(o.s();!(r=o.n()).done;){var a=mt(r.value,2),s=a[0],c=a[1];(s.includes("est")||c.content.includes("est")||s.includes("methodology"))&&i.push(gt({key:s},c))}}catch(e){o.e(e)}finally{o.f()}return{success:!0,data:i,agent:"Fred",message:"Applied ".concat(i.length," est methodology principles to your situation")}}}])&&wt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||Et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ct=new Map([["integrity definition",{category:"integrity",content:"Integrity is a state of being whole, complete, unbroken, and sound. For a person, integrity means your word is whole and complete - you do what you say you'll do, honor what you know to do, stand for what you believe, and take responsibility for what you allow. Integrity creates workability, reliability, and trust in your life.",keywords:["integrity","whole","complete","word","workability","trust"]}],["integrity statement creation",{category:"integrity",content:"Creating a powerful integrity statement involves declaring your commitment to wholeness and completeness in specific areas of your life. It should be clear, actionable, and meaningful to you. A good integrity statement often includes what you commit to doing, how you will honor your word, and what wholeness looks like in that area.",keywords:["integrity statement","commitment","declaration","wholeness","actionable"]}],["honoring your word",{category:"integrity",content:"Honoring your word means either keeping your commitments exactly as stated, or when you cannot, immediately communicating this to all affected parties and cleaning up any consequences. This applies to explicit promises, implied agreements, stated values, and personal standards.",keywords:["honoring word","keeping commitments","communication","consequences","promises"]}],["integrity in relationships",{category:"integrity",content:"Relationship integrity involves being reliable, consistent, and trustworthy with others. It means honoring agreements, communicating honestly about your capacity and limitations, and taking responsibility for your impact on others. This creates a foundation of trust and workability.",keywords:["relationship integrity","reliable","trustworthy","agreements","responsibility"]}],["authenticity definition",{category:"authenticity",content:"Authenticity is the quality of being genuine, real, and true to your own nature, values, and feelings. It means expressing yourself honestly without pretense or facade, aligning your external behavior with your internal reality, and living from your core truth rather than what others expect.",keywords:["authenticity","genuine","real","true nature","honest expression","core truth"]}],["authentic self-expression",{category:"authenticity",content:"Authentic self-expression involves sharing your genuine thoughts, feelings, and perspectives without filtering them through what you think others want to hear. It requires self-awareness, courage, and the willingness to be vulnerable. Authentic expression creates deeper connections and personal fulfillment.",keywords:["authentic expression","genuine thoughts","vulnerability","self-awareness","courage"]}],["authenticity statement creation",{category:"authenticity",content:"Creating an authenticity statement involves declaring how you commit to being genuine and true to yourself. It should reflect your core values, your commitment to honest self-expression, and how you want to show up authentically in the world. It's about being real rather than performing.",keywords:["authenticity statement","genuine","core values","honest expression","being real"]}],["living authentically",{category:"authenticity",content:"Living authentically means making choices that align with your true values and desires rather than external expectations or pressures. It involves knowing yourself deeply, accepting all parts of yourself, and expressing your truth even when it's difficult or unpopular.",keywords:["living authentically","true values","self-acceptance","expressing truth","alignment"]}],["integrity and authenticity relationship",{category:"integration",content:"Integrity and authenticity are complementary but distinct. Integrity focuses on wholeness and keeping your word, while authenticity focuses on being genuine and true to yourself. Together, they create a foundation for powerful, trustworthy, and genuine living. You can be authentic without integrity, or have integrity without being authentic, but combining them creates extraordinary effectiveness.",keywords:["integrity authenticity relationship","complementary","wholeness","genuine","trustworthy"]}],["personal development foundation",{category:"integration",content:"Both integrity and authenticity serve as foundational elements for personal development. Integrity creates the reliability and trust necessary for growth, while authenticity ensures that growth is aligned with your true self. Together, they enable sustainable transformation and meaningful progress.",keywords:["personal development","foundation","reliability","growth","transformation"]}],["creating powerful statements",{category:"integration",content:"Powerful personal statements combine clarity, specificity, and emotional resonance. They should be written in your own words, reflect your genuine commitment, and inspire action. The best statements are both aspirational and grounded in your current reality, creating a bridge to who you are becoming.",keywords:["powerful statements","clarity","specificity","emotional resonance","genuine commitment"]}],["statement refinement process",{category:"application",content:"Refining integrity and authenticity statements is an iterative process. Start with your initial insight or commitment, then refine for clarity, specificity, and emotional truth. Ask yourself: Does this feel true to me? Is it specific enough to guide action? Does it inspire me? Can I commit to it fully?",keywords:["statement refinement","iterative process","clarity","emotional truth","commitment"]}],["living your statements",{category:"application",content:"Once you create your statements, the real work begins in living them. This involves daily choices that align with your declared integrity and authenticity, regular reflection on how you're honoring your commitments, and ongoing refinement as you grow and evolve.",keywords:["living statements","daily choices","alignment","reflection","ongoing refinement"]}]]);function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach(function(t){xt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xt(e,t,n){return(t=Dt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||Pt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pt(e,t){if(e){if("string"==typeof e)return Nt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(e,t):void 0}}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dt(r.key),r)}}function Dt(e){var t=function(e){if("object"!=It(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==It(t)?t:t+""}var jt=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 Initializing Michael's Function Handler..."),this.knowledgeBase=Ct,this.stats={integrityUpdates:0,authenticityUpdates:0,givenByGreaterUpdates:0,causeInMatterUpdates:0,knowledgeSearches:0,totalCalls:0},function(){var e,t={},n=Ct.size,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Et(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(Ct);try{for(r.s();!(e=r.n()).done;){var i=kt(e.value,2),o=(i[0],i[1].category);t[o]=(t[o]||0)+1}}catch(e){r.e(e)}finally{r.f()}console.log("📊 Michael's Knowledge Base Stats:",{totalEntries:n,categories:t,timestamp:(new Date).toISOString()})}(),console.log("✅ Michael is ready with integrity, authenticity, being given by something greater, and being cause in the matter functions")},t=[{key:"handleFunctionCall",value:function(e){this.stats.totalCalls++,console.log("🎯 Michael Function Call:",{function:e.name,parameters:e.parameters,timestamp:(new Date).toISOString()}),console.log('DEBUG: Exact function name received: "'.concat(e.name,'"'));try{switch(e.name){case"FocusOnStatement":return this.focusOnStatement(e.parameters);case"UpdateIntegrityStatement":return this.updateIntegrityStatement(e.parameters);case"UpdateAuthenticityStatement":return this.updateAuthenticityStatement(e.parameters);case"UpdateBeingGivenByGreaterStatement":return this.updateBeingGivenByGreaterStatement(e.parameters);case"UpdateBeingCauseInMatterStatement":return this.updateBeingCauseInMatterStatement(e.parameters);case"HighlightIntegrityStatement":return this.highlightIntegrityStatement(e.parameters);case"HighlightAuthenticityStatement":return this.highlightAuthenticityStatement(e.parameters);case"HighlightBeingGivenByGreaterStatement":return this.highlightBeingGivenByGreaterStatement(e.parameters);case"HighlightBeingCauseInMatterStatement":return this.highlightBeingCauseInMatterStatement(e.parameters);case"UpdateCommitmentStatement":return console.log("DEBUG: Received old function name UpdateCommitmentStatement, redirecting to UpdateBeingGivenByGreaterStatement"),this.updateBeingGivenByGreaterStatement(e.parameters);case"UpdateCausationStatement":return console.log("DEBUG: Received old function name UpdateCausationStatement, redirecting to UpdateBeingCauseInMatterStatement"),this.updateBeingCauseInMatterStatement(e.parameters);case"SearchKnowledgeBase":return this.searchKnowledgeBase(e.parameters);default:return console.log('DEBUG: Unknown function name: "'.concat(e.name,'"')),{success:!1,message:"Unknown function: ".concat(e.name),agent:"michael"}}}catch(e){return console.error("Michael function call error:",e),{success:!1,message:"Function execution failed",agent:"michael",error:e.message}}}},{key:"focusOnStatement",value:function(e){var t=e.statementType,n=e.userMessage;console.log("\n🎯 ========== FOCUS ON STATEMENT DEBUG =========="),console.log("📥 Michael received focus request for: ".concat(t)),console.log('📝 User message: "'.concat(n,'"')),console.log("⏰ Timestamp: ".concat((new Date).toISOString()));var r="being cause in the matter"===t?"causationStatement":"being given by something greater"===t?"commitmentStatement":"causation"===t?"causationStatement":"commitment"===t?"commitmentStatement":"integrity"===t?"integrityStatement":"authenticityStatement",i={integrity:"#4CAF50",authenticity:"#2196F3","being given by something greater":"#FF9800","being cause in the matter":"#9C27B0",commitment:"#FF9800",causation:"#9C27B0"}[t]||"#667eea";this.highlightStatement(r,i,"Focusing on ".concat(t));var o={"being cause in the matter":"Let's work on being cause in the matter. This is about taking full ownership and responsibility for your outcomes instead of being at the effect of circumstances. Where in your life might you be operating from victim consciousness, and how can you shift to being the source of your results? What specific situation would you like to examine?","being given by something greater":"Let's work on being given by something greater. This is about discovering your purpose, calling, and how you serve something beyond your personal interests. What are you naturally drawn to contribute? What larger mission or service calls to you? What area of contribution feels most alive for you?",integrity:"Let's work on integrity. Integrity is about being whole, complete, and aligned between your word and your actions. Where might there be gaps between what you say and what you do, or where you're not honoring your commitments to yourself or others? What area of your life feels out of integrity?",authenticity:"Let's work on authenticity. This is about being true to who you really are - expressing your genuine self rather than who you think you should be or who others expect you to be. Where might you be wearing masks or hiding aspects of yourself? What situation makes you feel like you can't be completely authentic?",causation:"Let's work on being cause in the matter. This is about taking full ownership and responsibility for your outcomes instead of being at the effect of circumstances. Where in your life might you be operating from victim consciousness, and how can you shift to being the source of your results? What specific situation would you like to examine?",commitment:"Let's work on being given by something greater. This is about discovering your purpose, calling, and how you serve something beyond your personal interests. What are you naturally drawn to contribute? What larger mission or service calls to you? What area of contribution feels most alive for you?"}[t]||"Let's explore this area together. What would you like to examine?";console.log("🗣️ AGENT RESPONSE DEBUG:"),console.log('📝 Statement Type: "'.concat(t,'"')),console.log('🎤 What Michael will say: "'.concat(o,'"')),console.log("📊 Response length: ".concat(o.length," characters")),console.log('🔍 Contains "One moment": '.concat(o.includes("One moment")));var a={success:!0,message:"Statement focus activated - Michael is now focused on this area",agent:"michael",data:{statementType:t,focusMessage:n,response:o,timestamp:(new Date).toISOString()}};return console.log("📤 Function returning to VAPI:",JSON.stringify(a,null,2)),console.log("🏁 ========== END FOCUS STATEMENT DEBUG ==========\n"),a}},{key:"updateIntegrityStatement",value:function(e){this.stats.integrityUpdates++;var t=e.statement;console.log('💎 Michael updating integrity statement: "'.concat(t,'"'));var n=t.replace(/[<>]/g,""),r=document.getElementById("integrityStatement");return r&&(r.textContent=n,r.style.backgroundColor="#e8f5e8",r.style.padding="10px",r.style.borderRadius="5px",r.style.border="2px solid #4CAF50",r.style.transition="all 0.3s ease",setTimeout(function(){r.style.backgroundColor="#f9f9f9",r.style.border="1px solid #ddd"},2e3)),{success:!0,message:"Integrity statement updated successfully",agent:"michael",data:{statement:n,field:"integrity",updateCount:this.stats.integrityUpdates}}}},{key:"updateAuthenticityStatement",value:function(e){this.stats.authenticityUpdates++;var t=e.statement;console.log('🌟 Michael updating authenticity statement: "'.concat(t,'"'));var n=t.replace(/[<>]/g,""),r=document.getElementById("authenticityStatement");return r&&(r.textContent=n,r.style.backgroundColor="#e8f0ff",r.style.padding="10px",r.style.borderRadius="5px",r.style.border="2px solid #2196F3",r.style.transition="all 0.3s ease",setTimeout(function(){r.style.backgroundColor="#f9f9f9",r.style.border="1px solid #ddd"},2e3)),{success:!0,message:"Authenticity statement updated successfully",agent:"michael",data:{statement:n,field:"authenticity",updateCount:this.stats.authenticityUpdates}}}},{key:"updateBeingGivenByGreaterStatement",value:function(e){this.stats.givenByGreaterUpdates++;var t=e.statement;console.log("🎯 Michael updating 'Being Given By Something Greater' statement: \"".concat(t,'"'));var n=t.replace(/[<>]/g,""),r=document.getElementById("commitmentStatement");return r&&(r.textContent=n,r.style.backgroundColor="#fff3e0",r.style.padding="10px",r.style.borderRadius="5px",r.style.border="2px solid #ff9800",r.style.transition="all 0.3s ease",setTimeout(function(){r.style.backgroundColor="#f9f9f9",r.style.border="1px solid #ddd"},2e3)),{success:!0,message:"Being Given By Something Greater statement updated successfully",agent:"michael",data:{statement:n,field:"beingGivenByGreater",updateCount:this.stats.givenByGreaterUpdates}}}},{key:"updateBeingCauseInMatterStatement",value:function(e){this.stats.causeInMatterUpdates++;var t=e.statement;console.log("⚡ Michael updating 'Being Cause In The Matter' statement: \"".concat(t,'"'));var n=t.replace(/[<>]/g,""),r=document.getElementById("causationStatement");return r&&(r.textContent=n,r.style.backgroundColor="#f3e5f5",r.style.padding="10px",r.style.borderRadius="5px",r.style.border="2px solid #9c27b0",r.style.transition="all 0.3s ease",setTimeout(function(){r.style.backgroundColor="#f9f9f9",r.style.border="1px solid #ddd"},2e3)),{success:!0,message:"Being Cause In The Matter statement updated successfully",agent:"michael",data:{statement:n,field:"beingCauseInMatter",updateCount:this.stats.causeInMatterUpdates}}}},{key:"searchKnowledgeBase",value:function(e){this.stats.knowledgeSearches++;var t=e.query,n=e.category;console.log('🔍 Michael searching knowledge base for: "'.concat(t,'" in category: "').concat(n||"all",'"'));var r,i=[],o=t.toLowerCase(),a=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Pt(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(this.knowledgeBase);try{for(a.s();!(r=a.n()).done;){var s=Mt(r.value,2),c=s[0],l=s[1];if(!n||l.category===n){var u=0;c.toLowerCase()===o?u=100:c.toLowerCase().includes(o)?u=80:l.keywords.some(function(e){return e.toLowerCase().includes(o)||o.includes(e.toLowerCase())})?u=70:l.content.toLowerCase().includes(o)&&(u=60),u>0&&i.push({key:c,category:l.category,content:l.content,keywords:l.keywords,relevance:u})}}}catch(e){a.e(e)}finally{a.f()}i.sort(function(e,t){return t.relevance-e.relevance});var d=i.slice(0,5);return console.log("📚 Found ".concat(i.length," results, returning top ").concat(d.length)),{success:!0,message:"Found ".concat(d.length," relevant knowledge base entries"),agent:"michael",data:{query:t,category:n||"all",results:d,totalFound:i.length,searchCount:this.stats.knowledgeSearches}}}},{key:"highlightIntegrityStatement",value:function(e){var t=e.message,n=void 0===t?"We're focusing on integrity right now":t;return console.log('💎 Michael highlighting integrity statement: "'.concat(n,'"')),this.highlightStatement("integrityStatement","#4CAF50",n),{success:!0,message:"Integrity statement highlighted",agent:"michael",data:{statementType:"integrity",highlightMessage:n,timestamp:(new Date).toISOString()}}}},{key:"highlightAuthenticityStatement",value:function(e){var t=e.message,n=void 0===t?"We're focusing on authenticity right now":t;return console.log('🌟 Michael highlighting authenticity statement: "'.concat(n,'"')),this.highlightStatement("authenticityStatement","#2196F3",n),{success:!0,message:"Authenticity statement highlighted",agent:"michael",data:{statementType:"authenticity",highlightMessage:n,timestamp:(new Date).toISOString()}}}},{key:"highlightBeingGivenByGreaterStatement",value:function(e){var t=e.message,n=void 0===t?"We're focusing on being given by something greater right now":t;return console.log('🎯 Michael highlighting Being Given By Something Greater statement: "'.concat(n,'"')),this.highlightStatement("commitmentStatement","#FF9800",n),{success:!0,message:"Being Given By Something Greater statement highlighted",agent:"michael",data:{statementType:"beingGivenByGreater",highlightMessage:n,timestamp:(new Date).toISOString()}}}},{key:"highlightBeingCauseInMatterStatement",value:function(e){var t=e.message,n=void 0===t?"We're focusing on being cause in the matter right now":t;return console.log('⚡ Michael highlighting Being Cause In The Matter statement: "'.concat(n,'"')),this.highlightStatement("causationStatement","#9C27B0",n),{success:!0,message:"Being Cause In The Matter statement highlighted",agent:"michael",data:{statementType:"beingCauseInMatter",highlightMessage:n,timestamp:(new Date).toISOString()}}}},{key:"highlightStatement",value:function(e,t,n){this.clearAllHighlights();var r=document.getElementById(e);if(r){var i=r.closest(".statement-card");if(i){i.style.transition="all 0.4s ease",i.style.boxShadow="0 0 30px ".concat(t,"80, 0 0 60px ").concat(t,"40, inset 0 0 20px ").concat(t,"20"),i.style.transform="scale(1.05)",i.style.border="3px solid ".concat(t),i.style.zIndex="10",i.style.position="relative",i.setAttribute("data-highlighted","true");var o=0,a=setInterval(function(){o<2?(i.style.boxShadow="0 0 40px ".concat(t,"90, 0 0 80px ").concat(t,"50, inset 0 0 25px ").concat(t,"30"),setTimeout(function(){i.style.boxShadow="0 0 30px ".concat(t,"80, 0 0 60px ").concat(t,"40, inset 0 0 20px ").concat(t,"20")},300),o++):clearInterval(a)},600);console.log("✨ Highlighted ".concat(e," with color ").concat(t,' and message: "').concat(n,'"'))}}else console.warn("⚠️ Could not find element with ID: ".concat(e))}},{key:"clearAllHighlights",value:function(){var e=document.querySelectorAll('.statement-card[data-highlighted="true"]');e.forEach(function(e){e.style.transition="all 0.3s ease",e.style.boxShadow="",e.style.transform="",e.style.border="",e.style.zIndex="",e.style.position="",e.removeAttribute("data-highlighted")}),e.length>0&&console.log("🧹 Cleared ".concat(e.length," existing highlights"))}},{key:"getStats",value:function(){return Ot(Ot({},this.stats),{},{knowledgeBaseSize:this.knowledgeBase.size})}}],t&&Lt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Rt(e){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rt(e)}function Bt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ft(r.key),r)}}function Ft(e){var t=function(e){if("object"!=Rt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rt(t)?t:t+""}var Ut=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=new Map([["lisa",new b],["briana",new C],["betty",new F],["bart",new X],["luigi",new he],["peter",new Ae],["debbie",new Ue],["tim",new Xe],["paul",new ut],["fred",new St],["michael",new jt]])},(t=[{key:"getHandler",value:function(e){return this.handlers.get(e)}},{key:"handleFunctionCall",value:function(e,t){var n=this.getHandler(e);if(!n)return console.warn("No function handler found for agent: ".concat(e)),null;try{return n.handleFunctionCall(t)}catch(t){return console.error("Error handling function call for ".concat(e,":"),t),{success:!1,error:t.message,agent:e}}}},{key:"registerHandler",value:function(e,t){this.handlers.set(e,t),console.log("Registered function handler for agent: ".concat(e))}},{key:"unregisterHandler",value:function(e){var t=this.handlers.delete(e);return t&&console.log("Unregistered function handler for agent: ".concat(e)),t}},{key:"getRegisteredAgents",value:function(){return Array.from(this.handlers.keys())}},{key:"hasHandler",value:function(e){return this.handlers.has(e)}}])&&Bt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}function Gt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Yt(l,"_invoke",function(n,r,i){var o,s,c,l=0,u=i||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,c=e,h.n=n,a}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,o=u[t],p=h.p,g=o[2];n>3?(i=g===r)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,h.v=r,h.n=o[1]):p<g&&(i=n<3||o[0]>r||r>g)&&(o[4]=n,o[5]=r,h.n=g,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,g){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,g),s=u,c=g;(t=s<2?e:c)||!d;){o||(s?s<3?(s>1&&(h.n=-1),p(s,c)):h.n=c:h.v=c);try{if(l=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=h.n<0)?c:n.call(r,h))!==a)break}catch(t){o=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,o),!0),l}var a={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Yt(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,Yt(d,"constructor",l),Yt(l,"constructor",c),c.displayName="GeneratorFunction",Yt(l,i,"GeneratorFunction"),Yt(d),Yt(d,i,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),(Gt=function(){return{w:o,m:h}})()}function Yt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Yt=function(e,t,n,r){function o(t,n){Yt(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Yt(e,t,n,r)}function Ht(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function qt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ht(o,r,i,a,s,"next",e)}function s(e){Ht(o,r,i,a,s,"throw",e)}a(void 0)})}}function Vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zt(r.key),r)}}function zt(e){var t=function(e){if("object"!=Wt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wt(t)?t:t+""}var $t=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.vapi=new(i())("d555b32e-ab96-4a1f-be43-6a7afc43dd45"),this.currentCall=null,this.currentAgent=null,this.functionHandlers=new Ut,this.connected=!1,this.assistantIsSpeaking=!1,this.volumeLevel=0,this.maxSpread=30,this.callEndedNaturally=!1,this.processedToolCalls=new Set,this.statusDisplay=document.getElementById("status"),this.speakerDisplay=document.getElementById("speaker"),this.volumeDisplay=document.getElementById("volume"),this.vapiTyping=document.getElementById("vapiTyping"),this.vapiStatusMessage=document.getElementById("vapiStatusMessage"),this.chatWindow=document.getElementById("chat"),this.setupEventListeners(),this.renderAgents()},t=[{key:"renderAgents",value:function(){var e=document.getElementById("agents-container");if(e){var t=document.getElementById("integrityStatement")&&document.getElementById("authenticityStatement"),n=l;t&&(n={michael:l.michael},this.setupStatementClickListeners(),this.setupHighlightTestKeys()),e.innerHTML=function(e){return Object.entries(e).map(function(e){var t,n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2);return t=r[0],n=r[1],'\n <div class="agent-container" data-agent-id="'.concat(t,'">\n <div class="').concat(n.buttonClass,'" id="callWith').concat(n.name,'">\n <svg class="').concat(n.iconClass,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\n <path d="M192 0C139 0 96 43 96 96V256c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V216z"/>\n </svg>\n </div>\n <div class="agent-name">').concat(n.displayName,"</div>\n </div>\n ")}).join("")}(n),this.attachAgentListeners(n)}}},{key:"setupHighlightTestKeys",value:function(){var e=this;document.addEventListener("keydown",function(t){if(t.ctrlKey||t.metaKey)switch(t.key){case"1":t.preventDefault(),e.testHighlight("integrity");break;case"2":t.preventDefault(),e.testHighlight("authenticity");break;case"3":t.preventDefault(),e.testHighlight("being given by something greater");break;case"4":t.preventDefault(),e.testHighlight("being cause in the matter")}})}},{key:"testHighlight",value:function(e){console.log("Testing highlight for: ".concat(e));var t=this.functionHandlers.getHandler("michael");if(t){var n={integrity:{name:"HighlightIntegrityStatement",parameters:{message:"Testing integrity highlight"}},authenticity:{name:"HighlightAuthenticityStatement",parameters:{message:"Testing authenticity highlight"}},"being given by something greater":{name:"HighlightBeingGivenByGreaterStatement",parameters:{message:"Testing being given by something greater highlight"}},"being cause in the matter":{name:"HighlightBeingCauseInMatterStatement",parameters:{message:"Testing being cause in the matter highlight"}},commitment:{name:"HighlightBeingGivenByGreaterStatement",parameters:{message:"Testing commitment highlight"}},causation:{name:"HighlightBeingCauseInMatterStatement",parameters:{message:"Testing causation highlight"}}}[e];if(n){var r=t.handleFunctionCall(n);console.log("Highlight test result:",r)}}else console.log("Michael handler not found")}},{key:"attachAgentListeners",value:function(){!function(e,t){Object.keys(e).forEach(function(n){var r=document.getElementById("callWith".concat(e[n].name));r&&r.addEventListener("click",function(){return t.handleAgentCall(n)})})}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,this)}},{key:"handleAgentCall",value:(o=qt(Gt().m(function e(t){var n;return Gt().w(function(e){for(;;)switch(e.n){case 0:if(n=l[t]){e.n=1;break}return console.error("No configuration found for agent: ".concat(t)),e.a(2);case 1:if(!this.currentCall){e.n=3;break}return e.n=2,this.endCall();case 2:case 4:return e.a(2);case 3:return this.currentAgent=t,e.n=4,this.startCall(n)}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"startCall",value:(r=qt(Gt().m(function e(t){var n,r,i;return Gt().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=u(t),this.updateUIForCall(!0),(r=document.getElementById("instructions"))&&(r.textContent="Connecting... Please allow microphone access when prompted."),e.p=1,e.n=2,this.vapi.start(n);case 2:this.currentCall=e.v,console.log("Started call with ".concat(t.displayName)),e.n=4;break;case 3:e.p=3,i=e.v,console.error("Call failed:",i),this.handleError(i),this.currentAgent=null,this.currentCall=null,this.updateUIForCall(!1);case 4:return e.a(2)}},e,this,[[1,3]])})),function(e){return r.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.vapi.on("call-start",function(){return e.handleCallStart()}),this.vapi.on("call-end",function(){return e.handleCallEnd()}),this.vapi.on("speech-start",function(){return e.handleSpeechStart()}),this.vapi.on("speech-end",function(){return e.handleSpeechEnd()}),this.vapi.on("message",function(t){return e.handleMessage(t)}),this.vapi.on("volume-level",function(t){return e.handleVolumeLevel(t)}),this.vapi.on("error",function(t){return e.handleError(t)})}},{key:"handleCallStart",value:function(){console.log("Call started"),this.connected=!0,this.updateUI()}},{key:"handleCallEnd",value:function(){var e=this;if(console.log("Call ended"),this.connected=!1,this.currentCall=null,this.assistantIsSpeaking=!1,this.volumeLevel=0,this.callEndedNaturally=!0,this.processedToolCalls.clear(),this.currentAgent){var t=document.getElementById("callWith".concat(l[this.currentAgent].name));t&&(t.style.boxShadow="")}this.currentAgent=null,this.updateUI(),this.updateUIForCall(!1),function(e){Object.keys(e).forEach(function(e){h(e,!1,!1);var t=document.getElementById("callWith".concat(e));t&&(t.style.backgroundColor="",t.style.boxShadow="")})}(l),setTimeout(function(){e.callEndedNaturally=!1},1e3)}},{key:"handleSpeechStart",value:function(){this.assistantIsSpeaking=!0,this.updateUI()}},{key:"handleSpeechEnd",value:function(){this.assistantIsSpeaking=!1,this.updateUI()}},{key:"handleMessage",value:function(e){var t=this;"conversation-update"===e.type&&(e.conversation&&e.conversation.forEach(function(e){e.tool_calls&&e.tool_calls.length>0&&e.tool_calls.forEach(function(n){var r,i,o,a,s=n.id||"".concat(null===(r=n.function)||void 0===r?void 0:r.name,"-").concat(JSON.stringify(null===(i=n.function)||void 0===i?void 0:i.arguments),"-").concat(e.timestamp||Date.now());if(!t.processedToolCalls.has(s)){t.processedToolCalls.add(s);var c={name:null===(o=n.function)||void 0===o?void 0:o.name,parameters:null!==(a=n.function)&&void 0!==a&&a.arguments?JSON.parse(n.function.arguments):{}};t.currentAgent&&c.name&&t.handleFunctionCall(c)}})}),this.updateChat(e)),"function-call"===e.type&&this.currentAgent&&this.handleFunctionCall(e.functionCall)}},{key:"handleVolumeLevel",value:function(e){this.volumeLevel=e;var t=this.volumeLevel*this.maxSpread;if(this.volumeDisplay&&(this.volumeDisplay.textContent="Volume: ".concat(this.volumeLevel.toFixed(3))),this.currentAgent){var n=document.getElementById("callWith".concat(l[this.currentAgent].name));n&&(n.style.boxShadow="0 0 ".concat(t,"px ").concat(t/2,"px rgba(58,25,250,0.7)"))}}},{key:"handleFunctionCall",value:function(e){this.currentAgent?(console.log("Function called: ".concat(e.name," by ").concat(this.currentAgent)),this.functionHandlers.handleFunctionCall(this.currentAgent,e)?console.log("Function ".concat(e.name," executed successfully")):console.warn("Function ".concat(e.name," execution failed"))):console.warn("Function call received but no current agent")}},{key:"handleError",value:function(e){var t="Meeting has ended"===e.errorMsg||e.error&&"Meeting has ended"===e.error.message||e.error&&"Meeting has ended"===e.error.msg;if(this.callEndedNaturally||t)console.log("Call ended naturally (WebRTC cleanup)");else{if(console.error("Vapi error:",e),this.connected=!1,this.currentAgent){var n=document.getElementById("callWith".concat(l[this.currentAgent].name));n&&(n.style.boxShadow="")}this.vapiStatusMessage&&(e.error&&e.error.message?this.vapiStatusMessage.textContent=e.error.message:this.vapiStatusMessage.textContent="An error occurred"),this.updateUI(),this.updateUIForCall(!1)}}},{key:"updateUIForCall",value:function(e){var t,n=this;Object.keys(l).forEach(function(t){var r=l[t];h(r.name,e,t===n.currentAgent);var i=document.getElementById("callWith".concat(r.name));i&&(e&&t===n.currentAgent?i.style.backgroundColor="#007aff":i.style.backgroundColor="#858585")});var r=e&&this.currentAgent?"Connected to ".concat((null===(t=l[this.currentAgent])||void 0===t?void 0:t.displayName)||"agent"):"Click a microphone to start a call. You may need to allow microphone access twice for security.",i=document.getElementById("instructions");i&&(i.textContent=r)}},{key:"updateChat",value:function(e){var t=this;this.chatWindow&&(this.chatWindow.innerHTML="",e.conversation.forEach(function(e){var n=document.createElement("div");switch(n.classList.add("message"),e.role){case"assistant":n.classList.add("assistant");break;case"user":n.classList.add("user");break;case"tool":n.classList.add("tool")}e.content?n.textContent=e.content:e.tool_calls&&e.tool_calls.length>0&&(n.textContent="Processing request..."),t.chatWindow.appendChild(n)}),this.chatWindow.scrollTop=this.chatWindow.scrollHeight)}},{key:"updateUI",value:function(){this.statusDisplay&&(this.statusDisplay.textContent="Status: ".concat(this.connected?"Connected":"Disconnected")),this.speakerDisplay&&(this.speakerDisplay.textContent="Speaker: ".concat(this.assistantIsSpeaking?"Assistant":"User"))}},{key:"setupStatementClickListeners",value:function(){var e,t,n,r,i=this,o=null===(e=document.getElementById("causationStatement"))||void 0===e?void 0:e.closest(".statement-card");o&&(o.classList.add("clickable"),o.addEventListener("click",function(){i.handleStatementBoxClick("being cause in the matter")}));var a=null===(t=document.getElementById("integrityStatement"))||void 0===t?void 0:t.closest(".statement-card");a&&(a.classList.add("clickable"),a.addEventListener("click",function(){i.handleStatementBoxClick("integrity")}));var s=null===(n=document.getElementById("authenticityStatement"))||void 0===n?void 0:n.closest(".statement-card");s&&(s.classList.add("clickable"),s.addEventListener("click",function(){i.handleStatementBoxClick("authenticity")}));var c=null===(r=document.getElementById("commitmentStatement"))||void 0===r?void 0:r.closest(".statement-card");c&&(c.classList.add("clickable"),c.addEventListener("click",function(){i.handleStatementBoxClick("being given by something greater")}))}},{key:"handleStatementBoxClick",value:function(e){var t;console.log("Statement box clicked: ".concat(e));var n="being cause in the matter"===e?"causationStatement":"being given by something greater"===e?"commitmentStatement":"causation"===e?"causationStatement":"commitment"===e?"commitmentStatement":"integrity"===e?"integrityStatement":"authenticityStatement",r=null===(t=document.getElementById(n))||void 0===t?void 0:t.closest(".statement-card");if(r&&(r.style.transform="scale(0.98)",r.style.transition="all 0.1s ease",setTimeout(function(){r.style.transform="scale(1)"},100)),this.connected&&"michael"===this.currentAgent){var i=this.getStatementFocusMessage(e);console.log('Sending simulated user message to VAPI: "'.concat(i,'"')),this.vapi.send({type:"add-message",message:{role:"user",content:i}});var o=document.getElementById("chatMessages");if(o){var a=document.createElement("div");a.classList.add("chat-message","user"),a.textContent="🖱️ Clicked: ".concat(i),o.appendChild(a),o.scrollTop=o.scrollHeight;var s=document.getElementById("chat");s&&(s.style.display="block")}}else{var c=document.getElementById("instructions");if(c){var l=c.textContent;c.textContent='Start a conversation with Michael first, then click on the "'.concat(this.getStatementDisplayName(e),'" box to focus on that area.'),c.style.color="#ff9800",setTimeout(function(){c.textContent=l,c.style.color=""},3e3)}}}},{key:"getStatementFocusMessage",value:function(e){return{"being cause in the matter":"I want to work on being cause in the matter statement","being given by something greater":"I want to work on being given by something greater statement",integrity:"I want to work on the integrity statement",authenticity:"I want to work on the authenticity statement",causation:"I want to work on being cause in the matter statement",commitment:"I want to work on being given by something greater statement"}[e]||"I want to work on this area of personal development."}},{key:"getStatementDisplayName",value:function(e){return{"being cause in the matter":"Being Cause In The Matter Statement","being given by something greater":"Being Given By Something Greater Statement",integrity:"Integrity Statement",authenticity:"Authenticity Statement",causation:"Being Cause In The Matter Statement",commitment:"Being Given By Something Greater Statement"}[e]||e}},{key:"endCall",value:(n=qt(Gt().m(function e(){return Gt().w(function(e){for(;;)switch(e.n){case 0:if(!this.currentCall){e.n=1;break}return e.n=1,this.vapi.stop();case 1:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})}],t&&Vt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();document.addEventListener("DOMContentLoaded",function(){var e=new $t;window.vapiCallManager=e})})();