@tavus/embed 0.0.1-beta.10 → 0.0.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47
47
  pointer-events: none;
48
48
  `,document.body.appendChild(n),t.layout||=`custom-v1`,e.wrap(n,t)}},{key:`getCallInstance`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return e?lm[e]:Object.values(lm)[0]}}]);var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,ee,T,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe}();function Tm(e){if(e.extension){if(typeof e.extension!=`string`)throw Error(`Error starting dial out: extension must be a string`);if(e.extension.length>20)throw Error(`Error starting dial out: extension length must be less than or equal to 20`)}if(e.waitBeforeExtensionDialSec){if(typeof e.waitBeforeExtensionDialSec!=`number`)throw Error(`Error starting dial out: waitBeforeExtensionDialSec must be a number`);if(e.waitBeforeExtensionDialSec>60)throw Error(`Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60`);if(!e.extension)throw Error(`Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension`)}}function Em(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)console.warn(`MediaStreamTrack found in props or cache.`,r),n[r]=Ef;else if(r===`dailyConfig`){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 a=window._daily.instances[t].customCallbacks||{};a.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=a,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Dm(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==`joined-meeting`){var n=`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:`This daily-js method`} only supported after join.`;throw t&&(n+=` ${t}`),console.error(n),Error(n)}}function Om(e,t){return[`joining-meeting`,`joined-meeting`].includes(e)||t}function km(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`This daily-js method`,r=arguments.length>3?arguments[3]:void 0;if(Om(e,t)){var i=`${n} not supported after joining a meeting.`;throw r&&(i+=` ${r}`),console.error(i),Error(i)}}function Am(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`This daily-js method`,n=arguments.length>2?arguments[2]:void 0;if(!e){var r=`${t}${arguments.length>3&&arguments[3]!==void 0&&arguments[3]?` requires preAuth() or startCamera() to initialize call state.`:` requires preAuth(), startCamera(), or join() to initialize call state.`}`;throw n&&(r+=` ${n}`),console.error(r),Error(r)}}function jm(e){if(e){var t=`A pre-call quality test is in progress. Please try ${arguments.length>1&&arguments[1]!==void 0?arguments[1]:`This daily-js method`} again once testing has completed. Use stopTestCallQuality() to end it early.`;throw console.error(t),Error(t)}}function Mm(e){if(!e){var t=`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:`This daily-js method`} is only supported on custom callObject instances`;throw console.error(t),Error(t)}}function Nm(e){if(e){var t=`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:`This daily-js method`} is only supported as part of Daily's Prebuilt`;throw console.error(t),Error(t)}}function H(){if(B())throw Error(`This daily-js method is not currently supported in React Native`)}function Pm(){if(!B())throw Error(`This daily-js method is only supported in React Native`)}function Fm(e){if(e===void 0)return!0;var t;if(typeof e==`string`)t=e;else try{t=JSON.stringify(e),Lo(JSON.parse(t),e)||console.warn(`The userData provided will be modified when serialized.`)}catch(e){throw Error(`userData must be serializable to JSON: ${e}`)}if(t.length>4096)throw Error(`userData is too large (${t.length} characters). Maximum size suppported is 4096.`);return!0}function Im(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!!(e.layer===void 0||Number.isInteger(e.layer)&&e.layer>=0||e.layer===`inherit`)},a=function(e){return!!e&&!(e.video&&!i(e.video))&&!(e.screenVideo&&!i(e.screenVideo))},o=0,s=Object.entries(e);o<s.length;o++){var c=ko(s[o],2),l=c[0],u=c[1];if(!r(l)||!a(u))return!1}return!0}function Lm(e){if(I(e)!==`object`)return!1;for(var t=0,n=Object.entries(e);t<n.length;t++){var r=ko(n[t],2),i=r[0],a=r[1];switch(i){case`video`:if(I(a)!==`object`)return!1;for(var o=0,s=Object.entries(a);o<s.length;o++){var c=ko(s[o],2),l=c[0],u=c[1];switch(l){case`processor`:if(!Bm(u))return!1;break;case`settings`:if(!Vm(u))return!1;break;default:return!1}}break;case`audio`:if(I(a)!==`object`)return!1;for(var d=0,f=Object.entries(a);d<f.length;d++){var p=ko(f[d],2),m=p[0],h=p[1];switch(m){case`processor`:if(!zm(h))return!1;break;case`settings`:if(!Vm(h))return!1;break;default:return!1}}break;default:return!1}}return!0}function Rm(e,t,n){var r,i=[];e.video&&e.video.processor&&(Hf((r=t?.useLegacyVideoProcessor)!=null&&r)||(e.video.settings?delete e.video.processor:delete e.video,i.push(`video`))),e.audio&&e.audio.processor&&(Uf()||(e.audio.settings?delete e.audio.processor:delete e.audio,i.push(`audio`))),i.length>0&&console.error(`Ignoring settings for browser- or platform-unsupported input processor(s): ${i.join(`, `)}`),e.audio&&e.audio.settings&&(e.audio.settings.customTrack?(n.audioTrack=e.audio.settings.customTrack,e.audio.settings={customTrack:Ef}):delete n.audioTrack),e.video&&e.video.settings&&(e.video.settings.customTrack?(n.videoTrack=e.video.settings.customTrack,e.video.settings={customTrack:Ef}):delete n.videoTrack)}function zm(e){if(B())return console.warn(`Video processing is not yet supported in React Native`),!1;var t=[`type`];return!!e&&I(e)===`object`&&(Object.keys(e).filter((function(e){return!t.includes(e)})).forEach((function(t){console.warn(`invalid key inputSettings -> audio -> processor : ${t}`),delete e[t]})),!!function(e){return typeof e==`string`?Object.values(Of).includes(e)?!0:(console.error(`inputSettings audio processor type invalid`),!1):!1}(e.type))}function Bm(e){if(B())return console.warn(`Video processing is not yet supported in React Native`),!1;var t=[`type`,`config`];return!e||I(e)!==`object`||!function(e){return typeof e==`string`?Object.values(Df).includes(e)?!0:(console.error(`inputSettings video processor type invalid`),!1):!1}(e.type)||e.config&&(I(e.config)!==`object`||!function(e,t){var n=Object.keys(t);if(n.length===0)return!0;var r=`invalid object in inputSettings -> video -> processor -> config`;switch(e){case Df.BGBLUR:return n.length>1||n[0]!==`strength`?(console.error(r),!1):!(typeof t.strength!=`number`||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error(`${r}; expected: {0 < strength <= 1}, got: ${t.strength}`),!1);case Df.BGIMAGE:return!(t.source!==void 0&&!function(e){if(e.source==="default")return e.type=`default`,!0;if(e.source instanceof ArrayBuffer)return!0;if(es(e.source))return e.type=`url`,!!function(e){var t=new URL(e),n=t.pathname;if(t.protocol===`data:`)try{var r=n.substring(n.indexOf(`:`)+1,n.indexOf(`;`)).split(`/`)[1];return Af.includes(r)}catch(e){return console.error(`failed to deduce blob content type`,e),!1}var i=n.split(`.`).at(-1).toLowerCase().trim();return Af.includes(i)}(e.source)||(console.error(`invalid image type; supported types: [${Af.join(`, `)}]`),!1);return 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, <= 10`),!1):(e.type=`daily-preselect`,!0);var t,n}(t));default:return!0}}(e.type,e.config))?!1:(Object.keys(e).filter((function(e){return!t.includes(e)})).forEach((function(t){console.warn(`invalid key inputSettings -> video -> processor : ${t}`),delete e[t]})),!0)}function Vm(e){return I(e)===`object`&&(!e.customTrack||e.customTrack instanceof MediaStreamTrack)}function Hm(){return`inputSettings must be of the form: { video?: { processor?: { type: [ ${Object.values(Df).join(` | `)} ], config?: {} } }, audio?: { processor: {type: [ ${Object.values(Of).join(` | `)} ] } } }`}function Um(e){return`receiveSettings must be of the form { [<remote participant id> | ${bd}${e.allowAllParticipantsKey?` | "*"`:``}]: { [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}`}function Wm(){return`customIntegrations should be an object of type ${JSON.stringify(ym)}.`}function Gm(e){if(e&&I(e)!==`object`||Array.isArray(e))return console.error(`customTrayButtons should be an Object of the type ${JSON.stringify(vm)}.`),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=ko(n[t],1)[0],i=0,a=Object.entries(e[r]);i<a.length;i++){var o=ko(a[i],2),s=o[0],c=o[1],l=vm.id[s];if(!l)return console.error(`customTrayButton does not support key ${s}`),!1;switch(s){case`iconPath`:case`iconPathDarkMode`:if(!es(c))return console.error(`customTrayButton ${s} should be a url.`),!1;break;case`visualState`:if(![`default`,`sidebar-open`,`active`].includes(c))return console.error(`customTrayButton ${s} should be ${l}. Got: ${c}`),!1;break;default:if(I(c)!==l)return console.error(`customTrayButton ${s} should be a ${l}.`),!1}}return!0}function Km(e){if(!e||e&&I(e)!==`object`||Array.isArray(e))return console.error(Wm()),!1;for(var t=function(e){return`${e} should be ${ym.id[e]}`},n=function(e,t){return console.error(`customIntegration ${e}: ${t}`)},r=0,i=Object.entries(e);r<i.length;r++){var a=ko(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 o=0,s=Object.entries(e[a]);o<s.length;o++){var c=ko(s[o],2),l=c[0],u=c[1];switch(l){case`allow`:case`csp`:case`name`:case`referrerPolicy`:case`sandbox`:if(typeof u!=`string`)return n(a,t(l)),!1;break;case`iconURL`:if(!es(u))return n(a,`${l} should be a url`),!1;break;case`src`:if(`srcdoc`in e[a])return n(a,`cannot have both src and srcdoc`),!1;if(!es(u))return n(a,`src "${u}" 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(typeof u!=`string`)return n(a,t(l)),!1;break;case`location`:if(![`main`,`sidebar`].includes(u))return n(a,t(l)),!1;break;case`controlledBy`:if(u!==`*`&&u!==`owners`&&(!Array.isArray(u)||u.some((function(e){return typeof e!=`string`}))))return n(a,t(l)),!1;break;case`shared`:if((!Array.isArray(u)||u.some((function(e){return typeof e!=`string`})))&&u!==`owners`&&typeof u!=`boolean`)return n(a,t(l)),!1;break;default:if(!ym.id[l])return console.error(`customIntegration does not support key ${l}`),!1}}}return!0}function qm(e,t){if(t===void 0)return!1;switch(I(t)){case`string`:return I(e)===t;case`object`:if(I(e)!==`object`)return!1;for(var n in e)if(!qm(e[n],t[n]))return!1;return!0;default:return!1}}function Jm(e,t){var n=e.sessionId,r=e.toEndPoint,i=e.callerId,a=e.useSipRefer;if(!n||!r)throw Error(`${t}() requires a sessionId and toEndPoint`);if(typeof n!=`string`||typeof r!=`string`)throw Error(`Invalid paramater: sessionId and toEndPoint must be of type string`);if(a&&!r.startsWith(`sip:`))throw Error(`"toEndPoint" must be a "sip" address`);if(!r.startsWith(`sip:`)&&!r.startsWith(`+`))throw Error(`toEndPoint: ${r} must starts with either "sip:" or "+"`);if(i&&typeof i!=`string`)throw Error(`callerId must be of type string`);if(i&&!r.startsWith(`+`))throw Error(`callerId is only valid when transferring to a PSTN number`)}function Ym(e){if(I(e)!==`object`)throw Error(`RemoteMediaPlayerSettings: must be "object" type`);if(e.state&&!Object.values(kf).includes(e.state))throw Error(`Invalid value for RemoteMediaPlayerSettings.state, valid values are: `+JSON.stringify(kf));if(e.volume){if(typeof e.volume!=`number`)throw Error(`RemoteMediaPlayerSettings.volume: must be "number" type`);if(e.volume<0||e.volume>2)throw Error(`RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0`)}}function Xm(e,t,n){return!(typeof e!=`number`||e<t||e>n)}function Zm(e,t){return e&&!t&&delete e.data,e}function Qm(e){"@babel/helpers - typeof";return Qm=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Qm(e)}var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function $m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function eh(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function th(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function nh(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function rh(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ih(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ah=Fe(null),oh=function(){var e=ft(ah);return pt(e),e},sh=Fe({on:function(){},off:function(){}}),ch=-1,lh=function(){return ch--},uh=1,dh=function(){return uh++},W=function(e,t,n){n===void 0&&(n=!1);var r=ft(sh),i=r.off,a=r.on,o=rh(E(!1),2),s=o[0],c=o[1],l=O(0),u=k(function(){return n?lh():dh()},[n]);D(function(){if(!(!e||s)){if(l.current>1e5){console.error(`useDailyEvent called with potentially non-memoized event callback or due to too many re-renders.
49
49
  Memoize using useCallback to avoid re-render loop or reduce the amount of state transitions the callback depends on.
50
- Passed callback for '${e}' event is NOT registered.`,t),c(!0);return}l.current++;var n=setTimeout(function(){l.current=0},50);return a(e,t,u),function(){clearTimeout(n),i(e,u)}}},[t,e,u,s,i,a]),pt({event:e,eventId:u,isBlocked:s,callback:t})};function fh(e,t){var n,r;if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!fh(e[i],t[i]))return!1;return!0}if(MediaStream&&e instanceof MediaStream&&t instanceof MediaStream)return e.id===t.id&&e.active===t.active&&e.getTracks().length===t.getTracks().length&&e.getTracks().every(function(e,n){return fh(e,t.getTracks()[n])});if(MediaStreamTrack&&e instanceof MediaStreamTrack&&t instanceof MediaStreamTrack)return e.id===t.id&&e.kind===t.kind&&e.readyState===t.readyState;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;var a=Array.from(e).sort(),o=Array.from(t).sort();return a.every(function(e,t){return fh(e,o[t])})}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;try{for(var s=nh(e.entries()),c=s.next();!c.done;c=s.next()){var l=rh(c.value,2),u=l[0],d=l[1];if(!t.has(u)||!fh(d,t.get(u)))return!1}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}if(Qm(e)!==`object`||e===null||Qm(t)!==`object`||t===null)return!1;var f=Object.keys(e),p=Object.keys(t);if(f.length!==p.length)return!1;for(var i=0;i<f.length;i++){var u=f[i];if(!Object.prototype.hasOwnProperty.call(t,u)||!fh(e[u],t[u]))return!1}return!0}function ph(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],i=t[n],a=r!==null&&Qm(r)===`object`,o=i!==null&&Qm(i)===`object`;if(a||o){if(!fh(r,i))return!1}else if(r!==i)return!1}return!0}function G(e){return`daily-react-`+e}function mh(e){var t=new Map,n=new Map;return function(r){if(!t.has(r)){var i=N(function(t){var i=e.get(r)(t),a=n.get(r);return a!=null&&e.equals(i,a)?a:(n.set(r,i),i)});t.set(r,i)}return t.get(r)}}var hh=`::`,gh=`;`,_h=function(e,t){return e+hh+t},vh=function(e,t){return e+hh+t.join(gh)},yh=function(e,t){return xh(_h(e,t))},bh=ca(function(e){var t=N([]);return t.debugLabel=G(`participant-property-paths-${e}`),t}),xh=ca(function(e){var t=N(null);return t.debugLabel=G(`participant-property-${e}`),t}),Sh=mh({equals:ph,get:function(e){return function(t){var n=rh(e.split(hh),2),r=n[0];return n[1].split(gh).map(function(e){return t(yh(r,e))})}}}),Ch=function(e,t){var n,r=ho(Array.isArray(t)?Sh(vh(e,t)):xh(_h(e,t)));return pt(Array.isArray(t)?t.reduce(function(e,t,n){return e[t]=r[n],e},{}):(n={},n[t]=r,n)),r},wh=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Eh,Dh;function Oh(){if(Dh)return Eh;Dh=1;var e=`Expected a function`,t=NaN,n=`[object Symbol]`,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=Qm(wh)==`object`&&wh&&wh.Object===Object&&wh,l=(typeof self>`u`?`undefined`:Qm(self))==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(t,n,r){var i,a,o,s,c,l,u=0,d=!1,h=!1,g=!0;if(typeof t!=`function`)throw TypeError(e);n=b(n)||0,_(r)&&(d=!!r.leading,h=`maxWait`in r,o=h?f(b(r.maxWait)||0,n):o,g=`trailing`in r?!!r.trailing:g);function v(e){var n=i,r=a;return i=a=void 0,u=e,s=t.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,n),d?v(e):s}function x(e){var t=e-l,r=e-u,i=n-t;return h?p(i,o-r):i}function S(e){var t=e-l,r=e-u;return l===void 0||t>=n||t<0||h&&r>=o}function C(){var e=m();if(S(e))return w(e);c=setTimeout(C,x(e))}function w(e){return c=void 0,g&&i?v(e):(i=a=void 0,s)}function ee(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function T(){return c===void 0?s:w(m())}function te(){var e=m(),t=S(e);if(i=arguments,a=this,l=e,t){if(c===void 0)return y(l);if(h)return c=setTimeout(C,n),v(l)}return c===void 0&&(c=setTimeout(C,n)),s}return te.cancel=ee,te.flush=T,te}function g(t,n,r){var i=!0,a=!0;if(typeof t!=`function`)throw TypeError(e);return _(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),h(t,n,{leading:i,maxWait:n,trailing:a})}function _(e){var t=Qm(e);return!!e&&(t==`object`||t==`function`)}function v(e){return!!e&&Qm(e)==`object`}function y(e){return Qm(e)==`symbol`||v(e)&&d.call(e)==n}function b(e){if(typeof e==`number`)return e;if(y(e))return t;if(_(e)){var n=typeof e.valueOf==`function`?e.valueOf():e;e=_(n)?n+``:n}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?t:+e}return Eh=g,Eh}var kh=Th(Oh()),Ah=function(e,t,n,r){n===void 0&&(n=500),r===void 0&&(r=!1);var i=ft(sh),a=i.off,o=i.on,s=k(function(){var t;return Array.isArray(e)?e.reduce(function(e,t){return e[t]=r?lh():dh(),e},{}):(t={},t[e]=r?lh():dh(),t)},[e,r]),c=O([]);W(`call-instance-destroyed`,A(function(){c.current.length=0},[]));var l=k(function(){return kh(function(){c.current.length!==0&&(t(c.current),c.current.length=0)},n,{trailing:!0})},[t,n]);D(function(){if(e){var t=function(e){c.current.push(e),l()};return Array.isArray(e)?e.forEach(function(e){return o(e,t,s[e])}):o(e,t,s[e]),function(){Array.isArray(e)?e.forEach(function(e){return a(e,s[e])}):a(e,s[e])}}},[l,e,s,a,o]),pt({event:e,eventId:s})},jh=function(e,t,n){if(t===void 0&&(t=``),n===void 0&&(n=new Set),Qm(e)!==`object`||e===null||n.has(e))return[t];n.add(e);var r=[];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=t?`${t}.${i}`:i;r.push.apply(r,ih([a],rh(jh(e[i],a,n)),!1))}return n.delete(e),r},Mh=function(e){return jh(e)},Nh=function(e,t){return String(t).split(`.`).filter(function(e){return e.length}).reduce(function(e,t){return e&&e[t]},e)},Ph=function(e,t){return t.map(function(t){return Nh(e,t)})},Fh=N(null);Fh.debugLabel=G(`active-id`);var Ih=N(``);Ih.debugLabel=G(`local-id`);var Lh=N(null);Lh.debugLabel=G(`local-join-date`);var Rh=N([]);Rh.debugLabel=G(`participant-ids`);var zh=ca(function(e){var t=N(null);return t.debugLabel=G(`participant-${e}`),t}),Bh=N([]);Bh.debugLabel=G(`waiting-participants`);var Vh=ca(function(e){var t=N({awaitingAccess:{level:`full`},id:e,name:``});return t.debugLabel=G(`waiting-participant-${e}`),t}),Hh=function(e){var t=e.children,n=oh(),r=rh(E(!1),2),i=r[0],a=r[1],o=F(A(function(e,t,n){t(Ih,n.local.session_id);var r=Object.values(n);t(Rh,r.map(function(e){return e.session_id})),r.forEach(function(e){t(zh(e.session_id),e);var n=Mh(e);t(bh(e.session_id),n),n.forEach(function(n){var r=rh(Ph(e,[n]),1)[0];t(yh(e.session_id,n),r)})}),a(!0)},[]));D(function(){if(!(!n||i)){var e=setInterval(function(){var t=n.participants();`local`in t&&(o(t),clearInterval(e))},100);return function(){clearInterval(e)}}},[n,i,o]);var s=A(function(){if(n){var e=n?.participants();e.local&&o(e)}},[n,o]);W(`started-camera`,s,!0),W(`access-state-updated`,s,!0),W(`joining-meeting`,F(A(function(e,t){t(Lh,new Date),s()},[s])),!0),W(`joined-meeting`,A(function(e){o(e.participants)},[o]),!0);var c=F(A(function(e,t){t(Ih,``),t(Fh,null),e(Rh).forEach(function(e){return zh.remove(e)}),t(Rh,[])},[]));return W(`call-instance-destroyed`,c,!0),W(`left-meeting`,c,!0),Ah([`active-speaker-change`,`participant-joined`,`participant-updated`,`participant-left`],F(A(function(e,t,n){n.length&&n.forEach(function(n){switch(n.action){case`active-speaker-change`:t(Fh,n.activeSpeaker.peerId),t(zh(n.activeSpeaker.peerId),function(e){return e?U(U({},e),{last_active:new Date}):null});break;case`participant-joined`:t(Rh,function(e){return e.includes(n.participant.session_id)?e:ih(ih([],rh(e),!1),[n.participant.session_id],!1)}),t(zh(n.participant.session_id),n.participant);var r=Mh(n.participant);t(bh(n.participant.session_id),r),r.forEach(function(e){var r=rh(Ph(n.participant,[e]),1)[0];t(yh(n.participant.session_id,e),r)});break;case`participant-updated`:t(zh(n.participant.session_id),n.participant),n.participant.local&&t(Ih,n.participant.session_id);var r=Mh(n.participant),i=e(bh(n.participant.session_id));(r.length!==i.length||r.some(function(e){return!i.includes(e)}))&&t(bh(n.participant.session_id),r);var a=new Set(i),o=Ph(n.participant,r);r.forEach(function(e,r){var i=o[r];a.delete(e),t(yh(n.participant.session_id,e),function(e){return fh(e,i)?e:i})}),a.forEach(function(e){t(yh(n.participant.session_id,e),null)});break;case`participant-left`:t(Rh,function(e){return e.includes(n.participant.session_id)?e.filter(function(e){return e!==n.participant.session_id}):e}),zh.remove(n.participant.session_id),e(bh(n.participant.session_id)).forEach(function(e){xh.remove(_h(n.participant.session_id,e))}),bh.remove(n.participant.session_id);break}})},[])),100,!0),Ah([`waiting-participant-added`,`waiting-participant-updated`,`waiting-participant-removed`],F(A(function(e,t,n){n.forEach(function(e){switch(e.action){case`waiting-participant-added`:t(Bh,function(t){return t.includes(e.participant.id)?t:ih(ih([],rh(t),!1),[e.participant.id],!1)}),t(Vh(e.participant.id),e.participant);break;case`waiting-participant-updated`:t(Vh(e.participant.id),e.participant);break;case`waiting-participant-removed`:t(Bh,function(t){return t.filter(function(t){return t!==e.participant.id})}),Vh.remove(e.participant.id);break}})},[])),100,!0),P.createElement(P.Fragment,null,t)},Uh=function(){var e=ho(Ih);return pt(e),e},Wh=function(){return!0},Gh=function(e){var t=e===void 0?{}:e,n=t.filter,r=n===void 0?Wh:n,i=t.ignoreLocal,a=i===void 0?!1:i,o=Uh(),s=ho(Fh),c=a&&s===o,l=!r?.(s),u=rh(E(!c&&!l?s:null),2),d=u[0],f=u[1];return D(function(){c||l||f(s)},[l,c,s]),pt(d),d},Kh=function(e){return[`blocked`,`off`].includes(e)},qh=`;`,Jh=function(e,t){return`${e}${qh}${t}`},Yh=mh({equals:fh,get:function(e){return function(t){var n=rh(e.split(qh),2),r=n[0],i=n[1];return t(Rh).filter(function(e){switch(r){case`local`:case`owner`:case`record`:return t(yh(e,r));case`remote`:return!t(yh(e,`local`));case`screen`:var n=t(yh(e,`tracks.screenAudio.state`)),i=t(yh(e,`tracks.screenVideo.state`));return!Kh(n)||!Kh(i);default:return!0}}).sort(function(e,n){switch(i){case`joined_at`:case`session_id`:case`user_id`:case`user_name`:var r=t(yh(e,i)),a=t(yh(n,i));if(r!==void 0||a!==void 0){if(r===void 0)return-1;if(a===void 0||r>a)return 1;if(r<a)return-1}return 0;default:return 0}})}}}),Xh=function(e){var t=e===void 0?{}:e,n=t.filter,r=t.onActiveSpeakerChange,i=t.onParticipantJoined,a=t.onParticipantLeft,o=t.onParticipantUpdated,s=t.sort,c=ho(Yh(Jh(typeof n==`string`?n:null,typeof s==`string`?s:null))),l=typeof n==`function`||typeof s==`function`,u=A(function(e){return typeof n!=`function`&&typeof s!=`function`?[]:c.map(function(t){return e(zh(t))}).filter(function(e){return!!e}).filter(typeof n==`function`?n:function(){return!0}).sort(typeof s==`function`?s:function(){return 0}).map(function(e){return e.session_id}).filter(Boolean)},[n,c,s]),d=rh(E([]),2),f=d[0],p=d[1],m=F(A(function(e){if(l){var t=u(e);fh(t,f)||p(t)}},[f,u,l]));D(function(){m()},[m]),Ah([`participant-joined`,`participant-updated`,`active-speaker-change`,`participant-left`],A(function(e){e.length&&(e.forEach(function(e){switch(e.action){case`participant-joined`:i?.(e);break;case`participant-updated`:o?.(e);break;case`active-speaker-change`:r?.(e);break;case`participant-left`:a?.(e);break}}),m())},[m,r,i,a,o]));var h=typeof n==`function`||typeof s==`function`?f:c;return pt(h),h},Zh=mh({equals:ph,get:function(){return function(e){return e(Yh(Jh(`screen`,null))).map(function(t){return{local:e(yh(t,`local`)),screenAudio:e(yh(t,`tracks.screenAudio`)),screenVideo:e(yh(t,`tracks.screenVideo`)),screenId:`${t}-screen`,session_id:t}})}}}),Qh=function(e){var t=e===void 0?{}:e,n=t.onError,r=t.onLocalScreenShareStarted,i=t.onLocalScreenShareStopped,a=oh(),o=A(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a?.startScreenShare.apply(a,ih([],rh(e),!1))},[a]),s=A(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a?.stopScreenShare.apply(a,ih([],rh(e),!1))},[a]);W(`local-screen-share-started`,A(function(){return r?.()},[r])),W(`local-screen-share-stopped`,A(function(){return i?.()},[i])),W(`nonfatal-error`,A(function(e){e.type===`screen-share-error`&&n?.(e)},[n]));var c=ho(Zh(void 0)),l={isSharingScreen:c.some(function(e){return e.local}),screens:c,startScreenShare:o,stopScreenShare:s};return pt(l),l},$h=function(e,t){t===void 0&&(t=`video`);var n=Ch(e,`tracks.${t}`),r=n?U(U({},n),{isOff:Kh(n.state)}):{isOff:!0,persistentTrack:void 0,state:`off`,subscribed:!1};return pt(r),r};function eg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A(function(t){for(var n=0;n<e.length;n++){var r=e[n];typeof r==`function`?r(t):r&&Qm(r)===`object`&&(r.current=t)}},e)}var tg=ba(Ca(function(e,t){var n=e.onPlayFailed,r=e.sessionId,i=e.type,a=i===void 0?`audio`:i,o=$m(e,[`onPlayFailed`,`sessionId`,`type`]),s=O(null),c=$h(r,a),l=eg(s,t),u=c?.subscribed;return D(function(){var e=s.current;if(!(!e||!c?.persistentTrack)){if(!MediaStream){console.warn(`MediaStream API not available. Can't setup ${a} for ${r}`),n?.({sessionId:r,target:e,type:a,message:`MediaStream API not available`,name:`MediaStream API not available`});return}var t=function(){e.play().catch(function(t){n?.({sessionId:r,target:e,type:a,message:t.message,name:t.name})})};return e.addEventListener(`loadedmetadata`,t),e.srcObject=new MediaStream([c.persistentTrack]),e.load(),function(){e.removeEventListener(`loadedmetadata`,t)}}},[c?.persistentTrack,n,r,a]),W(`participant-left`,A(function(e){var t=s.current;e.participant.session_id!==r||!t||(t.srcObject=null)},[r])),W(`left-meeting`,A(function(){var e=s.current;e&&(e.pause(),e.srcObject=null)},[])),P.createElement(`audio`,U({autoPlay:!0,ref:l},o,{"data-session-id":r,"data-audio-type":a,"data-subscribed":u}))}));tg.displayName=`DailyAudioTrack`;var ng=ba(Ca(function(e,t){var n=e.autoSubscribeActiveSpeaker,r=n===void 0?!1:n,i=e.maxSpeakers,a=i===void 0?5:i,o=e.onPlayFailed,s=e.playLocalScreenAudio,c=s===void 0?!1:s,l=oh(),u=rh(E(Array(a).fill(``)),2),d=u[0],f=u[1],p=Qh().screens,m=Uh(),h=Gh({ignoreLocal:!0}),g=O(null);dt(t,function(){return{getActiveSpeakerAudio:function(){return g.current?.querySelector(`audio[data-session-id="${h}"][data-audio-type="audio"]`)??null},getAllAudio:function(){return Array.from(g.current?.querySelectorAll(`audio`)??[])},getAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="audio"]`)??null},getRmpAudio:function(){return Array.from(g.current?.querySelectorAll(`audio[data-audio-type="rmpAudio"]`)??[])},getScreenAudio:function(){return Array.from(g.current?.querySelectorAll(`audio[data-audio-type="screenAudio"]`)??[])},getRmpAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="rmpAudio"]`)??null},getScreenAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="screenAudio"]`)??null}}},[h]);var _=F(A(function(e,t,n){return eh(void 0,void 0,void 0,function(){var t,i;return th(this,function(a){if(t=Object.values(l?.participants()??{}).filter(function(e){return!e.local&&!!e.tracks.audio.subscribed}),i=function(e){return t.some(function(t){return t.session_id===e})},!i(n))if(l&&!l.isDestroyed()&&r&&!l.subscribeToTracksAutomatically())l.updateParticipant(n,{setSubscribedTracks:{audio:!0}});else return[2];return f(function(r){if(r.includes(n))return r;var a=function(e){return!e||!i(e)};if(r.some(a)){var o=r.findIndex(a);return r[o]=n,ih([],rh(r),!1)}var s=r.findIndex(function(e){return t.some(function(t){return t.session_id===e&&Kh(t.tracks.audio.state)})});if(s>=0)return r[s]=n,ih([],rh(r),!1);var c=t.filter(function(e){return r.includes(e.session_id)&&e.session_id!==h}).sort(function(t,n){var r=e(yh(t.session_id,`last_active`))??new Date(`1970-01-01`),i=e(yh(n.session_id,`last_active`))??new Date(`1970-01-01`);return r>i?1:r<i?-1:0});if(!c.length){var l=r.findIndex(function(e){return e!==h});return r[l]=n,ih([],rh(r),!1)}var u=r.indexOf(c[0]?.session_id);return r[u]=n,ih([],rh(r),!1)}),[2]})})},[h,r,l])),v=A(function(e){f(function(t){if(!t.includes(e))return t;var n=ih([],rh(t),!1),r=n.indexOf(e);return n[r]=``,n})},[]);Ah([`active-speaker-change`,`track-started`,`participant-left`],A(function(e){e.forEach(function(e){switch(e.action){case`active-speaker-change`:if(e.activeSpeaker.peerId===m)return;_(e.activeSpeaker.peerId);break;case`track-started`:e.track.kind===`audio`&&e.participant&&!e.participant.local&&_(e.participant.session_id);break;case`participant-left`:v(e.participant.session_id);break}})},[_,m,v]),200);var y=Xh({filter:A(function(e){return!!e?.tracks?.rmpAudio},[])});return P.createElement(`div`,{ref:g},d.map(function(e,t){return P.createElement(tg,{key:`speaker-slot-${t}`,onPlayFailed:o,sessionId:e,type:`audio`})}),p.filter(function(e){return c?!0:!e.local}).map(function(e){return P.createElement(tg,{key:e.screenId,onPlayFailed:o,sessionId:e.session_id,type:`screenAudio`})}),y.map(function(e){return P.createElement(tg,{key:`${e}-rmp`,onPlayFailed:o,sessionId:e,type:`rmpAudio`})}))}));ng.displayName=`DailyAudio`;var rg=Ca(function(e,t){var n=e.automirror,r=e.fit,i=r===void 0?`contain`:r,a=e.mirror,o=e.onResize,s=e.playableStyle,c=s===void 0?{}:s,l=e.sessionId,u=e.style,d=u===void 0?{}:u,f=e.type,p=f===void 0?`video`:f,m=$m(e,[`automirror`,`fit`,`mirror`,`onResize`,`playableStyle`,`sessionId`,`style`,`type`]),h=Uh()===l,g=p===`screenVideo`,_=h&&!g,v=O(null),y=eg(v,t),b=$h(l,p),x=b.persistentTrack,S=_||g||!b.isOff,C=Ch(l,`tracks.${p}`)?.subscribed,w=k(function(){if(typeof a==`boolean`)return a;if(!n)return!1;if(!x)return _;var e=x.getSettings();return`facingMode`in e?_&&e.facingMode===`user`:_},[n,_,a,x]);return D(function(){var e=v.current;if(e){var t=function(){var t=e.play();t!==void 0&&t.then(function(){e.controls=!1}).catch(function(t){e.controls=!0,console.warn(`Failed to play video`,t)})},n=function(){e.paused&&t()},r=function(){e.style.transform=`scale(1)`},i=function(){e.style.transform=``,setTimeout(function(){e.paused&&t()},100)},a=function(){document.visibilityState!==`hidden`&&e.paused&&t()};return e.addEventListener(`canplay`,n),e.addEventListener(`enterpictureinpicture`,r),e.addEventListener(`leavepictureinpicture`,i),document.addEventListener(`visibilitychange`,a),function(){e.removeEventListener(`canplay`,n),e.removeEventListener(`enterpictureinpicture`,r),e.removeEventListener(`leavepictureinpicture`,i),document.removeEventListener(`visibilitychange`,a)}}},[]),D(function(){var e=v.current;if(!(!e||!x)){if(!MediaStream){console.warn(`MediaStream API not available. Can't setup ${p} for ${l}`);return}return e.srcObject=new MediaStream([x]),e.load(),function(){e.srcObject=null,e.load()}}},[l,p,x,x?.id]),D(function(){var e=v.current;if(!o||!e)return;var t;function n(){t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=v.current;if(!(!e||document.hidden)){var t=e.videoWidth,n=e.videoHeight;t&&n&&o?.({aspectRatio:t/n,height:n,width:t})}})}return n(),e.addEventListener(`loadedmetadata`,n),e.addEventListener(`resize`,n),function(){t&&cancelAnimationFrame(t),e.removeEventListener(`loadedmetadata`,n),e.removeEventListener(`resize`,n)}},[o]),P.createElement(`video`,U({autoPlay:!0,muted:!0,playsInline:!0,ref:y,"data-local":h,"data-mirrored":w||void 0,"data-playable":S||void 0,"data-session-id":l,"data-subscribed":C,"data-video-type":p,style:U(U({objectFit:i,transform:w?`scale(-1, 1)`:``},d),S?c:{})},m))});rg.displayName=`DailyVideo`;var ig=Fe({refreshDevices:function(){return Promise.resolve()}}),ag=N(`idle`);ag.debugLabel=G(`camera-state`);var og=N(`idle`);og.debugLabel=G(`microphone-state`);var sg=N([]);sg.debugLabel=G(`camera-devices`);var cg=N([]);cg.debugLabel=G(`microphone-devices`);var lg=N([]);lg.debugLabel=G(`speaker-devices`);var ug=N(null);ug.debugLabel=G(`last-camera-error`);var dg=function(e){var t=e.children,n=oh(),r=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e,r,i,a,o,s,c,l,u,d;return th(this,function(f){switch(f.label){case 0:if((navigator==null?void 0:navigator.mediaDevices)?.getUserMedia===void 0||(navigator==null?void 0:navigator.mediaDevices)?.enumerateDevices===void 0)return t(ag,`not-supported`),t(og,`not-supported`),[2];if(!n)return[2];f.label=1;case 1:return f.trys.push([1,4,,5]),[4,n.enumerateDevices()];case 2:return e=f.sent().devices,r=e.filter(function(e){return e.kind===`videoinput`&&e.deviceId!==``}),i=e.filter(function(e){return e.kind===`audioinput`&&e.deviceId!==``}),a=e.filter(function(e){return e.kind===`audiooutput`&&e.deviceId!==``}),[4,n.getInputDevices()];case 3:return o=f.sent(),s=o.camera,c=o.mic,l=o.speaker,u=function(e,t,n){var r=n.find(function(e){return e.device.deviceId===t.deviceId}),i=`deviceId`in e&&t.deviceId===e.deviceId,a=!(`deviceId`in e)&&r?.selected;return{device:t,selected:i||!!a,state:r?.state??`granted`}},d=function(e,t){return e.device.deviceId==="default"?-1:t.device.deviceId==="default"?1:e.device.label<t.device.label?-1:+(e.device.label>t.device.label)},t(sg,function(e){return r.filter(Boolean).map(function(t){return u(s,t,e)}).sort(d)}),t(cg,function(e){return i.filter(Boolean).map(function(t){return u(c,t,e)}).sort(d)}),t(lg,function(e){return a.filter(Boolean).map(function(t){return u(l,t,e)}).sort(d)}),[3,5];case 4:return f.sent(),t(ag,`not-supported`),t(og,`not-supported`),[3,5];case 5:return[2]}})})},[n])),i=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var i,a,o,s,c,l,u,d,f,p,m,h;return th(this,function(g){switch(g.label){case 0:if(!n||(i=e(ag),a=e(og),o=n.participants(),!o.local))return[2];if(s=o.local.tracks,c=`prompt`,l=`prompt`,!navigator.permissions)return[3,5];g.label=1;case 1:return g.trys.push([1,4,,5]),[4,navigator.permissions.query({name:`camera`})];case 2:return u=g.sent(),c=u.state,[4,navigator.permissions.query({name:`microphone`})];case 3:return d=g.sent(),l=d.state,[3,5];case 4:return g.sent(),[3,5];case 5:return f=c===`prompt`&&[`idle`,`pending`].includes(i)&&s.video.state===`interrupted`&&!s.video.persistentTrack,p=[`idle`,`pending`].includes(i)&&!s.video.persistentTrack&&!!s.video.off?.byUser,m=l===`prompt`&&[`idle`,`pending`].includes(a)&&s.audio.state===`interrupted`&&!s.audio.persistentTrack,h=[`idle`,`pending`].includes(a)&&!s.audio.persistentTrack&&!!s.audio.off?.byUser,s.audio?.blocked?.byDeviceInUse?(t(og,`in-use`),t(cg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`in-use`}):e})})):s.audio?.blocked?.byDeviceMissing?t(og,`not-found`):s.audio?.blocked?.byPermissions||l===`denied`?t(og,`blocked`):m?t(og,`pending`):h?t(og,`idle`):(t(og,`granted`),t(cg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`granted`}):e})})),s.video?.blocked?.byDeviceInUse?(t(ag,`in-use`),t(sg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`in-use`}):e})})):s.video?.blocked?.byDeviceMissing?t(ag,`not-found`):s.video?.blocked?.byPermissions||c===`denied`?t(ag,`blocked`):f?t(ag,`pending`):p?t(ag,`idle`):(t(ag,`granted`),t(sg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`granted`}):e})})),r(),[2]}})})},[n,r]));return W(`participant-updated`,A(function(e){e.participant.local&&i()},[i])),W(`available-devices-updated`,r),W(`selected-devices-updated`,r),W(`camera-error`,F(A(function(e,t,n){switch(t(ug,n.error),n.error?.type){case`cam-in-use`:t(ag,`in-use`);break;case`mic-in-use`:t(og,`in-use`);break;case`cam-mic-in-use`:t(ag,`in-use`),t(og,`in-use`);break;case`not-found`:n.error?.missingMedia.includes(`video`)&&t(ag,`not-found`),n.error?.missingMedia.includes(`audio`)&&t(og,`not-found`);break;case`permissions`:n.error?.blockedMedia.includes(`video`)&&t(ag,`blocked`),n.error?.blockedMedia.includes(`audio`)&&t(og,`blocked`);break;case`constraints`:n.error?.reason===`invalid`?(t(ag,`constraints-invalid`),t(og,`constraints-invalid`)):n.error?.reason===`none-specified`&&(t(ag,`constraints-none-specified`),t(og,`constraints-none-specified`));break;case`undefined-mediadevices`:t(ag,`undefined-mediadevices`),t(og,`undefined-mediadevices`);break;default:t(ag,`unknown`),t(og,`unknown`);break}},[]))),W(`started-camera`,F(A(function(e,t){t(ag,`granted`),t(og,`granted`),i()},[i]))),P.createElement(ig.Provider,{value:{refreshDevices:r}},t)};function fg(e){return e.instanceId??`__default__`}var pg=N({});pg.debugLabel=G(`live-streaming-instances`);var mg=N(function(e){var t=e(pg),n=Object.values(t),r=n.filter(function(e){return e.isLiveStreaming}),i=r[0]??n[n.length-1];return{errorMsg:n.find(function(e){return e.errorMsg})?.errorMsg,isLiveStreaming:r.length>0,layout:i?.layout}});mg.debugLabel=G(`live-streaming`);var hg=function(e){var t=e.children;return W(`live-streaming-started`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return U(U({},e),(t={},t[r]={instanceId:r,isLiveStreaming:!0,layout:n?.layout},t))})},[]))),W(`live-streaming-stopped`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return e[r]?U(U({},e),(t={},t[r]=U(U({},e[r]),{isLiveStreaming:!1,layout:void 0}),t)):e})},[]))),W(`live-streaming-error`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return U(U({},e),(t={},t[r]=U(U({},e[r]??{instanceId:r,isLiveStreaming:!1}),{errorMsg:n.errorMsg}),t))})},[]))),W(`left-meeting`,F(A(function(e,t){t(pg,{})},[]))),P.createElement(P.Fragment,null,t)},gg=N(`new`);gg.debugLabel=G(`meeting-state`);var _g=N(null);_g.debugLabel=G(`meeting-error`);var vg=N(null);vg.debugLabel=G(`non-fatal-error`);var yg=N({data:void 0,topology:`none`});yg.debugLabel=G(`meeting-session-data`);var bg=function(e){var t=e.children,n=oh(),r=F(A(function(e,t){if(n){var r=n.meetingState();return t(gg,r),r}},[n]));return W(`loading`,r),W(`loaded`,r),W(`joining-meeting`,r),W(`joined-meeting`,r),W(`left-meeting`,r),W(`error`,F(A(function(e,t,n){t(_g,n),r()},[r]))),W(`nonfatal-error`,F(A(function(e,t,n){t(vg,n)},[]))),W(`joined-meeting`,F(A(function(e,t){n&&t(yg,n.meetingSessionState())},[n]))),W(`meeting-session-state-updated`,F(A(function(e,t,n){t(yg,n.meetingSessionState)},[]))),W(`left-meeting`,F(A(function(e,t){t(yg,{data:void 0,topology:`none`})},[]))),W(`call-instance-destroyed`,F(A(function(e,t){t(gg,`new`),t(_g,null),t(vg,null),t(yg,{data:void 0,topology:`none`})},[]))),P.createElement(P.Fragment,null,t)},xg=N(`none`);xg.debugLabel=G(`topology`);var Sg=N(`unknown`),Cg=N([]),wg=N(`interrupted`),Tg=N(100);Tg.debugLabel=G(`network-quality`);var Eg=N(`good`);Eg.debugLabel=G(`network-threshold`);var Dg=function(e){var t=e.children,n=oh(),r=ho(xg),i=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e;return th(this,function(r){switch(r.label){case 0:return n?[4,n.getNetworkTopology()]:[2];case 1:return e=r.sent(),!e||e?.topology===`none`||t(xg,e.topology),[2]}})})},[n]));return W(`joined-meeting`,i),W(`network-connection`,F(A(function(e,t,n){switch(t(wg,n.event),n.event){case`connected`:n.type===`peer-to-peer`&&t(xg,`peer`),n.type===`sfu`&&t(xg,`sfu`);break}},[]))),W(`network-quality-change`,F(A(function(e,t,n){t(Sg,function(e){return e===n.networkState?e:n.networkState}),t(Cg,function(e){var t=n.networkStateReasons??[];return ph(e,t)?e:t}),t(Tg,function(e){return e===n.quality?e:n.quality}),t(Eg,function(e){return e===n.threshold?e:n.threshold})},[]))),W(`left-meeting`,F(A(function(e,t){t(xg,`none`),t(Sg,`unknown`),t(Cg,[]),t(wg,`interrupted`),t(Tg,100),t(Eg,`good`)},[]))),D(function(){!n||r!==`none`||i()},[n,i,r]),P.createElement(P.Fragment,null,t)};function Og(e){return e.instanceId?e.instanceId:e.type===`local`||e.local?`__local__`:`__default__`}var kg=N({});kg.debugLabel=G(`recording-instances`);var Ag=N(function(e){var t=e(kg),n=Object.values(t),r=n.filter(function(e){return e.isRecording}),i=r[0]??n[n.length-1];return{error:n.some(function(e){return e.error}),isLocalParticipantRecorded:n.some(function(e){return e.isLocalParticipantRecorded}),isRecording:r.length>0,layout:i?.layout,local:i?.local,recordingId:i?.recordingId,recordingStartedDate:i?.recordingStartedDate,startedBy:i?.startedBy,type:i?.type}});Ag.debugLabel=G(`recording-state`);var jg=function(e){var t=e.children,n=Uh(),r=Xh({filter:`record`}),i=F(A(function(e,t,n,r){var i=e(kg).__local__,a={instanceId:`__local__`,isLocalParticipantRecorded:n,isRecording:n,local:n?r:i?.local,type:n?`local`:i?.type};i&&fh(i,a)||!n&&!i||(n?t(kg,function(e){return U(U({},e),{__local__:a})}):i&&t(kg,function(e){return U(U({},e),{__local__:U(U({},i),{isLocalParticipantRecorded:!1,isRecording:!1})})}))},[]));return D(function(){i(r.length>0,r.includes(n||`local`))},[n,i,r]),W(`recording-started`,F(A(function(e,t,r){var i=Og(r),a=!0;switch(r.type){case`cloud-audio-only`:case`cloud-beta`:case`cloud`:n&&r.layout?.preset===`single-participant`&&r.layout.session_id!==n&&(a=!1);break}t(kg,function(e){var t;return U(U({},e),(t={},t[i]={error:!1,instanceId:i,isLocalParticipantRecorded:a,isRecording:!0,layout:r?.layout,local:r?.local,recordingId:r?.recordingId,recordingStartedDate:new Date,startedBy:r?.startedBy,type:r?.type},t))})},[n]))),W(`recording-stopped`,F(A(function(e,t,n){var r=Og(n);t(kg,function(e){var t;return e[r]?U(U({},e),(t={},t[r]=U(U({},e[r]),{isLocalParticipantRecorded:!1,isRecording:!1}),t)):e})},[]))),W(`recording-error`,F(A(function(e,t,n){var r=Og(n);t(kg,function(e){var t,i=e[r];return U(U({},e),(t={},t[r]=U(U({},i??{instanceId:r}),{error:!0,errorMsg:n.errorMsg,isLocalParticipantRecorded:!1,isRecording:!1}),t))})},[]))),W(`left-meeting`,F(A(function(e,t){t(kg,{})},[]))),P.createElement(P.Fragment,null,t)},Mg=function(){var e=ho(gg);return pt(e),e},Ng=N(null);Ng.debugLabel=G(`room-state`);var Pg=function(e){var t=e.children,n=oh(),r=Mg();return W(`access-state-updated`,F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e;return th(this,function(i){switch(i.label){case 0:return!n||r===`left-meeting`?[2]:[4,n.room()];case 1:return e=i.sent(),e&&`id`in e&&t(Ng,e),[2,e]}})})},[n,r]))),W(`left-meeting`,F(A(function(e,t){return function(){t(Ng,null)}},[]))),P.createElement(P.Fragment,null,t)},Fg=N({isTranscribing:!1,model:`general`,language:`en`,transcriptions:[]});Fg.debugLabel=G(`transcription-state`);var Ig=function(e){var t=e.children;return W(`transcription-started`,F(A(function(e,t,n){t(Fg,{error:!1,transcriptionStartDate:new Date,isTranscribing:!0,transcriptions:[],endpointing:n.endpointing,extra:n.extra,includeRawResponse:n.includeRawResponse,instanceId:n.instanceId,language:n.language,model:n.model,profanity_filter:n.profanity_filter,punctuate:n.punctuate,redact:n.redact,startedBy:n.startedBy,tier:n.tier})},[]))),W(`transcription-stopped`,F(A(function(e,t,n){t(Fg,function(e){return U(U({},e),{updatedBy:n.updatedBy,isTranscribing:!1})})},[]))),W(`transcription-error`,F(A(function(e,t){t(Fg,function(e){return U(U({},e),{error:!0,isTranscribing:!1})})},[]))),W(`left-meeting`,F(A(function(e,t){t(Fg,function(e){return U(U({},e),{isTranscribing:!1})})},[]))),W(`app-message`,F(A(function(e,t,n){n?.fromId===`transcription`&&t(Fg,function(e){return U(U({},e),{isTranscribing:!0,transcriptions:ih(ih([],rh(e.transcriptions),!1),[n.data],!1)})})},[]))),P.createElement(P.Fragment,null,t)},Lg=`0.25.2`,Rg={strictMode:!0},zg=function(){return!0},Bg={options:Rg,shouldCreateInstance:zg},Vg=function(e,t){var n=t===void 0?Bg:t,r=n.parentElRef,i=n.options,a=i===void 0?Rg:i,o=n.shouldCreateInstance,s=o===void 0?zg:o,c=rh(E(null),2),l=c[0],u=c[1],d=O();return D(function(){if(e===`callFrame`&&r?.current===null||!s())return;function t(e){return eh(this,void 0,void 0,function(){return th(this,function(t){switch(t.label){case 0:return[4,e.destroy()];case 1:return t.sent(),[2]}})})}var n=function(){setTimeout(function(){return u(null)},0)},i=wm.getCallInstance();if(!l&&i&&!i.isDestroyed()){i.once(`call-instance-destroyed`,n),u(i);return}if(l){fh(d.current,a)||t(l);return}if(!i||i.isDestroyed())try{var o=U(U({},a),{aboutClient:U(U({},a.aboutClient??{}),{"daily-react":Lg})});switch(e){case`callFrame`:i=r?.current?wm.createFrame(r.current,o):wm.createFrame(o);break;case`callObject`:i=wm.createCallObject(o);break}d.current=a,u(i),i.once(`call-instance-destroyed`,n)}catch(e){if(console.error(`Error creating call instance:`,e),a.strictMode)throw e}},[l,a,r,s,e]),l},Hg=function(e){return Vg(`callObject`,e)},Ug=function(e){var t=e.children,n=e.jotaiStore,r=$m(e,[`children`,`jotaiStore`]),i=O({}),a=A(function(e){var t,n;if(`action`in e){var r=e.action,a=Array.from(i.current?.[r]??[]),o=a.filter(function(e){return rh(e,1)[0]<0}),s=a.filter(function(e){return rh(e,1)[0]>0}),c=ih(ih([],rh(o),!1),rh(s),!1);try{for(var l=nh(c),u=l.next();!u.done;u=l.next()){var d=rh(u.value,2)[1];d(e)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}},[]),o=A(function(e){e&&Object.keys(i.current).forEach(function(t){e.off(t,a),e.isDestroyed()||e.on(t,a)})},[a]),s=`callObject`in r?r.callObject:null,c=Hg({options:k(function(){return`callObject`in r?{}:r},[r]),shouldCreateInstance:A(function(){return!(`callObject`in r)},[r])}),l=s??c;D(function(){l&&o(l)},[l,o]);var u=A(function(e,t,n){var r;i.current[e]||(i.current[e]=new Map,l&&(l.off(e,a),l.isDestroyed()||l.on(e,a))),i.current[e]?.has(n)||(r=i.current[e])==null||r.set(n,t)},[l,a]),d=A(function(e,t){var n;(n=i.current[e])==null||n.delete(t),i.current[e]?.size===0&&(l?.off(e,a),delete i.current[e])},[l,a]);return P.createElement(co,{store:n},P.createElement(ah.Provider,{value:l},P.createElement(sh.Provider,{value:{on:u,off:d}},P.createElement(Pg,null,P.createElement(bg,null,P.createElement(Dg,null,P.createElement(Hh,null,P.createElement(jg,null,P.createElement(hg,null,P.createElement(Ig,null,P.createElement(dg,null,t)))))))))))},Wg=function(e){var t=(e===void 0?{}:e).onAppMessage,n=oh(),r=A(function(e,t){t===void 0&&(t=`*`),n&&n.sendAppMessage(e,t)},[n]);return W(`app-message`,A(function(e){t?.(e,r)},[t,r])),r},Gg=function(e,t,n,r){var i=oh(),a=e===Uh();W(`local-audio-level`,A(function(e){a&&t(e.audioLevel)},[t,a])),W(`remote-participants-audio-level`,A(function(n){a||t(n.participantsAudioLevel[e])},[t,e,a])),D(function(){if(!(!i||i.isDestroyed()||!a)&&!i.isLocalAudioLevelObserverRunning())try{i.startLocalAudioLevelObserver(r)}catch{n?.(`Local audio level observer not supported in this browser`)}},[i,n,r,a]),D(function(){!i||i.isDestroyed()||a||i.isRemoteParticipantsAudioLevelObserverRunning()||i.startRemoteParticipantsAudioLevelObserver(r)},[i,r,a])},Kg=function(e){return $h(e,`audio`)},qg,Jg;function Yg(){return Jg?qg:(Jg=1,qg=function e(t,n){if(t===n)return!0;if(t&&n&&Qm(t)==`object`&&Qm(n)==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n},qg)}Yg();var Xg=N({state:`low`,reason:`none`});Xg.debugLabel=G(`cpu-load`);var Zg=function(){var e=oh(),t=ho(ag),n=ho(og),r=ho(sg),i=ho(cg),a=ho(lg),o=ho(ug),s=ft(ig).refreshDevices,c=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setInputDevicesAsync({audioDeviceId:null,videoDeviceId:t})];case 1:return n.sent(),[2]}})})},[e]),l=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setInputDevicesAsync({audioDeviceId:t,videoDeviceId:null})];case 1:return n.sent(),[2]}})})},[e]),u=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setOutputDeviceAsync({outputDeviceId:t})];case 1:return n.sent(),[2]}})})},[e]),d=[`blocked`,`in-use`,`not-found`,`constraints-invalid`,`constraints-none-specified`,`undefined-mediadevices`,`unknown`],f={cameraError:o,cameras:r,camState:t,currentCam:r.find(function(e){return e.selected}),currentMic:i.find(function(e){return e.selected}),currentSpeaker:a.find(function(e){return e.selected}),hasCamError:d.includes(t),hasMicError:d.includes(n),microphones:i,micState:n,refreshDevices:s,setCamera:c,setMicrophone:l,setSpeaker:u,speakers:a};return pt(f),f},Qg=N(null);Qg.debugLabel=G(`input-settings`);var $g=N({hidden:0,present:0});$g.debugLabel=G(`participant-counts`);var e_=ca(function(e){var t=N({},function(t,n,r){n(e_(e),r)});return t.debugLabel=G(`participant-receive-settings-${e}`),t}),t_=function(e){return $h(e,`screenVideo`)},n_=N(null);n_.debugLabel=G(`send-settings`);var r_=function(e){return $h(e,`video`)};function i_({children:e}){return j(Ug,{children:e})}var a_=Fe(null),o_=`tavus:memory-user-id:`,s_=new Map;function c_(e){return`${o_}${e}`}function l_(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function u_(e){if(!e)return``;let t=c_(e);try{let e=window.localStorage.getItem(t);if(e)return e;let n=l_();return window.localStorage.setItem(t,n),n}catch{}let n=s_.get(t);if(n)return n;let r=l_();return s_.set(t,r),r}var d_=`tavus:terms-accepted:`;function f_(e){let t=5381;for(let n=0;n<e.length;n++)t=(t*33^e.charCodeAt(n))>>>0;return t.toString(36)}function p_(e,t){return`${d_}${e}:${f_(t)}`}function m_(e,t){if(!e||!t)return!1;try{return globalThis.localStorage?.getItem(p_(e,t))===`1`}catch{return!1}}function h_(e,t){if(!(!e||!t))try{globalThis.localStorage?.setItem(p_(e,t),`1`)}catch{}}var g_=null;function __(e,t){!e||!t||(g_={deploymentId:e,content:t})}function v_(){g_&&=(h_(g_.deploymentId,g_.content),null)}function y_(e){return e===`replica`||e===`user`?e:null}function b_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x_(e){if(!b_(e)||e.message_type!==`conversation`||typeof e.event_type!=`string`||!b_(e.properties))return null;if(e.event_type===`conversation.utterance`){let t=e.properties;return typeof t.speech==`string`?{kind:`chat-message`,sender:t.role===`replica`?`agent`:`user`,text:t.speech}:null}if(e.event_type===`conversation.utterance.streaming`){let t=e.properties;if(typeof t.speech!=`string`)return null;let n=t.final===!0||t.is_interrupted===!0;return{kind:`caption-update`,text:t.speech,final:n,role:y_(t.role)}}return null}function S_(e,t){return{message_type:`conversation`,event_type:`conversation.respond`,conversation_id:e,properties:{text:t}}}function C_(e,t){return typeof e[t]==`number`?{[t]:e[t]}:{}}function w_(e){let t=e.role===`user`||e.role===`replica`?e.role:null;return!t||typeof e.speech!=`string`?null:{kind:`utterance`,event_type:`conversation.utterance`,properties:{role:t,speech:e.speech,...C_(e,`seq`),...C_(e,`turn_idx`)}}}function T_(e){let t=e.role===`user`||e.role===`replica`?e.role:null;return!t||typeof e.speech!=`string`?null:{kind:`utterance.streaming`,event_type:`conversation.utterance.streaming`,properties:{role:t,speech:e.speech,...typeof e.final==`boolean`?{final:e.final}:{},...typeof e.is_interrupted==`boolean`?{is_interrupted:e.is_interrupted}:{},...C_(e,`seq`)}}}function E_(e){return typeof e.name!=`string`||typeof e.arguments!=`string`?null:{kind:`tool_call`,event_type:`conversation.tool_call`,properties:{name:e.name,arguments:e.arguments,...C_(e,`seq`),...C_(e,`turn_idx`)}}}function D_(e){if(typeof e.name!=`string`||typeof e.arguments!=`string`)return null;let t=e.modality===`vision`||e.modality===`audio`?e.modality:null;return t?{kind:`perception_tool_call`,event_type:`conversation.perception_tool_call`,properties:{name:e.name,arguments:e.arguments,modality:t}}:null}function O_(e){return{kind:`perception_analysis`,event_type:`conversation.perception_analysis`,properties:e}}function k_(e,t){return{kind:`speaking`,event_type:t,properties:{...C_(e,`seq`),...C_(e,`turn_idx`)}}}var A_={"conversation.utterance":w_,"conversation.utterance.streaming":T_,"conversation.tool_call":E_,"conversation.perception_tool_call":D_,"conversation.perception_analysis":O_,"conversation.replica_started_speaking":k_,"conversation.replica_stopped_speaking":k_,"conversation.user_started_speaking":k_,"conversation.user_stopped_speaking":k_};function j_(e){if(!b_(e)||e.message_type!==`conversation`||typeof e.event_type!=`string`||!b_(e.properties))return null;let t=A_[e.event_type];return t?t(e.properties,e.event_type):{kind:`unknown`,event_type:e.event_type,properties:e.properties}}function M_(e,t){return{message_type:`conversation`,event_type:t.event_type,conversation_id:e,properties:t.properties??{}}}function N_(e,t){let n=x_(e);return n?n.kind===`chat-message`?(t.appendChatMessage(n.sender,n.text),!0):(t.setCaption(n.text,n.final,n.role),!0):!1}function P_(e=5e3){let t=[],n=n=>{for(;t.length>0&&n-t[0].ts>e;)t.shift()};return{markSent(e){t.push({text:e,ts:Date.now()})},consumeMatch(e){n(Date.now());let r=t.findIndex(t=>t.text===e);return r===-1?!1:(t.splice(r,1),!0)}}}var F_=vn(`Conversation`),I_=1500,L_=Fe(null);function R_({children:e}){return j(i_,{children:j(G_,{children:e})})}function z_(e,t,n){let{role:r,speech:i}=e.properties;if(!(r===`user`&&n.consumeMatch(i)))for(let n of t)n.onUtterance?.({...e.properties})}function B_(e,t){for(let n of t)n.onToolCall?.({...e.properties})}function V_(e,t){for(let n of t)n.onPerception?.(e)}function H_(e,t){let n=e.event_type,r=n.startsWith(`conversation.replica`)?`replica`:`user`,i=n.endsWith(`started_speaking`)?`started`:`stopped`;for(let n of t)n.onSpeakingState?.({who:r,state:i,...e.properties})}function U_(e,t){for(let n of t)n.onMessage?.(e)}function W_(e,t,n){switch(e.kind){case`utterance`:case`utterance.streaming`:z_(e,t,n);return;case`tool_call`:B_(e,t);return;case`perception_tool_call`:case`perception_analysis`:V_(e,t);return;case`speaking`:H_(e,t);return;case`unknown`:U_(e,t);return}}function G_({children:e}){let{deploymentId:t,client:n,config:r}=ft(bi),{memoryStores:i}=ft(Ct),a=oh(),o=Mg(),s=ft(a_),c=k(()=>Ut(`idle`),[]),l=k(()=>Ut(null),[]),u=k(()=>Ut([]),[]),d=k(()=>Ut(``),[]),f=k(()=>Ut(null),[]),p=k(()=>Ut(null),[]),m=k(()=>Ut(null),[]),h=k(()=>Ut(null),[]),g=O(null),_=k(()=>P_(),[]),v=k(()=>new Set,[]),y=k(()=>Ut(`idle`),[]),b=s?.flowSignal??y,x=A(e=>{m.value=e},[m]),S=A(e=>{h.value=e},[h]),[,C]=E(o);D(()=>{C(o),o===`joined-meeting`?(c.value=`connected`,F_.info(`Connected to meeting`)):o===`left-meeting`?(c.value=`ended`,v_(),F_.info(`Left meeting`)):o===`error`&&(p.value=`Meeting error`,c.value=`error`)},[o,c,p]),_n(()=>{let e=c.value;if(e===`connected`)for(let e of v)e.onConnect?.();else if(e===`ended`||e===`disconnecting`)for(let e of v)e.onDisconnect?.();else if(e===`error`){let e=p.peek()??`Unknown error`;for(let t of v)t.onError?.({code:`CONVERSATION_ERROR`,message:e})}}),_n(()=>{let e=b.value;for(let t of v)t.onModeChange?.(e)}),Wg({onAppMessage:A(e=>{N_(e?.data,{appendChatMessage(e,t){e===`user`&&_.consumeMatch(t)||(u.value=[...u.peek(),{id:crypto.randomUUID(),sender:e,text:t,timestamp:Date.now()}])},setCaption(e,t,n){d.value=e,f.value=n,g.current!==null&&(clearTimeout(g.current),g.current=null),t&&(g.current=setTimeout(()=>{d.value=``,f.value=null,g.current=null},I_))}});let t=j_(e?.data);t&&W_(t,v,_)},[u,d,f,_,v])}),D(()=>()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);let w=A(async(e,o)=>{try{c.value=`connecting`,p.value=null;let s=e,u=m.peek();u&&s?.password==null&&(s={...s,password:u});let d=r.value.customization.conversation.unique_memory_tag===!0;if(!s?.memory_stores){let e=i??(d?[u_(t)]:[]);e.length&&(s={...s,memory_stores:e})}let f=h.peek();h.value=null,f&&s?.captcha_token==null&&(s={...s,captcha_token:f});let g=await Cn(n,t,s,o);l.value={conversationId:g.conversation_id,conversationName:g.conversation_name,conversationUrl:g.conversation_url,callbackUrl:g.callback_url,createdAt:g.created_at},await a?.join({url:g.conversation_url})}catch(e){throw e instanceof xn&&(e.status===401||e.status===403)&&r.value.has_password===!0&&(m.value=null),F_.error(`Start failed`,e),p.value=String(e),c.value=`error`,e}},[n,t,a,c,p,l,m,h,r,i]),ee=A(async()=>{let e=l.peek();c.value=`disconnecting`,e&&await wn(n,t,e.conversationId).catch(e=>F_.error(`End conversation API failed`,e)),await a?.leave(),c.value=`ended`},[n,t,a,c,l]),T=A(e=>{if(!a)return;let t=l.peek();if(!t){F_.warn(`sendChat called before session was established; dropping message`);return}_.markSent(e),a.sendAppMessage(S_(t.conversationId,e),`*`),u.value=[...u.peek(),{id:crypto.randomUUID(),sender:`user`,text:e,timestamp:Date.now()}]},[a,u,l,_]),te=A(e=>{if(!a){F_.warn(`sendMessage called before Daily was ready; dropping message`);return}let t=l.peek();if(!t){F_.warn(`sendMessage called before session was established; dropping message`);return}e.event_type===`conversation.respond`&&_.markSent(e.properties.text),a.sendAppMessage(M_(t.conversationId,e),`*`)},[a,l,_]),ne=A(e=>{v.add(e)},[v]),re=A(e=>{v.delete(e)},[v]),ie=k(()=>({state:c,session:l,chatMessages:u,captionText:d,captionRole:f,error:p,password:m,setPassword:x,captchaToken:h,setCaptchaToken:S,mode:b,start:w,end:ee,sendChat:T,sendMessage:te,conversation:{start:w,end:ee,sendMessage:te},__registerSubscriber:ne,__unregisterSubscriber:re}),[c,l,u,d,f,p,m,x,h,S,b,w,ee,T,te,ne,re]);return j(L_.Provider,{value:ie,children:e})}function K_(){let e=ft(bi);if(!e)throw Error(`useConfig must be used within ConfigProvider`);return e}var q_=new Set([`network`,`server`,`unavailable`,`busy`,`rate_limited`]);function J_(e){return e===401||e===403?`forbidden`:e===402?`limit_exceeded`:e===423?`busy`:e===429?`rate_limited`:e===409?`concurrency`:e===503?`unavailable`:e>=500?`server`:`unknown`}function Y_(e){if(!e)return;let t=e.get(`Retry-After`);if(!t)return;let n=Number.parseInt(t,10);if(!Number.isNaN(n)&&n>=0)return n;let r=Date.parse(t);if(!Number.isNaN(r)){let e=Math.floor((r-Date.now())/1e3);return e>0?e:0}}function X_(e){if(e instanceof xn){let t=J_(e.status);return{kind:t,status:e.status,raw:e.body,retryable:q_.has(t),retryAfterSec:Y_(e.headers)}}return e instanceof TypeError?{kind:`network`,raw:String(e),retryable:!0}:{kind:`unknown`,raw:String(e),retryable:!1}}function Z_(e){return e===`limit_exceeded`?`daily_limit`:e===`forbidden`||e===`concurrency`?null:`busy`}var Q_=`tavus_pudl_`,$_=3600*48,ev=new Map;function tv(){let e=new Date;return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,`0`)}${String(e.getUTCDate()).padStart(2,`0`)}`}function nv(e){return`${Q_}${e}`}function rv(e){try{let t=`${nv(e)}=`,n=document.cookie.split(`; `).find(e=>e.startsWith(t));if(!n)return 0;let[r,i]=decodeURIComponent(n.slice(t.length)).split(`.`);if(r!==tv())return 0;let a=Number.parseInt(i,10);return Number.isFinite(a)&&a>0?a:0}catch{return 0}}function iv(e,t){try{let n=encodeURIComponent(`${tv()}.${t}`);document.cookie=`${nv(e)}=${n}; max-age=${$_}; path=/; SameSite=Lax`}catch{return}}function av(e){let t=ev.get(e);return t||(t=Ut(e?rv(e):0),ev.set(e,t)),t}function ov(e){if(!e)return;iv(e,rv(e)+1);let t=rv(e),n=ev.get(e);n?n.value=t:ev.set(e,Ut(t))}var sv=new Set([`Captcha token required`,`Captcha verification failed`]);function cv(e){if(!(e instanceof xn)||e.status!==403)return!1;try{let t=JSON.parse(e.body.trim());return typeof t.error==`string`&&sv.has(t.error)}catch{return!1}}function lv(e,t){let n=e!==null,r=(t?.captchaToken.peek()??null)!==null,[i,a]=E(!n||r),[o,s]=E(0);D(()=>{n||a(!0)},[n]);let c=A(e=>{t?.setCaptchaToken(e),a(!0)},[t]),l=A(()=>{a(!0)},[]),u=t?.captchaToken.value??null,d=O(null);return D(()=>{let e=d.current!==null;d.current=u,n&&u===null&&(a(!1),e&&s(e=>e+1))},[n,u]),{captchaReady:i,captchaEpoch:o,handleCaptchaToken:c,handleCaptchaFallback:l}}function uv({children:e}){let{config:t}=K_(),{start:n}=ft(L_),r=t.value.deployment_id??``,i=av(r),a=A(()=>{let e=t.value,n=e.limits?.daily_call_limit_per_user;return n==null||e.channel!==`widget`&&e.channel!==`embed`?null:n},[t]),[o,s]=E(`idle`),[c,l]=E(!1),[u,d]=E(null),[f,p]=E(!1),m=k(()=>Ut(`idle`),[]);D(()=>{m.value=o},[o,m]),_n(()=>{let e=t.value,n=e.limits?.daily_call_limit_per_user;n!=null&&(e.channel!==`widget`&&e.channel!==`embed`||m.value===`idle`&&i.value>=n&&(d(`daily_limit`),p(!1),s(`unavailable`)))});let h=t.value.customization.show_haircheck,g=t.value.customization.conversation.modality,_=h&&g!==`chat`,v=O(!1),y=O(!1),b=A(async()=>{l(!0);try{await n(),v.current=!1,a()!=null&&ov(r),s(`call`)}catch(e){let n=X_(e);if(cv(e)&&!v.current){v.current=!0,l(!1),s(`idle`);return}if(v.current=!1,n.kind===`forbidden`&&t.value.has_password===!0){s(`idle`);return}d(Z_(n.kind)??`busy`),p(n.retryable),s(`unavailable`)}finally{l(!1)}},[n,t,a,r]),x=A(async()=>{if(o!==`idle`&&o!==`unavailable`)return;let e=a();if(e!=null&&i.value>=e){d(`daily_limit`),p(!1),s(`unavailable`);return}if(d(null),p(!1),_&&!y.current){s(`haircheck`);return}return b()},[o,_,b,a,i]),S=A(async()=>{o===`haircheck`&&(y.current=!0,await b())},[o,b]),C=A(()=>{o===`haircheck`&&s(`idle`)},[o]),w=A(()=>{o===`call`&&s(`ended`)},[o]),ee=A(()=>{d(null),p(!1),s(`idle`)},[]),T=k(()=>({flowSignal:m,setFlowState:s,isStarting:c,unavailableCause:u,canRetry:f,start:x,join:S,cancel:C,leave:w,restart:ee}),[m,c,u,f,x,S,C,w,ee]);return j(a_.Provider,{value:T,children:e})}var dv=vn(`HostBridge`),fv=Fe(null);function pv(e){if(!e)return null;let t=e.getRootNode();return t instanceof ShadowRoot&&t.host instanceof HTMLElement?t.host:e.parentElement}function mv({children:e}){let t=ft(L_),n=ft(a_),r=un(null),i=A(e=>{r.value=pv(e)},[r]),a=A((e,t)=>{let n=r.peek();n&&n.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0})),dv.info(`Event:`,e,t)},[r]);D(()=>{let e=r.value;if(e)return e.tavus={start:t.start,end:t.end,sendChat:t.sendChat,sendMessage:t.sendMessage},()=>{delete e.tavus}},[r.value,t]),D(()=>t.state.subscribe(e=>{switch(e){case`connected`:a(`tavus:conversation-started`,{conversationId:t.session.peek()?.conversationId??``}),a(`tavus:state-change`,{state:e});break;case`ended`:a(`tavus:conversation-ended`,{conversationId:t.session.peek()?.conversationId??``}),a(`tavus:state-change`,{state:e});break;case`error`:a(`tavus:error`,{code:`CONVERSATION_ERROR`,message:t.error.peek()??`Unknown error`}),a(`tavus:state-change`,{state:e});break;default:a(`tavus:state-change`,{state:e})}}),[t,a]),_n(()=>{if(!n)return;let e=n.flowSignal.value;a(`tavus:mode-change`,{mode:e})}),D(()=>{let e={onUtterance(e){a(`tavus:protocol-message`,{kind:`utterance`,event_type:`conversation.utterance`,properties:e})},onToolCall(e){a(`tavus:tool-call`,e),a(`tavus:protocol-message`,{kind:`tool_call`,event_type:`conversation.tool_call`,properties:e})},onPerception(e){a(`tavus:protocol-message`,e)},onSpeakingState({who:e,state:t,seq:n,turn_idx:r}){let i={state:t,...n===void 0?{}:{seq:n},...r===void 0?{}:{turn_idx:r}};a(`tavus:protocol-message`,{kind:`speaking`,event_type:e===`replica`?t===`started`?`conversation.replica_started_speaking`:`conversation.replica_stopped_speaking`:t===`started`?`conversation.user_started_speaking`:`conversation.user_stopped_speaking`,properties:i})},onMessage(e){a(`tavus:protocol-message`,e)}};return t.__registerSubscriber(e),()=>t.__unregisterSubscriber(e)},[t,a]);let o=k(()=>({shadowHost:r,dispatchEvent:a}),[r,a]);return j(fv.Provider,{value:o,children:[j(`div`,{ref:i,style:`display:contents`}),e]})}var hv=Fe(null);function gv({children:e}){let{config:t}=ft(bi),n=k(()=>Jt(()=>{let e=t.value.customization.style;return e.mode===`dark`||e.mode===`system`&&(globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1)}),[t]),r=k(()=>Jt(()=>{let e=t.value.customization.style;return e.style===`basic`?n.value?`white-black`:`black-white`:n.value?`${e.style}-dark`:e.style}),[t,n]),i=k(()=>Jt(()=>bv(t.value.customization.style)),[t]),a=k(()=>({dataTheme:r,isDark:n,cssVars:i}),[r,n,i]);return j(hv.Provider,{value:a,children:j(`div`,{"data-theme":r.value,style:xv(i.value),class:`contents`,children:e})})}var _v=[0,.125,.25,.5,.75],vv=[0,1,2,3,4],yv=[0,.2,.25,.3];function bv(e){return{"--radius-box":`${_v[e.boxes_radius]??.5}rem`,"--radius-field":`${_v[e.field_radius]??.25}rem`,"--radius-selector":`${_v[e.selectors_radius]??.5}rem`,"--border":`${vv[e.border_width]??1}px`,"--size-field":`${yv[e.fields_size]??.25}rem`,"--size-selector":`${yv[e.selectors_size]??.25}rem`,"--depth":e.depth_effect?`1`:`0`,"--noise":e.noise_effect?`1`:`0`}}function xv(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function Sv(e,t){D(()=>{let n=e.current;if(!n)return;let r=new ResizeObserver(e=>{let n=e[0];n&&t(n)});return r.observe(n),()=>r.disconnect()},[e,t])}var Cv=Fe(null),wv=480,Tv=768;function Ev({children:e}){let t=O(null),n=k(()=>Ut(`full`),[]);Sv(t,A(e=>{let t=e.contentRect.width;t<wv?n.value=`compact`:t<Tv?n.value=`medium`:n.value=`full`},[n]));let r=k(()=>({layoutMode:n,containerRef:t}),[n,t]);return j(Cv.Provider,{value:r,children:j(`div`,{ref:t,class:`w-full h-full`,children:e})})}var Dv=`@container/conversation w-full h-full`,Ov=`motion-safe:animate-[tavusFadeUp_280ms_ease-out]`,kv=`relative w-full h-full max-h-screen aspect-video @max-mobile:aspect-9/16 overflow-hidden rounded-box`;function Av({animate:e=!1,innerClassName:t,innerStyle:n,innerRef:r,role:i,"aria-live":a,"aria-label":o,children:s}){return j(`div`,{class:e?`${Dv} ${Ov}`:Dv,children:j(`div`,{ref:r,class:t?`${kv} ${t}`:kv,style:n,role:i,"aria-live":a,"aria-label":o,children:s})})}var jv=41/2,Mv=23/2,Nv=Math.hypot(jv,Mv),Pv=Array.from({length:1008},(e,t)=>{let n=t%42,r=Math.floor(t/42),i=Math.hypot(n-jv,r-Mv)/Nv*.82,a=.34+(n*13+r*7)%34/100;return{delay:`${i.toFixed(3)}s`,opacity:a.toFixed(2)}});function Fv(){return j(Av,{innerClassName:`embed-loading-screen`,role:`status`,"aria-live":`polite`,"aria-label":`Loading deployment`,children:j(`div`,{class:`embed-loading-dot-field`,"aria-hidden":`true`,style:{"--dot-columns":`42`,"--dot-rows":`24`},children:Pv.map((e,t)=>j(`span`,{class:`embed-loading-field-dot`,style:{"--dot-delay":e.delay,"--dot-opacity":e.opacity}},t))})})}var Iv=Fe(null);function Lv({children:e}){let t=O(null);return j(Iv.Provider,{value:{frameRef:t},children:j(`div`,{class:`@container/conversation w-full h-full`,children:j(`div`,{ref:t,class:`relative w-full h-full max-h-screen aspect-video @max-mobile:aspect-9/16 overflow-hidden rounded-box bg-base-100`,children:e})})})}var Rv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),zv=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Bv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vv=e=>{let t=Bv(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hv={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Uv=Fe({size:24,color:`currentColor`,strokeWidth:2,absoluteStrokeWidth:!1,class:``}),Wv=()=>ft(Uv),Gv=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Kv=({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,children:i,iconNode:a,class:o=``,...s})=>{let{size:c=24,strokeWidth:l=2,absoluteStrokeWidth:u=!1,color:d=`currentColor`,class:f=``}=Wv()??{},p=r??u?Number(n??l)*24/Number(t??c):n??l;return oe(`svg`,{...Hv,width:t??c??24,height:t??c??24,stroke:e??d,"stroke-width":p,class:Rv(`lucide`,f,o),...!i&&!Gv(s)&&{"aria-hidden":`true`},...s},[...a.map(([e,t])=>oe(e,t)),...ye(i)])},qv=(e,t)=>{let n=({class:n=``,className:r=``,children:i,...a})=>oe(Kv,{...a,iconNode:t,class:Rv(`lucide-${zv(Vv(e))}`,`lucide-${zv(e)}`,n,r)},i);return n.displayName=Vv(e),n},Jv=qv(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),Yv=qv(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Xv=qv(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Zv=qv(`camera-off`,[[`path`,{d:`M14.564 14.558a3 3 0 1 1-4.122-4.121`,key:`1rnrzw`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175`,key:`1x3arw`}],[`path`,{d:`M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344`,key:`1i84u0`}]]),Qv=qv(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),$v=qv(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ey=qv(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ty=qv(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ny=qv(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ry=qv(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),iy=qv(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),ay=qv(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),oy=qv(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),sy=qv(`monitor-up`,[[`path`,{d:`m9 10 3-3 3 3`,key:`11gsxs`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),cy=qv(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ly=qv(`phone-off`,[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]),uy=qv(`picture-in-picture-2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),dy=qv(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),fy=qv(`shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),py=qv(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),my=qv(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),hy=qv(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),gy=qv(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function _y(e,t){return({size:n=`var(--icon-size, 1.5rem)`,class:r,"aria-label":i})=>j(`span`,{class:r,role:`img`,"aria-label":i??t,children:j(e,{size:n})})}var vy={close:_y(gy,`Close`),leave:_y(ly,`Leave call`),more:_y(Yv,`More`),error:_y(Xv,`Error`),mic:_y(ay,`Microphone`),"mic-off":_y(iy,`Microphone muted`),cam:_y(Qv,`Camera`),"cam-off":_y(Zv,`Camera off`),"screen-share":_y(sy,`Screen share`),pip:_y(uy,`Picture in picture`),user:_y(my,`User`),"face-smile":_y(py,`Camera off`),captions:_y(Jv,`Closed captions`),chat:_y(ry,`Chat`),fullscreen:_y(ny,`Enter fullscreen`),"fullscreen-exit":_y(oy,`Exit fullscreen`),expand:_y(ey,`Expand`),collapse:_y(fy,`Collapse`),send:_y(dy,`Send`),"external-link":_y(ty,`External link`),clock:_y($v,`Clock`),moon:_y(cy,`Unavailable`),users:_y(hy,`Busy`)},yy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M16 19H4v-2h12v2ZM4 17H2V7h2v10Zm14-8h2V7h2v10h-2v-2h-2v2h-2V7h2v2Zm-2-2H4V5h12v2Z"/></svg>`,by=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 21h-2v-2h2v2Zm-6-2H4v-2h10v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h-2v-2h-2v-2h-2V7h2v2h2V7h2V5h2v14ZM4 17H2V7h2v10Zm12 0h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2H8V9h2v2ZM8 9H6V7h2v2ZM6 7H4V5h2v2Zm8 0h-4V5h4v2ZM4 5H2V3h2v2Z"/></svg>`,xy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 10h2v4H5zm8 0h2v4h-2zM7 8h4v2H7zm0 6h4v2H7zm8 0h4v2h-4zm0-6h4v2h-4z"/></svg>`,Sy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M22 22h-2v-2h-2v-2h2v-8h2v12Zm-4-4h-8v-2h8v2ZM4 12h2v2H4v2H2V4h2v8Zm6 4H8v-6h2v6Zm10-6H10V8h10v2Zm-4-4h-2V4h2v2Zm-2-2H4V2h10v2Z"/></svg>`,Cy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4v-2h2v2Zm14 0h-2v-2h2v2ZM4 18H2V6h2v12Zm18 0h-2V6h2v12Zm-5-1h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2h-2V6h2v7ZM6 6H4V4h2v2Zm14 0h-2V4h2v2Zm-2-2H6V2h12v2Z"/></svg>`,wy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4v-2h2v2Zm14 0h-2v-2h2v2ZM4 18H2V6h2v12Zm4 0H6v-2h2v2Zm14 0h-2V6h2v12Zm-12-2H8v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V8h2v2Zm2-2h-2V6h2v2ZM6 6H4V4h2v2Zm14 0h-2V4h2v2Zm-2-2H6V2h12v2Z"/></svg>`,Ty=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M7 19h2v-2h2v-2h2v2h2v2h2v2H7v-2Zm13-6H4v-2h16v2Zm-3-8h-2v2h-2v2h-2V7H9V5H7V3h10v2Z"/></svg>`,Ey=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 22H4v-2h16v2ZM4 20H2V4h2v16Zm18 0h-2V4h2v16Zm-9-2h-2v-2h2v2Zm0-4h-2V6h2v8Zm7-10H4V2h16v2Z"/></svg>`,Dy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M15 19h-2v2h-2v-2H9v-2H7v-2h10v2h-2v2Zm5-6H4v-2h16v2Zm-7-8h2v2h2v2H7V7h2V5h2V3h2v2Z"/></svg>`,Oy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M8 22H4v-2h4v2Zm12 0h-4v-2h4v2ZM4 20H2v-4h2v4Zm18 0h-2v-4h2v4Zm-6-3H8v-2h8v2Zm-8-2H6V9h2v6Zm10 0h-2V9h2v6Zm-2-6H8V7h8v2ZM4 8H2V4h2v4Zm18 0h-2V4h2v4ZM8 4H4V2h4v2Zm12 0h-4V2h4v2Z"/></svg>`,ky=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4V4h2v16Zm14 0h-2v-3h2v3ZM16 9h2v2h2v2h-2v2h-2v2h-2v-4H8v-2h6V7h2v2Zm4-2h-2V4h2v3Zm-2-3H6V2h12v2Z"/></svg>`,Ay=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M13 22h-2v-2H8v-2h8v2h-3v2Zm-5-4H6v-2h2v2Zm10 0h-2v-2h2v2ZM6 16H4v-6h2v6Zm8 0h-4v-2h4v2Zm6 0h-2v-6h2v6Zm-10-2H8V4h2v10Zm6 0h-2V4h2v10ZM14 4h-4V2h4v2Z"/></svg>`,jy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M13 22h-2v-2H8v-2h8v2h-3v2Zm9 0h-2v-2h2v2Zm-2-2h-2v-2h2v2ZM8 18H6v-2h2v2Zm10 0h-2v-2h2v2ZM6 16H4v-6h2v6Zm8-2h2v2h-6v-2h2v-2h2v2Zm-4-4h2v2h-2v2H8V8h2v2Zm10 4h-2v-4h2v4Zm-4-4h-2V4h2v6ZM8 8H6V6h2v2ZM6 6H4V4h2v2ZM4 4H2V2h2v2Zm10 0h-4V2h4v2Z"/></svg>`,My=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H8v-2h10v2ZM8 20H6v-2h2v2Zm12 0h-2v-2h2v2ZM6 18H4v-2h2v2Zm16 0h-2v-4h-2v-2h2v-2h2v8ZM4 16H2V6h2v10Zm14 0h-6v-2h6v2Zm-6-2h-2v-2h2v2Zm-2-2H8V6h2v6ZM6 6H4V4h2v2Zm8-2h-2v2h-2V4H6V2h8v2Z"/></svg>`,Ny=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M5 15H3v-2h2v2Zm8 0h-2v-2h2v2Zm8 0h-2v-2h2v2ZM3 13H1v-2h2v2Zm4 0H5v-2h2v2Zm4 0H9v-2h2v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h2v2ZM5 11H3V9h2v2Zm8 0h-2V9h2v2Zm8 0h-2V9h2v2Z"/></svg>`,Py=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 20H4v-2h16v2ZM4 18H2V6h2v12Zm18 0h-2V6h2v12ZM18 8v6h-8V8h8Zm2-2H4V4h16v2Zm-4 4h-4v2h4v-2Z"/></svg>`,Fy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 18h-7v2h3v2H8v-2h3v-2H4v-2h16v2ZM4 16H2V4h2v12Zm18 0h-2v-6h2v6Zm-6-6h-2V8h2v2Zm2-2h-2V6h2v2Zm4-6v6h-2V6h-2V4h-2V2h6Zm-8 2H4V2h10v2Z"/></svg>`,Iy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M4 19h4v2H2v-8h2v6Zm8 0H8v-2h4v2Zm4-2h-4v-2h4v2Zm4-2h-4v-2h4v2Zm-10-2H4v-2h6v2Zm12 0h-2v-2h2v2ZM8 5H4v6H2V3h6v2Zm12 6h-4V9h4v2Zm-4-2h-4V7h4v2Zm-4-2H8V5h4v2Z"/></svg>`,Ly=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M6 22H4v-4h2v4Zm14 0h-2v-4h2v4ZM8 18H6v-2h2v2Zm10 0h-2v-2h2v2Zm-2-2H8v-2h8v2Zm-1-4H9v-2h6v2Zm-6-2H7V4h2v6Zm8 0h-2V4h2v6Zm-2-6H9V2h6v2Z"/></svg>`,Ry=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M2 22H0v-4h2v4Zm14 0h-2v-4h2v4Zm8 0h-2v-4h2v4ZM4 18H2v-2h2v2Zm10 0h-2v-2h2v2Zm8 0h-2v-2h2v2Zm-10-2H4v-2h8v2Zm8 0h-4v-2h4v2Zm-9-4H5v-2h6v2Zm8 0h-4v-2h4v2ZM5 10H3V4h2v6Zm8 0h-2V4h2v6Zm8 0h-2V4h2v6ZM11 4H5V2h6v2Zm8 0h-4V2h4v2Z"/></svg>`,zy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 22H4v-2h16v2ZM4 20H2v-6H0v-2h2V8h2v12Zm18-8h2v2h-2v6h-2V8h2v4Zm-8 6h-4v-2h4v2Zm-4-2H8v-2h2v2Zm6 0h-2v-2h2v2Zm-6-4H8v-2h2v2Zm6 0h-2v-2h2v2Zm-3-6h7v2H4V6h7V4h2v2Zm4-2h-4V2h4v2Z"/></svg>`,By=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M17 21H5v-2h12v2ZM5 19H3V7h2v12Zm14 0h-2v-6h2v6Zm-8-4H9v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V9h2v2Zm6 0h-2V7h-2V5h-4V3h8v8Zm-4-2h-2V7h2v2Zm-6-2H5V5h6v2Z"/></svg>`;function Vy(e){return e.replace(/\s(width|height)="\d+"/g,``)}function Hy(e,t){let n=Vy(e);return({size:e=`var(--icon-size, 1.5rem)`,class:r,"aria-label":i})=>j(`span`,{class:r,role:`img`,"aria-label":i??t,style:{display:`inline-flex`,width:e,height:e},dangerouslySetInnerHTML:{__html:n.replace(`<svg`,`<svg width="100%" height="100%"`)}})}var Uy={pixelarticons:{close:Hy(wy,`Close`),leave:Hy(ky,`Leave call`),more:Hy(Ny,`More`),error:Hy(Ey,`Error`),mic:Hy(Ay,`Microphone`),"mic-off":Hy(jy,`Microphone muted`),cam:Hy(yy,`Camera`),"cam-off":Hy(by,`Camera off`),"screen-share":Hy(Fy,`Screen share`),pip:Hy(Py,`Picture in picture`),user:Hy(Ly,`User`),"face-smile":Hy(zy,`Camera off`),captions:Hy(xy,`Closed captions`),chat:Hy(Sy,`Chat`),fullscreen:Hy(Oy,`Enter fullscreen`),"fullscreen-exit":Hy(Ty,`Exit fullscreen`),expand:Hy(Dy,`Expand`),collapse:Hy(Ty,`Collapse`),send:Hy(Iy,`Send`),"external-link":Hy(By,`External link`),clock:Hy(Cy,`Clock`),moon:Hy(My,`Unavailable`),users:Hy(Ry,`Busy`)},lucide:vy};function Wy({name:e,...t}){let{config:n}=K_(),r=(Uy[n.value.customization.style.icon_library]??Uy.pixelarticons)[e];return j(r,{...t})}var Gy=`Ready when you are`,Ky=`Start the conversation`;function qy(e){return typeof e==`string`&&e.length>0?e:``}function Jy(e){let t=qy(e.replica_thumbnail_image_url);if(t)return{url:t,kind:`image`};let n=qy(e.replica_thumbnail_video_url);return n?{url:n,kind:`video`}:null}function Yy(e){let{preview:t}=e.customization,{background:n}=t,r=Jy(e),i;i=n.type?n.type:r?`replica`:`background-gradient`;let a=qy(n.url);return{title:t.title||Gy,description:t.description||``,btn_title:t.btn_title||Ky,background:{type:i,url:a}}}var Xy={backgroundImage:`linear-gradient(to bottom right, var(--color-primary), var(--color-base-300))`};function Zy({variant:e,replica:t}){let[n,r]=E(!1);return D(()=>{r(!1)},[e.url]),e.type===`replica`&&t?t.kind===`image`?j(`img`,{class:`absolute inset-0 w-full h-full object-cover`,src:t.url,loading:`lazy`,alt:``}):j(`video`,{class:`absolute inset-0 w-full h-full object-cover`,src:t.url,muted:!0,autoplay:!0,loop:!0,playsinline:!0}):e.type===`custom-image`&&e.url&&!n?j(`img`,{class:`absolute inset-0 w-full h-full object-cover`,src:e.url,loading:`lazy`,alt:``,onError:()=>r(!0)}):j(`div`,{class:`absolute inset-0`,style:Xy})}function Qy({className:e=``}){let{config:t}=K_(),n=Yy(t.value),r=Jy(t.value);return j(`div`,{class:`relative size-16 shrink-0 rounded-box overflow-hidden bg-base-300 ${e}`,children:j(Zy,{variant:n.background,replica:r})})}var $y=`absolute inset-0 bg-base-100 text-base-content flex flex-col items-center justify-center gap-6 px-6 py-8 text-center overflow-y-auto motion-safe:animate-[tavusFadeUp_280ms_ease-out]`;function eb({children:e,class:t,role:n,"aria-live":r}){return j(`div`,{class:t?`${$y} ${t}`:$y,role:n,"aria-live":r,children:e})}function tb({title:e,description:t,media:n,children:r,overlay:i}){return j(eb,{children:[n===void 0?j(Qy,{}):n,(e||t)&&j(`div`,{class:`flex flex-col items-center gap-3 max-w-sm`,children:[e&&j(`h2`,{class:`text-lg font-medium leading-snug`,children:e}),t&&j(`p`,{class:`text-base text-base-content/60 tracking-wide leading-snug`,children:t})]}),r&&j(`div`,{class:`flex flex-col items-center gap-3`,children:r}),i]})}var nb={daily_limit:{title:`Agent is at today's limit`,description:`This Agent can take more conversations tomorrow.`},total_limit:{title:`Agent is unavailable`,description:`This Agent isn't available right now. Please check back later.`},busy:{title:`Agent is in another conversation`,description:`Please try again in a moment.`},error:{title:`Couldn't load this Agent`,description:`This Agent couldn't be loaded. Please try again later.`}};function rb(e,t){let n=t?.[e];return{title:n?.title||nb[e].title,description:n?.description||nb[e].description}}var ib={daily_limit:`clock`,total_limit:`moon`,busy:`users`,error:`error`};function ab({cause:e}){return j(`div`,{class:`flex size-16 shrink-0 items-center justify-center rounded-box bg-base-200 text-base-content/70`,children:j(Wy,{name:ib[e],size:`2rem`})})}function ob({cause:e,canRetry:t,onRetry:n,onCancel:r}){let{config:i}=K_(),a=i.value.customization?.unavailable_screen,o=rb(e,a),s=a?.cta??[],c=e===`busy`||s.length>0||!!r;return j(tb,{media:j(ab,{cause:e}),title:o.title,description:o.description,children:c&&j(`div`,{class:`flex flex-wrap items-center justify-center gap-2`,children:[e===`busy`&&j(`button`,{type:`button`,class:`btn btn-neutral rounded-box`,disabled:!t,onClick:n,children:`Try again`}),s.map(e=>j(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`btn btn-outline rounded-box`,children:e.title},e.url)),r&&j(`button`,{type:`button`,class:`btn btn-ghost`,onClick:r,children:`Close`})]})})}function sb(){let e=ft(a_);return{state:e.flowSignal.value,isStarting:e.isStarting,unavailableCause:e.unavailableCause,canRetry:e.canRetry,start:e.start,join:e.join,cancel:e.cancel,leave:e.leave,restart:e.restart}}var cb={start_button:`Start the conversation`,ready_to_start:``};function lb(){let{config:e}=K_(),{preview:t}=e.value.customization;return k(()=>({start_button:t.btn_title??cb.start_button,ready_to_start:t.description??cb.ready_to_start}),[t])}var ub=`Thanks for joining`,db=`You can start a new conversation whenever you're ready.`,fb=`Start a new conversation`;function pb(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`||t.protocol===`mailto:`}catch{return!1}}function mb({text:e,onRestart:t}){let{config:n}=K_(),r=n.value.customization.after_call,i=r.cta.filter(e=>pb(e.url));return j(tb,{title:r.title||e?.title||ub,description:r.description||e?.description||db,children:[j(`button`,{type:`button`,class:`btn btn-neutral rounded-box`,onClick:t,children:e?.restart||fb}),i.length>0&&j(`div`,{class:`flex flex-wrap items-center justify-center gap-2`,children:i.map(e=>j(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`btn btn-outline rounded-box`,children:e.title},e.url))})]})}function hb(){let e=oh(),t=Uh(),{isOff:n}=r_(t),{camState:r}=Zg();return{isCamReady:k(()=>r===`granted`,[r]),isCamMuted:n,localSessionId:t,onToggleCamera:A(()=>{e?.setLocalVideo(n)},[e,n])}}function gb(){let e=oh(),t=Uh(),{isOff:n}=Kg(t),{micState:r}=Zg();return{isMicReady:k(()=>r===`granted`,[r]),isMicMuted:n,localSessionId:t,onToggleMicrophone:A(()=>{e?.setLocalAudio(n)},[e,n])}}function _b(){let e=oh(),t=Uh(),{isOff:n}=t_(t),r=!n;return{isScreenSharing:r,localSessionId:t,onToggleScreenshare:A(()=>{r?e?.stopScreenShare():e?.startScreenShare({displayMediaOptions:{audio:!1,selfBrowserSurface:`exclude`,surfaceSwitching:`include`,video:{width:1920,height:1080}}})},[e,r])}}function vb(e){switch(e){case`blocked`:return`blocked`;case`in-use`:return`in-use`;case`not-found`:return`not-found`;case`not-supported`:case`undefined-mediadevices`:return`unsupported`;default:return null}}function yb(e,t,n,r){return e===`granted`&&r?`granted`:vb(e)||(t===`denied`?`blocked`:t===`prompt`?`prompt`:t===`granted`?n?`checking`:`prompt`:e===`granted`?`granted`:n?`checking`:`prompt`)}function bb(e,t){let n=e===`granted`,r=e===`blocked`||e===`in-use`||e===`not-found`||e===`unsupported`;return{status:e,isGranted:n,isBlocked:r,canRequest:e===`prompt`,needsAttention:r||e===`prompt`&&t!==`granted`}}function xb(e){let[t,n]=E(null);return D(()=>{let t=!1,r=navigator.permissions;if(r?.query)return r.query({name:e}).then(e=>{t||(n(e.state),e.onchange=()=>{t||n(e.state)})}).catch(()=>{}),()=>{t=!0}},[e]),t}function Sb(){let e=oh(),t=Mg(),n=Uh(),{micState:r,camState:i,currentMic:a,currentCam:o}=Zg(),s=xb(`microphone`),c=xb(`camera`),l=t===`joined-meeting`||!!n,[u,d]=E(!1),[f,p]=E(!1),m=A(()=>{e&&(d(!0),l?e.setLocalAudio(!0):Promise.resolve(e.startCamera({videoSource:!1})).catch(()=>{}))},[e,l]),h=A(async()=>{if(e){p(!0);try{await e.setInputDevicesAsync({videoSource:!0})}catch{}e.setLocalVideo(!0)}},[e]);return{mic:k(()=>bb(yb(r,s,u,!!a),s),[r,s,u,a]),camera:k(()=>bb(yb(i,c,f,!!o),c),[i,c,f,o]),requestMic:m,requestCamera:h}}var Cb={microphone:`microphone`,camera:`camera`};function wb({class:e}){return j(`svg`,{class:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[j(`circle`,{cx:`7`,cy:`8`,r:`2.2`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`16`,cy:`16`,r:`2.2`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`path`,{d:`M2 8h2.5M9.5 8H22M2 16h11.5M18.5 16H22`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})]})}function Tb(){return j(`svg`,{viewBox:`0 0 240 180`,class:`w-full h-auto text-base-content/70`,fill:`none`,"aria-hidden":`true`,children:[j(`rect`,{x:`10`,y:`20`,width:`220`,height:`150`,rx:`10`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M10 46h220`,stroke:`currentColor`,"stroke-width":`2`}),j(`circle`,{cx:`26`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`40`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`54`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`path`,{d:`M78 33h14M86 27l-6 6 6 6M104 27v12`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),j(`rect`,{x:`118`,y:`25`,width:`96`,height:`16`,rx:`8`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{class:`text-info`,cx:`128`,cy:`33`,r:`11`,fill:`currentColor`,opacity:`0.18`}),j(`circle`,{class:`text-info`,cx:`128`,cy:`33`,r:`11`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`g`,{class:`text-info`,transform:`translate(120 25) scale(0.66)`,children:j(wb,{})}),j(`g`,{transform:`translate(34 78)`,children:[j(`rect`,{x:`0`,y:`8`,width:`34`,height:`26`,rx:`5`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M34 16l14-8v26l-14-8`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linejoin":`round`})]}),j(`g`,{transform:`translate(40 120)`,children:[j(`rect`,{x:`6`,y:`0`,width:`14`,height:`24`,rx:`7`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M0 20a13 13 0 0 0 26 0M13 33v8`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})]}),j(`path`,{d:`M150 64l34 14-14 4-2 16-18-34Z`,fill:`currentColor`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linejoin":`round`})]})}var Eb=ba(({device:e,onClose:t})=>{let n=Cb[e];return D(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),j(`div`,{class:`absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/50 motion-safe:animate-[tavusFadeUp_180ms_ease-out]`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tavus-blocked-title`,onClick:t,children:j(`div`,{class:`relative w-full max-w-md rounded-box bg-base-100 text-base-content shadow-xl overflow-hidden`,onClick:e=>e.stopPropagation(),children:[j(`button`,{type:`button`,class:`btn btn-sm btn-circle btn-ghost absolute top-2 right-2 z-10`,onClick:t,"aria-label":`Close`,children:j(Wy,{name:`close`,size:`1.1rem`})}),j(`div`,{class:`grid @3xl:grid-cols-[1fr_1.2fr] gap-4 p-5 @max-md:p-4`,children:[j(`div`,{class:`flex items-center justify-center @max-md:hidden`,children:j(Tb,{})}),j(`div`,{class:`flex flex-col gap-4`,children:[j(`h2`,{id:`tavus-blocked-title`,class:`text-lg font-semibold leading-snug pr-6`,children:[`Access to your `,n,` is blocked`]}),j(`ol`,{class:`flex flex-col gap-3 text-sm`,children:[j(`li`,{class:`flex items-start gap-2`,children:[j(`span`,{class:`font-semibold tabular-nums`,children:`1.`}),j(`span`,{class:`leading-snug`,children:[`Click the `,j(wb,{class:`inline-block align-text-bottom h-4 w-4 mx-0.5`}),` `,`settings icon in your browser's address bar`]})]}),j(`li`,{class:`flex items-start gap-2`,children:[j(`span`,{class:`font-semibold tabular-nums`,children:`2.`}),j(`span`,{class:`leading-snug`,children:[`Allow `,n,` access, then reload the page`]})]})]}),j(`button`,{type:`button`,class:`btn btn-neutral btn-sm self-start`,onClick:t,children:`Got it`})]})]})]})})}),Db=Fe({open:()=>{},close:()=>{}});function Ob(){return ft(Db)}function kb({children:e}){let[t,n]=E(null),r=A(e=>n(e),[]),i=A(()=>n(null),[]),a=k(()=>({open:r,close:i}),[r,i]);return j(Db.Provider,{value:a,children:[e,t&&j(Eb,{device:t,onClose:i})]})}var Ab=ba(()=>j(`span`,{"aria-hidden":`true`,class:`absolute -top-0.5 -right-0.5 z-20 flex h-4 w-4 items-center justify-center rounded-full bg-warning text-warning-content text-[0.6rem] font-bold leading-none ring-2 ring-base-100 pointer-events-none`,children:`!`})),jb=`select-control-pill relative inline-flex items-center bg-neutral text-neutral-content`,Mb=`absolute inset-0 w-full h-full opacity-0 cursor-pointer appearance-none disabled:cursor-not-allowed`,Nb=`absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none flex items-center`,Pb=`absolute left-0 top-0 h-full aspect-square flex items-center justify-center pointer-events-none`,Fb=`absolute left-0 top-0 z-10 btn btn-control btn-neutral`;function Ib(){return j(`svg`,{style:{width:`var(--chevron-size, 0.75rem)`,height:`var(--chevron-size, 0.75rem)`},viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:j(`path`,{d:`M4 6L8 10L12 6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})})}function Lb({value:e,devices:t,disabled:n,onChange:r,label:i}){return j(le,{children:[j(`select`,{class:Mb,value:e,onChange:e=>r(e.target.value),disabled:n,"aria-label":i,children:t.map(({device:e})=>j(`option`,{value:e.deviceId,children:e.label},e.deviceId))}),j(`span`,{class:Nb,children:j(Ib,{})})]})}function Rb(e){return j(`div`,{class:jb,children:j(Lb,{...e})})}function zb({iconName:e,...t}){return j(`div`,{class:jb,children:[j(`span`,{class:Pb,"aria-hidden":`true`,children:j(Wy,{name:e})}),j(Lb,{...t})]})}var Bb=ba(()=>{let{onToggleMicrophone:e,isMicReady:t,isMicMuted:n}=gb(),{microphones:r,currentMic:i,setMicrophone:a}=Zg();return!i||(r?.length??0)<=1?j(Ub,{}):j(`div`,{class:`relative inline-flex items-center`,children:[j(Rb,{value:i?.device?.deviceId,devices:r||[],disabled:!t,onChange:e=>a(e),label:`Select microphone`}),j(`button`,{type:`button`,onClick:e,disabled:!t,class:Fb,"aria-label":n?`Unmute microphone`:`Mute microphone`,"aria-pressed":n,children:j(Wy,{name:n||!t?`mic-off`:`mic`})})]})});function Vb(){let{onToggleCamera:e,isCamMuted:t}=hb(),{camera:n,requestCamera:r}=Sb(),{open:i}=Ob(),a=n.isGranted&&!t;return{isOn:a,onClick:()=>{if(n.isBlocked)return i(`camera`);if(a)return e();r()},label:a?`Turn camera off`:n.isGranted?`Turn camera on`:`Enable camera`,needsAttention:n.needsAttention}}var Hb=ba(()=>{let{isCamReady:e}=hb(),{currentCam:t,cameras:n,setCamera:r}=Zg(),i=Vb();return!t||(n?.length??0)<=1?j(Wb,{}):j(`div`,{class:`relative inline-flex items-center`,children:[j(Rb,{value:t?.device?.deviceId,devices:n||[],disabled:!e,onChange:e=>r(e),label:`Select camera`}),j(`button`,{type:`button`,onClick:i.onClick,class:Fb,"aria-label":i.label,"aria-pressed":!i.isOn,children:j(Wy,{name:i.isOn?`cam`:`cam-off`})})]})}),Ub=ba(()=>{let{onToggleMicrophone:e,isMicMuted:t}=gb(),{mic:n,requestMic:r}=Sb(),{open:i}=Ob();return j(`span`,{class:`relative inline-flex`,children:[j(`button`,{type:`button`,onClick:()=>{if(n.isGranted)return e();if(n.isBlocked)return i(`microphone`);r()},class:`btn btn-control btn-neutral`,"aria-label":n.isGranted?t?`Unmute microphone`:`Mute microphone`:`Allow microphone access`,"aria-pressed":n.isGranted?t:void 0,children:j(Wy,{name:t||!n.isGranted?`mic-off`:`mic`})}),n.needsAttention&&j(Ab,{})]})}),Wb=ba(()=>{let{isOn:e,onClick:t,label:n,needsAttention:r}=Vb();return j(`span`,{class:`relative inline-flex`,children:[j(`button`,{type:`button`,onClick:t,class:`btn btn-control btn-neutral`,"aria-label":n,"aria-pressed":!e,children:j(Wy,{name:e?`cam`:`cam-off`})}),r&&j(Ab,{})]})});ba(({compact:e=!1}={})=>{let{isMicReady:t}=gb(),{microphones:n,currentMic:r,setMicrophone:i}=Zg();return(n?.length??0)<=1?null:j(zb,{iconName:`mic`,value:r?.device?.deviceId,devices:n,disabled:!t,onChange:e=>i(e),label:`Select microphone`,compact:e})}),ba(({compact:e=!1}={})=>{let{isCamReady:t}=hb(),{currentCam:n,cameras:r,setCamera:i}=Zg();return(r?.length??0)<=1?null:j(zb,{iconName:`cam`,value:n?.device?.deviceId,devices:r,disabled:!t,onChange:e=>i(e),label:`Select camera`,compact:e})});var Gb=ba((e={})=>{let{onToggleScreenshare:t,isScreenSharing:n}=_b();return j(`button`,{type:`button`,onClick:t,class:`btn btn-control ${n?`btn-primary`:`btn-neutral`}`,"aria-label":n?`Stop screen share`:`Start screen share`,"aria-pressed":n,children:j(Wy,{name:`screen-share`})})});function Kb(e){let t=ft(L_);if(!t)throw Error(`useConversation must be used within ConversationProvider`);return D(()=>{if(e)return t.__registerSubscriber(e),()=>t.__unregisterSubscriber(e)},[e]),t}var qb=Fe(null);function Jb({children:e,defaultEnabled:t=!1}){let[n,r]=E(t),i=A(()=>r(e=>!e),[]),a=k(()=>({isEnabled:n,toggle:i}),[n,i]);return j(qb.Provider,{value:a,children:e})}function Yb(){let e=ft(qb);if(!e)throw Error(`ClosedCaptions components must be used within <ClosedCaptionsProvider>`);return e}var Xb=ba(()=>{let{isEnabled:e,toggle:t}=Yb();return j(`button`,{type:`button`,onClick:t,"aria-pressed":e,class:`btn btn-control ${e?`btn-primary`:`btn-neutral`}`,"aria-label":e?`Hide captions`:`Show captions`,children:j(Wy,{name:`captions`,"aria-label":e?`Closed Captions On`:`Closed Captions Off`})})}),Zb=ba(()=>{let{isEnabled:e}=Yb(),{captionText:t,captionRole:n}=Kb(),r=t.value,i=n.value;return!e||!r?null:j(`div`,{class:`absolute bottom-24 left-1/2 -translate-x-1/2 max-w-[80%] px-4 py-2 rounded-box bg-black/60 text-white`,role:`status`,"aria-live":`polite`,children:j(`div`,{class:`text-sm leading-5 max-h-15 overflow-hidden flex flex-col justify-end text-center`,children:j(`div`,{children:[j(`span`,{class:`text-xs ${i===`replica`?`text-secondary`:`text-primary`} mr-2`,children:i===`replica`?`Replica`:`You`}),r]})})})}),Qb=Fe(null);function $b({children:e,defaultOpen:t=!1}){let[n,r]=E(t),i=A(()=>r(e=>!e),[]),a=A(()=>r(!1),[]),o=k(()=>({isOpen:n,toggle:i,close:a}),[n,i,a]);return j(Qb.Provider,{value:o,children:e})}function ex(){let e=ft(Qb);if(!e)throw Error(`Chat components must be used within <ChatProvider>`);return e}var tx=ba((e={})=>{let{isOpen:t,toggle:n}=ex();return j(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":t?`Close chat`:`Open chat`,class:`btn btn-control ${t?`btn-primary`:`btn-neutral`}`,children:j(Wy,{name:`chat`})})}),nx=ba(({message:e})=>{let t=e.sender===`user`;return j(`li`,{class:`flex flex-col gap-1 ${t?`items-end`:`items-start`}`,children:[j(`span`,{class:`text-xs ${t?`text-primary`:`text-secondary`}`,children:t?`You`:`Replica`}),j(`span`,{class:`px-3 py-2 rounded-field text-sm max-w-[80%] ${t?`bg-primary text-primary-content`:`bg-base-200 text-base-content`}`,children:e.text})]})}),rx=ba(()=>{let{isOpen:e,close:t}=ex(),{chatMessages:n,sendChat:r,session:i}=Kb(),a=i.value?.conversationId??null,o=n.value,[s,c]=E(``),l=O(null);D(()=>{let e=l.current;e&&(e.scrollTop=e.scrollHeight)},[o.length]);let u=A(()=>{let e=s.trim();!e||!a||(r(e),c(``))},[s,r,a]),d=A(e=>{e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),u())},[u]),f=!!s.trim()&&!!a;return j(`aside`,{class:`absolute top-0 right-0 w-80 h-full bg-base-100 border-l border-base-300 flex flex-col z-30 transition-transform ${e?`translate-x-0`:`translate-x-full`} @max-mobile:w-full`,"aria-hidden":!e,inert:!e,children:[j(`header`,{class:`flex items-center justify-between px-4 py-3 border-b border-base-300`,children:[j(`span`,{class:`font-medium text-base-content`,children:`Chat`}),j(`button`,{type:`button`,class:`btn btn-ghost btn-sm btn-circle`,onClick:t,"aria-label":`Close chat`,children:j(Wy,{name:`close`,size:20})})]}),j(`ul`,{ref:l,class:`flex-1 overflow-y-auto p-4 flex flex-col gap-3`,role:`log`,"aria-live":`polite`,children:o.length===0?j(`li`,{class:`text-center text-sm opacity-70`,children:a?`Send a message to start the conversation.`:`Connecting…`}):o.map(e=>j(nx,{message:e},e.id))}),j(`form`,{class:`flex items-end gap-2 p-3 border-t border-base-300`,onSubmit:e=>{e.preventDefault(),u()},children:[j(`textarea`,{class:`textarea textarea-bordered textarea-sm flex-1 resize-none`,value:s,onChange:e=>c(e.target.value),onKeyDown:d,placeholder:a?`Type a message…`:`Connecting…`,disabled:!a,rows:1,"aria-label":`Message`}),j(`button`,{type:`submit`,class:`btn btn-primary btn-sm btn-circle`,disabled:!f,"aria-label":`Send message`,children:j(Wy,{name:`send`,size:18})})]})]})});function ix({label:e}){return j(eb,{role:`status`,"aria-live":`polite`,class:`z-2`,children:[j(Qy,{}),j(`div`,{class:`flex flex-col items-center gap-3`,children:[j(`span`,{class:`loading loading-spinner loading-md text-base-content`}),j(`span`,{class:`text-base font-medium`,children:e})]})]})}var ax=ba(()=>j(ix,{label:`Connecting`})),ox=ba(()=>j(ix,{label:`Leaving`}));function sx({active:e,onToggle:t,tooltip:n}){return j(`button`,{type:`button`,onClick:t,class:`btn btn-control ${e?`btn-info`:`btn-ghost`}`,"aria-label":n??(e?`Exit fullscreen`:`Enter fullscreen`),title:n,children:j(Wy,{name:e?`fullscreen-exit`:`fullscreen`})})}var cx=ba(({id:e})=>{let t=Gh()===e,n=O(null),r=O(null),i=O(null),a=O(void 0);Gg(e,A(e=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{let t=Number(Math.max(.01,e).toFixed(2));n.current&&r.current&&i.current&&(n.current.style.height=`${20+t*40}%`,r.current.style.height=`${20+t*130}%`,i.current.style.height=`${20+t*40}%`)})},[]));let o=`w-[3px] rounded-full bg-base-100 transition-[opacity] ${t?`opacity-100`:`opacity-50`}`;return j(`div`,{class:`flex items-center justify-center w-6 h-6`,children:j(`div`,{class:`flex items-center justify-center gap-[2px] w-full h-full`,children:[j(`div`,{ref:n,class:o,style:{height:`20%`}}),j(`div`,{ref:r,class:o,style:{height:`20%`}}),j(`div`,{ref:i,class:o,style:{height:`20%`}})]})})});function lx({sessionId:e,className:t=``}){let n=O(null),r=O(void 0);return Gg(e??``,A(t=>{e&&(r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let e=Math.max(0,Math.min(1,t**.6));n.current?.style.setProperty(`--audio-level`,String(e))}))},[e])),j(`div`,{ref:n,class:`relative aspect-square w-full max-w-[min(48cqi,16rem)] mx-auto pointer-events-none ${t}`,style:{"--audio-level":`0`},"aria-hidden":`true`,children:[j(`div`,{class:`absolute inset-0 rounded-full will-change-transform`,style:{background:`conic-gradient(from 0deg, var(--color-primary), var(--color-info, var(--color-primary)), var(--color-secondary, var(--color-primary)), var(--color-primary))`,filter:`blur(28px)`,animation:`tavusOrbSpin 18s linear infinite`,scale:`calc(1 + var(--audio-level, 0) * 0.35)`,opacity:`calc(0.45 + var(--audio-level, 0) * 0.45)`,transition:`scale 120ms ease-out, opacity 120ms ease-out`}}),j(`div`,{class:`absolute inset-[12%] rounded-full will-change-transform`,style:{background:`conic-gradient(from 180deg, color-mix(in oklab, var(--color-primary) 80%, white), transparent 30%, color-mix(in oklab, var(--color-primary) 60%, white) 70%, transparent)`,filter:`blur(14px)`,opacity:.55,mixBlendMode:`screen`,animation:`tavusOrbSpin 26s linear infinite reverse`}}),j(`div`,{class:`absolute inset-[28%] rounded-full`,style:{background:`radial-gradient(circle at 30% 30%, color-mix(in oklab, white 70%, var(--color-primary)), var(--color-primary) 60%, color-mix(in oklab, var(--color-primary) 50%, black))`,boxShadow:`0 0 60px color-mix(in oklab, var(--color-primary) 60%, transparent), inset 0 0 30px color-mix(in oklab, white 40%, transparent)`,scale:`calc(1 + var(--audio-level, 0) * 0.18)`,transition:`scale 100ms ease-out`}}),j(`div`,{class:`absolute inset-[28%] rounded-full`,style:{background:`radial-gradient(circle, color-mix(in oklab, var(--color-primary) 80%, transparent), transparent 70%)`,animation:`tavusOrbPulse 2.6s ease-in-out infinite`}})]})}function ux({children:e,class:t,className:n,...r}){return j(`div`,{class:`tavus-mesh-bg ${t??n??``}`,...r,children:[j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-1`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-2`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-3`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-4`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-5`}),j(`div`,{class:`absolute inset-0 bg-linear-to-t from-black/30 via-black/10 to-transparent pointer-events-none backdrop-blur-xs`}),e]})}var dx=e=>!!e.user_id?.includes(`tavus-replica`);function fx(){return Xh({filter:dx})}function px(e){let t=fx()[0],n=r_(t??``),r=Mg(),[i,a]=E(!1);return D(()=>{t&&(n.state===`playable`||e)&&a(!0)},[t,n.state,e]),r===`left-meeting`||r===`error`?{phase:`left`}:!i||!t?{phase:`connecting`}:{phase:`ready`,replicaId:t,videoState:n}}var mx=ba(({isAudioOnly:e})=>{let t=px(e);return t.phase===`left`?j(ox,{}):t.phase===`connecting`?j(ax,{}):e?j(ux,{class:`flex items-center justify-center`,children:[j(lx,{sessionId:t.replicaId}),j(tg,{sessionId:t.replicaId})]}):j(`div`,{class:`relative w-full h-full`,children:[j(rg,{automirror:!0,sessionId:t.replicaId,type:`video`,fit:`cover`,className:`absolute inset-0 w-full h-full object-cover ${t.videoState.isOff?`hidden`:``}`}),j(tg,{sessionId:t.replicaId})]})}),hx=ba(({onLeave:e})=>{let{config:t}=K_(),n=t.value.customization.conversation.modality===`audio`;return j(`div`,{class:`@container/pip w-full h-full`,children:j(`div`,{class:`relative w-full h-full overflow-hidden bg-linear-to-br from-base-300 to-base-200 text-base-content`,children:[j(`div`,{class:`relative w-full h-full z-5`,children:j(mx,{isAudioOnly:n})}),j(`div`,{class:`absolute bottom-4 w-full inset-x-0 z-20 flex justify-center items-center gap-2 @max-mobile:gap-1`,children:[j(Ub,{}),!n&&j(Wb,{}),j(`button`,{type:`button`,class:`btn btn-control btn-error`,onClick:e,"aria-label":`Leave call`,children:j(Wy,{name:`leave`,"aria-label":`Leave Call`})})]})]})})}),gx=ba(({personaSessionId:e,localSessionId:t,isPresenting:n,isScreenSharing:r,isAudioOnly:i,avatarOff:a,videoRef:o})=>{let s=n||r;return j(le,{children:[j(rg,{ref:o,automirror:!0,sessionId:r?t??``:e,type:s?`screenVideo`:`video`,fit:s?`contain`:`cover`,className:`absolute inset-0 w-full h-full transition-all ${s?`object-contain`:`object-cover`} ${!s&&a?`hidden`:``}`}),n&&j(`div`,{class:`absolute bottom-4 right-4 aspect-square w-32 @max-mobile:w-24 rounded-box overflow-hidden bg-black/30 z-10`,children:i||a?j(`div`,{class:`flex w-full h-full items-center justify-center`,children:j(lx,{sessionId:e})}):j(rg,{automirror:!0,sessionId:e,type:`video`,fit:`cover`,className:`w-full h-full object-cover`})})]})});function K(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function _x(e){return e&&Object.assign(xx,e),xx}var vx,yx,bx,xx,Sx=a((()=>{yx=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},bx=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(vx=globalThis).__zod_globalConfig??(vx.__zod_globalConfig={}),xx=globalThis.__zod_globalConfig}));function Cx(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function wx(e,t=`|`){return e.map(e=>Bx(e)).join(t)}function Tx(e,t){return typeof t==`bigint`?t.toString():t}function Ex(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Dx(e){return e==null}function Ox(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function kx(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function Ax(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rS)return r===void 0&&(r=rS,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function jx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Mx(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Nx(e){return JSON.stringify(e)}function Px(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Fx(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ix(e){if(Fx(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Fx(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Lx(e){return Ix(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Rx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function zx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function q(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Bx(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Vx(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Hx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return zx(e,Mx(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return jx(this,`shape`,e),e},checks:[]}))}function Ux(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return zx(e,Mx(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return jx(this,`shape`,r),r},checks:[]}))}function Wx(e,t){if(!Ix(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jx(this,`shape`,n),n}}))}function Gx(e,t){if(!Ix(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jx(this,`shape`,n),n}}))}function Kx(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return jx(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function qx(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return zx(t,Mx(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return jx(this,`shape`,i),i},checks:[]}))}function Jx(e,t,n){return zx(t,Mx(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return jx(this,`shape`,i),i}}))}function Yx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Xx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Zx(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Qx(e){return typeof e==`string`?e:e?.message}function $x(e,t,n){let r=e.message?e.message:Qx(e.inst?._zod.def?.error?.(e))??Qx(t?.error?.(e))??Qx(n.customError?.(e))??Qx(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function eS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function tS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function nS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var rS,iS,aS,oS,sS,cS=a((()=>{Sx(),rS=Symbol(`evaluating`),iS=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},aS=Ex(()=>{if(xx.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),oS=new Set([`string`,`number`,`symbol`]),sS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}}));function lS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function uS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var dS,fS,pS,mS=a((()=>{Sx(),cS(),dS=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tx,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},fS=K(`$ZodError`,dS),pS=K(`$ZodError`,dS,{Parent:Error})})),hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS=a((()=>{Sx(),mS(),cS(),hS=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new yx;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$x(e,a,_x())));throw iS(t,i?.callee),t}return o.value},gS=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$x(e,a,_x())));throw iS(t,i?.callee),t}return o.value},_S=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new yx;return a.issues.length?{success:!1,error:new(e??fS)(a.issues.map(e=>$x(e,i,_x())))}:{success:!0,data:a.value}},vS=_S(pS),yS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>$x(e,i,_x())))}:{success:!0,data:a.value}},bS=yS(pS),xS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hS(e)(t,n,i)},SS=e=>(t,n,r)=>hS(e)(t,n,r),CS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return gS(e)(t,n,i)},wS=e=>async(t,n,r)=>gS(e)(t,n,r),TS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _S(e)(t,n,i)},ES=e=>(t,n,r)=>_S(e)(t,n,r),DS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yS(e)(t,n,i)},OS=e=>async(t,n,r)=>yS(e)(t,n,r)}));function AS(){return new RegExp(WS,`u`)}function jS(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function MS(e){return RegExp(`^${jS(e)}$`)}function NS(e){let t=jS({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${$S}T(?:${r})$`)}var PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC=a((()=>{PS=/^[cC][0-9a-z]{6,}$/,FS=/^[0-9a-z]+$/,IS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,LS=/^[0-9a-vA-V]{20}$/,RS=/^[A-Za-z0-9]{27}$/,zS=/^[a-zA-Z0-9_-]{21}$/,BS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,HS=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,US=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WS=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,GS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,JS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,XS=/^[A-Za-z0-9_-]*$/,ZS=/^https?$/,QS=/^\+[1-9]\d{6,14}$/,$S=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,eC=RegExp(`^${$S}$`),tC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},nC=/^-?\d+$/,rC=/^-?\d+(?:\.\d+)?$/,iC=/^(?:true|false)$/i,aC=/^null$/i,oC=/^undefined$/i,sC=/^[^A-Z]*$/,cC=/^[^a-z]*$/})),uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC=a((()=>{Sx(),lC(),cS(),uC=K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),dC={number:`number`,bigint:`bigint`,object:`date`},fC=K(`$ZodCheckLessThan`,(e,t)=>{uC.init(e,t);let n=dC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pC=K(`$ZodCheckGreaterThan`,(e,t)=>{uC.init(e,t);let n=dC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mC=K(`$ZodCheckMultipleOf`,(e,t)=>{uC.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):kx(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hC=K(`$ZodCheckNumberFormat`,(e,t)=>{uC.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=sS[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=nC)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),gC=K(`$ZodCheckMaxLength`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=eS(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_C=K(`$ZodCheckMinLength`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=eS(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vC=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=eS(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),yC=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;uC.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),bC=K(`$ZodCheckRegex`,(e,t)=>{yC.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xC=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=sC,yC.init(e,t)}),SC=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=cC,yC.init(e,t)}),CC=K(`$ZodCheckIncludes`,(e,t)=>{uC.init(e,t);let n=Rx(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),wC=K(`$ZodCheckStartsWith`,(e,t)=>{uC.init(e,t);let n=RegExp(`^${Rx(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),TC=K(`$ZodCheckEndsWith`,(e,t)=>{uC.init(e,t);let n=RegExp(`.*${Rx(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),EC=K(`$ZodCheckOverwrite`,(e,t)=>{uC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),OC,kC=a((()=>{OC=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
50
+ Passed callback for '${e}' event is NOT registered.`,t),c(!0);return}l.current++;var n=setTimeout(function(){l.current=0},50);return a(e,t,u),function(){clearTimeout(n),i(e,u)}}},[t,e,u,s,i,a]),pt({event:e,eventId:u,isBlocked:s,callback:t})};function fh(e,t){var n,r;if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!fh(e[i],t[i]))return!1;return!0}if(MediaStream&&e instanceof MediaStream&&t instanceof MediaStream)return e.id===t.id&&e.active===t.active&&e.getTracks().length===t.getTracks().length&&e.getTracks().every(function(e,n){return fh(e,t.getTracks()[n])});if(MediaStreamTrack&&e instanceof MediaStreamTrack&&t instanceof MediaStreamTrack)return e.id===t.id&&e.kind===t.kind&&e.readyState===t.readyState;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;var a=Array.from(e).sort(),o=Array.from(t).sort();return a.every(function(e,t){return fh(e,o[t])})}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;try{for(var s=nh(e.entries()),c=s.next();!c.done;c=s.next()){var l=rh(c.value,2),u=l[0],d=l[1];if(!t.has(u)||!fh(d,t.get(u)))return!1}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}if(Qm(e)!==`object`||e===null||Qm(t)!==`object`||t===null)return!1;var f=Object.keys(e),p=Object.keys(t);if(f.length!==p.length)return!1;for(var i=0;i<f.length;i++){var u=f[i];if(!Object.prototype.hasOwnProperty.call(t,u)||!fh(e[u],t[u]))return!1}return!0}function ph(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],i=t[n],a=r!==null&&Qm(r)===`object`,o=i!==null&&Qm(i)===`object`;if(a||o){if(!fh(r,i))return!1}else if(r!==i)return!1}return!0}function G(e){return`daily-react-`+e}function mh(e){var t=new Map,n=new Map;return function(r){if(!t.has(r)){var i=N(function(t){var i=e.get(r)(t),a=n.get(r);return a!=null&&e.equals(i,a)?a:(n.set(r,i),i)});t.set(r,i)}return t.get(r)}}var hh=`::`,gh=`;`,_h=function(e,t){return e+hh+t},vh=function(e,t){return e+hh+t.join(gh)},yh=function(e,t){return xh(_h(e,t))},bh=ca(function(e){var t=N([]);return t.debugLabel=G(`participant-property-paths-${e}`),t}),xh=ca(function(e){var t=N(null);return t.debugLabel=G(`participant-property-${e}`),t}),Sh=mh({equals:ph,get:function(e){return function(t){var n=rh(e.split(hh),2),r=n[0];return n[1].split(gh).map(function(e){return t(yh(r,e))})}}}),Ch=function(e,t){var n,r=ho(Array.isArray(t)?Sh(vh(e,t)):xh(_h(e,t)));return pt(Array.isArray(t)?t.reduce(function(e,t,n){return e[t]=r[n],e},{}):(n={},n[t]=r,n)),r},wh=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Eh,Dh;function Oh(){if(Dh)return Eh;Dh=1;var e=`Expected a function`,t=NaN,n=`[object Symbol]`,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=Qm(wh)==`object`&&wh&&wh.Object===Object&&wh,l=(typeof self>`u`?`undefined`:Qm(self))==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(t,n,r){var i,a,o,s,c,l,u=0,d=!1,h=!1,g=!0;if(typeof t!=`function`)throw TypeError(e);n=b(n)||0,_(r)&&(d=!!r.leading,h=`maxWait`in r,o=h?f(b(r.maxWait)||0,n):o,g=`trailing`in r?!!r.trailing:g);function v(e){var n=i,r=a;return i=a=void 0,u=e,s=t.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,n),d?v(e):s}function x(e){var t=e-l,r=e-u,i=n-t;return h?p(i,o-r):i}function S(e){var t=e-l,r=e-u;return l===void 0||t>=n||t<0||h&&r>=o}function C(){var e=m();if(S(e))return w(e);c=setTimeout(C,x(e))}function w(e){return c=void 0,g&&i?v(e):(i=a=void 0,s)}function ee(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function T(){return c===void 0?s:w(m())}function te(){var e=m(),t=S(e);if(i=arguments,a=this,l=e,t){if(c===void 0)return y(l);if(h)return c=setTimeout(C,n),v(l)}return c===void 0&&(c=setTimeout(C,n)),s}return te.cancel=ee,te.flush=T,te}function g(t,n,r){var i=!0,a=!0;if(typeof t!=`function`)throw TypeError(e);return _(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),h(t,n,{leading:i,maxWait:n,trailing:a})}function _(e){var t=Qm(e);return!!e&&(t==`object`||t==`function`)}function v(e){return!!e&&Qm(e)==`object`}function y(e){return Qm(e)==`symbol`||v(e)&&d.call(e)==n}function b(e){if(typeof e==`number`)return e;if(y(e))return t;if(_(e)){var n=typeof e.valueOf==`function`?e.valueOf():e;e=_(n)?n+``:n}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?t:+e}return Eh=g,Eh}var kh=Th(Oh()),Ah=function(e,t,n,r){n===void 0&&(n=500),r===void 0&&(r=!1);var i=ft(sh),a=i.off,o=i.on,s=k(function(){var t;return Array.isArray(e)?e.reduce(function(e,t){return e[t]=r?lh():dh(),e},{}):(t={},t[e]=r?lh():dh(),t)},[e,r]),c=O([]);W(`call-instance-destroyed`,A(function(){c.current.length=0},[]));var l=k(function(){return kh(function(){c.current.length!==0&&(t(c.current),c.current.length=0)},n,{trailing:!0})},[t,n]);D(function(){if(e){var t=function(e){c.current.push(e),l()};return Array.isArray(e)?e.forEach(function(e){return o(e,t,s[e])}):o(e,t,s[e]),function(){Array.isArray(e)?e.forEach(function(e){return a(e,s[e])}):a(e,s[e])}}},[l,e,s,a,o]),pt({event:e,eventId:s})},jh=function(e,t,n){if(t===void 0&&(t=``),n===void 0&&(n=new Set),Qm(e)!==`object`||e===null||n.has(e))return[t];n.add(e);var r=[];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=t?`${t}.${i}`:i;r.push.apply(r,ih([a],rh(jh(e[i],a,n)),!1))}return n.delete(e),r},Mh=function(e){return jh(e)},Nh=function(e,t){return String(t).split(`.`).filter(function(e){return e.length}).reduce(function(e,t){return e&&e[t]},e)},Ph=function(e,t){return t.map(function(t){return Nh(e,t)})},Fh=N(null);Fh.debugLabel=G(`active-id`);var Ih=N(``);Ih.debugLabel=G(`local-id`);var Lh=N(null);Lh.debugLabel=G(`local-join-date`);var Rh=N([]);Rh.debugLabel=G(`participant-ids`);var zh=ca(function(e){var t=N(null);return t.debugLabel=G(`participant-${e}`),t}),Bh=N([]);Bh.debugLabel=G(`waiting-participants`);var Vh=ca(function(e){var t=N({awaitingAccess:{level:`full`},id:e,name:``});return t.debugLabel=G(`waiting-participant-${e}`),t}),Hh=function(e){var t=e.children,n=oh(),r=rh(E(!1),2),i=r[0],a=r[1],o=F(A(function(e,t,n){t(Ih,n.local.session_id);var r=Object.values(n);t(Rh,r.map(function(e){return e.session_id})),r.forEach(function(e){t(zh(e.session_id),e);var n=Mh(e);t(bh(e.session_id),n),n.forEach(function(n){var r=rh(Ph(e,[n]),1)[0];t(yh(e.session_id,n),r)})}),a(!0)},[]));D(function(){if(!(!n||i)){var e=setInterval(function(){var t=n.participants();`local`in t&&(o(t),clearInterval(e))},100);return function(){clearInterval(e)}}},[n,i,o]);var s=A(function(){if(n){var e=n?.participants();e.local&&o(e)}},[n,o]);W(`started-camera`,s,!0),W(`access-state-updated`,s,!0),W(`joining-meeting`,F(A(function(e,t){t(Lh,new Date),s()},[s])),!0),W(`joined-meeting`,A(function(e){o(e.participants)},[o]),!0);var c=F(A(function(e,t){t(Ih,``),t(Fh,null),e(Rh).forEach(function(e){return zh.remove(e)}),t(Rh,[])},[]));return W(`call-instance-destroyed`,c,!0),W(`left-meeting`,c,!0),Ah([`active-speaker-change`,`participant-joined`,`participant-updated`,`participant-left`],F(A(function(e,t,n){n.length&&n.forEach(function(n){switch(n.action){case`active-speaker-change`:t(Fh,n.activeSpeaker.peerId),t(zh(n.activeSpeaker.peerId),function(e){return e?U(U({},e),{last_active:new Date}):null});break;case`participant-joined`:t(Rh,function(e){return e.includes(n.participant.session_id)?e:ih(ih([],rh(e),!1),[n.participant.session_id],!1)}),t(zh(n.participant.session_id),n.participant);var r=Mh(n.participant);t(bh(n.participant.session_id),r),r.forEach(function(e){var r=rh(Ph(n.participant,[e]),1)[0];t(yh(n.participant.session_id,e),r)});break;case`participant-updated`:t(zh(n.participant.session_id),n.participant),n.participant.local&&t(Ih,n.participant.session_id);var r=Mh(n.participant),i=e(bh(n.participant.session_id));(r.length!==i.length||r.some(function(e){return!i.includes(e)}))&&t(bh(n.participant.session_id),r);var a=new Set(i),o=Ph(n.participant,r);r.forEach(function(e,r){var i=o[r];a.delete(e),t(yh(n.participant.session_id,e),function(e){return fh(e,i)?e:i})}),a.forEach(function(e){t(yh(n.participant.session_id,e),null)});break;case`participant-left`:t(Rh,function(e){return e.includes(n.participant.session_id)?e.filter(function(e){return e!==n.participant.session_id}):e}),zh.remove(n.participant.session_id),e(bh(n.participant.session_id)).forEach(function(e){xh.remove(_h(n.participant.session_id,e))}),bh.remove(n.participant.session_id);break}})},[])),100,!0),Ah([`waiting-participant-added`,`waiting-participant-updated`,`waiting-participant-removed`],F(A(function(e,t,n){n.forEach(function(e){switch(e.action){case`waiting-participant-added`:t(Bh,function(t){return t.includes(e.participant.id)?t:ih(ih([],rh(t),!1),[e.participant.id],!1)}),t(Vh(e.participant.id),e.participant);break;case`waiting-participant-updated`:t(Vh(e.participant.id),e.participant);break;case`waiting-participant-removed`:t(Bh,function(t){return t.filter(function(t){return t!==e.participant.id})}),Vh.remove(e.participant.id);break}})},[])),100,!0),P.createElement(P.Fragment,null,t)},Uh=function(){var e=ho(Ih);return pt(e),e},Wh=function(){return!0},Gh=function(e){var t=e===void 0?{}:e,n=t.filter,r=n===void 0?Wh:n,i=t.ignoreLocal,a=i===void 0?!1:i,o=Uh(),s=ho(Fh),c=a&&s===o,l=!r?.(s),u=rh(E(!c&&!l?s:null),2),d=u[0],f=u[1];return D(function(){c||l||f(s)},[l,c,s]),pt(d),d},Kh=function(e){return[`blocked`,`off`].includes(e)},qh=`;`,Jh=function(e,t){return`${e}${qh}${t}`},Yh=mh({equals:fh,get:function(e){return function(t){var n=rh(e.split(qh),2),r=n[0],i=n[1];return t(Rh).filter(function(e){switch(r){case`local`:case`owner`:case`record`:return t(yh(e,r));case`remote`:return!t(yh(e,`local`));case`screen`:var n=t(yh(e,`tracks.screenAudio.state`)),i=t(yh(e,`tracks.screenVideo.state`));return!Kh(n)||!Kh(i);default:return!0}}).sort(function(e,n){switch(i){case`joined_at`:case`session_id`:case`user_id`:case`user_name`:var r=t(yh(e,i)),a=t(yh(n,i));if(r!==void 0||a!==void 0){if(r===void 0)return-1;if(a===void 0||r>a)return 1;if(r<a)return-1}return 0;default:return 0}})}}}),Xh=function(e){var t=e===void 0?{}:e,n=t.filter,r=t.onActiveSpeakerChange,i=t.onParticipantJoined,a=t.onParticipantLeft,o=t.onParticipantUpdated,s=t.sort,c=ho(Yh(Jh(typeof n==`string`?n:null,typeof s==`string`?s:null))),l=typeof n==`function`||typeof s==`function`,u=A(function(e){return typeof n!=`function`&&typeof s!=`function`?[]:c.map(function(t){return e(zh(t))}).filter(function(e){return!!e}).filter(typeof n==`function`?n:function(){return!0}).sort(typeof s==`function`?s:function(){return 0}).map(function(e){return e.session_id}).filter(Boolean)},[n,c,s]),d=rh(E([]),2),f=d[0],p=d[1],m=F(A(function(e){if(l){var t=u(e);fh(t,f)||p(t)}},[f,u,l]));D(function(){m()},[m]),Ah([`participant-joined`,`participant-updated`,`active-speaker-change`,`participant-left`],A(function(e){e.length&&(e.forEach(function(e){switch(e.action){case`participant-joined`:i?.(e);break;case`participant-updated`:o?.(e);break;case`active-speaker-change`:r?.(e);break;case`participant-left`:a?.(e);break}}),m())},[m,r,i,a,o]));var h=typeof n==`function`||typeof s==`function`?f:c;return pt(h),h},Zh=mh({equals:ph,get:function(){return function(e){return e(Yh(Jh(`screen`,null))).map(function(t){return{local:e(yh(t,`local`)),screenAudio:e(yh(t,`tracks.screenAudio`)),screenVideo:e(yh(t,`tracks.screenVideo`)),screenId:`${t}-screen`,session_id:t}})}}}),Qh=function(e){var t=e===void 0?{}:e,n=t.onError,r=t.onLocalScreenShareStarted,i=t.onLocalScreenShareStopped,a=oh(),o=A(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a?.startScreenShare.apply(a,ih([],rh(e),!1))},[a]),s=A(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a?.stopScreenShare.apply(a,ih([],rh(e),!1))},[a]);W(`local-screen-share-started`,A(function(){return r?.()},[r])),W(`local-screen-share-stopped`,A(function(){return i?.()},[i])),W(`nonfatal-error`,A(function(e){e.type===`screen-share-error`&&n?.(e)},[n]));var c=ho(Zh(void 0)),l={isSharingScreen:c.some(function(e){return e.local}),screens:c,startScreenShare:o,stopScreenShare:s};return pt(l),l},$h=function(e,t){t===void 0&&(t=`video`);var n=Ch(e,`tracks.${t}`),r=n?U(U({},n),{isOff:Kh(n.state)}):{isOff:!0,persistentTrack:void 0,state:`off`,subscribed:!1};return pt(r),r};function eg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A(function(t){for(var n=0;n<e.length;n++){var r=e[n];typeof r==`function`?r(t):r&&Qm(r)===`object`&&(r.current=t)}},e)}var tg=ba(Ca(function(e,t){var n=e.onPlayFailed,r=e.sessionId,i=e.type,a=i===void 0?`audio`:i,o=$m(e,[`onPlayFailed`,`sessionId`,`type`]),s=O(null),c=$h(r,a),l=eg(s,t),u=c?.subscribed;return D(function(){var e=s.current;if(!(!e||!c?.persistentTrack)){if(!MediaStream){console.warn(`MediaStream API not available. Can't setup ${a} for ${r}`),n?.({sessionId:r,target:e,type:a,message:`MediaStream API not available`,name:`MediaStream API not available`});return}var t=function(){e.play().catch(function(t){n?.({sessionId:r,target:e,type:a,message:t.message,name:t.name})})};return e.addEventListener(`loadedmetadata`,t),e.srcObject=new MediaStream([c.persistentTrack]),e.load(),function(){e.removeEventListener(`loadedmetadata`,t)}}},[c?.persistentTrack,n,r,a]),W(`participant-left`,A(function(e){var t=s.current;e.participant.session_id!==r||!t||(t.srcObject=null)},[r])),W(`left-meeting`,A(function(){var e=s.current;e&&(e.pause(),e.srcObject=null)},[])),P.createElement(`audio`,U({autoPlay:!0,ref:l},o,{"data-session-id":r,"data-audio-type":a,"data-subscribed":u}))}));tg.displayName=`DailyAudioTrack`;var ng=ba(Ca(function(e,t){var n=e.autoSubscribeActiveSpeaker,r=n===void 0?!1:n,i=e.maxSpeakers,a=i===void 0?5:i,o=e.onPlayFailed,s=e.playLocalScreenAudio,c=s===void 0?!1:s,l=oh(),u=rh(E(Array(a).fill(``)),2),d=u[0],f=u[1],p=Qh().screens,m=Uh(),h=Gh({ignoreLocal:!0}),g=O(null);dt(t,function(){return{getActiveSpeakerAudio:function(){return g.current?.querySelector(`audio[data-session-id="${h}"][data-audio-type="audio"]`)??null},getAllAudio:function(){return Array.from(g.current?.querySelectorAll(`audio`)??[])},getAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="audio"]`)??null},getRmpAudio:function(){return Array.from(g.current?.querySelectorAll(`audio[data-audio-type="rmpAudio"]`)??[])},getScreenAudio:function(){return Array.from(g.current?.querySelectorAll(`audio[data-audio-type="screenAudio"]`)??[])},getRmpAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="rmpAudio"]`)??null},getScreenAudioBySessionId:function(e){return g.current?.querySelector(`audio[data-session-id="${e}"][data-audio-type="screenAudio"]`)??null}}},[h]);var _=F(A(function(e,t,n){return eh(void 0,void 0,void 0,function(){var t,i;return th(this,function(a){if(t=Object.values(l?.participants()??{}).filter(function(e){return!e.local&&!!e.tracks.audio.subscribed}),i=function(e){return t.some(function(t){return t.session_id===e})},!i(n))if(l&&!l.isDestroyed()&&r&&!l.subscribeToTracksAutomatically())l.updateParticipant(n,{setSubscribedTracks:{audio:!0}});else return[2];return f(function(r){if(r.includes(n))return r;var a=function(e){return!e||!i(e)};if(r.some(a)){var o=r.findIndex(a);return r[o]=n,ih([],rh(r),!1)}var s=r.findIndex(function(e){return t.some(function(t){return t.session_id===e&&Kh(t.tracks.audio.state)})});if(s>=0)return r[s]=n,ih([],rh(r),!1);var c=t.filter(function(e){return r.includes(e.session_id)&&e.session_id!==h}).sort(function(t,n){var r=e(yh(t.session_id,`last_active`))??new Date(`1970-01-01`),i=e(yh(n.session_id,`last_active`))??new Date(`1970-01-01`);return r>i?1:r<i?-1:0});if(!c.length){var l=r.findIndex(function(e){return e!==h});return r[l]=n,ih([],rh(r),!1)}var u=r.indexOf(c[0]?.session_id);return r[u]=n,ih([],rh(r),!1)}),[2]})})},[h,r,l])),v=A(function(e){f(function(t){if(!t.includes(e))return t;var n=ih([],rh(t),!1),r=n.indexOf(e);return n[r]=``,n})},[]);Ah([`active-speaker-change`,`track-started`,`participant-left`],A(function(e){e.forEach(function(e){switch(e.action){case`active-speaker-change`:if(e.activeSpeaker.peerId===m)return;_(e.activeSpeaker.peerId);break;case`track-started`:e.track.kind===`audio`&&e.participant&&!e.participant.local&&_(e.participant.session_id);break;case`participant-left`:v(e.participant.session_id);break}})},[_,m,v]),200);var y=Xh({filter:A(function(e){return!!e?.tracks?.rmpAudio},[])});return P.createElement(`div`,{ref:g},d.map(function(e,t){return P.createElement(tg,{key:`speaker-slot-${t}`,onPlayFailed:o,sessionId:e,type:`audio`})}),p.filter(function(e){return c?!0:!e.local}).map(function(e){return P.createElement(tg,{key:e.screenId,onPlayFailed:o,sessionId:e.session_id,type:`screenAudio`})}),y.map(function(e){return P.createElement(tg,{key:`${e}-rmp`,onPlayFailed:o,sessionId:e,type:`rmpAudio`})}))}));ng.displayName=`DailyAudio`;var rg=Ca(function(e,t){var n=e.automirror,r=e.fit,i=r===void 0?`contain`:r,a=e.mirror,o=e.onResize,s=e.playableStyle,c=s===void 0?{}:s,l=e.sessionId,u=e.style,d=u===void 0?{}:u,f=e.type,p=f===void 0?`video`:f,m=$m(e,[`automirror`,`fit`,`mirror`,`onResize`,`playableStyle`,`sessionId`,`style`,`type`]),h=Uh()===l,g=p===`screenVideo`,_=h&&!g,v=O(null),y=eg(v,t),b=$h(l,p),x=b.persistentTrack,S=_||g||!b.isOff,C=Ch(l,`tracks.${p}`)?.subscribed,w=k(function(){if(typeof a==`boolean`)return a;if(!n)return!1;if(!x)return _;var e=x.getSettings();return`facingMode`in e?_&&e.facingMode===`user`:_},[n,_,a,x]);return D(function(){var e=v.current;if(e){var t=function(){var t=e.play();t!==void 0&&t.then(function(){e.controls=!1}).catch(function(t){e.controls=!0,console.warn(`Failed to play video`,t)})},n=function(){e.paused&&t()},r=function(){e.style.transform=`scale(1)`},i=function(){e.style.transform=``,setTimeout(function(){e.paused&&t()},100)},a=function(){document.visibilityState!==`hidden`&&e.paused&&t()};return e.addEventListener(`canplay`,n),e.addEventListener(`enterpictureinpicture`,r),e.addEventListener(`leavepictureinpicture`,i),document.addEventListener(`visibilitychange`,a),function(){e.removeEventListener(`canplay`,n),e.removeEventListener(`enterpictureinpicture`,r),e.removeEventListener(`leavepictureinpicture`,i),document.removeEventListener(`visibilitychange`,a)}}},[]),D(function(){var e=v.current;if(!(!e||!x)){if(!MediaStream){console.warn(`MediaStream API not available. Can't setup ${p} for ${l}`);return}return e.srcObject=new MediaStream([x]),e.load(),function(){e.srcObject=null,e.load()}}},[l,p,x,x?.id]),D(function(){var e=v.current;if(!o||!e)return;var t;function n(){t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=v.current;if(!(!e||document.hidden)){var t=e.videoWidth,n=e.videoHeight;t&&n&&o?.({aspectRatio:t/n,height:n,width:t})}})}return n(),e.addEventListener(`loadedmetadata`,n),e.addEventListener(`resize`,n),function(){t&&cancelAnimationFrame(t),e.removeEventListener(`loadedmetadata`,n),e.removeEventListener(`resize`,n)}},[o]),P.createElement(`video`,U({autoPlay:!0,muted:!0,playsInline:!0,ref:y,"data-local":h,"data-mirrored":w||void 0,"data-playable":S||void 0,"data-session-id":l,"data-subscribed":C,"data-video-type":p,style:U(U({objectFit:i,transform:w?`scale(-1, 1)`:``},d),S?c:{})},m))});rg.displayName=`DailyVideo`;var ig=Fe({refreshDevices:function(){return Promise.resolve()}}),ag=N(`idle`);ag.debugLabel=G(`camera-state`);var og=N(`idle`);og.debugLabel=G(`microphone-state`);var sg=N([]);sg.debugLabel=G(`camera-devices`);var cg=N([]);cg.debugLabel=G(`microphone-devices`);var lg=N([]);lg.debugLabel=G(`speaker-devices`);var ug=N(null);ug.debugLabel=G(`last-camera-error`);var dg=function(e){var t=e.children,n=oh(),r=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e,r,i,a,o,s,c,l,u,d;return th(this,function(f){switch(f.label){case 0:if((navigator==null?void 0:navigator.mediaDevices)?.getUserMedia===void 0||(navigator==null?void 0:navigator.mediaDevices)?.enumerateDevices===void 0)return t(ag,`not-supported`),t(og,`not-supported`),[2];if(!n)return[2];f.label=1;case 1:return f.trys.push([1,4,,5]),[4,n.enumerateDevices()];case 2:return e=f.sent().devices,r=e.filter(function(e){return e.kind===`videoinput`&&e.deviceId!==``}),i=e.filter(function(e){return e.kind===`audioinput`&&e.deviceId!==``}),a=e.filter(function(e){return e.kind===`audiooutput`&&e.deviceId!==``}),[4,n.getInputDevices()];case 3:return o=f.sent(),s=o.camera,c=o.mic,l=o.speaker,u=function(e,t,n){var r=n.find(function(e){return e.device.deviceId===t.deviceId}),i=`deviceId`in e&&t.deviceId===e.deviceId,a=!(`deviceId`in e)&&r?.selected;return{device:t,selected:i||!!a,state:r?.state??`granted`}},d=function(e,t){return e.device.deviceId==="default"?-1:t.device.deviceId==="default"?1:e.device.label<t.device.label?-1:+(e.device.label>t.device.label)},t(sg,function(e){return r.filter(Boolean).map(function(t){return u(s,t,e)}).sort(d)}),t(cg,function(e){return i.filter(Boolean).map(function(t){return u(c,t,e)}).sort(d)}),t(lg,function(e){return a.filter(Boolean).map(function(t){return u(l,t,e)}).sort(d)}),[3,5];case 4:return f.sent(),t(ag,`not-supported`),t(og,`not-supported`),[3,5];case 5:return[2]}})})},[n])),i=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var i,a,o,s,c,l,u,d,f,p,m,h;return th(this,function(g){switch(g.label){case 0:if(!n||(i=e(ag),a=e(og),o=n.participants(),!o.local))return[2];if(s=o.local.tracks,c=`prompt`,l=`prompt`,!navigator.permissions)return[3,5];g.label=1;case 1:return g.trys.push([1,4,,5]),[4,navigator.permissions.query({name:`camera`})];case 2:return u=g.sent(),c=u.state,[4,navigator.permissions.query({name:`microphone`})];case 3:return d=g.sent(),l=d.state,[3,5];case 4:return g.sent(),[3,5];case 5:return f=c===`prompt`&&[`idle`,`pending`].includes(i)&&s.video.state===`interrupted`&&!s.video.persistentTrack,p=[`idle`,`pending`].includes(i)&&!s.video.persistentTrack&&!!s.video.off?.byUser,m=l===`prompt`&&[`idle`,`pending`].includes(a)&&s.audio.state===`interrupted`&&!s.audio.persistentTrack,h=[`idle`,`pending`].includes(a)&&!s.audio.persistentTrack&&!!s.audio.off?.byUser,s.audio?.blocked?.byDeviceInUse?(t(og,`in-use`),t(cg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`in-use`}):e})})):s.audio?.blocked?.byDeviceMissing?t(og,`not-found`):s.audio?.blocked?.byPermissions||l===`denied`?t(og,`blocked`):m?t(og,`pending`):h?t(og,`idle`):(t(og,`granted`),t(cg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`granted`}):e})})),s.video?.blocked?.byDeviceInUse?(t(ag,`in-use`),t(sg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`in-use`}):e})})):s.video?.blocked?.byDeviceMissing?t(ag,`not-found`):s.video?.blocked?.byPermissions||c===`denied`?t(ag,`blocked`):f?t(ag,`pending`):p?t(ag,`idle`):(t(ag,`granted`),t(sg,function(e){return e.map(function(e){return e.selected?U(U({},e),{state:`granted`}):e})})),r(),[2]}})})},[n,r]));return W(`participant-updated`,A(function(e){e.participant.local&&i()},[i])),W(`available-devices-updated`,r),W(`selected-devices-updated`,r),W(`camera-error`,F(A(function(e,t,n){switch(t(ug,n.error),n.error?.type){case`cam-in-use`:t(ag,`in-use`);break;case`mic-in-use`:t(og,`in-use`);break;case`cam-mic-in-use`:t(ag,`in-use`),t(og,`in-use`);break;case`not-found`:n.error?.missingMedia.includes(`video`)&&t(ag,`not-found`),n.error?.missingMedia.includes(`audio`)&&t(og,`not-found`);break;case`permissions`:n.error?.blockedMedia.includes(`video`)&&t(ag,`blocked`),n.error?.blockedMedia.includes(`audio`)&&t(og,`blocked`);break;case`constraints`:n.error?.reason===`invalid`?(t(ag,`constraints-invalid`),t(og,`constraints-invalid`)):n.error?.reason===`none-specified`&&(t(ag,`constraints-none-specified`),t(og,`constraints-none-specified`));break;case`undefined-mediadevices`:t(ag,`undefined-mediadevices`),t(og,`undefined-mediadevices`);break;default:t(ag,`unknown`),t(og,`unknown`);break}},[]))),W(`started-camera`,F(A(function(e,t){t(ag,`granted`),t(og,`granted`),i()},[i]))),P.createElement(ig.Provider,{value:{refreshDevices:r}},t)};function fg(e){return e.instanceId??`__default__`}var pg=N({});pg.debugLabel=G(`live-streaming-instances`);var mg=N(function(e){var t=e(pg),n=Object.values(t),r=n.filter(function(e){return e.isLiveStreaming}),i=r[0]??n[n.length-1];return{errorMsg:n.find(function(e){return e.errorMsg})?.errorMsg,isLiveStreaming:r.length>0,layout:i?.layout}});mg.debugLabel=G(`live-streaming`);var hg=function(e){var t=e.children;return W(`live-streaming-started`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return U(U({},e),(t={},t[r]={instanceId:r,isLiveStreaming:!0,layout:n?.layout},t))})},[]))),W(`live-streaming-stopped`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return e[r]?U(U({},e),(t={},t[r]=U(U({},e[r]),{isLiveStreaming:!1,layout:void 0}),t)):e})},[]))),W(`live-streaming-error`,F(A(function(e,t,n){var r=fg(n);t(pg,function(e){var t;return U(U({},e),(t={},t[r]=U(U({},e[r]??{instanceId:r,isLiveStreaming:!1}),{errorMsg:n.errorMsg}),t))})},[]))),W(`left-meeting`,F(A(function(e,t){t(pg,{})},[]))),P.createElement(P.Fragment,null,t)},gg=N(`new`);gg.debugLabel=G(`meeting-state`);var _g=N(null);_g.debugLabel=G(`meeting-error`);var vg=N(null);vg.debugLabel=G(`non-fatal-error`);var yg=N({data:void 0,topology:`none`});yg.debugLabel=G(`meeting-session-data`);var bg=function(e){var t=e.children,n=oh(),r=F(A(function(e,t){if(n){var r=n.meetingState();return t(gg,r),r}},[n]));return W(`loading`,r),W(`loaded`,r),W(`joining-meeting`,r),W(`joined-meeting`,r),W(`left-meeting`,r),W(`error`,F(A(function(e,t,n){t(_g,n),r()},[r]))),W(`nonfatal-error`,F(A(function(e,t,n){t(vg,n)},[]))),W(`joined-meeting`,F(A(function(e,t){n&&t(yg,n.meetingSessionState())},[n]))),W(`meeting-session-state-updated`,F(A(function(e,t,n){t(yg,n.meetingSessionState)},[]))),W(`left-meeting`,F(A(function(e,t){t(yg,{data:void 0,topology:`none`})},[]))),W(`call-instance-destroyed`,F(A(function(e,t){t(gg,`new`),t(_g,null),t(vg,null),t(yg,{data:void 0,topology:`none`})},[]))),P.createElement(P.Fragment,null,t)},xg=N(`none`);xg.debugLabel=G(`topology`);var Sg=N(`unknown`),Cg=N([]),wg=N(`interrupted`),Tg=N(100);Tg.debugLabel=G(`network-quality`);var Eg=N(`good`);Eg.debugLabel=G(`network-threshold`);var Dg=function(e){var t=e.children,n=oh(),r=ho(xg),i=F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e;return th(this,function(r){switch(r.label){case 0:return n?[4,n.getNetworkTopology()]:[2];case 1:return e=r.sent(),!e||e?.topology===`none`||t(xg,e.topology),[2]}})})},[n]));return W(`joined-meeting`,i),W(`network-connection`,F(A(function(e,t,n){switch(t(wg,n.event),n.event){case`connected`:n.type===`peer-to-peer`&&t(xg,`peer`),n.type===`sfu`&&t(xg,`sfu`);break}},[]))),W(`network-quality-change`,F(A(function(e,t,n){t(Sg,function(e){return e===n.networkState?e:n.networkState}),t(Cg,function(e){var t=n.networkStateReasons??[];return ph(e,t)?e:t}),t(Tg,function(e){return e===n.quality?e:n.quality}),t(Eg,function(e){return e===n.threshold?e:n.threshold})},[]))),W(`left-meeting`,F(A(function(e,t){t(xg,`none`),t(Sg,`unknown`),t(Cg,[]),t(wg,`interrupted`),t(Tg,100),t(Eg,`good`)},[]))),D(function(){!n||r!==`none`||i()},[n,i,r]),P.createElement(P.Fragment,null,t)};function Og(e){return e.instanceId?e.instanceId:e.type===`local`||e.local?`__local__`:`__default__`}var kg=N({});kg.debugLabel=G(`recording-instances`);var Ag=N(function(e){var t=e(kg),n=Object.values(t),r=n.filter(function(e){return e.isRecording}),i=r[0]??n[n.length-1];return{error:n.some(function(e){return e.error}),isLocalParticipantRecorded:n.some(function(e){return e.isLocalParticipantRecorded}),isRecording:r.length>0,layout:i?.layout,local:i?.local,recordingId:i?.recordingId,recordingStartedDate:i?.recordingStartedDate,startedBy:i?.startedBy,type:i?.type}});Ag.debugLabel=G(`recording-state`);var jg=function(e){var t=e.children,n=Uh(),r=Xh({filter:`record`}),i=F(A(function(e,t,n,r){var i=e(kg).__local__,a={instanceId:`__local__`,isLocalParticipantRecorded:n,isRecording:n,local:n?r:i?.local,type:n?`local`:i?.type};i&&fh(i,a)||!n&&!i||(n?t(kg,function(e){return U(U({},e),{__local__:a})}):i&&t(kg,function(e){return U(U({},e),{__local__:U(U({},i),{isLocalParticipantRecorded:!1,isRecording:!1})})}))},[]));return D(function(){i(r.length>0,r.includes(n||`local`))},[n,i,r]),W(`recording-started`,F(A(function(e,t,r){var i=Og(r),a=!0;switch(r.type){case`cloud-audio-only`:case`cloud-beta`:case`cloud`:n&&r.layout?.preset===`single-participant`&&r.layout.session_id!==n&&(a=!1);break}t(kg,function(e){var t;return U(U({},e),(t={},t[i]={error:!1,instanceId:i,isLocalParticipantRecorded:a,isRecording:!0,layout:r?.layout,local:r?.local,recordingId:r?.recordingId,recordingStartedDate:new Date,startedBy:r?.startedBy,type:r?.type},t))})},[n]))),W(`recording-stopped`,F(A(function(e,t,n){var r=Og(n);t(kg,function(e){var t;return e[r]?U(U({},e),(t={},t[r]=U(U({},e[r]),{isLocalParticipantRecorded:!1,isRecording:!1}),t)):e})},[]))),W(`recording-error`,F(A(function(e,t,n){var r=Og(n);t(kg,function(e){var t,i=e[r];return U(U({},e),(t={},t[r]=U(U({},i??{instanceId:r}),{error:!0,errorMsg:n.errorMsg,isLocalParticipantRecorded:!1,isRecording:!1}),t))})},[]))),W(`left-meeting`,F(A(function(e,t){t(kg,{})},[]))),P.createElement(P.Fragment,null,t)},Mg=function(){var e=ho(gg);return pt(e),e},Ng=N(null);Ng.debugLabel=G(`room-state`);var Pg=function(e){var t=e.children,n=oh(),r=Mg();return W(`access-state-updated`,F(A(function(e,t){return eh(void 0,void 0,void 0,function(){var e;return th(this,function(i){switch(i.label){case 0:return!n||r===`left-meeting`?[2]:[4,n.room()];case 1:return e=i.sent(),e&&`id`in e&&t(Ng,e),[2,e]}})})},[n,r]))),W(`left-meeting`,F(A(function(e,t){return function(){t(Ng,null)}},[]))),P.createElement(P.Fragment,null,t)},Fg=N({isTranscribing:!1,model:`general`,language:`en`,transcriptions:[]});Fg.debugLabel=G(`transcription-state`);var Ig=function(e){var t=e.children;return W(`transcription-started`,F(A(function(e,t,n){t(Fg,{error:!1,transcriptionStartDate:new Date,isTranscribing:!0,transcriptions:[],endpointing:n.endpointing,extra:n.extra,includeRawResponse:n.includeRawResponse,instanceId:n.instanceId,language:n.language,model:n.model,profanity_filter:n.profanity_filter,punctuate:n.punctuate,redact:n.redact,startedBy:n.startedBy,tier:n.tier})},[]))),W(`transcription-stopped`,F(A(function(e,t,n){t(Fg,function(e){return U(U({},e),{updatedBy:n.updatedBy,isTranscribing:!1})})},[]))),W(`transcription-error`,F(A(function(e,t){t(Fg,function(e){return U(U({},e),{error:!0,isTranscribing:!1})})},[]))),W(`left-meeting`,F(A(function(e,t){t(Fg,function(e){return U(U({},e),{isTranscribing:!1})})},[]))),W(`app-message`,F(A(function(e,t,n){n?.fromId===`transcription`&&t(Fg,function(e){return U(U({},e),{isTranscribing:!0,transcriptions:ih(ih([],rh(e.transcriptions),!1),[n.data],!1)})})},[]))),P.createElement(P.Fragment,null,t)},Lg=`0.25.2`,Rg={strictMode:!0},zg=function(){return!0},Bg={options:Rg,shouldCreateInstance:zg},Vg=function(e,t){var n=t===void 0?Bg:t,r=n.parentElRef,i=n.options,a=i===void 0?Rg:i,o=n.shouldCreateInstance,s=o===void 0?zg:o,c=rh(E(null),2),l=c[0],u=c[1],d=O();return D(function(){if(e===`callFrame`&&r?.current===null||!s())return;function t(e){return eh(this,void 0,void 0,function(){return th(this,function(t){switch(t.label){case 0:return[4,e.destroy()];case 1:return t.sent(),[2]}})})}var n=function(){setTimeout(function(){return u(null)},0)},i=wm.getCallInstance();if(!l&&i&&!i.isDestroyed()){i.once(`call-instance-destroyed`,n),u(i);return}if(l){fh(d.current,a)||t(l);return}if(!i||i.isDestroyed())try{var o=U(U({},a),{aboutClient:U(U({},a.aboutClient??{}),{"daily-react":Lg})});switch(e){case`callFrame`:i=r?.current?wm.createFrame(r.current,o):wm.createFrame(o);break;case`callObject`:i=wm.createCallObject(o);break}d.current=a,u(i),i.once(`call-instance-destroyed`,n)}catch(e){if(console.error(`Error creating call instance:`,e),a.strictMode)throw e}},[l,a,r,s,e]),l},Hg=function(e){return Vg(`callObject`,e)},Ug=function(e){var t=e.children,n=e.jotaiStore,r=$m(e,[`children`,`jotaiStore`]),i=O({}),a=A(function(e){var t,n;if(`action`in e){var r=e.action,a=Array.from(i.current?.[r]??[]),o=a.filter(function(e){return rh(e,1)[0]<0}),s=a.filter(function(e){return rh(e,1)[0]>0}),c=ih(ih([],rh(o),!1),rh(s),!1);try{for(var l=nh(c),u=l.next();!u.done;u=l.next()){var d=rh(u.value,2)[1];d(e)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}},[]),o=A(function(e){e&&Object.keys(i.current).forEach(function(t){e.off(t,a),e.isDestroyed()||e.on(t,a)})},[a]),s=`callObject`in r?r.callObject:null,c=Hg({options:k(function(){return`callObject`in r?{}:r},[r]),shouldCreateInstance:A(function(){return!(`callObject`in r)},[r])}),l=s??c;D(function(){l&&o(l)},[l,o]);var u=A(function(e,t,n){var r;i.current[e]||(i.current[e]=new Map,l&&(l.off(e,a),l.isDestroyed()||l.on(e,a))),i.current[e]?.has(n)||(r=i.current[e])==null||r.set(n,t)},[l,a]),d=A(function(e,t){var n;(n=i.current[e])==null||n.delete(t),i.current[e]?.size===0&&(l?.off(e,a),delete i.current[e])},[l,a]);return P.createElement(co,{store:n},P.createElement(ah.Provider,{value:l},P.createElement(sh.Provider,{value:{on:u,off:d}},P.createElement(Pg,null,P.createElement(bg,null,P.createElement(Dg,null,P.createElement(Hh,null,P.createElement(jg,null,P.createElement(hg,null,P.createElement(Ig,null,P.createElement(dg,null,t)))))))))))},Wg=function(e){var t=(e===void 0?{}:e).onAppMessage,n=oh(),r=A(function(e,t){t===void 0&&(t=`*`),n&&n.sendAppMessage(e,t)},[n]);return W(`app-message`,A(function(e){t?.(e,r)},[t,r])),r},Gg=function(e,t,n,r){var i=oh(),a=e===Uh();W(`local-audio-level`,A(function(e){a&&t(e.audioLevel)},[t,a])),W(`remote-participants-audio-level`,A(function(n){a||t(n.participantsAudioLevel[e])},[t,e,a])),D(function(){if(!(!i||i.isDestroyed()||!a)&&!i.isLocalAudioLevelObserverRunning())try{i.startLocalAudioLevelObserver(r)}catch{n?.(`Local audio level observer not supported in this browser`)}},[i,n,r,a]),D(function(){!i||i.isDestroyed()||a||i.isRemoteParticipantsAudioLevelObserverRunning()||i.startRemoteParticipantsAudioLevelObserver(r)},[i,r,a])},Kg=function(e){return $h(e,`audio`)},qg,Jg;function Yg(){return Jg?qg:(Jg=1,qg=function e(t,n){if(t===n)return!0;if(t&&n&&Qm(t)==`object`&&Qm(n)==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n},qg)}Yg();var Xg=N({state:`low`,reason:`none`});Xg.debugLabel=G(`cpu-load`);var Zg=function(){var e=oh(),t=ho(ag),n=ho(og),r=ho(sg),i=ho(cg),a=ho(lg),o=ho(ug),s=ft(ig).refreshDevices,c=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setInputDevicesAsync({audioDeviceId:null,videoDeviceId:t})];case 1:return n.sent(),[2]}})})},[e]),l=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setInputDevicesAsync({audioDeviceId:t,videoDeviceId:null})];case 1:return n.sent(),[2]}})})},[e]),u=A(function(t){return eh(void 0,void 0,void 0,function(){return th(this,function(n){switch(n.label){case 0:return[4,e?.setOutputDeviceAsync({outputDeviceId:t})];case 1:return n.sent(),[2]}})})},[e]),d=[`blocked`,`in-use`,`not-found`,`constraints-invalid`,`constraints-none-specified`,`undefined-mediadevices`,`unknown`],f={cameraError:o,cameras:r,camState:t,currentCam:r.find(function(e){return e.selected}),currentMic:i.find(function(e){return e.selected}),currentSpeaker:a.find(function(e){return e.selected}),hasCamError:d.includes(t),hasMicError:d.includes(n),microphones:i,micState:n,refreshDevices:s,setCamera:c,setMicrophone:l,setSpeaker:u,speakers:a};return pt(f),f},Qg=N(null);Qg.debugLabel=G(`input-settings`);var $g=N({hidden:0,present:0});$g.debugLabel=G(`participant-counts`);var e_=ca(function(e){var t=N({},function(t,n,r){n(e_(e),r)});return t.debugLabel=G(`participant-receive-settings-${e}`),t}),t_=function(e){return $h(e,`screenVideo`)},n_=N(null);n_.debugLabel=G(`send-settings`);var r_=function(e){return $h(e,`video`)};function i_({children:e}){return j(Ug,{children:e})}var a_=Fe(null),o_=`tavus:memory-user-id:`,s_=new Map;function c_(e){return`${o_}${e}`}function l_(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function u_(e){if(!e)return``;let t=c_(e);try{let e=window.localStorage.getItem(t);if(e)return e;let n=l_();return window.localStorage.setItem(t,n),n}catch{}let n=s_.get(t);if(n)return n;let r=l_();return s_.set(t,r),r}var d_=`tavus:terms-accepted:`;function f_(e){let t=5381;for(let n=0;n<e.length;n++)t=(t*33^e.charCodeAt(n))>>>0;return t.toString(36)}function p_(e,t){return`${d_}${e}:${f_(t)}`}function m_(e,t){if(!e||!t)return!1;try{return globalThis.localStorage?.getItem(p_(e,t))===`1`}catch{return!1}}function h_(e,t){if(!(!e||!t))try{globalThis.localStorage?.setItem(p_(e,t),`1`)}catch{}}var g_=null;function __(e,t){!e||!t||(g_={deploymentId:e,content:t})}function v_(){g_&&=(h_(g_.deploymentId,g_.content),null)}function y_(e){return e===`replica`||e===`user`?e:null}function b_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x_(e){if(!b_(e)||e.message_type!==`conversation`||typeof e.event_type!=`string`||!b_(e.properties))return null;if(e.event_type===`conversation.utterance`){let t=e.properties;return typeof t.speech==`string`?{kind:`chat-message`,sender:t.role===`replica`?`agent`:`user`,text:t.speech}:null}if(e.event_type===`conversation.utterance.streaming`){let t=e.properties;if(typeof t.speech!=`string`)return null;let n=t.final===!0||t.is_interrupted===!0;return{kind:`caption-update`,text:t.speech,final:n,role:y_(t.role)}}return null}function S_(e,t){return{message_type:`conversation`,event_type:`conversation.respond`,conversation_id:e,properties:{text:t}}}function C_(e,t){return typeof e[t]==`number`?{[t]:e[t]}:{}}function w_(e){let t=e.role===`user`||e.role===`replica`?e.role:null;return!t||typeof e.speech!=`string`?null:{kind:`utterance`,event_type:`conversation.utterance`,properties:{role:t,speech:e.speech,...C_(e,`seq`),...C_(e,`turn_idx`)}}}function T_(e){let t=e.role===`user`||e.role===`replica`?e.role:null;return!t||typeof e.speech!=`string`?null:{kind:`utterance.streaming`,event_type:`conversation.utterance.streaming`,properties:{role:t,speech:e.speech,...typeof e.final==`boolean`?{final:e.final}:{},...typeof e.is_interrupted==`boolean`?{is_interrupted:e.is_interrupted}:{},...C_(e,`seq`)}}}function E_(e){return typeof e.name!=`string`||typeof e.arguments!=`string`?null:{kind:`tool_call`,event_type:`conversation.tool_call`,properties:{name:e.name,arguments:e.arguments,...C_(e,`seq`),...C_(e,`turn_idx`)}}}function D_(e){if(typeof e.name!=`string`||typeof e.arguments!=`string`)return null;let t=e.modality===`vision`||e.modality===`audio`?e.modality:null;return t?{kind:`perception_tool_call`,event_type:`conversation.perception_tool_call`,properties:{name:e.name,arguments:e.arguments,modality:t}}:null}function O_(e){return{kind:`perception_analysis`,event_type:`conversation.perception_analysis`,properties:e}}function k_(e,t){return{kind:`speaking`,event_type:t,properties:{...C_(e,`seq`),...C_(e,`turn_idx`)}}}var A_={"conversation.utterance":w_,"conversation.utterance.streaming":T_,"conversation.tool_call":E_,"conversation.perception_tool_call":D_,"conversation.perception_analysis":O_,"conversation.replica_started_speaking":k_,"conversation.replica_stopped_speaking":k_,"conversation.user_started_speaking":k_,"conversation.user_stopped_speaking":k_};function j_(e){if(!b_(e)||e.message_type!==`conversation`||typeof e.event_type!=`string`||!b_(e.properties))return null;let t=A_[e.event_type];return t?t(e.properties,e.event_type):{kind:`unknown`,event_type:e.event_type,properties:e.properties}}function M_(e,t){return{message_type:`conversation`,event_type:t.event_type,conversation_id:e,properties:t.properties??{}}}function N_(e,t){let n=x_(e);return n?n.kind===`chat-message`?(t.appendChatMessage(n.sender,n.text),!0):(t.setCaption(n.text,n.final,n.role),!0):!1}function P_(e=5e3){let t=[],n=n=>{for(;t.length>0&&n-t[0].ts>e;)t.shift()};return{markSent(e){t.push({text:e,ts:Date.now()})},consumeMatch(e){n(Date.now());let r=t.findIndex(t=>t.text===e);return r===-1?!1:(t.splice(r,1),!0)}}}var F_=vn(`Conversation`),I_=1500,L_=Fe(null);function R_({children:e}){return j(i_,{children:j(G_,{children:e})})}function z_(e,t,n){let{role:r,speech:i}=e.properties;if(!(r===`user`&&n.consumeMatch(i)))for(let n of t)n.onUtterance?.({...e.properties})}function B_(e,t){for(let n of t)n.onToolCall?.({...e.properties})}function V_(e,t){for(let n of t)n.onPerception?.(e)}function H_(e,t){let n=e.event_type,r=n.startsWith(`conversation.replica`)?`replica`:`user`,i=n.endsWith(`started_speaking`)?`started`:`stopped`;for(let n of t)n.onSpeakingState?.({who:r,state:i,...e.properties})}function U_(e,t){for(let n of t)n.onMessage?.(e)}function W_(e,t,n){switch(e.kind){case`utterance`:case`utterance.streaming`:z_(e,t,n);return;case`tool_call`:B_(e,t);return;case`perception_tool_call`:case`perception_analysis`:V_(e,t);return;case`speaking`:H_(e,t);return;case`unknown`:U_(e,t);return}}function G_({children:e}){let{deploymentId:t,client:n,config:r}=ft(bi),{memoryStores:i}=ft(Ct),a=oh(),o=Mg(),s=ft(a_),c=k(()=>Ut(`idle`),[]),l=k(()=>Ut(null),[]),u=k(()=>Ut([]),[]),d=k(()=>Ut(``),[]),f=k(()=>Ut(null),[]),p=k(()=>Ut(null),[]),m=k(()=>Ut(null),[]),h=k(()=>Ut(null),[]),g=O(null),_=k(()=>P_(),[]),v=k(()=>new Set,[]),y=k(()=>Ut(`idle`),[]),b=s?.flowSignal??y,x=A(e=>{m.value=e},[m]),S=A(e=>{h.value=e},[h]),[,C]=E(o);D(()=>{C(o),o===`joined-meeting`?(c.value=`connected`,F_.info(`Connected to meeting`)):o===`left-meeting`?(c.value=`ended`,v_(),F_.info(`Left meeting`)):o===`error`&&(p.value=`Meeting error`,c.value=`error`)},[o,c,p]),_n(()=>{let e=c.value;if(e===`connected`)for(let e of v)e.onConnect?.();else if(e===`ended`||e===`disconnecting`)for(let e of v)e.onDisconnect?.();else if(e===`error`){let e=p.peek()??`Unknown error`;for(let t of v)t.onError?.({code:`CONVERSATION_ERROR`,message:e})}}),_n(()=>{let e=b.value;for(let t of v)t.onModeChange?.(e)}),Wg({onAppMessage:A(e=>{N_(e?.data,{appendChatMessage(e,t){e===`user`&&_.consumeMatch(t)||(u.value=[...u.peek(),{id:crypto.randomUUID(),sender:e,text:t,timestamp:Date.now()}])},setCaption(e,t,n){d.value=e,f.value=n,g.current!==null&&(clearTimeout(g.current),g.current=null),t&&(g.current=setTimeout(()=>{d.value=``,f.value=null,g.current=null},I_))}});let t=j_(e?.data);t&&W_(t,v,_)},[u,d,f,_,v])}),D(()=>()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);let w=A(async(e,o)=>{try{c.value=`connecting`,p.value=null;let s=e,u=m.peek();u&&s?.password==null&&(s={...s,password:u});let d=r.value.customization.conversation.unique_memory_tag===!0;if(!s?.memory_stores){let e=i??(d?[u_(t)]:[]);e.length&&(s={...s,memory_stores:e})}let f=h.peek();h.value=null,f&&s?.captcha_token==null&&(s={...s,captcha_token:f});let g=await Cn(n,t,s,o);l.value={conversationId:g.conversation_id,conversationName:g.conversation_name,conversationUrl:g.conversation_url,callbackUrl:g.callback_url,createdAt:g.created_at},await a?.join({url:g.conversation_url})}catch(e){throw e instanceof xn&&(e.status===401||e.status===403)&&r.value.has_password===!0&&(m.value=null),F_.error(`Start failed`,e),p.value=String(e),c.value=`error`,e}},[n,t,a,c,p,l,m,h,r,i]),ee=A(async()=>{let e=l.peek();c.value=`disconnecting`,e&&await wn(n,t,e.conversationId).catch(e=>F_.error(`End conversation API failed`,e)),await a?.leave(),c.value=`ended`},[n,t,a,c,l]),T=A(e=>{if(!a)return;let t=l.peek();if(!t){F_.warn(`sendChat called before session was established; dropping message`);return}_.markSent(e),a.sendAppMessage(S_(t.conversationId,e),`*`),u.value=[...u.peek(),{id:crypto.randomUUID(),sender:`user`,text:e,timestamp:Date.now()}]},[a,u,l,_]),te=A(e=>{if(!a){F_.warn(`sendMessage called before Daily was ready; dropping message`);return}let t=l.peek();if(!t){F_.warn(`sendMessage called before session was established; dropping message`);return}e.event_type===`conversation.respond`&&_.markSent(e.properties.text),a.sendAppMessage(M_(t.conversationId,e),`*`)},[a,l,_]),ne=A(e=>{v.add(e)},[v]),re=A(e=>{v.delete(e)},[v]),ie=k(()=>({state:c,session:l,chatMessages:u,captionText:d,captionRole:f,error:p,password:m,setPassword:x,captchaToken:h,setCaptchaToken:S,mode:b,start:w,end:ee,sendChat:T,sendMessage:te,conversation:{start:w,end:ee,sendMessage:te},__registerSubscriber:ne,__unregisterSubscriber:re}),[c,l,u,d,f,p,m,x,h,S,b,w,ee,T,te,ne,re]);return j(L_.Provider,{value:ie,children:e})}function K_(){let e=ft(bi);if(!e)throw Error(`useConfig must be used within ConfigProvider`);return e}var q_=new Set([`network`,`server`,`unavailable`,`busy`,`rate_limited`]);function J_(e){return e===401||e===403?`forbidden`:e===402?`limit_exceeded`:e===423?`busy`:e===429?`rate_limited`:e===409?`concurrency`:e===503?`unavailable`:e>=500?`server`:`unknown`}function Y_(e){if(!e)return;let t=e.get(`Retry-After`);if(!t)return;let n=Number.parseInt(t,10);if(!Number.isNaN(n)&&n>=0)return n;let r=Date.parse(t);if(!Number.isNaN(r)){let e=Math.floor((r-Date.now())/1e3);return e>0?e:0}}function X_(e){if(e instanceof xn){let t=J_(e.status);return{kind:t,status:e.status,raw:e.body,retryable:q_.has(t),retryAfterSec:Y_(e.headers)}}return e instanceof TypeError?{kind:`network`,raw:String(e),retryable:!0}:{kind:`unknown`,raw:String(e),retryable:!1}}function Z_(e){return e===`limit_exceeded`?`daily_limit`:e===`forbidden`||e===`concurrency`?null:`busy`}var Q_=`tavus_pudl_`,$_=3600*48,ev=new Map;function tv(){let e=new Date;return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,`0`)}${String(e.getUTCDate()).padStart(2,`0`)}`}function nv(e){return`${Q_}${e}`}function rv(e){try{let t=`${nv(e)}=`,n=document.cookie.split(`; `).find(e=>e.startsWith(t));if(!n)return 0;let[r,i]=decodeURIComponent(n.slice(t.length)).split(`.`);if(r!==tv())return 0;let a=Number.parseInt(i,10);return Number.isFinite(a)&&a>0?a:0}catch{return 0}}function iv(e,t){try{let n=encodeURIComponent(`${tv()}.${t}`);document.cookie=`${nv(e)}=${n}; max-age=${$_}; path=/; SameSite=Lax`}catch{return}}function av(e){let t=ev.get(e);return t||(t=Ut(e?rv(e):0),ev.set(e,t)),t}function ov(e){if(!e)return;iv(e,rv(e)+1);let t=rv(e),n=ev.get(e);n?n.value=t:ev.set(e,Ut(t))}var sv=new Set([`Captcha token required`,`Captcha verification failed`]);function cv(e){if(!(e instanceof xn)||e.status!==403)return!1;try{let t=JSON.parse(e.body.trim());return typeof t.error==`string`&&sv.has(t.error)}catch{return!1}}function lv(e,t){let n=e!==null,r=(t?.captchaToken.peek()??null)!==null,[i,a]=E(!n||r),[o,s]=E(0);D(()=>{n||a(!0)},[n]);let c=A(e=>{t?.setCaptchaToken(e),a(!0)},[t]),l=A(()=>{a(!0)},[]),u=t?.captchaToken.value??null,d=O(null);return D(()=>{let e=d.current!==null;d.current=u,n&&u===null&&(a(!1),e&&s(e=>e+1))},[n,u]),{captchaReady:i,captchaEpoch:o,handleCaptchaToken:c,handleCaptchaFallback:l}}function uv({children:e}){let{config:t}=K_(),{start:n}=ft(L_),r=t.value.deployment_id??``,i=av(r),a=A(()=>{let e=t.value,n=e.limits?.daily_call_limit_per_user;return n==null||e.channel!==`widget`&&e.channel!==`embed`?null:n},[t]),[o,s]=E(`idle`),[c,l]=E(!1),[u,d]=E(null),[f,p]=E(!1),m=k(()=>Ut(`idle`),[]);D(()=>{m.value=o},[o,m]),_n(()=>{let e=t.value,n=e.limits?.daily_call_limit_per_user;n!=null&&(e.channel!==`widget`&&e.channel!==`embed`||m.value===`idle`&&i.value>=n&&(d(`daily_limit`),p(!1),s(`unavailable`)))});let h=t.value.customization.show_haircheck,g=t.value.customization.conversation.modality,_=h&&g!==`chat`,v=O(!1),y=O(!1),b=A(async()=>{l(!0);try{await n(),v.current=!1,a()!=null&&ov(r),s(`call`)}catch(e){let n=X_(e);if(cv(e)&&!v.current){v.current=!0,l(!1),s(`idle`);return}if(v.current=!1,n.kind===`forbidden`&&t.value.has_password===!0){s(`idle`);return}d(Z_(n.kind)??`busy`),p(n.retryable),s(`unavailable`)}finally{l(!1)}},[n,t,a,r]),x=A(async()=>{if(o!==`idle`&&o!==`unavailable`)return;let e=a();if(e!=null&&i.value>=e){d(`daily_limit`),p(!1),s(`unavailable`);return}if(d(null),p(!1),_&&!y.current){s(`haircheck`);return}return b()},[o,_,b,a,i]),S=A(async()=>{o===`haircheck`&&(y.current=!0,await b())},[o,b]),C=A(()=>{o===`haircheck`&&s(`idle`)},[o]),w=A(()=>{o===`call`&&s(`ended`)},[o]),ee=A(()=>{d(null),p(!1),s(`idle`)},[]),T=k(()=>({flowSignal:m,setFlowState:s,isStarting:c,unavailableCause:u,canRetry:f,start:x,join:S,cancel:C,leave:w,restart:ee}),[m,c,u,f,x,S,C,w,ee]);return j(a_.Provider,{value:T,children:e})}var dv=vn(`HostBridge`),fv=Fe(null);function pv(e){if(!e)return null;let t=e.getRootNode();return t instanceof ShadowRoot&&t.host instanceof HTMLElement?t.host:e.parentElement}function mv({children:e}){let t=ft(L_),n=ft(a_),r=un(null),i=A(e=>{r.value=pv(e)},[r]),a=A((e,t)=>{let n=r.peek();n&&n.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0})),dv.info(`Event:`,e,t)},[r]);D(()=>{let e=r.value;if(e)return e.tavus={start:t.start,end:t.end,sendChat:t.sendChat,sendMessage:t.sendMessage},()=>{delete e.tavus}},[r.value,t]),D(()=>t.state.subscribe(e=>{switch(e){case`connected`:a(`tavus:conversation-started`,{conversationId:t.session.peek()?.conversationId??``}),a(`tavus:state-change`,{state:e});break;case`ended`:a(`tavus:conversation-ended`,{conversationId:t.session.peek()?.conversationId??``}),a(`tavus:state-change`,{state:e});break;case`error`:a(`tavus:error`,{code:`CONVERSATION_ERROR`,message:t.error.peek()??`Unknown error`}),a(`tavus:state-change`,{state:e});break;default:a(`tavus:state-change`,{state:e})}}),[t,a]),_n(()=>{if(!n)return;let e=n.flowSignal.value;a(`tavus:mode-change`,{mode:e})}),D(()=>{let e={onUtterance(e){a(`tavus:protocol-message`,{kind:`utterance`,event_type:`conversation.utterance`,properties:e})},onToolCall(e){a(`tavus:tool-call`,e),a(`tavus:protocol-message`,{kind:`tool_call`,event_type:`conversation.tool_call`,properties:e})},onPerception(e){a(`tavus:protocol-message`,e)},onSpeakingState({who:e,state:t,seq:n,turn_idx:r}){let i={state:t,...n===void 0?{}:{seq:n},...r===void 0?{}:{turn_idx:r}};a(`tavus:protocol-message`,{kind:`speaking`,event_type:e===`replica`?t===`started`?`conversation.replica_started_speaking`:`conversation.replica_stopped_speaking`:t===`started`?`conversation.user_started_speaking`:`conversation.user_stopped_speaking`,properties:i})},onMessage(e){a(`tavus:protocol-message`,e)}};return t.__registerSubscriber(e),()=>t.__unregisterSubscriber(e)},[t,a]);let o=k(()=>({shadowHost:r,dispatchEvent:a}),[r,a]);return j(fv.Provider,{value:o,children:[j(`div`,{ref:i,style:`display:contents`}),e]})}var hv=Fe(null);function gv({children:e}){let{config:t}=ft(bi),n=k(()=>Jt(()=>{let e=t.value.customization.style;return e.mode===`dark`||e.mode===`system`&&(globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1)}),[t]),r=k(()=>Jt(()=>{let e=t.value.customization.style;return e.style===`basic`?n.value?`white-black`:`black-white`:n.value?`${e.style}-dark`:e.style}),[t,n]),i=k(()=>Jt(()=>bv(t.value.customization.style)),[t]),a=k(()=>({dataTheme:r,isDark:n,cssVars:i}),[r,n,i]);return j(hv.Provider,{value:a,children:j(`div`,{"data-theme":r.value,style:xv(i.value),class:`contents`,children:e})})}var _v=[0,.125,.25,.5,.75],vv=[0,1,2,3,4],yv=[0,.2,.25,.3];function bv(e){return{"--radius-box":`${_v[e.boxes_radius]??.5}rem`,"--radius-field":`${_v[e.field_radius]??.25}rem`,"--radius-selector":`${_v[e.selectors_radius]??.5}rem`,"--border":`${vv[e.border_width]??1}px`,"--size-field":`${yv[e.fields_size]??.25}rem`,"--size-selector":`${yv[e.selectors_size]??.25}rem`,"--depth":e.depth_effect?`1`:`0`,"--noise":e.noise_effect?`1`:`0`}}function xv(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function Sv(e,t){D(()=>{let n=e.current;if(!n)return;let r=new ResizeObserver(e=>{let n=e[0];n&&t(n)});return r.observe(n),()=>r.disconnect()},[e,t])}var Cv=Fe(null),wv=480,Tv=768;function Ev({children:e}){let t=O(null),n=k(()=>Ut(`full`),[]);Sv(t,A(e=>{let t=e.contentRect.width;t<wv?n.value=`compact`:t<Tv?n.value=`medium`:n.value=`full`},[n]));let r=k(()=>({layoutMode:n,containerRef:t}),[n,t]);return j(Cv.Provider,{value:r,children:j(`div`,{ref:t,class:`w-full h-full`,children:e})})}var Dv=`@container/conversation w-full h-full`,Ov=`motion-safe:animate-[tavusFadeUp_280ms_ease-out]`,kv=`relative w-full h-full max-h-screen aspect-video @max-mobile:aspect-9/16 overflow-hidden rounded-box`;function Av({animate:e=!1,innerClassName:t,innerStyle:n,innerRef:r,role:i,"aria-live":a,"aria-label":o,children:s}){return j(`div`,{class:e?`${Dv} ${Ov}`:Dv,children:j(`div`,{ref:r,class:t?`${kv} ${t}`:kv,style:n,role:i,"aria-live":a,"aria-label":o,children:s})})}var jv=41/2,Mv=23/2,Nv=Math.hypot(jv,Mv),Pv=Array.from({length:1008},(e,t)=>{let n=t%42,r=Math.floor(t/42),i=Math.hypot(n-jv,r-Mv)/Nv*.82,a=.34+(n*13+r*7)%34/100;return{delay:`${i.toFixed(3)}s`,opacity:a.toFixed(2)}});function Fv(){return j(Av,{innerClassName:`embed-loading-screen`,role:`status`,"aria-live":`polite`,"aria-label":`Loading deployment`,children:j(`div`,{class:`embed-loading-dot-field`,"aria-hidden":`true`,style:{"--dot-columns":`42`,"--dot-rows":`24`},children:Pv.map((e,t)=>j(`span`,{class:`embed-loading-field-dot`,style:{"--dot-delay":e.delay,"--dot-opacity":e.opacity}},t))})})}var Iv=Fe(null);function Lv({children:e}){let t=O(null);return j(Iv.Provider,{value:{frameRef:t},children:j(`div`,{class:`@container/conversation w-full h-full`,children:j(`div`,{ref:t,class:`relative w-full h-full max-h-screen aspect-video @max-mobile:aspect-9/16 overflow-hidden rounded-box bg-base-100`,children:e})})})}var Rv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),zv=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Bv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vv=e=>{let t=Bv(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hv={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Uv=Fe({size:24,color:`currentColor`,strokeWidth:2,absoluteStrokeWidth:!1,class:``}),Wv=()=>ft(Uv),Gv=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Kv=({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,children:i,iconNode:a,class:o=``,...s})=>{let{size:c=24,strokeWidth:l=2,absoluteStrokeWidth:u=!1,color:d=`currentColor`,class:f=``}=Wv()??{},p=r??u?Number(n??l)*24/Number(t??c):n??l;return oe(`svg`,{...Hv,width:t??c??24,height:t??c??24,stroke:e??d,"stroke-width":p,class:Rv(`lucide`,f,o),...!i&&!Gv(s)&&{"aria-hidden":`true`},...s},[...a.map(([e,t])=>oe(e,t)),...ye(i)])},qv=(e,t)=>{let n=({class:n=``,className:r=``,children:i,...a})=>oe(Kv,{...a,iconNode:t,class:Rv(`lucide-${zv(Vv(e))}`,`lucide-${zv(e)}`,n,r)},i);return n.displayName=Vv(e),n},Jv=qv(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),Yv=qv(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Xv=qv(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Zv=qv(`camera-off`,[[`path`,{d:`M14.564 14.558a3 3 0 1 1-4.122-4.121`,key:`1rnrzw`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175`,key:`1x3arw`}],[`path`,{d:`M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344`,key:`1i84u0`}]]),Qv=qv(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),$v=qv(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ey=qv(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ty=qv(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ny=qv(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ry=qv(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),iy=qv(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),ay=qv(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),oy=qv(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),sy=qv(`monitor-up`,[[`path`,{d:`m9 10 3-3 3 3`,key:`11gsxs`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),cy=qv(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ly=qv(`phone-off`,[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]),uy=qv(`picture-in-picture-2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),dy=qv(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),fy=qv(`shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),py=qv(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),my=qv(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),hy=qv(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),gy=qv(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function _y(e,t){return({size:n=`var(--icon-size, 1.5rem)`,class:r,"aria-label":i})=>j(`span`,{class:r,role:`img`,"aria-label":i??t,children:j(e,{size:n})})}var vy={close:_y(gy,`Close`),leave:_y(ly,`Leave call`),more:_y(Yv,`More`),error:_y(Xv,`Error`),mic:_y(ay,`Microphone`),"mic-off":_y(iy,`Microphone muted`),cam:_y(Qv,`Camera`),"cam-off":_y(Zv,`Camera off`),"screen-share":_y(sy,`Screen share`),pip:_y(uy,`Picture in picture`),user:_y(my,`User`),"face-smile":_y(py,`Camera off`),captions:_y(Jv,`Closed captions`),chat:_y(ry,`Chat`),fullscreen:_y(ny,`Enter fullscreen`),"fullscreen-exit":_y(oy,`Exit fullscreen`),expand:_y(ey,`Expand`),collapse:_y(fy,`Collapse`),send:_y(dy,`Send`),"external-link":_y(ty,`External link`),clock:_y($v,`Clock`),moon:_y(cy,`Unavailable`),users:_y(hy,`Busy`)},yy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M16 19H4v-2h12v2ZM4 17H2V7h2v10Zm14-8h2V7h2v10h-2v-2h-2v2h-2V7h2v2Zm-2-2H4V5h12v2Z"/></svg>`,by=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 21h-2v-2h2v2Zm-6-2H4v-2h10v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h-2v-2h-2v-2h-2V7h2v2h2V7h2V5h2v14ZM4 17H2V7h2v10Zm12 0h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2H8V9h2v2ZM8 9H6V7h2v2ZM6 7H4V5h2v2Zm8 0h-4V5h4v2ZM4 5H2V3h2v2Z"/></svg>`,xy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 10h2v4H5zm8 0h2v4h-2zM7 8h4v2H7zm0 6h4v2H7zm8 0h4v2h-4zm0-6h4v2h-4z"/></svg>`,Sy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M22 22h-2v-2h-2v-2h2v-8h2v12Zm-4-4h-8v-2h8v2ZM4 12h2v2H4v2H2V4h2v8Zm6 4H8v-6h2v6Zm10-6H10V8h10v2Zm-4-4h-2V4h2v2Zm-2-2H4V2h10v2Z"/></svg>`,Cy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4v-2h2v2Zm14 0h-2v-2h2v2ZM4 18H2V6h2v12Zm18 0h-2V6h2v12Zm-5-1h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-2-2h-2V6h2v7ZM6 6H4V4h2v2Zm14 0h-2V4h2v2Zm-2-2H6V2h12v2Z"/></svg>`,wy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4v-2h2v2Zm14 0h-2v-2h2v2ZM4 18H2V6h2v12Zm4 0H6v-2h2v2Zm14 0h-2V6h2v12Zm-12-2H8v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V8h2v2Zm2-2h-2V6h2v2ZM6 6H4V4h2v2Zm14 0h-2V4h2v2Zm-2-2H6V2h12v2Z"/></svg>`,Ty=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M7 19h2v-2h2v-2h2v2h2v2h2v2H7v-2Zm13-6H4v-2h16v2Zm-3-8h-2v2h-2v2h-2V7H9V5H7V3h10v2Z"/></svg>`,Ey=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 22H4v-2h16v2ZM4 20H2V4h2v16Zm18 0h-2V4h2v16Zm-9-2h-2v-2h2v2Zm0-4h-2V6h2v8Zm7-10H4V2h16v2Z"/></svg>`,Dy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M15 19h-2v2h-2v-2H9v-2H7v-2h10v2h-2v2Zm5-6H4v-2h16v2Zm-7-8h2v2h2v2H7V7h2V5h2V3h2v2Z"/></svg>`,Oy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M8 22H4v-2h4v2Zm12 0h-4v-2h4v2ZM4 20H2v-4h2v4Zm18 0h-2v-4h2v4Zm-6-3H8v-2h8v2Zm-8-2H6V9h2v6Zm10 0h-2V9h2v6Zm-2-6H8V7h8v2ZM4 8H2V4h2v4Zm18 0h-2V4h2v4ZM8 4H4V2h4v2Zm12 0h-4V2h4v2Z"/></svg>`,ky=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H6v-2h12v2ZM6 20H4V4h2v16Zm14 0h-2v-3h2v3ZM16 9h2v2h2v2h-2v2h-2v2h-2v-4H8v-2h6V7h2v2Zm4-2h-2V4h2v3Zm-2-3H6V2h12v2Z"/></svg>`,Ay=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M13 22h-2v-2H8v-2h8v2h-3v2Zm-5-4H6v-2h2v2Zm10 0h-2v-2h2v2ZM6 16H4v-6h2v6Zm8 0h-4v-2h4v2Zm6 0h-2v-6h2v6Zm-10-2H8V4h2v10Zm6 0h-2V4h2v10ZM14 4h-4V2h4v2Z"/></svg>`,jy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M13 22h-2v-2H8v-2h8v2h-3v2Zm9 0h-2v-2h2v2Zm-2-2h-2v-2h2v2ZM8 18H6v-2h2v2Zm10 0h-2v-2h2v2ZM6 16H4v-6h2v6Zm8-2h2v2h-6v-2h2v-2h2v2Zm-4-4h2v2h-2v2H8V8h2v2Zm10 4h-2v-4h2v4Zm-4-4h-2V4h2v6ZM8 8H6V6h2v2ZM6 6H4V4h2v2ZM4 4H2V2h2v2Zm10 0h-4V2h4v2Z"/></svg>`,My=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M18 22H8v-2h10v2ZM8 20H6v-2h2v2Zm12 0h-2v-2h2v2ZM6 18H4v-2h2v2Zm16 0h-2v-4h-2v-2h2v-2h2v8ZM4 16H2V6h2v10Zm14 0h-6v-2h6v2Zm-6-2h-2v-2h2v2Zm-2-2H8V6h2v6ZM6 6H4V4h2v2Zm8-2h-2v2h-2V4H6V2h8v2Z"/></svg>`,Ny=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M5 15H3v-2h2v2Zm8 0h-2v-2h2v2Zm8 0h-2v-2h2v2ZM3 13H1v-2h2v2Zm4 0H5v-2h2v2Zm4 0H9v-2h2v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h2v2Zm4 0h-2v-2h2v2ZM5 11H3V9h2v2Zm8 0h-2V9h2v2Zm8 0h-2V9h2v2Z"/></svg>`,Py=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 20H4v-2h16v2ZM4 18H2V6h2v12Zm18 0h-2V6h2v12ZM18 8v6h-8V8h8Zm2-2H4V4h16v2Zm-4 4h-4v2h4v-2Z"/></svg>`,Fy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 18h-7v2h3v2H8v-2h3v-2H4v-2h16v2ZM4 16H2V4h2v12Zm18 0h-2v-6h2v6Zm-6-6h-2V8h2v2Zm2-2h-2V6h2v2Zm4-6v6h-2V6h-2V4h-2V2h6Zm-8 2H4V2h10v2Z"/></svg>`,Iy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M4 19h4v2H2v-8h2v6Zm8 0H8v-2h4v2Zm4-2h-4v-2h4v2Zm4-2h-4v-2h4v2Zm-10-2H4v-2h6v2Zm12 0h-2v-2h2v2ZM8 5H4v6H2V3h6v2Zm12 6h-4V9h4v2Zm-4-2h-4V7h4v2Zm-4-2H8V5h4v2Z"/></svg>`,Ly=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M6 22H4v-4h2v4Zm14 0h-2v-4h2v4ZM8 18H6v-2h2v2Zm10 0h-2v-2h2v2Zm-2-2H8v-2h8v2Zm-1-4H9v-2h6v2Zm-6-2H7V4h2v6Zm8 0h-2V4h2v6Zm-2-6H9V2h6v2Z"/></svg>`,Ry=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M2 22H0v-4h2v4Zm14 0h-2v-4h2v4Zm8 0h-2v-4h2v4ZM4 18H2v-2h2v2Zm10 0h-2v-2h2v2Zm8 0h-2v-2h2v2Zm-10-2H4v-2h8v2Zm8 0h-4v-2h4v2Zm-9-4H5v-2h6v2Zm8 0h-4v-2h4v2ZM5 10H3V4h2v6Zm8 0h-2V4h2v6Zm8 0h-2V4h2v6ZM11 4H5V2h6v2Zm8 0h-4V2h4v2Z"/></svg>`,zy=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M20 22H4v-2h16v2ZM4 20H2v-6H0v-2h2V8h2v12Zm18-8h2v2h-2v6h-2V8h2v4Zm-8 6h-4v-2h4v2Zm-4-2H8v-2h2v2Zm6 0h-2v-2h2v2Zm-6-4H8v-2h2v2Zm6 0h-2v-2h2v2Zm-3-6h7v2H4V6h7V4h2v2Zm4-2h-4V2h4v2Z"/></svg>`,By=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M17 21H5v-2h12v2ZM5 19H3V7h2v12Zm14 0h-2v-6h2v6Zm-8-4H9v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V9h2v2Zm6 0h-2V7h-2V5h-4V3h8v8Zm-4-2h-2V7h2v2Zm-6-2H5V5h6v2Z"/></svg>`;function Vy(e){return e.replace(/\s(width|height)="\d+"/g,``)}function Hy(e,t){let n=Vy(e);return({size:e=`var(--icon-size, 1.5rem)`,class:r,"aria-label":i})=>j(`span`,{class:r,role:`img`,"aria-label":i??t,style:{display:`inline-flex`,width:e,height:e},dangerouslySetInnerHTML:{__html:n.replace(`<svg`,`<svg width="100%" height="100%"`)}})}var Uy={pixelarticons:{close:Hy(wy,`Close`),leave:Hy(ky,`Leave call`),more:Hy(Ny,`More`),error:Hy(Ey,`Error`),mic:Hy(Ay,`Microphone`),"mic-off":Hy(jy,`Microphone muted`),cam:Hy(yy,`Camera`),"cam-off":Hy(by,`Camera off`),"screen-share":Hy(Fy,`Screen share`),pip:Hy(Py,`Picture in picture`),user:Hy(Ly,`User`),"face-smile":Hy(zy,`Camera off`),captions:Hy(xy,`Closed captions`),chat:Hy(Sy,`Chat`),fullscreen:Hy(Oy,`Enter fullscreen`),"fullscreen-exit":Hy(Ty,`Exit fullscreen`),expand:Hy(Dy,`Expand`),collapse:Hy(Ty,`Collapse`),send:Hy(Iy,`Send`),"external-link":Hy(By,`External link`),clock:Hy(Cy,`Clock`),moon:Hy(My,`Unavailable`),users:Hy(Ry,`Busy`)},lucide:vy};function Wy({name:e,...t}){let{config:n}=K_(),r=(Uy[n.value.customization.style.icon_library]??Uy.pixelarticons)[e];return j(r,{...t})}var Gy=`Ready when you are`,Ky=`Start the conversation`;function qy(e){return typeof e==`string`&&e.length>0?e:``}function Jy(e){let t=qy(e.replica_thumbnail_image_url);if(t)return{url:t,kind:`image`};let n=qy(e.replica_thumbnail_video_url);return n?{url:n,kind:`video`}:null}function Yy(e){let{preview:t}=e.customization,{background:n}=t,r=Jy(e),i;i=n.type?n.type:r?`replica`:`background-gradient`;let a=qy(n.url);return{title:t.title||Gy,description:t.description||``,btn_title:t.btn_title||Ky,background:{type:i,url:a}}}var Xy={backgroundImage:`linear-gradient(to bottom right, var(--color-primary), var(--color-base-300))`};function Zy({variant:e,replica:t}){let[n,r]=E(!1);return D(()=>{r(!1)},[e.url]),e.type===`replica`&&t?t.kind===`image`?j(`img`,{class:`absolute inset-0 w-full h-full object-cover`,src:t.url,loading:`lazy`,alt:``}):j(`video`,{class:`absolute inset-0 w-full h-full object-cover`,src:t.url,muted:!0,autoplay:!0,loop:!0,playsinline:!0}):e.type===`custom-image`&&e.url&&!n?j(`img`,{class:`absolute inset-0 w-full h-full object-cover`,src:e.url,loading:`lazy`,alt:``,onError:()=>r(!0)}):j(`div`,{class:`absolute inset-0`,style:Xy})}function Qy({className:e=``}){let{config:t}=K_(),n=Yy(t.value),r=Jy(t.value);return j(`div`,{class:`relative size-16 shrink-0 rounded-box overflow-hidden bg-base-300 ${e}`,children:j(Zy,{variant:n.background,replica:r})})}var $y=`absolute inset-0 bg-base-100 text-base-content flex flex-col items-center justify-center gap-6 px-6 py-8 text-center overflow-y-auto motion-safe:animate-[tavusFadeUp_280ms_ease-out]`;function eb({children:e,class:t,role:n,"aria-live":r}){return j(`div`,{class:t?`${$y} ${t}`:$y,role:n,"aria-live":r,children:e})}function tb({title:e,description:t,media:n,children:r,overlay:i}){return j(eb,{children:[n===void 0?j(Qy,{}):n,(e||t)&&j(`div`,{class:`flex flex-col items-center gap-3 max-w-sm`,children:[e&&j(`h2`,{class:`text-lg font-medium leading-snug`,children:e}),t&&j(`p`,{class:`text-base text-base-content/60 tracking-wide leading-snug`,children:t})]}),r&&j(`div`,{class:`flex flex-col items-center gap-3`,children:r}),i]})}var nb={daily_limit:{title:`PAL is at today's limit`,description:`This PAL can take more conversations tomorrow.`},total_limit:{title:`PAL is unavailable`,description:`This PAL isn't available right now. Please check back later.`},busy:{title:`PAL is in another conversation`,description:`Please try again in a moment.`},error:{title:`Couldn't load this PAL`,description:`This PAL couldn't be loaded. Please try again later.`}};function rb(e,t){let n=t?.[e];return{title:n?.title||nb[e].title,description:n?.description||nb[e].description}}var ib={daily_limit:`clock`,total_limit:`moon`,busy:`users`,error:`error`};function ab({cause:e}){return j(`div`,{class:`flex size-16 shrink-0 items-center justify-center rounded-box bg-base-200 text-base-content/70`,children:j(Wy,{name:ib[e],size:`2rem`})})}function ob({cause:e,canRetry:t,onRetry:n,onCancel:r}){let{config:i}=K_(),a=i.value.customization?.unavailable_screen,o=rb(e,a),s=a?.cta??[],c=e===`busy`||s.length>0||!!r;return j(tb,{media:j(ab,{cause:e}),title:o.title,description:o.description,children:c&&j(`div`,{class:`flex flex-wrap items-center justify-center gap-2`,children:[e===`busy`&&j(`button`,{type:`button`,class:`btn btn-neutral rounded-box`,disabled:!t,onClick:n,children:`Try again`}),s.map(e=>j(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`btn btn-outline rounded-box`,children:e.title},e.url)),r&&j(`button`,{type:`button`,class:`btn btn-ghost`,onClick:r,children:`Close`})]})})}function sb(){let e=ft(a_);return{state:e.flowSignal.value,isStarting:e.isStarting,unavailableCause:e.unavailableCause,canRetry:e.canRetry,start:e.start,join:e.join,cancel:e.cancel,leave:e.leave,restart:e.restart}}var cb={start_button:`Start the conversation`,ready_to_start:``};function lb(){let{config:e}=K_(),{preview:t}=e.value.customization;return k(()=>({start_button:t.btn_title??cb.start_button,ready_to_start:t.description??cb.ready_to_start}),[t])}var ub=`Thanks for joining`,db=`You can start a new conversation whenever you're ready.`,fb=`Start a new conversation`;function pb(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`||t.protocol===`mailto:`}catch{return!1}}function mb({text:e,onRestart:t}){let{config:n}=K_(),r=n.value.customization.after_call,i=r.cta.filter(e=>pb(e.url));return j(tb,{title:r.title||e?.title||ub,description:r.description||e?.description||db,children:[j(`button`,{type:`button`,class:`btn btn-neutral rounded-box`,onClick:t,children:e?.restart||fb}),i.length>0&&j(`div`,{class:`flex flex-wrap items-center justify-center gap-2`,children:i.map(e=>j(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`btn btn-outline rounded-box`,children:e.title},e.url))})]})}function hb(){let e=oh(),t=Uh(),{isOff:n}=r_(t),{camState:r}=Zg();return{isCamReady:k(()=>r===`granted`,[r]),isCamMuted:n,localSessionId:t,onToggleCamera:A(()=>{e?.setLocalVideo(n)},[e,n])}}function gb(){let e=oh(),t=Uh(),{isOff:n}=Kg(t),{micState:r}=Zg();return{isMicReady:k(()=>r===`granted`,[r]),isMicMuted:n,localSessionId:t,onToggleMicrophone:A(()=>{e?.setLocalAudio(n)},[e,n])}}function _b(){let e=oh(),t=Uh(),{isOff:n}=t_(t),r=!n;return{isScreenSharing:r,localSessionId:t,onToggleScreenshare:A(()=>{r?e?.stopScreenShare():e?.startScreenShare({displayMediaOptions:{audio:!1,selfBrowserSurface:`exclude`,surfaceSwitching:`include`,video:{width:1920,height:1080}}})},[e,r])}}function vb(e){switch(e){case`blocked`:return`blocked`;case`in-use`:return`in-use`;case`not-found`:return`not-found`;case`not-supported`:case`undefined-mediadevices`:return`unsupported`;default:return null}}function yb(e,t,n,r){return e===`granted`&&r?`granted`:vb(e)||(t===`denied`?`blocked`:t===`prompt`?`prompt`:t===`granted`?n?`checking`:`prompt`:e===`granted`?`granted`:n?`checking`:`prompt`)}function bb(e,t){let n=e===`granted`,r=e===`blocked`||e===`in-use`||e===`not-found`||e===`unsupported`;return{status:e,isGranted:n,isBlocked:r,canRequest:e===`prompt`,needsAttention:r||e===`prompt`&&t!==`granted`}}function xb(e){let[t,n]=E(null);return D(()=>{let t=!1,r=navigator.permissions;if(r?.query)return r.query({name:e}).then(e=>{t||(n(e.state),e.onchange=()=>{t||n(e.state)})}).catch(()=>{}),()=>{t=!0}},[e]),t}function Sb(){let e=oh(),t=Mg(),n=Uh(),{micState:r,camState:i,currentMic:a,currentCam:o}=Zg(),s=xb(`microphone`),c=xb(`camera`),l=t===`joined-meeting`||!!n,[u,d]=E(!1),[f,p]=E(!1),m=A(()=>{e&&(d(!0),l?e.setLocalAudio(!0):Promise.resolve(e.startCamera({videoSource:!1})).catch(()=>{}))},[e,l]),h=A(async()=>{if(e){p(!0);try{await e.setInputDevicesAsync({videoSource:!0})}catch{}e.setLocalVideo(!0)}},[e]);return{mic:k(()=>bb(yb(r,s,u,!!a),s),[r,s,u,a]),camera:k(()=>bb(yb(i,c,f,!!o),c),[i,c,f,o]),requestMic:m,requestCamera:h}}var Cb={microphone:`microphone`,camera:`camera`};function wb({class:e}){return j(`svg`,{class:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[j(`circle`,{cx:`7`,cy:`8`,r:`2.2`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`16`,cy:`16`,r:`2.2`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`path`,{d:`M2 8h2.5M9.5 8H22M2 16h11.5M18.5 16H22`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})]})}function Tb(){return j(`svg`,{viewBox:`0 0 240 180`,class:`w-full h-auto text-base-content/70`,fill:`none`,"aria-hidden":`true`,children:[j(`rect`,{x:`10`,y:`20`,width:`220`,height:`150`,rx:`10`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M10 46h220`,stroke:`currentColor`,"stroke-width":`2`}),j(`circle`,{cx:`26`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`40`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{cx:`54`,cy:`33`,r:`3.5`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`path`,{d:`M78 33h14M86 27l-6 6 6 6M104 27v12`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),j(`rect`,{x:`118`,y:`25`,width:`96`,height:`16`,rx:`8`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`circle`,{class:`text-info`,cx:`128`,cy:`33`,r:`11`,fill:`currentColor`,opacity:`0.18`}),j(`circle`,{class:`text-info`,cx:`128`,cy:`33`,r:`11`,stroke:`currentColor`,"stroke-width":`1.6`}),j(`g`,{class:`text-info`,transform:`translate(120 25) scale(0.66)`,children:j(wb,{})}),j(`g`,{transform:`translate(34 78)`,children:[j(`rect`,{x:`0`,y:`8`,width:`34`,height:`26`,rx:`5`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M34 16l14-8v26l-14-8`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linejoin":`round`})]}),j(`g`,{transform:`translate(40 120)`,children:[j(`rect`,{x:`6`,y:`0`,width:`14`,height:`24`,rx:`7`,stroke:`currentColor`,"stroke-width":`2`}),j(`path`,{d:`M0 20a13 13 0 0 0 26 0M13 33v8`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})]}),j(`path`,{d:`M150 64l34 14-14 4-2 16-18-34Z`,fill:`currentColor`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linejoin":`round`})]})}var Eb=ba(({device:e,onClose:t})=>{let n=Cb[e];return D(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),j(`div`,{class:`absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/50 motion-safe:animate-[tavusFadeUp_180ms_ease-out]`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tavus-blocked-title`,onClick:t,children:j(`div`,{class:`relative w-full max-w-md rounded-box bg-base-100 text-base-content shadow-xl overflow-hidden`,onClick:e=>e.stopPropagation(),children:[j(`button`,{type:`button`,class:`btn btn-sm btn-circle btn-ghost absolute top-2 right-2 z-10`,onClick:t,"aria-label":`Close`,children:j(Wy,{name:`close`,size:`1.1rem`})}),j(`div`,{class:`grid @3xl:grid-cols-[1fr_1.2fr] gap-4 p-5 @max-md:p-4`,children:[j(`div`,{class:`flex items-center justify-center @max-md:hidden`,children:j(Tb,{})}),j(`div`,{class:`flex flex-col gap-4`,children:[j(`h2`,{id:`tavus-blocked-title`,class:`text-lg font-semibold leading-snug pr-6`,children:[`Access to your `,n,` is blocked`]}),j(`ol`,{class:`flex flex-col gap-3 text-sm`,children:[j(`li`,{class:`flex items-start gap-2`,children:[j(`span`,{class:`font-semibold tabular-nums`,children:`1.`}),j(`span`,{class:`leading-snug`,children:[`Click the `,j(wb,{class:`inline-block align-text-bottom h-4 w-4 mx-0.5`}),` `,`settings icon in your browser's address bar`]})]}),j(`li`,{class:`flex items-start gap-2`,children:[j(`span`,{class:`font-semibold tabular-nums`,children:`2.`}),j(`span`,{class:`leading-snug`,children:[`Allow `,n,` access, then reload the page`]})]})]}),j(`button`,{type:`button`,class:`btn btn-neutral btn-sm self-start`,onClick:t,children:`Got it`})]})]})]})})}),Db=Fe({open:()=>{},close:()=>{}});function Ob(){return ft(Db)}function kb({children:e}){let[t,n]=E(null),r=A(e=>n(e),[]),i=A(()=>n(null),[]),a=k(()=>({open:r,close:i}),[r,i]);return j(Db.Provider,{value:a,children:[e,t&&j(Eb,{device:t,onClose:i})]})}var Ab=ba(()=>j(`span`,{"aria-hidden":`true`,class:`absolute -top-0.5 -right-0.5 z-20 flex h-4 w-4 items-center justify-center rounded-full bg-warning text-warning-content text-[0.6rem] font-bold leading-none ring-2 ring-base-100 pointer-events-none`,children:`!`})),jb=`select-control-pill relative inline-flex items-center bg-neutral text-neutral-content`,Mb=`absolute inset-0 w-full h-full opacity-0 cursor-pointer appearance-none disabled:cursor-not-allowed`,Nb=`absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none flex items-center`,Pb=`absolute left-0 top-0 h-full aspect-square flex items-center justify-center pointer-events-none`,Fb=`absolute left-0 top-0 z-10 btn btn-control btn-neutral`;function Ib(){return j(`svg`,{style:{width:`var(--chevron-size, 0.75rem)`,height:`var(--chevron-size, 0.75rem)`},viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:j(`path`,{d:`M4 6L8 10L12 6`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})})}function Lb({value:e,devices:t,disabled:n,onChange:r,label:i}){return j(le,{children:[j(`select`,{class:Mb,value:e,onChange:e=>r(e.target.value),disabled:n,"aria-label":i,children:t.map(({device:e})=>j(`option`,{value:e.deviceId,children:e.label},e.deviceId))}),j(`span`,{class:Nb,children:j(Ib,{})})]})}function Rb(e){return j(`div`,{class:jb,children:j(Lb,{...e})})}function zb({iconName:e,...t}){return j(`div`,{class:jb,children:[j(`span`,{class:Pb,"aria-hidden":`true`,children:j(Wy,{name:e})}),j(Lb,{...t})]})}var Bb=ba(()=>{let{onToggleMicrophone:e,isMicReady:t,isMicMuted:n}=gb(),{microphones:r,currentMic:i,setMicrophone:a}=Zg();return!i||(r?.length??0)<=1?j(Ub,{}):j(`div`,{class:`relative inline-flex items-center`,children:[j(Rb,{value:i?.device?.deviceId,devices:r||[],disabled:!t,onChange:e=>a(e),label:`Select microphone`}),j(`button`,{type:`button`,onClick:e,disabled:!t,class:Fb,"aria-label":n?`Unmute microphone`:`Mute microphone`,"aria-pressed":n,children:j(Wy,{name:n||!t?`mic-off`:`mic`})})]})});function Vb(){let{onToggleCamera:e,isCamMuted:t}=hb(),{camera:n,requestCamera:r}=Sb(),{open:i}=Ob(),a=n.isGranted&&!t;return{isOn:a,onClick:()=>{if(n.isBlocked)return i(`camera`);if(a)return e();r()},label:a?`Turn camera off`:n.isGranted?`Turn camera on`:`Enable camera`,needsAttention:n.needsAttention}}var Hb=ba(()=>{let{isCamReady:e}=hb(),{currentCam:t,cameras:n,setCamera:r}=Zg(),i=Vb();return!t||(n?.length??0)<=1?j(Wb,{}):j(`div`,{class:`relative inline-flex items-center`,children:[j(Rb,{value:t?.device?.deviceId,devices:n||[],disabled:!e,onChange:e=>r(e),label:`Select camera`}),j(`button`,{type:`button`,onClick:i.onClick,class:Fb,"aria-label":i.label,"aria-pressed":!i.isOn,children:j(Wy,{name:i.isOn?`cam`:`cam-off`})})]})}),Ub=ba(()=>{let{onToggleMicrophone:e,isMicMuted:t}=gb(),{mic:n,requestMic:r}=Sb(),{open:i}=Ob();return j(`span`,{class:`relative inline-flex`,children:[j(`button`,{type:`button`,onClick:()=>{if(n.isGranted)return e();if(n.isBlocked)return i(`microphone`);r()},class:`btn btn-control btn-neutral`,"aria-label":n.isGranted?t?`Unmute microphone`:`Mute microphone`:`Allow microphone access`,"aria-pressed":n.isGranted?t:void 0,children:j(Wy,{name:t||!n.isGranted?`mic-off`:`mic`})}),n.needsAttention&&j(Ab,{})]})}),Wb=ba(()=>{let{isOn:e,onClick:t,label:n,needsAttention:r}=Vb();return j(`span`,{class:`relative inline-flex`,children:[j(`button`,{type:`button`,onClick:t,class:`btn btn-control btn-neutral`,"aria-label":n,"aria-pressed":!e,children:j(Wy,{name:e?`cam`:`cam-off`})}),r&&j(Ab,{})]})});ba(({compact:e=!1}={})=>{let{isMicReady:t}=gb(),{microphones:n,currentMic:r,setMicrophone:i}=Zg();return(n?.length??0)<=1?null:j(zb,{iconName:`mic`,value:r?.device?.deviceId,devices:n,disabled:!t,onChange:e=>i(e),label:`Select microphone`,compact:e})}),ba(({compact:e=!1}={})=>{let{isCamReady:t}=hb(),{currentCam:n,cameras:r,setCamera:i}=Zg();return(r?.length??0)<=1?null:j(zb,{iconName:`cam`,value:n?.device?.deviceId,devices:r,disabled:!t,onChange:e=>i(e),label:`Select camera`,compact:e})});var Gb=ba((e={})=>{let{onToggleScreenshare:t,isScreenSharing:n}=_b();return j(`button`,{type:`button`,onClick:t,class:`btn btn-control ${n?`btn-primary`:`btn-neutral`}`,"aria-label":n?`Stop screen share`:`Start screen share`,"aria-pressed":n,children:j(Wy,{name:`screen-share`})})});function Kb(e){let t=ft(L_);if(!t)throw Error(`useConversation must be used within ConversationProvider`);return D(()=>{if(e)return t.__registerSubscriber(e),()=>t.__unregisterSubscriber(e)},[e]),t}var qb=Fe(null);function Jb({children:e,defaultEnabled:t=!1}){let[n,r]=E(t),i=A(()=>r(e=>!e),[]),a=k(()=>({isEnabled:n,toggle:i}),[n,i]);return j(qb.Provider,{value:a,children:e})}function Yb(){let e=ft(qb);if(!e)throw Error(`ClosedCaptions components must be used within <ClosedCaptionsProvider>`);return e}var Xb=ba(()=>{let{isEnabled:e,toggle:t}=Yb();return j(`button`,{type:`button`,onClick:t,"aria-pressed":e,class:`btn btn-control ${e?`btn-primary`:`btn-neutral`}`,"aria-label":e?`Hide captions`:`Show captions`,children:j(Wy,{name:`captions`,"aria-label":e?`Closed Captions On`:`Closed Captions Off`})})}),Zb=ba(()=>{let{isEnabled:e}=Yb(),{captionText:t,captionRole:n}=Kb(),r=t.value,i=n.value;return!e||!r?null:j(`div`,{class:`absolute bottom-24 left-1/2 -translate-x-1/2 max-w-[80%] px-4 py-2 rounded-box bg-black/60 text-white z-10`,role:`status`,"aria-live":`polite`,children:j(`div`,{class:`text-sm leading-5 max-h-15 overflow-hidden flex flex-col justify-end text-center`,children:j(`div`,{children:[j(`span`,{class:`text-xs ${i===`replica`?`text-secondary`:`text-primary`} mr-2`,children:i===`replica`?`PAL`:`You`}),r]})})})}),Qb=Fe(null);function $b({children:e,defaultOpen:t=!1}){let[n,r]=E(t),i=A(()=>r(e=>!e),[]),a=A(()=>r(!1),[]),o=k(()=>({isOpen:n,toggle:i,close:a}),[n,i,a]);return j(Qb.Provider,{value:o,children:e})}function ex(){let e=ft(Qb);if(!e)throw Error(`Chat components must be used within <ChatProvider>`);return e}var tx=ba((e={})=>{let{isOpen:t,toggle:n}=ex();return j(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":t?`Close chat`:`Open chat`,class:`btn btn-control ${t?`btn-primary`:`btn-neutral`}`,children:j(Wy,{name:`chat`})})}),nx=ba(({message:e})=>{let t=e.sender===`user`;return j(`li`,{class:`flex flex-col gap-1 ${t?`items-end`:`items-start`}`,children:[j(`span`,{class:`text-xs ${t?`text-primary`:`text-secondary`}`,children:t?`You`:`PAL`}),j(`span`,{class:`px-3 py-2 rounded-field text-sm max-w-[80%] ${t?`bg-primary text-primary-content`:`bg-base-200 text-base-content`}`,children:e.text})]})}),rx=ba(()=>{let{isOpen:e,close:t}=ex(),{chatMessages:n,sendChat:r,session:i}=Kb(),a=i.value?.conversationId??null,o=n.value,[s,c]=E(``),l=O(null);D(()=>{let e=l.current;e&&(e.scrollTop=e.scrollHeight)},[o.length]);let u=A(()=>{let e=s.trim();!e||!a||(r(e),c(``))},[s,r,a]),d=A(e=>{e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),u())},[u]),f=!!s.trim()&&!!a;return j(`aside`,{class:`absolute top-0 right-0 w-80 h-full bg-base-100 border-l border-base-300 flex flex-col z-30 transition-transform ${e?`translate-x-0`:`translate-x-full`} @max-mobile:w-full`,"aria-hidden":!e,inert:!e,children:[j(`header`,{class:`flex items-center justify-between px-4 py-3 border-b border-base-300`,children:[j(`span`,{class:`font-medium text-base-content`,children:`Chat`}),j(`button`,{type:`button`,class:`btn btn-ghost btn-sm btn-circle`,onClick:t,"aria-label":`Close chat`,children:j(Wy,{name:`close`,size:20})})]}),j(`ul`,{ref:l,class:`flex-1 overflow-y-auto p-4 flex flex-col gap-3`,role:`log`,"aria-live":`polite`,children:o.length===0?j(`li`,{class:`text-center text-sm opacity-70`,children:a?`Send a message to start the conversation.`:`Connecting…`}):o.map(e=>j(nx,{message:e},e.id))}),j(`form`,{class:`flex items-end gap-2 p-3 border-t border-base-300`,onSubmit:e=>{e.preventDefault(),u()},children:[j(`textarea`,{class:`textarea textarea-bordered textarea-sm flex-1 resize-none`,value:s,onChange:e=>c(e.target.value),onKeyDown:d,placeholder:a?`Type a message…`:`Connecting…`,disabled:!a,rows:1,"aria-label":`Message`}),j(`button`,{type:`submit`,class:`btn btn-primary btn-sm btn-circle`,disabled:!f,"aria-label":`Send message`,children:j(Wy,{name:`send`,size:18})})]})]})});function ix({label:e}){return j(eb,{role:`status`,"aria-live":`polite`,class:`z-2`,children:[j(Qy,{}),j(`div`,{class:`flex flex-col items-center gap-3`,children:[j(`span`,{class:`loading loading-spinner loading-md text-base-content`}),j(`span`,{class:`text-base font-medium`,children:e})]})]})}var ax=ba(()=>j(ix,{label:`Connecting`})),ox=ba(()=>j(ix,{label:`Leaving`}));function sx({active:e,onToggle:t,tooltip:n}){return j(`button`,{type:`button`,onClick:t,class:`btn btn-control ${e?`btn-info`:`btn-ghost`}`,"aria-label":n??(e?`Exit fullscreen`:`Enter fullscreen`),title:n,children:j(Wy,{name:e?`fullscreen-exit`:`fullscreen`})})}var cx=ba(({id:e})=>{let t=Gh()===e,n=O(null),r=O(null),i=O(null),a=O(void 0);Gg(e,A(e=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{let t=Number(Math.max(.01,e).toFixed(2));n.current&&r.current&&i.current&&(n.current.style.height=`${20+t*40}%`,r.current.style.height=`${20+t*130}%`,i.current.style.height=`${20+t*40}%`)})},[]));let o=`w-[3px] rounded-full bg-base-100 transition-[opacity] ${t?`opacity-100`:`opacity-50`}`;return j(`div`,{class:`flex items-center justify-center w-6 h-6`,children:j(`div`,{class:`flex items-center justify-center gap-[2px] w-full h-full`,children:[j(`div`,{ref:n,class:o,style:{height:`20%`}}),j(`div`,{ref:r,class:o,style:{height:`20%`}}),j(`div`,{ref:i,class:o,style:{height:`20%`}})]})})});function lx({sessionId:e,className:t=``}){let n=O(null),r=O(void 0);return Gg(e??``,A(t=>{e&&(r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let e=Math.max(0,Math.min(1,t**.6));n.current?.style.setProperty(`--audio-level`,String(e))}))},[e])),j(`div`,{ref:n,class:`relative aspect-square w-full max-w-[min(48cqi,16rem)] mx-auto pointer-events-none ${t}`,style:{"--audio-level":`0`},"aria-hidden":`true`,children:[j(`div`,{class:`absolute inset-0 rounded-full will-change-transform`,style:{background:`conic-gradient(from 0deg, var(--color-primary), var(--color-info, var(--color-primary)), var(--color-secondary, var(--color-primary)), var(--color-primary))`,filter:`blur(28px)`,animation:`tavusOrbSpin 18s linear infinite`,scale:`calc(1 + var(--audio-level, 0) * 0.35)`,opacity:`calc(0.45 + var(--audio-level, 0) * 0.45)`,transition:`scale 120ms ease-out, opacity 120ms ease-out`}}),j(`div`,{class:`absolute inset-[12%] rounded-full will-change-transform`,style:{background:`conic-gradient(from 180deg, color-mix(in oklab, var(--color-primary) 80%, white), transparent 30%, color-mix(in oklab, var(--color-primary) 60%, white) 70%, transparent)`,filter:`blur(14px)`,opacity:.55,mixBlendMode:`screen`,animation:`tavusOrbSpin 26s linear infinite reverse`}}),j(`div`,{class:`absolute inset-[28%] rounded-full`,style:{background:`radial-gradient(circle at 30% 30%, color-mix(in oklab, white 70%, var(--color-primary)), var(--color-primary) 60%, color-mix(in oklab, var(--color-primary) 50%, black))`,boxShadow:`0 0 60px color-mix(in oklab, var(--color-primary) 60%, transparent), inset 0 0 30px color-mix(in oklab, white 40%, transparent)`,scale:`calc(1 + var(--audio-level, 0) * 0.18)`,transition:`scale 100ms ease-out`}}),j(`div`,{class:`absolute inset-[28%] rounded-full`,style:{background:`radial-gradient(circle, color-mix(in oklab, var(--color-primary) 80%, transparent), transparent 70%)`,animation:`tavusOrbPulse 2.6s ease-in-out infinite`}})]})}function ux({children:e,class:t,className:n,...r}){return j(`div`,{class:`tavus-mesh-bg ${t??n??``}`,...r,children:[j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-1`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-2`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-3`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-4`}),j(`div`,{class:`tavus-mesh-blob tavus-mesh-blob-5`}),j(`div`,{class:`absolute inset-0 bg-linear-to-t from-black/30 via-black/10 to-transparent pointer-events-none backdrop-blur-xs`}),e]})}var dx=e=>!!e.user_id?.includes(`tavus-replica`);function fx(){return Xh({filter:dx})}function px(e){let t=fx()[0],n=r_(t??``),r=Mg(),[i,a]=E(!1);return D(()=>{t&&(n.state===`playable`||e)&&a(!0)},[t,n.state,e]),r===`left-meeting`||r===`error`?{phase:`left`}:!i||!t?{phase:`connecting`}:{phase:`ready`,replicaId:t,videoState:n}}var mx=ba(({isAudioOnly:e})=>{let t=px(e);return t.phase===`left`?j(ox,{}):t.phase===`connecting`?j(ax,{}):e?j(ux,{class:`flex items-center justify-center`,children:[j(lx,{sessionId:t.replicaId}),j(tg,{sessionId:t.replicaId})]}):j(`div`,{class:`relative w-full h-full`,children:[j(rg,{automirror:!0,sessionId:t.replicaId,type:`video`,fit:`cover`,className:`absolute inset-0 w-full h-full object-cover ${t.videoState.isOff?`hidden`:``}`}),j(tg,{sessionId:t.replicaId})]})}),hx=ba(({onLeave:e})=>{let{config:t}=K_(),n=t.value.customization.conversation.modality===`audio`;return j(`div`,{class:`@container/pip w-full h-full`,children:j(`div`,{class:`relative w-full h-full overflow-hidden bg-linear-to-br from-base-300 to-base-200 text-base-content`,children:[j(`div`,{class:`relative w-full h-full z-5`,children:j(mx,{isAudioOnly:n})}),j(`div`,{class:`absolute bottom-4 w-full inset-x-0 z-20 flex justify-center items-center gap-2 @max-mobile:gap-1`,children:[j(Ub,{}),!n&&j(Wb,{}),j(`button`,{type:`button`,class:`btn btn-control btn-error`,onClick:e,"aria-label":`Leave call`,children:j(Wy,{name:`leave`,"aria-label":`Leave Call`})})]})]})})}),gx=ba(({personaSessionId:e,localSessionId:t,isPresenting:n,isScreenSharing:r,isAudioOnly:i,avatarOff:a,videoRef:o})=>{let s=n||r;return j(le,{children:[j(rg,{ref:o,automirror:!0,sessionId:r?t??``:e,type:s?`screenVideo`:`video`,fit:s?`contain`:`cover`,className:`absolute inset-0 w-full h-full transition-all ${s?`object-contain`:`object-cover`} ${!s&&a?`hidden`:``}`}),n&&j(`div`,{class:`absolute bottom-4 right-4 aspect-square w-32 @max-mobile:w-24 rounded-box overflow-hidden bg-black/30 z-10`,children:i||a?j(`div`,{class:`flex w-full h-full items-center justify-center`,children:j(lx,{sessionId:e})}):j(rg,{automirror:!0,sessionId:e,type:`video`,fit:`cover`,className:`w-full h-full object-cover`})})]})});function K(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function _x(e){return e&&Object.assign(xx,e),xx}var vx,yx,bx,xx,Sx=a((()=>{yx=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},bx=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(vx=globalThis).__zod_globalConfig??(vx.__zod_globalConfig={}),xx=globalThis.__zod_globalConfig}));function Cx(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function wx(e,t=`|`){return e.map(e=>Bx(e)).join(t)}function Tx(e,t){return typeof t==`bigint`?t.toString():t}function Ex(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Dx(e){return e==null}function Ox(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function kx(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function Ax(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rS)return r===void 0&&(r=rS,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function jx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Mx(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Nx(e){return JSON.stringify(e)}function Px(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Fx(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ix(e){if(Fx(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Fx(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Lx(e){return Ix(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Rx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function zx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function q(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Bx(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Vx(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Hx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return zx(e,Mx(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return jx(this,`shape`,e),e},checks:[]}))}function Ux(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return zx(e,Mx(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return jx(this,`shape`,r),r},checks:[]}))}function Wx(e,t){if(!Ix(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jx(this,`shape`,n),n}}))}function Gx(e,t){if(!Ix(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jx(this,`shape`,n),n}}))}function Kx(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return zx(e,Mx(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return jx(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function qx(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return zx(t,Mx(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return jx(this,`shape`,i),i},checks:[]}))}function Jx(e,t,n){return zx(t,Mx(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return jx(this,`shape`,i),i}}))}function Yx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Xx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Zx(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Qx(e){return typeof e==`string`?e:e?.message}function $x(e,t,n){let r=e.message?e.message:Qx(e.inst?._zod.def?.error?.(e))??Qx(t?.error?.(e))??Qx(n.customError?.(e))??Qx(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function eS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function tS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function nS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var rS,iS,aS,oS,sS,cS=a((()=>{Sx(),rS=Symbol(`evaluating`),iS=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},aS=Ex(()=>{if(xx.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),oS=new Set([`string`,`number`,`symbol`]),sS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}}));function lS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function uS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var dS,fS,pS,mS=a((()=>{Sx(),cS(),dS=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tx,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},fS=K(`$ZodError`,dS),pS=K(`$ZodError`,dS,{Parent:Error})})),hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS=a((()=>{Sx(),mS(),cS(),hS=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new yx;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$x(e,a,_x())));throw iS(t,i?.callee),t}return o.value},gS=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$x(e,a,_x())));throw iS(t,i?.callee),t}return o.value},_S=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new yx;return a.issues.length?{success:!1,error:new(e??fS)(a.issues.map(e=>$x(e,i,_x())))}:{success:!0,data:a.value}},vS=_S(pS),yS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>$x(e,i,_x())))}:{success:!0,data:a.value}},bS=yS(pS),xS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hS(e)(t,n,i)},SS=e=>(t,n,r)=>hS(e)(t,n,r),CS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return gS(e)(t,n,i)},wS=e=>async(t,n,r)=>gS(e)(t,n,r),TS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _S(e)(t,n,i)},ES=e=>(t,n,r)=>_S(e)(t,n,r),DS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yS(e)(t,n,i)},OS=e=>async(t,n,r)=>yS(e)(t,n,r)}));function AS(){return new RegExp(WS,`u`)}function jS(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function MS(e){return RegExp(`^${jS(e)}$`)}function NS(e){let t=jS({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${$S}T(?:${r})$`)}var PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC=a((()=>{PS=/^[cC][0-9a-z]{6,}$/,FS=/^[0-9a-z]+$/,IS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,LS=/^[0-9a-vA-V]{20}$/,RS=/^[A-Za-z0-9]{27}$/,zS=/^[a-zA-Z0-9_-]{21}$/,BS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,HS=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,US=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WS=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,GS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,JS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,XS=/^[A-Za-z0-9_-]*$/,ZS=/^https?$/,QS=/^\+[1-9]\d{6,14}$/,$S=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,eC=RegExp(`^${$S}$`),tC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},nC=/^-?\d+$/,rC=/^-?\d+(?:\.\d+)?$/,iC=/^(?:true|false)$/i,aC=/^null$/i,oC=/^undefined$/i,sC=/^[^A-Z]*$/,cC=/^[^a-z]*$/})),uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC=a((()=>{Sx(),lC(),cS(),uC=K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),dC={number:`number`,bigint:`bigint`,object:`date`},fC=K(`$ZodCheckLessThan`,(e,t)=>{uC.init(e,t);let n=dC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pC=K(`$ZodCheckGreaterThan`,(e,t)=>{uC.init(e,t);let n=dC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mC=K(`$ZodCheckMultipleOf`,(e,t)=>{uC.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):kx(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hC=K(`$ZodCheckNumberFormat`,(e,t)=>{uC.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=sS[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=nC)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),gC=K(`$ZodCheckMaxLength`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=eS(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_C=K(`$ZodCheckMinLength`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=eS(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vC=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;uC.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Dx(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=eS(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),yC=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;uC.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),bC=K(`$ZodCheckRegex`,(e,t)=>{yC.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xC=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=sC,yC.init(e,t)}),SC=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=cC,yC.init(e,t)}),CC=K(`$ZodCheckIncludes`,(e,t)=>{uC.init(e,t);let n=Rx(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),wC=K(`$ZodCheckStartsWith`,(e,t)=>{uC.init(e,t);let n=RegExp(`^${Rx(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),TC=K(`$ZodCheckEndsWith`,(e,t)=>{uC.init(e,t);let n=RegExp(`.*${Rx(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),EC=K(`$ZodCheckOverwrite`,(e,t)=>{uC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),OC,kC=a((()=>{OC=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
51
51
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
52
52
  `))}}})),AC,jC=a((()=>{AC={major:4,minor:4,patch:3}}));function MC(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function NC(e){if(!XS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return MC(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function PC(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function FC(e,t,n){e.issues.length&&t.issues.push(...Zx(n,e.issues)),t.value[n]=e.value}function IC(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Zx(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function LC(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Vx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function RC(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>IC(e,n,i,t,u,d))):IC(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function zC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Yx(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>$x(e,r,_x())))}),t)}function BC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ix(e)&&Ix(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=BC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=BC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function VC(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Yx(e))return e;let o=BC(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function HC(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function UC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function WC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function GC(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function KC(e){return e.value=Object.freeze(e.value),e}function qC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(nS(e))}}var JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw=a((()=>{DC(),Sx(),kC(),kS(),lC(),cS(),jC(),JC=K(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=AC;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Yx(e),i;for(let a of t){if(a._zod.def.when){if(Xx(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new yx;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Yx(e,t))});else{if(e.issues.length===t)continue;r||=Yx(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Yx(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new yx;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new yx;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ax(e,`~standard`,()=>({validate:t=>{try{let n=vS(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return bS(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),YC=K(`$ZodString`,(e,t)=>{JC.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??tC(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),XC=K(`$ZodStringFormat`,(e,t)=>{yC.init(e,t),YC.init(e,t)}),ZC=K(`$ZodGUID`,(e,t)=>{t.pattern??=VS,XC.init(e,t)}),QC=K(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=HS(e)}else t.pattern??=HS();XC.init(e,t)}),$C=K(`$ZodEmail`,(e,t)=>{t.pattern??=US,XC.init(e,t)}),ew=K(`$ZodURL`,(e,t)=>{XC.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ZS.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),tw=K(`$ZodEmoji`,(e,t)=>{t.pattern??=AS(),XC.init(e,t)}),nw=K(`$ZodNanoID`,(e,t)=>{t.pattern??=zS,XC.init(e,t)}),rw=K(`$ZodCUID`,(e,t)=>{t.pattern??=PS,XC.init(e,t)}),iw=K(`$ZodCUID2`,(e,t)=>{t.pattern??=FS,XC.init(e,t)}),aw=K(`$ZodULID`,(e,t)=>{t.pattern??=IS,XC.init(e,t)}),ow=K(`$ZodXID`,(e,t)=>{t.pattern??=LS,XC.init(e,t)}),sw=K(`$ZodKSUID`,(e,t)=>{t.pattern??=RS,XC.init(e,t)}),cw=K(`$ZodISODateTime`,(e,t)=>{t.pattern??=NS(t),XC.init(e,t)}),lw=K(`$ZodISODate`,(e,t)=>{t.pattern??=eC,XC.init(e,t)}),uw=K(`$ZodISOTime`,(e,t)=>{t.pattern??=MS(t),XC.init(e,t)}),dw=K(`$ZodISODuration`,(e,t)=>{t.pattern??=BS,XC.init(e,t)}),fw=K(`$ZodIPv4`,(e,t)=>{t.pattern??=GS,XC.init(e,t),e._zod.bag.format=`ipv4`}),pw=K(`$ZodIPv6`,(e,t)=>{t.pattern??=KS,XC.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),mw=K(`$ZodCIDRv4`,(e,t)=>{t.pattern??=qS,XC.init(e,t)}),hw=K(`$ZodCIDRv6`,(e,t)=>{t.pattern??=JS,XC.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),gw=K(`$ZodBase64`,(e,t)=>{t.pattern??=YS,XC.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{MC(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),_w=K(`$ZodBase64URL`,(e,t)=>{t.pattern??=XS,XC.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{NC(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),vw=K(`$ZodE164`,(e,t)=>{t.pattern??=QS,XC.init(e,t)}),yw=K(`$ZodJWT`,(e,t)=>{XC.init(e,t),e._zod.check=n=>{PC(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),bw=K(`$ZodNumber`,(e,t)=>{JC.init(e,t),e._zod.pattern=e._zod.bag.pattern??rC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),xw=K(`$ZodNumberFormat`,(e,t)=>{hC.init(e,t),bw.init(e,t)}),Sw=K(`$ZodBoolean`,(e,t)=>{JC.init(e,t),e._zod.pattern=iC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Cw=K(`$ZodUndefined`,(e,t)=>{JC.init(e,t),e._zod.pattern=oC,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ww=K(`$ZodNull`,(e,t)=>{JC.init(e,t),e._zod.pattern=aC,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Tw=K(`$ZodUnknown`,(e,t)=>{JC.init(e,t),e._zod.parse=e=>e}),Ew=K(`$ZodNever`,(e,t)=>{JC.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Dw=K(`$ZodArray`,(e,t)=>{JC.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>FC(t,n,e))):FC(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Ow=K(`$ZodObject`,(e,t)=>{if(JC.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Ex(()=>LC(t));Ax(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Fx,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>IC(n,t,e,s,r,i))):IC(a,t,e,s,r,i)}return i?RC(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kw=K(`$ZodObjectJIT`,(e,t)=>{Ow.init(e,t);let n=e._zod.parse,r=Ex(()=>LC(t)),i=e=>{let t=new OC([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Nx(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Nx(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
53
53
  if (${n}.issues.length) {
package/dist/index.mjs CHANGED
@@ -19165,20 +19165,20 @@ function tb({ title: e, description: t, media: n, children: r, overlay: i }) {
19165
19165
  //#region ../core/src/utils/unavailable-copy.ts
19166
19166
  var nb = {
19167
19167
  daily_limit: {
19168
- title: "Agent is at today's limit",
19169
- description: "This Agent can take more conversations tomorrow."
19168
+ title: "PAL is at today's limit",
19169
+ description: "This PAL can take more conversations tomorrow."
19170
19170
  },
19171
19171
  total_limit: {
19172
- title: "Agent is unavailable",
19173
- description: "This Agent isn't available right now. Please check back later."
19172
+ title: "PAL is unavailable",
19173
+ description: "This PAL isn't available right now. Please check back later."
19174
19174
  },
19175
19175
  busy: {
19176
- title: "Agent is in another conversation",
19176
+ title: "PAL is in another conversation",
19177
19177
  description: "Please try again in a moment."
19178
19178
  },
19179
19179
  error: {
19180
- title: "Couldn't load this Agent",
19181
- description: "This Agent couldn't be loaded. Please try again later."
19180
+ title: "Couldn't load this PAL",
19181
+ description: "This PAL couldn't be loaded. Please try again later."
19182
19182
  }
19183
19183
  };
19184
19184
  function rb(e, t) {
@@ -19894,14 +19894,14 @@ var Xb = ba(() => {
19894
19894
  }), Zb = ba(() => {
19895
19895
  let { isEnabled: e } = Yb(), { captionText: t, captionRole: n } = Kb(), r = t.value, i = n.value;
19896
19896
  return !e || !r ? null : /* @__PURE__ */ A("div", {
19897
- class: "absolute bottom-24 left-1/2 -translate-x-1/2 max-w-[80%] px-4 py-2 rounded-box bg-black/60 text-white",
19897
+ class: "absolute bottom-24 left-1/2 -translate-x-1/2 max-w-[80%] px-4 py-2 rounded-box bg-black/60 text-white z-10",
19898
19898
  role: "status",
19899
19899
  "aria-live": "polite",
19900
19900
  children: /* @__PURE__ */ A("div", {
19901
19901
  class: "text-sm leading-5 max-h-15 overflow-hidden flex flex-col justify-end text-center",
19902
19902
  children: /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("span", {
19903
19903
  class: `text-xs ${i === "replica" ? "text-secondary" : "text-primary"} mr-2`,
19904
- children: i === "replica" ? "Replica" : "You"
19904
+ children: i === "replica" ? "PAL" : "You"
19905
19905
  }), r] })
19906
19906
  })
19907
19907
  });
@@ -19942,7 +19942,7 @@ var tx = ba((e = {}) => {
19942
19942
  class: `flex flex-col gap-1 ${t ? "items-end" : "items-start"}`,
19943
19943
  children: [/* @__PURE__ */ A("span", {
19944
19944
  class: `text-xs ${t ? "text-primary" : "text-secondary"}`,
19945
- children: t ? "You" : "Replica"
19945
+ children: t ? "You" : "PAL"
19946
19946
  }), /* @__PURE__ */ A("span", {
19947
19947
  class: `px-3 py-2 rounded-field text-sm max-w-[80%] ${t ? "bg-primary text-primary-content" : "bg-base-200 text-base-content"}`,
19948
19948
  children: e.text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/embed",
3
- "version": "0.0.1-beta.10",
3
+ "version": "0.0.1-beta.11",
4
4
  "description": "Tavus conversational video AI <tavus-embed> custom element for the web.",
5
5
  "keywords": [
6
6
  "ai",