voicedots-ai-widget 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".vd-modal-overlay{position:fixed;inset:0;z-index:10001;display:flex;align-items:center;justify-content:center;padding:16px;pointer-events:auto}.vd-modal-backdrop{position:absolute;inset:0;background:#0006;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.vd-modal-container{position:relative;width:100%;max-width:448px;max-height:85vh;background:#ffffffd9;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:24px;border:1px solid rgba(139,92,246,.3);box-shadow:0 25px 50px -12px #7c4dff40;display:flex;flex-direction:column;overflow:hidden}.vd-modal-glow{position:absolute;top:0;left:50%;transform:translate(-50%);width:120px;height:2px;background:#7c4dff80;filter:blur(4px)}.vd-modal-header{display:flex;justify-content:space-between;align-items:center;padding:20px 24px;border-bottom:1px solid rgba(139,92,246,.1)}.vd-modal-title-box{display:flex;align-items:center;gap:12px}.vd-modal-icon-wrapper{width:40px;height:40px;border-radius:50%;background:#7c4dff1a;color:#7c4dff;display:flex;align-items:center;justify-content:center}.vd-modal-title-box h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1a}.vd-modal-close{background:transparent;border:none;color:#666;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s cubic-bezier(.4,0,.2,1)}.vd-modal-close:hover{background:#0000000d;color:#1a1a1a;transform:rotate(90deg)}.vd-modal-body{flex:1;overflow-y:auto;padding:24px}.vd-form-grid{display:flex;flex-direction:column;gap:16px}.vd-input-group{display:flex;flex-direction:column;gap:6px}.vd-input-group label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#7c4dff;margin-left:4px}.vd-input-field{width:100%;height:44px;padding:0 16px;border-radius:12px;background:#7c4dff0d;border:1px solid transparent;font-size:14px;transition:all .2s;outline:none}.vd-input-field:focus{background:#fff;border-color:#7c4dff;box-shadow:0 0 0 4px #7c4dff1a}.vd-modal-footer{margin-top:24px;padding-top:20px;border-top:1px solid rgba(0,0,0,.05);display:flex;justify-content:space-between;align-items:center}.vd-verify-badge{display:flex;align-items:center;gap:4px;font-size:10px;color:#666}.vd-footer-btns{display:flex;gap:8px}.vd-btn-save{padding:8px 18px;background:#7c4dff;color:#fff;border:none;border-radius:100px;font-weight:700;font-size:12px;display:flex;align-items:center;gap:6px;cursor:pointer;transition:all .2s}.vd-btn-save:hover{background:#6a3de8;box-shadow:0 4px 12px #7c4dff4d}.vd-btn-ghost{background:transparent;border:none;color:#666;font-size:12px;font-weight:600;cursor:pointer}@keyframes vd-zoom-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.animate-zoom-in{animation:vd-zoom-in .2s ease-out}.vd-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.vd-lottie-container{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;aspect-ratio:1 / 1}.vd-lottie-container canvas{max-width:100%;max-height:100%;animation:vd-fade-in .5s ease-out}@keyframes vd-fade-in{0%{opacity:0}to{opacity:1}}.vd-widget-container{position:fixed;bottom:24px;right:24px;z-index:2147483647;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vd-main-card{width:330px;background:#fff;border-radius:20px;box-shadow:0 10px 40px #0000001a;overflow:hidden;display:flex;flex-direction:column}.vd-header{padding:14px 18px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(0,0,0,.05)}.vd-header h3{margin:0;font-size:16px;font-weight:600;color:#111827}.vd-icon-btn{background:transparent;border:none;cursor:pointer;color:#4b5563;display:flex;align-items:center;justify-content:center;padding:4px;border-radius:8px;transition:background .2s}.vd-icon-btn:hover{background:#0000000d}.vd-timer{background:#eae0f5;color:#7c4dff;font-weight:600;padding:4px 12px;border-radius:12px;font-size:13px;margin-left:12px}.vd-title-group{display:flex;align-items:center}.vd-avatar-grid{display:grid;gap:12px;padding:16px;justify-content:center}.vd-avatar-grid.count-1{grid-template-columns:minmax(auto,240px)}.vd-avatar-grid.count-2,.vd-avatar-grid.count-4,.vd-avatar-grid.count-3{grid-template-columns:1fr 1fr}.vd-avatar-grid.count-3 .vd-avatar-item:last-child{grid-column:span 2;justify-self:center;width:calc(50% - 6px)}.vd-avatar-item{background:#fff;border-radius:16px;padding:12px 12px 16px;text-align:center;transition:all .2s ease;border:1px solid #f0f0f0;cursor:pointer;display:flex;flex-direction:column;align-items:center;box-sizing:border-box;width:100%}.vd-avatar-item:hover{box-shadow:0 4px 12px #8b5cf626}.vd-avatar-item.active{background:#fff;box-shadow:0 0 0 2px #8b5cf6}.vd-avatar-item p{margin:8px 0 0;font-size:13px;font-weight:600;color:#1f2937}.vd-lottie-container{width:120px;height:120px;display:flex;align-items:center;justify-content:center}.vd-controls{padding:0 20px 16px;display:flex;flex-direction:column;gap:12px}.vd-btn-primary{width:100%;background:var(--theme-color, #8B5CF6);color:#fff;border:none;border-radius:100px;height:48px;font-weight:600;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;position:relative;transition:opacity .2s;overflow:hidden}.vd-btn-primary:hover{opacity:.9}.vd-btn-icon-wrapper{position:absolute;left:8px;width:32px;height:32px;background:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center}.vd-btn-icon-wrapper img{width:20px;height:20px}.vd-sliding{animation:vd-slide-right 1.5s infinite alternate ease-in-out}@keyframes vd-slide-right{0%{left:8px}to{left:calc(100% - 40px)}}.vd-active-controls{display:flex;gap:12px;width:100%}.vd-mic-btn{width:48px;height:48px;border-radius:50%;background:#fff;border:1px solid #E5E7EB;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}.vd-end-btn{flex-grow:1;height:48px;border-radius:100px;background:#ef4444;color:#fff;border:none;font-weight:600;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer}.vd-watermark{display:block;text-align:center;font-size:13px;font-weight:500;color:#1201013d;text-decoration:none;margin-top:0;margin-bottom:2px;opacity:5000;transition:opacity .2s}.vd-watermark:hover{opacity:1;text-decoration:underline}.vd-pill{display:flex;align-items:center;gap:10px;padding:6px 16px 6px 6px;background:#fff;border-radius:100px;border:1px solid rgba(139,92,246,.1);box-shadow:0 4px 12px #0000001a;cursor:pointer;transition:transform .2s,box-shadow .2s}.vd-pill:hover{transform:translateY(-2px);box-shadow:0 6px 16px #8b5cf626}.vd-pill-icon-container{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;background:#fff;box-shadow:0 2px 8px #0000000d}.vd-pill-icon{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--theme-color, #9966FE),#7c4dff);display:flex;align-items:center;justify-content:center;position:relative}.vd-pill-icon-inner{width:12px;height:12px;border-radius:50%;background:#e9d5ff}.vd-pill-text{font-size:16px;font-weight:700;color:#1f2937;letter-spacing:-.2px}.vd-pill-icon.pulse{animation:vd-pulse 1.5s infinite}@keyframes vd-pulse{0%{transform:scale(1);box-shadow:0 0 #7c4dffb3}70%{transform:scale(1.05);box-shadow:0 0 0 10px #7c4dff00}to{transform:scale(1);box-shadow:0 0 #7c4dff00}}.vd-portal-host{position:fixed;inset:0;z-index:2147483647;pointer-events:none}.vd-portal-host>*{pointer-events:auto}.vd-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:auto;z-index:10001}.vd-modal-content{background:#fff;padding:24px;border-radius:20px;width:90%;max-width:400px;box-shadow:0 20px 25px -5px #0000001a}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
+ var e,t,n,i,s,o,r,a,c,d,l,u,h={},p=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _(t,n,i){var s,o,r,a={};for(r in n)"key"==r?s=n[r]:"ref"==r?o=n[r]:a[r]=n[r];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===a[r]&&(a[r]=t.defaultProps[r]);return b(t,a,s,o,null)}function b(e,i,s,o,r){var a={type:e,props:i,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++n:r,__i:-1,__u:0};return null==r&&null!=t.vnode&&t.vnode(a),a}function y(e){return e.children}function k(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?C(e):null}function w(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,s=[],o=[],r=v({},n);r.__v=n.__v+1,t.vnode&&t.vnode(r),x(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,s,null==i?C(n):i,!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,N(s,r,o),n.__e=n.__=null,r.__e!=i&&T(r)}}function T(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),T(e)}function S(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!E.__r++||s!=t.debounceRendering)&&((s=t.debounceRendering)||o)(E)}function E(){try{for(var e,t=1;i.length;)i.length>t&&i.sort(r),e=i.shift(),t=i.length,w(e)}finally{i.length=E.__r=0}}function P(e,t,n,i,s,o,r,a,c,d,l){var u,m,v,f,_,k,w,T=i&&i.__k||p,S=t.length;for(c=function(e,t,n,i,s){var o,r,a,c,d,l=n.length,u=l,h=0;for(e.__k=new Array(s),o=0;o<s;o++)null!=(r=t[o])&&"boolean"!=typeof r&&"function"!=typeof r?("string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?r=e.__k[o]=b(null,r,null,null,null):g(r)?r=e.__k[o]=b(y,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?r=e.__k[o]=b(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):e.__k[o]=r,c=o+h,r.__=e,r.__b=e.__b+1,a=null,-1!=(d=r.__i=M(r,n,c,u))&&(u--,(a=n[d])&&(a.__u|=2)),null==a||null==a.__v?(-1==d&&(s>l?h--:s<l&&h++),"function"!=typeof r.type&&(r.__u|=4)):d!=c&&(d==c-1?h--:d==c+1?h++:(d>c?h--:h++,r.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<l;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=C(a)),j(a,a));return i}(n,t,T,c,S),u=0;u<S;u++)null!=(v=n.__k[u])&&(m=-1!=v.__i&&T[v.__i]||h,v.__i=u,k=x(e,v,m,s,o,r,a,c,d,l),f=v.__e,v.ref&&m.ref!=v.ref&&(m.ref&&F(m.ref,null,v),l.push(v.ref,v.__c||f,v)),null==_&&null!=f&&(_=f),(w=!!(4&v.__u))||m.__k===v.__k?c=I(v,c,e,w):"function"==typeof v.type&&void 0!==k?c=k:f&&(c=f.nextSibling),v.__u&=-7);return n.__e=_,c}function I(e,t,n,i){var s,o;if("function"==typeof e.type){for(s=e.__k,o=0;s&&o<s.length;o++)s[o]&&(s[o].__=e,t=I(s[o],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=C(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function R(e,t){return t=t||[],null==e||"boolean"==typeof e||(g(e)?e.some(function(e){R(e,t)}):t.push(e)),t}function M(e,t,n,i){var s,o,r,a=e.key,c=e.type,d=t[n],l=null!=d&&!(2&d.__u);if(null===d&&null==a||l&&a==d.key&&c==d.type)return n;if(i>(l?1:0))for(s=n-1,o=n+1;s>=0||o<t.length;)if(null!=(d=t[r=s>=0?s--:o++])&&!(2&d.__u)&&a==d.key&&c==d.type)return r;return-1}function L(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function O(e,t,n,i,s){var o,r;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||L(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||L(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(a,"$1")),r=t.toLowerCase(),t=r in e||"onFocusOut"==t||"onFocusIn"==t?r.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=c,e.addEventListener(t,o?l:d,o)):e.removeEventListener(t,o?l:d,o);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(u){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function D(e){return function(n){if(this.l){var i=this.l[n.type+e];if(null==n.t)n.t=c++;else if(n.t<i.u)return;return i(t.event?t.event(n):n)}}}function x(n,i,s,o,r,a,c,d,l,u){var m,_,b,w,T,S,E,I,R,M,L,D,x,N,F,j=i.type;if(void 0!==i.constructor)return null;128&s.__u&&(l=!!(32&s.__u),a=[d=i.__e=s.__e]),(m=t.__b)&&m(i);e:if("function"==typeof j)try{if(I=i.props,R=j.prototype&&j.prototype.render,M=(m=j.contextType)&&o[m.__c],L=m?M?M.props.value:m.__:o,s.__c?E=(_=i.__c=s.__c).__=_.__E:(R?i.__c=_=new j(I,L):(i.__c=_=new k(I,L),_.constructor=j,_.render=B),M&&M.sub(_),_.state||(_.state={}),_.__n=o,b=_.__d=!0,_.__h=[],_._sb=[]),R&&null==_.__s&&(_.__s=_.state),R&&null!=j.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=v({},_.__s)),v(_.__s,j.getDerivedStateFromProps(I,_.__s))),w=_.props,T=_.state,_.__v=i,b)R&&null==j.getDerivedStateFromProps&&null!=_.componentWillMount&&_.componentWillMount(),R&&null!=_.componentDidMount&&_.__h.push(_.componentDidMount);else{if(R&&null==j.getDerivedStateFromProps&&I!==w&&null!=_.componentWillReceiveProps&&_.componentWillReceiveProps(I,L),i.__v==s.__v||!_.__e&&null!=_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(I,_.__s,L)){i.__v!=s.__v&&(_.props=I,_.state=_.__s,_.__d=!1),i.__e=s.__e,i.__k=s.__k,i.__k.some(function(e){e&&(e.__=i)}),p.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&c.push(_);break e}null!=_.componentWillUpdate&&_.componentWillUpdate(I,_.__s,L),R&&null!=_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(w,T,S)})}if(_.context=L,_.props=I,_.__P=n,_.__e=!1,D=t.__r,x=0,R)_.state=_.__s,_.__d=!1,D&&D(i),m=_.render(_.props,_.state,_.context),p.push.apply(_.__h,_._sb),_._sb=[];else do{_.__d=!1,D&&D(i),m=_.render(_.props,_.state,_.context),_.state=_.__s}while(_.__d&&++x<25);_.state=_.__s,null!=_.getChildContext&&(o=v(v({},o),_.getChildContext())),R&&!b&&null!=_.getSnapshotBeforeUpdate&&(S=_.getSnapshotBeforeUpdate(w,T)),N=null!=m&&m.type===y&&null==m.key?U(m.props.children):m,d=P(n,g(N)?N:[N],i,s,o,r,a,c,d,l,u),_.base=i.__e,i.__u&=-161,_.__h.length&&c.push(_),E&&(_.__E=_.__=null)}catch(q){if(i.__v=null,l||null!=a)if(q.then){for(i.__u|=l?160:128;d&&8==d.nodeType&&d.nextSibling;)d=d.nextSibling;a[a.indexOf(d)]=null,i.__e=d}else{for(F=a.length;F--;)f(a[F]);A(i)}else i.__e=s.__e,i.__k=s.__k,q.then||A(i);t.__e(q,i,s)}else null==a&&i.__v==s.__v?(i.__k=s.__k,i.__e=s.__e):d=i.__e=function(n,i,s,o,r,a,c,d,l){var u,p,m,v,_,b,y,k=s.props||h,w=i.props,T=i.type;if("svg"==T?r="http://www.w3.org/2000/svg":"math"==T?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((_=a[u])&&"setAttribute"in _==!!T&&(T?_.localName==T:3==_.nodeType)){n=_,a[u]=null;break}if(null==n){if(null==T)return document.createTextNode(w);n=document.createElementNS(r,T,w.is&&w),d&&(t.__m&&t.__m(i,a),d=!1),a=null}if(null==T)k===w||d&&n.data==w||(n.data=w);else{if(a=a&&e.call(n.childNodes),!d&&null!=a)for(k={},u=0;u<n.attributes.length;u++)k[(_=n.attributes[u]).name]=_.value;for(u in k)_=k[u],"dangerouslySetInnerHTML"==u?m=_:"children"==u||u in w||"value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w||O(n,u,null,_,r);for(u in w)_=w[u],"children"==u?v=_:"dangerouslySetInnerHTML"==u?p=_:"value"==u?b=_:"checked"==u?y=_:d&&"function"!=typeof _||k[u]===_||O(n,u,_,k[u],r);if(p)d||m&&(p.__html==m.__html||p.__html==n.innerHTML)||(n.innerHTML=p.__html),i.__k=[];else if(m&&(n.innerHTML=""),P("template"==i.type?n.content:n,g(v)?v:[v],i,s,o,"foreignObject"==T?"http://www.w3.org/1999/xhtml":r,a,c,a?a[0]:s.__k&&C(s,0),d,l),null!=a)for(u=a.length;u--;)f(a[u]);d||(u="value","progress"==T&&null==b?n.removeAttribute("value"):null!=b&&(b!==n[u]||"progress"==T&&!b||"option"==T&&b!=k[u])&&O(n,u,b,k[u],r),u="checked",null!=y&&y!=n[u]&&O(n,u,y,k[u],r))}return n}(s.__e,i,s,o,r,a,c,l,u);return(m=t.diffed)&&m(i),128&i.__u?void 0:d}function A(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(A))}function N(e,n,i){for(var s=0;s<i.length;s++)F(i[s],i[++s],i[++s]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(i){t.__e(i,n.__v)}})}function U(e){return"object"!=typeof e||null==e||e.__b>0?e:g(e)?e.map(U):v({},e)}function F(e,n,i){try{if("function"==typeof e){var s="function"==typeof e.__u;s&&e.__u(),s&&null==n||(e.__u=e(n))}else e.current=n}catch(o){t.__e(o,i)}}function j(e,n,i){var s,o;if(t.unmount&&t.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||F(s,null,n)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(r){t.__e(r,n)}s.base=s.__P=null}if(s=e.__k)for(o=0;o<s.length;o++)s[o]&&j(s[o],n,i||"function"!=typeof e.type);i||f(e.__e),e.__c=e.__=e.__e=void 0}function B(e,t,n){return this.constructor(e,n)}function q(n,i,s){var o,r,a,c;i==document&&(i=document.documentElement),t.__&&t.__(n,i),r=(o="function"==typeof s)?null:s&&s.__k||i.__k,a=[],c=[],x(i,n=(!o&&s||i).__k=_(y,null,[n]),r||h,h,i.namespaceURI,!o&&s?[s]:r?null:i.firstChild?e.call(i.childNodes):null,a,!o&&s?s:r?r.__e:i.firstChild,o,c),N(a,n,c)}function V(e,t){q(e,t,V)}function W(t,n,i){var s,o,r,a,c=v({},t.props);for(r in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),n)"key"==r?s=n[r]:"ref"==r?o=n[r]:c[r]=void 0===n[r]&&null!=a?a[r]:n[r];return arguments.length>2&&(c.children=arguments.length>3?e.call(arguments,2):i),b(t.type,c,s||t.key,o||t.ref,null)}function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},H.apply(this,arguments)}function z(e,t){if(null==e)return{};var n,i,s={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(n=o[i])>=0||(s[n]=e[n]);return s}e=p.slice,t={__e:function(e,t,n,i){for(var s,o,r;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(e)),r=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,i||{}),r=s.__d),r)return s.__E=s}catch(a){e=a}throw e}},n=0,k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),S(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),S(this))},k.prototype.render=y,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,r=function(e,t){return e.__v.__b-t.__v.__b},E.__r=0,a=/(PointerCapture)$|Capture$/i,c=0,d=D(!1),l=D(!0),u=0;var G=["context","children"],J=["useFragment"];function K(e){return this.getChildContext=function(){return e.context},W(e.children,z(e,G))}function $(e){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=_(K,H({},this._props,{context:t.detail.context}),ee(this,this._vdomComponent,e)),(this.hasAttribute("hydrate")?V:q)(this._vdom,this._root)}function Q(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function Y(e,t,n){if(this._vdom){var i={};i[e]=n=null==n?void 0:n,i[Q(e)]=n,this._vdom=W(this._vdom,i),q(this._vdom,this._root)}}function X(){q(this._vdom=null,this._root)}function Z(e,t){var n=this;return _(e.useFragment?y:"slot",H({},z(e,J),{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function ee(e,t,n){if(3===e.nodeType)return e.data;if(1!==e.nodeType)return null;var i=[],s={},o=0,r=e.attributes,a=e.childNodes;for(o=r.length;o--;)"slot"!==r[o].name&&(s[r[o].name]=r[o].value,s[Q(r[o].name)]=r[o].value);for(o=a.length;o--;){var c=ee(a[o],null,n),d=a[o].slot;d?s[d]=_(Z,{name:d},c):i[o]=c}var l=!(!n||!n.shadow),u=t?_(Z,{useFragment:!l},i):i;return!l&&t&&(e.innerHTML=""),_(t||e.nodeName.toLowerCase(),s,u)}var te=0;function ne(e,n,i,s,o,r){n||(n={});var a,c,d=n;if("ref"in d)for(c in d={},n)"ref"==c?a=n[c]:d[c]=n[c];var l={type:e,props:d,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--te,__i:-1,__u:0,__source:o,__self:r};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===d[c]&&(d[c]=a[c]);return t.vnode&&t.vnode(l),l}var ie,se,oe,re,ae=0,ce=[],de=t,le=de.__b,ue=de.__r,he=de.diffed,pe=de.__c,me=de.unmount,ge=de.__;function ve(e,t){de.__h&&de.__h(se,e,ae||t),ae=0;var n=se.__H||(se.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function fe(e){return ae=1,function(e,t,n){var i=ve(ie++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Re(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=se,!se.__f)){var s=function(e,t,n){if(!i.__c.__H)return!0;var s=i.__c.__H.__.filter(function(e){return e.__c});if(s.every(function(e){return!e.__N}))return!o||o.call(this,e,t,n);var r=i.__c.props!==e;return s.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(r=!0)}}),o&&o.call(this,e,t,n)||r};se.__f=!0;var o=se.shouldComponentUpdate,r=se.componentWillUpdate;se.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,s(e,t,n),o=i}r&&r.call(this,e,t,n)},se.shouldComponentUpdate=s}return i.__N||i.__}(Re,e)}function _e(e,t){var n=ve(ie++,3);!de.__s&&Ie(n.__H,t)&&(n.__=e,n.u=t,se.__H.__h.push(n))}function be(e){return ae=5,ke(function(){return{current:e}},[])}function ye(e,t,n){ae=6,function(e,t){var n=ve(ie++,4);!de.__s&&Ie(n.__H,t)&&(n.__=e,n.u=t,se.__h.push(n))}(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function ke(e,t){var n=ve(ie++,7);return Ie(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ce(e,t){return ae=8,ke(function(){return e},t)}function we(){for(var e;e=ce.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ee),t.__h.some(Pe),t.__h=[]}catch(n){t.__h=[],de.__e(n,e.__v)}}}de.__b=function(e){se=null,le&&le(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ge&&ge(e,t)},de.__r=function(e){ue&&ue(e),ie=0;var t=(se=e.__c).__H;t&&(oe===se?(t.__h=[],se.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ee),t.__h.some(Pe),t.__h=[],ie=0)),oe=se},de.diffed=function(e){he&&he(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ce.push(t)&&re===de.requestAnimationFrame||((re=de.requestAnimationFrame)||Se)(we)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),oe=se=null},de.__c=function(e,t){t.some(function(e){try{e.__h.some(Ee),e.__h=e.__h.filter(function(e){return!e.__||Pe(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],de.__e(n,e.__v)}}),pe&&pe(e,t)},de.unmount=function(e){me&&me(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Ee(e)}catch(n){t=n}}),n.__H=void 0,t&&de.__e(t,n.__v))};var Te="function"==typeof requestAnimationFrame;function Se(e){var t,n=function(){clearTimeout(i),Te&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);Te&&(t=requestAnimationFrame(n))}function Ee(e){var t=se,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),se=t}function Pe(e){var t=se;e.__c=e.__(),se=t}function Ie(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Re(e,t){return"function"==typeof t?t(e):t}const Me=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Le=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Oe=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var De={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"};const xe=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},Ae=({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,children:s,iconNode:o,class:r="",...a})=>_("svg",{...De,width:String(t),height:t,stroke:e,"stroke-width":i?24*Number(n)/Number(t):n,class:["lucide",r].join(" "),...!s&&!xe(a)&&{"aria-hidden":"true"},...a},[...o.map(([e,t])=>_(e,t)),...R(s)]),Ne=(e,t)=>{const n=({class:n="",className:i="",children:s,...o})=>_(Ae,{...o,iconNode:t,class:Me(`lucide-${Le(Oe(e))}`,`lucide-${Le(e)}`,n,i)},s);return n.displayName=Oe(e),n},Ue=Ne("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]),Fe=Ne("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),je=Ne("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"}]]),Be=Ne("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"}]]),qe=Ne("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"}]]),Ve=Ne("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),We=Ne("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),He=Ne("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),ze=Ne("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ge(e,t){for(var n in t)e[n]=t[n];return e}function Je(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function Ke(e,t){this.props=e,this.context=t}(Ke.prototype=new k).isPureReactComponent=!0,Ke.prototype.shouldComponentUpdate=function(e,t){return Je(this.props,e)||Je(this.state,t)};var $e=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),$e&&$e(e)};var Qe="undefined"!=typeof Symbol&&Symbol.for&&/* @__PURE__ */Symbol.for("react.forward_ref")||3911;var Ye=t.__e;t.__e=function(e,t,n,i){if(e.then)for(var s,o=t;o=o.__;)if((s=o.__c)&&s.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t);Ye(e,t,n,i)};var Xe=t.unmount;function Ze(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Ge({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ze(e,t,n)})),e}function et(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return et(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function tt(){this.__u=0,this.o=null,this.__b=null}function nt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function it(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Xe&&Xe(e)},(tt.prototype=new k).__c=function(e,t){var n=t.__c,i=this;null==i.o&&(i.o=[]),i.o.push(n);var s=nt(i.__v),o=!1,r=function(){o||i.__z||(o=!0,n.__R=null,s?s(c):c())};n.__R=r;var a=n.__P;n.__P=null;var c=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=et(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.o.pop();)t.__P=a,t.forceUpdate()}};i.__u++||32&t.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(r,r)},tt.prototype.componentWillUnmount=function(){this.o=[]},tt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Ze(this.__b,n,i.__O=i.__P)}this.__b=null}var s=t.__a&&_(y,null,e.fallback);return s&&(s.__u&=-33),[_(y,null,t.__a?null:e.children),s]};var st=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function ot(e){return this.getChildContext=function(){return e.context},e.children}function rt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){q(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var i=t.__v;null!==i&&!i.__m&&null!==i.__;)i=i.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:i.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}q(_(ot,{context:t.context},e.__v),t.v)}(it.prototype=new k).__a=function(e){var t=this,n=nt(t.__v),i=t.l.get(e);return i[0]++,function(s){var o=function(){t.props.revealOrder?(i.push(s),st(t,e,i)):s()};n?n(o):o()}},it.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=R(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},it.prototype.componentDidUpdate=it.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){st(e,n,t)})};var at="undefined"!=typeof Symbol&&Symbol.for&&/* @__PURE__ */Symbol.for("react.element")||60103,ct=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,dt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,lt=/[A-Z0-9]/g,ut="undefined"!=typeof document,ht=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof/* @__PURE__ */Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};k.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(k.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var pt=t.event;t.event=function(e){return pt&&(e=pt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var mt={configurable:!0,get:function(){return this.class}},gt=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={},s=-1==n.indexOf("-");for(var o in t){var r=t[o];if(!("value"===o&&"defaultValue"in t&&null==r||ut&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||ht(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":dt.test(o)&&(o=a):a=o="oninput":s&&ct.test(o)?o=o.replace(lt,"-$&").toLowerCase():null===r&&(r=void 0),"oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=r}}"select"==n&&(i.multiple&&Array.isArray(i.value)&&(i.value=R(t.children).forEach(function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)})),null!=i.defaultValue&&(i.value=R(t.children).forEach(function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",mt)):t.className&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=at,gt&&gt(e)};var vt=t.__r;t.__r=function(e){vt&&vt(e),e.__c};var ft=t.diffed;function _t(e){return(_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bt(e){var t=function(e,t){if("object"!=_t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=_t(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_t(t)?t:t+""}function yt(e,t,n){return(t=bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t.diffed=function(e){ft&&ft(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var kt=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},Ct=class{constructor(){yt(this,"_lastHandleId",0),yt(this,"_lastImmediate",null)}requestAnimationFrame(e){return this._lastHandleId>=2**53-1&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{e(Date.now())}),this._lastHandleId}cancelAnimationFrame(e){this._lastImmediate&&clearImmediate(this._lastImmediate)}},wt=class{constructor(){yt(this,"_strategy",void 0),this._strategy="function"==typeof requestAnimationFrame?new kt:new Ct}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}};const Tt=typeof window<"u"&&void 0!==window.document,St=new Uint8Array([80,75,3,4]),Et=["v","ip","op","layers","fr","w","h"],Pt="0.66.0",It="@lottiefiles/dotlottie-web";let Rt;function Mt(e){let t=Rt.__externref_table_alloc_command_export();return Rt.__wbindgen_export_2.set(t,e),t}let Lt=0,Ot=null;function Dt(){return(null===Ot||0===Ot.byteLength)&&(Ot=new Uint8Array(Rt.memory.buffer)),Ot}const xt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},At="function"==typeof xt.encodeInto?function(e,t){return xt.encodeInto(e,t)}:function(e,t){let n=xt.encode(e);return t.set(n),{read:e.length,written:n.length}};function Nt(e,t,n){if(void 0===n){let n=xt.encode(e),i=t(n.length,1)>>>0;return Dt().subarray(i,i+n.length).set(n),Lt=n.length,i}let i=e.length,s=t(i,1)>>>0,o=Dt(),r=0;for(;r<i;r++){let t=e.charCodeAt(r);if(t>127)break;o[s+r]=t}if(r!==i){0!==r&&(e=e.slice(r)),s=n(s,i,i=r+3*e.length,1)>>>0;let t=Dt().subarray(s+r,s+i);r+=At(e,t).written,s=n(s,i,r,1)>>>0}return Lt=r,s}function Ut(e){return null==e}let Ft=null;function jt(){return(null===Ft||!0===Ft.buffer.detached||void 0===Ft.buffer.detached&&Ft.buffer!==Rt.memory.buffer)&&(Ft=new DataView(Rt.memory.buffer)),Ft}const Bt=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};function qt(e,t){return e>>>=0,Bt.decode(Dt().subarray(e,e+t))}function Vt(e,t){let n=t(1*e.length,1)>>>0;return Dt().set(e,n/1),Lt=e.length,n}typeof TextDecoder<"u"&&Bt.decode();let Wt=null;function Ht(e,t){let n=t(4*e.length,4)>>>0;return((null===Wt||0===Wt.byteLength)&&(Wt=new Float32Array(Rt.memory.buffer)),Wt).set(e,n/4),Lt=e.length,n}const zt=Object.freeze({Forward:0,0:"Forward",Reverse:1,1:"Reverse",Bounce:2,2:"Bounce",ReverseBounce:3,3:"ReverseBounce"}),Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>Rt.__wbg_dotlottieplayerwasm_free(e>>>0,1));var Jt=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){let e=this.__destroy_into_raw();Rt.__wbg_dotlottieplayerwasm_free(e,0)}constructor(){return this.__wbg_ptr=Rt.dotlottieplayerwasm_new()>>>0,Gt.register(this,this.__wbg_ptr,this),this}load_animation(e,t,n){let i=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_load_animation(this.__wbg_ptr,i,s,t,n)}load_dotlottie_data(e,t,n){let i=Vt(e,Rt.__wbindgen_malloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,i,s,t,n)}load_animation_from_id(e,t,n){let i=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,i,s,t,n)}tick(){return 0!==Rt.dotlottieplayerwasm_tick(this.__wbg_ptr)}render(){return 0!==Rt.dotlottieplayerwasm_render(this.__wbg_ptr)}clear(){Rt.dotlottieplayerwasm_clear(this.__wbg_ptr)}resize(e,t){return 0!==Rt.dotlottieplayerwasm_resize(this.__wbg_ptr,e,t)}get_pixel_buffer(){return Rt.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}play(){return 0!==Rt.dotlottieplayerwasm_play(this.__wbg_ptr)}pause(){return 0!==Rt.dotlottieplayerwasm_pause(this.__wbg_ptr)}stop(){return 0!==Rt.dotlottieplayerwasm_stop(this.__wbg_ptr)}is_playing(){return 0!==Rt.dotlottieplayerwasm_is_playing(this.__wbg_ptr)}is_paused(){return 0!==Rt.dotlottieplayerwasm_is_paused(this.__wbg_ptr)}is_stopped(){return 0!==Rt.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)}is_loaded(){return 0!==Rt.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)}is_complete(){return 0!==Rt.dotlottieplayerwasm_is_complete(this.__wbg_ptr)}is_tweening(){return 0!==Rt.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)}current_frame(){return Rt.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}total_frames(){return Rt.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}request_frame(){return Rt.dotlottieplayerwasm_request_frame(this.__wbg_ptr)}set_frame(e){return 0!==Rt.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)}seek(e){return 0!==Rt.dotlottieplayerwasm_seek(this.__wbg_ptr,e)}duration(){return Rt.dotlottieplayerwasm_duration(this.__wbg_ptr)}segment_duration(){return Rt.dotlottieplayerwasm_segment_duration(this.__wbg_ptr)}current_loop_count(){return Rt.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}reset_current_loop_count(){Rt.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}width(){return Rt.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return Rt.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}animation_size(){return Rt.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}mode(){return Rt.dotlottieplayerwasm_mode(this.__wbg_ptr)}set_mode(e){Rt.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}speed(){return Rt.dotlottieplayerwasm_speed(this.__wbg_ptr)}set_speed(e){Rt.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}loop_animation(){return 0!==Rt.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)}set_loop(e){Rt.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}loop_count(){return Rt.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}set_loop_count(e){Rt.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}autoplay(){return 0!==Rt.dotlottieplayerwasm_autoplay(this.__wbg_ptr)}set_autoplay(e){Rt.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}use_frame_interpolation(){return 0!==Rt.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)}set_use_frame_interpolation(e){Rt.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}background_color(){return Rt.dotlottieplayerwasm_background_color(this.__wbg_ptr)>>>0}set_background_color(e){return 0!==Rt.dotlottieplayerwasm_set_background_color(this.__wbg_ptr,e)}clear_background_color(){return 0!==Rt.dotlottieplayerwasm_clear_background_color(this.__wbg_ptr)}set_quality(e){return 0!==Rt.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)}has_segment(){return 0!==Rt.dotlottieplayerwasm_has_segment(this.__wbg_ptr)}segment_start(){return Rt.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}segment_end(){return Rt.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_segment(e,t){return 0!==Rt.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)}clear_segment(){return 0!==Rt.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)}set_layout(e,t,n){let i=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_set_layout(this.__wbg_ptr,i,s,t,n)}layout_fit(){let e,t;try{let n=Rt.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],qt(n[0],n[1])}finally{Rt.__wbindgen_free_command_export(e,t,1)}}layout_align_x(){return Rt.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return Rt.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}set_viewport(e,t,n,i){return 0!==Rt.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,i)}set_color_slot(e,t,n,i){let s=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),o=Lt;return 0!==Rt.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,s,o,t,n,i)}set_scalar_slot(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,i,t)}set_text_slot(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Nt(t,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),o=Lt;return 0!==Rt.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,i,s,o)}set_vector_slot(e,t,n){let i=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,i,s,t,n)}set_position_slot(e,t,n){let i=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,i,s,t,n)}clear_slots(){return 0!==Rt.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)}clear_slot(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)}set_slots_str(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)}set_slot_str(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Nt(t,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),o=Lt;return 0!==Rt.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,i,s,o)}get_slot_str(e){let t,n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Rt.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,n,i);return 0!==s[0]&&(t=qt(s[0],s[1]).slice(),Rt.__wbindgen_free_command_export(s[0],1*s[1],1)),t}get_slots_str(){let e,t;try{let n=Rt.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],qt(n[0],n[1])}finally{Rt.__wbindgen_free_command_export(e,t,1)}}get_slot_ids(){return Rt.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_type(e){let t,n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Rt.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,n,i);return 0!==s[0]&&(t=qt(s[0],s[1]).slice(),Rt.__wbindgen_free_command_export(s[0],1*s[1],1)),t}reset_slot(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)}reset_slots(){return 0!==Rt.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)}intersect(e,t,n){let i=Nt(n,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;return 0!==Rt.dotlottieplayerwasm_intersect(this.__wbg_ptr,e,t,i,s)}get_layer_bounds(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return Rt.dotlottieplayerwasm_get_layer_bounds(this.__wbg_ptr,t,n)}get_transform(){return Rt.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}set_transform(e){let t=Ht(e,Rt.__wbindgen_malloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)}tween(e,t){return 0!==Rt.dotlottieplayerwasm_tween(this.__wbg_ptr,e,Ut(t)?4294967297:Math.fround(t))}tween_with_easing(e,t,n,i,s,o){return 0!==Rt.dotlottieplayerwasm_tween_with_easing(this.__wbg_ptr,e,Ut(t)?4294967297:Math.fround(t),n,i,s,o)}tween_stop(){return 0!==Rt.dotlottieplayerwasm_tween_stop(this.__wbg_ptr)}tween_update(e){return 0!==Rt.dotlottieplayerwasm_tween_update(this.__wbg_ptr,Ut(e)?4294967297:Math.fround(e))}tween_to_marker(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_tween_to_marker(this.__wbg_ptr,n,i,Ut(t)?4294967297:Math.fround(t))}markers(){return Rt.dotlottieplayerwasm_markers(this.__wbg_ptr)}marker_names(){return Rt.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}current_marker(){let e,t=Rt.dotlottieplayerwasm_current_marker(this.__wbg_ptr);return 0!==t[0]&&(e=qt(t[0],t[1]).slice(),Rt.__wbindgen_free_command_export(t[0],1*t[1],1)),e}set_marker(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;Rt.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_marker(){Rt.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}poll_event(){return Rt.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}emit_on_loop(){Rt.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}load_font(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Vt(t,Rt.__wbindgen_malloc_command_export),o=Lt;return 0!==Rt.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,i,s,o)}static unload_font(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_unload_font(t,n)}set_theme(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)}reset_theme(){return 0!==Rt.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)}set_theme_data(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)}theme_id(){let e,t=Rt.dotlottieplayerwasm_theme_id(this.__wbg_ptr);return 0!==t[0]&&(e=qt(t[0],t[1]).slice(),Rt.__wbindgen_free_command_export(t[0],1*t[1],1)),e}animation_id(){let e,t=Rt.dotlottieplayerwasm_animation_id(this.__wbg_ptr);return 0!==t[0]&&(e=qt(t[0],t[1]).slice(),Rt.__wbindgen_free_command_export(t[0],1*t[1],1)),e}manifest_string(){let e,t;try{let n=Rt.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],qt(n[0],n[1])}finally{Rt.__wbindgen_free_command_export(e,t,1)}}get_state_machine(e){let t,n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Rt.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,n,i);return 0!==s[0]&&(t=qt(s[0],s[1]).slice(),Rt.__wbindgen_free_command_export(s[0],1*s[1],1)),t}state_machine_id(){let e,t=Rt.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr);return 0!==t[0]&&(e=qt(t[0],t[1]).slice(),Rt.__wbindgen_free_command_export(t[0],1*t[1],1)),e}state_machine_load(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)}state_machine_load_from_id(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)}state_machine_unload(){Rt.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_fire(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;return 0!==Rt.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)}sm_set_numeric_input(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,i,t)}sm_get_numeric_input(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt,i=Rt.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return 4294967297===i?void 0:i}sm_set_string_input(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Nt(t,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),o=Lt;return 0!==Rt.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,i,s,o)}sm_get_string_input(e){let t,n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Rt.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,n,i);return 0!==s[0]&&(t=qt(s[0],s[1]).slice(),Rt.__wbindgen_free_command_export(s[0],1*s[1],1)),t}sm_set_boolean_input(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,i,t)}sm_get_boolean_input(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt,i=Rt.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return 16777215===i?void 0:0!==i}sm_reset_input(e){let t=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),n=Lt;Rt.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}sm_poll_event(){return Rt.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_start(e,t){let n=function(e,t){let n=t(4*e.length,4)>>>0;for(let i=0;i<e.length;i++){let t=Mt(e[i]);jt().setUint32(n+4*i,t,!0)}return Lt=e.length,n}(t,Rt.__wbindgen_malloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,i)}sm_stop(){return 0!==Rt.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)}sm_status(){let e,t;try{let n=Rt.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],qt(n[0],n[1])}finally{Rt.__wbindgen_free_command_export(e,t,1)}}sm_current_state(){let e,t;try{let n=Rt.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],qt(n[0],n[1])}finally{Rt.__wbindgen_free_command_export(e,t,1)}}sm_override_current_state(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt;return 0!==Rt.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,i,t)}sm_framework_setup(){return Rt.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_get_inputs(){return Rt.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_post_click(e,t){Rt.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}sm_post_pointer_down(e,t){Rt.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_up(e,t){Rt.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){Rt.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_post_pointer_enter(e,t){Rt.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){Rt.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_poll_internal_event(){return Rt.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}sm_tick(){return 0!==Rt.dotlottieplayerwasm_sm_tick(this.__wbg_ptr)}};function Kt(){let e={wbg:{}};return e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},e.wbg.__wbg_now_807e54c39636c349=function(){return Date.now()},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return function(e,t){try{return e.apply(this,t)}catch(n){let e=Mt(n);Rt.__wbindgen_exn_store_command_export(e)}}(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbindgen_init_externref_table=function(){let e=Rt.__wbindgen_export_2,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return Rt.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n="string"==typeof t?t:void 0;var i=Ut(n)?0:Nt(n,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),s=Lt;jt().setInt32(e+4,s,!0),jt().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return qt(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(qt(e,t))},e}async function $t(e){if(void 0!==Rt)return Rt;if(void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===e)throw Error("WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().");let t=Kt();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:i}=await async function(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}let i=await e.arrayBuffer();return await WebAssembly.instantiate(i,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}(await e,t);return function(e,t){return Rt=e.exports,$t.__wbindgen_wasm_module=t,Ft=null,Wt=null,Ot=null,Rt.__wbindgen_start(),Rt}(n,i)}var Qt=class{constructor(){yt(this,"_eventListeners",/* @__PURE__ */new Map)}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=/* @__PURE__ */new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),0===n.size&&this._eventListeners.delete(e)):this._eventListeners.delete(e))}dispatch(e){this._eventListeners.get(e.type)?.forEach(t=>t(e))}removeAllEventListeners(){this._eventListeners.clear()}},Yt=class e{static _initializeObserver(){e._observer||(e._observer=new IntersectionObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);n&&(t.isIntersecting?n.unfreeze():n.freeze())})},{threshold:0}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,n),e._observer?.observe(t))}static unobserve(t){e._observer?.unobserve(t),e._observedCanvases.delete(t),0===e._observedCanvases.size&&(e._observer?.disconnect(),e._observer=null)}};yt(Yt,"_observer",null),yt(Yt,"_observedCanvases",/* @__PURE__ */new Map);var Xt=class e{static _initializeObserver(){e._observer||(e._observer=new ResizeObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);if(!n)return;let[i,s]=n;clearTimeout(s);let o=setTimeout(()=>{i.resize()},100);e._observedCanvases.set(t.target,[i,o])})}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,[n,0]),e._observer?.observe(t))}static unobserve(t){let n=e._observedCanvases.get(t);if(n){let e=n[1];e&&clearTimeout(e)}e._observer?.unobserve(t),e._observedCanvases.delete(t),!e._observedCanvases.size&&e._observer&&(e._observer.disconnect(),e._observer=null)}};function Zt(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,St.byteLength));for(let n=0;n<St.length;n+=1)if(St[n]!==t[n])return!1;return!0}function en(e){return Et.every(t=>Object.hasOwn(e,t))}function tn(e){if("string"!=typeof e)return en(e);try{return en(JSON.parse(e))}catch{return!1}}function nn(){return 1+.75*((Tt?window.devicePixelRatio:1)-1)}function sn(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>n||t.right<0||t.left>i)}function on(e){let t=e.target;if(t instanceof HTMLCanvasElement){let n=t.getBoundingClientRect();if(0===n.width||0===n.height||0===t.width||0===t.height)return null;let i=t.width/n.width,s=t.height/n.height,o=(e.clientX-n.left)*i,r=(e.clientY-n.top)*s;return!Number.isFinite(o)||!Number.isFinite(r)||Number.isNaN(o)||Number.isNaN(r)?null:{x:o,y:r}}return null}function rn(e){let t,n,i=e.replace("OpenUrl: ",""),s=i.indexOf(" | Target: ");-1===s?(t=i,n="_blank"):(t=i.substring(0,s),n=i.substring(s+11)),window.open(t,n)}yt(Xt,"_observer",null),yt(Xt,"_observedCanvases",/* @__PURE__ */new Map);const an=function(e,t,n){let i=null,s=t;return{load:()=>(i||(i=e(s).then(()=>{}).catch(async t=>{console.warn(`Primary WASM load failed from ${s}: ${t.message}`),console.warn(`Attempting to load WASM from backup URL: ${n}`);try{await e(n)}catch(o){throw console.error(`Primary WASM URL failed: ${t.message}`),console.error(`Backup WASM URL failed: ${o.message}`),i=null,Error("WASM loading failed from all sources.")}})),i),setWasmUrl(e){e!==s&&(s=e,i=null)}}}($t,`https://cdn.jsdelivr.net/npm/${It}@${Pt}/dist/dotlottie-player.wasm`,`https://unpkg.com/${It}@${Pt}/dist/dotlottie-player.wasm`),cn=e=>{switch(e){case"reverse":return zt.Reverse;case"bounce":return zt.Bounce;case"reverse-bounce":return zt.ReverseBounce;default:return zt.Forward}},dn=e=>{switch(e){case"contain":default:return"contain";case"cover":return"cover";case"fill":return"fill";case"fit-height":return"fit-height";case"fit-width":return"fit-width";case"none":return"none"}};var ln=class{constructor(e){yt(this,"_canvas",null),yt(this,"_pendingLoad",null),yt(this,"_context",null),yt(this,"_eventManager",void 0),yt(this,"_animationFrameId",null),yt(this,"_frameManager",void 0),yt(this,"_dotLottieCore",null),yt(this,"_stateMachineId",""),yt(this,"_stateMachineConfig",null),yt(this,"_isStateMachineRunning",!1),yt(this,"_renderConfig",{}),yt(this,"_isFrozen",!1),yt(this,"_backgroundColor",null),yt(this,"_boundOnClick",null),yt(this,"_boundOnPointerUp",null),yt(this,"_boundOnPointerDown",null),yt(this,"_boundOnPointerMove",null),yt(this,"_boundOnPointerEnter",null),yt(this,"_boundOnPointerLeave",null),yt(this,"_bufferMismatchCount",0),yt(this,"_lastExpectedBufferSize",0),yt(this,"_marker",""),this._canvas=e.canvas??null,this._eventManager=new Qt,this._frameManager=new wt,this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||nn(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(cn(e.mode??"forward")),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&2===e.segment.length&&this._dotLottieCore.set_segment(e.segment[0],e.segment[1]),this._marker=e.marker??"",this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(e.layout?.fit??"contain",e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._stateMachineId=e.stateMachineId??"",this._stateMachineConfig=e.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:"ready"}),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error("[dotlottie-web] Initialization failed:",e),this._eventManager.dispatch({type:"loadError",error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return an.load()}_createCore(){return new Jt}_onCoreCreated(){}_drainPlayerEvents(){if(!this._dotLottieCore)return;let e;for(;null!=(e=this._dotLottieCore.poll_event());){let t=e;switch(t.type){case"Load":setTimeout(()=>this._eventManager.dispatch({type:"load"}),0);break;case"LoadError":setTimeout(()=>this._eventManager.dispatch({type:"loadError",error:Error("failed to load")}),0);break;case"Play":setTimeout(()=>this._eventManager.dispatch({type:"play"}),0);break;case"Pause":setTimeout(()=>this._eventManager.dispatch({type:"pause"}),0);break;case"Stop":setTimeout(()=>this._eventManager.dispatch({type:"stop"}),0);break;case"Frame":setTimeout(()=>this._eventManager.dispatch({type:"frame",currentFrame:t.frameNo??0}),0);break;case"Render":setTimeout(()=>this._eventManager.dispatch({type:"render",currentFrame:t.frameNo??0}),0);break;case"Loop":setTimeout(()=>this._eventManager.dispatch({type:"loop",loopCount:t.loopCount??0}),0);break;case"Complete":setTimeout(()=>this._eventManager.dispatch({type:"complete"}),0)}}}_drainSmEvents(){if(!this._dotLottieCore)return;let e,t;for(;null!=(e=this._dotLottieCore.sm_poll_event());){let t=e;switch(t.type){case"Start":setTimeout(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:"stateMachineStart"}),this._startAnimationLoop()},0);break;case"Stop":setTimeout(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:"stateMachineStop"}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()},0);break;case"CustomEvent":this._eventManager.dispatch({type:"stateMachineCustomEvent",eventName:t.message??""});break;case"BooleanInputChange":this._eventManager.dispatch({type:"stateMachineBooleanInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"NumericInputChange":this._eventManager.dispatch({type:"stateMachineNumericInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"StringInputChange":this._eventManager.dispatch({type:"stateMachineStringInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"InputFired":this._eventManager.dispatch({type:"stateMachineInputFired",inputName:t.name??""});break;case"Transition":this._eventManager.dispatch({type:"stateMachineTransition",fromState:t.previousState??"",toState:t.newState??""});break;case"StateEntered":this._eventManager.dispatch({type:"stateMachineStateEntered",state:t.state??""});break;case"StateExit":this._eventManager.dispatch({type:"stateMachineStateExit",state:t.state??""});break;case"Error":this._eventManager.dispatch({type:"stateMachineError",error:t.message??""})}}for(;null!=(t=this._dotLottieCore.sm_poll_internal_event());){let e=t;if("Message"===e.type){let t=e.message??"";Tt&&t.startsWith("OpenUrl: ")?rn(t):this._eventManager.dispatch({type:"stateMachineInternalMessage",message:t})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:"loadError",error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return Zt(n)?n:(new TextDecoder).decode(n)}_loadFromData(e){if(null===this._dotLottieCore)return;if(!this._canvas)return void console.warn("[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.");let t=this._canvas.width,n=this._canvas.height,i=!1;if("string"==typeof e){if(!tn(e))return void this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");i=this._dotLottieCore.load_animation(e,t,n)}else if(e instanceof ArrayBuffer){if(!Zt(e))return void this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");i=this._dotLottieCore.load_dotlottie_data(new Uint8Array(e),t,n)}else{if("object"!=typeof e)return void this._dispatchError("Unsupported data type for animation data. Expected:\n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON).\n Received: "+typeof e);if(!tn(e))return void this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");i=this._dotLottieCore.load_animation(JSON.stringify(e),t,n)}i?(void 0!==this._renderConfig.quality&&this._dotLottieCore.set_quality(this._renderConfig.quality),Tt&&this.resize(),this._drainPlayerEvents(),this._marker&&this._dotLottieCore.set_marker(this._marker),setTimeout(()=>{this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame})},0),this._dotLottieCore.render(),this._drainPlayerEvents(),this._draw(),this._stateMachineId?this.stateMachineLoad(this._stateMachineId)&&this.stateMachineStart()&&this._startAnimationLoop():this._dotLottieCore.is_playing()&&this._startAnimationLoop(),Tt&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(Yt.observe(this._canvas,this),sn(this._canvas)||this.freeze()),this._renderConfig.autoResize&&Xt.observe(this._canvas,this))):this._drainPlayerEvents()}_loadFromSrc(e){this._fetchData(e).then(e=>this._loadFromData(e)).catch(t=>this._dispatchError(`Failed to load animation data from URL: ${e}. ${t}`))}get buffer(){return this._dotLottieCore?this._dotLottieCore.get_pixel_buffer():null}get activeAnimationId(){return this._dotLottieCore?.animation_id()??void 0}get activeThemeId(){return this._dotLottieCore?.theme_id()??void 0}get layout(){if(this._dotLottieCore)return{align:[this._dotLottieCore.layout_align_x(),this._dotLottieCore.layout_align_y()],fit:dn(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??""}get manifest(){try{let e=this._dotLottieCore?.manifest_string();if(null===this._dotLottieCore||!e)return null;let t=JSON.parse(e);return 0===Object.keys(t).length?null:t}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){if(this._dotLottieCore&&this._dotLottieCore.has_segment())return[this._dotLottieCore.segment_start(),this._dotLottieCore.segment_end()]}get loop(){return this._dotLottieCore?.loop_animation()??!1}get mode(){return this._dotLottieCore?(e=>{switch(e){case zt.Reverse:return"reverse";case zt.Bounce:return"bounce";case zt.ReverseBounce:return"reverse-bounce";default:return"forward"}})(this._dotLottieCore.mode()):"forward"}get isFrozen(){return this._isFrozen}get isStateMachineRunning(){return this._isStateMachineRunning}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.autoplay()??!1}get useFrameInterpolation(){return this._dotLottieCore?.use_frame_interpolation()??!1}get speed(){return this._dotLottieCore?.speed()??0}get isReady(){return null!==this._dotLottieCore}get isLoaded(){return this._dotLottieCore?.is_loaded()??!1}get isPlaying(){return this._dotLottieCore?.is_playing()??!1}get isPaused(){return this._dotLottieCore?.is_paused()??!1}get isStopped(){return this._dotLottieCore?.is_stopped()??!1}get currentFrame(){return this._dotLottieCore?Math.round(100*this._dotLottieCore.current_frame())/100:0}get loopCount(){return this._dotLottieCore?.current_loop_count()??0}get totalFrames(){return this._dotLottieCore?.total_frames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segment_duration()??0}get canvas(){return this._canvas}load(e){null!==this._dotLottieCore&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(cn(e.mode??"forward")),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&2===e.segment.length?this._dotLottieCore.set_segment(e.segment[0],e.segment[1]):this._dotLottieCore.clear_segment(),this._marker=e.marker??"",this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._dotLottieCore.set_layout(e.layout?.fit??"contain",e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),this.setBackgroundColor(e.backgroundColor??""))}_draw(){if(null!==this._dotLottieCore&&null!==this._canvas&&(!this._context&&"getContext"in this._canvas&&"function"==typeof this._canvas.getContext&&(typeof HTMLCanvasElement<"u"&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext("2d")),this._context)){let e=this._dotLottieCore.get_pixel_buffer(),t=this._canvas.width*this._canvas.height*4;if(e.byteLength!==t)return this._lastExpectedBufferSize===t?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=t),void(10===this._bufferMismatchCount&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${t} bytes for canvas ${this._canvas.width}x${this._canvas.height}, but got ${e.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`));this._bufferMismatchCount=0,this._lastExpectedBufferSize=t;let n=null,i=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);typeof ImageData>"u"?(n=this._context.createImageData(this._canvas.width,this._canvas.height),n.data.set(i)):n=new ImageData(i,this._canvas.width,this._canvas.height),this._context.putImageData(n,0,0)}}_cleanupCanvas(){this._canvas&&Tt&&this._canvas instanceof HTMLCanvasElement&&(Yt.unobserve(this._canvas),Xt.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&Tt&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(Yt.observe(this._canvas,this),sn(this._canvas)||this.freeze()),this._renderConfig.autoResize&&Xt.observe(this._canvas,this),this._isStateMachineRunning&&this._setupStateMachineListeners()),this._canvas&&this._dotLottieCore&&this.isLoaded&&this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}_setupRendererOnCanvas(){this._context=null}_stopAnimationLoop(){null!==this._animationFrameId&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null)}_startAnimationLoop(){null===this._animationFrameId&&this._dotLottieCore&&!this._isFrozen&&(this._dotLottieCore.is_playing()||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this)))}_animationLoop(){if(null!==this._dotLottieCore)if(this._dotLottieCore.is_playing()||this._isStateMachineRunning)try{let e=this._isStateMachineRunning?this._dotLottieCore.sm_tick():this._dotLottieCore.tick();this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),e&&this._draw(),this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this))}catch(ep){console.error("Error in animation frame:",ep),this._eventManager.dispatch({type:"renderError",error:ep}),ep instanceof WebAssembly.RuntimeError&&this.destroy()}else this._stopAnimationLoop();else this._stopAnimationLoop()}play(){if(null===this._dotLottieCore||!this.isLoaded)return;this._stopAnimationLoop();let e=this._dotLottieCore.play();this._drainPlayerEvents(),(e||this._dotLottieCore.is_playing())&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&Tt&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!sn(this._canvas)&&this.freeze()}pause(){null!==this._dotLottieCore&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(null===this._dotLottieCore)return;let e=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),e&&(this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(e){if(null!==this._dotLottieCore&&this._dotLottieCore.seek(e)){let e=this._dotLottieCore.render();this._drainPlayerEvents(),e&&this._draw()}}setSpeed(e){null!==this._dotLottieCore&&this._dotLottieCore.set_speed(e)}setBackgroundColor(e){null!==this._dotLottieCore&&(Tt&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=e:this._dotLottieCore.set_background_color(function(e){if(!function(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}(e))return 0;let t=e.replace("#","");return t=6===t.length?`${t}ff`:t,parseInt(t,16)}(e)),this._backgroundColor=e)}setLoop(e){null!==this._dotLottieCore&&this._dotLottieCore.set_loop(e)}setLoopCount(e){null!==this._dotLottieCore&&this._dotLottieCore.set_loop_count(e)}setUseFrameInterpolation(e){null!==this._dotLottieCore&&this._dotLottieCore.set_use_frame_interpolation(e)}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._dotLottieCore?.free(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners()}freeze(){null!==this._animationFrameId&&(this._stopAnimationLoop(),this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}))}unfreeze(){null===this._animationFrameId&&(this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}),this._startAnimationLoop())}resize(){if(this._dotLottieCore&&this.isLoaded&&this._canvas){if(Tt&&this._canvas instanceof HTMLCanvasElement){let e=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:t,width:n}=this._canvas.getBoundingClientRect();0!==t&&0!==n&&(this._canvas.width=n*e,this._canvas.height=t*e)}this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}}setCanvas(e){if(e&&this._canvas!==e&&(this._canvas&&this._cleanupCanvas(),this._canvas=e,this._initializeCanvas(),this._pendingLoad)){let e=this._pendingLoad;this._pendingLoad=null,e.data?this._loadFromData(e.data):e.src&&this._loadFromSrc(e.src)}}setTransform(e){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.set_transform(new Float32Array(e));return t&&this._dotLottieCore.render()&&this._draw(),t}getTransform(){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_transform();return Array.from(e)}setSegment(e,t){null!==this._dotLottieCore&&this._dotLottieCore.set_segment(e,t)}setMode(e){null!==this._dotLottieCore&&this._dotLottieCore.set_mode(cn(e))}setRenderConfig(e){let{devicePixelRatio:t,freezeOnOffscreen:n,quality:i,...s}=e;this._renderConfig={...this._renderConfig,...s,devicePixelRatio:t||nn(),freezeOnOffscreen:n??!0,...void 0!==i&&{quality:i}},void 0!==i&&this._dotLottieCore&&this._dotLottieCore.set_quality(i),Tt&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?Xt.observe(this._canvas,this):Xt.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(Yt.observe(this._canvas,this),sn(this._canvas)||this.freeze()):(Yt.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(e){null===this._dotLottieCore||this._dotLottieCore.animation_id()===e||!this._canvas||(this._dotLottieCore.load_animation_from_id(e,this._canvas.width,this._canvas.height)?(void 0!==this._renderConfig.quality&&this._dotLottieCore.set_quality(this._renderConfig.quality),this.resize(),this._drainPlayerEvents(),this._dotLottieCore.render(),this._draw()):this._dispatchError(`Failed to load animation with id: ${e}`))}setMarker(e){null!==this._dotLottieCore&&(this._marker=e,this._dotLottieCore.set_marker(e))}markers(){let e=this._dotLottieCore?.markers();return e&&Array.isArray(e)?e:[]}setTheme(e){if(null===this._dotLottieCore)return!1;let t=this._dotLottieCore.set_theme(e);return t&&(this._dotLottieCore.render(),this._draw()),t}resetTheme(){if(null===this._dotLottieCore)return!1;let e=this._dotLottieCore.reset_theme();return e&&(this._dotLottieCore.render(),this._draw()),e}setThemeData(e){if(null===this._dotLottieCore)return!1;let t="string"==typeof e?e:JSON.stringify(e),n=this._dotLottieCore.set_theme_data(t);return n&&(this._dotLottieCore.render(),this._draw()),n}setSlots(e){null!==this._dotLottieCore&&this._dotLottieCore.set_slots_str(JSON.stringify(e))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]&&"t"in e[0]&&"s"in e[0]}getSlotIds(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.get_slot_ids();return Array.isArray(e)?e:[]}getSlotType(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_type(e);return t||void 0}getSlot(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_str(e);if(t)try{return JSON.parse(t)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(e,t){if(null===this._dotLottieCore)return!1;let n=this._isKeyframeArray(t),i=JSON.stringify({a:n?1:0,k:t}),s=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),s}setScalarSlot(e,t){if(null===this._dotLottieCore)return!1;let n="number"!=typeof t,i=JSON.stringify({a:n?1:0,k:t}),s=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),s}setVectorSlot(e,t){if(null===this._dotLottieCore)return!1;let n=this._isKeyframeArray(t),i=JSON.stringify({a:n?1:0,k:t}),s=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),s}setGradientSlot(e,t,n){if(null===this._dotLottieCore)return!1;let i=this._isKeyframeArray(t),s=JSON.stringify({k:{a:i?1:0,k:t},p:n}),o=this._dotLottieCore.set_slot_str(e,s);return this._dotLottieCore.render(),this._draw(),o}setTextSlot(e,t){if(null===this._dotLottieCore)return!1;let n=this._dotLottieCore.get_slot_str(e),i=t;if(n){let e=JSON.parse(n);if(e&&"k"in e&&Array.isArray(e.k)){let n=e.k[0];"s"in n&&"object"==typeof n.s&&(i={...n.s,...t})}}let s=JSON.stringify({a:0,k:[{t:0,s:i}]}),o=this._dotLottieCore.set_slot_str(e,s);return this._dotLottieCore.render(),this._draw(),o}resetSlot(e){if(null===this._dotLottieCore)return!1;let t=this._dotLottieCore.reset_slot(e);return this._dotLottieCore.render(),this._draw(),t}clearSlot(e){if(null===this._dotLottieCore)return!1;let t=this._dotLottieCore.clear_slot(e);return this._dotLottieCore.render(),this._draw(),t}resetSlots(){if(null===this._dotLottieCore)return!1;let e=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),e}clearSlots(){if(null===this._dotLottieCore)return!1;let e=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),e}setLayout(e){null!==this._dotLottieCore&&this._dotLottieCore.set_layout(e.fit??"contain",e.align?.[0]??.5,e.align?.[1]??.5)}setViewport(e,t,n,i){return null!==this._dotLottieCore&&this._dotLottieCore.set_viewport(e,t,n,i)}static setWasmUrl(e){an.setWasmUrl(e)}static async registerFont(e,t){try{let n;if(await an.load(),"string"==typeof t){let e=await fetch(t);if(!e.ok)return console.error(`Failed to fetch font from URL: ${t}. Status: ${e.status}`),!1;n=new Uint8Array(await e.arrayBuffer())}else n=t instanceof Uint8Array?t:new Uint8Array(t);let i=function(e,t){let n=Nt(e,Rt.__wbindgen_malloc_command_export,Rt.__wbindgen_realloc_command_export),i=Lt,s=Vt(t,Rt.__wbindgen_malloc_command_export),o=Lt;return 0!==Rt.register_font(n,i,s,o)}(e,n);return i||console.error(`Failed to register font "${e}". Font data may be invalid.`),i}catch(n){return console.error(`Error registering font "${e}":`,n),!1}}tween(e,t){return!!this._dotLottieCore&&this._dotLottieCore.tween_with_easing(e,t,0,0,1,1)}tweenToMarker(e,t){return!!this._dotLottieCore&&this._dotLottieCore.tween_to_marker(e,t)}animationSize(){let e=this._dotLottieCore?.animation_size();return{width:e?.[0]??0,height:e?.[1]??0}}getLayerBoundingBox(e){let t=this._dotLottieCore?.get_layer_bounds(e);if(t&&8===t.length)return Array.from(t)}static transformThemeToLottieSlots(e,t){return""}stateMachineLoad(e){return!!this._dotLottieCore&&this._dotLottieCore.state_machine_load_from_id(e)}stateMachineLoadData(e){return!!this._dotLottieCore&&this._dotLottieCore.state_machine_load(e)}stateMachineSetConfig(e){this._stateMachineConfig=e}stateMachineStart(){if(null===this._dotLottieCore)return!1;let e=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),e&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),e}stateMachineStop(){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.sm_stop();return this._drainSmEvents(),e&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.is_playing()||this._stopAnimationLoop()),e}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??""}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??""}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??""}stateMachineOverrideState(e,t=!1){return this._dotLottieCore?.sm_override_current_state(e,t)??!1}stateMachineGet(e){return this._dotLottieCore?.get_state_machine(e)??""}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_framework_setup();return Array.isArray(e)?e:[]}stateMachineSetBooleanInput(e,t){return this._dotLottieCore?.sm_set_boolean_input(e,t)??!1}stateMachineSetNumericInput(e,t){return this._dotLottieCore?.sm_set_numeric_input(e,t)??!1}stateMachineSetStringInput(e,t){return this._dotLottieCore?.sm_set_string_input(e,t)??!1}stateMachineGetBooleanInput(e){return this._dotLottieCore?.sm_get_boolean_input(e)??void 0}stateMachineGetNumericInput(e){return this._dotLottieCore?.sm_get_numeric_input(e)??void 0}stateMachineGetStringInput(e){return this._dotLottieCore?.sm_get_string_input(e)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_get_inputs();return Array.isArray(e)?e:[]}stateMachineFireEvent(e){this._dotLottieCore?.sm_fire(e)}stateMachinePostClickEvent(e,t){this._dotLottieCore?.sm_post_click(e,t)}stateMachinePostPointerUpEvent(e,t){this._dotLottieCore?.sm_post_pointer_up(e,t)}stateMachinePostPointerDownEvent(e,t){this._dotLottieCore?.sm_post_pointer_down(e,t)}stateMachinePostPointerMoveEvent(e,t){this._dotLottieCore?.sm_post_pointer_move(e,t)}stateMachinePostPointerEnterEvent(e,t){this._dotLottieCore?.sm_post_pointer_enter(e,t)}stateMachinePostPointerExitEvent(e,t){this._dotLottieCore?.sm_post_pointer_exit(e,t)}_onClick(e){let t=on(e);t&&this.stateMachinePostClickEvent(t.x,t.y)}_onPointerUp(e){let t=on(e);t&&this.stateMachinePostPointerUpEvent(t.x,t.y)}_onPointerDown(e){let t=on(e);t&&this.stateMachinePostPointerDownEvent(t.x,t.y)}_onPointerMove(e){let t=on(e);t&&this.stateMachinePostPointerMoveEvent(t.x,t.y)}_onPointerEnter(e){let t=on(e);t&&this.stateMachinePostPointerEnterEvent(t.x,t.y)}_onPointerLeave(e){let t=on(e);t&&this.stateMachinePostPointerExitEvent(t.x,t.y)}_setupStateMachineListeners(){if(Tt&&this._canvas instanceof HTMLCanvasElement&&null!==this._dotLottieCore&&this.isLoaded){let e=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),e.includes("Click")&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener("click",this._boundOnClick)),e.includes("PointerUp")&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener("pointerup",this._boundOnPointerUp)),e.includes("PointerDown")&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener("pointerdown",this._boundOnPointerDown)),e.includes("PointerMove")&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener("pointermove",this._boundOnPointerMove)),e.includes("PointerEnter")&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener("pointerenter",this._boundOnPointerEnter)),e.includes("PointerExit")&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener("pointerleave",this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){Tt&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener("click",this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener("pointerup",this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener("pointerdown",this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener("pointermove",this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener("pointerenter",this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener("pointerleave",this._boundOnPointerLeave),this._boundOnPointerLeave=null))}},un=class{constructor(){if(typeof Worker>"u")throw Error("Worker is not supported in this environment.");let e=new Blob([new Uint8Array([34,117,115,101,32,115,116,114,105,99,116,34,59,40,40,41,61,62,123,118,97,114,32,115,116,61,79,98,106,101,99,116,46,100,101,102,105,110,101,80,114,111,112,101,114,116,121,59,118,97,114,32,105,116,61,40,110,44,116,44,101,41,61,62,116,32,105,110,32,110,63,115,116,40,110,44,116,44,123,101,110,117,109,101,114,97,98,108,101,58,33,48,44,99,111,110,102,105,103,117,114,97,98,108,101,58,33,48,44,119,114,105,116,97,98,108,101,58,33,48,44,118,97,108,117,101,58,101,125,41,58,110,91,116,93,61,101,59,118,97,114,32,108,61,40,110,44,116,44,101,41,61,62,105,116,40,110,44,116,121,112,101,111,102,32,116,33,61,34,115,121,109,98,111,108,34,63,116,43,34,34,58,116,44,101,41,59,118,97,114,32,70,61,99,108,97,115,115,123,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,125,44,79,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,108,97,115,116,72,97,110,100,108,101,73,100,34,44,48,41,59,108,40,116,104,105,115,44,34,95,108,97,115,116,73,109,109,101,100,105,97,116,101,34,44,110,117,108,108,41,125,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,62,61,78,117,109,98,101,114,46,77,65,88,95,83,65,70,69,95,73,78,84,69,71,69,82,38,38,40,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,61,48,41,44,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,43,61,49,44,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,61,115,101,116,73,109,109,101,100,105,97,116,101,40,40,41,61,62,123,116,40,68,97,116,101,46,110,111,119,40,41,41,125,41,44,116,104,105,115,46,95,108,97,115,116,72,97,110,100,108,101,73,100,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,38,38,99,108,101,97,114,73,109,109,101,100,105,97,116,101,40,116,104,105,115,46,95,108,97,115,116,73,109,109,101,100,105,97,116,101,41,125,125,44,82,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,115,116,114,97,116,101,103,121,34,41,59,116,104,105,115,46,95,115,116,114,97,116,101,103,121,61,116,121,112,101,111,102,32,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,61,61,34,102,117,110,99,116,105,111,110,34,63,110,101,119,32,70,58,110,101,119,32,79,125,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,115,116,114,97,116,101,103,121,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,123,116,104,105,115,46,95,115,116,114,97,116,101,103,121,46,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,41,125,125,59,118,97,114,32,103,61,116,121,112,101,111,102,32,119,105,110,100,111,119,60,34,117,34,38,38,116,121,112,101,111,102,32,119,105,110,100,111,119,46,100,111,99,117,109,101,110,116,60,34,117,34,59,118,97,114,32,84,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,91,56,48,44,55,53,44,51,44,52,93,41,44,74,61,91,34,118,34,44,34,105,112,34,44,34,111,112,34,44,34,108,97,121,101,114,115,34,44,34,102,114,34,44,34,119,34,44,34,104,34,93,44,122,61,34,48,46,54,54,46,48,34,44,68,61,34,64,108,111,116,116,105,101,102,105,108,101,115,47,100,111,116,108,111,116,116,105,101,45,119,101,98,34,44,106,61,46,55,53,44,75,61,52,59,118,97,114,32,111,59,102,117,110,99,116,105,111,110,32,88,40,110,41,123,108,101,116,32,116,61,111,46,95,95,101,120,116,101,114,110,114,101,102,95,116,97,98,108,101,95,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,41,59,114,101,116,117,114,110,32,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,112,111,114,116,95,50,46,115,101,116,40,116,44,110,41,44,116,125,102,117,110,99,116,105,111,110,32,97,116,40,110,44,116,41,123,116,114,121,123,114,101,116,117,114,110,32,110,46,97,112,112,108,121,40,116,104,105,115,44,116,41,125,99,97,116,99,104,40,101,41,123,108,101,116,32,114,61,88,40,101,41,59,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,110,95,115,116,111,114,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,114,41,125,125,118,97,114,32,99,61,48,44,67,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,120,40,41,123,114,101,116,117,114,110,40,67,61,61,61,110,117,108,108,124,124,67,46,98,121,116,101,76,101,110,103,116,104,61,61,61,48,41,38,38,40,67,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,67,125,118,97,114,32,107,61,116,121,112,101,111,102,32,84,101,120,116,69,110,99,111,100,101,114,60,34,117,34,63,110,101,119,32,84,101,120,116,69,110,99,111,100,101,114,40,34,117,116,102,45,56,34,41,58,123,101,110,99,111,100,101,58,40,41,61,62,123,116,104,114,111,119,32,69,114,114,111,114,40,34,84,101,120,116,69,110,99,111,100,101,114,32,110,111,116,32,97,118,97,105,108,97,98,108,101,34,41,125,125,44,95,116,61,116,121,112,101,111,102,32,107,46,101,110,99,111,100,101,73,110,116,111,61,61,34,102,117,110,99,116,105,111,110,34,63,102,117,110,99,116,105,111,110,40,110,44,116,41,123,114,101,116,117,114,110,32,107,46,101,110,99,111,100,101,73,110,116,111,40,110,44,116,41,125,58,102,117,110,99,116,105,111,110,40,110,44,116,41,123,108,101,116,32,101,61,107,46,101,110,99,111,100,101,40,110,41,59,114,101,116,117,114,110,32,116,46,115,101,116,40,101,41,44,123,114,101,97,100,58,110,46,108,101,110,103,116,104,44,119,114,105,116,116,101,110,58,101,46,108,101,110,103,116,104,125,125,59,102,117,110,99,116,105,111,110,32,100,40,110,44,116,44,101,41,123,105,102,40,101,61,61,61,118,111,105,100,32,48,41,123,108,101,116,32,112,61,107,46,101,110,99,111,100,101,40,110,41,44,102,61,116,40,112,46,108,101,110,103,116,104,44,49,41,62,62,62,48,59,114,101,116,117,114,110,32,120,40,41,46,115,117,98,97,114,114,97,121,40,102,44,102,43,112,46,108,101,110,103,116,104,41,46,115,101,116,40,112,41,44,99,61,112,46,108,101,110,103,116,104,44,102,125,108,101,116,32,114,61,110,46,108,101,110,103,116,104,44,115,61,116,40,114,44,49,41,62,62,62,48,44,105,61,120,40,41,44,95,61,48,59,102,111,114,40,59,95,60,114,59,95,43,43,41,123,108,101,116,32,112,61,110,46,99,104,97,114,67,111,100,101,65,116,40,95,41,59,105,102,40,112,62,49,50,55,41,98,114,101,97,107,59,105,91,115,43,95,93,61,112,125,105,102,40,95,33,61,61,114,41,123,95,33,61,61,48,38,38,40,110,61,110,46,115,108,105,99,101,40,95,41,41,44,115,61,101,40,115,44,114,44,114,61,95,43,110,46,108,101,110,103,116,104,42,51,44,49,41,62,62,62,48,59,108,101,116,32,112,61,120,40,41,46,115,117,98,97,114,114,97,121,40,115,43,95,44,115,43,114,41,44,102,61,95,116,40,110,44,112,41,59,95,43,61,102,46,119,114,105,116,116,101,110,44,115,61,101,40,115,44,114,44,95,44,49,41,62,62,62,48,125,114,101,116,117,114,110,32,99,61,95,44,115,125,102,117,110,99,116,105,111,110,32,76,40,110,41,123,114,101,116,117,114,110,32,110,61,61,110,117,108,108,125,118,97,114,32,121,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,66,40,41,123,114,101,116,117,114,110,40,121,61,61,61,110,117,108,108,124,124,121,46,98,117,102,102,101,114,46,100,101,116,97,99,104,101,100,61,61,61,33,48,124,124,121,46,98,117,102,102,101,114,46,100,101,116,97,99,104,101,100,61,61,61,118,111,105,100,32,48,38,38,121,46,98,117,102,102,101,114,33,61,61,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,38,38,40,121,61,110,101,119,32,68,97,116,97,86,105,101,119,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,121,125,118,97,114,32,90,61,116,121,112,101,111,102,32,84,101,120,116,68,101,99,111,100,101,114,60,34,117,34,63,110,101,119,32,84,101,120,116,68,101,99,111,100,101,114,40,34,117,116,102,45,56,34,44,123,105,103,110,111,114,101,66,79,77,58,33,48,44,102,97,116,97,108,58,33,48,125,41,58,123,100,101,99,111,100,101,58,40,41,61,62,123,116,104,114,111,119,32,69,114,114,111,114,40,34,84,101,120,116,68,101,99,111,100,101,114,32,110,111,116,32,97,118,97,105,108,97,98,108,101,34,41,125,125,59,116,121,112,101,111,102,32,84,101,120,116,68,101,99,111,100,101,114,60,34,117,34,38,38,90,46,100,101,99,111,100,101,40,41,59,102,117,110,99,116,105,111,110,32,109,40,110,44,116,41,123,114,101,116,117,114,110,32,110,61,110,62,62,62,48,44,90,46,100,101,99,111,100,101,40,120,40,41,46,115,117,98,97,114,114,97,121,40,110,44,110,43,116,41,41,125,102,117,110,99,116,105,111,110,32,36,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,49,44,49,41,62,62,62,48,59,114,101,116,117,114,110,32,120,40,41,46,115,101,116,40,110,44,101,47,49,41,44,99,61,110,46,108,101,110,103,116,104,44,101,125,118,97,114,32,73,61,110,117,108,108,59,102,117,110,99,116,105,111,110,32,99,116,40,41,123,114,101,116,117,114,110,40,73,61,61,61,110,117,108,108,124,124,73,46,98,121,116,101,76,101,110,103,116,104,61,61,61,48,41,38,38,40,73,61,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,111,46,109,101,109,111,114,121,46,98,117,102,102,101,114,41,41,44,73,125,102,117,110,99,116,105,111,110,32,100,116,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,52,44,52,41,62,62,62,48,59,114,101,116,117,114,110,32,99,116,40,41,46,115,101,116,40,110,44,101,47,52,41,44,99,61,110,46,108,101,110,103,116,104,44,101,125,102,117,110,99,116,105,111,110,32,108,116,40,110,44,116,41,123,108,101,116,32,101,61,116,40,110,46,108,101,110,103,116,104,42,52,44,52,41,62,62,62,48,59,102,111,114,40,108,101,116,32,114,61,48,59,114,60,110,46,108,101,110,103,116,104,59,114,43,43,41,123,108,101,116,32,115,61,88,40,110,91,114,93,41,59,66,40,41,46,115,101,116,85,105,110,116,51,50,40,101,43,52,42,114,44,115,44,33,48,41,125,114,101,116,117,114,110,32,99,61,110,46,108,101,110,103,116,104,44,101,125,102,117,110,99,116,105,111,110,32,81,40,110,44,116,41,123,108,101,116,32,101,61,100,40,110,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,36,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,114,101,103,105,115,116,101,114,95,102,111,110,116,40,101,44,114,44,115,44,105,41,33,61,61,48,125,118,97,114,32,119,61,79,98,106,101,99,116,46,102,114,101,101,122,101,40,123,70,111,114,119,97,114,100,58,48,44,48,58,34,70,111,114,119,97,114,100,34,44,82,101,118,101,114,115,101,58,49,44,49,58,34,82,101,118,101,114,115,101,34,44,66,111,117,110,99,101,58,50,44,50,58,34,66,111,117,110,99,101,34,44,82,101,118,101,114,115,101,66,111,117,110,99,101,58,51,44,51,58,34,82,101,118,101,114,115,101,66,111,117,110,99,101,34,125,41,44,89,61,116,121,112,101,111,102,32,70,105,110,97,108,105,122,97,116,105,111,110,82,101,103,105,115,116,114,121,62,34,117,34,63,123,114,101,103,105,115,116,101,114,58,40,41,61,62,123,125,44,117,110,114,101,103,105,115,116,101,114,58,40,41,61,62,123,125,125,58,110,101,119,32,70,105,110,97,108,105,122,97,116,105,111,110,82,101,103,105,115,116,114,121,40,110,61,62,111,46,95,95,119,98,103,95,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,102,114,101,101,40,110,62,62,62,48,44,49,41,41,44,80,61,99,108,97,115,115,123,95,95,100,101,115,116,114,111,121,95,105,110,116,111,95,114,97,119,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,95,119,98,103,95,112,116,114,59,114,101,116,117,114,110,32,116,104,105,115,46,95,95,119,98,103,95,112,116,114,61,48,44,89,46,117,110,114,101,103,105,115,116,101,114,40,116,104,105,115,41,44,116,125,102,114,101,101,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,95,100,101,115,116,114,111,121,95,105,110,116,111,95,114,97,119,40,41,59,111,46,95,95,119,98,103,95,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,102,114,101,101,40,116,44,48,41,125,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,110,101,119,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,95,119,98,103,95,112,116,114,61,116,62,62,62,48,44,89,46,114,101,103,105,115,116,101,114,40,116,104,105,115,44,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,104,105,115,41,44,116,104,105,115,125,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,116,44,101,44,114,41,123,108,101,116,32,115,61,36,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,116,105,99,107,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,114,101,110,100,101,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,110,100,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,99,108,101,97,114,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,114,101,115,105,122,101,40,116,44,101,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,105,122,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,33,61,61,48,125,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,112,108,97,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,112,97,117,115,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,97,117,115,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,116,111,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,112,108,97,121,105,110,103,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,112,108,97,121,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,112,97,117,115,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,112,97,117,115,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,115,116,111,112,112,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,115,116,111,112,112,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,108,111,97,100,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,108,111,97,100,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,99,111,109,112,108,101,116,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,99,111,109,112,108,101,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,115,95,116,119,101,101,110,105,110,103,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,115,95,116,119,101,101,110,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,99,117,114,114,101,110,116,95,102,114,97,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,116,111,116,97,108,95,102,114,97,109,101,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,111,116,97,108,95,102,114,97,109,101,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,114,101,113,117,101,115,116,95,102,114,97,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,113,117,101,115,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,102,114,97,109,101,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,102,114,97,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,115,101,101,107,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,101,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,100,117,114,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,114,101,115,101,116,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,119,105,100,116,104,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,119,105,100,116,104,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,104,101,105,103,104,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,104,101,105,103,104,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,109,111,100,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,111,100,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,109,111,100,101,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,109,111,100,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,115,112,101,101,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,112,101,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,115,112,101,101,100,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,112,101,101,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,108,111,111,112,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,111,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,108,111,111,112,95,99,111,117,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,97,117,116,111,112,108,97,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,117,116,111,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,97,117,116,111,112,108,97,121,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,97,117,116,111,112,108,97,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,125,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,62,62,62,48,125,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,99,108,101,97,114,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,113,117,97,108,105,116,121,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,41,33,61,61,48,125,104,97,115,95,115,101,103,109,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,104,97,115,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,103,109,101,110,116,95,115,116,97,114,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,115,116,97,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,103,109,101,110,116,95,101,110,100,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,103,109,101,110,116,95,101,110,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,115,101,103,109,101,110,116,40,116,44,101,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,33,61,61,48,125,99,108,101,97,114,95,115,101,103,109,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,101,103,109,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,108,97,121,111,117,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,108,97,121,111,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,108,97,121,111,117,116,95,102,105,116,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,102,105,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,109,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,118,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,118,105,101,119,112,111,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,44,114,44,115,41,33,61,61,48,125,115,101,116,95,99,111,108,111,114,95,115,108,111,116,40,116,44,101,44,114,44,115,41,123,108,101,116,32,105,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,99,111,108,111,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,105,44,95,44,101,44,114,44,115,41,33,61,61,48,125,115,101,116,95,115,99,97,108,97,114,95,115,108,111,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,99,97,108,97,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,101,116,95,116,101,120,116,95,115,108,111,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,101,120,116,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,101,116,95,118,101,99,116,111,114,95,115,108,111,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,118,101,99,116,111,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,115,101,116,95,112,111,115,105,116,105,111,110,95,115,108,111,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,112,111,115,105,116,105,111,110,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,115,44,105,44,101,44,114,41,33,61,61,48,125,99,108,101,97,114,95,115,108,111,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,108,111,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,99,108,101,97,114,95,115,108,111,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,101,116,95,115,108,111,116,115,95,115,116,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,108,111,116,115,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,115,108,111,116,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,109,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,103,101,116,95,115,108,111,116,115,95,115,116,114,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,115,95,115,116,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,109,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,103,101,116,95,115,108,111,116,95,105,100,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,105,100,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,109,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,114,101,115,101,116,95,115,108,111,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,115,108,111,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,114,101,115,101,116,95,115,108,111,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,115,108,111,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,105,110,116,101,114,115,101,99,116,40,116,44,101,44,114,41,123,108,101,116,32,115,61,100,40,114,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,105,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,105,110,116,101,114,115,101,99,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,44,115,44,105,41,33,61,61,48,125,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,103,101,116,95,116,114,97,110,115,102,111,114,109,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,116,114,97,110,115,102,111,114,109,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,101,116,95,116,114,97,110,115,102,111,114,109,40,116,41,123,108,101,116,32,101,61,100,116,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,114,97,110,115,102,111,114,109,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,116,119,101,101,110,40,116,44,101,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,119,101,101,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,76,40,101,41,63,52,50,57,52,57,54,55,50,57,55,58,77,97,116,104,46,102,114,111,117,110,100,40,101,41,41,33,61,61,48,125,116,119,101,101,110,95,119,105,116,104,95,101,97,115,105,110,103,40,116,44,101,44,114,44,115,44,105,44,95,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,119,101,101,110,95,119,105,116,104,95,101,97,115,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,76,40,101,41,63,52,50,57,52,57,54,55,50,57,55,58,77,97,116,104,46,102,114,111,117,110,100,40,101,41,44,114,44,115,44,105,44,95,41,33,61,61,48,125,116,119,101,101,110,95,115,116,111,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,119,101,101,110,95,115,116,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,116,119,101,101,110,95,117,112,100,97,116,101,40,116,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,119,101,101,110,95,117,112,100,97,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,76,40,116,41,63,52,50,57,52,57,54,55,50,57,55,58,77,97,116,104,46,102,114,111,117,110,100,40,116,41,41,33,61,61,48,125,116,119,101,101,110,95,116,111,95,109,97,114,107,101,114,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,119,101,101,110,95,116,111,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,76,40,101,41,63,52,50,57,52,57,54,55,50,57,55,58,77,97,116,104,46,102,114,111,117,110,100,40,101,41,41,33,61,61,48,125,109,97,114,107,101,114,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,114,107,101,114,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,109,97,114,107,101,114,95,110,97,109,101,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,114,107,101,114,95,110,97,109,101,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,109,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,115,101,116,95,109,97,114,107,101,114,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,99,108,101,97,114,95,109,97,114,107,101,114,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,99,108,101,97,114,95,109,97,114,107,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,112,111,108,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,112,111,108,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,101,109,105,116,95,111,110,95,108,111,111,112,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,101,109,105,116,95,111,110,95,108,111,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,108,111,97,100,95,102,111,110,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,36,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,108,111,97,100,95,102,111,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,116,97,116,105,99,32,117,110,108,111,97,100,95,102,111,110,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,117,110,108,111,97,100,95,102,111,110,116,40,101,44,114,41,33,61,61,48,125,115,101,116,95,116,104,101,109,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,104,101,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,114,101,115,101,116,95,116,104,101,109,101,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,114,101,115,101,116,95,116,104,101,109,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,116,104,101,109,101,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,116,104,101,109,101,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,109,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,97,110,105,109,97,116,105,111,110,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,97,110,105,109,97,116,105,111,110,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,109,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,109,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,109,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,41,123,108,101,116,32,116,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,44,101,59,114,101,116,117,114,110,32,116,91,48,93,33,61,61,48,38,38,40,101,61,109,40,116,91,48,93,44,116,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,91,48,93,44,116,91,49,93,42,49,44,49,41,41,44,101,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,116,97,116,101,95,109,97,99,104,105,110,101,95,117,110,108,111,97,100,40,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,116,97,116,101,95,109,97,99,104,105,110,101,95,117,110,108,111,97,100,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,102,105,114,101,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,102,105,114,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,33,61,61,48,125,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,59,114,101,116,117,114,110,32,115,61,61,61,52,50,57,52,57,54,55,50,57,55,63,118,111,105,100,32,48,58,115,125,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,44,105,61,100,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,105,44,95,41,33,61,61,48,125,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,44,105,59,114,101,116,117,114,110,32,115,91,48,93,33,61,61,48,38,38,40,105,61,109,40,115,91,48,93,44,115,91,49,93,41,46,115,108,105,99,101,40,41,44,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,115,91,48,93,44,115,91,49,93,42,49,44,49,41,41,44,105,125,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,44,115,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,59,114,101,116,117,114,110,32,115,61,61,61,49,54,55,55,55,50,49,53,63,118,111,105,100,32,48,58,115,33,61,61,48,125,115,109,95,114,101,115,101,116,95,105,110,112,117,116,40,116,41,123,108,101,116,32,101,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,114,61,99,59,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,114,101,115,101,116,95,105,110,112,117,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,101,44,114,41,125,115,109,95,112,111,108,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,108,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,115,116,97,114,116,40,116,44,101,41,123,108,101,116,32,114,61,108,116,40,101,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,97,114,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,114,44,115,41,33,61,61,48,125,115,109,95,115,116,111,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,111,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,115,109,95,115,116,97,116,117,115,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,115,116,97,116,117,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,109,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,41,123,108,101,116,32,116,44,101,59,116,114,121,123,108,101,116,32,114,61,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,59,114,101,116,117,114,110,32,116,61,114,91,48,93,44,101,61,114,91,49,93,44,109,40,114,91,48,93,44,114,91,49,93,41,125,102,105,110,97,108,108,121,123,111,46,95,95,119,98,105,110,100,103,101,110,95,102,114,101,101,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,40,116,44,101,44,49,41,125,125,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,44,101,41,123,108,101,116,32,114,61,100,40,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,115,61,99,59,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,114,44,115,44,101,41,33,61,61,48,125,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,103,101,116,95,105,110,112,117,116,115,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,103,101,116,95,105,110,112,117,116,115,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,44,101,41,123,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,44,116,44,101,41,125,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,125,115,109,95,116,105,99,107,40,41,123,114,101,116,117,114,110,32,111,46,100,111,116,108,111,116,116,105,101,112,108,97,121,101,114,119,97,115,109,95,115,109,95,116,105,99,107,40,116,104,105,115,46,95,95,119,98,103,95,112,116,114,41,33,61,61,48,125,125,59,97,115,121,110,99,32,102,117,110,99,116,105,111,110,32,112,116,40,110,44,116,41,123,105,102,40,116,121,112,101,111,102,32,82,101,115,112,111,110,115,101,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,82,101,115,112,111,110,115,101,41,123,105,102,40,116,121,112,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,61,61,34,102,117,110,99,116,105,111,110,34,41,116,114,121,123,114,101,116,117,114,110,32,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,40,110,44,116,41,125,99,97,116,99,104,40,114,41,123,105,102,40,110,46,104,101,97,100,101,114,115,46,103,101,116,40,34,67,111,110,116,101,110,116,45,84,121,112,101,34,41,33,61,34,97,112,112,108,105,99,97,116,105,111,110,47,119,97,115,109,34,41,99,111,110,115,111,108,101,46,119,97,114,110,40,34,96,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,83,116,114,101,97,109,105,110,103,96,32,102,97,105,108,101,100,32,98,101,99,97,117,115,101,32,121,111,117,114,32,115,101,114,118,101,114,32,100,111,101,115,32,110,111,116,32,115,101,114,118,101,32,87,97,115,109,32,119,105,116,104,32,96,97,112,112,108,105,99,97,116,105,111,110,47,119,97,115,109,96,32,77,73,77,69,32,116,121,112,101,46,32,70,97,108,108,105,110,103,32,98,97,99,107,32,116,111,32,96,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,96,32,119,104,105,99,104,32,105,115,32,115,108,111,119,101,114,46,32,79,114,105,103,105,110,97,108,32,101,114,114,111,114,58,92,110,34,44,114,41,59,101,108,115,101,32,116,104,114,111,119,32,114,125,108,101,116,32,101,61,97,119,97,105,116,32,110,46,97,114,114,97,121,66,117,102,102,101,114,40,41,59,114,101,116,117,114,110,32,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,40,101,44,116,41,125,101,108,115,101,123,108,101,116,32,101,61,97,119,97,105,116,32,87,101,98,65,115,115,101,109,98,108,121,46,105,110,115,116,97,110,116,105,97,116,101,40,110,44,116,41,59,114,101,116,117,114,110,32,101,32,105,110,115,116,97,110,99,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,73,110,115,116,97,110,99,101,63,123,105,110,115,116,97,110,99,101,58,101,44,109,111,100,117,108,101,58,110,125,58,101,125,125,102,117,110,99,116,105,111,110,32,104,116,40,41,123,108,101,116,32,110,61,123,125,59,114,101,116,117,114,110,32,110,46,119,98,103,61,123,125,44,110,46,119,98,103,46,95,95,119,98,103,95,98,117,102,102,101,114,95,54,48,57,99,99,51,101,101,101,53,49,101,100,49,53,56,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,116,46,98,117,102,102,101,114,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,95,52,48,53,101,50,50,102,51,57,48,53,55,54,99,101,50,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,110,101,119,32,79,98,106,101,99,116,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,95,55,56,102,101,98,49,48,56,98,54,52,55,50,55,49,51,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,110,101,119,32,65,114,114,97,121,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,119,105,116,104,98,121,116,101,111,102,102,115,101,116,97,110,100,108,101,110,103,116,104,95,100,57,55,101,54,51,55,101,98,101,49,52,53,97,57,97,61,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,114,101,116,117,114,110,32,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,116,44,101,62,62,62,48,44,114,62,62,62,48,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,101,119,119,105,116,104,108,101,110,103,116,104,95,53,97,53,101,102,101,51,49,51,99,102,100,53,57,102,49,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,116,62,62,62,48,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,110,111,119,95,56,48,55,101,53,52,99,51,57,54,51,54,99,51,52,57,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,68,97,116,101,46,110,111,119,40,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,112,117,115,104,95,55,51,55,99,102,99,56,99,49,52,51,50,99,50,99,54,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,114,101,116,117,114,110,32,116,46,112,117,115,104,40,101,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,115,101,116,95,98,98,56,99,101,99,102,54,97,54,50,98,57,102,52,54,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,97,116,40,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,114,101,116,117,114,110,32,82,101,102,108,101,99,116,46,115,101,116,40,116,44,101,44,114,41,125,44,97,114,103,117,109,101,110,116,115,41,125,44,110,46,119,98,103,46,95,95,119,98,103,95,115,101,116,105,110,100,101,120,95,52,101,55,51,97,102,100,99,100,57,98,98,57,53,99,100,61,102,117,110,99,116,105,111,110,40,116,44,101,44,114,41,123,116,91,101,62,62,62,48,93,61,114,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,105,110,105,116,95,101,120,116,101,114,110,114,101,102,95,116,97,98,108,101,61,102,117,110,99,116,105,111,110,40,41,123,108,101,116,32,116,61,111,46,95,95,119,98,105,110,100,103,101,110,95,101,120,112,111,114,116,95,50,44,101,61,116,46,103,114,111,119,40,52,41,59,116,46,115,101,116,40,48,44,118,111,105,100,32,48,41,44,116,46,115,101,116,40,101,43,48,44,118,111,105,100,32,48,41,44,116,46,115,101,116,40,101,43,49,44,110,117,108,108,41,44,116,46,115,101,116,40,101,43,50,44,33,48,41,44,116,46,115,101,116,40,101,43,51,44,33,49,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,109,101,109,111,114,121,61,102,117,110,99,116,105,111,110,40,41,123,114,101,116,117,114,110,32,111,46,109,101,109,111,114,121,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,110,117,109,98,101,114,95,110,101,119,61,102,117,110,99,116,105,111,110,40,116,41,123,114,101,116,117,114,110,32,116,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,115,116,114,105,110,103,95,103,101,116,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,108,101,116,32,114,61,101,44,115,61,116,121,112,101,111,102,32,114,61,61,34,115,116,114,105,110,103,34,63,114,58,118,111,105,100,32,48,59,118,97,114,32,105,61,76,40,115,41,63,48,58,100,40,115,44,111,46,95,95,119,98,105,110,100,103,101,110,95,109,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,44,111,46,95,95,119,98,105,110,100,103,101,110,95,114,101,97,108,108,111,99,95,99,111,109,109,97,110,100,95,101,120,112,111,114,116,41,44,95,61,99,59,66,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,49,44,95,44,33,48,41,44,66,40,41,46,115,101,116,73,110,116,51,50,40,116,43,52,42,48,44,105,44,33,48,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,115,116,114,105,110,103,95,110,101,119,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,114,101,116,117,114,110,32,109,40,116,44,101,41,125,44,110,46,119,98,103,46,95,95,119,98,105,110,100,103,101,110,95,116,104,114,111,119,61,102,117,110,99,116,105,111,110,40,116,44,101,41,123,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,109,40,116,44,101,41,41,125,44,110,125,102,117,110,99,116,105,111,110,32,117,116,40,110,44,116,41,123,114,101,116,117,114,110,32,111,61,110,46,101,120,112,111,114,116,115,44,113,46,95,95,119,98,105,110,100,103,101,110,95,119,97,115,109,95,109,111,100,117,108,101,61,116,44,121,61,110,117,108,108,44,73,61,110,117,108,108,44,67,61,110,117,108,108,44,111,46,95,95,119,98,105,110,100,103,101,110,95,115,116,97,114,116,40,41,44,111,125,97,115,121,110,99,32,102,117,110,99,116,105,111,110,32,113,40,110,41,123,105,102,40,111,33,61,61,118,111,105,100,32,48,41,114,101,116,117,114,110,32,111,59,105,102,40,116,121,112,101,111,102,32,110,60,34,117,34,38,38,40,79,98,106,101,99,116,46,103,101,116,80,114,111,116,111,116,121,112,101,79,102,40,110,41,61,61,61,79,98,106,101,99,116,46,112,114,111,116,111,116,121,112,101,63,123,109,111,100,117,108,101,95,111,114,95,112,97,116,104,58,110,125,61,110,58,99,111,110,115,111,108,101,46,119,97,114,110,40,34,117,115,105,110,103,32,100,101,112,114,101,99,97,116,101,100,32,112,97,114,97,109,101,116,101,114,115,32,102,111,114,32,116,104,101,32,105,110,105,116,105,97,108,105,122,97,116,105,111,110,32,102,117,110,99,116,105,111,110,59,32,112,97,115,115,32,97,32,115,105,110,103,108,101,32,111,98,106,101,99,116,32,105,110,115,116,101,97,100,34,41,41,44,116,121,112,101,111,102,32,110,62,34,117,34,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,87,65,83,77,32,109,111,100,117,108,101,32,85,82,76,32,109,117,115,116,32,98,101,32,112,114,111,118,105,100,101,100,32,118,105,97,32,68,111,116,76,111,116,116,105,101,87,97,115,109,76,111,97,100,101,114,32,111,114,32,115,101,116,87,97,115,109,85,114,108,40,41,46,34,41,59,108,101,116,32,116,61,104,116,40,41,59,40,116,121,112,101,111,102,32,110,61,61,34,115,116,114,105,110,103,34,124,124,116,121,112,101,111,102,32,82,101,113,117,101,115,116,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,82,101,113,117,101,115,116,124,124,116,121,112,101,111,102,32,85,82,76,61,61,34,102,117,110,99,116,105,111,110,34,38,38,110,32,105,110,115,116,97,110,99,101,111,102,32,85,82,76,41,38,38,40,110,61,102,101,116,99,104,40,110,41,41,59,108,101,116,123,105,110,115,116,97,110,99,101,58,101,44,109,111,100,117,108,101,58,114,125,61,97,119,97,105,116,32,112,116,40,97,119,97,105,116,32,110,44,116,41,59,114,101,116,117,114,110,32,117,116,40,101,44,114,41,125,118,97,114,32,116,116,61,113,59,118,97,114,32,65,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,41,123,108,40,116,104,105,115,44,34,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,34,44,110,101,119,32,77,97,112,41,125,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,108,101,116,32,114,61,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,41,59,114,124,124,40,114,61,110,101,119,32,83,101,116,44,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,115,101,116,40,116,44,114,41,41,44,114,46,97,100,100,40,101,41,125,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,108,101,116,32,114,61,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,41,59,114,38,38,40,101,63,40,114,46,100,101,108,101,116,101,40,101,41,44,114,46,115,105,122,101,61,61,61,48,38,38,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,100,101,108,101,116,101,40,116,41,41,58,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,100,101,108,101,116,101,40,116,41,41,125,100,105,115,112,97,116,99,104,40,116,41,123,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,103,101,116,40,116,46,116,121,112,101,41,63,46,102,111,114,69,97,99,104,40,114,61,62,114,40,116,41,41,125,114,101,109,111,118,101,65,108,108,69,118,101,110,116,76,105,115,116,101,110,101,114,115,40,41,123,116,104,105,115,46,95,101,118,101,110,116,76,105,115,116,101,110,101,114,115,46,99,108,101,97,114,40,41,125,125,59,118,97,114,32,117,61,99,108,97,115,115,32,117,123,115,116,97,116,105,99,32,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,123,105,102,40,117,46,95,111,98,115,101,114,118,101,114,41,114,101,116,117,114,110,59,108,101,116,32,116,61,101,61,62,123,101,46,102,111,114,69,97,99,104,40,114,61,62,123,108,101,116,32,115,61,117,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,114,46,116,97,114,103,101,116,41,59,115,38,38,40,114,46,105,115,73,110,116,101,114,115,101,99,116,105,110,103,63,115,46,117,110,102,114,101,101,122,101,40,41,58,115,46,102,114,101,101,122,101,40,41,41,125,41,125,59,117,46,95,111,98,115,101,114,118,101,114,61,110,101,119,32,73,110,116,101,114,115,101,99,116,105,111,110,79,98,115,101,114,118,101,114,40,116,44,123,116,104,114,101,115,104,111,108,100,58,48,125,41,125,115,116,97,116,105,99,32,111,98,115,101,114,118,101,40,116,44,101,41,123,117,46,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,44,33,117,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,104,97,115,40,116,41,38,38,40,117,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,116,44,101,41,44,117,46,95,111,98,115,101,114,118,101,114,63,46,111,98,115,101,114,118,101,40,116,41,41,125,115,116,97,116,105,99,32,117,110,111,98,115,101,114,118,101,40,116,41,123,117,46,95,111,98,115,101,114,118,101,114,63,46,117,110,111,98,115,101,114,118,101,40,116,41,44,117,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,100,101,108,101,116,101,40,116,41,44,117,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,105,122,101,61,61,61,48,38,38,40,117,46,95,111,98,115,101,114,118,101,114,63,46,100,105,115,99,111,110,110,101,99,116,40,41,44,117,46,95,111,98,115,101,114,118,101,114,61,110,117,108,108,41,125,125,59,108,40,117,44,34,95,111,98,115,101,114,118,101,114,34,44,110,117,108,108,41,44,108,40,117,44,34,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,34,44,110,101,119,32,77,97,112,41,59,118,97,114,32,118,61,117,59,118,97,114,32,104,61,99,108,97,115,115,32,104,123,115,116,97,116,105,99,32,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,123,105,102,40,104,46,95,111,98,115,101,114,118,101,114,41,114,101,116,117,114,110,59,108,101,116,32,116,61,101,61,62,123,101,46,102,111,114,69,97,99,104,40,114,61,62,123,108,101,116,32,115,61,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,114,46,116,97,114,103,101,116,41,59,105,102,40,33,115,41,114,101,116,117,114,110,59,108,101,116,91,105,44,95,93,61,115,59,99,108,101,97,114,84,105,109,101,111,117,116,40,95,41,59,108,101,116,32,112,61,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,105,46,114,101,115,105,122,101,40,41,125,44,49,48,48,41,59,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,114,46,116,97,114,103,101,116,44,91,105,44,112,93,41,125,41,125,59,104,46,95,111,98,115,101,114,118,101,114,61,110,101,119,32,82,101,115,105,122,101,79,98,115,101,114,118,101,114,40,116,41,125,115,116,97,116,105,99,32,111,98,115,101,114,118,101,40,116,44,101,41,123,104,46,95,105,110,105,116,105,97,108,105,122,101,79,98,115,101,114,118,101,114,40,41,44,33,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,104,97,115,40,116,41,38,38,40,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,101,116,40,116,44,91,101,44,48,93,41,44,104,46,95,111,98,115,101,114,118,101,114,63,46,111,98,115,101,114,118,101,40,116,41,41,125,115,116,97,116,105,99,32,117,110,111,98,115,101,114,118,101,40,116,41,123,108,101,116,32,101,61,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,103,101,116,40,116,41,59,105,102,40,101,41,123,108,101,116,32,114,61,101,91,49,93,59,114,38,38,99,108,101,97,114,84,105,109,101,111,117,116,40,114,41,125,104,46,95,111,98,115,101,114,118,101,114,63,46,117,110,111,98,115,101,114,118,101,40,116,41,44,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,100,101,108,101,116,101,40,116,41,44,33,104,46,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,46,115,105,122,101,38,38,104,46,95,111,98,115,101,114,118,101,114,38,38,40,104,46,95,111,98,115,101,114,118,101,114,46,100,105,115,99,111,110,110,101,99,116,40,41,44,104,46,95,111,98,115,101,114,118,101,114,61,110,117,108,108,41,125,125,59,108,40,104,44,34,95,111,98,115,101,114,118,101,114,34,44,110,117,108,108,41,44,108,40,104,44,34,95,111,98,115,101,114,118,101,100,67,97,110,118,97,115,101,115,34,44,110,101,119,32,77,97,112,41,59,118,97,114,32,98,61,104,59,102,117,110,99,116,105,111,110,32,109,116,40,110,41,123,114,101,116,117,114,110,47,94,35,40,91,92,100,97,45,102,93,123,54,125,124,91,92,100,97,45,102,93,123,56,125,41,36,47,105,117,46,116,101,115,116,40,110,41,125,102,117,110,99,116,105,111,110,32,110,116,40,110,41,123,105,102,40,33,109,116,40,110,41,41,114,101,116,117,114,110,32,48,59,108,101,116,32,116,61,110,46,114,101,112,108,97,99,101,40,34,35,34,44,34,34,41,59,114,101,116,117,114,110,32,116,61,116,46,108,101,110,103,116,104,61,61,61,54,63,96,36,123,116,125,102,102,96,58,116,44,112,97,114,115,101,73,110,116,40,116,44,49,54,41,125,102,117,110,99,116,105,111,110,32,86,40,110,41,123,105,102,40,110,46,98,121,116,101,76,101,110,103,116,104,60,52,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,110,46,115,108,105,99,101,40,48,44,84,46,98,121,116,101,76,101,110,103,116,104,41,41,59,102,111,114,40,108,101,116,32,101,61,48,59,101,60,84,46,108,101,110,103,116,104,59,101,43,61,49,41,105,102,40,84,91,101,93,33,61,61,116,91,101,93,41,114,101,116,117,114,110,33,49,59,114,101,116,117,114,110,33,48,125,102,117,110,99,116,105,111,110,32,101,116,40,110,41,123,114,101,116,117,114,110,32,74,46,101,118,101,114,121,40,116,61,62,79,98,106,101,99,116,46,104,97,115,79,119,110,40,110,44,116,41,41,125,102,117,110,99,116,105,111,110,32,78,40,110,41,123,105,102,40,116,121,112,101,111,102,32,110,61,61,34,115,116,114,105,110,103,34,41,116,114,121,123,114,101,116,117,114,110,32,101,116,40,74,83,79,78,46,112,97,114,115,101,40,110,41,41,125,99,97,116,99,104,123,114,101,116,117,114,110,33,49,125,101,108,115,101,32,114,101,116,117,114,110,32,101,116,40,110,41,125,102,117,110,99,116,105,111,110,32,85,40,41,123,114,101,116,117,114,110,32,49,43,40,40,103,63,119,105,110,100,111,119,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,49,41,45,49,41,42,106,125,102,117,110,99,116,105,111,110,32,83,40,110,41,123,108,101,116,32,116,61,110,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,44,101,61,119,105,110,100,111,119,46,105,110,110,101,114,72,101,105,103,104,116,124,124,100,111,99,117,109,101,110,116,46,100,111,99,117,109,101,110,116,69,108,101,109,101,110,116,46,99,108,105,101,110,116,72,101,105,103,104,116,44,114,61,119,105,110,100,111,119,46,105,110,110,101,114,87,105,100,116,104,124,124,100,111,99,117,109,101,110,116,46,100,111,99,117,109,101,110,116,69,108,101,109,101,110,116,46,99,108,105,101,110,116,87,105,100,116,104,59,114,101,116,117,114,110,33,40,116,46,98,111,116,116,111,109,60,48,124,124,116,46,116,111,112,62,101,124,124,116,46,114,105,103,104,116,60,48,124,124,116,46,108,101,102,116,62,114,41,125,102,117,110,99,116,105,111,110,32,69,40,110,41,123,108,101,116,32,116,61,110,46,116,97,114,103,101,116,59,105,102,40,116,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,41,123,108,101,116,32,101,61,116,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,59,105,102,40,101,46,119,105,100,116,104,61,61,61,48,124,124,101,46,104,101,105,103,104,116,61,61,61,48,124,124,116,46,119,105,100,116,104,61,61,61,48,124,124,116,46,104,101,105,103,104,116,61,61,61,48,41,114,101,116,117,114,110,32,110,117,108,108,59,108,101,116,32,114,61,116,46,119,105,100,116,104,47,101,46,119,105,100,116,104,44,115,61,116,46,104,101,105,103,104,116,47,101,46,104,101,105,103,104,116,44,105,61,40,110,46,99,108,105,101,110,116,88,45,101,46,108,101,102,116,41,42,114,44,95,61,40,110,46,99,108,105,101,110,116,89,45,101,46,116,111,112,41,42,115,59,114,101,116,117,114,110,33,78,117,109,98,101,114,46,105,115,70,105,110,105,116,101,40,105,41,124,124,33,78,117,109,98,101,114,46,105,115,70,105,110,105,116,101,40,95,41,124,124,78,117,109,98,101,114,46,105,115,78,97,78,40,105,41,124,124,78,117,109,98,101,114,46,105,115,78,97,78,40,95,41,63,110,117,108,108,58,123,120,58,105,44,121,58,95,125,125,114,101,116,117,114,110,32,110,117,108,108,125,102,117,110,99,116,105,111,110,32,114,116,40,110,41,123,108,101,116,32,116,61,110,46,114,101,112,108,97,99,101,40,34,79,112,101,110,85,114,108,58,32,34,44,34,34,41,44,101,61,116,46,105,110,100,101,120,79,102,40,34,32,124,32,84,97,114,103,101,116,58,32,34,41,44,114,44,115,59,101,61,61,61,45,49,63,40,114,61,116,44,115,61,34,95,98,108,97,110,107,34,41,58,40,114,61,116,46,115,117,98,115,116,114,105,110,103,40,48,44,101,41,44,115,61,116,46,115,117,98,115,116,114,105,110,103,40,101,43,49,49,41,41,44,119,105,110,100,111,119,46,111,112,101,110,40,114,44,115,41,125,102,117,110,99,116,105,111,110,32,111,116,40,110,44,116,44,101,41,123,108,101,116,32,114,61,110,117,108,108,44,115,61,116,59,114,101,116,117,114,110,123,108,111,97,100,40,41,123,114,101,116,117,114,110,32,114,124,124,40,114,61,110,40,115,41,46,116,104,101,110,40,40,41,61,62,123,125,41,46,99,97,116,99,104,40,97,115,121,110,99,32,105,61,62,123,99,111,110,115,111,108,101,46,119,97,114,110,40,96,80,114,105,109,97,114,121,32,87,65,83,77,32,108,111,97,100,32,102,97,105,108,101,100,32,102,114,111,109,32,36,123,115,125,58,32,36,123,105,46,109,101,115,115,97,103,101,125,96,41,44,99,111,110,115,111,108,101,46,119,97,114,110,40,96,65,116,116,101,109,112,116,105,110,103,32,116,111,32,108,111,97,100,32,87,65,83,77,32,102,114,111,109,32,98,97,99,107,117,112,32,85,82,76,58,32,36,123,101,125,96,41,59,116,114,121,123,97,119,97,105,116,32,110,40,101,41,125,99,97,116,99,104,40,95,41,123,116,104,114,111,119,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,80,114,105,109,97,114,121,32,87,65,83,77,32,85,82,76,32,102,97,105,108,101,100,58,32,36,123,105,46,109,101,115,115,97,103,101,125,96,41,44,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,66,97,99,107,117,112,32,87,65,83,77,32,85,82,76,32,102,97,105,108,101,100,58,32,36,123,95,46,109,101,115,115,97,103,101,125,96,41,44,114,61,110,117,108,108,44,110,101,119,32,69,114,114,111,114,40,34,87,65,83,77,32,108,111,97,100,105,110,103,32,102,97,105,108,101,100,32,102,114,111,109,32,97,108,108,32,115,111,117,114,99,101,115,46,34,41,125,125,41,41,44,114,125,44,115,101,116,87,97,115,109,85,114,108,40,105,41,123,105,33,61,61,115,38,38,40,115,61,105,44,114,61,110,117,108,108,41,125,125,125,118,97,114,32,87,61,111,116,40,116,116,44,96,104,116,116,112,115,58,47,47,99,100,110,46,106,115,100,101,108,105,118,114,46,110,101,116,47,110,112,109,47,36,123,68,125,64,36,123,122,125,47,100,105,115,116,47,100,111,116,108,111,116,116,105,101,45,112,108,97,121,101,114,46,119,97,115,109,96,44,96,104,116,116,112,115,58,47,47,117,110,112,107,103,46,99,111,109,47,36,123,68,125,64,36,123,122,125,47,100,105,115,116,47,100,111,116,108,111,116,116,105,101,45,112,108,97,121,101,114,46,119,97,115,109,96,41,44,71,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,34,114,101,118,101,114,115,101,34,58,114,101,116,117,114,110,32,119,46,82,101,118,101,114,115,101,59,99,97,115,101,34,98,111,117,110,99,101,34,58,114,101,116,117,114,110,32,119,46,66,111,117,110,99,101,59,99,97,115,101,34,114,101,118,101,114,115,101,45,98,111,117,110,99,101,34,58,114,101,116,117,114,110,32,119,46,82,101,118,101,114,115,101,66,111,117,110,99,101,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,32,119,46,70,111,114,119,97,114,100,125,125,44,103,116,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,32,119,46,82,101,118,101,114,115,101,58,114,101,116,117,114,110,34,114,101,118,101,114,115,101,34,59,99,97,115,101,32,119,46,66,111,117,110,99,101,58,114,101,116,117,114,110,34,98,111,117,110,99,101,34,59,99,97,115,101,32,119,46,82,101,118,101,114,115,101,66,111,117,110,99,101,58,114,101,116,117,114,110,34,114,101,118,101,114,115,101,45,98,111,117,110,99,101,34,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,34,102,111,114,119,97,114,100,34,125,125,44,102,116,61,110,61,62,123,115,119,105,116,99,104,40,110,41,123,99,97,115,101,34,99,111,110,116,97,105,110,34,58,114,101,116,117,114,110,34,99,111,110,116,97,105,110,34,59,99,97,115,101,34,99,111,118,101,114,34,58,114,101,116,117,114,110,34,99,111,118,101,114,34,59,99,97,115,101,34,102,105,108,108,34,58,114,101,116,117,114,110,34,102,105,108,108,34,59,99,97,115,101,34,102,105,116,45,104,101,105,103,104,116,34,58,114,101,116,117,114,110,34,102,105,116,45,104,101,105,103,104,116,34,59,99,97,115,101,34,102,105,116,45,119,105,100,116,104,34,58,114,101,116,117,114,110,34,102,105,116,45,119,105,100,116,104,34,59,99,97,115,101,34,110,111,110,101,34,58,114,101,116,117,114,110,34,110,111,110,101,34,59,100,101,102,97,117,108,116,58,114,101,116,117,114,110,34,99,111,110,116,97,105,110,34,125,125,44,77,61,99,108,97,115,115,123,99,111,110,115,116,114,117,99,116,111,114,40,116,41,123,108,40,116,104,105,115,44,34,95,99,97,110,118,97,115,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,112,101,110,100,105,110,103,76,111,97,100,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,99,111,110,116,101,120,116,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,101,118,101,110,116,77,97,110,97,103,101,114,34,41,59,108,40,116,104,105,115,44,34,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,102,114,97,109,101,77,97,110,97,103,101,114,34,41,59,108,40,116,104,105,115,44,34,95,100,111,116,76,111,116,116,105,101,67,111,114,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,34,44,34,34,41,59,108,40,116,104,105,115,44,34,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,34,44,33,49,41,59,108,40,116,104,105,115,44,34,95,114,101,110,100,101,114,67,111,110,102,105,103,34,44,123,125,41,59,108,40,116,104,105,115,44,34,95,105,115,70,114,111,122,101,110,34,44,33,49,41,59,108,40,116,104,105,115,44,34,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,67,108,105,99,107,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,34,44,110,117,108,108,41,59,108,40,116,104,105,115,44,34,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,34,44,48,41,59,108,40,116,104,105,115,44,34,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,34,44,48,41,59,108,40,116,104,105,115,44,34,95,109,97,114,107,101,114,34,44,34,34,41,59,116,104,105,115,46,95,99,97,110,118,97,115,61,116,46,99,97,110,118,97,115,63,63,110,117,108,108,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,61,110,101,119,32,65,44,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,61,110,101,119,32,82,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,61,123,46,46,46,116,46,114,101,110,100,101,114,67,111,110,102,105,103,44,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,116,46,114,101,110,100,101,114,67,111,110,102,105,103,63,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,85,40,41,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,116,46,114,101,110,100,101,114,67,111,110,102,105,103,63,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,63,63,33,48,125,44,116,104,105,115,46,95,105,110,105,116,87,97,115,109,40,41,46,116,104,101,110,40,40,41,61,62,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,116,104,105,115,46,95,99,114,101,97,116,101,67,111,114,101,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,97,117,116,111,112,108,97,121,40,116,46,97,117,116,111,112,108,97,121,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,46,108,111,111,112,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,46,108,111,111,112,67,111,117,110,116,63,63,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,71,40,116,46,109,111,100,101,63,63,34,102,111,114,119,97,114,100,34,41,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,46,115,112,101,101,100,63,63,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,63,63,33,48,41,44,116,46,115,101,103,109,101,110,116,38,38,116,46,115,101,103,109,101,110,116,46,108,101,110,103,116,104,61,61,61,50,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,46,115,101,103,109,101,110,116,91,48,93,44,116,46,115,101,103,109,101,110,116,91,49,93,41,44,116,104,105,115,46,95,109,97,114,107,101,114,61,116,46,109,97,114,107,101,114,63,63,34,34,44,116,104,105,115,46,95,109,97,114,107,101,114,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,108,97,121,111,117,116,63,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,61,116,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,63,63,34,34,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,61,116,46,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,63,110,117,108,108,44,116,104,105,115,46,95,111,110,67,111,114,101,67,114,101,97,116,101,100,40,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,97,100,121,34,125,41,44,116,46,100,97,116,97,63,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,46,100,97,116,97,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,100,97,116,97,58,116,46,100,97,116,97,125,58,116,46,115,114,99,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,116,46,115,114,99,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,115,114,99,58,116,46,115,114,99,125,41,44,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,38,38,116,104,105,115,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,41,125,41,46,99,97,116,99,104,40,101,61,62,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,34,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,73,110,105,116,105,97,108,105,122,97,116,105,111,110,32,102,97,105,108,101,100,58,34,44,101,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,119,97,115,109,32,109,111,100,117,108,101,58,32,36,123,101,125,96,41,125,41,125,41,125,97,115,121,110,99,32,95,105,110,105,116,87,97,115,109,40,41,123,114,101,116,117,114,110,32,87,46,108,111,97,100,40,41,125,95,99,114,101,97,116,101,67,111,114,101,40,41,123,114,101,116,117,114,110,32,110,101,119,32,80,125,95,111,110,67,111,114,101,67,114,101,97,116,101,100,40,41,123,125,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,59,102,111,114,40,59,40,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,111,108,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,116,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,101,61,116,59,115,119,105,116,99,104,40,101,46,116,121,112,101,41,123,99,97,115,101,34,76,111,97,100,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,76,111,97,100,69,114,114,111,114,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,34,102,97,105,108,101,100,32,116,111,32,108,111,97,100,34,41,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,80,108,97,121,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,112,108,97,121,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,80,97,117,115,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,112,97,117,115,101,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,111,112,34,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,70,114,97,109,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,102,114,97,109,101,78,111,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,82,101,110,100,101,114,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,110,100,101,114,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,102,114,97,109,101,78,111,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,76,111,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,111,112,34,44,108,111,111,112,67,111,117,110,116,58,101,46,108,111,111,112,67,111,117,110,116,63,63,48,125,41,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,67,111,109,112,108,101,116,101,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,99,111,109,112,108,101,116,101,34,125,41,44,48,41,59,98,114,101,97,107,59,100,101,102,97,117,108,116,58,98,114,101,97,107,125,125,125,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,59,102,111,114,40,59,40,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,112,111,108,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,116,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,114,61,116,59,115,119,105,116,99,104,40,114,46,116,121,112,101,41,123,99,97,115,101,34,83,116,97,114,116,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,48,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,125,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,125,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,111,112,34,58,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,125,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,125,44,48,41,59,98,114,101,97,107,59,99,97,115,101,34,67,117,115,116,111,109,69,118,101,110,116,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,101,118,101,110,116,78,97,109,101,58,114,46,109,101,115,115,97,103,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,66,111,111,108,101,97,110,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,78,117,109,101,114,105,99,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,114,105,110,103,73,110,112,117,116,67,104,97,110,103,101,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,44,110,101,119,86,97,108,117,101,58,114,46,110,101,119,86,97,108,117,101,44,111,108,100,86,97,108,117,101,58,114,46,111,108,100,86,97,108,117,101,125,41,59,98,114,101,97,107,59,99,97,115,101,34,73,110,112,117,116,70,105,114,101,100,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,105,110,112,117,116,78,97,109,101,58,114,46,110,97,109,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,84,114,97,110,115,105,116,105,111,110,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,102,114,111,109,83,116,97,116,101,58,114,46,112,114,101,118,105,111,117,115,83,116,97,116,101,63,63,34,34,44,116,111,83,116,97,116,101,58,114,46,110,101,119,83,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,97,116,101,69,110,116,101,114,101,100,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,115,116,97,116,101,58,114,46,115,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,83,116,97,116,101,69,120,105,116,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,34,44,115,116,97,116,101,58,114,46,115,116,97,116,101,63,63,34,34,125,41,59,98,114,101,97,107,59,99,97,115,101,34,69,114,114,111,114,34,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,101,114,114,111,114,58,114,46,109,101,115,115,97,103,101,63,63,34,34,125,41,59,98,114,101,97,107,59,100,101,102,97,117,108,116,58,98,114,101,97,107,125,125,108,101,116,32,101,59,102,111,114,40,59,40,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,112,111,108,108,95,105,110,116,101,114,110,97,108,95,101,118,101,110,116,40,41,41,33,61,61,110,117,108,108,38,38,101,33,61,61,118,111,105,100,32,48,59,41,123,108,101,116,32,114,61,101,59,105,102,40,114,46,116,121,112,101,61,61,61,34,77,101,115,115,97,103,101,34,41,123,108,101,116,32,115,61,114,46,109,101,115,115,97,103,101,63,63,34,34,59,103,38,38,115,46,115,116,97,114,116,115,87,105,116,104,40,34,79,112,101,110,85,114,108,58,32,34,41,63,114,116,40,115,41,58,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,44,109,101,115,115,97,103,101,58,115,125,41,125,125,125,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,116,41,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,116,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,108,111,97,100,69,114,114,111,114,34,44,101,114,114,111,114,58,110,101,119,32,69,114,114,111,114,40,116,41,125,41,125,97,115,121,110,99,32,95,102,101,116,99,104,68,97,116,97,40,116,41,123,108,101,116,32,101,61,97,119,97,105,116,32,102,101,116,99,104,40,116,41,59,105,102,40,33,101,46,111,107,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,102,101,116,99,104,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,32,102,114,111,109,32,85,82,76,58,32,36,123,116,125,46,32,36,123,101,46,115,116,97,116,117,115,125,58,32,36,123,101,46,115,116,97,116,117,115,84,101,120,116,125,96,41,59,108,101,116,32,114,61,97,119,97,105,116,32,101,46,97,114,114,97,121,66,117,102,102,101,114,40,41,59,114,101,116,117,114,110,32,86,40,114,41,63,114,58,110,101,119,32,84,101,120,116,68,101,99,111,100,101,114,40,41,46,100,101,99,111,100,101,40,114,41,125,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,105,102,40,33,116,104,105,115,46,95,99,97,110,118,97,115,41,123,99,111,110,115,111,108,101,46,119,97,114,110,40,34,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,67,97,110,110,111,116,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,119,105,116,104,111,117,116,32,99,97,110,118,97,115,46,32,67,97,108,108,32,115,101,116,67,97,110,118,97,115,40,41,32,102,105,114,115,116,46,34,41,59,114,101,116,117,114,110,125,108,101,116,32,101,61,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,114,61,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,44,115,61,33,49,59,105,102,40,116,121,112,101,111,102,32,116,61,61,34,115,116,114,105,110,103,34,41,123,105,102,40,33,78,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,76,111,116,116,105,101,32,74,83,79,78,32,115,116,114,105,110,103,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,115,116,114,105,110,103,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,76,111,116,116,105,101,32,74,83,79,78,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,116,44,101,44,114,41,125,101,108,115,101,32,105,102,40,116,32,105,110,115,116,97,110,99,101,111,102,32,65,114,114,97,121,66,117,102,102,101,114,41,123,105,102,40,33,86,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,100,111,116,76,111,116,116,105,101,32,65,114,114,97,121,66,117,102,102,101,114,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,65,114,114,97,121,66,117,102,102,101,114,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,100,111,116,76,111,116,116,105,101,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,100,111,116,108,111,116,116,105,101,95,100,97,116,97,40,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,116,41,44,101,44,114,41,125,101,108,115,101,32,105,102,40,116,121,112,101,111,102,32,116,61,61,34,111,98,106,101,99,116,34,41,123,105,102,40,33,78,40,116,41,41,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,34,73,110,118,97,108,105,100,32,76,111,116,116,105,101,32,74,83,79,78,32,111,98,106,101,99,116,58,32,84,104,101,32,112,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,100,111,101,115,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,32,116,104,101,32,76,111,116,116,105,101,32,74,83,79,78,32,102,111,114,109,97,116,46,34,41,59,114,101,116,117,114,110,125,115,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,40,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,44,101,44,114,41,125,101,108,115,101,123,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,85,110,115,117,112,112,111,114,116,101,100,32,100,97,116,97,32,116,121,112,101,32,102,111,114,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,46,32,69,120,112,101,99,116,101,100,58,10,32,32,32,32,32,32,32,32,32,32,45,32,115,116,114,105,110,103,32,40,76,111,116,116,105,101,32,74,83,79,78,41,44,10,32,32,32,32,32,32,32,32,32,32,45,32,65,114,114,97,121,66,117,102,102,101,114,32,40,100,111,116,76,111,116,116,105,101,41,44,10,32,32,32,32,32,32,32,32,32,32,45,32,111,98,106,101,99,116,32,40,76,111,116,116,105,101,32,74,83,79,78,41,46,10,32,32,32,32,32,32,32,32,32,32,82,101,99,101,105,118,101,100,58,32,36,123,116,121,112,101,111,102,32,116,125,96,41,59,114,101,116,117,114,110,125,115,63,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,41,44,103,38,38,116,104,105,115,46,114,101,115,105,122,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,109,97,114,107,101,114,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,44,115,101,116,84,105,109,101,111,117,116,40,40,41,61,62,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,116,104,105,115,46,99,117,114,114,101,110,116,70,114,97,109,101,125,41,125,44,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,63,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,73,100,41,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,38,38,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,38,38,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,40,118,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,38,38,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,41,41,58,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,125,95,108,111,97,100,70,114,111,109,83,114,99,40,116,41,123,116,104,105,115,46,95,102,101,116,99,104,68,97,116,97,40,116,41,46,116,104,101,110,40,101,61,62,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,101,41,41,46,99,97,116,99,104,40,101,61,62,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,100,97,116,97,32,102,114,111,109,32,85,82,76,58,32,36,123,116,125,46,32,36,123,101,125,96,41,41,125,103,101,116,32,98,117,102,102,101,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,58,110,117,108,108,125,103,101,116,32,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,97,110,105,109,97,116,105,111,110,95,105,100,40,41,63,63,118,111,105,100,32,48,125,103,101,116,32,97,99,116,105,118,101,84,104,101,109,101,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,116,104,101,109,101,95,105,100,40,41,63,63,118,111,105,100,32,48,125,103,101,116,32,108,97,121,111,117,116,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,123,97,108,105,103,110,58,91,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,97,108,105,103,110,95,120,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,97,108,105,103,110,95,121,40,41,93,44,102,105,116,58,102,116,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,97,121,111,117,116,95,102,105,116,40,41,41,125,125,103,101,116,32,109,97,114,107,101,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,99,117,114,114,101,110,116,95,109,97,114,107,101,114,40,41,63,63,34,34,125,103,101,116,32,109,97,110,105,102,101,115,116,40,41,123,116,114,121,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,109,97,110,105,102,101,115,116,95,115,116,114,105,110,103,40,41,59,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,33,116,41,114,101,116,117,114,110,32,110,117,108,108,59,108,101,116,32,101,61,74,83,79,78,46,112,97,114,115,101,40,116,41,59,114,101,116,117,114,110,32,79,98,106,101,99,116,46,107,101,121,115,40,101,41,46,108,101,110,103,116,104,61,61,61,48,63,110,117,108,108,58,101,125,99,97,116,99,104,123,114,101,116,117,114,110,32,110,117,108,108,125,125,103,101,116,32,114,101,110,100,101,114,67,111,110,102,105,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,125,103,101,116,32,115,101,103,109,101,110,116,40,41,123,105,102,40,33,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,124,124,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,104,97,115,95,115,101,103,109,101,110,116,40,41,41,41,114,101,116,117,114,110,91,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,103,109,101,110,116,95,115,116,97,114,116,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,103,109,101,110,116,95,101,110,100,40,41,93,125,103,101,116,32,108,111,111,112,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,108,111,111,112,95,97,110,105,109,97,116,105,111,110,40,41,63,63,33,49,125,103,101,116,32,109,111,100,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,103,116,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,109,111,100,101,40,41,41,58,34,102,111,114,119,97,114,100,34,125,103,101,116,32,105,115,70,114,111,122,101,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,105,115,70,114,111,122,101,110,125,103,101,116,32,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,125,103,101,116,32,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,63,63,34,34,125,103,101,116,32,97,117,116,111,112,108,97,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,97,117,116,111,112,108,97,121,40,41,63,63,33,49,125,103,101,116,32,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,41,63,63,33,49,125,103,101,116,32,115,112,101,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,112,101,101,100,40,41,63,63,48,125,103,101,116,32,105,115,82,101,97,100,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,125,103,101,116,32,105,115,76,111,97,100,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,108,111,97,100,101,100,40,41,63,63,33,49,125,103,101,116,32,105,115,80,108,97,121,105,110,103,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,108,97,121,105,110,103,40,41,63,63,33,49,125,103,101,116,32,105,115,80,97,117,115,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,112,97,117,115,101,100,40,41,63,63,33,49,125,103,101,116,32,105,115,83,116,111,112,112,101,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,105,115,95,115,116,111,112,112,101,100,40,41,63,63,33,49,125,103,101,116,32,99,117,114,114,101,110,116,70,114,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,77,97,116,104,46,114,111,117,110,100,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,117,114,114,101,110,116,95,102,114,97,109,101,40,41,42,49,48,48,41,47,49,48,48,58,48,125,103,101,116,32,108,111,111,112,67,111,117,110,116,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,99,117,114,114,101,110,116,95,108,111,111,112,95,99,111,117,110,116,40,41,63,63,48,125,103,101,116,32,116,111,116,97,108,70,114,97,109,101,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,116,111,116,97,108,95,102,114,97,109,101,115,40,41,63,63,48,125,103,101,116,32,100,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,100,117,114,97,116,105,111,110,40,41,63,63,48,125,103,101,116,32,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,101,103,109,101,110,116,95,100,117,114,97,116,105,111,110,40,41,63,63,48,125,103,101,116,32,99,97,110,118,97,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,99,97,110,118,97,115,125,108,111,97,100,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,97,117,116,111,112,108,97,121,40,116,46,97,117,116,111,112,108,97,121,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,46,108,111,111,112,63,63,33,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,46,108,111,111,112,67,111,117,110,116,63,63,48,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,71,40,116,46,109,111,100,101,63,63,34,102,111,114,119,97,114,100,34,41,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,46,115,112,101,101,100,63,63,49,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,63,63,33,48,41,44,116,46,115,101,103,109,101,110,116,38,38,116,46,115,101,103,109,101,110,116,46,108,101,110,103,116,104,61,61,61,50,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,46,115,101,103,109,101,110,116,91,48,93,44,116,46,115,101,103,109,101,110,116,91,49,93,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,101,103,109,101,110,116,40,41,44,116,104,105,115,46,95,109,97,114,107,101,114,61,116,46,109,97,114,107,101,114,63,63,34,34,44,116,104,105,115,46,95,109,97,114,107,101,114,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,104,105,115,46,95,109,97,114,107,101,114,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,109,97,114,107,101,114,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,108,97,121,111,117,116,63,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,108,97,121,111,117,116,63,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,44,116,46,100,97,116,97,63,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,116,46,100,97,116,97,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,100,97,116,97,58,116,46,100,97,116,97,125,58,116,46,115,114,99,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,116,46,115,114,99,41,58,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,123,115,114,99,58,116,46,115,114,99,125,41,44,116,104,105,115,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,63,63,34,34,41,41,125,95,100,114,97,119,40,41,123,105,102,40,33,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,116,104,105,115,46,95,99,97,110,118,97,115,61,61,61,110,117,108,108,41,38,38,40,33,116,104,105,115,46,95,99,111,110,116,101,120,116,38,38,34,103,101,116,67,111,110,116,101,120,116,34,105,110,32,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,121,112,101,111,102,32,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,67,111,110,116,101,120,116,61,61,34,102,117,110,99,116,105,111,110,34,38,38,40,116,121,112,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,60,34,117,34,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,124,124,116,121,112,101,111,102,32,79,102,102,115,99,114,101,101,110,67,97,110,118,97,115,60,34,117,34,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,79,102,102,115,99,114,101,101,110,67,97,110,118,97,115,41,38,38,40,116,104,105,115,46,95,99,111,110,116,101,120,116,61,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,67,111,110,116,101,120,116,40,34,50,100,34,41,41,44,116,104,105,115,46,95,99,111,110,116,101,120,116,41,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,112,105,120,101,108,95,98,117,102,102,101,114,40,41,44,101,61,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,42,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,42,75,59,105,102,40,116,46,98,121,116,101,76,101,110,103,116,104,33,61,61,101,41,123,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,61,61,101,63,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,43,61,49,58,40,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,49,44,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,101,41,44,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,61,61,49,48,38,38,99,111,110,115,111,108,101,46,119,97,114,110,40,96,91,100,111,116,108,111,116,116,105,101,45,119,101,98,93,32,80,101,114,115,105,115,116,101,110,116,32,98,117,102,102,101,114,32,115,105,122,101,32,109,105,115,109,97,116,99,104,32,100,101,116,101,99,116,101,100,46,32,69,120,112,101,99,116,101,100,32,36,123,101,125,32,98,121,116,101,115,32,102,111,114,32,99,97,110,118,97,115,32,36,123,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,125,120,36,123,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,125,44,32,98,117,116,32,103,111,116,32,36,123,116,46,98,121,116,101,76,101,110,103,116,104,125,32,98,121,116,101,115,46,32,84,104,105,115,32,109,97,121,32,105,110,100,105,99,97,116,101,32,97,32,87,65,83,77,32,109,101,109,111,114,121,32,97,108,108,111,99,97,116,105,111,110,32,105,115,115,117,101,32,111,114,32,105,110,118,97,108,105,100,32,99,97,110,118,97,115,32,100,105,109,101,110,115,105,111,110,115,46,96,41,59,114,101,116,117,114,110,125,116,104,105,115,46,95,98,117,102,102,101,114,77,105,115,109,97,116,99,104,67,111,117,110,116,61,48,44,116,104,105,115,46,95,108,97,115,116,69,120,112,101,99,116,101,100,66,117,102,102,101,114,83,105,122,101,61,101,59,108,101,116,32,114,61,110,117,108,108,44,115,61,110,101,119,32,85,105,110,116,56,67,108,97,109,112,101,100,65,114,114,97,121,40,116,46,98,117,102,102,101,114,44,116,46,98,121,116,101,79,102,102,115,101,116,44,116,46,98,121,116,101,76,101,110,103,116,104,41,59,116,121,112,101,111,102,32,73,109,97,103,101,68,97,116,97,62,34,117,34,63,40,114,61,116,104,105,115,46,95,99,111,110,116,101,120,116,46,99,114,101,97,116,101,73,109,97,103,101,68,97,116,97,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,44,114,46,100,97,116,97,46,115,101,116,40,115,41,41,58,114,61,110,101,119,32,73,109,97,103,101,68,97,116,97,40,115,44,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,44,116,104,105,115,46,95,99,111,110,116,101,120,116,46,112,117,116,73,109,97,103,101,68,97,116,97,40,114,44,48,44,48,41,125,125,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,99,97,110,118,97,115,38,38,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,118,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,98,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,41,125,95,105,110,105,116,105,97,108,105,122,101,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,115,101,116,117,112,82,101,110,100,101,114,101,114,79,110,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,40,118,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,38,38,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,38,38,116,104,105,115,46,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,105,122,101,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,95,115,101,116,117,112,82,101,110,100,101,114,101,114,79,110,67,97,110,118,97,115,40,41,123,116,104,105,115,46,95,99,111,110,116,101,120,116,61,110,117,108,108,125,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,99,97,110,99,101,108,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,41,44,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,110,117,108,108,41,125,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,38,38,33,116,104,105,115,46,95,105,115,70,114,111,122,101,110,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,41,38,38,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,76,111,111,112,46,98,105,110,100,40,116,104,105,115,41,41,41,125,95,97,110,105,109,97,116,105,111,110,76,111,111,112,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,114,101,116,117,114,110,125,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,38,38,33,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,114,101,116,117,114,110,125,116,114,121,123,108,101,116,32,116,61,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,116,105,99,107,40,41,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,116,105,99,107,40,41,59,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,63,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,58,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,38,38,116,104,105,115,46,95,100,114,97,119,40,41,44,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,116,104,105,115,46,95,102,114,97,109,101,77,97,110,97,103,101,114,46,114,101,113,117,101,115,116,65,110,105,109,97,116,105,111,110,70,114,97,109,101,40,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,76,111,111,112,46,98,105,110,100,40,116,104,105,115,41,41,125,99,97,116,99,104,40,116,41,123,99,111,110,115,111,108,101,46,101,114,114,111,114,40,34,69,114,114,111,114,32,105,110,32,97,110,105,109,97,116,105,111,110,32,102,114,97,109,101,58,34,44,116,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,114,101,110,100,101,114,69,114,114,111,114,34,44,101,114,114,111,114,58,116,125,41,44,116,32,105,110,115,116,97,110,99,101,111,102,32,87,101,98,65,115,115,101,109,98,108,121,46,82,117,110,116,105,109,101,69,114,114,111,114,38,38,116,104,105,115,46,100,101,115,116,114,111,121,40,41,125,125,112,108,97,121,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,33,116,104,105,115,46,105,115,76,111,97,100,101,100,41,114,101,116,117,114,110,59,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,108,97,121,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,40,116,124,124,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,41,38,38,40,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,104,105,115,46,95,99,97,110,118,97,115,38,38,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,38,38,33,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,38,38,116,104,105,115,46,102,114,101,101,122,101,40,41,125,112,97,117,115,101,40,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,112,97,117,115,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,125,115,116,111,112,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,111,112,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,38,38,40,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,97,109,101,34,44,99,117,114,114,101,110,116,70,114,97,109,101,58,116,104,105,115,46,99,117,114,114,101,110,116,70,114,97,109,101,125,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,115,101,116,70,114,97,109,101,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,59,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,101,107,40,116,41,41,123,108,101,116,32,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,59,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,114,38,38,116,104,105,115,46,95,100,114,97,119,40,41,125,125,115,101,116,83,112,101,101,100,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,112,101,101,100,40,116,41,125,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,63,116,104,105,115,46,95,99,97,110,118,97,115,46,115,116,121,108,101,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,61,116,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,98,97,99,107,103,114,111,117,110,100,95,99,111,108,111,114,40,110,116,40,116,41,41,44,116,104,105,115,46,95,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,61,116,41,125,115,101,116,76,111,111,112,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,40,116,41,125,115,101,116,76,111,111,112,67,111,117,110,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,111,111,112,95,99,111,117,110,116,40,116,41,125,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,117,115,101,95,102,114,97,109,101,95,105,110,116,101,114,112,111,108,97,116,105,111,110,40,116,41,125,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,125,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,123,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,116,44,101,41,125,100,101,115,116,114,111,121,40,41,123,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,102,114,101,101,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,110,117,108,108,44,116,104,105,115,46,95,99,111,110,116,101,120,116,61,110,117,108,108,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,100,101,115,116,114,111,121,34,125,41,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,114,101,109,111,118,101,65,108,108,69,118,101,110,116,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,125,102,114,101,101,122,101,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,48,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,102,114,101,101,122,101,34,125,41,41,125,117,110,102,114,101,101,122,101,40,41,123,116,104,105,115,46,95,97,110,105,109,97,116,105,111,110,70,114,97,109,101,73,100,61,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,105,115,70,114,111,122,101,110,61,33,49,44,116,104,105,115,46,95,101,118,101,110,116,77,97,110,97,103,101,114,46,100,105,115,112,97,116,99,104,40,123,116,121,112,101,58,34,117,110,102,114,101,101,122,101,34,125,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,125,114,101,115,105,122,101,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,124,124,33,116,104,105,115,46,105,115,76,111,97,100,101,100,124,124,33,116,104,105,115,46,95,99,97,110,118,97,115,41,114,101,116,117,114,110,59,105,102,40,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,41,123,108,101,116,32,101,61,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,119,105,110,100,111,119,46,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,124,124,49,44,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,61,116,104,105,115,46,95,99,97,110,118,97,115,46,103,101,116,66,111,117,110,100,105,110,103,67,108,105,101,110,116,82,101,99,116,40,41,59,114,33,61,61,48,38,38,115,33,61,61,48,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,61,115,42,101,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,61,114,42,101,41,125,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,105,122,101,40,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,115,101,116,67,97,110,118,97,115,40,116,41,123,105,102,40,33,40,33,116,124,124,116,104,105,115,46,95,99,97,110,118,97,115,61,61,61,116,41,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,38,38,116,104,105,115,46,95,99,108,101,97,110,117,112,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,99,97,110,118,97,115,61,116,44,116,104,105,115,46,95,105,110,105,116,105,97,108,105,122,101,67,97,110,118,97,115,40,41,44,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,41,41,123,108,101,116,32,101,61,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,59,116,104,105,115,46,95,112,101,110,100,105,110,103,76,111,97,100,61,110,117,108,108,44,101,46,100,97,116,97,63,116,104,105,115,46,95,108,111,97,100,70,114,111,109,68,97,116,97,40,101,46,100,97,116,97,41,58,101,46,115,114,99,38,38,116,104,105,115,46,95,108,111,97,100,70,114,111,109,83,114,99,40,101,46,115,114,99,41,125,125,115,101,116,84,114,97,110,115,102,111,114,109,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,114,97,110,115,102,111,114,109,40,110,101,119,32,70,108,111,97,116,51,50,65,114,114,97,121,40,116,41,41,59,114,101,116,117,114,110,32,101,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,38,38,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,103,101,116,84,114,97,110,115,102,111,114,109,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,116,114,97,110,115,102,111,114,109,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,102,114,111,109,40,116,41,125,115,101,116,83,101,103,109,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,101,103,109,101,110,116,40,116,44,101,41,125,115,101,116,77,111,100,101,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,111,100,101,40,71,40,116,41,41,125,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,40,116,41,123,108,101,116,123,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,101,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,114,44,113,117,97,108,105,116,121,58,115,44,46,46,46,105,125,61,116,59,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,61,123,46,46,46,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,44,46,46,46,105,44,100,101,118,105,99,101,80,105,120,101,108,82,97,116,105,111,58,101,124,124,85,40,41,44,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,58,114,63,63,33,48,44,46,46,46,115,33,61,61,118,111,105,100,32,48,38,38,123,113,117,97,108,105,116,121,58,115,125,125,44,115,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,115,41,44,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,97,117,116,111,82,101,115,105,122,101,63,98,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,58,98,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,102,114,101,101,122,101,79,110,79,102,102,115,99,114,101,101,110,63,40,118,46,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,44,116,104,105,115,41,44,83,40,116,104,105,115,46,95,99,97,110,118,97,115,41,124,124,116,104,105,115,46,102,114,101,101,122,101,40,41,41,58,40,118,46,117,110,111,98,115,101,114,118,101,40,116,104,105,115,46,95,99,97,110,118,97,115,41,44,116,104,105,115,46,95,105,115,70,114,111,122,101,110,38,38,116,104,105,115,46,117,110,102,114,101,101,122,101,40,41,41,41,125,108,111,97,100,65,110,105,109,97,116,105,111,110,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,124,124,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,97,110,105,109,97,116,105,111,110,95,105,100,40,41,61,61,61,116,124,124,33,116,104,105,115,46,95,99,97,110,118,97,115,41,114,101,116,117,114,110,59,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,108,111,97,100,95,97,110,105,109,97,116,105,111,110,95,102,114,111,109,95,105,100,40,116,44,116,104,105,115,46,95,99,97,110,118,97,115,46,119,105,100,116,104,44,116,104,105,115,46,95,99,97,110,118,97,115,46,104,101,105,103,104,116,41,63,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,33,61,61,118,111,105,100,32,48,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,113,117,97,108,105,116,121,40,116,104,105,115,46,95,114,101,110,100,101,114,67,111,110,102,105,103,46,113,117,97,108,105,116,121,41,44,116,104,105,115,46,114,101,115,105,122,101,40,41,44,116,104,105,115,46,95,100,114,97,105,110,80,108,97,121,101,114,69,118,101,110,116,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,58,116,104,105,115,46,95,100,105,115,112,97,116,99,104,69,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,108,111,97,100,32,97,110,105,109,97,116,105,111,110,32,119,105,116,104,32,105,100,58,32,36,123,116,125,96,41,125,115,101,116,77,97,114,107,101,114,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,40,116,104,105,115,46,95,109,97,114,107,101,114,61,116,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,109,97,114,107,101,114,40,116,41,41,125,109,97,114,107,101,114,115,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,109,97,114,107,101,114,115,40,41,59,114,101,116,117,114,110,32,116,38,38,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,101,116,84,104,101,109,101,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,104,101,109,101,40,116,41,59,114,101,116,117,114,110,32,101,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,101,125,114,101,115,101,116,84,104,101,109,101,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,116,104,101,109,101,40,41,59,114,101,116,117,114,110,32,116,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,116,125,115,101,116,84,104,101,109,101,68,97,116,97,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,121,112,101,111,102,32,116,61,61,34,115,116,114,105,110,103,34,63,116,58,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,44,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,116,104,101,109,101,95,100,97,116,97,40,101,41,59,114,101,116,117,114,110,32,114,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,44,114,125,115,101,116,83,108,111,116,115,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,115,95,115,116,114,40,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,116,41,41,38,38,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,41,125,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,116,41,123,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,38,38,116,46,108,101,110,103,116,104,62,48,38,38,116,121,112,101,111,102,32,116,91,48,93,61,61,34,111,98,106,101,99,116,34,38,38,116,91,48,93,33,61,61,110,117,108,108,38,38,34,116,34,105,110,32,116,91,48,93,38,38,34,115,34,105,110,32,116,91,48,93,125,103,101,116,83,108,111,116,73,100,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,105,100,115,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,103,101,116,83,108,111,116,84,121,112,101,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,116,121,112,101,40,116,41,59,105,102,40,101,41,114,101,116,117,114,110,32,101,125,103,101,116,83,108,111,116,40,116,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,59,105,102,40,101,41,116,114,121,123,114,101,116,117,114,110,32,74,83,79,78,46,112,97,114,115,101,40,101,41,125,99,97,116,99,104,123,114,101,116,117,114,110,125,125,103,101,116,83,108,111,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,123,125,59,116,114,121,123,114,101,116,117,114,110,32,74,83,79,78,46,112,97,114,115,101,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,115,95,115,116,114,40,41,41,125,99,97,116,99,104,123,114,101,116,117,114,110,123,125,125,125,115,101,116,67,111,108,111,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,115,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,114,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,83,99,97,108,97,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,115,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,116,121,112,101,111,102,32,101,33,61,34,110,117,109,98,101,114,34,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,86,101,99,116,111,114,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,115,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,114,63,49,58,48,44,107,58,101,125,41,44,105,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,115,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,105,125,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,40,116,44,101,44,114,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,115,61,116,104,105,115,46,95,105,115,75,101,121,102,114,97,109,101,65,114,114,97,121,40,101,41,44,105,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,107,58,123,97,58,115,63,49,58,48,44,107,58,101,125,44,112,58,114,125,41,44,95,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,105,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,95,125,115,101,116,84,101,120,116,83,108,111,116,40,116,44,101,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,114,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,103,101,116,95,115,108,111,116,95,115,116,114,40,116,41,44,115,61,101,59,105,102,40,114,41,123,108,101,116,32,112,61,74,83,79,78,46,112,97,114,115,101,40,114,41,59,105,102,40,112,38,38,34,107,34,105,110,32,112,38,38,65,114,114,97,121,46,105,115,65,114,114,97,121,40,112,46,107,41,41,123,108,101,116,32,102,61,112,46,107,91,48,93,59,34,115,34,105,110,32,102,38,38,116,121,112,101,111,102,32,102,46,115,61,61,34,111,98,106,101,99,116,34,38,38,40,115,61,123,46,46,46,102,46,115,44,46,46,46,101,125,41,125,125,108,101,116,32,105,61,74,83,79,78,46,115,116,114,105,110,103,105,102,121,40,123,97,58,48,44,107,58,91,123,116,58,48,44,115,125,93,125,41,44,95,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,115,108,111,116,95,115,116,114,40,116,44,105,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,95,125,114,101,115,101,116,83,108,111,116,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,115,108,111,116,40,116,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,99,108,101,97,114,83,108,111,116,40,116,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,108,111,116,40,116,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,101,125,114,101,115,101,116,83,108,111,116,115,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,115,101,116,95,115,108,111,116,115,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,125,99,108,101,97,114,83,108,111,116,115,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,99,108,101,97,114,95,115,108,111,116,115,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,114,101,110,100,101,114,40,41,44,116,104,105,115,46,95,100,114,97,119,40,41,44,116,125,115,101,116,76,97,121,111,117,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,108,97,121,111,117,116,40,116,46,102,105,116,63,63,34,99,111,110,116,97,105,110,34,44,116,46,97,108,105,103,110,63,46,91,48,93,63,63,46,53,44,116,46,97,108,105,103,110,63,46,91,49,93,63,63,46,53,41,125,115,101,116,86,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,63,33,49,58,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,101,116,95,118,105,101,119,112,111,114,116,40,116,44,101,44,114,44,115,41,125,115,116,97,116,105,99,32,115,101,116,87,97,115,109,85,114,108,40,116,41,123,87,46,115,101,116,87,97,115,109,85,114,108,40,116,41,125,115,116,97,116,105,99,32,97,115,121,110,99,32,114,101,103,105,115,116,101,114,70,111,110,116,40,116,44,101,41,123,116,114,121,123,97,119,97,105,116,32,87,46,108,111,97,100,40,41,59,108,101,116,32,114,59,105,102,40,116,121,112,101,111,102,32,101,61,61,34,115,116,114,105,110,103,34,41,123,108,101,116,32,105,61,97,119,97,105,116,32,102,101,116,99,104,40,101,41,59,105,102,40,33,105,46,111,107,41,114,101,116,117,114,110,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,102,101,116,99,104,32,102,111,110,116,32,102,114,111,109,32,85,82,76,58,32,36,123,101,125,46,32,83,116,97,116,117,115,58,32,36,123,105,46,115,116,97,116,117,115,125,96,41,44,33,49,59,114,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,97,119,97,105,116,32,105,46,97,114,114,97,121,66,117,102,102,101,114,40,41,41,125,101,108,115,101,32,101,32,105,110,115,116,97,110,99,101,111,102,32,85,105,110,116,56,65,114,114,97,121,63,114,61,101,58,114,61,110,101,119,32,85,105,110,116,56,65,114,114,97,121,40,101,41,59,108,101,116,32,115,61,81,40,116,44,114,41,59,114,101,116,117,114,110,32,115,124,124,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,70,97,105,108,101,100,32,116,111,32,114,101,103,105,115,116,101,114,32,102,111,110,116,32,34,36,123,116,125,34,46,32,70,111,110,116,32,100,97,116,97,32,109,97,121,32,98,101,32,105,110,118,97,108,105,100,46,96,41,44,115,125,99,97,116,99,104,40,114,41,123,114,101,116,117,114,110,32,99,111,110,115,111,108,101,46,101,114,114,111,114,40,96,69,114,114,111,114,32,114,101,103,105,115,116,101,114,105,110,103,32,102,111,110,116,32,34,36,123,116,125,34,58,96,44,114,41,44,33,49,125,125,116,119,101,101,110,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,116,119,101,101,110,95,119,105,116,104,95,101,97,115,105,110,103,40,116,44,101,44,48,44,48,44,49,44,49,41,58,33,49,125,116,119,101,101,110,84,111,77,97,114,107,101,114,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,116,119,101,101,110,95,116,111,95,109,97,114,107,101,114,40,116,44,101,41,58,33,49,125,97,110,105,109,97,116,105,111,110,83,105,122,101,40,41,123,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,97,110,105,109,97,116,105,111,110,95,115,105,122,101,40,41,59,114,101,116,117,114,110,123,119,105,100,116,104,58,116,63,46,91,48,93,63,63,48,44,104,101,105,103,104,116,58,116,63,46,91,49,93,63,63,48,125,125,103,101,116,76,97,121,101,114,66,111,117,110,100,105,110,103,66,111,120,40,116,41,123,108,101,116,32,101,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,103,101,116,95,108,97,121,101,114,95,98,111,117,110,100,115,40,116,41,59,105,102,40,101,38,38,101,46,108,101,110,103,116,104,61,61,61,56,41,114,101,116,117,114,110,32,65,114,114,97,121,46,102,114,111,109,40,101,41,125,115,116,97,116,105,99,32,116,114,97,110,115,102,111,114,109,84,104,101,109,101,84,111,76,111,116,116,105,101,83,108,111,116,115,40,116,44,101,41,123,114,101,116,117,114,110,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,95,102,114,111,109,95,105,100,40,116,41,58,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,108,111,97,100,40,116,41,58,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,40,116,41,123,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,61,116,125,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,123,105,102,40,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,61,61,61,110,117,108,108,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,115,116,97,114,116,40,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,46,111,112,101,110,85,114,108,80,111,108,105,99,121,63,46,114,101,113,117,105,114,101,85,115,101,114,73,110,116,101,114,97,99,116,105,111,110,63,63,33,48,44,116,104,105,115,46,95,115,116,97,116,101,77,97,99,104,105,110,101,67,111,110,102,105,103,63,46,111,112,101,110,85,114,108,80,111,108,105,99,121,63,46,119,104,105,116,101,108,105,115,116,63,63,91,93,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,44,116,38,38,40,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,48,44,116,104,105,115,46,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,115,116,97,114,116,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,125,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,33,49,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,115,116,111,112,40,41,59,114,101,116,117,114,110,32,116,104,105,115,46,95,100,114,97,105,110,83,109,69,118,101,110,116,115,40,41,44,116,38,38,40,116,104,105,115,46,95,105,115,83,116,97,116,101,77,97,99,104,105,110,101,82,117,110,110,105,110,103,61,33,49,44,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,105,115,95,112,108,97,121,105,110,103,40,41,124,124,116,104,105,115,46,95,115,116,111,112,65,110,105,109,97,116,105,111,110,76,111,111,112,40,41,41,44,116,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,116,97,116,117,115,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,116,97,116,101,95,109,97,99,104,105,110,101,95,105,100,40,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,40,116,44,101,61,33,49,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,111,118,101,114,114,105,100,101,95,99,117,114,114,101,110,116,95,115,116,97,116,101,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,103,101,116,95,115,116,97,116,101,95,109,97,99,104,105,110,101,40,116,41,63,63,34,34,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,102,114,97,109,101,119,111,114,107,95,115,101,116,117,112,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,40,116,44,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,115,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,44,101,41,63,63,33,49,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,98,111,111,108,101,97,110,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,110,117,109,101,114,105,99,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,40,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,103,101,116,95,115,116,114,105,110,103,95,105,110,112,117,116,40,116,41,63,63,118,111,105,100,32,48,125,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,40,41,123,105,102,40,33,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,41,114,101,116,117,114,110,91,93,59,108,101,116,32,116,61,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,46,115,109,95,103,101,116,95,105,110,112,117,116,115,40,41,59,114,101,116,117,114,110,32,65,114,114,97,121,46,105,115,65,114,114,97,121,40,116,41,63,116,58,91,93,125,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,40,116,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,102,105,114,101,40,116,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,99,108,105,99,107,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,117,112,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,100,111,119,110,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,109,111,118,101,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,110,116,101,114,40,116,44,101,41,125,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,116,44,101,41,123,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,63,46,115,109,95,112,111,115,116,95,112,111,105,110,116,101,114,95,101,120,105,116,40,116,44,101,41,125,95,111,110,67,108,105,99,107,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,85,112,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,68,111,119,110,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,77,111,118,101,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,69,110,116,101,114,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,111,110,80,111,105,110,116,101,114,76,101,97,118,101,40,116,41,123,108,101,116,32,101,61,69,40,116,41,59,101,38,38,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,101,46,120,44,101,46,121,41,125,95,115,101,116,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,123,105,102,40,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,116,104,105,115,46,95,100,111,116,76,111,116,116,105,101,67,111,114,101,33,61,61,110,117,108,108,38,38,116,104,105,115,46,105,115,76,111,97,100,101,100,41,123,108,101,116,32,116,61,116,104,105,115,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,59,116,104,105,115,46,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,44,116,46,105,110,99,108,117,100,101,115,40,34,67,108,105,99,107,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,61,116,104,105,115,46,95,111,110,67,108,105,99,107,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,99,108,105,99,107,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,85,112,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,85,112,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,117,112,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,68,111,119,110,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,68,111,119,110,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,100,111,119,110,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,77,111,118,101,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,77,111,118,101,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,109,111,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,69,110,116,101,114,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,69,110,116,101,114,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,101,110,116,101,114,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,41,41,44,116,46,105,110,99,108,117,100,101,115,40,34,80,111,105,110,116,101,114,69,120,105,116,34,41,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,61,116,104,105,115,46,95,111,110,80,111,105,110,116,101,114,76,101,97,118,101,46,98,105,110,100,40,116,104,105,115,41,44,116,104,105,115,46,95,99,97,110,118,97,115,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,108,101,97,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,41,41,125,125,95,99,108,101,97,110,117,112,83,116,97,116,101,77,97,99,104,105,110,101,76,105,115,116,101,110,101,114,115,40,41,123,103,38,38,116,104,105,115,46,95,99,97,110,118,97,115,32,105,110,115,116,97,110,99,101,111,102,32,72,84,77,76,67,97,110,118,97,115,69,108,101,109,101,110,116,38,38,40,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,99,108,105,99,107,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,67,108,105,99,107,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,117,112,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,85,112,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,100,111,119,110,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,68,111,119,110,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,109,111,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,77,111,118,101,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,101,110,116,101,114,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,69,110,116,101,114,61,110,117,108,108,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,38,38,40,116,104,105,115,46,95,99,97,110,118,97,115,46,114,101,109,111,118,101,69,118,101,110,116,76,105,115,116,101,110,101,114,40,34,112,111,105,110,116,101,114,108,101,97,118,101,34,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,41,44,116,104,105,115,46,95,98,111,117,110,100,79,110,80,111,105,110,116,101,114,76,101,97,118,101,61,110,117,108,108,41,41,125,125,59,118,97,114,32,97,61,110,101,119,32,77,97,112,44,119,116,61,123,114,101,97,100,121,58,110,61,62,116,61,62,123,108,101,116,32,101,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,97,100,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,44,99,111,109,112,108,101,116,101,58,110,61,62,116,61,62,123,108,101,116,32,101,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,67,111,109,112,108,101,116,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,44,108,111,97,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,97,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,108,111,97,100,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,97,100,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,114,101,110,100,101,114,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,110,100,101,114,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,108,111,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,76,111,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,112,108,97,121,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,80,108,97,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,112,97,117,115,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,80,97,117,115,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,102,114,97,109,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,70,114,97,109,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,114,101,110,100,101,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,82,101,110,100,101,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,102,114,101,101,122,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,70,114,101,101,122,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,117,110,102,114,101,101,122,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,85,110,102,114,101,101,122,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,100,101,115,116,114,111,121,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,68,101,115,116,114,111,121,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,58,110,61,62,116,61,62,123,108,101,116,32,114,61,123,105,100,58,34,34,44,109,101,116,104,111,100,58,34,111,110,83,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,44,114,101,115,117,108,116,58,123,105,110,115,116,97,110,99,101,73,100,58,110,44,101,118,101,110,116,58,116,125,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,114,41,125,125,44,72,61,123,115,101,116,84,114,97,110,115,102,111,114,109,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,84,114,97,110,115,102,111,114,109,40,110,46,112,97,114,97,109,115,46,116,114,97,110,115,102,111,114,109,41,125,44,103,101,116,84,114,97,110,115,102,111,114,109,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,84,114,97,110,115,102,111,114,109,40,41,125,44,103,101,116,68,111,116,76,111,116,116,105,101,73,110,115,116,97,110,99,101,83,116,97,116,101,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,123,115,116,97,116,101,58,123,108,111,111,112,67,111,117,110,116,58,101,46,108,111,111,112,67,111,117,110,116,44,105,115,76,111,97,100,101,100,58,101,46,105,115,76,111,97,100,101,100,44,105,115,80,97,117,115,101,100,58,101,46,105,115,80,97,117,115,101,100,44,105,115,80,108,97,121,105,110,103,58,101,46,105,115,80,108,97,121,105,110,103,44,105,115,83,116,111,112,112,101,100,58,101,46,105,115,83,116,111,112,112,101,100,44,105,115,70,114,111,122,101,110,58,101,46,105,115,70,114,111,122,101,110,44,108,111,111,112,58,101,46,108,111,111,112,44,109,111,100,101,58,101,46,109,111,100,101,44,115,112,101,101,100,58,101,46,115,112,101,101,100,44,99,117,114,114,101,110,116,70,114,97,109,101,58,101,46,99,117,114,114,101,110,116,70,114,97,109,101,44,116,111,116,97,108,70,114,97,109,101,115,58,101,46,116,111,116,97,108,70,114,97,109,101,115,44,100,117,114,97,116,105,111,110,58,101,46,100,117,114,97,116,105,111,110,44,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,58,101,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,44,114,101,110,100,101,114,67,111,110,102,105,103,58,101,46,114,101,110,100,101,114,67,111,110,102,105,103,44,109,97,114,107,101,114,58,101,46,109,97,114,107,101,114,44,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,58,101,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,44,109,97,114,107,101,114,115,58,101,46,109,97,114,107,101,114,115,40,41,44,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,58,101,46,97,99,116,105,118,101,65,110,105,109,97,116,105,111,110,73,100,44,97,99,116,105,118,101,84,104,101,109,101,73,100,58,101,46,97,99,116,105,118,101,84,104,101,109,101,73,100,44,97,117,116,111,112,108,97,121,58,101,46,97,117,116,111,112,108,97,121,44,115,101,103,109,101,110,116,58,101,46,115,101,103,109,101,110,116,44,108,97,121,111,117,116,58,101,46,108,97,121,111,117,116,44,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,58,101,46,115,101,103,109,101,110,116,68,117,114,97,116,105,111,110,44,105,115,82,101,97,100,121,58,101,46,105,115,82,101,97,100,121,44,109,97,110,105,102,101,115,116,58,101,46,109,97,110,105,102,101,115,116,125,125,125,44,115,101,116,76,97,121,111,117,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,97,121,111,117,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,97,121,111,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,76,105,115,116,101,110,101,114,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,68,97,116,97,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,76,111,97,100,68,97,116,97,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,67,108,105,99,107,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,85,112,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,68,111,119,110,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,77,111,118,101,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,110,116,101,114,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,80,111,115,116,80,111,105,110,116,101,114,69,120,105,116,69,118,101,110,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,67,111,110,102,105,103,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,83,101,116,83,116,114,105,110,103,73,110,112,117,116,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,78,117,109,101,114,105,99,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,66,111,111,108,101,97,110,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,114,105,110,103,73,110,112,117,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,73,110,112,117,116,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,110,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,70,105,114,101,69,118,101,110,116,40,101,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,83,116,97,116,117,115,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,67,117,114,114,101,110,116,83,116,97,116,101,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,65,99,116,105,118,101,73,100,40,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,44,114,61,110,46,112,97,114,97,109,115,46,105,109,109,101,100,105,97,116,101,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,115,116,97,116,101,77,97,99,104,105,110,101,79,118,101,114,114,105,100,101,83,116,97,116,101,40,101,44,114,41,125,44,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,116,97,116,101,77,97,99,104,105,110,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,116,97,116,101,77,97,99,104,105,110,101,71,101,116,40,101,41,125,44,99,114,101,97,116,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,115,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,59,105,102,40,97,46,104,97,115,40,116,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,97,108,114,101,97,100,121,32,101,120,105,115,116,115,46,96,41,59,108,101,116,32,105,61,110,101,119,32,77,40,101,41,59,114,101,116,117,114,110,32,105,46,99,97,110,118,97,115,38,38,40,105,46,99,97,110,118,97,115,46,104,101,105,103,104,116,61,115,44,105,46,99,97,110,118,97,115,46,119,105,100,116,104,61,114,41,44,97,46,115,101,116,40,116,44,105,41,44,91,34,99,111,109,112,108,101,116,101,34,44,34,102,114,97,109,101,34,44,34,108,111,97,100,34,44,34,108,111,97,100,69,114,114,111,114,34,44,34,114,101,110,100,101,114,69,114,114,111,114,34,44,34,108,111,111,112,34,44,34,112,97,117,115,101,34,44,34,112,108,97,121,34,44,34,115,116,111,112,34,44,34,100,101,115,116,114,111,121,34,44,34,102,114,101,101,122,101,34,44,34,117,110,102,114,101,101,122,101,34,44,34,114,101,110,100,101,114,34,44,34,114,101,97,100,121,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,114,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,111,112,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,84,114,97,110,115,105,116,105,111,110,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,110,116,101,114,101,100,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,97,116,101,69,120,105,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,67,117,115,116,111,109,69,118,101,110,116,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,69,114,114,111,114,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,66,111,111,108,101,97,110,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,78,117,109,101,114,105,99,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,83,116,114,105,110,103,73,110,112,117,116,86,97,108,117,101,67,104,97,110,103,101,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,112,117,116,70,105,114,101,100,34,44,34,115,116,97,116,101,77,97,99,104,105,110,101,73,110,116,101,114,110,97,108,77,101,115,115,97,103,101,34,93,46,102,111,114,69,97,99,104,40,112,61,62,123,105,46,97,100,100,69,118,101,110,116,76,105,115,116,101,110,101,114,40,112,44,119,116,91,112,93,40,116,41,41,125,41,44,123,105,110,115,116,97,110,99,101,73,100,58,116,125,125,44,100,101,115,116,114,111,121,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,101,38,38,40,101,46,100,101,115,116,114,111,121,40,41,44,97,46,100,101,108,101,116,101,40,116,41,41,125,44,102,114,101,101,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,102,114,101,101,122,101,40,41,125,44,108,111,97,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,99,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,108,111,97,100,40,101,41,125,44,108,111,97,100,65,110,105,109,97,116,105,111,110,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,97,110,105,109,97,116,105,111,110,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,108,111,97,100,65,110,105,109,97,116,105,111,110,40,101,41,125,44,115,101,116,84,104,101,109,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,116,104,101,109,101,73,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,101,116,84,104,101,109,101,40,101,41,125,44,115,101,116,84,104,101,109,101,68,97,116,97,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,116,104,101,109,101,68,97,116,97,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,114,46,115,101,116,84,104,101,109,101,68,97,116,97,40,101,41,125,44,112,97,117,115,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,112,97,117,115,101,40,41,125,44,112,108,97,121,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,112,108,97,121,40,41,125,44,114,101,103,105,115,116,101,114,70,111,110,116,58,97,115,121,110,99,32,110,61,62,123,108,101,116,123,102,111,110,116,78,97,109,101,58,116,44,102,111,110,116,83,111,117,114,99,101,58,101,125,61,110,46,112,97,114,97,109,115,59,114,101,116,117,114,110,32,77,46,114,101,103,105,115,116,101,114,70,111,110,116,40,116,44,101,41,125,44,114,101,115,105,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,114,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,115,46,99,97,110,118,97,115,38,38,40,115,46,99,97,110,118,97,115,46,104,101,105,103,104,116,61,114,44,115,46,99,97,110,118,97,115,46,119,105,100,116,104,61,101,41,44,115,46,114,101,115,105,122,101,40,41,125,44,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,98,97,99,107,103,114,111,117,110,100,67,111,108,111,114,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,66,97,99,107,103,114,111,117,110,100,67,111,108,111,114,40,101,41,125,44,115,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,115,101,116,83,108,111,116,115,40,110,46,112,97,114,97,109,115,46,115,108,111,116,115,41,125,44,103,101,116,83,108,111,116,73,100,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,73,100,115,40,41,125,44,103,101,116,83,108,111,116,84,121,112,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,84,121,112,101,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,103,101,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,103,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,103,101,116,83,108,111,116,115,40,41,125,44,115,101,116,67,111,108,111,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,67,111,108,111,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,83,99,97,108,97,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,83,99,97,108,97,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,86,101,99,116,111,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,86,101,99,116,111,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,71,114,97,100,105,101,110,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,44,110,46,112,97,114,97,109,115,46,99,111,108,111,114,83,116,111,112,67,111,117,110,116,41,125,44,115,101,116,84,101,120,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,115,101,116,84,101,120,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,44,110,46,112,97,114,97,109,115,46,118,97,108,117,101,41,125,44,114,101,115,101,116,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,114,101,115,101,116,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,99,108,101,97,114,83,108,111,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,99,108,101,97,114,83,108,111,116,40,110,46,112,97,114,97,109,115,46,115,108,111,116,73,100,41,125,44,114,101,115,101,116,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,114,101,115,101,116,83,108,111,116,115,40,41,125,44,99,108,101,97,114,83,108,111,116,115,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,101,46,99,108,101,97,114,83,108,111,116,115,40,41,125,44,115,101,116,70,114,97,109,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,102,114,97,109,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,70,114,97,109,101,40,101,41,125,44,115,101,116,77,111,100,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,109,111,100,101,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,77,111,100,101,40,101,41,125,44,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,114,101,110,100,101,114,67,111,110,102,105,103,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,82,101,110,100,101,114,67,111,110,102,105,103,40,101,41,125,44,115,101,116,83,101,103,109,101,110,116,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,101,103,109,101,110,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,83,101,103,109,101,110,116,40,101,91,48,93,44,101,91,49,93,41,125,44,115,101,116,83,112,101,101,100,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,115,112,101,101,100,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,83,112,101,101,100,40,101,41,125,44,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,117,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,85,115,101,70,114,97,109,101,73,110,116,101,114,112,111,108,97,116,105,111,110,40,101,41,125,44,115,101,116,87,97,115,109,85,114,108,58,110,61,62,123,77,46,115,101,116,87,97,115,109,85,114,108,40,110,46,112,97,114,97,109,115,46,117,114,108,41,125,44,115,116,111,112,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,115,116,111,112,40,41,125,44,117,110,102,114,101,101,122,101,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,101,46,117,110,102,114,101,101,122,101,40,41,125,44,116,119,101,101,110,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,102,114,97,109,101,44,114,61,110,46,112,97,114,97,109,115,46,100,117,114,97,116,105,111,110,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,116,119,101,101,110,40,101,44,114,41,125,44,116,119,101,101,110,84,111,77,97,114,107,101,114,58,110,61,62,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,109,97,114,107,101,114,44,114,61,110,46,112,97,114,97,109,115,46,100,117,114,97,116,105,111,110,44,115,61,97,46,103,101,116,40,116,41,59,105,102,40,33,115,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,115,46,116,119,101,101,110,84,111,77,97,114,107,101,114,40,101,44,114,41,125,44,115,101,116,86,105,101,119,112,111,114,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,120,44,114,61,110,46,112,97,114,97,109,115,46,121,44,115,61,110,46,112,97,114,97,109,115,46,119,105,100,116,104,44,105,61,110,46,112,97,114,97,109,115,46,104,101,105,103,104,116,44,95,61,97,46,103,101,116,40,116,41,59,105,102,40,33,95,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,101,116,117,114,110,32,95,46,115,101,116,86,105,101,119,112,111,114,116,40,101,44,114,44,115,44,105,41,125,44,97,110,105,109,97,116,105,111,110,83,105,122,101,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,97,46,103,101,116,40,116,41,59,105,102,40,33,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,108,101,116,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,61,101,46,97,110,105,109,97,116,105,111,110,83,105,122,101,40,41,59,114,101,116,117,114,110,123,104,101,105,103,104,116,58,114,44,119,105,100,116,104,58,115,125,125,44,115,101,116,77,97,114,107,101,114,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,109,97,114,107,101,114,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,77,97,114,107,101,114,40,101,41,125,44,115,101,116,76,111,111,112,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,111,111,112,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,111,111,112,40,101,41,125,44,115,101,116,76,111,111,112,67,111,117,110,116,40,110,41,123,108,101,116,32,116,61,110,46,112,97,114,97,109,115,46,105,110,115,116,97,110,99,101,73,100,44,101,61,110,46,112,97,114,97,109,115,46,108,111,111,112,67,111,117,110,116,44,114,61,97,46,103,101,116,40,116,41,59,105,102,40,33,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,73,110,115,116,97,110,99,101,32,119,105,116,104,32,105,100,32,36,123,116,125,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,46,96,41,59,114,46,115,101,116,76,111,111,112,67,111,117,110,116,40,101,41,125,125,59,102,117,110,99,116,105,111,110,32,118,116,40,110,41,123,108,101,116,32,116,61,110,46,109,101,116,104,111,100,59,105,102,40,79,98,106,101,99,116,46,104,97,115,79,119,110,40,72,44,116,41,38,38,116,121,112,101,111,102,32,72,91,116,93,61,61,34,102,117,110,99,116,105,111,110,34,41,114,101,116,117,114,110,32,72,91,116,93,40,110,41,59,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,77,101,116,104,111,100,32,36,123,83,116,114,105,110,103,40,116,41,125,32,105,115,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,32,105,110,32,99,111,109,109,97,110,100,115,46,96,41,125,115,101,108,102,46,111,110,109,101,115,115,97,103,101,61,97,115,121,110,99,32,110,61,62,123,116,114,121,123,108,101,116,32,116,61,97,119,97,105,116,32,118,116,40,110,46,100,97,116,97,41,44,101,61,123,105,100,58,110,46,100,97,116,97,46,105,100,44,109,101,116,104,111,100,58,110,46,100,97,116,97,46,109,101,116,104,111,100,44,114,101,115,117,108,116,58,116,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,99,97,116,99,104,40,116,41,123,108,101,116,32,101,61,123,105,100,58,110,46,100,97,116,97,46,105,100,44,109,101,116,104,111,100,58,110,46,100,97,116,97,46,109,101,116,104,111,100,44,101,114,114,111,114,58,116,46,109,101,115,115,97,103,101,125,59,115,101,108,102,46,112,111,115,116,77,101,115,115,97,103,101,40,101,41,125,125,59,118,97,114,32,98,116,61,34,34,44,74,116,61,98,116,59,125,41,40,41,59,10])],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}};function hn(e,t){if(typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement){let{height:n,width:i}=e.getBoundingClientRect();if(0!==n&&0!==i)return{width:i*t,height:n*t}}return{width:e.width,height:e.height}}function pn(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}var mn=class e{constructor(t){if(yt(this,"_eventManager",new Qt),yt(this,"_id",void 0),yt(this,"_worker",void 0),yt(this,"_canvas",void 0),yt(this,"_dotLottieInstanceState",{loopCount:0,markers:[],autoplay:!1,backgroundColor:"",currentFrame:0,duration:0,loop:!1,mode:"forward",segment:[0,0],segmentDuration:0,speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:nn()},activeAnimationId:"",activeThemeId:"",layout:void 0,marker:"",isReady:!1,manifest:null}),yt(this,"_created",!1),yt(this,"_boundOnClick",null),yt(this,"_boundOnPointerUp",null),yt(this,"_boundOnPointerDown",null),yt(this,"_boundOnPointerMove",null),yt(this,"_boundOnPointerEnter",null),yt(this,"_boundOnPointerLeave",null),yt(this,"_pendingConfig",null),t.canvas){let e=typeof HTMLCanvasElement<"u"&&t.canvas instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<"u"&&t.canvas instanceof OffscreenCanvas;if(!e&&!n)throw Error("Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas")}this._canvas=t.canvas??null,this._id=`dotlottie-${pn()}`;let n=t.workerId||"defaultWorker";this._worker=e._workerManager.getWorker(n),e._workerManager.assignAnimationToWorker(this._id,n),e._wasmUrl&&this._sendMessage("setWasmUrl",{url:e._wasmUrl});let i={...t,renderConfig:{...t.renderConfig,devicePixelRatio:t.renderConfig?.devicePixelRatio||nn(),freezeOnOffscreen:t.renderConfig?.freezeOnOffscreen??!0}};this._pendingConfig=i,this._canvas&&(this._create(i),this._pendingConfig=null),this._worker.addEventListener("message",this._handleWorkerEvent.bind(this))}async _handleWorkerEvent(e){let t=e.data;if(!t.id&&("onLoad"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event),Tt&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&(Yt.observe(this._canvas,this),sn(this._canvas)||await this.freeze()),this._dotLottieInstanceState.renderConfig.autoResize&&Xt.observe(this._canvas,this))),"onComplete"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onDestroy"===t.method&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),"onUnfreeze"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(t.result.event)),"onFrame"===t.method&&t.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=t.result.event.currentFrame,this._eventManager.dispatch(t.result.event)),"onRender"===t.method&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),"onFreeze"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onPause"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onPlay"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStop"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onLoadError"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onRenderError"===t.method&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),"onReady"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onLoop"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineStart"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._setupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),"onStateMachineStop"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._cleanupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),"onStateMachineTransition"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineStateEntered"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineStateExit"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineCustomEvent"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineError"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineBooleanInputValueChange"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineNumericInputValueChange"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineStringInputValueChange"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineInputFired"===t.method&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),"onStateMachineInternalMessage"===t.method&&t.result.instanceId===this._id)){await this._updateDotLottieInstanceState();let e=t.result.event;e.message.startsWith("OpenUrl: ")&&rn(e.message)}}async _create(e){if(!this._canvas)return;let t;t=this._canvas instanceof HTMLCanvasElement?this._canvas.transferControlToOffscreen():this._canvas;let{instanceId:n}=await this._sendMessage("create",{instanceId:this._id,config:{...e,canvas:t},...hn(this._canvas,e.renderConfig?.devicePixelRatio||nn())},[t]);if(n!==this._id)throw Error("Instance ID mismatch");this._created=!0,await this._updateDotLottieInstanceState()}get loopCount(){return this._dotLottieInstanceState.loopCount}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get segmentDuration(){return this._dotLottieInstanceState.segmentDuration}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}async setCanvas(e){let t=typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas;if(!t&&!n)throw Error("Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas");if(this._canvas!==e){if(this._created&&null!==this._canvas)throw Error("Cannot change canvas after worker instance is already created with a different canvas.");this._canvas=e,!this._created&&this._pendingConfig&&(await this._create(this._pendingConfig),this._pendingConfig=null)}}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage("play",{instanceId:this._id}),await this._updateDotLottieInstanceState(),Tt&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&!sn(this._canvas)&&await this.freeze())}async pause(){this._created&&(await this._sendMessage("pause",{instanceId:this._id}),await this._updateDotLottieInstanceState())}async stop(){this._created&&(await this._sendMessage("stop",{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSpeed(e){this._created&&(await this._sendMessage("setSpeed",{instanceId:this._id,speed:e}),await this._updateDotLottieInstanceState())}async setMode(e){this._created&&(await this._sendMessage("setMode",{instanceId:this._id,mode:e}),await this._updateDotLottieInstanceState())}async setFrame(e){this._created&&(await this._sendMessage("setFrame",{frame:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSegment(e,t){this._created&&(await this._sendMessage("setSegment",{instanceId:this._id,segment:[e,t]}),await this._updateDotLottieInstanceState())}async setRenderConfig(e){if(!this._created)return;let{devicePixelRatio:t,freezeOnOffscreen:n,quality:i,...s}=e;await this._sendMessage("setRenderConfig",{instanceId:this._id,renderConfig:{...this._dotLottieInstanceState.renderConfig,...s,devicePixelRatio:t||nn(),freezeOnOffscreen:n??!0,...void 0!==i&&{quality:i}}}),await this._updateDotLottieInstanceState(),Tt&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.autoResize?Xt.observe(this._canvas,this):Xt.unobserve(this._canvas),this._dotLottieInstanceState.renderConfig.freezeOnOffscreen?(Yt.observe(this._canvas,this),sn(this._canvas)||await this.freeze()):(Yt.unobserve(this._canvas),this._dotLottieInstanceState.isFrozen&&await this.unfreeze()))}async setUseFrameInterpolation(e){this._created&&(await this._sendMessage("setUseFrameInterpolation",{instanceId:this._id,useFrameInterpolation:e}),await this._updateDotLottieInstanceState())}async setTheme(e){if(!this._created)return!1;let t=this._sendMessage("setTheme",{instanceId:this._id,themeId:e});return await this._updateDotLottieInstanceState(),t}async load(e){this._created?(await this._sendMessage("load",{config:e,instanceId:this._id}),await this._updateDotLottieInstanceState()):this._pendingConfig&&(this._pendingConfig={...this._pendingConfig,...e})}async setLoop(e){this._created&&(await this._sendMessage("setLoop",{instanceId:this._id,loop:e}),await this._updateDotLottieInstanceState())}async setLoopCount(e){this._created&&(await this._sendMessage("setLoopCount",{instanceId:this._id,loopCount:e}),await this._updateDotLottieInstanceState())}async resize(){if(!this._created||!this._canvas)return;let{height:e,width:t}=hn(this._canvas,this._dotLottieInstanceState.renderConfig.devicePixelRatio||nn());await this._sendMessage("resize",{height:e,instanceId:this._id,width:t}),await this._updateDotLottieInstanceState()}async destroy(){this._created&&(this._created=!1,await this._sendMessage("destroy",{instanceId:this._id}),this._cleanupStateMachineListeners(),e._workerManager.unassignAnimationFromWorker(this._id),this._eventManager.removeAllEventListeners(),Tt&&this._canvas instanceof HTMLCanvasElement&&(Yt.unobserve(this._canvas),Xt.unobserve(this._canvas)))}async freeze(){this._created&&(await this._sendMessage("freeze",{instanceId:this._id}),await this._updateDotLottieInstanceState())}async unfreeze(){this._created&&(await this._sendMessage("unfreeze",{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setBackgroundColor(e){this._created&&(await this._sendMessage("setBackgroundColor",{instanceId:this._id,backgroundColor:e}),await this._updateDotLottieInstanceState())}async loadAnimation(e){this._created&&(await this._sendMessage("loadAnimation",{animationId:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setLayout(e){this._created&&(await this._sendMessage("setLayout",{instanceId:this._id,layout:e}),await this._updateDotLottieInstanceState())}async setSlots(e){this._created&&await this._sendMessage("setSlots",{instanceId:this._id,slots:e})}async getSlotIds(){return this._created?this._sendMessage("getSlotIds",{instanceId:this._id}):[]}async getSlotType(e){if(this._created)return this._sendMessage("getSlotType",{instanceId:this._id,slotId:e})}async getSlot(e){if(this._created)return this._sendMessage("getSlot",{instanceId:this._id,slotId:e})}async getSlots(){return this._created?this._sendMessage("getSlots",{instanceId:this._id}):{}}async setColorSlot(e,t){return!!this._created&&this._sendMessage("setColorSlot",{instanceId:this._id,slotId:e,value:t})}async setScalarSlot(e,t){return!!this._created&&this._sendMessage("setScalarSlot",{instanceId:this._id,slotId:e,value:t})}async setVectorSlot(e,t){return!!this._created&&this._sendMessage("setVectorSlot",{instanceId:this._id,slotId:e,value:t})}async setGradientSlot(e,t,n){return!!this._created&&this._sendMessage("setGradientSlot",{instanceId:this._id,slotId:e,value:t,colorStopCount:n})}async setTextSlot(e,t){return!!this._created&&this._sendMessage("setTextSlot",{instanceId:this._id,slotId:e,value:t})}async resetSlot(e){return!!this._created&&this._sendMessage("resetSlot",{instanceId:this._id,slotId:e})}async clearSlot(e){return!!this._created&&this._sendMessage("clearSlot",{instanceId:this._id,slotId:e})}async resetSlots(){return!!this._created&&this._sendMessage("resetSlots",{instanceId:this._id})}async clearSlots(){return!!this._created&&this._sendMessage("clearSlots",{instanceId:this._id})}async _updateDotLottieInstanceState(){this._created&&(this._dotLottieInstanceState=(await this._sendMessage("getDotLottieInstanceState",{instanceId:this._id})).state)}markers(){return this._dotLottieInstanceState.markers}async setMarker(e){this._created&&(await this._sendMessage("setMarker",{instanceId:this._id,marker:e}),await this._updateDotLottieInstanceState())}async setThemeData(e){if(!this._created)return!1;let t=await this._sendMessage("setThemeData",{instanceId:this._id,themeData:e});return await this._updateDotLottieInstanceState(),t}async setViewport(e,t,n,i){return!!this._created&&this._sendMessage("setViewport",{x:e,y:t,width:n,height:i,instanceId:this._id})}async animationSize(){return this._created?this._sendMessage("animationSize",{instanceId:this._id}):{height:0,width:0}}async tween(e,t){return!!this._created&&this._sendMessage("tween",{instanceId:this._id,frame:e,duration:t})}async tweenToMarker(e,t){return!!this._created&&this._sendMessage("tweenToMarker",{instanceId:this._id,marker:e,duration:t})}async setTransform(e){return!!this._created&&this._sendMessage("setTransform",{instanceId:this._id,transform:e})}async getTransform(){if(this._created)return this._sendMessage("getTransform",{instanceId:this._id})}async _sendMessage(e,t,n){let i={id:`dotlottie-request-${pn()}`,method:e,params:t};return this._worker.postMessage(i,n||[]),new Promise((t,n)=>{let s=o=>{let r=o.data;r.id===i.id&&(this._worker.removeEventListener("message",s),r.error?n(Error(`Failed to execute method ${e}: ${r.error}`)):t(r.result))};this._worker.addEventListener("message",s)})}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}static setWasmUrl(t){e._wasmUrl=t}static async registerFont(t,n){try{let i=pn();return e._workerManager.broadcastMessage({id:i,method:"registerFont",params:{fontName:t,fontSource:n}}),!0}catch(ep){return console.error(`Error broadcasting registerFont for "${t}":`,ep),!1}}async stateMachineLoad(e){if(!this._created)return!1;let t=await this._sendMessage("stateMachineLoad",{instanceId:this._id,stateMachineId:e});return await this._updateDotLottieInstanceState(),t}async stateMachineLoadData(e){if(!this._created)return!1;let t=await this._sendMessage("stateMachineLoadData",{instanceId:this._id,stateMachineData:e});return await this._updateDotLottieInstanceState(),t}async stateMachineStart(){if(!this._created)return!1;let e=await this._sendMessage("stateMachineStart",{instanceId:this._id});return e&&(this._setupStateMachineListeners(),await this._updateDotLottieInstanceState()),e}async stateMachineStop(){return!!this._created&&(this._cleanupStateMachineListeners(),this._sendMessage("stateMachineStop",{instanceId:this._id}))}async stateMachineSetNumericInput(e,t){return!!this._created&&this._sendMessage("stateMachineSetNumericInput",{instanceId:this._id,name:e,value:t})}async stateMachineSetBooleanInput(e,t){return!!this._created&&this._sendMessage("stateMachineSetBooleanInput",{instanceId:this._id,name:e,value:t})}async stateMachineSetConfig(e){this._created&&this._sendMessage("stateMachineSetConfig",{instanceId:this._id,config:e})}async stateMachineSetStringInput(e,t){return!!this._created&&this._sendMessage("stateMachineSetStringInput",{instanceId:this._id,name:e,value:t})}async stateMachineGetNumericInput(e){if(this._created)return this._sendMessage("stateMachineGetNumericInput",{instanceId:this._id,name:e})}async stateMachineGetBooleanInput(e){if(this._created)return this._sendMessage("stateMachineGetBooleanInput",{instanceId:this._id,name:e})}async stateMachineGetStringInput(e){if(this._created)return this._sendMessage("stateMachineGetStringInput",{instanceId:this._id,name:e})}async stateMachineGetInputs(){if(this._created)return this._sendMessage("stateMachineGetInputs",{instanceId:this._id})}async stateMachineFireEvent(e){this._created&&this._sendMessage("stateMachineFireEvent",{instanceId:this._id,name:e})}async stateMachineGetStatus(){return this._created?this._sendMessage("stateMachineGetStatus",{instanceId:this._id}):""}async stateMachineGetCurrentState(){return this._created?this._sendMessage("stateMachineGetCurrentState",{instanceId:this._id}):""}async stateMachineGetActiveId(){return this._created?this._sendMessage("stateMachineGetActiveId",{instanceId:this._id}):""}async stateMachineOverrideState(e,t=!1){return!!this._created&&this._sendMessage("stateMachineOverrideState",{instanceId:this._id,state:e,immediate:t})}async stateMachineGet(e){return this._created?this._sendMessage("stateMachineGet",{instanceId:this._id,stateMachineId:e}):""}async stateMachineGetListeners(){return this._created?this._sendMessage("stateMachineGetListeners",{instanceId:this._id}):[]}async stateMachinePostClickEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostClickEvent",{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerUpEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostPointerUpEvent",{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerDownEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostPointerDownEvent",{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerMoveEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostPointerMoveEvent",{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerEnterEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostPointerEnterEvent",{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerExitEvent(e,t){if(this._created)return this._sendMessage("stateMachinePostPointerExitEvent",{instanceId:this._id,x:e,y:t})}_onClick(e){let t=on(e);t&&this._sendMessage("stateMachinePostClickEvent",{instanceId:this._id,x:t.x,y:t.y})}_onPointerUp(e){let t=on(e);t&&this._sendMessage("stateMachinePostPointerUpEvent",{instanceId:this._id,x:t.x,y:t.y})}_onPointerDown(e){let t=on(e);t&&this._sendMessage("stateMachinePostPointerDownEvent",{instanceId:this._id,x:t.x,y:t.y})}_onPointerMove(e){let t=on(e);t&&this._sendMessage("stateMachinePostPointerMoveEvent",{instanceId:this._id,x:t.x,y:t.y})}_onPointerEnter(e){let t=on(e);t&&this._sendMessage("stateMachinePostPointerEnterEvent",{instanceId:this._id,x:t.x,y:t.y})}_onPointerLeave(e){let t=on(e);t&&this._sendMessage("stateMachinePostPointerExitEvent",{instanceId:this._id,x:t.x,y:t.y})}async _setupStateMachineListeners(){if(Tt&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let e=await this._sendMessage("stateMachineGetListeners",{instanceId:this._id});if(0===e.length)return;this._cleanupStateMachineListeners(),e.includes("Click")&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener("click",this._boundOnClick)),e.includes("PointerUp")&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener("pointerup",this._boundOnPointerUp)),e.includes("PointerDown")&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener("pointerdown",this._boundOnPointerDown)),e.includes("PointerMove")&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener("pointermove",this._boundOnPointerMove)),e.includes("PointerEnter")&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener("pointerenter",this._boundOnPointerEnter)),e.includes("PointerExit")&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener("pointerleave",this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){Tt&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener("click",this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener("pointerup",this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener("pointerdown",this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener("pointermove",this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener("pointerenter",this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener("pointerleave",this._boundOnPointerLeave),this._boundOnPointerLeave=null))}};yt(mn,"_workerManager",new class{constructor(){yt(this,"_workers",/* @__PURE__ */new Map),yt(this,"_animationWorkerMap",/* @__PURE__ */new Map)}getWorker(e){return this._workers.has(e)||this._workers.set(e,new un),this._workers.get(e)}assignAnimationToWorker(e,t){this._animationWorkerMap.set(e,t)}unassignAnimationFromWorker(e){this._animationWorkerMap.delete(e)}sendMessage(e,t,n){this.getWorker(e).postMessage(t,n||[])}broadcastMessage(e,t){this._workers.forEach(n=>{n.postMessage(e,t||[])})}terminateWorker(e){let t=this._workers.get(e);t&&(t.terminate(),this._workers.delete(e))}}),yt(mn,"_wasmUrl","");const gn=({animationId:e,autoplay:t,backgroundColor:n,className:i,createDotLottie:s,data:o,dotLottieRefCallback:r,layout:a,loop:c,mode:d,playOnHover:l,renderConfig:u,segment:h,speed:p,src:m,stateMachineConfig:g,stateMachineId:v,style:f,themeData:_,themeId:b,useFrameInterpolation:y,workerId:k,...C})=>{let w=be(null),T=be(null),S=be(r),E={speed:p,mode:d,loop:c,useFrameInterpolation:y,segment:h,backgroundColor:n,autoplay:t,themeId:b,workerId:k,src:m,data:o,layout:a,renderConfig:u,animationId:e,stateMachineConfig:g,stateMachineId:v},P=be(E);S.current=r,P.current=E;let I=Ce(e=>{T.current=e,e?w.current=s({...P.current,canvas:e}):(w.current?.destroy(),w.current=null),S.current?.(w.current)},[]);return _e(()=>{let e=e=>{l&&("mouseenter"===e.type&&w.current?.play(),"mouseleave"===e.type&&w.current?.pause())};return T.current?.addEventListener("mouseenter",e),T.current?.addEventListener("mouseleave",e),()=>{T.current?.removeEventListener("mouseenter",e),T.current?.removeEventListener("mouseleave",e)}},[l]),_e(()=>{w.current?.setSpeed(p??1)},[p]),_e(()=>{w.current?.setMode(d??"forward")},[d]),_e(()=>{w.current?.setLoop(c??!1)},[c]),_e(()=>{w.current?.setUseFrameInterpolation(y??!0)},[y]),_e(()=>{"number"==typeof h?.[0]&&"number"==typeof h[1]&&w.current?.setSegment(h[0],h[1])},[h]),_e(()=>{w.current?.setBackgroundColor(n??"")},[n]),_e(()=>{w.current?.setRenderConfig(u??{})},[JSON.stringify(u)]),_e(()=>{"string"!=typeof o&&"object"!=typeof o||w.current?.load({data:o,...P.current})},[o]),_e(()=>{"string"==typeof m&&w.current?.load({src:m,...P.current})},[m]),_e(()=>{w.current?.setMarker(C.marker??"")},[C.marker]),_e(()=>{w.current?.loadAnimation(e??"")},[e]),_e(()=>{"string"==typeof b&&w.current?.setTheme(b)},[b]),_e(()=>{w.current?.setThemeData(_??"")},[_]),_e(()=>{w.current?.setLayout(a??{})},[a?.fit,a?.align?.[0],a?.align?.[1]]),_e(()=>{w.current?.isLoaded&&("string"==typeof v&&v?w.current.stateMachineLoad(v)&&w.current.stateMachineStart():w.current.stateMachineStop())},[v]),_e(()=>{w.current?.stateMachineSetConfig(g??null)},[g]),ne("div",{className:i,...!i&&{style:{width:"100%",height:"100%",lineHeight:0,...f}},children:ne("canvas",{ref:I,style:{width:"100%",height:"100%"},...C})})},vn=e=>new ln(e),fn=e=>ne(gn,{...e,createDotLottie:vn}),_n=function(e){function t(t){var n=Ge({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Qe,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}(({lottieSrc:e,stateMachineId:t="StateMachine1",className:n},i)=>{const s=be(null);return ye(i,()=>({startTalking(){s.current?.stateMachineSetBooleanInput?.("talking",!0)},stopTalking(){s.current?.stateMachineSetBooleanInput?.("talking",!1)},triggerHover(){s.current&&(s.current.stateMachineSetBooleanInput("talking",!1),s.current.stateMachineSetBooleanInput("hover",!0))},stopHover(){s.current&&s.current.stateMachineSetBooleanInput("hover",!1)}})),/* @__PURE__ */ne("div",{className:n||"vd-lottie-container",children:/* @__PURE__ */ne(fn,{src:e,autoplay:!0,loop:!0,stateMachineId:t,dotLottieRefCallback:e=>{s.current=e}})})});function bn(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}var yn=Object.defineProperty,kn=(e,t,n)=>((e,t,n)=>t in e?yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let Cn=class{constructor(){kn(this,"_locking"),kn(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){let e;this._locks+=1;const t=new Promise(t=>e=()=>{this._locks-=1,t()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),n}};function wn(e,t){if(!e)throw new Error(t)}function Tn(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int 32: "+e)}function Sn(e){if("number"!=typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint 32: "+e)}function En(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float 32: "+e)}const Pn=/* @__PURE__ */Symbol("@bufbuild/protobuf/enum-type");function In(e){const t=e[Pn];return wn(t,"missing enum type on enum object"),t}function Rn(e,t,n,i){e[Pn]=Mn(t,n.map(t=>({no:t.no,name:t.name,localName:e[t.no]})))}function Mn(e,t,n){const i=/* @__PURE__ */Object.create(null),s=/* @__PURE__ */Object.create(null),o=[];for(const r of t){const e=On(r);o.push(e),i[r.name]=e,s[r.no]=e}return{typeName:e,values:o,findName:e=>i[e],findNumber:e=>s[e]}}function Ln(e,t,n){const i={};for(const s of t){const e=On(s);i[e.localName]=e.no,i[e.no]=e.localName}return Rn(i,e,t),i}function On(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}class Dn{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const n=this.getType().runtime.bin,i=n.makeReadOptions(t);return n.readMessage(this,i.readerFactory(e),e.byteLength,i),this}fromJson(e,t){const n=this.getType(),i=n.runtime.json,s=i.makeReadOptions(t);return i.readMessage(n,e,s,this),this}fromJsonString(e,t){let n;try{n=JSON.parse(e)}catch(ep){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(ep instanceof Error?ep.message:String(ep)))}return this.fromJson(n,t)}toBinary(e){const t=this.getType().runtime.bin,n=t.makeWriteOptions(e),i=n.writerFactory();return t.writeMessage(this,i,n),i.finish()}toJson(e){const t=this.getType().runtime.json,n=t.makeWriteOptions(e);return t.writeMessage(this,n)}toJsonString(e){var t;const n=this.toJson(e);return JSON.stringify(n,null,null!==(t=null==e?void 0:e.prettySpaces)&&void 0!==t?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function xn(){let e=0,t=0;for(let i=0;i<28;i+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<i,!(128&n))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<i,!(128&n))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function An(e,t,n){for(let o=0;o<28;o+=7){const i=e>>>o,s=!(i>>>7==0&&0==t),r=255&(s?128|i:i);if(n.push(r),!s)return}const i=e>>>28&15|(7&t)<<4,s=!!(t>>3);if(n.push(255&(s?128|i:i)),s){for(let e=3;e<31;e+=7){const i=t>>>e,s=!(i>>>7==0),o=255&(s?128|i:i);if(n.push(o),!s)return}n.push(t>>>31&1)}}const Nn=4294967296;function Un(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let i=0,s=0;function o(t,o){const r=Number(e.slice(t,o));s*=n,i=i*n+r,i>=Nn&&(s+=i/Nn|0,i%=Nn)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?Bn(i,s):jn(i,s)}function Fn(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(Nn*t+e);const n=16777215&(e>>>24|t<<8),i=t>>16&65535;let s=(16777215&e)+6777216*n+6710656*i,o=n+8147497*i,r=2*i;const a=1e7;return s>=a&&(o+=Math.floor(s/a),s%=a),o>=a&&(r+=Math.floor(o/a),o%=a),r.toString()+qn(o)+qn(s)}function jn(e,t){return{lo:0|e,hi:0|t}}function Bn(e,t){return t=~t,e?e=1+~e:t+=1,jn(e,t)}const qn=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Vn(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function Wn(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let n=5;128&e&&n<10;n++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const Hn=function(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&("object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),i=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const i="bigint"==typeof e?e:BigInt(e);if(i>n||i<t)throw new Error("int64 invalid: ".concat(e));return i},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>s||t<i)throw new Error("uint64 invalid: ".concat(e));return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}const t=e=>wn(/^-?[0-9]+$/.test(e),"int64 invalid: ".concat(e)),n=e=>wn(/^[0-9]+$/.test(e),"uint64 invalid: ".concat(e));return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),t(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),n(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),t(e),Un(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),n(e),Un(e)),dec:(e,t)=>function(e,t){let n=jn(e,t);const i=2147483648&n.hi;i&&(n=Bn(n.lo,n.hi));const s=Fn(n.lo,n.hi);return i?"-"+s:s}(e,t),uDec:(e,t)=>Fn(e,t)}}();var zn,Gn,Jn,Kn,$n,Qn;function Yn(e,t,n){if(t===n)return!0;if(e==zn.BYTES){if(!(t instanceof Uint8Array&&n instanceof Uint8Array))return!1;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==n[e])return!1;return!0}switch(e){case zn.UINT64:case zn.FIXED64:case zn.INT64:case zn.SFIXED64:case zn.SINT64:return t==n}return!1}function Xn(e,t){switch(e){case zn.BOOL:return!1;case zn.UINT64:case zn.FIXED64:case zn.INT64:case zn.SFIXED64:case zn.SINT64:return 0==t?Hn.zero:"0";case zn.DOUBLE:case zn.FLOAT:return 0;case zn.BYTES:return new Uint8Array(0);case zn.STRING:return"";default:return 0}}function Zn(e,t){switch(e){case zn.BOOL:return!1===t;case zn.STRING:return""===t;case zn.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(Gn=zn||(zn={}))[Gn.DOUBLE=1]="DOUBLE",Gn[Gn.FLOAT=2]="FLOAT",Gn[Gn.INT64=3]="INT64",Gn[Gn.UINT64=4]="UINT64",Gn[Gn.INT32=5]="INT32",Gn[Gn.FIXED64=6]="FIXED64",Gn[Gn.FIXED32=7]="FIXED32",Gn[Gn.BOOL=8]="BOOL",Gn[Gn.STRING=9]="STRING",Gn[Gn.BYTES=12]="BYTES",Gn[Gn.UINT32=13]="UINT32",Gn[Gn.SFIXED32=15]="SFIXED32",Gn[Gn.SFIXED64=16]="SFIXED64",Gn[Gn.SINT32=17]="SINT32",Gn[Gn.SINT64=18]="SINT64",(Kn=Jn||(Jn={}))[Kn.BIGINT=0]="BIGINT",Kn[Kn.STRING=1]="STRING",(Qn=$n||($n={}))[Qn.Varint=0]="Varint",Qn[Qn.Bit64=1]="Bit64",Qn[Qn.LengthDelimited=2]="LengthDelimited",Qn[Qn.StartGroup=3]="StartGroup",Qn[Qn.EndGroup=4]="EndGroup",Qn[Qn.Bit32=5]="Bit32";class ei{constructor(e){this.stack=[],this.textEncoder=null!=e?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Sn(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return Tn(e),Vn(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){En(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Sn(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Tn(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Tn(e),Vn(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=Hn.enc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=Hn.uEnc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=Hn.enc(e);return An(t.lo,t.hi,this.buf),this}sint64(e){let t=Hn.enc(e),n=t.hi>>31;return An(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=Hn.uEnc(e);return An(t.lo,t.hi,this.buf),this}}class ti{constructor(e,t){this.varint64=xn,this.uint32=Wn,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=null!=t?t:new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case $n.Varint:for(;128&this.buf[this.pos++];);break;case $n.Bit64:this.pos+=4;case $n.Bit32:this.pos+=4;break;case $n.LengthDelimited:let n=this.uint32();this.pos+=n;break;case $n.StartGroup:for(;;){const[e,n]=this.tag();if(n===$n.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return Hn.dec(...this.varint64())}uint64(){return Hn.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,Hn.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Hn.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Hn.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function ni(e){const t=e.field.localName,n=/* @__PURE__ */Object.create(null);return n[t]=function(e){const t=e.field;if(t.repeated)return[];if(void 0!==t.default)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return Xn(t.T,t.L);case"message":const e=t.T,n=new e;return e.fieldWrapper?e.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}(e),[n,()=>n[t]]}let ii="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),si=[];for(let pp=0;pp<ii.length;pp++)si[ii[pp].charCodeAt(0)]=pp;si["-".charCodeAt(0)]=ii.indexOf("+"),si["_".charCodeAt(0)]=ii.indexOf("/");const oi={dec(e){let t=3*e.length/4;"="==e[e.length-2]?t-=2:"="==e[e.length-1]&&(t-=1);let n,i=new Uint8Array(t),s=0,o=0,r=0;for(let a=0;a<e.length;a++){if(n=si[e.charCodeAt(a)],void 0===n)switch(e[a]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:r=n,o=1;break;case 1:i[s++]=r<<2|(48&n)>>4,r=n,o=2;break;case 2:i[s++]=(15&r)<<4|(60&n)>>2,r=n,o=3;break;case 3:i[s++]=(3&r)<<6|n,o=0}}if(1==o)throw Error("invalid base64 string.");return i.subarray(0,s)},enc(e){let t,n="",i=0,s=0;for(let o=0;o<e.length;o++)switch(t=e[o],i){case 0:n+=ii[t>>2],s=(3&t)<<4,i=1;break;case 1:n+=ii[s|t>>4],s=(15&t)<<2,i=2;break;case 2:n+=ii[s|t>>6],n+=ii[63&t],i=0}return i&&(n+=ii[s],n+="=",1==i&&(n+="=")),n}};function ri(e,t,n){di(t,e);const i=t.runtime.bin.makeReadOptions(n),s=function(e,t){if(!t.repeated&&("enum"==t.kind||"scalar"==t.kind)){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(e=>e.no===t.no)}(e.getType().runtime.bin.listUnknownFields(e),t.field),[o,r]=ni(t);for(const a of s)t.runtime.bin.readField(o,i.readerFactory(a.data),t.field,a.wireType,i);return r()}function ai(e,t,n,i){di(t,e);const s=t.runtime.bin.makeReadOptions(i),o=t.runtime.bin.makeWriteOptions(i);if(ci(e,t)){const n=e.getType().runtime.bin.listUnknownFields(e).filter(e=>e.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(const t of n)e.getType().runtime.bin.onUnknownField(e,t.no,t.wireType,t.data)}const r=o.writerFactory();let a=t.field;a.opt||a.repeated||"enum"!=a.kind&&"scalar"!=a.kind||(a=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(a,n,r,o);const c=s.readerFactory(r.finish());for(;c.pos<c.len;){const[t,n]=c.tag(),i=c.skip(n,t);e.getType().runtime.bin.onUnknownField(e,t,n,i)}}function ci(e,t){const n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find(e=>e.no==t.field.no)}function di(e,t){wn(e.extendee.typeName==t.getType().typeName,"extension ".concat(e.typeName," can only be applied to message ").concat(e.extendee.typeName))}function li(e,t){const n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?void 0!==t[n]:"enum"==e.kind?t[n]!==e.T.values[0].no:!Zn(e.T,t[n]);case"message":return void 0!==t[n];case"map":return Object.keys(t[n]).length>0}}function ui(e,t){const n=e.localName,i=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=i?e.T.values[0].no:void 0;break;case"scalar":t[n]=i?Xn(e.T,e.L):void 0;break;case"message":t[n]=void 0}}function hi(e,t){if(null===e||"object"!=typeof e)return!1;if(!Object.getOwnPropertyNames(Dn.prototype).every(t=>t in e&&"function"==typeof e[t]))return!1;const n=e.getType();return null!==n&&"function"==typeof n&&"typeName"in n&&"string"==typeof n.typeName&&(void 0===t||n.typeName==t.typeName)}function pi(e,t){return hi(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}zn.DOUBLE,zn.FLOAT,zn.INT64,zn.UINT64,zn.INT32,zn.UINT32,zn.BOOL,zn.STRING,zn.BYTES;const mi={ignoreUnknownFields:!1},gi={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function vi(e){return e?Object.assign(Object.assign({},mi),e):mi}function fi(e){return e?Object.assign(Object.assign({},gi),e):gi}const _i=/* @__PURE__ */Symbol(),bi=/* @__PURE__ */Symbol();function yi(e){if(null===e)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":'"'.concat(e.split('"').join('\\"'),'"');default:return String(e)}}function ki(e,t,n,i,s){let o=n.localName;if(n.repeated){if(wn("map"!=n.kind),null===t)return;if(!Array.isArray(t))throw new Error("cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(t)));const r=e[o];for(const e of t){if(null===e)throw new Error("cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(e)));switch(n.kind){case"message":r.push(n.T.fromJson(e,i));break;case"enum":const t=Ti(n.T,e,i.ignoreUnknownFields,!0);t!==bi&&r.push(t);break;case"scalar":try{r.push(wi(n.T,e,n.L,!0))}catch(ep){let i="cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(e));throw ep instanceof Error&&ep.message.length>0&&(i+=": ".concat(ep.message)),new Error(i)}}}}else if("map"==n.kind){if(null===t)return;if("object"!=typeof t||Array.isArray(t))throw new Error("cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(t)));const r=e[o];for(const[e,o]of Object.entries(t)){if(null===o)throw new Error("cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: map value null"));let a;try{a=Ci(n.K,e)}catch(ep){let i="cannot decode map key for field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(t));throw ep instanceof Error&&ep.message.length>0&&(i+=": ".concat(ep.message)),new Error(i)}switch(n.V.kind){case"message":r[a]=n.V.T.fromJson(o,i);break;case"enum":const e=Ti(n.V.T,o,i.ignoreUnknownFields,!0);e!==bi&&(r[a]=e);break;case"scalar":try{r[a]=wi(n.V.T,o,Jn.BIGINT,!0)}catch(ep){let i="cannot decode map value for field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(t));throw ep instanceof Error&&ep.message.length>0&&(i+=": ".concat(ep.message)),new Error(i)}}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:o},o="value"),n.kind){case"message":const r=n.T;if(null===t&&"google.protobuf.Value"!=r.typeName)return;let a=e[o];hi(a)?a.fromJson(t,i):(e[o]=a=r.fromJson(t,i),r.fieldWrapper&&!n.oneof&&(e[o]=r.fieldWrapper.unwrapField(a)));break;case"enum":const c=Ti(n.T,t,i.ignoreUnknownFields,!1);switch(c){case _i:ui(n,e);break;case bi:break;default:e[o]=c}break;case"scalar":try{const i=wi(n.T,t,n.L,!1);if(i===_i)ui(n,e);else e[o]=i}catch(ep){let i="cannot decode field ".concat(s.typeName,".").concat(n.name," from JSON: ").concat(yi(t));throw ep instanceof Error&&ep.message.length>0&&(i+=": ".concat(ep.message)),new Error(i)}}}function Ci(e,t){if(e===zn.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1}return wi(e,t,Jn.BIGINT,!0).toString()}function wi(e,t,n,i){if(null===t)return i?Xn(e,n):_i;switch(e){case zn.DOUBLE:case zn.FLOAT:if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t)break;if("string"==typeof t&&t.trim().length!==t.length)break;if("string"!=typeof t&&"number"!=typeof t)break;const i=Number(t);if(Number.isNaN(i))break;if(!Number.isFinite(i))break;return e==zn.FLOAT&&En(i),i;case zn.INT32:case zn.FIXED32:case zn.SFIXED32:case zn.SINT32:case zn.UINT32:let s;if("number"==typeof t?s=t:"string"==typeof t&&t.length>0&&t.trim().length===t.length&&(s=Number(t)),void 0===s)break;return e==zn.UINT32||e==zn.FIXED32?Sn(s):Tn(s),s;case zn.INT64:case zn.SFIXED64:case zn.SINT64:if("number"!=typeof t&&"string"!=typeof t)break;const o=Hn.parse(t);return n?o.toString():o;case zn.FIXED64:case zn.UINT64:if("number"!=typeof t&&"string"!=typeof t)break;const r=Hn.uParse(t);return n?r.toString():r;case zn.BOOL:if("boolean"!=typeof t)break;return t;case zn.STRING:if("string"!=typeof t)break;try{encodeURIComponent(t)}catch(ep){throw new Error("invalid UTF8")}return t;case zn.BYTES:if(""===t)return new Uint8Array(0);if("string"!=typeof t)break;return oi.dec(t)}throw new Error}function Ti(e,t,n,i){if(null===t)return"google.protobuf.NullValue"==e.typeName?0:i?e.values[0].no:_i;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=e.findName(t);if(void 0!==i)return i.no;if(n)return bi}throw new Error("cannot decode enum ".concat(e.typeName," from JSON: ").concat(yi(t)))}function Si(e){return!(!e.repeated&&"map"!=e.kind)||!e.oneof&&("message"!=e.kind&&(!e.opt&&!e.req))}function Ei(e,t,n){if("map"==e.kind){wn("object"==typeof t&&null!=t);const i={},s=Object.entries(t);switch(e.V.kind){case"scalar":for(const[n,o]of s)i[n.toString()]=Ii(e.V.T,o);break;case"message":for(const[e,o]of s)i[e.toString()]=o.toJson(n);break;case"enum":const t=e.V.T;for(const[e,o]of s)i[e.toString()]=Pi(t,o,n.enumAsInteger)}return n.emitDefaultValues||s.length>0?i:void 0}if(e.repeated){wn(Array.isArray(t));const i=[];switch(e.kind){case"scalar":for(let n=0;n<t.length;n++)i.push(Ii(e.T,t[n]));break;case"enum":for(let s=0;s<t.length;s++)i.push(Pi(e.T,t[s],n.enumAsInteger));break;case"message":for(let e=0;e<t.length;e++)i.push(t[e].toJson(n))}return n.emitDefaultValues||i.length>0?i:void 0}switch(e.kind){case"scalar":return Ii(e.T,t);case"enum":return Pi(e.T,t,n.enumAsInteger);case"message":return pi(e.T,t).toJson(n)}}function Pi(e,t,n){var i;if(wn("number"==typeof t),"google.protobuf.NullValue"==e.typeName)return null;if(n)return t;const s=e.findNumber(t);return null!==(i=null==s?void 0:s.name)&&void 0!==i?i:t}function Ii(e,t){switch(e){case zn.INT32:case zn.SFIXED32:case zn.SINT32:case zn.FIXED32:case zn.UINT32:return wn("number"==typeof t),t;case zn.FLOAT:case zn.DOUBLE:return wn("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case zn.STRING:return wn("string"==typeof t),t;case zn.BOOL:return wn("boolean"==typeof t),t;case zn.UINT64:case zn.FIXED64:case zn.INT64:case zn.SFIXED64:case zn.SINT64:return wn("bigint"==typeof t||"string"==typeof t||"number"==typeof t),t.toString();case zn.BYTES:return wn(t instanceof Uint8Array),oi.enc(t)}}const Ri=/* @__PURE__ */Symbol("@bufbuild/protobuf/unknown-fields"),Mi={readUnknownFields:!0,readerFactory:e=>new ti(e)},Li={writeUnknownFields:!0,writerFactory:()=>new ei};function Oi(e){return e?Object.assign(Object.assign({},Mi),e):Mi}function Di(e){return e?Object.assign(Object.assign({},Li),e):Li}function xi(e,t,n,i,s){let{repeated:o,localName:r}=n;switch(n.oneof&&((e=e[n.oneof.localName]).case!=r&&delete e.value,e.case=r,r="value"),n.kind){case"scalar":case"enum":const a="enum"==n.kind?zn.INT32:n.T;let c=Ui;if("scalar"==n.kind&&n.L>0&&(c=Ni),o){let n=e[r];if(i==$n.LengthDelimited&&a!=zn.STRING&&a!=zn.BYTES){let e=t.uint32()+t.pos;for(;t.pos<e;)n.push(c(t,a))}else n.push(c(t,a))}else e[r]=c(t,a);break;case"message":const d=n.T;o?e[r].push(Ai(t,new d,s,n)):hi(e[r])?Ai(t,e[r],s,n):(e[r]=Ai(t,new d,s,n),!d.fieldWrapper||n.oneof||n.repeated||(e[r]=d.fieldWrapper.unwrapField(e[r])));break;case"map":let[l,u]=function(e,t,n){const i=t.uint32(),s=t.pos+i;let o,r;for(;t.pos<s;){const[i]=t.tag();switch(i){case 1:o=Ui(t,e.K);break;case 2:switch(e.V.kind){case"scalar":r=Ui(t,e.V.T);break;case"enum":r=t.int32();break;case"message":r=Ai(t,new e.V.T,n,void 0)}}}void 0===o&&(o=Xn(e.K,Jn.BIGINT));"string"!=typeof o&&"number"!=typeof o&&(o=o.toString());if(void 0===r)switch(e.V.kind){case"scalar":r=Xn(e.V.T,Jn.BIGINT);break;case"enum":r=e.V.T.values[0].no;break;case"message":r=new e.V.T}return[o,r]}(n,t,s);e[r][l]=u}}function Ai(e,t,n,i){const s=t.getType().runtime.bin,o=null==i?void 0:i.delimited;return s.readMessage(t,e,o?i.no:e.uint32(),n,o),t}function Ni(e,t){const n=Ui(e,t);return"bigint"==typeof n?n.toString():n}function Ui(e,t){switch(t){case zn.STRING:return e.string();case zn.BOOL:return e.bool();case zn.DOUBLE:return e.double();case zn.FLOAT:return e.float();case zn.INT32:return e.int32();case zn.INT64:return e.int64();case zn.UINT64:return e.uint64();case zn.FIXED64:return e.fixed64();case zn.BYTES:return e.bytes();case zn.FIXED32:return e.fixed32();case zn.SFIXED32:return e.sfixed32();case zn.SFIXED64:return e.sfixed64();case zn.SINT64:return e.sint64();case zn.UINT32:return e.uint32();case zn.SINT32:return e.sint32()}}function Fi(e,t,n,i){wn(void 0!==t);const s=e.repeated;switch(e.kind){case"scalar":case"enum":let o="enum"==e.kind?zn.INT32:e.T;if(s)if(wn(Array.isArray(t)),e.packed)!function(e,t,n,i){if(!i.length)return;e.tag(n,$n.LengthDelimited).fork();let[,s]=Vi(t);for(let o=0;o<i.length;o++)e[s](i[o]);e.join()}(n,o,e.no,t);else for(const i of t)qi(n,o,e.no,i);else qi(n,o,e.no,t);break;case"message":if(s){wn(Array.isArray(t));for(const s of t)Bi(n,i,e,s)}else Bi(n,i,e,t);break;case"map":wn("object"==typeof t&&null!=t);for(const[s,r]of Object.entries(t))ji(n,i,e,s,r)}}function ji(e,t,n,i,s){e.tag(n.no,$n.LengthDelimited),e.fork();let o=i;switch(n.K){case zn.INT32:case zn.FIXED32:case zn.UINT32:case zn.SFIXED32:case zn.SINT32:o=Number.parseInt(i);break;case zn.BOOL:wn("true"==i||"false"==i),o="true"==i}switch(qi(e,n.K,1,o),n.V.kind){case"scalar":qi(e,n.V.T,2,s);break;case"enum":qi(e,zn.INT32,2,s);break;case"message":wn(void 0!==s),e.tag(2,$n.LengthDelimited).bytes(s.toBinary(t))}e.join()}function Bi(e,t,n,i){const s=pi(n.T,i);n.delimited?e.tag(n.no,$n.StartGroup).raw(s.toBinary(t)).tag(n.no,$n.EndGroup):e.tag(n.no,$n.LengthDelimited).bytes(s.toBinary(t))}function qi(e,t,n,i){wn(void 0!==i);let[s,o]=Vi(t);e.tag(n,s)[o](i)}function Vi(e){let t=$n.Varint;switch(e){case zn.BYTES:case zn.STRING:t=$n.LengthDelimited;break;case zn.DOUBLE:case zn.FIXED64:case zn.SFIXED64:t=$n.Bit64;break;case zn.FIXED32:case zn.SFIXED32:case zn.FLOAT:t=$n.Bit32}return[t,zn[e].toLowerCase()]}function Wi(e){if(void 0===e)return e;if(hi(e))return e.clone();if(e instanceof Uint8Array){const t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function Hi(e){return e instanceof Uint8Array?e:new Uint8Array(e)}class zi{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const e={};for(const t of this.list())e[t.jsonName]=e[t.name]=t;this.jsonNames=e}return this.jsonNames[e]}find(e){if(!this.numbers){const e={};for(const t of this.list())e[t.no]=t;this.numbers=e}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const n of this.list())n.oneof?n.oneof!==t&&(t=n.oneof,e.push(t)):e.push(n)}return this.members}}function Gi(e,t){const n=Ki(e);return t?n:Zi(Xi(n))}const Ji=Ki;function Ki(e){let t=!1;const n=[];for(let i=0;i<e.length;i++){let s=e.charAt(i);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),n.push(s)}}return n.join("")}const $i=/* @__PURE__ */new Set(["constructor","toString","toJSON","valueOf"]),Qi=/* @__PURE__ */new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Yi=e=>"".concat(e,"$"),Xi=e=>Qi.has(e)?Yi(e):e,Zi=e=>$i.has(e)?Yi(e):e;class es{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=Gi(e,!1)}addField(e){wn(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=/* @__PURE__ */Object.create(null);for(let e=0;e<this.fields.length;e++)this._lookup[this.fields[e].localName]=this.fields[e]}return this._lookup[e]}}const ts=(ns=e=>new zi(e,e=>function(e){var t,n,i,s,o,r;const a=[];let c;for(const d of"function"==typeof e?e():e){const e=d;if(e.localName=Gi(d.name,void 0!==d.oneof),e.jsonName=null!==(t=d.jsonName)&&void 0!==t?t:Ji(d.name),e.repeated=null!==(n=d.repeated)&&void 0!==n&&n,"scalar"==d.kind&&(e.L=null!==(i=d.L)&&void 0!==i?i:Jn.BIGINT),e.delimited=null!==(s=d.delimited)&&void 0!==s&&s,e.req=null!==(o=d.req)&&void 0!==o&&o,e.opt=null!==(r=d.opt)&&void 0!==r&&r,void 0===d.packed&&(e.packed="enum"==d.kind||"scalar"==d.kind&&d.T!=zn.BYTES&&d.T!=zn.STRING),void 0!==d.oneof){const t="string"==typeof d.oneof?d.oneof:d.oneof.name;c&&c.name==t||(c=new es(t)),e.oneof=c,c.addField(e)}a.push(e)}return a}(e)),is=e=>{for(const t of e.getType().fields.byMember()){if(t.opt)continue;const n=t.localName,i=e;if(t.repeated)i[n]=[];else switch(t.kind){case"oneof":i[n]={case:void 0};break;case"enum":i[n]=0;break;case"map":i[n]={};break;case"scalar":i[n]=Xn(t.T,t.L)}}},{syntax:"proto3",json:{makeReadOptions:vi,makeWriteOptions:fi,readMessage(e,t,n,i){if(null==t||Array.isArray(t)||"object"!=typeof t)throw new Error("cannot decode message ".concat(e.typeName," from JSON: ").concat(yi(t)));i=null!=i?i:new e;const s=/* @__PURE__ */new Map,o=n.typeRegistry;for(const[r,a]of Object.entries(t)){const t=e.fields.findJsonName(r);if(t){if(t.oneof){if(null===a&&"scalar"==t.kind)continue;const n=s.get(t.oneof);if(void 0!==n)throw new Error("cannot decode message ".concat(e.typeName,' from JSON: multiple keys for oneof "').concat(t.oneof.name,'" present: "').concat(n,'", "').concat(r,'"'));s.set(t.oneof,r)}ki(i,a,t,n,e)}else{let t=!1;if((null==o?void 0:o.findExtension)&&r.startsWith("[")&&r.endsWith("]")){const s=o.findExtension(r.substring(1,r.length-1));if(s&&s.extendee.typeName==e.typeName){t=!0;const[e,o]=ni(s);ki(e,a,s.field,n,s),ai(i,s,o(),n)}}if(!t&&!n.ignoreUnknownFields)throw new Error("cannot decode message ".concat(e.typeName,' from JSON: key "').concat(r,'" is unknown'))}}return i},writeMessage(e,t){const n=e.getType(),i={};let s;try{for(s of n.fields.byNumber()){if(!li(s,e)){if(s.req)throw"required field not set";if(!t.emitDefaultValues)continue;if(!Si(s))continue}const n=Ei(s,s.oneof?e[s.oneof.localName].value:e[s.localName],t);void 0!==n&&(i[t.useProtoFieldName?s.name:s.jsonName]=n)}const o=t.typeRegistry;if(null==o?void 0:o.findExtensionFor)for(const s of n.runtime.bin.listUnknownFields(e)){const r=o.findExtensionFor(n.typeName,s.no);if(r&&ci(e,r)){const n=ri(e,r,t),s=Ei(r.field,n,t);void 0!==s&&(i[r.field.jsonName]=s)}}}catch(ep){const t=s?"cannot encode field ".concat(n.typeName,".").concat(s.name," to JSON"):"cannot encode message ".concat(n.typeName," to JSON"),i=ep instanceof Error?ep.message:String(ep);throw new Error(t+(i.length>0?": ".concat(i):""))}return i},readScalar:(e,t,n)=>wi(e,t,null!=n?n:Jn.BIGINT,!0),writeScalar(e,t,n){if(void 0!==t)return n||Zn(e,t)?Ii(e,t):void 0},debug:yi},bin:{makeReadOptions:Oi,makeWriteOptions:Di,listUnknownFields(e){var t;return null!==(t=e[Ri])&&void 0!==t?t:[]},discardUnknownFields(e){delete e[Ri]},writeUnknownFields(e,t){const n=e[Ri];if(n)for(const i of n)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,i){const s=e;Array.isArray(s[Ri])||(s[Ri]=[]),s[Ri].push({no:t,wireType:n,data:i})},readMessage(e,t,n,i,s){const o=e.getType(),r=s?t.len:t.pos+n;let a,c;for(;t.pos<r&&([a,c]=t.tag(),!0!==s||c!=$n.EndGroup);){const n=o.fields.find(a);if(!n){const n=t.skip(c,a);i.readUnknownFields&&this.onUnknownField(e,a,c,n);continue}xi(e,t,n,c,i)}if(s&&(c!=$n.EndGroup||a!==n))throw new Error("invalid end group tag")},readField:xi,writeMessage(e,t,n){const i=e.getType();for(const s of i.fields.byNumber())if(li(s,e))Fi(s,s.oneof?e[s.oneof.localName].value:e[s.localName],t,n);else if(s.req)throw new Error("cannot encode field ".concat(i.typeName,".").concat(s.name," to binary: required field not set"));return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,i){void 0!==t&&Fi(e,t,n,i)}},util:Object.assign(Object.assign({},{setEnumType:Rn,initPartial(e,t){if(void 0===e)return;const n=t.getType();for(const i of n.fields.byMember()){const n=i.localName,s=t,o=e;if(null!=o[n])switch(i.kind){case"oneof":const e=o[n].case;if(void 0===e)continue;const t=i.findField(e);let r=o[n].value;t&&"message"==t.kind&&!hi(r,t.T)?r=new t.T(r):t&&"scalar"===t.kind&&t.T===zn.BYTES&&(r=Hi(r)),s[n]={case:e,value:r};break;case"scalar":case"enum":let a=o[n];i.T===zn.BYTES&&(a=i.repeated?a.map(Hi):Hi(a)),s[n]=a;break;case"map":switch(i.V.kind){case"scalar":case"enum":if(i.V.T===zn.BYTES)for(const[t,i]of Object.entries(o[n]))s[n][t]=Hi(i);else Object.assign(s[n],o[n]);break;case"message":const e=i.V.T;for(const t of Object.keys(o[n])){let i=o[n][t];e.fieldWrapper||(i=new e(i)),s[n][t]=i}}break;case"message":const c=i.T;if(i.repeated)s[n]=o[n].map(e=>hi(e,c)?e:new c(e));else{const e=o[n];c.fieldWrapper?"google.protobuf.BytesValue"===c.typeName?s[n]=Hi(e):s[n]=e:s[n]=hi(e,c)?e:new c(e)}}}},equals:(e,t,n)=>t===n||!(!t||!n)&&e.fields.byMember().every(e=>{const i=t[e.localName],s=n[e.localName];if(e.repeated){if(i.length!==s.length)return!1;switch(e.kind){case"message":return i.every((t,n)=>e.T.equals(t,s[n]));case"scalar":return i.every((t,n)=>Yn(e.T,t,s[n]));case"enum":return i.every((e,t)=>Yn(zn.INT32,e,s[t]))}throw new Error("repeated cannot contain ".concat(e.kind))}switch(e.kind){case"message":let t=i,n=s;return e.T.fieldWrapper&&(void 0===t||hi(t)||(t=e.T.fieldWrapper.wrapField(t)),void 0===n||hi(n)||(n=e.T.fieldWrapper.wrapField(n))),e.T.equals(t,n);case"enum":return Yn(zn.INT32,i,s);case"scalar":return Yn(e.T,i,s);case"oneof":if(i.case!==s.case)return!1;const o=e.findField(i.case);if(void 0===o)return!0;switch(o.kind){case"message":return o.T.equals(i.value,s.value);case"enum":return Yn(zn.INT32,i.value,s.value);case"scalar":return Yn(o.T,i.value,s.value)}throw new Error("oneof cannot contain ".concat(o.kind));case"map":const r=Object.keys(i).concat(Object.keys(s));switch(e.V.kind){case"message":const t=e.V.T;return r.every(e=>t.equals(i[e],s[e]));case"enum":return r.every(e=>Yn(zn.INT32,i[e],s[e]));case"scalar":const n=e.V.T;return r.every(e=>Yn(n,i[e],s[e]))}}}),clone(e){const t=e.getType(),n=new t,i=n;for(const s of t.fields.byMember()){const t=e[s.localName];let n;if(s.repeated)n=t.map(Wi);else if("map"==s.kind){n=i[s.localName];for(const[e,i]of Object.entries(t))n[e]=Wi(i)}else n="oneof"==s.kind?s.findField(t.case)?{case:t.case,value:Wi(t.value)}:{case:void 0}:Wi(t);i[s.localName]=n}for(const s of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(i,s.no,s.wireType,s.data);return n}}),{newFieldList:ns,initFields:is}),makeMessageType(e,t,n){return function(e,t,n,i){var s;const o=null!==(s=null==i?void 0:i.localName)&&void 0!==s?s:t.substring(t.lastIndexOf(".")+1),r={[o]:function(t){e.util.initFields(this),e.util.initPartial(t,this)}}[o];return Object.setPrototypeOf(r.prototype,new Dn),Object.assign(r,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary:(e,t)=>(new r).fromBinary(e,t),fromJson:(e,t)=>(new r).fromJson(e,t),fromJsonString:(e,t)=>(new r).fromJsonString(e,t),equals:(t,n)=>e.util.equals(r,t,n)}),r}(this,e,t,n)},makeEnum:Ln,makeEnumType:Mn,getEnumType:In,makeExtension(e,t,n){return function(e,t,n,i){let s;return{typeName:t,extendee:n,get field(){if(!s){const n="function"==typeof i?i():i;n.name=t.split(".").pop(),n.jsonName="[".concat(t,"]"),s=e.util.newFieldList([n]).list()[0]}return s},runtime:e}}(this,e,t,n)}});var ns,is;class ss extends Dn{constructor(e){super(),this.seconds=Hn.zero,this.nanos=0,ts.util.initPartial(e,this)}fromJson(e,t){if("string"!=typeof e)throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(ts.json.debug(e)));const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=Hn.parse(i/1e3),this.nanos=0,n[7]&&(this.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),this}toJson(e){const t=1e3*Number(this.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let n="Z";if(this.nanos>0){const e=(this.nanos+1e9).toString().substring(1);n="000000"===e.substring(3)?"."+e.substring(0,3)+"Z":"000"===e.substring(6)?"."+e.substring(0,6)+"Z":"."+e+"Z"}return new Date(t).toISOString().replace(".000Z",n)}toDate(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}static now(){return ss.fromDate(/* @__PURE__ */new Date)}static fromDate(e){const t=e.getTime();return new ss({seconds:Hn.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return(new ss).fromBinary(e,t)}static fromJson(e,t){return(new ss).fromJson(e,t)}static fromJsonString(e,t){return(new ss).fromJsonString(e,t)}static equals(e,t){return ts.util.equals(ss,e,t)}}ss.runtime=ts,ss.typeName="google.protobuf.Timestamp",ss.fields=ts.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const os=/* @__PURE__ */ts.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:ss},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:rs,repeated:!0},{no:5,name:"events",kind:"message",T:cs,repeated:!0}]),rs=/* @__PURE__ */ts.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:as,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),as=/* @__PURE__ */ts.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:ss},{no:3,name:"value",kind:"scalar",T:2}]),cs=/* @__PURE__ */ts.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:ss},{no:7,name:"normalized_end_timestamp",kind:"message",T:ss,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),ds=/* @__PURE__ */ts.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),ls=/* @__PURE__ */ts.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),us=/* @__PURE__ */ts.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),hs=/* @__PURE__ */ts.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),ps=/* @__PURE__ */ts.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),ms=/* @__PURE__ */ts.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),gs=/* @__PURE__ */ts.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"},{no:15,name:"MEDIA_FAILURE"}]),vs=/* @__PURE__ */ts.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),fs=/* @__PURE__ */ts.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),_s=/* @__PURE__ */ts.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),bs=/* @__PURE__ */ts.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:ys,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:no}]),ys=/* @__PURE__ */ts.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),ks=/* @__PURE__ */ts.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:ts.getEnumType(us),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Cs=/* @__PURE__ */ts.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:ts.getEnumType(ws)},{no:4,name:"tracks",kind:"message",T:Is,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:ks},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:ts.getEnumType(Ts)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:ts.getEnumType(gs)},{no:18,name:"kind_details",kind:"enum",T:ts.getEnumType(Ss),repeated:!0},{no:19,name:"data_tracks",kind:"message",T:Rs,repeated:!0}]),ws=/* @__PURE__ */ts.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Ts=/* @__PURE__ */ts.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"},{no:7,name:"CONNECTOR"},{no:8,name:"BRIDGE"}]),Ss=/* @__PURE__ */ts.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"},{no:2,name:"CONNECTOR_WHATSAPP"},{no:3,name:"CONNECTOR_TWILIO"},{no:4,name:"BRIDGE_RTSP"}]),Es=/* @__PURE__ */ts.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),Ps=/* @__PURE__ */ts.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Ls,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:ts.getEnumType(Os)},{no:6,name:"sdp_cid",kind:"scalar",T:9}]),Is=/* @__PURE__ */ts.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:ts.getEnumType(ls)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:ts.getEnumType(us)},{no:10,name:"layers",kind:"message",T:Ls,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:Ps,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:ts.getEnumType(Es)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:no},{no:19,name:"audio_features",kind:"enum",T:ts.getEnumType(_s),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:ts.getEnumType(ds)}]),Rs=/* @__PURE__ */ts.makeMessageType("livekit.DataTrackInfo",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"sid",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"encryption",kind:"enum",T:ts.getEnumType(Es)}]),Ms=/* @__PURE__ */ts.makeMessageType("livekit.DataTrackSubscriptionOptions",()=>[{no:1,name:"target_fps",kind:"scalar",T:13,opt:!0}]),Ls=/* @__PURE__ */ts.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:ts.getEnumType(hs)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13},{no:6,name:"spatial_layer",kind:"scalar",T:5},{no:7,name:"rid",kind:"scalar",T:9},{no:8,name:"repair_ssrc",kind:"scalar",T:13}]),Os=/* @__PURE__ */ts.makeEnum("livekit.VideoLayer.Mode",[{no:0,name:"MODE_UNUSED"},{no:1,name:"ONE_SPATIAL_LAYER_PER_STREAM"},{no:2,name:"MULTIPLE_SPATIAL_LAYERS_PER_STREAM"},{no:3,name:"ONE_SPATIAL_LAYER_PER_STREAM_INCOMPLETE_RTCP_SR"}]),Ds=/* @__PURE__ */ts.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:ts.getEnumType(xs)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:js,oneof:"value"},{no:3,name:"speaker",kind:"message",T:Us,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Bs,oneof:"value"},{no:7,name:"transcription",kind:"message",T:qs,oneof:"value"},{no:8,name:"metrics",kind:"message",T:os,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:Ws,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:Hs,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:zs,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Gs,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:ro,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:ao,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:co,oneof:"value"},{no:18,name:"encrypted_packet",kind:"message",T:As,oneof:"value"},{no:16,name:"sequence",kind:"scalar",T:13},{no:17,name:"participant_sid",kind:"scalar",T:9}]),xs=/* @__PURE__ */ts.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),As=/* @__PURE__ */ts.makeMessageType("livekit.EncryptedPacket",()=>[{no:1,name:"encryption_type",kind:"enum",T:ts.getEnumType(Es)},{no:2,name:"iv",kind:"scalar",T:12},{no:3,name:"key_index",kind:"scalar",T:13},{no:4,name:"encrypted_value",kind:"scalar",T:12}]),Ns=/* @__PURE__ */ts.makeMessageType("livekit.EncryptedPacketPayload",()=>[{no:1,name:"user",kind:"message",T:js,oneof:"value"},{no:3,name:"chat_message",kind:"message",T:Ws,oneof:"value"},{no:4,name:"rpc_request",kind:"message",T:Hs,oneof:"value"},{no:5,name:"rpc_ack",kind:"message",T:zs,oneof:"value"},{no:6,name:"rpc_response",kind:"message",T:Gs,oneof:"value"},{no:7,name:"stream_header",kind:"message",T:ro,oneof:"value"},{no:8,name:"stream_chunk",kind:"message",T:ao,oneof:"value"},{no:9,name:"stream_trailer",kind:"message",T:co,oneof:"value"}]),Us=/* @__PURE__ */ts.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:Fs,repeated:!0}]),Fs=/* @__PURE__ */ts.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),js=/* @__PURE__ */ts.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),Bs=/* @__PURE__ */ts.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),qs=/* @__PURE__ */ts.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:Vs,repeated:!0}]),Vs=/* @__PURE__ */ts.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),Ws=/* @__PURE__ */ts.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),Hs=/* @__PURE__ */ts.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),zs=/* @__PURE__ */ts.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Gs=/* @__PURE__ */ts.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Js,oneof:"value"}]),Js=/* @__PURE__ */ts.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),Ks=/* @__PURE__ */ts.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),$s=/* @__PURE__ */ts.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:ts.getEnumType(Qs)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),Qs=/* @__PURE__ */ts.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),Ys=/* @__PURE__ */ts.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:ts.getEnumType(Xs)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),Xs=/* @__PURE__ */ts.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"},{no:14,name:"ESP32"}]),Zs=/* @__PURE__ */ts.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:eo},{no:2,name:"screen",kind:"message",T:eo},{no:3,name:"resume_connection",kind:"enum",T:ts.getEnumType(ms)},{no:4,name:"disabled_codecs",kind:"message",T:to},{no:5,name:"force_relay",kind:"enum",T:ts.getEnumType(ms)}]),eo=/* @__PURE__ */ts.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:ts.getEnumType(ms)}]),to=/* @__PURE__ */ts.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:ys,repeated:!0},{no:2,name:"publish",kind:"message",T:ys,repeated:!0}]),no=/* @__PURE__ */ts.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),io=/* @__PURE__ */ts.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),so=/* @__PURE__ */ts.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:ts.getEnumType(io)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),oo=/* @__PURE__ */ts.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),ro=/* @__PURE__ */ts.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:ts.getEnumType(Es)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:so,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:oo,oneof:"content_header"}],{localName:"DataStream_Header"}),ao=/* @__PURE__ */ts.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),co=/* @__PURE__ */ts.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),lo=/* @__PURE__ */ts.makeMessageType("livekit.SubscribedAudioCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"enabled",kind:"scalar",T:8}]),uo=/* @__PURE__ */ts.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),ho=/* @__PURE__ */ts.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),po=/* @__PURE__ */ts.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),mo=/* @__PURE__ */ts.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Mo,oneof:"message"},{no:2,name:"answer",kind:"message",T:Mo,oneof:"message"},{no:3,name:"trickle",kind:"message",T:To,oneof:"message"},{no:4,name:"add_track",kind:"message",T:fo,oneof:"message"},{no:5,name:"mute",kind:"message",T:So,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Oo,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Ao,oneof:"message"},{no:8,name:"leave",kind:"message",T:Fo,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Bo,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:er,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:ir,oneof:"message"},{no:13,name:"simulate",kind:"message",T:rr,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:qo,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:ar,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:No,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:Uo,oneof:"message"},{no:19,name:"publish_data_track_request",kind:"message",T:_o,oneof:"message"},{no:20,name:"unpublish_data_track_request",kind:"message",T:yo,oneof:"message"},{no:21,name:"update_data_subscription",kind:"message",T:Do,oneof:"message"}]),go=/* @__PURE__ */ts.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:Eo,oneof:"message"},{no:2,name:"answer",kind:"message",T:Mo,oneof:"message"},{no:3,name:"offer",kind:"message",T:Mo,oneof:"message"},{no:4,name:"trickle",kind:"message",T:To,oneof:"message"},{no:5,name:"update",kind:"message",T:Lo,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Io,oneof:"message"},{no:8,name:"leave",kind:"message",T:Fo,oneof:"message"},{no:9,name:"mute",kind:"message",T:So,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:Wo,oneof:"message"},{no:11,name:"room_update",kind:"message",T:Ho,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:Go,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:Ko,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:Yo,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:tr,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:Ro,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:Po,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:cr,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:ur,oneof:"message"},{no:22,name:"request_response",kind:"message",T:hr,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:mr,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:nr,oneof:"message"},{no:25,name:"media_sections_requirement",kind:"message",T:br,oneof:"message"},{no:26,name:"subscribed_audio_codec_update",kind:"message",T:Xo,oneof:"message"},{no:27,name:"publish_data_track_response",kind:"message",T:bo,oneof:"message"},{no:28,name:"unpublish_data_track_response",kind:"message",T:ko,oneof:"message"},{no:29,name:"data_track_subscriber_handles",kind:"message",T:Co,oneof:"message"}]),vo=/* @__PURE__ */ts.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Ls,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:ts.getEnumType(Os)}]),fo=/* @__PURE__ */ts.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:ts.getEnumType(ls)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:ts.getEnumType(us)},{no:9,name:"layers",kind:"message",T:Ls,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:vo,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:ts.getEnumType(Es)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:ts.getEnumType(ds)},{no:17,name:"audio_features",kind:"enum",T:ts.getEnumType(_s),repeated:!0}]),_o=/* @__PURE__ */ts.makeMessageType("livekit.PublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"encryption",kind:"enum",T:ts.getEnumType(Es)}]),bo=/* @__PURE__ */ts.makeMessageType("livekit.PublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:Rs}]),yo=/* @__PURE__ */ts.makeMessageType("livekit.UnpublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13}]),ko=/* @__PURE__ */ts.makeMessageType("livekit.UnpublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:Rs}]),Co=/* @__PURE__ */ts.makeMessageType("livekit.DataTrackSubscriberHandles",()=>[{no:1,name:"sub_handles",kind:"map",K:13,V:{kind:"message",T:wo}}]),wo=/* @__PURE__ */ts.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack",()=>[{no:1,name:"publisher_identity",kind:"scalar",T:9},{no:2,name:"publisher_sid",kind:"scalar",T:9},{no:3,name:"track_sid",kind:"scalar",T:9}],{localName:"DataTrackSubscriberHandles_PublishedDataTrack"}),To=/* @__PURE__ */ts.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:ts.getEnumType(uo)},{no:3,name:"final",kind:"scalar",T:8}]),So=/* @__PURE__ */ts.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),Eo=/* @__PURE__ */ts.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:bs},{no:2,name:"participant",kind:"message",T:Cs},{no:3,name:"other_participants",kind:"message",T:Cs,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Vo,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Zs},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:$s},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:ys,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),Po=/* @__PURE__ */ts.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:Vo,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Zs},{no:3,name:"server_info",kind:"message",T:$s},{no:4,name:"last_message_seq",kind:"scalar",T:13}]),Io=/* @__PURE__ */ts.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Is}]),Ro=/* @__PURE__ */ts.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Mo=/* @__PURE__ */ts.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"id",kind:"scalar",T:13},{no:4,name:"mid_to_track_id",kind:"map",K:9,V:{kind:"scalar",T:9}}]),Lo=/* @__PURE__ */ts.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Cs,repeated:!0}]),Oo=/* @__PURE__ */ts.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Ks,repeated:!0}]),Do=/* @__PURE__ */ts.makeMessageType("livekit.UpdateDataSubscription",()=>[{no:1,name:"updates",kind:"message",T:xo,repeated:!0}]),xo=/* @__PURE__ */ts.makeMessageType("livekit.UpdateDataSubscription.Update",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"options",kind:"message",T:Ms}],{localName:"UpdateDataSubscription_Update"}),Ao=/* @__PURE__ */ts.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:ts.getEnumType(hs)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),No=/* @__PURE__ */ts.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:ts.getEnumType(_s),repeated:!0}]),Uo=/* @__PURE__ */ts.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),Fo=/* @__PURE__ */ts.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:ts.getEnumType(gs)},{no:3,name:"action",kind:"enum",T:ts.getEnumType(jo)},{no:4,name:"regions",kind:"message",T:dr}]),jo=/* @__PURE__ */ts.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Bo=/* @__PURE__ */ts.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Ls,repeated:!0}]),qo=/* @__PURE__ */ts.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),Vo=/* @__PURE__ */ts.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),Wo=/* @__PURE__ */ts.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:Fs,repeated:!0}]),Ho=/* @__PURE__ */ts.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:bs}]),zo=/* @__PURE__ */ts.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:ts.getEnumType(ps)},{no:3,name:"score",kind:"scalar",T:2}]),Go=/* @__PURE__ */ts.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:zo,repeated:!0}]),Jo=/* @__PURE__ */ts.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:ts.getEnumType(ho)}]),Ko=/* @__PURE__ */ts.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:Jo,repeated:!0}]),$o=/* @__PURE__ */ts.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:ts.getEnumType(hs)},{no:2,name:"enabled",kind:"scalar",T:8}]),Qo=/* @__PURE__ */ts.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:$o,repeated:!0}]),Yo=/* @__PURE__ */ts.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:$o,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:Qo,repeated:!0}]),Xo=/* @__PURE__ */ts.makeMessageType("livekit.SubscribedAudioCodecUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_audio_codecs",kind:"message",T:lo,repeated:!0}]),Zo=/* @__PURE__ */ts.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),er=/* @__PURE__ */ts.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Zo,repeated:!0}]),tr=/* @__PURE__ */ts.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),nr=/* @__PURE__ */ts.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:bs},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:Cs},{no:4,name:"other_participants",kind:"message",T:Cs,repeated:!0}]),ir=/* @__PURE__ */ts.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Mo},{no:2,name:"subscription",kind:"message",T:Oo},{no:3,name:"publish_tracks",kind:"message",T:Io,repeated:!0},{no:4,name:"data_channels",kind:"message",T:or,repeated:!0},{no:5,name:"offer",kind:"message",T:Mo},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0},{no:7,name:"datachannel_receive_states",kind:"message",T:sr,repeated:!0},{no:8,name:"publish_data_tracks",kind:"message",T:bo,repeated:!0}]),sr=/* @__PURE__ */ts.makeMessageType("livekit.DataChannelReceiveState",()=>[{no:1,name:"publisher_sid",kind:"scalar",T:9},{no:2,name:"last_seq",kind:"scalar",T:13}]),or=/* @__PURE__ */ts.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:ts.getEnumType(uo)}]),rr=/* @__PURE__ */ts.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:ts.getEnumType(po),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),ar=/* @__PURE__ */ts.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),cr=/* @__PURE__ */ts.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),dr=/* @__PURE__ */ts.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:lr,repeated:!0}]),lr=/* @__PURE__ */ts.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),ur=/* @__PURE__ */ts.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:ts.getEnumType(fs)}]),hr=/* @__PURE__ */ts.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:ts.getEnumType(pr)},{no:3,name:"message",kind:"scalar",T:9},{no:4,name:"trickle",kind:"message",T:To,oneof:"request"},{no:5,name:"add_track",kind:"message",T:fo,oneof:"request"},{no:6,name:"mute",kind:"message",T:So,oneof:"request"},{no:7,name:"update_metadata",kind:"message",T:qo,oneof:"request"},{no:8,name:"update_audio_track",kind:"message",T:No,oneof:"request"},{no:9,name:"update_video_track",kind:"message",T:Uo,oneof:"request"},{no:10,name:"publish_data_track",kind:"message",T:_o,oneof:"request"},{no:11,name:"unpublish_data_track",kind:"message",T:yo,oneof:"request"}]),pr=/* @__PURE__ */ts.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"},{no:4,name:"QUEUED"},{no:5,name:"UNSUPPORTED_TYPE"},{no:6,name:"UNCLASSIFIED_ERROR"},{no:7,name:"INVALID_HANDLE"},{no:8,name:"INVALID_NAME"},{no:9,name:"DUPLICATE_HANDLE"},{no:10,name:"DUPLICATE_NAME"}]),mr=/* @__PURE__ */ts.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),gr=/* @__PURE__ */ts.makeMessageType("livekit.ConnectionSettings",()=>[{no:1,name:"auto_subscribe",kind:"scalar",T:8},{no:2,name:"adaptive_stream",kind:"scalar",T:8},{no:3,name:"subscriber_allow_pause",kind:"scalar",T:8,opt:!0},{no:4,name:"disable_ice_lite",kind:"scalar",T:8},{no:5,name:"auto_subscribe_data_track",kind:"scalar",T:8,opt:!0}]),vr=/* @__PURE__ */ts.makeMessageType("livekit.JoinRequest",()=>[{no:1,name:"client_info",kind:"message",T:Ys},{no:2,name:"connection_settings",kind:"message",T:gr},{no:3,name:"metadata",kind:"scalar",T:9},{no:4,name:"participant_attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"add_track_requests",kind:"message",T:fo,repeated:!0},{no:6,name:"publisher_offer",kind:"message",T:Mo},{no:7,name:"reconnect",kind:"scalar",T:8},{no:8,name:"reconnect_reason",kind:"enum",T:ts.getEnumType(vs)},{no:9,name:"participant_sid",kind:"scalar",T:9},{no:10,name:"sync_state",kind:"message",T:ir}]),fr=/* @__PURE__ */ts.makeMessageType("livekit.WrappedJoinRequest",()=>[{no:1,name:"compression",kind:"enum",T:ts.getEnumType(_r)},{no:2,name:"join_request",kind:"scalar",T:12}]),_r=/* @__PURE__ */ts.makeEnum("livekit.WrappedJoinRequest.Compression",[{no:0,name:"NONE"},{no:1,name:"GZIP"}]),br=/* @__PURE__ */ts.makeMessageType("livekit.MediaSectionsRequirement",()=>[{no:1,name:"num_audios",kind:"scalar",T:13},{no:2,name:"num_videos",kind:"scalar",T:13}]);function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kr,Cr={exports:{}};var wr,Tr,Sr,Er,Pr,Ir,Rr,Mr=(kr||(kr=1,Tr=Cr.exports,Sr=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(ep){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),s=0;s<i.length;s++){var o=i[s];this[o]=s<n?e:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function d(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function l(i,s,o){return function(i){return"debug"===i&&(i="log"),typeof console!==t&&("trace"===i&&n?a:void 0!==console[i]?r(console,i):void 0!==console.log?r(console,"log"):e)}(i)||d.apply(this,arguments)}function u(e,n){var r,a,d,u=this,h="loglevel";function p(){var e;if(typeof window!==t&&h){try{e=window.localStorage[h]}catch(o){}if(typeof e===t)try{var n=window.document.cookie,i=encodeURIComponent(h),s=n.indexOf(i+"=");-1!==s&&(e=/^([^;]+)/.exec(n.slice(s+i.length+1))[1])}catch(o){}return void 0===u.levels[e]&&(e=void 0),e}}function m(e){var t=e;if("string"==typeof t&&void 0!==u.levels[t.toUpperCase()]&&(t=u.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=u.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),u.name=e,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=n||l,u.getLevel=function(){return null!=d?d:null!=a?a:r},u.setLevel=function(e,n){return d=m(e),!1!==n&&function(e){var n=(i[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=n)}catch(s){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(s){}}}(d),c.call(u)},u.setDefaultLevel=function(e){a=m(e),p()||u.setLevel(e,!1)},u.resetLevel=function(){d=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(u)},u.enableAll=function(e){u.setLevel(u.levels.TRACE,e)},u.disableAll=function(e){u.setLevel(u.levels.SILENT,e)},u.rebuild=function(){if(o!==u&&(r=m(o.getLevel())),c.call(u),o===u)for(var e in s)s[e].rebuild()},r=m(o?o.getLevel():"WARN");var g=p();null!=g&&(d=m(g)),c.call(u)}(o=new u).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=s[e];return t||(t=s[e]=new u(e,o.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return s},o.default=o,o},(wr=Cr).exports?wr.exports=Sr():Tr.log=Sr()),Cr.exports);(Pr=Er||(Er={}))[Pr.trace=0]="trace",Pr[Pr.debug=1]="debug",Pr[Pr.info=2]="info",Pr[Pr.warn=3]="warn",Pr[Pr.error=4]="error",Pr[Pr.silent=5]="silent",(Rr=Ir||(Ir={})).Default="livekit",Rr.Room="livekit-room",Rr.TokenSource="livekit-token-source",Rr.Participant="livekit-participant",Rr.Track="livekit-track",Rr.Publication="livekit-track-publication",Rr.Engine="livekit-engine",Rr.Signal="livekit-signal",Rr.PCManager="livekit-pc-manager",Rr.PCTransport="livekit-pc-transport",Rr.E2EE="lk-e2ee",Rr.DataTracks="livekit-data-tracks";let Lr=Mr.getLogger("livekit");function Or(e){const t=Mr.getLogger(e);return t.setDefaultLevel(Lr.getLevel()),t}Object.values(Ir).map(e=>Mr.getLogger(e)),Lr.setDefaultLevel(Er.info);const Dr=Mr.getLogger("lk-e2ee"),xr=7e3,Ar=[0,300,1200,2700,4800,xr,xr,xr,xr,xr];function Nr(e,t,n,i){return new(n||(n=Promise))(function(s,o){function r(e){try{c(i.next(e))}catch(ep){o(ep)}}function a(e){try{c(i.throw(e))}catch(ep){o(ep)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,a)}c((i=i.apply(e,t||[])).next())})}function Ur(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Ur(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise(function(i,s){(function(e,t,n,i){Promise.resolve(i).then(function(t){e({value:t,done:n})},t)})(i,s,(t=e[n](t)).done,t.value)})}}}"function"==typeof SuppressedError&&SuppressedError;var jr,Br={exports:{}};var qr=function(){if(jr)return Br.exports;jr=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}Br.exports=s,Br.exports.once=function(e,t){return new Promise(function(n,i){function s(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,s,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function r(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,i){var s,o,c,d;if(r(n),void 0===(o=e._events)?(o=e._events=/* @__PURE__ */Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]),void 0===c)c=o[t]=n,++e._eventsCount;else if("function"==typeof c?c=o[t]=i?[n,c]:[c,n]:i?c.unshift(n):c.push(n),(s=a(e))>0&&c.length>s&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,d=l,console&&console.warn&&console.warn(d)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=d.bind(i);return s.listener=n,i.wrapFn=s,s}function u(e,t,n){var i=e._events;if(void 0===i)return[];var s=i[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):p(s,s.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function m(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function s(o){i.once&&e.removeEventListener(t,s),n(o)})}}return Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=/* @__PURE__ */Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var s="error"===e,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var d=c.length,l=p(c,d);for(i=0;i<d;++i)n(l[i],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return r(t),this.on(e,l(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return r(t),this.prependListener(e,l(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,i,s,o,a;if(r(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=/* @__PURE__ */Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=/* @__PURE__ */Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=/* @__PURE__ */Object.create(null):delete n[e]),this;if(0===arguments.length){var s,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(s=o[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=/* @__PURE__ */Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return u(this,e,!0)},s.prototype.rawListeners=function(e){return u(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},Br.exports}();let Vr=!0,Wr=!0;function Hr(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseFloat(i[n],10)}function zr(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,s=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return s.apply(this,arguments);const o=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=/* @__PURE__ */new Map),this._eventMap[t].set(i,o),s.apply(this,[e,o])};const o=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Gr(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Vr=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Jr(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Wr=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Kr(){if("object"==typeof window){if(Vr)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function $r(e,t){Wr&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Qr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Yr(e){return Qr(e)?Object.keys(e).reduce(function(t,n){const i=Qr(e[n]),s=i?Yr(e[n]):e[n],o=i&&!Object.keys(s).length;return void 0===s||o?t:Object.assign(t,{[n]:s})},{}):e}function Xr(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(i=>{i.endsWith("Id")?Xr(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach(t=>{Xr(e,e.get(t),n)})}))}function Zr(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",s=/* @__PURE__ */new Map;if(null===t)return s;const o=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(t=>{e.forEach(n=>{n.type===i&&n.trackId===t.id&&Xr(e,n,s)})}),s}const ea=Kr;function ta(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[s("min",n)]=i.ideal,t.optional.push(e),e={},e[s("max",n)]=i.ideal,t.optional.push(e)):(e[s("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=i.exact):["min","max"].forEach(e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=i[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,s){if(t.version>=61)return s(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const r=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||r)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let r=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!r&&n.length&&t.includes("back")&&(r=n[n.length-1]),r&&(e.video.deviceId=o.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=i(e.video),ea("chrome: "+JSON.stringify(e)),s(e)})}e.video=i(e.video)}return ea("chrome: "+JSON.stringify(e)),s(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){s(e,e=>{n.webkitGetUserMedia(e,t,e=>{i&&i(o(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return s(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(o(e))))}}}function na(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function ia(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const s=new Event("track");s.track=n.track,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)}),t.stream.getTracks().forEach(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const s=new Event("track");s.track=n,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else zr(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function sa(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let s=n.apply(this,arguments);return s||(s=t(this,e),this._senders.push(s)),s};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function oa(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>Zr(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),zr(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>Zr(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach(n=>{n.track===e&&(t?i=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?i=!0:n=t),t.track===e)),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function ra(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const s=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),s.apply(this,arguments)}}function aa(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return ra(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const s=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(s.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(e=>e===t))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const s=this._streams[n.id];if(s)s.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>o(this,e))}};e.RTCPeerConnection.prototype[t]=i[t]});const r=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),s.id)}),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),r.apply(this,arguments)):r.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ca(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]})}function da(e,t){zr(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}var la=/* @__PURE__ */Object.freeze({__proto__:null,fixNegotiationNeeded:da,shimAddTrackRemoveTrack:aa,shimAddTrackRemoveTrackWithNative:ra,shimGetSendersWithDtmf:sa,shimGetUserMedia:ta,shimMediaStream:na,shimOnTrack:ia,shimPeerConnection:ca,shimSenderReceiverGetStats:oa});function ua(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){$r("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ha(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function pa(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,s,o]=arguments;return i.apply(this,[e||null]).then(e=>{if(t.version<53&&!s)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(ep){if("TypeError"!==ep.name)throw ep;e.forEach((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(s,o)}}function ma(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(/* @__PURE__ */new Map)}}function ga(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),zr(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function va(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){$r("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function fa(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function _a(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return i})}function ba(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function ya(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function ka(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}var Ca=/* @__PURE__ */Object.freeze({__proto__:null,shimAddTransceiver:_a,shimCreateAnswer:ka,shimCreateOffer:ya,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})},shimGetParameters:ba,shimGetUserMedia:ua,shimOnTrack:ha,shimPeerConnection:pa,shimRTCDataChannel:fa,shimReceiverGetStats:ga,shimRemoveStream:va,shimSenderGetStats:ma});function wa(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return i&&i.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function Ta(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Sa(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,s=t.setLocalDescription,o=t.setRemoteDescription,r=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],s=n.apply(this,[i]);return t?(s.then(e,t),Promise.resolve()):s},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],s=i.apply(this,[n]);return t?(s.then(e,t),Promise.resolve()):s};let a=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=a,a=function(e,t,n){const i=o.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=a,a=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=a}function Ea(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Pa(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function Pa(e){return e&&void 0!==e.video?Object.assign({},e,{video:Yr(e.video)}):e}function Ia(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];void 0===i.urls&&i.url?($r("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function Ra(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ma(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function La(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Oa,Da=/* @__PURE__ */Object.freeze({__proto__:null,shimAudioContext:La,shimCallbacksAPI:Sa,shimConstraints:Pa,shimCreateOfferLegacy:Ma,shimGetUserMedia:Ea,shimLocalStreamsAPI:wa,shimRTCIceServerUrls:Ia,shimRemoteStreamsAPI:Ta,shimTrackEventTransceiver:Ra}),xa={exports:{}};var Aa=(Oa||(Oa=1,function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map(e=>e.trim())},t.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter(e=>0===e.indexOf(n))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let i=8;i<t.length;i+=2)switch(t[i]){case"raddr":n.relatedAddress=t[i+1];break;case"rport":n.relatedPort=parseInt(t[i+1],10);break;case"tcptype":n.tcpType=t[i+1];break;case"ufrag":n.ufrag=t[i+1],n.usernameFragment=t[i+1];break;default:void 0===n[t[i]]&&(n[t[i]]=t[i+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const i=e.substring(e.indexOf(" ")+1).split(";");for(let s=0;s<i.length;s++)n=i[s].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach(t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)}),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substring(t+1,i),n.value=e.substring(i+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],s=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" ");n.profile=i[2];for(let o=3;o<i.length;o++){const s=i[o],r=t.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(r){const i=t.parseRtpMap(r),o=t.matchPrefix(e,"a=fmtp:"+s+" ");switch(i.parameters=o.length?t.parseFmtp(o[0]):{},i.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(t.parseRtcpFb),n.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach(e=>{n.headerExtensions.push(t.parseExtmap(e))});const s=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach(e=>{s.forEach(t=>{e.rtcpFeedback.find(e=>e.type===t.type&&e.parameter===t.parameter)||e.rtcpFeedback.push(t)})}),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=n.codecs.map(e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach(e=>{i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)});let s=0;return n.codecs.forEach(e=>{e.maxptime>s&&(s=e.maxptime)}),s>0&&(i+="a=maxptime:"+s+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach(e=>{i+=t.writeExtmap(e)}),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),s=-1!==i.fecMechanisms.indexOf("RED"),o=-1!==i.fecMechanisms.indexOf("ULPFEC"),r=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute),a=r.length>0&&r[0].ssrc;let c;const d=t.matchPrefix(e,"a=ssrc-group:FID").map(e=>e.substring(17).split(" ").map(e=>parseInt(e,10)));d.length>0&&d[0].length>1&&d[0][0]===a&&(c=d[0][1]),i.codecs.forEach(e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(t.rtx={ssrc:c}),n.push(t),s&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},n.push(t))}}),0===n.length&&a&&n.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,n.forEach(e=>{e.maxBitrate=l})),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute)[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const s=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=0===s.length;const o=t.matchPrefix(e,"a=rtcp-mux");return n.mux=o.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(1===i.length)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const s=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"msid"===e.attribute);return s.length>0?(n=s[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:n.fmt,maxMessageSize:s};const r=t.matchPrefix(e,"a=sctpmap:");if(r.length>0){const e=r[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:s}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let s;const o=void 0!==n?n:2;return s=e||t.generateSessionId(),"v=0\r\no="+(i||"thisisadapterortc")+" "+s+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const i=t.splitLines(e);for(let t=0;t<i.length;t++)switch(i[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[t].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let t=0;t<n.length;t++)if(n[t].length<2||"="!==n[t].charAt(1))return!1;return!0},e.exports=t}(xa)),xa.exports),Na=/* @__PURE__ */yr(Aa),Ua=/* @__PURE__ */bn({__proto__:null,default:Na},[Aa]);function Fa(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const n=new t(e),i=Na.parseCandidate(e.candidate);for(const e in i)e in n||Object.defineProperty(n,e,{value:i[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,zr(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ja(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||zr(e,"icecandidate",e=>{if(e.candidate){const t=Na.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function Ba(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Na.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=Na.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),n=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(e),i=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const s=Na.matchPrefix(e.sdp,"a=max-message-size:");return s.length>0?i=parseInt(s[0].substring(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i}(arguments[0],e);let s;s=0===n&&0===i?Number.POSITIVE_INFINITY:0===n||0===i?Math.max(n,i):Math.min(n,i);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>s}),this._sctp=o}return n.apply(this,arguments)}}function qa(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],s=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&s>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},zr(e,"datachannel",e=>(t(e.channel,e.target),e))}function Va(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function Wa(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t._safariVersion>=13.1)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Ha(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function za(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);return("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then(e=>n.apply(this,[e]))})}var Ga,Ja,Ka=/* @__PURE__ */Object.freeze({__proto__:null,removeExtmapAllowMixed:Wa,shimAddIceCandidateNullOrEmpty:Ha,shimConnectionState:Va,shimMaxMessageSize:Ba,shimParameterlessSetLocalDescription:za,shimRTCIceCandidate:Fa,shimRTCIceCandidateRelayProtocol:ja,shimSendThrowTypeError:qa});!function(){let{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=Kr,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){const e=n.userAgentData.brands.find(e=>"Chromium"===e.brand);if(e)return{browser:"chrome",version:parseInt(e.version,10)}}if(n.mozGetUserMedia)t.browser="firefox",t.version=parseInt(Hr(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=parseInt(Hr(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=parseInt(Hr(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype,t._safariVersion=Hr(n.userAgent,/Version\/(\d+(\.?\d+))/,1)}return t}(e),s={browserDetails:i,commonShim:Ka,extractVersion:Hr,disableLog:Gr,disableWarnings:Jr,sdp:Ua};switch(i.browser){case"chrome":if(!la||!ca||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),s;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),s;n("adapter.js shimming chrome."),s.browserShim=la,Ha(e,i),za(e),ta(e,i),na(e),ca(e,i),ia(e),aa(e,i),sa(e),oa(e),da(e,i),Fa(e),ja(e),Va(e),Ba(e,i),qa(e),Wa(e,i);break;case"firefox":if(!Ca||!pa||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),s;n("adapter.js shimming firefox."),s.browserShim=Ca,Ha(e,i),za(e),ua(e,i),pa(e,i),ha(e),va(e),ma(e),ga(e),fa(e),_a(e),ba(e),ya(e),ka(e),Fa(e),Va(e),Ba(e,i),qa(e);break;case"safari":if(!Da||!t.shimSafari)return n("Safari shim is not included in this adapter release."),s;n("adapter.js shimming safari."),s.browserShim=Da,Ha(e,i),za(e),Ia(e),Ma(e),Sa(e),wa(e),Ta(e),Ra(e),Ea(e),La(e),Fa(e),ja(e),Ba(e,i),qa(e),Wa(e,i);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});class $a extends(Ja=Promise){constructor(e){super(e)}catch(e){return super.catch(e)}static reject(e){return super.reject(e)}static all(e){return super.all(e)}static race(e){return super.race(e)}}Ga=$a,$a.resolve=e=>Reflect.get(Ja,"resolve",Ga).call(Ga,e);const Qa=/version\/(\d+(\.?_?\d+)+)/i;let Ya;function Xa(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("undefined"==typeof navigator)return;const n=navigator.userAgent.toLowerCase();if(void 0===Ya||t){const e=Za.find(e=>{let{test:t}=e;return t.test(n)});Ya=null==e?void 0:e.describe(n)}return Ya}const Za=[{test:/firefox|iceweasel|fxios/i,describe:e=>({name:"Firefox",version:ec(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e),os:e.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:tc(e)})},{test:/chrom|crios|crmo/i,describe:e=>({name:"Chrome",version:ec(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),os:e.toLowerCase().includes("crios")?"iOS":void 0,osVersion:tc(e)})},{test:/safari|applewebkit/i,describe:e=>({name:"Safari",version:ec(Qa,e),os:e.includes("mobile/")?"iOS":"macOS",osVersion:tc(e)})}];function ec(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=t.match(e);return i&&i.length>=n&&i[n]||""}function tc(e){return e.includes("mac os")?ec(/\(.+?(\d+_\d+(:?_\d+)?)/,e,1).replace(/_/g,"."):void 0}class nc extends Error{constructor(e,t,n){super(t||"an error has occurred"),this.name="LiveKitError",this.code=e,void 0!==(null==n?void 0:n.cause)&&(this.cause=null==n?void 0:n.cause)}}class ic extends nc{}var sc,oc,rc,ac,cc,dc,lc,uc,hc,pc,mc,gc,vc,fc;(oc=sc||(sc={}))[oc.NotAllowed=0]="NotAllowed",oc[oc.ServerUnreachable=1]="ServerUnreachable",oc[oc.InternalError=2]="InternalError",oc[oc.Cancelled=3]="Cancelled",oc[oc.LeaveRequest=4]="LeaveRequest",oc[oc.Timeout=5]="Timeout",oc[oc.WebSocket=6]="WebSocket",oc[oc.ServiceNotFound=7]="ServiceNotFound";class _c extends ic{constructor(e,t,n,i){super(1,e),this.name="ConnectionError",this.status=n,this.reason=t,this.context=i,this.reasonName=sc[t]}static notAllowed(e,t,n){return new _c(e,sc.NotAllowed,t,n)}static timeout(e){return new _c(e,sc.Timeout)}static leaveRequest(e,t){return new _c(e,sc.LeaveRequest,void 0,t)}static internal(e,t){return new _c(e,sc.InternalError,void 0,t)}static cancelled(e){return new _c(e,sc.Cancelled)}static serverUnreachable(e,t){return new _c(e,sc.ServerUnreachable,t)}static websocket(e,t,n){return new _c(e,sc.WebSocket,t,n)}static serviceNotFound(e,t){return new _c(e,sc.ServiceNotFound,void 0,t)}}class bc extends nc{constructor(e){super(21,null!=e?e:"device is unsupported"),this.name="DeviceUnsupportedError"}}class yc extends nc{constructor(e){super(20,null!=e?e:"track is invalid"),this.name="TrackInvalidError"}}class kc extends nc{constructor(e){super(10,null!=e?e:"unsupported server"),this.name="UnsupportedServer"}}class Cc extends nc{constructor(e){super(12,null!=e?e:"unexpected connection state"),this.name="UnexpectedConnectionState"}}class wc extends nc{constructor(e){super(13,null!=e?e:"unable to negotiate"),this.name="NegotiationError"}}class Tc extends nc{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class Sc extends ic{constructor(e,t){super(15,e),this.name="SignalRequestError",this.reason=t,this.reasonName="string"==typeof t?t:pr[t]}}(ac=rc||(rc={}))[ac.AlreadyOpened=0]="AlreadyOpened",ac[ac.AbnormalEnd=1]="AbnormalEnd",ac[ac.DecodeFailed=2]="DecodeFailed",ac[ac.LengthExceeded=3]="LengthExceeded",ac[ac.Incomplete=4]="Incomplete",ac[ac.HandlerAlreadyRegistered=7]="HandlerAlreadyRegistered",ac[ac.EncryptionTypeMismatch=8]="EncryptionTypeMismatch";class Ec extends ic{constructor(e,t){super(16,e),this.name="DataStreamError",this.reason=t,this.reasonName=rc[t]}}class Pc extends nc{constructor(e){super(18,e),this.name="SignalReconnectError"}}(dc=cc||(cc={})).PermissionDenied="PermissionDenied",dc.NotFound="NotFound",dc.DeviceInUse="DeviceInUse",dc.Other="Other",function(e){e.getFailure=function(t){if(t&&"name"in t)return"NotFoundError"===t.name||"DevicesNotFoundError"===t.name?e.NotFound:"NotAllowedError"===t.name||"PermissionDeniedError"===t.name?e.PermissionDenied:"NotReadableError"===t.name||"TrackStartError"===t.name?e.DeviceInUse:e.Other}}(cc||(cc={}));class Ic{}Ic.setTimeout=function(){return setTimeout(...arguments)},Ic.setInterval=function(){return setInterval(...arguments)},Ic.clearTimeout=function(){return clearTimeout(...arguments)},Ic.clearInterval=function(){return clearInterval(...arguments)},(uc=lc||(lc={})).Connected="connected",uc.Reconnecting="reconnecting",uc.SignalReconnecting="signalReconnecting",uc.Reconnected="reconnected",uc.Disconnected="disconnected",uc.ConnectionStateChanged="connectionStateChanged",uc.Moved="moved",uc.MediaDevicesChanged="mediaDevicesChanged",uc.ParticipantConnected="participantConnected",uc.ParticipantDisconnected="participantDisconnected",uc.TrackPublished="trackPublished",uc.TrackSubscribed="trackSubscribed",uc.TrackSubscriptionFailed="trackSubscriptionFailed",uc.TrackUnpublished="trackUnpublished",uc.TrackUnsubscribed="trackUnsubscribed",uc.TrackMuted="trackMuted",uc.TrackUnmuted="trackUnmuted",uc.LocalTrackPublished="localTrackPublished",uc.LocalTrackUnpublished="localTrackUnpublished",uc.LocalAudioSilenceDetected="localAudioSilenceDetected",uc.ActiveSpeakersChanged="activeSpeakersChanged",uc.ParticipantMetadataChanged="participantMetadataChanged",uc.ParticipantNameChanged="participantNameChanged",uc.ParticipantAttributesChanged="participantAttributesChanged",uc.ParticipantActive="participantActive",uc.RoomMetadataChanged="roomMetadataChanged",uc.DataReceived="dataReceived",uc.SipDTMFReceived="sipDTMFReceived",uc.TranscriptionReceived="transcriptionReceived",uc.ConnectionQualityChanged="connectionQualityChanged",uc.TrackStreamStateChanged="trackStreamStateChanged",uc.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",uc.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",uc.AudioPlaybackStatusChanged="audioPlaybackChanged",uc.VideoPlaybackStatusChanged="videoPlaybackChanged",uc.MediaDevicesError="mediaDevicesError",uc.ParticipantPermissionsChanged="participantPermissionsChanged",uc.SignalConnected="signalConnected",uc.RecordingStatusChanged="recordingStatusChanged",uc.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",uc.EncryptionError="encryptionError",uc.DCBufferStatusChanged="dcBufferStatusChanged",uc.ActiveDeviceChanged="activeDeviceChanged",uc.ChatMessage="chatMessage",uc.LocalTrackSubscribed="localTrackSubscribed",uc.MetricsReceived="metricsReceived",(pc=hc||(hc={})).TrackPublished="trackPublished",pc.TrackSubscribed="trackSubscribed",pc.TrackSubscriptionFailed="trackSubscriptionFailed",pc.TrackUnpublished="trackUnpublished",pc.TrackUnsubscribed="trackUnsubscribed",pc.TrackMuted="trackMuted",pc.TrackUnmuted="trackUnmuted",pc.LocalTrackPublished="localTrackPublished",pc.LocalTrackUnpublished="localTrackUnpublished",pc.LocalTrackCpuConstrained="localTrackCpuConstrained",pc.LocalSenderCreated="localSenderCreated",pc.ParticipantMetadataChanged="participantMetadataChanged",pc.ParticipantNameChanged="participantNameChanged",pc.DataReceived="dataReceived",pc.SipDTMFReceived="sipDTMFReceived",pc.TranscriptionReceived="transcriptionReceived",pc.IsSpeakingChanged="isSpeakingChanged",pc.ConnectionQualityChanged="connectionQualityChanged",pc.TrackStreamStateChanged="trackStreamStateChanged",pc.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",pc.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",pc.TrackCpuConstrained="trackCpuConstrained",pc.MediaDevicesError="mediaDevicesError",pc.AudioStreamAcquired="audioStreamAcquired",pc.ParticipantPermissionsChanged="participantPermissionsChanged",pc.PCTrackAdded="pcTrackAdded",pc.AttributesChanged="attributesChanged",pc.LocalTrackSubscribed="localTrackSubscribed",pc.ChatMessage="chatMessage",pc.Active="active",(gc=mc||(mc={})).TransportsCreated="transportsCreated",gc.Connected="connected",gc.Disconnected="disconnected",gc.Resuming="resuming",gc.Resumed="resumed",gc.Restarting="restarting",gc.Restarted="restarted",gc.SignalResumed="signalResumed",gc.SignalRestarted="signalRestarted",gc.Closing="closing",gc.MediaTrackAdded="mediaTrackAdded",gc.ActiveSpeakersUpdate="activeSpeakersUpdate",gc.DataPacketReceived="dataPacketReceived",gc.RTPVideoMapUpdate="rtpVideoMapUpdate",gc.DCBufferStatusChanged="dcBufferStatusChanged",gc.ParticipantUpdate="participantUpdate",gc.RoomUpdate="roomUpdate",gc.SpeakersChanged="speakersChanged",gc.StreamStateChanged="streamStateChanged",gc.ConnectionQualityUpdate="connectionQualityUpdate",gc.SubscriptionError="subscriptionError",gc.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",gc.RemoteMute="remoteMute",gc.SubscribedQualityUpdate="subscribedQualityUpdate",gc.LocalTrackUnpublished="localTrackUnpublished",gc.LocalTrackSubscribed="localTrackSubscribed",gc.Offline="offline",gc.SignalRequestResponse="signalRequestResponse",gc.SignalConnected="signalConnected",gc.RoomMoved="roomMoved",(fc=vc||(vc={})).Message="message",fc.Muted="muted",fc.Unmuted="unmuted",fc.Restarted="restarted",fc.Ended="ended",fc.Subscribed="subscribed",fc.Unsubscribed="unsubscribed",fc.CpuConstrained="cpuConstrained",fc.UpdateSettings="updateSettings",fc.UpdateSubscription="updateSubscription",fc.AudioPlaybackStarted="audioPlaybackStarted",fc.AudioPlaybackFailed="audioPlaybackFailed",fc.AudioSilenceDetected="audioSilenceDetected",fc.VisibilityChanged="visibilityChanged",fc.VideoDimensionsChanged="videoDimensionsChanged",fc.VideoPlaybackStarted="videoPlaybackStarted",fc.VideoPlaybackFailed="videoPlaybackFailed",fc.ElementAttached="elementAttached",fc.ElementDetached="elementDetached",fc.UpstreamPaused="upstreamPaused",fc.UpstreamResumed="upstreamResumed",fc.SubscriptionPermissionChanged="subscriptionPermissionChanged",fc.SubscriptionStatusChanged="subscriptionStatusChanged",fc.SubscriptionFailed="subscriptionFailed",fc.TrackProcessorUpdate="trackProcessorUpdate",fc.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",fc.TranscriptionReceived="transcriptionReceived",fc.TimeSyncUpdate="timeSyncUpdate",fc.PreConnectBufferFlushed="preConnectBufferFlushed";class Rc{constructor(e,t,n,i,s){if("object"==typeof e)this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else{if(void 0===t||void 0===n)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:n,maxFramerate:i,priority:s}}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const Mc=["vp8","h264"],Lc=["vp8","h264","vp9","av1","h265"];const Oc=function(e){return!!Mc.find(t=>t===e)};var Dc,xc,Ac,Nc;(xc=Dc||(Dc={}))[xc.PREFER_REGRESSION=0]="PREFER_REGRESSION",xc[xc.SIMULCAST=1]="SIMULCAST",xc[xc.REGRESSION=2]="REGRESSION",(Nc=Ac||(Ac={})).telephone={maxBitrate:12e3},Nc.speech={maxBitrate:24e3},Nc.music={maxBitrate:48e3},Nc.musicStereo={maxBitrate:64e3},Nc.musicHighQuality={maxBitrate:96e3},Nc.musicHighQualityStereo={maxBitrate:128e3};const Uc={h90:new Rc(160,90,9e4,20),h180:new Rc(320,180,16e4,20),h216:new Rc(384,216,18e4,20),h360:new Rc(640,360,45e4,20),h540:new Rc(960,540,8e5,25),h720:new Rc(1280,720,17e5,30),h1080:new Rc(1920,1080,3e6,30),h1440:new Rc(2560,1440,5e6,30),h2160:new Rc(3840,2160,8e6,30)},Fc={h120:new Rc(160,120,7e4,20),h180:new Rc(240,180,125e3,20),h240:new Rc(320,240,14e4,20),h360:new Rc(480,360,33e4,20),h480:new Rc(640,480,5e5,20),h540:new Rc(720,540,6e5,25),h720:new Rc(960,720,13e5,30),h1080:new Rc(1440,1080,23e5,30),h1440:new Rc(1920,1440,38e5,30)},jc={h360fps3:new Rc(640,360,2e5,3,"medium"),h360fps15:new Rc(640,360,4e5,15,"medium"),h720fps5:new Rc(1280,720,8e5,5,"medium"),h720fps15:new Rc(1280,720,15e5,15,"medium"),h720fps30:new Rc(1280,720,2e6,30,"medium"),h1080fps15:new Rc(1920,1080,25e5,15,"medium"),h1080fps30:new Rc(1920,1080,5e6,30,"medium"),original:new Rc(0,0,7e6,30,"medium")};function Bc(e,t,n){var i,s,o,r;const{optionsWithoutProcessor:a,audioProcessor:c,videoProcessor:d}=Qc(null!=e?e:{}),l=null==t?void 0:t.processor,u=null==n?void 0:n.processor,h=null!=a?a:{};return!0===h.audio&&(h.audio={}),!0===h.video&&(h.video={}),h.audio&&(qc(h.audio,t),null!==(i=(o=h.audio).deviceId)&&void 0!==i||(o.deviceId={ideal:"default"}),(c||l)&&(h.audio.processor=null!=c?c:l)),h.video&&(qc(h.video,n),null!==(s=(r=h.video).deviceId)&&void 0!==s||(r.deviceId={ideal:"default"}),(d||u)&&(h.video.processor=null!=d?d:u)),h}function qc(e,t){return Object.keys(t).forEach(n=>{void 0===e[n]&&(e[n]=t[n])}),e}function Vc(e){var t,n,i,s;const o={};if(e.video)if("object"==typeof e.video){const n={},s=n,r=e.video;Object.keys(r).forEach(e=>{if("resolution"===e)qc(s,r.resolution);else s[e]=r[e]}),o.video=n,null!==(t=(i=o.video).deviceId)&&void 0!==t||(i.deviceId={ideal:"default"})}else o.video=!!e.video&&{deviceId:{ideal:"default"}};else o.video=!1;return e.audio?"object"==typeof e.audio?(o.audio=e.audio,null!==(n=(s=o.audio).deviceId)&&void 0!==n||(s.deviceId={ideal:"default"})):o.audio={deviceId:{ideal:"default"}}:o.audio=!1,o}function Wc(e){return Nr(this,arguments,void 0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function*(){const n=Hc();if(n){const i=n.createAnalyser();i.fftSize=2048;const s=i.frequencyBinCount,o=new Uint8Array(s);n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield od(t),i.getByteTimeDomainData(o);const r=o.some(e=>128!==e&&0!==e);return n.close(),!r}return!1}()})}function Hc(){var e;const t="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(t){const n=new t({latencyHint:"interactive"});if("suspended"===n.state&&"undefined"!=typeof window&&(null===(e=window.document)||void 0===e?void 0:e.body)){const e=()=>Nr(this,void 0,void 0,function*(){var t;try{"suspended"===n.state&&(yield n.resume())}catch(ep){console.warn("Error trying to auto-resume audio context",ep)}finally{null===(t=window.document.body)||void 0===t||t.removeEventListener("click",e)}});n.addEventListener("statechange",()=>{var t;"closed"===n.state&&(null===(t=window.document.body)||void 0===t||t.removeEventListener("click",e))}),window.document.body.addEventListener("click",e)}return n}}function zc(e){return"audioinput"===e?td.Source.Microphone:"videoinput"===e?td.Source.Camera:td.Source.Unknown}function Gc(e){return e===td.Source.Microphone?"audioinput":e===td.Source.Camera?"videoinput":void 0}function Jc(e){return e.split("/")[1].toLowerCase()}function Kc(e){const t=[];return e.forEach(e=>{void 0!==e.track&&t.push(new Io({cid:e.track.mediaStreamID,track:e.trackInfo}))}),t}function $c(e){return"mediaStreamTrack"in e?{trackID:e.sid,source:e.source,muted:e.isMuted,enabled:e.mediaStreamTrack.enabled,kind:e.kind,streamID:e.mediaStreamID,streamTrackID:e.mediaStreamTrack.id}:{trackID:e.trackSid,enabled:e.isEnabled,muted:e.isMuted,trackInfo:Object.assign({mimeType:e.mimeType,name:e.trackName,encrypted:e.isEncrypted,kind:e.kind,source:e.source},e.track?$c(e.track):{})}}function Qc(e){const t=Object.assign({},e);let n,i;return"object"==typeof t.audio&&t.audio.processor&&(n=t.audio.processor,t.audio=Object.assign(Object.assign({},t.audio),{processor:void 0})),"object"==typeof t.video&&t.video.processor&&(i=t.video.processor,t.video=Object.assign(Object.assign({},t.video),{processor:void 0})),{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:(s=t,void 0===s?s:"function"==typeof structuredClone?"object"==typeof s&&null!==s?structuredClone(Object.assign({},s)):structuredClone(s):JSON.parse(JSON.stringify(s)))};var s}function Yc(e,t){return e.width*e.height<t.width*t.height}const Xc=[];var Zc,ed;(ed=Zc||(Zc={}))[ed.LOW=0]="LOW",ed[ed.MEDIUM=1]="MEDIUM",ed[ed.HIGH=2]="HIGH";class td extends qr.EventEmitter{get streamState(){return this._streamState}setStreamState(e){this._streamState=e}constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this._streamState=td.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=Lr,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),5e3):this.handleAppVisibilityChanged()},this.log=Or(null!==(i=n.loggerName)&&void 0!==i?i:Ir.Track),this.loggerContextCb=n.loggerContextCb,this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=td.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},null===(e=this.loggerContextCb)||void 0===e?void 0:e.call(this)),$c(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===td.Kind.Video&&(t="video"),0===this.attachedElements.length&&this.kind===td.Kind.Video&&this.addAppVisibilityListener(),e||("audio"===t&&(Xc.forEach(t=>{null!==t.parentElement||e||(e=t)}),e&&Xc.splice(Xc.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),nd(this.mediaStreamTrack,e);const n=e.srcObject.getTracks(),i=n.some(e=>"audio"===e.kind);return e.play().then(()=>{this.emit(i?vc.AudioPlaybackStarted:vc.VideoPlaybackStarted)}).catch(t=>{"NotAllowedError"===t.name?this.emit(i?vc.AudioPlaybackFailed:vc.VideoPlaybackFailed,t):"AbortError"===t.name?Lr.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):Lr.warn("could not playback ".concat(i?"audio":"video"),t),i&&e&&n.some(e=>"video"===e.kind)&&"NotAllowedError"===t.name&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(vc.ElementAttached,e),e}detach(e){try{if(e){id(this.mediaStreamTrack,e);const t=this.attachedElements.indexOf(e);return t>=0&&(this.attachedElements.splice(t,1),this.recycleElement(e),this.emit(vc.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach(e=>{id(this.mediaStreamTrack,e),t.push(e),this.recycleElement(e),this.emit(vc.ElementDetached,e)}),this.attachedElements=[],t}finally{0===this.attachedElements.length&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=Or(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),Xc.forEach(e=>{e.parentElement||(t=!1)}),t&&Xc.push(e)}}handleAppVisibilityChanged(){return Nr(this,void 0,void 0,function*(){this.isInBackground="hidden"===document.visibilityState,this.isInBackground||this.kind!==td.Kind.Video||setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){gd()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){gd()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function nd(e,t){let n,i;n=t.srcObject instanceof MediaStream?t.srcObject:new MediaStream,i="audio"===e.kind?n.getAudioTracks():n.getVideoTracks(),i.includes(e)||(i.forEach(e=>{n.removeTrack(e)}),n.addTrack(e)),hd()&&t instanceof HTMLVideoElement||(t.autoplay=!0),t.muted=0===n.getAudioTracks().length,t instanceof HTMLVideoElement&&(t.playsInline=!0),t.srcObject!==n&&(t.srcObject=n,(hd()||ld())&&t instanceof HTMLVideoElement&&setTimeout(()=>{t.srcObject=n,t.play().catch(()=>{})},0))}function id(e,t){if(t.srcObject instanceof MediaStream){const n=t.srcObject;n.removeTrack(e),n.getTracks().length>0?t.srcObject=n:t.srcObject=null}}!function(e){let t;var n;let i;var s;let o;var r;(n=t=e.Kind||(e.Kind={})).Audio="audio",n.Video="video",n.Unknown="unknown",(s=i=e.Source||(e.Source={})).Camera="camera",s.Microphone="microphone",s.ScreenShare="screen_share",s.ScreenShareAudio="screen_share_audio",s.Unknown="unknown",(r=o=e.StreamState||(e.StreamState={})).Active="active",r.Paused="paused",r.Unknown="unknown",e.kindToProto=function(e){switch(e){case t.Audio:return ls.AUDIO;case t.Video:return ls.VIDEO;default:return ls.DATA}},e.kindFromProto=function(e){switch(e){case ls.AUDIO:return t.Audio;case ls.VIDEO:return t.Video;default:return t.Unknown}},e.sourceToProto=function(e){switch(e){case i.Camera:return us.CAMERA;case i.Microphone:return us.MICROPHONE;case i.ScreenShare:return us.SCREEN_SHARE;case i.ScreenShareAudio:return us.SCREEN_SHARE_AUDIO;default:return us.UNKNOWN}},e.sourceFromProto=function(e){switch(e){case us.CAMERA:return i.Camera;case us.MICROPHONE:return i.Microphone;case us.SCREEN_SHARE:return i.ScreenShare;case us.SCREEN_SHARE_AUDIO:return i.ScreenShareAudio;default:return i.Unknown}},e.streamStateFromProto=function(e){switch(e){case ho.ACTIVE:return o.Active;case ho.PAUSED:return o.Paused;default:return o.Unknown}}}(td||(td={}));const sd="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function od(e){return new $a(t=>Ic.setTimeout(t,e))}function rd(){return"addTransceiver"in RTCPeerConnection.prototype}function ad(){return"addTrack"in RTCPeerConnection.prototype}function cd(e){return"av1"===e||"vp9"===e}function dd(e){return!(!document||pd())&&(e||(e=document.createElement("audio")),"setSinkId"in e)}function ld(){var e;return"Firefox"===(null===(e=Xa())||void 0===e?void 0:e.name)}function ud(){const e=Xa();return!!e&&"Chrome"===e.name&&"iOS"!==e.os}function hd(){var e;return"Safari"===(null===(e=Xa())||void 0===e?void 0:e.name)}function pd(){const e=Xa();return"Safari"===(null==e?void 0:e.name)||"iOS"===(null==e?void 0:e.os)}function md(){var e,t;return!!gd()&&(null!==(t=null===(e=navigator.userAgentData)||void 0===e?void 0:e.mobile)&&void 0!==t?t:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function gd(){return"undefined"!=typeof document}function vd(){return"ReactNative"==navigator.product}function fd(e){return e.hostname.endsWith(".livekit.cloud")||e.hostname.endsWith(".livekit.run")}function _d(e){return fd(e)?e.hostname.split(".")[0]:null}function bd(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function yd(){if(!vd())return;let e=bd();return e?e.platform:void 0}function kd(){if(gd())return window.devicePixelRatio;if(vd()){let e=bd();if(e)return e.devicePixelRatio}return 1}function Cd(e,t){const n=e.split("."),i=t.split("."),s=Math.min(n.length,i.length);for(let o=0;o<s;++o){const e=parseInt(n[o],10),t=parseInt(i[o],10);if(e>t)return 1;if(e<t)return-1;if(o===s-1&&e===t)return 0}return""===e&&""!==t?-1:""===t?1:n.length==i.length?0:n.length<i.length?-1:1}function wd(e){for(const t of e)t.target.handleResize(t)}function Td(e){for(const t of e)t.target.handleVisibilityChanged(t)}let Sd=null;const Ed=()=>(Sd||(Sd=new ResizeObserver(wd)),Sd);let Pd=null;const Id=()=>(Pd||(Pd=new IntersectionObserver(Td,{root:null,rootMargin:"0px"})),Pd);function Rd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=document.createElement("canvas");s.width=e,s.height=t;const o=s.getContext("2d");null==o||o.fillRect(0,0,s.width,s.height),i&&o&&(o.beginPath(),o.arc(e/2,t/2,50,0,2*Math.PI,!0),o.closePath(),o.fillStyle="grey",o.fill());const r=s.captureStream(),[a]=r.getTracks();if(!a)throw Error("Could not get empty media stream video track");return a.enabled=n,a}let Md;function Ld(){if(!Md){const e=new AudioContext,t=e.createOscillator(),n=e.createGain();n.gain.setValueAtTime(0,0);const i=e.createMediaStreamDestination();if(t.connect(n),n.connect(i),t.start(),[Md]=i.stream.getAudioTracks(),!Md)throw Error("Could not get empty media stream audio track");Md.enabled=!1}return Md.clone()}class Od{get isResolved(){return this._isResolved}constructor(e,t){this._isResolved=!1,this.onFinally=t,this.promise=new Promise((t,n)=>Nr(this,void 0,void 0,function*(){this.resolve=t,this.reject=n,e&&(yield e(t,n))})).finally(()=>{var e;this._isResolved=!0,null===(e=this.onFinally)||void 0===e||e.call(this)})}}function Dd(e){if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e[0];if(void 0!==e.exact)return Array.isArray(e.exact)?e.exact[0]:e.exact;if(void 0!==e.ideal)return Array.isArray(e.ideal)?e.ideal[0]:e.ideal;throw Error("could not unwrap constraint")}function xd(e){return e.startsWith("ws")?e.replace(/^(ws)/,"http"):e}function Ad(e){switch(e.reason){case sc.LeaveRequest:return e.context;case sc.Cancelled:return gs.CLIENT_INITIATED;case sc.NotAllowed:return gs.USER_REJECTED;case sc.ServerUnreachable:return gs.JOIN_FAILURE;default:return gs.UNKNOWN_REASON}}function Nd(e){return void 0!==e?Number(e):void 0}function Ud(e){return void 0!==e?BigInt(e):void 0}function Fd(e){return!!e&&!(e instanceof MediaStreamTrack)&&e.isLocal}function jd(e){return!!e&&e.kind==td.Kind.Audio}function Bd(e){return!!e&&e.kind==td.Kind.Video}function qd(e){return Fd(e)&&Bd(e)}function Vd(e){return Fd(e)&&jd(e)}function Wd(e){return!!e&&!e.isLocal}function Hd(e){return!!e&&!e.isLocal}function zd(e){return Wd(e)&&Bd(e)}function Gd(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=function(e,t){const n=new URL(function(e){return e.startsWith("http")?e.replace(/^(http)/,"ws"):e}(e));return t.forEach((e,t)=>{n.searchParams.set(t,e)}),Kd(n,"rtc")}(e,t);return n?i:Kd(i,"v1")}function Jd(e){return e.endsWith("/")?e:"".concat(e,"/")}function Kd(e,t){return e.pathname="".concat(Jd(e.pathname)).concat(t),e}function $d(e){if("string"==typeof e)return go.fromJson(JSON.parse(e),{ignoreUnknownFields:!0});if(e instanceof ArrayBuffer)return go.fromBinary(new Uint8Array(e));throw new Error("could not decode websocket message: ".concat(typeof e))}const Qd="lk_e2ee";var Yd,Xd,Zd,el,tl,nl,il,sl;function ol(){return void 0!==window.RTCRtpSender&&void 0!==window.RTCRtpSender.prototype.createEncodedStreams||rl()}function rl(){return void 0!==window.RTCRtpScriptTransform}(Xd=Yd||(Yd={})).SetKey="setKey",Xd.RatchetRequest="ratchetRequest",Xd.KeyRatcheted="keyRatcheted",(Zd||(Zd={})).KeyRatcheted="keyRatcheted",(tl=el||(el={})).ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",tl.EncryptionError="encryptionError",(nl||(nl={})).Error="cryptorError";qr.EventEmitter;(sl=il||(il={}))[sl.InvalidKey=0]="InvalidKey",sl[sl.MissingKey=1]="MissingKey",sl[sl.InternalError=2]="InternalError";class al extends qr.EventEmitter{constructor(e,t){super(),this.decryptDataRequests=/* @__PURE__ */new Map,this.encryptDataRequests=/* @__PURE__ */new Map,this.onWorkerMessage=e=>{var t,n;const{kind:i,data:s}=e.data;switch(i){case"error":if(Lr.error(s.error.message),s.uuid){const e=this.decryptDataRequests.get(s.uuid);if(null==e?void 0:e.reject){e.reject(s.error);break}const t=this.encryptDataRequests.get(s.uuid);if(null==t?void 0:t.reject){t.reject(s.error);break}}this.emit(el.EncryptionError,s.error,s.participantIdentity);break;case"initAck":s.enabled&&this.keyProvider.getKeys().forEach(e=>{this.postKey(e)});break;case"enable":if(s.enabled&&this.keyProvider.getKeys().forEach(e=>{this.postKey(e)}),this.encryptionEnabled!==s.enabled&&s.participantIdentity===(null===(t=this.room)||void 0===t?void 0:t.localParticipant.identity))this.emit(el.ParticipantEncryptionStatusChanged,s.enabled,this.room.localParticipant),this.encryptionEnabled=s.enabled;else if(s.participantIdentity){const e=null===(n=this.room)||void 0===n?void 0:n.getParticipantByIdentity(s.participantIdentity);if(!e)throw TypeError("couldn't set encryption status, participant not found".concat(s.participantIdentity));this.emit(el.ParticipantEncryptionStatusChanged,s.enabled,e)}break;case"ratchetKey":this.keyProvider.emit(Yd.KeyRatcheted,s.ratchetResult,s.participantIdentity,s.keyIndex);break;case"decryptDataResponse":const e=this.decryptDataRequests.get(s.uuid);(null==e?void 0:e.resolve)&&e.resolve(s);break;case"encryptDataResponse":const i=this.encryptDataRequests.get(s.uuid);(null==i?void 0:i.resolve)&&i.resolve(s)}},this.onWorkerError=e=>{Lr.error("e2ee worker encountered an error:",{error:e.error}),this.emit(el.EncryptionError,e.error,void 0)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1,this.dataChannelEncryptionEnabled=t}get isEnabled(){return this.encryptionEnabled}get isDataChannelEncryptionEnabled(){return this.isEnabled&&this.dataChannelEncryptionEnabled}setup(e){if(!ol())throw new bc("tried to setup end-to-end encryption on an unsupported browser");if(Lr.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:Dr.getLevel()}};this.worker&&(Lr.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(e,t){Lr.debug("set e2ee to ".concat(e," for participant ").concat(t)),this.postEnable(e,t)}setSifTrailer(e){e&&0!==e.length?this.postSifTrailer(e):Lr.warn("ignoring server sent trailer as it's empty")}setupEngine(e){e.on(mc.RTPVideoMapUpdate,e=>{this.postRTPMap(e)})}setupEventListeners(e,t){e.on(lc.TrackPublished,(e,t)=>this.setParticipantCryptorEnabled(e.trackInfo.encryption!==Es.NONE,t.identity)),e.on(lc.ConnectionStateChanged,t=>{t===Yu.Connected&&e.remoteParticipants.forEach(e=>{e.trackPublications.forEach(t=>{this.setParticipantCryptorEnabled(t.trackInfo.encryption!==Es.NONE,e.identity)})})}).on(lc.TrackUnsubscribed,(e,t,n)=>{var i;const s={kind:"removeTransform",data:{participantIdentity:n.identity,trackId:e.mediaStreamID}};null===(i=this.worker)||void 0===i||i.postMessage(s)}).on(lc.TrackSubscribed,(e,t,n)=>{this.setupE2EEReceiver(e,n.identity,t.trackInfo)}).on(lc.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");t.getKeys().forEach(e=>{this.postKey(e)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(hc.LocalSenderCreated,(e,t)=>Nr(this,void 0,void 0,function*(){this.setupE2EESender(t,e)})),e.localParticipant.on(hc.LocalTrackPublished,e=>{if(!Bd(e.track)||!pd())return;const t={kind:"updateCodec",data:{trackId:e.track.mediaStreamID,codec:Jc(e.trackInfo.codecs[0].mimeType),participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(t)}),t.on(Yd.SetKey,e=>this.postKey(e)).on(Yd.RatchetRequest,(e,t)=>this.postRatchetRequest(e,t))}encryptData(e){return Nr(this,void 0,void 0,function*(){if(!this.worker)throw Error("could not encrypt data, worker is missing");const t=crypto.randomUUID(),n={kind:"encryptDataRequest",data:{uuid:t,payload:e,participantIdentity:this.room.localParticipant.identity}},i=new Od;return i.onFinally=()=>{this.encryptDataRequests.delete(t)},this.encryptDataRequests.set(t,i),this.worker.postMessage(n),i.promise})}handleEncryptedData(e,t,n,i){if(!this.worker)throw Error("could not handle encrypted data, worker is missing");const s=crypto.randomUUID(),o={kind:"decryptDataRequest",data:{uuid:s,payload:e,iv:t,participantIdentity:n,keyIndex:i}},r=new Od;return r.onFinally=()=>{this.decryptDataRequests.delete(s)},this.decryptDataRequests.set(s,r),this.worker.postMessage(o),r.promise}postRatchetRequest(e,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const n={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:t}};this.worker.postMessage(n)}postKey(e){let{key:t,participantIdentity:n,keyIndex:i}=e;var s;if(!this.worker)throw Error("could not set key, worker is missing");const o={kind:"setKey",data:{participantIdentity:n,isPublisher:n===(null===(s=this.room)||void 0===s?void 0:s.localParticipant.identity),key:t,keyIndex:i}};this.worker.postMessage(o)}postEnable(e,t){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");{const n={kind:"enable",data:{enabled:e,participantIdentity:t}};this.worker.postMessage(n)}}postRTPMap(e){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(null===(t=this.room)||void 0===t?void 0:t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const n={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(n)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(t)}setupE2EEReceiver(e,t,n){if(e.receiver){if(!(null==n?void 0:n.mimeType)||""===n.mimeType)throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,t,"video"===e.kind?Jc(n.mimeType):void 0)}}setupE2EESender(e,t){Fd(e)&&t?this.handleSender(t,e.mediaStreamID,void 0):t||Lr.warn("early return because sender is not ready")}handleReceiver(e,t,n,i){return Nr(this,void 0,void 0,function*(){if(this.worker){if(rl()&&!ud()){const s={kind:"decode",participantIdentity:n,trackId:t,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,s)}else{if(Qd in e&&i){const e={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:n}};return void this.worker.postMessage(e)}let s=e.writableStream,o=e.readableStream;if(!s||!o){const t=e.createEncodedStreams();e.writableStream=t.writable,s=t.writable,e.readableStream=t.readable,o=t.readable}const r={kind:"decode",data:{readableStream:o,writableStream:s,trackId:t,codec:i,participantIdentity:n,isReuse:Qd in e}};this.worker.postMessage(r,[o,s])}e[Qd]=!0}})}handleSender(e,t,n){var i;if(!(Qd in e)&&this.worker){if(!(null===(i=this.room)||void 0===i?void 0:i.localParticipant.identity)||""===this.room.localParticipant.identity)throw TypeError("local identity needs to be known in order to set up encrypted sender");if(rl()&&!ud()){Lr.info("initialize script transform");const i={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:n};e.transform=new RTCRtpScriptTransform(this.worker,i)}else{Lr.info("initialize encoded streams");const i=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:i.readable,writableStream:i.writable,codec:n,trackId:t,participantIdentity:this.room.localParticipant.identity,isReuse:!1}};this.worker.postMessage(s,[i.readable,i.writable])}e[Qd]=!0}}}class cl{constructor(){this.failedConnectionAttempts=/* @__PURE__ */new Map,this.backOffPromises=/* @__PURE__ */new Map}static getInstance(){return this._instance||(this._instance=new cl),this._instance}addFailedConnectionAttempt(e){var t;const n=_d(new URL(e));if(!n)return;let i=null!==(t=this.failedConnectionAttempts.get(n))&&void 0!==t?t:0;this.failedConnectionAttempts.set(n,i+1),this.backOffPromises.set(n,od(Math.min(500*Math.pow(2,i),15e3)))}getBackOffPromise(e){const t=new URL(e),n=t&&_d(t);return n&&this.backOffPromises.get(n)||Promise.resolve()}resetFailedConnectionAttempts(e){const t=new URL(e),n=t&&_d(t);n&&(this.failedConnectionAttempts.set(n,0),this.backOffPromises.set(n,Promise.resolve()))}resetAll(){this.backOffPromises.clear(),this.failedConnectionAttempts.clear()}}cl._instance=null;const dl="default";class ll{constructor(){this._previousDevices=[]}static getInstance(){return void 0===this.instance&&(this.instance=new ll),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i;if((null===(i=ll.userMediaPromiseMap)||void 0===i?void 0:i.size)>0){Lr.debug("awaiting getUserMedia promise");try{e?yield ll.userMediaPromiseMap.get(e):yield Promise.all(ll.userMediaPromiseMap.values())}catch(ep){Lr.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(n&&(!hd()||!t.hasDeviceInUse(e))){if(0===s.filter(t=>t.kind===e).length||s.some(t=>{const n=""===t.label,i=!e||t.kind===e;return n&&i})){const t={video:"audioinput"!==e&&"audiooutput"!==e,audio:"videoinput"!==e&&{deviceId:{ideal:"default"}}},n=yield navigator.mediaDevices.getUserMedia(t);s=yield navigator.mediaDevices.enumerateDevices(),n.getTracks().forEach(e=>{e.stop()})}}return t._previousDevices=s,e&&(s=s.filter(t=>t.kind===e)),s}()})}normalizeDeviceId(e,t,n){return Nr(this,void 0,void 0,function*(){if(t!==dl)return t;const i=yield this.getDevices(e),s=i.find(e=>e.deviceId===dl);if(!s)return void Lr.warn("could not reliably determine default device");const o=i.find(e=>e.deviceId!==dl&&e.groupId===(null!=n?n:s.groupId));if(o)return null==o?void 0:o.deviceId;Lr.warn("could not reliably determine default device")})}hasDeviceInUse(e){return e?ll.userMediaPromiseMap.has(e):ll.userMediaPromiseMap.size>0}}var ul,hl;ll.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],ll.userMediaPromiseMap=/* @__PURE__ */new Map,(hl=ul||(ul={}))[hl.WAITING=0]="WAITING",hl[hl.RUNNING=1]="RUNNING",hl[hl.COMPLETED=2]="COMPLETED";class pl{constructor(){this.pendingTasks=/* @__PURE__ */new Map,this.taskMutex=new Cn,this.nextTaskIndex=0}run(e){return Nr(this,void 0,void 0,function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:ul.WAITING};this.pendingTasks.set(t.id,t);const n=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=ul.RUNNING,yield e()}finally{t.status=ul.COMPLETED,this.pendingTasks.delete(t.id),n()}})}flush(){return Nr(this,void 0,void 0,function*(){return this.run(()=>Nr(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}class ml{get readyState(){return this.ws.readyState}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,i;if(null===(n=t.signal)||void 0===n?void 0:n.aborted)throw new DOMException("This operation was aborted","AbortError");this.url=e;const s=new WebSocket(e,null!==(i=t.protocols)&&void 0!==i?i:[]);s.binaryType="arraybuffer",this.ws=s;const o=function(){let{closeCode:e,reason:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s.close(e,t)};this.opened=new $a((e,t)=>{const n=()=>{t(_c.websocket("Encountered websocket error during connection establishment"))};s.onopen=()=>{e({readable:new ReadableStream({start(e){s.onmessage=t=>{let{data:n}=t;return e.enqueue(n)},s.onerror=t=>e.error(t)},cancel:o}),writable:new WritableStream({write(e){s.send(e)},abort(){s.close()},close:o}),protocol:s.protocol,extensions:s.extensions}),s.removeEventListener("error",n)},s.addEventListener("error",n)}),this.closed=new $a((e,t)=>{const n=()=>Nr(this,void 0,void 0,function*(){const n=new $a(e=>{s.readyState!==WebSocket.CLOSED&&s.addEventListener("close",t=>{e(t)},{once:!0})}),i=yield $a.race([od(250),n]);i?e(i):t(_c.websocket("Encountered unspecified websocket error without a timely close event"))});s.onclose=t=>{let{code:i,reason:o}=t;e({closeCode:i,reason:o}),s.removeEventListener("error",n)},s.addEventListener("error",n)}),t.signal&&(t.signal.onabort=()=>s.close()),this.close=o}}const gl=["syncState","trickle","offer","answer","simulate","leave"];var vl,fl;(fl=vl||(vl={}))[fl.CONNECTING=0]="CONNECTING",fl[fl.CONNECTED=1]="CONNECTED",fl[fl.RECONNECTING=2]="RECONNECTING",fl[fl.DISCONNECTING=3]="DISCONNECTING",fl[fl.DISCONNECTED=4]="DISCONNECTED";class _l{get currentState(){return this.state}get isDisconnected(){return this.state===vl.DISCONNECTING||this.state===vl.DISCONNECTED}get isEstablishingConnection(){return this.state===vl.CONNECTING||this.state===vl.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;this.rtt=0,this.state=vl.DISCONNECTED,this.log=Lr,this._requestId=0,this.useV0SignalPath=!1,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0,this.onMediaSectionsRequirement=void 0},this.log=Or(null!==(n=t.loggerName)&&void 0!==n?n:Ir.Signal),this.loggerContextCb=t.loggerContextCb,this.useJSON=e,this.requestQueue=new pl,this.queuedRequests=[],this.closingLock=new Cn,this.connectionLock=new Cn,this.state=vl.DISCONNECTED}get logContext(){var e,t;return null!==(t=null===(e=this.loggerContextCb)||void 0===e?void 0:e.call(this))&&void 0!==t?t:{}}join(e,t,n,i){return Nr(this,arguments,void 0,function(e,t,n,i){var s=this;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function*(){s.state=vl.CONNECTING,s.options=n;return yield s.connect(e,t,n,i,o)}()})}reconnect(e,t,n,i){return Nr(this,void 0,void 0,function*(){if(!this.options)return void this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);this.state=vl.RECONNECTING,this.clearPingInterval();return yield this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:n,reconnectReason:i}),void 0,this.useV0SignalPath)})}connect(e,t,n,i){return Nr(this,arguments,void 0,function(e,t,n,i){var s=this;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function*(){const r=yield s.connectionLock.lock();s.connectOptions=n,s.useV0SignalPath=o;const a=function(){var e;const t=new Ys({sdk:Xs.JS,protocol:16,version:"2.17.2"});return vd()&&(t.os=null!==(e=yd())&&void 0!==e?e:""),t}(),c=o?function(e,t,n){var i;const s=new URLSearchParams;s.set("access_token",e),n.reconnect&&(s.set("reconnect","1"),n.sid&&s.set("sid",n.sid));s.set("auto_subscribe",n.autoSubscribe?"1":"0"),s.set("sdk",vd()?"reactnative":"js"),s.set("version",t.version),s.set("protocol",t.protocol.toString()),t.deviceModel&&s.set("device_model",t.deviceModel);t.os&&s.set("os",t.os);t.osVersion&&s.set("os_version",t.osVersion);t.browser&&s.set("browser",t.browser);t.browserVersion&&s.set("browser_version",t.browserVersion);n.adaptiveStream&&s.set("adaptive_stream","1");n.reconnectReason&&s.set("reconnect_reason",n.reconnectReason.toString());(null===(i=navigator.connection)||void 0===i?void 0:i.type)&&s.set("network",navigator.connection.type);return s}(t,a,n):function(e,t,n){const i=new URLSearchParams;i.set("access_token",e);const s=new vr({clientInfo:t,connectionSettings:new gr({autoSubscribe:!!n.autoSubscribe,adaptiveStream:!!n.adaptiveStream}),reconnect:!!n.reconnect,participantSid:n.sid?n.sid:void 0});n.reconnectReason&&(s.reconnectReason=n.reconnectReason);const o=new fr({joinRequest:s.toBinary()});return i.set("join_request",btoa(new TextDecoder("utf-8").decode(o.toBinary()))),i}(t,a,n),d=Gd(e,c,o).toString(),l=(u=d,Kd(new URL(xd(u)),"validate")).toString();var u;return new Promise((e,t)=>Nr(s,void 0,void 0,function*(){var s,o;try{let r=!1;const a=e=>Nr(this,void 0,void 0,function*(){if(r)return;r=!0;const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unknown reason";if(!(e instanceof AbortSignal))return t;const n=e.reason;switch(typeof n){case"string":return n;case"object":return n instanceof Error?n.message:t;default:return"toString"in n?n.toString():t}}(e instanceof Event?e.currentTarget:e,"Abort handler called");this.streamWriter&&!this.isDisconnected?this.sendLeave().then(()=>this.close(n)).catch(e=>{this.log.error(e),this.close()}):this.close(),c(),t(_c.cancelled(n))});null==i||i.addEventListener("abort",a);const c=()=>{clearTimeout(u),null==i||i.removeEventListener("abort",a)},u=setTimeout(()=>{a(_c.timeout("room connection has timed out (signal)"))},n.websocketTimeout),h=(e,t)=>{this.handleSignalConnected(e,u,t)},p=new URL(d);p.searchParams.has("access_token")&&p.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(p),Object.assign({reconnect:n.reconnect,reconnectReason:n.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new ml(d);try{this.ws.closed.then(e=>{var n;this.isEstablishingConnection&&t(_c.internal("Websocket got closed during a (re)connection attempt: ".concat(e.reason))),1e3!==e.closeCode&&(this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:e.reason,code:e.closeCode,wasClean:1e3===e.closeCode,state:this.state})),this.state===vl.CONNECTED&&this.handleOnClose(null!==(n=e.reason)&&void 0!==n?n:"Unexpected WS error"))}).catch(e=>{this.isEstablishingConnection&&t(_c.internal("Websocket error during a (re)connection attempt: ".concat(e)))});const i=yield this.ws.opened.catch(e=>Nr(this,void 0,void 0,function*(){if(this.state!==vl.CONNECTED){this.state=vl.DISCONNECTED,clearTimeout(u);const n=yield this.handleConnectionError(e,l);return void t(n)}this.handleWSError(e),t(e)}));if(clearTimeout(u),!i)return;const r=i.readable.getReader();this.streamWriter=i.writable.getWriter();const a=yield r.read();if(r.releaseLock(),!a.value)throw _c.internal("no message received as first message");const c=$d(a.value),d=this.validateFirstMessage(c,null!==(s=n.reconnect)&&void 0!==s&&s);if(!d.isValid)return void t(d.error);"join"===(null===(o=c.message)||void 0===o?void 0:o.case)&&(this.pingTimeoutDuration=c.message.value.pingTimeout,this.pingIntervalDuration=c.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})));h(i,d.shouldProcessFirstMessage?c:void 0),e(d.response)}catch(ep){t(ep)}finally{c()}}finally{r()}}))}()})}startReadingLoop(e,t){return Nr(this,void 0,void 0,function*(){for(t&&this.handleSignalResponse(t);;){this.signalLatency&&(yield od(this.signalLatency));const{done:t,value:n}=yield e.read();if(t)break;const i=$d(n);this.handleSignalResponse(i)}})}close(){return Nr(this,arguments,void 0,function(){var e=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Close method called on signal client";return function*(){if([vl.DISCONNECTING||vl.DISCONNECTED].includes(e.state))return void e.log.debug("ignoring signal close as it's already in disconnecting state");const i=yield e.closingLock.lock();try{if(e.clearPingInterval(),t&&(e.state=vl.DISCONNECTING),e.ws){e.ws.close({closeCode:1e3,reason:n});const t=e.ws.closed;e.ws=void 0,e.streamWriter=void 0,yield Promise.race([t,od(250)])}}catch(ep){e.log.debug("websocket error while closing",Object.assign(Object.assign({},e.logContext),{error:ep}))}finally{t&&(e.state=vl.DISCONNECTED),i()}}()})}sendOffer(e,t){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:yl(e,t)})}sendAnswer(e,t){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:yl(e,t)})}sendIceCandidate(e,t){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new To({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new So({sid:e,muted:t})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,t){return Nr(this,arguments,void 0,function(e,t){var n=this;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const s=n.getNextRequestId();return yield n.sendRequest({case:"updateMetadata",value:new qo({requestId:s,metadata:e,name:t,attributes:i})}),s}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,t){return this.sendRequest({case:"updateLayers",value:new Bo({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new er({allParticipants:e,trackPermissions:t})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:Hn.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new ar({timestamp:Hn.parse(Date.now()),rtt:Hn.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new No({trackSid:e,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new Fo({reason:gs.CLIENT_INITIATED,action:jo.DISCONNECT})})}sendRequest(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){const i=!n&&!function(e){const t=gl.indexOf(e.case)>=0;return Lr.trace("request allowed to bypass queue:",{canPass:t,req:e}),t}(e);if(i&&t.state===vl.RECONNECTING)return void t.queuedRequests.push(()=>Nr(t,void 0,void 0,function*(){yield this.sendRequest(e,!0)}));if(n||(yield t.requestQueue.flush()),t.signalLatency&&(yield od(t.signalLatency)),t.isDisconnected)return void t.log.debug("skipping signal request (type: ".concat(e.case,") - SignalClient disconnected"));if(!t.streamWriter)return void t.log.error("cannot send signal request before connected, type: ".concat(null==e?void 0:e.case),t.logContext);const s=new mo({message:e});try{t.useJSON?yield t.streamWriter.write(s.toJsonString()):yield t.streamWriter.write(s.toBinary())}catch(ep){t.log.error("error sending signal message",Object.assign(Object.assign({},t.logContext),{error:ep}))}}()})}handleSignalResponse(e){var t,n;const i=e.message;if(null==i)return void this.log.debug("received unsupported message",this.logContext);let s=!1;if("answer"===i.case){const e=bl(i.value);this.onAnswer&&this.onAnswer(e,i.value.id,i.value.midToTrackId)}else if("offer"===i.case){const e=bl(i.value);this.onOffer&&this.onOffer(e,i.value.id,i.value.midToTrackId)}else if("trickle"===i.case){const e=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(e,i.value.target)}else"update"===i.case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(t=i.value.participants)&&void 0!==t?t:[]):"trackPublished"===i.case?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):"speakersChanged"===i.case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(n=i.value.speakers)&&void 0!==n?n:[]):"leave"===i.case?this.onLeave&&this.onLeave(i.value):"mute"===i.case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):"roomUpdate"===i.case?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):"connectionQuality"===i.case?this.onConnectionQuality&&this.onConnectionQuality(i.value):"streamStateUpdate"===i.case?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):"subscribedQualityUpdate"===i.case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):"subscriptionPermissionUpdate"===i.case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):"refreshToken"===i.case?this.onTokenRefresh&&this.onTokenRefresh(i.value):"trackUnpublished"===i.case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):"subscriptionResponse"===i.case?this.onSubscriptionError&&this.onSubscriptionError(i.value):"pong"===i.case||("pongResp"===i.case?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),s=!0):"requestResponse"===i.case?this.onRequestResponse&&this.onRequestResponse(i.value):"trackSubscribed"===i.case?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):"roomMoved"===i.case?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):"mediaSectionsRequirement"===i.case?this.onMediaSectionsRequirement&&this.onMediaSectionsRequirement(i.value):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));s||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return Nr(this,void 0,void 0,function*(){if(this.state===vl.DISCONNECTED)return;const t=this.onClose;yield this.close(void 0,e),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),t&&t(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=Ic.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*this.pingTimeoutDuration).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},1e3*this.pingTimeoutDuration):this.log.warn("ping timeout duration not set",this.logContext)}clearPingTimeout(){this.pingTimeout&&Ic.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=Ic.setInterval(()=>{this.sendPing()},1e3*this.pingIntervalDuration)):this.log.warn("ping interval duration not set",this.logContext)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Ic.clearInterval(this.pingInterval)}handleSignalConnected(e,t,n){this.state=vl.CONNECTED,clearTimeout(t),this.startPingInterval(),this.startReadingLoop(e.readable.getReader(),n)}validateFirstMessage(e,t){var n,i,s,o,r;return"join"===(null===(n=e.message)||void 0===n?void 0:n.case)?{isValid:!0,response:e.message.value}:this.state===vl.RECONNECTING&&"leave"!==(null===(i=e.message)||void 0===i?void 0:i.case)?"reconnect"===(null===(s=e.message)||void 0===s?void 0:s.case)?{isValid:!0,response:e.message.value}:(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),{isValid:!0,response:void 0,shouldProcessFirstMessage:!0}):this.isEstablishingConnection&&"leave"===(null===(o=e.message)||void 0===o?void 0:o.case)?{isValid:!1,error:_c.leaveRequest("Received leave request while trying to (re)connect",e.message.value.reason)}:t?{isValid:!1,error:_c.internal("Unexpected first message")}:{isValid:!1,error:_c.internal("did not receive join response, got ".concat(null===(r=e.message)||void 0===r?void 0:r.case," instead"))}}handleConnectionError(e,t){return Nr(this,void 0,void 0,function*(){try{const n=yield fetch(t);switch(n.status){case 404:return _c.serviceNotFound("v1 RTC path not found. Consider upgrading your LiveKit server version","v0-rtc");case 401:case 403:const e=yield n.text();return _c.notAllowed(e,n.status)}return e instanceof _c?e:_c.internal("Encountered unknown websocket error during connection: ".concat(e),{status:n.status,statusText:n.statusText})}catch(ep){return ep instanceof _c?ep:_c.serverUnreachable(ep instanceof Error?ep.message:"server was not reachable")}})}}function bl(e){const t={type:"offer",sdp:e.sdp};switch(e.type){case"answer":case"offer":case"pranswer":case"rollback":t.type=e.type}return t}function yl(e,t){return new Mo({sdp:e.sdp,type:e.type,id:t})}class kl{constructor(){this.buffer=[],this._totalSize=0}push(e){this.buffer.push(e),this._totalSize+=e.data.byteLength}pop(){const e=this.buffer.shift();return e&&(this._totalSize-=e.data.byteLength),e}getAll(){return this.buffer.slice()}popToSequence(e){for(;this.buffer.length>0;){if(!(this.buffer[0].sequence<=e))break;this.pop()}}alignBufferedAmount(e){for(;this.buffer.length>0;){const t=this.buffer[0];if(this._totalSize-t.data.byteLength<=e)break;this.pop()}}get length(){return this.buffer.length}}class Cl{constructor(e){this._map=/* @__PURE__ */new Map,this._lastCleanup=0,this.ttl=e}set(e,t){const n=Date.now();n-this._lastCleanup>this.ttl/2&&this.cleanup();const i=n+this.ttl;return this._map.set(e,{value:t,expiresAt:i}),this}get(e){const t=this._map.get(e);if(t){if(!(t.expiresAt<Date.now()))return t.value;this._map.delete(e)}}has(e){const t=this._map.get(e);return!!t&&(!(t.expiresAt<Date.now())||(this._map.delete(e),!1))}delete(e){return this._map.delete(e)}clear(){this._map.clear()}cleanup(){const e=Date.now();for(const[t,n]of this._map.entries())n.expiresAt<e&&this._map.delete(t);this._lastCleanup=e}get size(){return this.cleanup(),this._map.size}forEach(e){this.cleanup();for(const[t,n]of this._map.entries())n.expiresAt>=Date.now()&&e(n.value,t,this.asValueMap())}map(e){this.cleanup();const t=[],n=this.asValueMap();for(const[i,s]of n.entries())t.push(e(s,i,n));return t}asValueMap(){const e=/* @__PURE__ */new Map;for(const[t,n]of this._map.entries())n.expiresAt>=Date.now()&&e.set(t,n.value);return e}}var wl,Tl,Sl,El,Pl,Il={},Rl={},Ml={exports:{}};function Ll(){if(wl)return Ml.exports;wl=1;var e=Ml.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(e).forEach(function(t){e[t].forEach(function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")})}),Ml.exports}function Ol(){return Tl||(Tl=1,function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var s=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:s&&!n[e.name]&&(n[e.name]={});var o=e.push?{}:s?n[e.name]:n;!function(e,n,i,s){if(s&&!i)n[s]=t(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(n[i[o]]=t(e[o+1]))}(i.match(e.reg),o,e.names,e.name),e.push&&n[e.push].push(o)},i=Ll(),s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(s).forEach(function(e){var t=e[0],s=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),r=o[o.length-1]);for(var a=0;a<(i[t]||[]).length;a+=1){var c=i[t][a];if(c.reg.test(s))return n(c,r,s)}}),t.media=o,t};var o=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),s=0;s<i.length;s+=3)n.push({component:i[s],ip:i[s+1],port:i[s+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map(function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})})},e.parseSimulcastStreamList=function(e){return e.split(";").map(function(e){return e.split(",").map(function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}})})}}(Rl)),Rl}function Dl(){if(El)return Sl;El=1;var e=Ll(),t=/%[sdv%]/g,n=function(e){var n=1,i=arguments,s=i.length;return e.replace(t,function(e){if(n>=s)return e;var t=i[n];switch(n+=1,e){case"%%":return"%";case"%s":return String(t);case"%d":return Number(t);case"%v":return""}})},i=function(e,t,i){var s=[e+"="+(t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format)];if(t.names)for(var o=0;o<t.names.length;o+=1){var r=t.names[o];t.name?s.push(i[t.name][r]):s.push(i[t.names[o]])}else s.push(i[t.name]);return n.apply(null,s)},s=["v","o","s","i","u","e","p","c","b","t","r","z","a"],o=["i","c","b","a"];return Sl=function(t,n){n=n||{},null==t.version&&(t.version=0),null==t.name&&(t.name=" "),t.media.forEach(function(e){null==e.payloads&&(e.payloads="")});var r=n.outerOrder||s,a=n.innerOrder||o,c=[];return r.forEach(function(n){e[n].forEach(function(e){e.name in t&&null!=t[e.name]?c.push(i(n,e,t)):e.push in t&&null!=t[e.push]&&t[e.push].forEach(function(t){c.push(i(n,e,t))})})}),t.media.forEach(function(t){c.push(i("m",e.m[0],t)),a.forEach(function(n){e[n].forEach(function(e){e.name in t&&null!=t[e.name]?c.push(i(n,e,t)):e.push in t&&null!=t[e.push]&&t[e.push].forEach(function(t){c.push(i(n,e,t))})})})}),c.join("\r\n")+"\r\n"}}var xl=function(){if(Pl)return Il;Pl=1;var e=Ol(),t=Dl(),n=Ll();return Il.grammar=n,Il.write=t,Il.parse=e.parse,Il.parseParams=e.parseParams,Il.parseFmtpConfig=e.parseFmtpConfig,Il.parsePayloads=e.parsePayloads,Il.parseRemoteCandidates=e.parseRemoteCandidates,Il.parseImageAttributes=e.parseImageAttributes,Il.parseSimulcastStreamList=e.parseSimulcastStreamList,Il}();function Al(e,t,n){var i,s,o;void 0===t&&(t=50),void 0===n&&(n={});var r=null!=(i=n.isImmediate)&&i,a=null!=(s=n.callback)&&s,c=n.maxWait,d=Date.now(),l=[];var u=function(){var n=[].slice.call(arguments),i=this;return new Promise(function(s,u){var h=r&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout(function(){if(o=void 0,d=Date.now(),!r){var t=e.apply(i,n);a&&a(t),l.forEach(function(e){return(0,e.resolve)(t)}),l=[]}},function(){if(void 0!==c){var e=Date.now()-d;if(e+t>=c)return c-e}return t}()),h){var p=e.apply(i,n);return a&&a(p),s(p)}l.push({resolve:s,reject:u})})};return u.cancel=function(e){void 0!==o&&clearTimeout(o),l.forEach(function(t){return(0,t.reject)(e)}),l=[]},u}const Nl="negotiationStarted",Ul="negotiationComplete",Fl="rtpVideoPayloadTypes";class jl extends qr.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;super(),this.log=Lr,this.ddExtID=0,this.latestOfferId=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=Al(e=>Nr(this,void 0,void 0,function*(){this.emit(Nl);try{yield this.createAndSendOffer()}catch(ep){if(!e)throw ep;e(ep)}}),20),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=Or(null!==(n=t.loggerName)&&void 0!==n?n:Ir.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC(),this.offerLock=new Cn}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=e=>{var t;e.candidate&&(null===(t=this.onIceCandidate)||void 0===t||t.call(this,e.candidate))},e.onicecandidateerror=e=>{var t;null===(t=this.onIceCandidateError)||void 0===t||t.call(this,e)},e.oniceconnectionstatechange=()=>{var t;null===(t=this.onIceConnectionStateChange)||void 0===t||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;null===(t=this.onSignalingStatechange)||void 0===t||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;null===(t=this.onConnectionStateChange)||void 0===t||t.call(this,e.connectionState)},e.ondatachannel=e=>{var t;null===(t=this.onDataChannel)||void 0===t||t.call(this,e)},e.ontrack=e=>{var t;null===(t=this.onTrack)||void 0===t||t.call(this,e)},e}get logContext(){var e,t;return Object.assign({},null===(t=(e=this.loggerOptions).loggerContextCb)||void 0===t?void 0:t.call(e))}get isICEConnected(){return null!==this._pc&&("connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState)}addIceCandidate(e){return Nr(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e,t){return Nr(this,void 0,void 0,function*(){var n;if("answer"===e.type&&this.latestOfferId>0&&t>0&&t!==this.latestOfferId)return this.log.warn("ignoring answer for old offer",Object.assign(Object.assign({},this.logContext),{offerId:t,latestOfferId:this.latestOfferId})),!1;let i;if("offer"===e.type){let{stereoMids:t,nackMids:n}=function(e){var t;const n=[],i=[],s=xl.parse(null!==(t=e.sdp)&&void 0!==t?t:"");let o=0;return s.media.forEach(e=>{var t;const s=Vl(e.mid);"audio"===e.type&&(e.rtp.some(e=>"opus"===e.codec&&(o=e.payload,!0)),(null===(t=e.rtcpFb)||void 0===t?void 0:t.some(e=>e.payload===o&&"nack"===e.type))&&i.push(s),e.fmtp.some(e=>e.payload===o&&(e.config.includes("sprop-stereo=1")&&n.push(s),!0)))}),{stereoMids:n,nackMids:i}}(e);this.remoteStereoMids=t,this.remoteNackMids=n}else if("answer"===e.type){const t=xl.parse(null!==(n=e.sdp)&&void 0!==n?n:"");t.media.forEach(e=>{const t=Vl(e.mid);"audio"===e.type&&this.trackBitrates.some(n=>{if(!n.transceiver||t!=n.transceiver.mid)return!1;let i=0;if(e.rtp.some(e=>e.codec.toUpperCase()===n.codec.toUpperCase()&&(i=e.payload,!0)),0===i)return!0;let s=!1;for(const t of e.fmtp)if(t.payload===i){t.config=t.config.split(";").filter(e=>!e.includes("maxaveragebitrate")).join(";"),n.maxbr>0&&(t.config+=";maxaveragebitrate=".concat(1e3*n.maxbr)),s=!0;break}return s||n.maxbr>0&&e.fmtp.push({payload:i,config:"maxaveragebitrate=".concat(1e3*n.maxbr)}),!0})}),i=xl.write(t)}if(yield this.setMungedSDP(e,i,!0),this.pendingCandidates.forEach(e=>{this.pc.addIceCandidate(e)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate)this.renegotiate=!1,yield this.createAndSendOffer();else if("answer"===e.type&&(this.emit(Ul),e.sdp)){xl.parse(e.sdp).media.forEach(e=>{"video"===e.type&&this.emit(Fl,e.rtp)})}return!0})}createAndSendOffer(e){return Nr(this,void 0,void 0,function*(){var t;const n=yield this.offerLock.lock();try{if(void 0===this.onOffer)return;if((null==e?void 0:e.iceRestart)&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&"have-local-offer"===this._pc.signalingState){const t=this._pc.remoteDescription;if(!(null==e?void 0:e.iceRestart)||!t)return this.renegotiate=!0,void this.log.debug("requesting renegotiation",Object.assign({},this.logContext));yield this._pc.setRemoteDescription(t)}else if(!this._pc||"closed"===this._pc.signalingState)return void this.log.warn("could not createOffer with closed peer connection",this.logContext);this.log.debug("starting to negotiate",this.logContext);const n=this.latestOfferId+1;this.latestOfferId=n;const i=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:i.sdp},this.logContext));const s=xl.parse(null!==(t=i.sdp)&&void 0!==t?t:"");if(s.media.forEach(e=>{ql(e),"audio"===e.type?Bl(e,["all"],[]):"video"===e.type&&this.trackBitrates.some(t=>{if(!e.msid||!t.cid||!e.msid.includes(t.cid))return!1;let n=0;if(e.rtp.some(e=>e.codec.toUpperCase()===t.codec.toUpperCase()&&(n=e.payload,!0)),0===n)return!0;if(cd(t.codec)&&!hd()&&this.ensureVideoDDExtensionForSVC(e,s),!cd(t.codec))return!0;const i=Math.round(.7*t.maxbr);for(const s of e.fmtp)if(s.payload===n){s.config.includes("x-google-start-bitrate")||(s.config+=";x-google-start-bitrate=".concat(i));break}return!0})}),this.latestOfferId>n)return void this.log.warn("latestOfferId mismatch",Object.assign(Object.assign({},this.logContext),{latestOfferId:this.latestOfferId,offerId:n}));yield this.setMungedSDP(i,xl.write(s)),this.onOffer(i,this.latestOfferId)}finally{n()}})}createAndSetAnswer(){return Nr(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),n=xl.parse(null!==(e=t.sdp)&&void 0!==e?e:"");return n.media.forEach(e=>{ql(e),"audio"===e.type&&Bl(e,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,xl.write(n)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTransceiverOfKind(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new Cc("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new Cc("PC closed, cannot configure");return null===(t=this._pc)||void 0===t?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(null===(e=this._pc)||void 0===e?void 0:e.removeTrack)}removeTrack(e){var t;return null===(t=this._pc)||void 0===t?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return null!==(t=null===(e=this._pc)||void 0===e?void 0:e.connectionState)&&void 0!==t?t:"closed"}getICEConnectionState(){var e,t;return null!==(t=null===(e=this._pc)||void 0===e?void 0:e.iceConnectionState)&&void 0!==t?t:"closed"}getSignallingState(){var e,t;return null!==(t=null===(e=this._pc)||void 0===e?void 0:e.signalingState)&&void 0!==t?t:"closed"}getTransceivers(){var e,t;return null!==(t=null===(e=this._pc)||void 0===e?void 0:e.getTransceivers())&&void 0!==t?t:[]}getSenders(){var e,t;return null!==(t=null===(e=this._pc)||void 0===e?void 0:e.getSenders())&&void 0!==t?t:[]}getLocalDescription(){var e;return null===(e=this._pc)||void 0===e?void 0:e.localDescription}getRemoteDescription(){var e;return null===(e=this.pc)||void 0===e?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return Nr(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const n=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map;if((yield this._pc.getStats()).forEach(e=>{switch(e.type){case"transport":t=e.selectedCandidatePairId;break;case"candidate-pair":""===t&&e.selected&&(t=e.id),n.set(e.id,e);break;case"remote-candidate":i.set(e.id,"".concat(e.address,":").concat(e.port))}}),""===t)return;const s=null===(e=n.get(t))||void 0===e?void 0:e.remoteCandidateId;return void 0!==s?i.get(s):void 0})}setMungedSDP(e,t,n){return Nr(this,void 0,void 0,function*(){if(t){const i=e.sdp;e.sdp=t;try{return this.log.debug("setting munged ".concat(n?"remote":"local"," description"),this.logContext),void(n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e))}catch(ep){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:ep,sdp:t})),e.sdp=i}}try{n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(ep){let i="unknown error";ep instanceof Error?i=ep.message:"string"==typeof ep&&(i=ep);const s={error:i,sdp:e.sdp};throw!n&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new wc(i)}})}ensureVideoDDExtensionForSVC(e,t){var n,i;if(!(null===(n=e.ext)||void 0===n?void 0:n.some(e=>e.uri===sd))){if(0===this.ddExtID){let e=0;t.media.forEach(t=>{var n;"video"===t.type&&(null===(n=t.ext)||void 0===n||n.forEach(t=>{t.value>e&&(e=t.value)}))}),this.ddExtID=e+1}null===(i=e.ext)||void 0===i||i.push({value:this.ddExtID,uri:sd})}}}function Bl(e,t,n){const i=Vl(e.mid);let s=0;e.rtp.some(e=>"opus"===e.codec&&(s=e.payload,!0)),s>0&&(e.rtcpFb||(e.rtcpFb=[]),n.includes(i)&&!e.rtcpFb.some(e=>e.payload===s&&"nack"===e.type)&&e.rtcpFb.push({payload:s,type:"nack"}),(t.includes(i)||1===t.length&&"all"===t[0])&&e.fmtp.some(e=>e.payload===s&&(e.config.includes("stereo=1")||(e.config+=";stereo=1"),!0)))}function ql(e){if(e.connection){const t=e.connection.ip.indexOf(":")>=0;(4===e.connection.version&&t||6===e.connection.version&&!t)&&(e.connection.ip="0.0.0.0",e.connection.version=4)}}function Vl(e){return"number"==typeof e?e.toFixed(0):e}const Wl="vp8",Hl={audioPreset:Ac.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:jc.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Wl,backupCodec:!0,preConnectBuffer:!1},zl={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},Gl={deviceId:{ideal:"default"},resolution:Uc.h720.resolution},Jl={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(e){this._retryDelays=void 0!==e?[...e]:Ar}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+1e3*Math.random()}},disconnectOnPageLeave:!0,webAudioMix:!1,singlePeerConnection:!0},Kl={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var $l,Ql;(Ql=$l||($l={}))[Ql.NEW=0]="NEW",Ql[Ql.CONNECTING=1]="CONNECTING",Ql[Ql.CONNECTED=2]="CONNECTED",Ql[Ql.FAILED=3]="FAILED",Ql[Ql.CLOSING=4]="CLOSING",Ql[Ql.CLOSED=5]="CLOSED";class Yl{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}get mode(){return this._mode}constructor(e,t,n){var i;this.peerConnectionTimeout=Kl.peerConnectionTimeout,this.log=Lr,this.updateState=()=>{var e,t;const n=this.state,i=this.requiredTransports.map(e=>e.getConnectionState());i.every(e=>"connected"===e)?this.state=$l.CONNECTED:i.some(e=>"failed"===e)?this.state=$l.FAILED:i.some(e=>"connecting"===e)?this.state=$l.CONNECTING:i.every(e=>"closed"===e)?this.state=$l.CLOSED:i.some(e=>"closed"===e)?this.state=$l.CLOSING:i.every(e=>"new"===e)&&(this.state=$l.NEW),n!==this.state&&(this.log.debug("pc state change: from ".concat($l[n]," to ").concat($l[this.state]),this.logContext),null===(e=this.onStateChange)||void 0===e||e.call(this,this.state,this.publisher.getConnectionState(),null===(t=this.subscriber)||void 0===t?void 0:t.getConnectionState()))},this.log=Or(null!==(i=n.loggerName)&&void 0!==i?i:Ir.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired="subscriber-primary"!==t,this.isSubscriberConnectionRequired="subscriber-primary"===t,this.publisher=new jl(e,n),this._mode=t,"publisher-only"!==t&&(this.subscriber=new jl(e,n),this.subscriber.onConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.subscriber.onIceCandidate=e=>{var t;null===(t=this.onIceCandidate)||void 0===t||t.call(this,e,uo.SUBSCRIBER)},this.subscriber.onDataChannel=e=>{var t;null===(t=this.onDataChannel)||void 0===t||t.call(this,e)},this.subscriber.onTrack=e=>{var t;null===(t=this.onTrack)||void 0===t||t.call(this,e)}),this.publisher.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=e=>{var t;null===(t=this.onIceCandidate)||void 0===t||t.call(this,e,uo.PUBLISHER)},this.publisher.onTrack=e=>{var t;null===(t=this.onTrack)||void 0===t||t.call(this,e)},this.publisher.onOffer=(e,t)=>{var n;null===(n=this.onPublisherOffer)||void 0===n||n.call(this,e,t)},this.state=$l.NEW,this.connectionLock=new Cn,this.remoteOfferLock=new Cn}get logContext(){var e,t;return Object.assign({},null===(t=(e=this.loggerOptions).loggerContextCb)||void 0===t?void 0:t.call(e))}requirePublisher(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isPublisherConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e,t){return this.publisher.setRemoteDescription(e,t)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return Nr(this,void 0,void 0,function*(){var e;if(this.publisher&&"closed"!==this.publisher.getSignallingState()){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}catch(ep){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:ep}))}}yield Promise.all([this.publisher.close(),null===(e=this.subscriber)||void 0===e?void 0:e.close()]),this.updateState()})}triggerIceRestart(){return Nr(this,void 0,void 0,function*(){this.subscriber&&(this.subscriber.restartingIce=!0),this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return Nr(this,void 0,void 0,function*(){var n;t===uo.PUBLISHER?yield this.publisher.addIceCandidate(e):yield null===(n=this.subscriber)||void 0===n?void 0:n.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e,t){return Nr(this,void 0,void 0,function*(){var n,i,s;this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:null===(n=this.subscriber)||void 0===n?void 0:n.getSignallingState().toString()}));const o=yield this.remoteOfferLock.lock();try{if(!(yield null===(i=this.subscriber)||void 0===i?void 0:i.setRemoteDescription(e,t)))return;return yield null===(s=this.subscriber)||void 0===s?void 0:s.createAndSetAnswer()}finally{o()}})}updateConfiguration(e,t){var n;this.publisher.setConfiguration(e),null===(n=this.subscriber)||void 0===n||n.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return Nr(this,void 0,void 0,function*(){var n;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&"connected"!==this.publisher.getConnectionState()&&"connecting"!==this.publisher.getConnectionState()&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all(null===(n=this.requiredTransports)||void 0===n?void 0:n.map(n=>this.ensureTransportConnected(n,e,t)))}finally{i()}})}negotiate(e){return Nr(this,void 0,void 0,function*(){return new $a((t,n)=>Nr(this,void 0,void 0,function*(){let i=setTimeout(()=>{n(new wc("negotiation timed out"))},this.peerConnectionTimeout);const s=()=>{clearTimeout(i),this.publisher.off(Nl,r),e.signal.removeEventListener("abort",o)},o=()=>{s(),n(new wc("negotiation aborted"))},r=()=>{e.signal.aborted||(clearTimeout(i),i=setTimeout(()=>{s(),n(new wc("negotiation timed out"))},this.peerConnectionTimeout))};e.signal.addEventListener("abort",o),this.publisher.on(Nl,r),this.publisher.once(Ul,()=>{s(),t()}),yield this.publisher.negotiate(e=>{s(),e instanceof Error?n(e):n(new Error(String(e)))})}))})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTransceiverOfKind(e,t){return this.publisher.addTransceiverOfKind(e,t)}getMidForReceiver(e){const t=(this.subscriber?this.subscriber.getTransceivers():this.publisher.getTransceivers()).find(t=>t.receiver===e);return null==t?void 0:t.mid}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===uo.PUBLISHER||e===uo.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&this.subscriber&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return Nr(this,arguments,void 0,function(e,t){var n=this;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.peerConnectionTimeout;return function*(){if("connected"!==e.getConnectionState())return new Promise((e,s)=>Nr(n,void 0,void 0,function*(){const n=()=>{this.log.warn("abort transport connection",this.logContext),Ic.clearTimeout(o),s(_c.cancelled("room connection has been cancelled"))};(null==t?void 0:t.signal.aborted)&&n(),null==t||t.signal.addEventListener("abort",n);const o=Ic.setTimeout(()=>{null==t||t.signal.removeEventListener("abort",n),s(_c.internal("could not establish pc connection"))},i);for(;this.state!==$l.CONNECTED;)if(yield od(50),null==t?void 0:t.signal.aborted)return void s(_c.cancelled("room connection has been cancelled"));Ic.clearTimeout(o),null==t||t.signal.removeEventListener("abort",n),e()}))}()})}}class Xl{static fetchRegionSettings(e,t,n){return Nr(this,void 0,void 0,function*(){const i=yield Xl.fetchLock.lock();try{const i=yield fetch("".concat(function(e){return"".concat(e.protocol.replace("ws","http"),"//").concat(e.host,"/settings")}(e),"/regions"),{headers:{authorization:"Bearer ".concat(t)},signal:n});if(i.ok){const e=function(e){var t;const n=e.get("Cache-Control");if(n){const e=null===(t=n.match(/(?:^|[,\s])max-age=(\d+)/))||void 0===t?void 0:t[1];if(e)return parseInt(e,10)}}(i.headers),t=e?1e3*e:5e3;return{regionSettings:yield i.json(),updatedAtInMs:Date.now(),maxAgeInMs:t}}throw 401===i.status?_c.notAllowed("Could not fetch region settings: ".concat(i.statusText),i.status):_c.internal("Could not fetch region settings: ".concat(i.statusText))}catch(ep){throw ep instanceof _c?ep:(null==n?void 0:n.aborted)?_c.cancelled("Region fetching was aborted"):_c.serverUnreachable("Could not fetch region settings, ".concat(ep instanceof Error?"".concat(ep.name,": ").concat(ep.message):ep))}finally{i()}})}static scheduleRefetch(e,t,n){return Nr(this,void 0,void 0,function*(){const i=Xl.settingsTimeouts.get(e.hostname);clearTimeout(i),Xl.settingsTimeouts.set(e.hostname,setTimeout(()=>Nr(this,void 0,void 0,function*(){try{const n=yield Xl.fetchRegionSettings(e,t);Xl.updateCachedRegionSettings(e,t,n)}catch(i){if(i instanceof _c&&i.reason===sc.NotAllowed)return void Lr.debug("token is not valid, cancelling auto region refresh");Lr.debug("auto refetching of region settings failed",{error:i}),Xl.scheduleRefetch(e,t,n)}}),n))})}static updateCachedRegionSettings(e,t,n){Xl.cache.set(e.hostname,n),Xl.scheduleRefetch(e,t,n.maxAgeInMs)}static stopRefetch(e){const t=Xl.settingsTimeouts.get(e);t&&(clearTimeout(t),Xl.settingsTimeouts.delete(e))}static scheduleCleanup(e){let t=Xl.connectionTrackers.get(e);t&&(t.cleanupTimeout&&clearTimeout(t.cleanupTimeout),t.cleanupTimeout=setTimeout(()=>{const t=Xl.connectionTrackers.get(e);t&&0===t.connectionCount&&(Lr.debug("stopping region refetch after disconnect delay",{hostname:e}),Xl.stopRefetch(e)),t&&(t.cleanupTimeout=void 0)},3e4))}static cancelCleanup(e){const t=Xl.connectionTrackers.get(e);(null==t?void 0:t.cleanupTimeout)&&(clearTimeout(t.cleanupTimeout),t.cleanupTimeout=void 0)}notifyConnected(){const e=this.serverUrl.hostname;let t=Xl.connectionTrackers.get(e);t||(t={connectionCount:0},Xl.connectionTrackers.set(e,t)),t.connectionCount++,Xl.cancelCleanup(e)}notifyDisconnected(){const e=this.serverUrl.hostname,t=Xl.connectionTrackers.get(e);t&&(t.connectionCount=Math.max(0,t.connectionCount-1),0===t.connectionCount&&Xl.scheduleCleanup(e))}constructor(e,t){this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){this.token=e}isCloud(){return fd(this.serverUrl)}getServerUrl(){return this.serverUrl}fetchRegionSettings(e){return Nr(this,void 0,void 0,function*(){return Xl.fetchRegionSettings(this.serverUrl,this.token,e)})}getNextBestRegionUrl(e){return Nr(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");let t=Xl.cache.get(this.serverUrl.hostname);(!t||Date.now()-t.updatedAtInMs>t.maxAgeInMs)&&(t=yield this.fetchRegionSettings(e),Xl.updateCachedRegionSettings(this.serverUrl,this.token,t));const n=t.regionSettings.regions.filter(e=>!this.attemptedRegions.find(t=>t.url===e.url));if(n.length>0){const e=n[0];return this.attemptedRegions.push(e),Lr.debug("next region: ".concat(e.region)),e.url}return null})}resetAttempts(){this.attemptedRegions=[]}setServerReportedRegions(e){Xl.updateCachedRegionSettings(this.serverUrl,this.token,e)}}Xl.cache=/* @__PURE__ */new Map,Xl.settingsTimeouts=/* @__PURE__ */new Map,Xl.connectionTrackers=/* @__PURE__ */new Map,Xl.fetchLock=new Cn;class Zl extends Error{constructor(e,t,n){super(t),this.code=e,this.message=tu(t,Zl.MAX_MESSAGE_BYTES),this.data=n?tu(n,Zl.MAX_DATA_BYTES):void 0}static fromProto(e){return new Zl(e.code,e.message,e.data)}toProto(){return new Js({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new Zl(Zl.ErrorCode[e],Zl.ErrorMessage[e],t)}}Zl.MAX_MESSAGE_BYTES=256,Zl.MAX_DATA_BYTES=15360,Zl.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},Zl.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};function eu(e){return(new TextEncoder).encode(e).length}function tu(e,t){if(eu(e)<=t)return e;let n=0,i=e.length;const s=new TextEncoder;for(;n<i;){const o=Math.floor((n+i+1)/2);s.encode(e.slice(0,o)).length<=t?n=o:i=o-1}return e.slice(0,n)}const nu=2e3;function iu(e,t){if(!t)return 0;let n,i;return"bytesReceived"in e?(n=e.bytesReceived,i=t.bytesReceived):"bytesSent"in e&&(n=e.bytesSent,i=t.bytesSent),void 0===n||void 0===i||void 0===e.timestamp||void 0===t.timestamp?0:8*(n-i)*1e3/(e.timestamp-t.timestamp)}const su="undefined"!=typeof MediaRecorder;const ou=su?MediaRecorder:class{constructor(){throw new Error("MediaRecorder is not available in this environment")}};class ru extends ou{constructor(e,t){if(!su)throw new Error("MediaRecorder is not available in this environment");let n,i;super(new MediaStream([e.mediaStreamTrack]),t);const s=()=>{this.removeEventListener("dataavailable",n),this.removeEventListener("stop",s),this.removeEventListener("error",o),null==i||i.close(),i=void 0},o=e=>{null==i||i.error(e),this.removeEventListener("dataavailable",n),this.removeEventListener("stop",s),this.removeEventListener("error",o),i=void 0};this.byteStream=new ReadableStream({start:e=>{i=e,n=t=>Nr(this,void 0,void 0,function*(){let n;if(t.data.arrayBuffer){const e=yield t.data.arrayBuffer();n=new Uint8Array(e)}else{if(!t.data.byteArray)throw new Error("no data available!");n=t.data.byteArray}void 0!==i&&e.enqueue(n)}),this.addEventListener("dataavailable",n)},cancel:()=>{s()}}),this.addEventListener("stop",s),this.addEventListener("error",o)}}class au extends td{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}get hasPreConnectBuffer(){return!!this.localTrackRecorder}constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(e,t,arguments.length>4?arguments[4]:void 0),this.manuallyStopped=!1,this.pendingDeviceChange=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=Al(()=>Nr(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>Nr(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(vc.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Cn,this.pauseUpstreamLock=new Cn,this.trackChangeLock=new Cn,this.trackChangeLock.lock().then(t=>Nr(this,void 0,void 0,function*(){try{yield this.setMediaStreamTrack(e,!0)}finally{t()}})),this._constraints=e.getConstraints(),n&&(this._constraints=n)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==td.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();return e&&t?{width:e,height:t}:void 0}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return null!==(t=null===(e=this.processor)||void 0===e?void 0:e.processedTrack)&&void 0!==t?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t){return Nr(this,void 0,void 0,function*(){var n;if(e===this._mediaStreamTrack&&!t)return;let i;if(this._mediaStreamTrack&&(this.attachedElements.forEach(e=>{id(this._mediaStreamTrack,e)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints()),this.processor&&e){if(this.log.debug("restarting processor",this.logContext),"unknown"===this.kind)throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(nd(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}this.sender&&"closed"!==(null===(n=this.sender.transport)||void 0===n?void 0:n.state)&&(yield this.sender.replaceTrack(null!=i?i:e)),this.providedByUser||this._mediaStreamTrack===e||this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(t=>{nd(null!=i?i:e,t)}))})}waitForDimensions(){return Nr(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return function*(){var n;if(e.kind===td.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");"iOS"===(null===(n=Xa())||void 0===n?void 0:n.os)&&(yield od(10));const i=Date.now();for(;Date.now()-i<t;){const t=e.dimensions;if(t)return t;yield od(50)}throw new yc("unable to get track dimensions after timeout")}()})}setDeviceId(e){return Nr(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===Dd(e)||(this._constraints.deviceId=e,this.isMuted?(this.pendingDeviceChange=!0,!0):(yield this.restartTrack(),Dd(e)===this._mediaStreamTrack.getSettings().deviceId))})}getDeviceId(){return Nr(this,arguments,void 0,function(){var e=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){if(e.source===td.Source.ScreenShare)return;const{deviceId:n,groupId:i}=e._mediaStreamTrack.getSettings(),s=e.kind===td.Kind.Audio?"audioinput":"videoinput";return t?ll.getInstance().normalizeDeviceId(s,n,i):n}()})}mute(){return Nr(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return Nr(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return Nr(this,void 0,void 0,function*(){const n=yield this.trackChangeLock.lock();try{if(!this.sender)throw new yc("unable to replace an unpublished track");let n,i;return"boolean"==typeof t?n=t:void 0!==t&&(n=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=null==n||n,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.internalStopProcessor()),this}finally{n()}})}restart(e){return Nr(this,void 0,void 0,function*(){this.manuallyStopped=!1;const t=yield this.trackChangeLock.lock();try{e||(e=this._constraints);const{deviceId:t,facingMode:n}=e,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===td.Kind.Video?s.video=!t&&!n||{deviceId:t,facingMode:n}:s.audio=!t||Object.assign({deviceId:t},i),this.attachedElements.forEach(e=>{id(this.mediaStreamTrack,e)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const o=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return this.kind===td.Kind.Video&&(yield o.applyConstraints(i)),o.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(o),this._constraints=e,this.pendingDeviceChange=!1,this.emit(vc.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),this.isMuted===e&&this._mediaStreamTrack.enabled!==e||(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?vc.Muted:vc.Unmuted,this))}get needsReAcquisition(){return"live"!==this._mediaStreamTrack.readyState||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Nr(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),md()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted||(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),null===(e=this.processor)||void 0===e||e.destroy(),this.processor=void 0}pauseUpstream(){return Nr(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(!0===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to pause upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!0,this.emit(vc.UpstreamPaused,this);const t=Xa();if("Safari"===(null==t?void 0:t.name)&&Cd(t.version,"12.0")<0)throw new bc("pauseUpstream is not supported on Safari < 12.");"closed"!==(null===(e=this.sender.transport)||void 0===e?void 0:e.state)&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return Nr(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(!1===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to resume upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!1,this.emit(vc.UpstreamResumed,this),"closed"!==(null===(e=this.sender.transport)||void 0===e?void 0:e.state)&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return Nr(this,void 0,void 0,function*(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return;return yield this.sender.getStats()})}setProcessor(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i;const s=yield t.trackChangeLock.lock();try{t.log.debug("setting up processor",t.logContext);const s=document.createElement(t.kind),o={kind:t.kind,track:t._mediaStreamTrack,element:s,audioContext:t.audioContext};if(yield e.init(o),t.log.debug("processor initialized",t.logContext),t.processor&&(yield t.internalStopProcessor()),"unknown"===t.kind)throw TypeError("cannot set processor on track of unknown kind");if(nd(t._mediaStreamTrack,s),s.muted=!0,s.play().catch(e=>{e instanceof DOMException&&"AbortError"===e.name?(t.log.warn("failed to play processor element, retrying",Object.assign(Object.assign({},t.logContext),{error:e})),setTimeout(()=>{s.play().catch(e=>{t.log.error("failed to play processor element",Object.assign(Object.assign({},t.logContext),{err:e}))})},100)):t.log.error("failed to play processor element",Object.assign(Object.assign({},t.logContext),{error:e}))}),t.processor=e,t.processorElement=s,t.processor.processedTrack){for(const e of t.attachedElements)e!==t.processorElement&&n&&(id(t._mediaStreamTrack,e),nd(t.processor.processedTrack,e));yield null===(i=t.sender)||void 0===i?void 0:i.replaceTrack(t.processor.processedTrack)}t.emit(vc.TrackProcessorUpdate,t.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return Nr(this,arguments,void 0,function(){var e=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){const n=yield e.trackChangeLock.lock();try{yield e.internalStopProcessor(t)}finally{n()}}()})}internalStopProcessor(){return Nr(this,arguments,void 0,function(){var e=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var n,i;e.processor&&(e.log.debug("stopping processor",e.logContext),null===(n=e.processor.processedTrack)||void 0===n||n.stop(),yield e.processor.destroy(),e.processor=void 0,t||(null===(i=e.processorElement)||void 0===i||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(vc.TrackProcessorUpdate))}()})}startPreConnectBuffer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;if(su)if(this.localTrackRecorder)this.log.warn("preconnect buffer already started");else{{let e="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(e)||(e="video/mp4"),this.localTrackRecorder=new ru(this,{mimeType:e})}this.localTrackRecorder.start(e),this.autoStopPreConnectBuffer=setTimeout(()=>{this.log.warn("preconnect buffer timed out, stopping recording automatically",this.logContext),this.stopPreConnectBuffer()},1e4)}else this.log.warn("MediaRecorder is not available, cannot start preconnect buffer",this.logContext)}stopPreConnectBuffer(){clearTimeout(this.autoStopPreConnectBuffer),this.localTrackRecorder&&(this.localTrackRecorder.stop(),this.localTrackRecorder=void 0)}getPreConnectBuffer(){var e;return null===(e=this.localTrackRecorder)||void 0===e?void 0:e.byteStream}getPreConnectBufferMimeType(){var e;return null===(e=this.localTrackRecorder)||void 0===e?void 0:e.mimeType}}class cu extends au{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;super(e,td.Kind.Audio,t,n,s),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>Nr(this,void 0,void 0,function*(){if(!this.sender)return void(this._currentBitrate=0);let e;try{e=yield this.getSenderStats()}catch(ep){return void this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:ep}))}e&&this.prevStats&&(this._currentBitrate=iu(e,this.prevStats)),this.prevStats=e}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(vc.AudioTrackFeatureUpdate,this,_s.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(vc.AudioTrackFeatureUpdate,this,_s.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return Nr(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===td.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return Nr(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source!==td.Source.Microphone||!this.stopOnMute&&"ended"!==this._mediaStreamTrack.readyState&&!this.pendingDeviceChange||this.isUserProvided||(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}restartTrack(e){return Nr(this,void 0,void 0,function*(){let t;if(e){const n=Vc({audio:e});"boolean"!=typeof n.audio&&(t=n.audio)}yield this.restart(t)})}restart(e){const t=Object.create(null,{restart:{get:()=>super.restart}});return Nr(this,void 0,void 0,function*(){const n=yield t.restart.call(this,e);return this.checkForSilence(),n})}startMonitor(){gd()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},nu)))}setProcessor(e){return Nr(this,void 0,void 0,function*(){var t;const n=yield this.trackChangeLock.lock();try{if(!vd()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.internalStopProcessor());const n={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(n),this.processor=e,this.processor.processedTrack&&(yield null===(t=this.sender)||void 0===t?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(vc.TrackProcessorUpdate,this.processor)}finally{n()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return Nr(this,void 0,void 0,function*(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return;let t;return(yield this.sender.getStats()).forEach(e=>{"outbound-rtp"===e.type&&(t={type:"audio",streamId:e.id,packetsSent:e.packetsSent,packetsLost:e.packetsLost,bytesSent:e.bytesSent,timestamp:e.timestamp,roundTripTime:e.roundTripTime,jitter:e.jitter})}),t})}checkForSilence(){return Nr(this,void 0,void 0,function*(){const e=yield Wc(this);return e&&(this.isMuted||this.log.debug("silence detected on local audio track",this.logContext),this.emit(vc.AudioSilenceDetected)),e})}}const du=Object.values(Uc),lu=Object.values(Fc),uu=Object.values(jc),hu=[Uc.h180,Uc.h360],pu=[Fc.h180,Fc.h360],mu=["q","h","f"];function gu(e,t,n,i){var s,o;let r=null==i?void 0:i.videoEncoding;e&&(r=null==i?void 0:i.screenShareEncoding);const a=null==i?void 0:i.simulcast,c=null==i?void 0:i.scalabilityMode,d=null==i?void 0:i.videoCodec;if(!r&&!a&&!c||!t||!n)return[{}];r||(r=function(e,t,n,i){const s=function(e,t,n){if(e)return uu;const i=t>n?t/n:n/t;if(Math.abs(i-16/9)<Math.abs(i-4/3))return du;return lu}(e,t,n);let{encoding:o}=s[0];const r=Math.max(t,n);for(let a=0;a<s.length;a+=1){const e=s[a];if(o=e.encoding,e.width>=r)break}if(i)switch(i){case"av1":case"h265":o=Object.assign({},o),o.maxBitrate=.7*o.maxBitrate;break;case"vp9":o=Object.assign({},o),o.maxBitrate=.85*o.maxBitrate}return o}(e,t,n,d),Lr.debug("using video encoding",r));const l=r.maxFramerate,u=new Rc(t,n,r.maxBitrate,r.maxFramerate,r.priority);if(c&&cd(d)){const e=new bu(c),t=[];if(e.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(c));const n=Xa();if(pd()||vd()||"Chrome"===(null==n?void 0:n.name)&&Cd(null==n?void 0:n.version,"113")<0){const i="h"==e.suffix?2:3,s=function(e){return e||(e=Xa()),"Safari"===(null==e?void 0:e.name)&&Cd(e.version,"18.3")>0||"iOS"===(null==e?void 0:e.os)&&!!(null==e?void 0:e.osVersion)&&Cd(e.osVersion,"18.3")>0}(n);for(let n=0;n<e.spatial;n+=1)t.push({rid:mu[2-n],maxBitrate:r.maxBitrate/Math.pow(i,n),maxFramerate:u.encoding.maxFramerate,scaleResolutionDownBy:s?Math.pow(2,n):void 0});t[0].scalabilityMode=c}else t.push({maxBitrate:r.maxBitrate,maxFramerate:u.encoding.maxFramerate,scalabilityMode:c});return u.encoding.priority&&(t[0].priority=u.encoding.priority,t[0].networkPriority=u.encoding.priority),Lr.debug("using svc encoding",{encodings:t}),t}if(!a)return[r];let h,p=[];if(p=e?null!==(s=_u(null==i?void 0:i.screenShareSimulcastLayers))&&void 0!==s?s:vu(e,u):null!==(o=_u(null==i?void 0:i.videoSimulcastLayers))&&void 0!==o?o:vu(e,u),p.length>0){const e=p[0];p.length>1&&([,h]=p);const i=Math.max(t,n);if(i>=960&&h)return fu(t,n,[e,h,u],l);if(i>=480)return fu(t,n,[e,u],l)}return fu(t,n,[u])}function vu(e,t){if(e)return[{scaleResolutionDownBy:2,fps:(n=t).encoding.maxFramerate}].map(e=>{var t,i;return new Rc(Math.floor(n.width/e.scaleResolutionDownBy),Math.floor(n.height/e.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(e.scaleResolutionDownBy,2)*((null!==(t=n.encoding.maxFramerate)&&void 0!==t?t:30)/(null!==(i=e.fps)&&void 0!==i?i:30))))),e.fps,n.encoding.priority)});var n;const{width:i,height:s}=t,o=i>s?i/s:s/i;return Math.abs(o-16/9)<Math.abs(o-4/3)?hu:pu}function fu(e,t,n,i){const s=[];if(n.forEach((n,o)=>{if(o>=mu.length)return;const r=Math.min(e,t),a={rid:mu[o],scaleResolutionDownBy:Math.max(1,r/Math.min(n.width,n.height)),maxBitrate:n.encoding.maxBitrate},c=i&&n.encoding.maxFramerate?Math.min(i,n.encoding.maxFramerate):n.encoding.maxFramerate;c&&(a.maxFramerate=c);const d=ld()||0===o;n.encoding.priority&&d&&(a.priority=n.encoding.priority,a.networkPriority=n.encoding.priority),s.push(a)}),vd()&&"ios"===yd()){let e;s.forEach(t=>{e?t.maxFramerate&&t.maxFramerate>e&&(e=t.maxFramerate):e=t.maxFramerate});let t=!0;s.forEach(n=>{var i;n.maxFramerate!=e&&(t&&(t=!1,Lr.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),Lr.info('Setting framerate of encoding "'.concat(null!==(i=n.rid)&&void 0!==i?i:"",'" to ').concat(e)),n.maxFramerate=e)})}return s}function _u(e){if(e)return e.sort((e,t)=>{const{encoding:n}=e,{encoding:i}=t;return n.maxBitrate>i.maxBitrate?1:n.maxBitrate<i.maxBitrate?-1:n.maxBitrate===i.maxBitrate&&n.maxFramerate&&i.maxFramerate?n.maxFramerate>i.maxFramerate?1:-1:0})}class bu{constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat(null!==(e=this.suffix)&&void 0!==e?e:"")}}class yu extends au{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;super(e,td.Kind.Video,t,n,i),this.simulcastCodecs=/* @__PURE__ */new Map,this.degradationPreference="balanced",this.isCpuConstrained=!1,this.optimizeForPerformance=!1,this.monitorSender=()=>Nr(this,void 0,void 0,function*(){if(!this.sender)return void(this._currentBitrate=0);let e;try{e=yield this.getSenderStats()}catch(ep){return void this.log.error("could not get video sender stats",Object.assign(Object.assign({},this.logContext),{error:ep}))}const t=new Map(e.map(e=>[e.rid,e])),n=e.some(e=>"cpu"===e.qualityLimitationReason);if(n!==this.isCpuConstrained&&(this.isCpuConstrained=n,this.isCpuConstrained&&this.emit(vc.CpuConstrained)),this.prevStats){let e=0;t.forEach((t,n)=>{var i;const s=null===(i=this.prevStats)||void 0===i?void 0:i.get(n);e+=iu(t,s)}),this._currentBitrate=e}this.prevStats=t}),this.senderLock=new Cn}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!gd())return;const n=null===(t=this.sender)||void 0===t?void 0:t.getParameters();n&&(this.encodings=n.encodings),this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},nu))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return Nr(this,void 0,void 0,function*(){var t,n,i,s,o;yield e.pauseUpstream.call(this);try{for(var r,a=!0,c=Fr(this.simulcastCodecs.values());!(t=(r=yield c.next()).done);a=!0){s=r.value,a=!1;const e=s;yield null===(o=e.sender)||void 0===o?void 0:o.replaceTrack(null)}}catch(d){n={error:d}}finally{try{a||t||!(i=c.return)||(yield i.call(c))}finally{if(n)throw n.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return Nr(this,void 0,void 0,function*(){var t,n,i,s,o;yield e.resumeUpstream.call(this);try{for(var r,a=!0,c=Fr(this.simulcastCodecs.values());!(t=(r=yield c.next()).done);a=!0){s=r.value,a=!1;const e=s;yield null===(o=e.sender)||void 0===o?void 0:o.replaceTrack(e.mediaStreamTrack)}}catch(d){n={error:d}}finally{try{a||t||!(i=c.return)||(yield i.call(c))}finally{if(n)throw n.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return Nr(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source!==td.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return Nr(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source!==td.Source.Camera||this.isUserProvided||(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return Nr(this,void 0,void 0,function*(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return[];const t=[],n=yield this.sender.getStats();return n.forEach(e=>{var i;if("outbound-rtp"===e.type){const s={type:"video",streamId:e.id,frameHeight:e.frameHeight,frameWidth:e.frameWidth,framesPerSecond:e.framesPerSecond,framesSent:e.framesSent,firCount:e.firCount,pliCount:e.pliCount,nackCount:e.nackCount,packetsSent:e.packetsSent,bytesSent:e.bytesSent,qualityLimitationReason:e.qualityLimitationReason,qualityLimitationDurations:e.qualityLimitationDurations,qualityLimitationResolutionChanges:e.qualityLimitationResolutionChanges,rid:null!==(i=e.rid)&&void 0!==i?i:e.id,retransmittedPacketsSent:e.retransmittedPacketsSent,targetBitrate:e.targetBitrate,timestamp:e.timestamp},o=n.get(e.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),t.push(s)}}),t.sort((e,t)=>{var n,i;return(null!==(n=t.frameWidth)&&void 0!==n?n:0)-(null!==(i=e.frameWidth)&&void 0!==i?i:0)}),t})}setPublishingQuality(e){const t=[];for(let n=Zc.LOW;n<=Zc.HIGH;n+=1)t.push(new $o({quality:n,enabled:n<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(cd(this.codec),t)}restartTrack(e){return Nr(this,void 0,void 0,function*(){var t,n,i,s,o;let r;if(e){const t=Vc({video:e});"boolean"!=typeof t.video&&(r=t.video)}yield this.restart(r),this.isCpuConstrained=!1;try{for(var a,c=!0,d=Fr(this.simulcastCodecs.values());!(t=(a=yield d.next()).done);c=!0){s=a.value,c=!1;const e=s;e.sender&&"closed"!==(null===(o=e.sender.transport)||void 0===o?void 0:o.state)&&(e.mediaStreamTrack=this.mediaStreamTrack.clone(),yield e.sender.replaceTrack(e.mediaStreamTrack))}}catch(l){n={error:l}}finally{try{c||t||!(i=d.return)||(yield i.call(d))}finally{if(n)throw n.error}}})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return Nr(this,arguments,void 0,function(e){var n=this;let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var s,o,r,a,c,d;if(yield t.setProcessor.call(n,e,i),null===(c=n.processor)||void 0===c?void 0:c.processedTrack)try{for(var l,u=!0,h=Fr(n.simulcastCodecs.values());!(s=(l=yield h.next()).done);u=!0){a=l.value,u=!1;const e=a;yield null===(d=e.sender)||void 0===d?void 0:d.replaceTrack(n.processor.processedTrack)}}catch(p){o={error:p}}finally{try{u||s||!(r=h.return)||(yield r.call(h))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return Nr(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(ep){this.log.warn("failed to set degradationPreference",Object.assign({error:ep},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e))return void this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);const n={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,n),n}setSimulcastTrackSender(e,t){const n=this.simulcastCodecs.get(e);n&&(n.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},5e3))}setPublishingCodecs(e){return Nr(this,void 0,void 0,function*(){var t,n,i,s,o,r,a;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(cd(e[0].codec),e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(t=!0,n=Fr(e);!(s=(i=yield n.next()).done);t=!0){a=i.value,t=!1;const e=a;if(this.codec&&this.codec!==e.codec){const t=this.simulcastCodecs.get(e.codec);if(this.log.debug("try setPublishingCodec for ".concat(e.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:t})),t&&t.sender)t.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(e.codec),this.logContext),yield ku(t.sender,t.encodings,e.qualities,this.senderLock,cd(e.codec),this.log,this.logContext));else for(const n of e.qualities)if(n.enabled){c.push(e.codec);break}}else yield this.setPublishingLayers(cd(e.codec),e.qualities)}}catch(d){o={error:d}}finally{try{t||s||!(r=n.return)||(yield r.call(n))}finally{if(o)throw o.error}}return c})}setPublishingLayers(e,t){return Nr(this,void 0,void 0,function*(){this.optimizeForPerformance?this.log.info("skipping setPublishingLayers due to optimized publishing performance",Object.assign(Object.assign({},this.logContext),{qualities:t})):(this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:t})),this.sender&&this.encodings&&(yield ku(this.sender,this.encodings,t,this.senderLock,e,this.log,this.logContext)))})}prioritizePerformance(){return Nr(this,void 0,void 0,function*(){if(!this.sender)throw new Error("sender not found");const e=yield this.senderLock.lock();try{this.optimizeForPerformance=!0;const e=this.sender.getParameters();e.encodings=e.encodings.map((e,t)=>{var n;return Object.assign(Object.assign({},e),{active:0===t,scaleResolutionDownBy:Math.max(1,Math.ceil((null!==(n=this.mediaStreamTrack.getSettings().height)&&void 0!==n?n:360)/360)),scalabilityMode:0===t&&cd(this.codec)?"L1T3":void 0,maxFramerate:0===t?15:0,maxBitrate:0===t?e.maxBitrate:0})}),this.log.debug("setting performance optimised encodings",Object.assign(Object.assign({},this.logContext),{encodings:e.encodings})),this.encodings=e.encodings,yield this.sender.setParameters(e)}catch(ep){this.log.error("failed to set performance optimised encodings",Object.assign(Object.assign({},this.logContext),{error:ep})),this.optimizeForPerformance=!1}finally{e()}})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Nr(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),md()&&this.isInBackground&&this.source===td.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function ku(e,t,n,i,s,o,r){return Nr(this,void 0,void 0,function*(){const a=yield i.lock();o.debug("setPublishingLayersForSender",Object.assign(Object.assign({},r),{sender:e,qualities:n,senderEncodings:t}));try{const i=e.getParameters(),{encodings:a}=i;if(!a)return;if(a.length!==t.length)return void o.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},r),{encodings:a,senderEncodings:t}));let c=!1;if(!1&&a[0].scalabilityMode);else{if(s){n.some(e=>e.enabled)&&n.forEach(e=>e.enabled=!0)}a.forEach((e,i)=>{var s;let a=null!==(s=e.rid)&&void 0!==s?s:"";""===a&&(a="q");const d=Cu(a),l=n.find(e=>e.quality===d);l&&e.active!==l.enabled&&(c=!0,e.active=l.enabled,o.debug("setting layer ".concat(l.quality," to ").concat(e.active?"enabled":"disabled"),r),ld()&&(l.enabled?(e.scaleResolutionDownBy=t[i].scaleResolutionDownBy,e.maxBitrate=t[i].maxBitrate,e.maxFrameRate=t[i].maxFrameRate):(e.scaleResolutionDownBy=4,e.maxBitrate=10,e.maxFrameRate=2)))})}c&&(i.encodings=a,o.debug("setting encodings",Object.assign(Object.assign({},r),{encodings:i.encodings})),yield e.setParameters(i))}finally{a()}})}function Cu(e){switch(e){case"f":default:return Zc.HIGH;case"h":return Zc.MEDIUM;case"q":return Zc.LOW}}function wu(e,t,n,i){if(!n)return[new Ls({quality:Zc.HIGH,width:e,height:t,bitrate:0,ssrc:0})];if(i){const i=n[0].scalabilityMode,s=new bu(i),o=[],r="h"==s.suffix?1.5:2,a="h"==s.suffix?2:3;for(let c=0;c<s.spatial;c+=1)o.push(new Ls({quality:Math.min(Zc.HIGH,s.spatial-1)-c,width:Math.ceil(e/Math.pow(r,c)),height:Math.ceil(t/Math.pow(r,c)),bitrate:n[0].maxBitrate?Math.ceil(n[0].maxBitrate/Math.pow(a,c)):0,ssrc:0}));return o}return n.map(n=>{var i,s,o;const r=null!==(i=n.scaleResolutionDownBy)&&void 0!==i?i:1;let a=Cu(null!==(s=n.rid)&&void 0!==s?s:"");return new Ls({quality:a,width:Math.ceil(e/r),height:Math.ceil(t/r),bitrate:null!==(o=n.maxBitrate)&&void 0!==o?o:0,ssrc:0})})}const Tu="_lossy",Su="_reliable",Eu="leave-reconnect";var Pu,Iu;(Iu=Pu||(Pu={}))[Iu.New=0]="New",Iu[Iu.Connected=1]="Connected",Iu[Iu.Disconnected=2]="Disconnected",Iu[Iu.Reconnecting=3]="Reconnecting",Iu[Iu.Closed=4]="Closed";class Ru extends qr.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=Kl.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.latestRemoteOfferId=0,this.subscriberPrimary=!1,this.pcState=Pu.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=Lr,this.reliableDataSequence=1,this.reliableMessageBuffer=new kl,this.reliableReceivedState=new Cl(3e4),this.lossyDataStatCurrentBytes=0,this.lossyDataStatByterate=0,this.lossyDataDropCount=0,this.midToTrackId={},this.isWaitingForNetworkReconnect=!1,this.handleDataChannel=e=>Nr(this,[e],void 0,function(e){var t=this;let{channel:n}=e;return function*(){if(n){if(n.label===Su)t.reliableDCSub=n;else{if(n.label!==Tu)return;t.lossyDCSub=n}t.log.debug("on data channel ".concat(n.id,", ").concat(n.label),t.logContext),n.onmessage=t.handleDataMessage}}()}),this.handleDataMessage=e=>Nr(this,void 0,void 0,function*(){var t,n,i,s,o;const r=yield this.dataProcessLock.lock();try{let r;if(e.data instanceof ArrayBuffer)r=e.data;else{if(!(e.data instanceof Blob))return void this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:e.data}));r=yield e.data.arrayBuffer()}const a=Ds.fromBinary(new Uint8Array(r));if(a.sequence>0&&""!==a.participantSid){const e=this.reliableReceivedState.get(a.participantSid);if(e&&a.sequence<=e)return;this.reliableReceivedState.set(a.participantSid,a.sequence)}if("speaker"===(null===(t=a.value)||void 0===t?void 0:t.case))this.emit(mc.ActiveSpeakersUpdate,a.value.value.speakers);else if("encryptedPacket"===(null===(n=a.value)||void 0===n?void 0:n.case)){if(!this.e2eeManager)return void this.log.error("Received encrypted packet but E2EE not set up",this.logContext);const e=yield null===(i=this.e2eeManager)||void 0===i?void 0:i.handleEncryptedData(a.value.value.encryptedValue,a.value.value.iv,a.participantIdentity,a.value.value.keyIndex),t=Ns.fromBinary(e.payload),n=new Ds({value:t.value,participantIdentity:a.participantIdentity,participantSid:a.participantSid});"user"===(null===(s=n.value)||void 0===s?void 0:s.case)&&Mu(n,n.value.value),this.emit(mc.DataPacketReceived,n,a.value.value.encryptionType)}else"user"===(null===(o=a.value)||void 0===o?void 0:o.case)&&Mu(a,a.value.value),this.emit(mc.DataPacketReceived,a,Es.NONE)}finally{r()}}),this.handleDataError=e=>{const t=0===e.currentTarget.maxRetransmits?"lossy":"reliable";if(e instanceof ErrorEvent&&e.error){const{error:n}=e.error;this.log.error("DataChannel error on ".concat(t,": ").concat(e.message),Object.assign(Object.assign({},this.logContext),{error:n}))}else this.log.error("Unknown DataChannel error on ".concat(t),Object.assign(Object.assign({},this.logContext),{event:e}))},this.handleBufferedAmountLow=e=>{const t=0===e.currentTarget.maxRetransmits?xs.LOSSY:xs.RELIABLE;this.updateAndEmitDCBufferStatus(t)},this.handleDisconnect=(e,t)=>{if(this._isClosed)return;this.log.warn("".concat(e," disconnected"),this.logContext),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const n=e=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(e,"ms. giving up"),this.logContext),this.emit(mc.Disconnected),this.close()},i=Date.now()-this.reconnectStart;let s=this.getNextRetryDelay({elapsedMs:i,retryCount:this.reconnectAttempts});null!==s?(e===Eu&&(s=0),this.log.debug("reconnecting in ".concat(s,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=Ic.setTimeout(()=>this.attemptReconnect(t).finally(()=>this.reconnectTimeout=void 0),s)):n(i)},this.waitForRestarted=()=>new Promise((e,t)=>{this.pcState===Pu.Connected&&e();const n=()=>{this.off(mc.Disconnected,i),e()},i=()=>{this.off(mc.Restarted,n),t()};this.once(mc.Restarted,n),this.once(mc.Disconnected,i)}),this.updateAndEmitDCBufferStatus=e=>{if(e===xs.RELIABLE){const t=this.dataChannelForKind(e);t&&this.reliableMessageBuffer.alignBufferedAmount(t.bufferedAmount)}const t=this.isBufferStatusLow(e);void 0!==t&&t!==this.dcBufferStatus.get(e)&&(this.dcBufferStatus.set(e,t),this.emit(mc.DCBufferStatusChanged,t,e))},this.isBufferStatusLow=e=>{const t=this.dataChannelForKind(e);if(t)return t.bufferedAmount<=t.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>Nr(this,void 0,void 0,function*(){if(!this.url)return;(yield fetch(xd(this.url),{method:"HEAD"}).then(e=>e.ok).catch(()=>!1))&&(this.log.info("detected network reconnected"),(this.client.currentState===vl.RECONNECTING||this.isWaitingForNetworkReconnect&&this.client.currentState===vl.CONNECTED)&&(this.clearReconnectTimeout(),this.attemptReconnect(vs.RR_SIGNAL_DISCONNECTED),this.isWaitingForNetworkReconnect=!1))}),this.handleBrowserOffline=()=>Nr(this,void 0,void 0,function*(){if(this.url)try{yield Promise.race([fetch(xd(this.url),{method:"HEAD"}),od(4e3).then(()=>Promise.reject())])}catch(ep){!1===window.navigator.onLine&&(this.log.info("detected network interruption"),this.isWaitingForNetworkReconnect=!0)}}),this.log=Or(null!==(t=e.loggerName)&&void 0!==t?t:Ir.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new _l(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.closingLock=new Cn,this.dataProcessLock=new Cn,this.dcBufferStatus=/* @__PURE__ */new Map([[xs.LOSSY,!0],[xs.RELIABLE,!0]]),this.client.onParticipantUpdate=e=>this.emit(mc.ParticipantUpdate,e),this.client.onConnectionQuality=e=>this.emit(mc.ConnectionQualityUpdate,e),this.client.onRoomUpdate=e=>this.emit(mc.RoomUpdate,e),this.client.onSubscriptionError=e=>this.emit(mc.SubscriptionError,e),this.client.onSubscriptionPermissionUpdate=e=>this.emit(mc.SubscriptionPermissionUpdate,e),this.client.onSpeakersChanged=e=>this.emit(mc.SpeakersChanged,e),this.client.onStreamStateUpdate=e=>this.emit(mc.StreamStateChanged,e),this.client.onRequestResponse=e=>this.emit(mc.SignalRequestResponse,e)}get logContext(){var e,t,n,i,s,o;return{room:null===(t=null===(e=this.latestJoinResponse)||void 0===e?void 0:e.room)||void 0===t?void 0:t.name,roomID:null===(i=null===(n=this.latestJoinResponse)||void 0===n?void 0:n.room)||void 0===i?void 0:i.sid,participant:null===(o=null===(s=this.latestJoinResponse)||void 0===s?void 0:s.participant)||void 0===o?void 0:o.identity,pID:this.participantSid}}join(e,t,n,i){return Nr(this,arguments,void 0,function(e,t,n,i){var s=this;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return function*(){s.url=e,s.token=t,s.signalOpts=n,s.maxJoinAttempts=n.maxRetries;try{s.joinAttempts+=1,s.setupSignalClientCallbacks();const r=yield s.client.join(e,t,n,i,o);return s._isClosed=!1,s.latestJoinResponse=r,s.subscriberPrimary=r.subscriberPrimary,s.pcManager||(yield s.configure(r,!o)),s.subscriberPrimary&&!r.fastPublish||s.negotiate().catch(e=>{Lr.error(e,s.logContext)}),s.registerOnLineListener(),s.clientConfiguration=r.clientConfiguration,s.emit(mc.SignalConnected,r),r}catch(ep){if(ep instanceof _c)if(ep.reason===sc.ServerUnreachable){if(s.log.warn("Couldn't connect to server, attempt ".concat(s.joinAttempts," of ").concat(s.maxJoinAttempts),s.logContext),s.joinAttempts<s.maxJoinAttempts)return s.join(e,t,n,i,o)}else if(ep.reason===sc.ServiceNotFound)return s.log.warn("Initial connection failed: ".concat(ep.message," – Retrying")),s.join(e,t,n,i,!0);throw ep}}()})}close(){return Nr(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed)e();else try{this._isClosed=!0,this.joinAttempts=0,this.emit(mc.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),this.cleanupLossyDataStats(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return Nr(this,void 0,void 0,function*(){var e;yield null===(e=this.pcManager)||void 0===e?void 0:e.close(),this.pcManager=void 0;const t=e=>{e&&(e.close(),e.onbufferedamountlow=null,e.onclose=null,e.onclosing=null,e.onerror=null,e.onmessage=null,e.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0,this.reliableMessageBuffer=new kl,this.reliableDataSequence=1,this.reliableReceivedState.clear()})}cleanupLossyDataStats(){this.lossyDataStatByterate=0,this.lossyDataStatCurrentBytes=0,this.lossyDataStatInterval&&(clearInterval(this.lossyDataStatInterval),this.lossyDataStatInterval=void 0),this.lossyDataDropCount=0}cleanupClient(){return Nr(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new yc("a track with the same ID has already been published");return new Promise((t,n)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],n(_c.timeout("publication of local track timed out, no response from server"))},1e4);this.pendingTrackResolvers[e.cid]={resolve:e=>{clearTimeout(i),t(e)},reject:()=>{clearTimeout(i),n(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(ep){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:ep}))}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return null===(e=this.reliableDCSub)||void 0===e?void 0:e.readyState}getConnectedServerAddress(){return Nr(this,void 0,void 0,function*(){var e;return null===(e=this.pcManager)||void 0===e?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e,t){return Nr(this,void 0,void 0,function*(){var n,i;if(this.pcManager&&this.pcManager.currentState!==$l.NEW)return;this.participantSid=null===(n=e.participant)||void 0===n?void 0:n.sid;const s=this.makeRTCConfiguration(e);var o;this.pcManager=new Yl(s,t?"publisher-only":e.subscriberPrimary?"subscriber-primary":"publisher-primary",this.loggerOptions),this.emit(mc.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(e,t)=>{this.client.sendIceCandidate(e,t)},this.pcManager.onPublisherOffer=(e,t)=>{this.client.sendOffer(e,t)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(t,n,i)=>Nr(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(t),this.logContext),["closed","disconnected","failed"].includes(n)&&(this.publisherConnectionPromise=void 0),t===$l.CONNECTED){const t=this.pcState===Pu.New;this.pcState=Pu.Connected,t&&this.emit(mc.Connected,e)}else t===$l.FAILED&&(this.pcState!==Pu.Connected&&this.pcState!==Pu.Reconnecting||(this.pcState=Pu.Disconnected,this.handleDisconnect("peerconnection failed","failed"===i?vs.RR_SUBSCRIBER_FAILED:vs.RR_PUBLISHER_FAILED)));const s=this.client.isDisconnected||this.client.currentState===vl.RECONNECTING,o=[$l.FAILED,$l.CLOSING,$l.CLOSED].includes(t);s&&o&&!this._isClosed&&this.emit(mc.Offline)}),this.pcManager.onTrack=e=>{0!==e.streams.length&&this.emit(mc.MediaTrackAdded,e.track,e.streams[0],e.receiver)},void 0!==(o=null===(i=e.serverInfo)||void 0===i?void 0:i.protocol)&&o>13||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=(e,t,n)=>Nr(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,midToTrackId:n})),this.midToTrackId=n,yield this.pcManager.setPublisherAnswer(e,t))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:t})),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=(e,t,n)=>Nr(this,void 0,void 0,function*(){if(this.latestRemoteOfferId=t,!this.pcManager)return;this.midToTrackId=n;const i=yield this.pcManager.createSubscriberAnswerFromOffer(e,t);i&&this.client.sendAnswer(i,t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:null===(t=e.track)||void 0===t?void 0:t.sid})),!this.pendingTrackResolvers[e.cid])return void this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));const{resolve:n}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],n(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(mc.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(mc.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{var t;this.token=e,null===(t=this.regionUrlProvider)||void 0===t||t.updateToken(e)},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(mc.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(mc.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var t;this.participantSid=null===(t=e.participant)||void 0===t?void 0:t.sid,this.latestJoinResponse&&(this.latestJoinResponse.room=e.room),this.emit(mc.RoomMoved,e)},this.client.onMediaSectionsRequirement=e=>{var t,n;const i={direction:"recvonly"};for(let s=0;s<e.numAudios;s++)null===(t=this.pcManager)||void 0===t||t.addPublisherTransceiverOfKind("audio",i);for(let s=0;s<e.numVideos;s++)null===(n=this.pcManager)||void 0===n||n.addPublisherTransceiverOfKind("video",i);this.negotiate()},this.client.onClose=()=>{this.handleDisconnect("signal",vs.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:null==e?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions({updatedAtInMs:Date.now(),maxAgeInMs:5e3,regionSettings:e.regions})),e.action){case jo.DISCONNECT:this.emit(mc.Disconnected,null==e?void 0:e.reason),this.close();break;case jo.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(Eu);break;case jo.RESUME:this.handleDisconnect(Eu)}}}makeRTCConfiguration(e){var t;const n=Object.assign({},this.rtcConfig);if((null===(t=this.signalOpts)||void 0===t?void 0:t.e2eeEnabled)&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),n.encodedInsertableStreams=!0),e.iceServers&&!n.iceServers){const t=[];e.iceServers.forEach(e=>{const n={urls:e.urls};e.username&&(n.username=e.username),e.credential&&(n.credential=e.credential),t.push(n)}),n.iceServers=t}return e.clientConfiguration&&e.clientConfiguration.forceRelay===ms.ENABLED&&(n.iceTransportPolicy="relay"),n.sdpSemantics="unified-plan",n.continualGatheringPolicy="gather_continually",n}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(Tu,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(Su,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow,this.cleanupLossyDataStats(),this.lossyDataStatInterval=setInterval(()=>{this.lossyDataStatByterate=this.lossyDataStatCurrentBytes,this.lossyDataStatCurrentBytes=0;const e=this.dataChannelForKind(xs.LOSSY);if(e){const t=this.lossyDataStatByterate/10;e.bufferedAmountLowThreshold=Math.min(Math.max(t,8192),262144)}},1e3))}createSender(e,t,n){return Nr(this,void 0,void 0,function*(){if(rd()){return yield this.createTransceiverRTCRtpSender(e,t,n)}if(ad()){this.log.warn("using add-track fallback",this.logContext);return yield this.createRTCRtpSender(e.mediaStreamTrack)}throw new Cc("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,n,i){return Nr(this,void 0,void 0,function*(){if(rd())return this.createSimulcastTransceiverSender(e,t,n,i);if(ad())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new Cc("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,n){return Nr(this,void 0,void 0,function*(){if(!this.pcManager)throw new Cc("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Bd(e)&&(e.codec=t.videoCodec);const s={direction:"sendonly",streams:i};n&&(s.sendEncodings=n);return(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,s)).sender})}createSimulcastTransceiverSender(e,t,n,i){return Nr(this,void 0,void 0,function*(){if(!this.pcManager)throw new Cc("publisher is closed");const s={direction:"sendonly"};i&&(s.sendEncodings=i);const o=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,s);if(n.videoCodec)return e.setSimulcastTrackSender(n.videoCodec,o.sender),o.sender})}createRTCRtpSender(e){return Nr(this,void 0,void 0,function*(){if(!this.pcManager)throw new Cc("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return Nr(this,void 0,void 0,function*(){var t,n,i;if(!this._isClosed)if(this.attemptingReconnect)Lr.warn("already attempting reconnect, returning early",this.logContext);else{(null===(t=this.clientConfiguration)||void 0===t?void 0:t.resumeConnection)!==ms.DISABLED&&(null!==(i=null===(n=this.pcManager)||void 0===n?void 0:n.currentState)&&void 0!==i?i:$l.NEW)!==$l.NEW||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(ep){this.reconnectAttempts+=1;let t=!0;ep instanceof Cc?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:ep})),t=!1):ep instanceof Pc||(this.fullReconnectOnNext=!0),t?this.handleDisconnect("reconnect",vs.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(mc.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(ep){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:ep}))}return null}restartConnection(e){return Nr(this,void 0,void 0,function*(){var t,n,i;try{if(!this.url||!this.token)throw new Cc("could not reconnect, url or token not saved");let n;this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(mc.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Pc;n=yield this.join(null!=e?e:this.url,this.token,this.signalOpts,void 0,!this.options.singlePeerConnection)}catch(ep){if(ep instanceof _c&&ep.reason===sc.NotAllowed)throw new Cc("could not reconnect, token might be expired");throw new Pc}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(mc.SignalRestarted,n),yield this.waitForPCReconnected(),this.client.currentState!==vl.CONNECTED)throw new Pc("Signal connection got severed during reconnect");null===(t=this.regionUrlProvider)||void 0===t||t.resetAttempts(),this.emit(mc.Restarted)}catch(s){const e=yield null===(n=this.regionUrlProvider)||void 0===n?void 0:n.getNextBestRegionUrl();if(e)return void(yield this.restartConnection(e));throw null===(i=this.regionUrlProvider)||void 0===i||i.resetAttempts(),s}})}resumeConnection(e){return Nr(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new Cc("could not reconnect, url or token not saved");if(!this.pcManager)throw new Cc("publisher and subscriber connections unset");let n;this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(mc.Resuming);try{this.setupSignalClientCallbacks(),n=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let e="";if(i instanceof Error&&(e=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof _c&&i.reason===sc.NotAllowed)throw new Cc("could not reconnect, token might be expired");if(i instanceof _c&&i.reason===sc.LeaveRequest)throw i;throw new Pc(e)}if(this.emit(mc.SignalResumed),n){const e=this.makeRTCConfiguration(n);this.pcManager.updateConfiguration(e),this.latestJoinResponse&&(this.latestJoinResponse.serverInfo=n.serverInfo)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==vl.CONNECTED)throw new Pc("Signal connection got severed during reconnect");this.client.setReconnected(),"open"===(null===(t=this.reliableDC)||void 0===t?void 0:t.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),(null==n?void 0:n.lastMessageSeq)&&this.resendReliableMessagesForResume(n.lastMessageSeq),this.emit(mc.Resumed)})}waitForPCInitialConnection(e,t){return Nr(this,void 0,void 0,function*(){if(!this.pcManager)throw new Cc("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return Nr(this,void 0,void 0,function*(){this.pcState=Pu.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield od(2e3),!this.pcManager)throw new Cc("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=Pu.Connected}catch(ep){throw this.pcState=Pu.Disconnected,_c.internal("could not establish PC connection, ".concat(ep.message))}})}publishRpcResponse(e,t,n,i){return Nr(this,void 0,void 0,function*(){const s=new Ds({destinationIdentities:[e],kind:xs.RELIABLE,value:{case:"rpcResponse",value:new Gs({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:null!=n?n:""}})}});yield this.sendDataPacket(s,xs.RELIABLE)})}publishRpcAck(e,t){return Nr(this,void 0,void 0,function*(){const n=new Ds({destinationIdentities:[e],kind:xs.RELIABLE,value:{case:"rpcAck",value:new zs({requestId:t})}});yield this.sendDataPacket(n,xs.RELIABLE)})}sendDataPacket(e,t){return Nr(this,void 0,void 0,function*(){if(yield this.ensurePublisherConnected(t),this.e2eeManager&&this.e2eeManager.isDataChannelEncryptionEnabled){const t=function(e){var t,n,i,s,o;if("sipDtmf"!==(null===(t=e.value)||void 0===t?void 0:t.case)&&"metrics"!==(null===(n=e.value)||void 0===n?void 0:n.case)&&"speaker"!==(null===(i=e.value)||void 0===i?void 0:i.case)&&"transcription"!==(null===(s=e.value)||void 0===s?void 0:s.case)&&"encryptedPacket"!==(null===(o=e.value)||void 0===o?void 0:o.case))return new Ns({value:e.value})}(e);if(t){const n=yield this.e2eeManager.encryptData(t.toBinary());e.value={case:"encryptedPacket",value:new As({encryptedValue:n.payload,iv:n.iv,keyIndex:n.keyIndex})}}}t===xs.RELIABLE&&(e.sequence=this.reliableDataSequence,this.reliableDataSequence+=1);const n=e.toBinary(),i=this.dataChannelForKind(t);if(i){if(t===xs.RELIABLE)yield this.waitForBufferStatusLow(t),this.reliableMessageBuffer.push({data:n,sequence:e.sequence});else{if(!this.isBufferStatusLow(t))return this.lossyDataDropCount+=1,void(this.lossyDataDropCount%100==0&&this.log.warn("dropping lossy data channel messages, total dropped: ".concat(this.lossyDataDropCount),this.logContext));this.lossyDataStatCurrentBytes+=n.byteLength}if(this.attemptingReconnect)return;i.send(n)}this.updateAndEmitDCBufferStatus(t)})}resendReliableMessagesForResume(e){return Nr(this,void 0,void 0,function*(){yield this.ensurePublisherConnected(xs.RELIABLE);const t=this.dataChannelForKind(xs.RELIABLE);t&&(this.reliableMessageBuffer.popToSequence(e),this.reliableMessageBuffer.getAll().forEach(e=>{t.send(e.data)})),this.updateAndEmitDCBufferStatus(xs.RELIABLE)})}waitForBufferStatusLow(e){return new $a((t,n)=>Nr(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))t();else{const i=()=>n(new Cc("engine closed"));for(this.once(mc.Closing,i);!this.dcBufferStatus.get(e);)yield od(10);this.off(mc.Closing,i),t()}}))}ensureDataTransportConnected(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;return function*(){var i;if(!t.pcManager)throw new Cc("PC manager is closed");const s=n?t.pcManager.subscriber:t.pcManager.publisher,o=n?"Subscriber":"Publisher";if(!s)throw _c.internal("".concat(o," connection not set"));let r=!1;n||t.dataChannelForKind(e,n)||(t.createDataChannels(),r=!0),r||n||t.pcManager.publisher.isICEConnected||"checking"===t.pcManager.publisher.getICEConnectionState()||(r=!0),r&&t.negotiate().catch(e=>{Lr.error(e,t.logContext)});const a=t.dataChannelForKind(e,n);if("open"===(null==a?void 0:a.readyState))return;const c=/* @__PURE__ */(new Date).getTime()+t.peerConnectionTimeout;for(;/* @__PURE__ */(new Date).getTime()<c;){if(s.isICEConnected&&"open"===(null===(i=t.dataChannelForKind(e,n))||void 0===i?void 0:i.readyState))return;yield od(50)}throw _c.internal("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()))}()})}ensurePublisherConnected(e){return Nr(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){if(!this.pcManager)return!1;return!![$l.CONNECTING,$l.CONNECTED].includes(this.pcManager.currentState)&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return Nr(this,void 0,void 0,function*(){return new $a((e,t)=>Nr(this,void 0,void 0,function*(){if(!this.pcManager)return void t(new wc("PC manager is closed"));this.pcManager.requirePublisher(),0!=this.pcManager.publisher.getTransceivers().length||this.lossyDC||this.reliableDC||this.createDataChannels();const n=new AbortController,i=()=>{n.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&t(new wc("cannot negotiate on closed engine")),this.on(mc.Closing,i),this.on(mc.Restarting,i),this.pcManager.publisher.once(Fl,e=>{const t=/* @__PURE__ */new Map;e.forEach(e=>{const n=e.codec.toLowerCase();var i;i=n,Lc.includes(i)&&t.set(e.payload,n)}),this.emit(mc.RTPVideoMapUpdate,t)});try{yield this.pcManager.negotiate(n),e()}catch(ep){if(n.signal.aborted)return void e();ep instanceof wc&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",vs.RR_UNKNOWN),ep instanceof Error?t(ep):t(new Error(String(ep)))}finally{this.off(mc.Closing,i),this.off(mc.Restarting,i)}}))})}dataChannelForKind(e,t){if(t){if(e===xs.LOSSY)return this.lossyDCSub;if(e===xs.RELIABLE)return this.reliableDCSub}else{if(e===xs.LOSSY)return this.lossyDC;if(e===xs.RELIABLE)return this.reliableDC}}sendSyncState(e,t){var n,i,s,o;if(!this.pcManager)return void this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);const r=this.pcManager.publisher.getLocalDescription(),a=this.pcManager.publisher.getRemoteDescription(),c=null===(n=this.pcManager.subscriber)||void 0===n?void 0:n.getRemoteDescription(),d=null===(i=this.pcManager.subscriber)||void 0===i?void 0:i.getLocalDescription(),l=null===(o=null===(s=this.signalOpts)||void 0===s?void 0:s.autoSubscribe)||void 0===o||o,u=new Array,h=new Array;e.forEach(e=>{e.isDesired!==l&&u.push(e.trackSid),e.isEnabled||h.push(e.trackSid)}),this.client.sendSyncState(new ir({answer:"publisher-only"===this.pcManager.mode?a?yl({sdp:a.sdp,type:a.type}):void 0:d?yl({sdp:d.sdp,type:d.type}):void 0,offer:"publisher-only"===this.pcManager.mode?r?yl({sdp:r.sdp,type:r.type}):void 0:c?yl({sdp:c.sdp,type:c.type}):void 0,subscription:new Oo({trackSids:u,subscribe:!l,participantTracks:[]}),publishTracks:Kc(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:h,datachannelReceiveStates:this.reliableReceivedState.map((e,t)=>new sr({publisherSid:t,lastSeq:e}))}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],t=(t,n)=>{void 0!==(null==t?void 0:t.id)&&null!==t.id&&e.push(new or({label:t.label,id:t.id,target:n}))};return t(this.dataChannelForKind(xs.LOSSY),uo.PUBLISHER),t(this.dataChannelForKind(xs.RELIABLE),uo.PUBLISHER),t(this.dataChannelForKind(xs.LOSSY,!0),uo.SUBSCRIBER),t(this.dataChannelForKind(xs.RELIABLE,!0),uo.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Ic.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){gd()&&(window.addEventListener("online",this.handleBrowserOnLine),window.addEventListener("offline",this.handleBrowserOffline))}deregisterOnLineListener(){gd()&&(window.removeEventListener("online",this.handleBrowserOnLine),window.removeEventListener("offline",this.handleBrowserOffline))}getTrackIdForReceiver(e){var t;const n=null===(t=this.pcManager)||void 0===t?void 0:t.getMidForReceiver(e);if(n){const e=Object.entries(this.midToTrackId).find(e=>{let[t]=e;return t===n});if(e)return e[1]}}}function Mu(e,t){const n=e.participantIdentity?e.participantIdentity:t.participantIdentity;e.participantIdentity=n,t.participantIdentity=n;const i=0!==e.destinationIdentities.length?e.destinationIdentities:t.destinationIdentities;e.destinationIdentities=i,t.destinationIdentities=i}class Lu{get info(){return this._info}validateBytesReceived(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("number"==typeof this.totalByteSize&&0!==this.totalByteSize){if(e&&this.bytesReceived<this.totalByteSize)throw new Ec("Not enough chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, only received ").concat(this.bytesReceived," bytes"),rc.Incomplete);if(this.bytesReceived>this.totalByteSize)throw new Ec("Extra chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, received ").concat(this.bytesReceived," bytes"),rc.LengthExceeded)}}constructor(e,t,n,i){this.reader=t,this.totalByteSize=n,this._info=e,this.bytesReceived=0,this.outOfBandFailureRejectingFuture=i}}class Ou extends Lu{handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const n=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(t=this.onProgress)||void 0===t||t.call(this,n)}[Symbol.asyncIterator](){const e=this.reader.getReader();let t=new Od,n=null,i=null;if(this.signal){const e=this.signal;i=()=>{var n;null===(n=t.reject)||void 0===n||n.call(t,e.reason)},e.addEventListener("abort",i),n=e}const s=()=>{e.releaseLock(),n&&i&&n.removeEventListener("abort",i),this.signal=void 0};return{next:()=>Nr(this,void 0,void 0,function*(){var n,i;try{const{done:s,value:o}=yield Promise.race([e.read(),t.promise,null!==(i=null===(n=this.outOfBandFailureRejectingFuture)||void 0===n?void 0:n.promise)&&void 0!==i?i:new Promise(()=>{})]);return s?(this.validateBytesReceived(!0),{done:!0,value:void 0}):(this.handleChunkReceived(o),{done:!1,value:o.content})}catch(o){throw s(),o}}),return(){return Nr(this,void 0,void 0,function*(){return s(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return Nr(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){var n,i,s,o;let r=/* @__PURE__ */new Set;const a=t.signal?e.withAbortSignal(t.signal):e;try{for(var c,d=!0,l=Fr(a);!(n=(c=yield l.next()).done);d=!0){o=c.value,d=!1;const e=o;r.add(e)}}catch(u){i={error:u}}finally{try{d||n||!(s=l.return)||(yield s.call(l))}finally{if(i)throw i.error}}return Array.from(r)}()})}}class Du extends Lu{constructor(e,t,n,i){super(e,t,n,i),this.receivedChunks=/* @__PURE__ */new Map}handleChunkReceived(e){var t;const n=Nd(e.chunkIndex),i=this.receivedChunks.get(n);if(i&&i.version>e.version)return;this.receivedChunks.set(n,e),this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const s=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(t=this.onProgress)||void 0===t||t.call(this,s)}[Symbol.asyncIterator](){const e=this.reader.getReader(),t=new TextDecoder("utf-8",{fatal:!0});let n=new Od,i=null,s=null;if(this.signal){const e=this.signal;s=()=>{var t;null===(t=n.reject)||void 0===t||t.call(n,e.reason)},e.addEventListener("abort",s),i=e}const o=()=>{e.releaseLock(),i&&s&&i.removeEventListener("abort",s),this.signal=void 0};return{next:()=>Nr(this,void 0,void 0,function*(){var i,s;try{const{done:o,value:a}=yield Promise.race([e.read(),n.promise,null!==(s=null===(i=this.outOfBandFailureRejectingFuture)||void 0===i?void 0:i.promise)&&void 0!==s?s:new Promise(()=>{})]);if(o)return this.validateBytesReceived(!0),{done:!0,value:void 0};{let e;this.handleChunkReceived(a);try{e=t.decode(a.content)}catch(r){throw new Ec("Cannot decode datastream chunk ".concat(a.chunkIndex," as text: ").concat(r),rc.DecodeFailed)}return{done:!1,value:e}}}catch(r){throw o(),r}}),return(){return Nr(this,void 0,void 0,function*(){return o(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return Nr(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){var n,i,s,o;let r="";const a=t.signal?e.withAbortSignal(t.signal):e;try{for(var c,d=!0,l=Fr(a);!(n=(c=yield l.next()).done);d=!0){o=c.value,d=!1;r+=o}}catch(u){i={error:u}}finally{try{d||n||!(s=l.return)||(yield s.call(l))}finally{if(i)throw i.error}}return r}()})}}class xu{constructor(){this.log=Lr,this.byteStreamControllers=/* @__PURE__ */new Map,this.textStreamControllers=/* @__PURE__ */new Map,this.byteStreamHandlers=/* @__PURE__ */new Map,this.textStreamHandlers=/* @__PURE__ */new Map}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new Ec('A text stream handler for topic "'.concat(e,'" has already been set.'),rc.HandlerAlreadyRegistered);this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new Ec('A byte stream handler for topic "'.concat(e,'" has already been set.'),rc.HandlerAlreadyRegistered);this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}clearControllers(){this.byteStreamControllers.clear(),this.textStreamControllers.clear()}validateParticipantHasNoActiveDataStreams(e){var t,n,i,s;const o=Array.from(this.textStreamControllers.entries()).filter(t=>t[1].sendingParticipantIdentity===e),r=Array.from(this.byteStreamControllers.entries()).filter(t=>t[1].sendingParticipantIdentity===e);if(o.length>0||r.length>0){const a=new Ec("Participant ".concat(e," unexpectedly disconnected in the middle of sending data"),rc.AbnormalEnd);for(const[e,i]of r)null===(n=(t=i.outOfBandFailureRejectingFuture).reject)||void 0===n||n.call(t,a),this.byteStreamControllers.delete(e);for(const[e,t]of o)null===(s=(i=t.outOfBandFailureRejectingFuture).reject)||void 0===s||s.call(i,a),this.textStreamControllers.delete(e)}}handleDataStreamPacket(e,t){return Nr(this,void 0,void 0,function*(){switch(e.value.case){case"streamHeader":return this.handleStreamHeader(e.value.value,e.participantIdentity,t);case"streamChunk":return this.handleStreamChunk(e.value.value,t);case"streamTrailer":return this.handleStreamTrailer(e.value.value,t);default:throw new Error('DataPacket of value "'.concat(e.value.case,'" is not data stream related!'))}})}handleStreamHeader(e,t,n){return Nr(this,void 0,void 0,function*(){var i;if("byteHeader"===e.contentHeader.case){const s=this.byteStreamHandlers.get(e.topic);if(!s)return void this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);let o;const r=new Od;r.promise.catch(e=>{this.log.error(e)});const a={id:e.streamId,name:null!==(i=e.contentHeader.value.name)&&void 0!==i?i:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Nd(e.timestamp),attributes:e.attributes,encryptionType:n},c=new ReadableStream({start:n=>{if(o=n,this.textStreamControllers.has(e.streamId))throw new Ec("A data stream read is already in progress for a stream with id ".concat(e.streamId,"."),rc.AlreadyOpened);this.byteStreamControllers.set(e.streamId,{info:a,controller:o,startTime:Date.now(),sendingParticipantIdentity:t,outOfBandFailureRejectingFuture:r})}});s(new Ou(a,c,Nd(e.totalLength),r),{identity:t})}else if("textHeader"===e.contentHeader.case){const i=this.textStreamHandlers.get(e.topic);if(!i)return void this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);let s;const o=new Od;o.promise.catch(e=>{this.log.error(e)});const r={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes,encryptionType:n,attachedStreamIds:e.contentHeader.value.attachedStreamIds},a=new ReadableStream({start:n=>{if(s=n,this.textStreamControllers.has(e.streamId))throw new Ec("A data stream read is already in progress for a stream with id ".concat(e.streamId,"."),rc.AlreadyOpened);this.textStreamControllers.set(e.streamId,{info:r,controller:s,startTime:Date.now(),sendingParticipantIdentity:t,outOfBandFailureRejectingFuture:o})}});i(new Du(r,a,Nd(e.totalLength),o),{identity:t})}})}handleStreamChunk(e,t){const n=this.byteStreamControllers.get(e.streamId);n&&(n.info.encryptionType!==t?(n.controller.error(new Ec("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(n.info.encryptionType),rc.EncryptionTypeMismatch)),this.byteStreamControllers.delete(e.streamId)):e.content.length>0&&n.controller.enqueue(e));const i=this.textStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==t?(i.controller.error(new Ec("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(i.info.encryptionType),rc.EncryptionTypeMismatch)),this.textStreamControllers.delete(e.streamId)):e.content.length>0&&i.controller.enqueue(e))}handleStreamTrailer(e,t){const n=this.textStreamControllers.get(e.streamId);n&&(n.info.encryptionType!==t?n.controller.error(new Ec("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(n.info.encryptionType),rc.EncryptionTypeMismatch)):(n.info.attributes=Object.assign(Object.assign({},n.info.attributes),e.attributes),n.controller.close(),this.textStreamControllers.delete(e.streamId)));const i=this.byteStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==t?i.controller.error(new Ec("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(i.info.encryptionType),rc.EncryptionTypeMismatch)):(i.info.attributes=Object.assign(Object.assign({},i.info.attributes),e.attributes),i.controller.close()),this.byteStreamControllers.delete(e.streamId))}}class Au{constructor(e,t,n){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=n,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return Nr(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),null===(e=this.onClose)||void 0===e||e.call(this)})}}class Nu extends Au{}class Uu extends Au{}class Fu{constructor(e,t){this.engine=e,this.log=t}setupEngine(e){this.engine=e}sendText(e,t){return Nr(this,void 0,void 0,function*(){var n;const i=crypto.randomUUID(),s=(new TextEncoder).encode(e).byteLength,o=null===(n=null==t?void 0:t.attachments)||void 0===n?void 0:n.map(()=>crypto.randomUUID()),r=new Array(o?o.length+1:1).fill(0),a=(e,n)=>{var i;r[n]=e;const s=r.reduce((e,t)=>e+t,0);null===(i=null==t?void 0:t.onProgress)||void 0===i||i.call(t,s)},c=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:null==t?void 0:t.destinationIdentities,topic:null==t?void 0:t.topic,attachedStreamIds:o,attributes:null==t?void 0:t.attributes});return yield c.write(e),a(1,0),yield c.close(),(null==t?void 0:t.attachments)&&o&&(yield Promise.all(t.attachments.map((e,n)=>Nr(this,void 0,void 0,function*(){return this._sendFile(o[n],e,{topic:t.topic,mimeType:e.type,onProgress:e=>{a(e,n+1)}})})))),c.info})}streamText(e){return Nr(this,void 0,void 0,function*(){var t,n,i;const s=null!==(t=null==e?void 0:e.streamId)&&void 0!==t?t:crypto.randomUUID(),o={id:s,mimeType:"text/plain",timestamp:Date.now(),topic:null!==(n=null==e?void 0:e.topic)&&void 0!==n?n:"",size:null==e?void 0:e.totalSize,attributes:null==e?void 0:e.attributes,encryptionType:(null===(i=this.engine.e2eeManager)||void 0===i?void 0:i.isDataChannelEncryptionEnabled)?Es.GCM:Es.NONE,attachedStreamIds:null==e?void 0:e.attachedStreamIds},r=new ro({streamId:s,mimeType:o.mimeType,topic:o.topic,timestamp:Ud(o.timestamp),totalLength:Ud(null==e?void 0:e.totalSize),attributes:o.attributes,contentHeader:{case:"textHeader",value:new so({version:null==e?void 0:e.version,attachedStreamIds:o.attachedStreamIds,replyToStreamId:null==e?void 0:e.replyToStreamId,operationType:"update"===(null==e?void 0:e.type)?io.UPDATE:io.CREATE})}}),a=null==e?void 0:e.destinationIdentities,c=new Ds({destinationIdentities:a,value:{case:"streamHeader",value:r}});yield this.engine.sendDataPacket(c,xs.RELIABLE);let d=0;const l=this.engine,u=new WritableStream({write(e){return Nr(this,void 0,void 0,function*(){for(const t of function(e,t){const n=[];let i=(new TextEncoder).encode(e);for(;i.length>t;){let e=t;for(;e>0;){const t=i[e];if(void 0!==t&&128!=(192&t))break;e--}n.push(i.slice(0,e)),i=i.slice(e)}return i.length>0&&n.push(i),n}(e,15e3)){const e=new ao({content:t,streamId:s,chunkIndex:Ud(d)}),n=new Ds({destinationIdentities:a,value:{case:"streamChunk",value:e}});yield l.sendDataPacket(n,xs.RELIABLE),d+=1}})},close(){return Nr(this,void 0,void 0,function*(){const e=new co({streamId:s}),t=new Ds({destinationIdentities:a,value:{case:"streamTrailer",value:e}});yield l.sendDataPacket(t,xs.RELIABLE)})},abort(e){console.log("Sink error:",e)}});let h=()=>Nr(this,void 0,void 0,function*(){yield p.close()});l.once(mc.Closing,h);const p=new Nu(u,o,()=>this.engine.off(mc.Closing,h));return p})}sendFile(e,t){return Nr(this,void 0,void 0,function*(){const n=crypto.randomUUID();return yield this._sendFile(n,e,t),{id:n}})}_sendFile(e,t,n){return Nr(this,void 0,void 0,function*(){var i;const s=yield this.streamBytes({streamId:e,totalSize:t.size,name:t.name,mimeType:null!==(i=null==n?void 0:n.mimeType)&&void 0!==i?i:t.type,topic:null==n?void 0:n.topic,destinationIdentities:null==n?void 0:n.destinationIdentities}),o=t.stream().getReader();for(;;){const{done:e,value:t}=yield o.read();if(e)break;yield s.write(t)}return yield s.close(),s.info})}streamBytes(e){return Nr(this,void 0,void 0,function*(){var t,n,i,s,o,r;const a=null!==(t=null==e?void 0:e.streamId)&&void 0!==t?t:crypto.randomUUID(),c=null==e?void 0:e.destinationIdentities,d={id:a,mimeType:null!==(n=null==e?void 0:e.mimeType)&&void 0!==n?n:"application/octet-stream",topic:null!==(i=null==e?void 0:e.topic)&&void 0!==i?i:"",timestamp:Date.now(),attributes:null==e?void 0:e.attributes,size:null==e?void 0:e.totalSize,name:null!==(s=null==e?void 0:e.name)&&void 0!==s?s:"unknown",encryptionType:(null===(o=this.engine.e2eeManager)||void 0===o?void 0:o.isDataChannelEncryptionEnabled)?Es.GCM:Es.NONE},l=new ro({totalLength:Ud(null!==(r=d.size)&&void 0!==r?r:0),mimeType:d.mimeType,streamId:a,topic:d.topic,timestamp:Ud(Date.now()),attributes:d.attributes,contentHeader:{case:"byteHeader",value:new oo({name:d.name})}}),u=new Ds({destinationIdentities:c,value:{case:"streamHeader",value:l}});yield this.engine.sendDataPacket(u,xs.RELIABLE);let h=0;const p=new Cn,m=this.engine,g=this.log,v=new WritableStream({write(e){return Nr(this,void 0,void 0,function*(){const t=yield p.lock();let n=0;try{for(;n<e.byteLength;){const t=e.slice(n,n+15e3),i=new Ds({destinationIdentities:c,value:{case:"streamChunk",value:new ao({content:t,streamId:a,chunkIndex:Ud(h)})}});yield m.sendDataPacket(i,xs.RELIABLE),h+=1,n+=t.byteLength}}finally{t()}})},close(){return Nr(this,void 0,void 0,function*(){const e=new co({streamId:a}),t=new Ds({destinationIdentities:c,value:{case:"streamTrailer",value:e}});yield m.sendDataPacket(t,xs.RELIABLE)})},abort(e){g.error("Sink error:",e)}});return new Uu(v,d)})}}class ju extends td{constructor(e,t,n,i,s){super(e,n,s),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?vc.Muted:vc.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=n=>{n.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(vc.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return Nr(this,void 0,void 0,function*(){var e;if(!(null===(e=this.receiver)||void 0===e?void 0:e.getStats))return;return yield this.receiver.getStats()})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),nu)),"undefined"!=typeof RTCRtpReceiver&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const n=null===(t=this.receiver)||void 0===t?void 0:t.getSynchronizationSources()[0];if(n){const{timestamp:e,rtpTimestamp:t}=n;t&&this.rtpTimestamp!==t&&(this.emit(vc.TimeSyncUpdate,{timestamp:e,rtpTimestamp:t}),this.rtpTimestamp=t)}};e()}}class Bu extends ju{constructor(e,t,n,i,s,o){super(e,t,td.Kind.Audio,n,o),this.monitorReceiver=()=>Nr(this,void 0,void 0,function*(){if(!this.receiver)return void(this._currentBitrate=0);const e=yield this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=iu(e,this.prevStats)),this.prevStats=e}),this.audioContext=i,this.webAudioPluginNodes=[],s&&(this.sinkId=s.deviceId)}setVolume(e){var t;for(const n of this.attachedElements)this.audioContext?null===(t=this.gainNode)||void 0===t||t.gain.setTargetAtTime(e,0,.1):n.volume=e;vd()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(vd())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return Nr(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(dd(t))return t.setSinkId(e)}))})}attach(e){const t=0===this.attachedElements.length;return e?super.attach(e):e=super.attach(),this.sinkId&&dd(e)&&e.setSinkId(this.sinkId).catch(e=>{this.log.error("Failed to set sink id on remote audio track",e,this.logContext)}),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let n=this.sourceNode;this.webAudioPluginNodes.forEach(e=>{n.connect(e),n=e}),this.gainNode=e.createGain(),n.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),"running"!==e.state&&e.resume().then(()=>{"running"!==e.state&&this.emit(vc.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(e=>{this.emit(vc.AudioPlaybackFailed,e)})}disconnectWebAudio(){var e,t;null===(e=this.gainNode)||void 0===e||e.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return Nr(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;let e;return(yield this.receiver.getStats()).forEach(t=>{"inbound-rtp"===t.type&&(e={type:"audio",streamId:t.id,timestamp:t.timestamp,jitter:t.jitter,bytesReceived:t.bytesReceived,concealedSamples:t.concealedSamples,concealmentEvents:t.concealmentEvents,silentConcealedSamples:t.silentConcealedSamples,silentConcealmentEvents:t.silentConcealmentEvents,totalAudioEnergy:t.totalAudioEnergy,totalSamplesDuration:t.totalSamplesDuration})}),e})}}class qu extends ju{constructor(e,t,n,i,s){super(e,t,td.Kind.Video,n,s),this.elementInfos=[],this.monitorReceiver=()=>Nr(this,void 0,void 0,function*(){if(!this.receiver)return void(this._currentBitrate=0);const e=yield this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=iu(e,this.prevStats)),this.prevStats=e}),this.debouncedHandleResize=Al(()=>{this.updateDimensions()},100),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}setStreamState(e){super.setStreamState(e),this.log.debug("setStreamState",e),this.isAdaptiveStream&&e===td.StreamState.Active&&this.updateVisibility()}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?id(this._mediaStreamTrack,t):nd(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find(t=>t.element===e)){const t=new Vu(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&void 0===this.elementInfos.find(t=>t===e)?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream)return void this.log.warn("stopObservingElementInfo ignored",this.logContext);const t=this.elementInfos.filter(t=>t===e);for(const n of t)n.stopObserving();this.elementInfos=this.elementInfos.filter(t=>t!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const n of t)this.stopObservingElement(n);return t}getDecoderImplementation(){var e;return null===(e=this.prevStats)||void 0===e?void 0:e.decoderImplementation}getReceiverStats(){return Nr(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,n="",i=/* @__PURE__ */new Map;return e.forEach(e=>{"inbound-rtp"===e.type?(n=e.codecId,t={type:"video",streamId:e.id,framesDecoded:e.framesDecoded,framesDropped:e.framesDropped,framesReceived:e.framesReceived,packetsReceived:e.packetsReceived,packetsLost:e.packetsLost,frameWidth:e.frameWidth,frameHeight:e.frameHeight,pliCount:e.pliCount,firCount:e.firCount,nackCount:e.nackCount,jitter:e.jitter,timestamp:e.timestamp,bytesReceived:e.bytesReceived,decoderImplementation:e.decoderImplementation}):"codec"===e.type&&i.set(e.id,e)}),t&&""!==n&&i.get(n)&&(t.mimeType=i.get(n).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(t=>t.element===e);for(const n of t)this.stopObservingElementInfo(n)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Nr(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(e){var t,n;const i=this.elementInfos.reduce((e,t)=>Math.max(e,t.visibilityChangedAt||0),0),s=!(null!==(n=null===(t=this.adaptiveStreamSettings)||void 0===t?void 0:t.pauseVideoInBackground)&&void 0!==n&&!n)&&this.isInBackground,o=this.elementInfos.some(e=>e.pictureInPicture),r=this.elementInfos.some(e=>e.visible)&&!s||o;(this.lastVisible!==r||e)&&(!r&&Date.now()-i<100?Ic.setTimeout(()=>{this.updateVisibility()},100):(this.lastVisible=r,this.emit(vc.VisibilityChanged,r,this)))}updateDimensions(){var e,t;let n=0,i=0;const s=this.getPixelDensity();for(const o of this.elementInfos){const e=o.width()*s,t=o.height()*s;e+t>n+i&&(n=e,i=t)}(null===(e=this.lastDimensions)||void 0===e?void 0:e.width)===n&&(null===(t=this.lastDimensions)||void 0===t?void 0:t.height)===i||(this.lastDimensions={width:n,height:i},this.emit(vc.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=null===(e=this.adaptiveStreamSettings)||void 0===e?void 0:e.pixelDensity;if("screen"===t)return kd();if(!t){return kd()>2?2:1}return t}}class Vu{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=e=>{var t;const{target:n,isIntersecting:i}=e;n===this.element&&(this.isIntersecting=i,this.isPiP=Wu(this.element),this.visibilityChangedAt=Date.now(),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this))},this.onEnterPiP=()=>{var e,t,n;null===(t=null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)||void 0===t||t.addEventListener("pagehide",this.onLeavePiP),this.isPiP=Wu(this.element),null===(n=this.handleVisibilityChanged)||void 0===n||n.call(this)},this.onLeavePiP=()=>{var e;this.isPiP=Wu(this.element),null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.element=e,this.isIntersecting=null!=t?t:Hu(e),this.isPiP=gd()&&Wu(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,n;this.isIntersecting=Hu(this.element),this.isPiP=Wu(this.element),this.element.handleResize=()=>{var e;null===(e=this.handleResize)||void 0===e||e.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,Id().observe(this.element),Ed().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),null===(e=window.documentPictureInPicture)||void 0===e||e.addEventListener("enter",this.onEnterPiP),null===(n=null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)||void 0===n||n.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,n,i,s;null===(e=Id())||void 0===e||e.unobserve(this.element),null===(t=Ed())||void 0===t||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),null===(n=window.documentPictureInPicture)||void 0===n||n.removeEventListener("enter",this.onEnterPiP),null===(s=null===(i=window.documentPictureInPicture)||void 0===i?void 0:i.window)||void 0===s||s.removeEventListener("pagehide",this.onLeavePiP)}}function Wu(e){var t,n;return document.pictureInPictureElement===e||!!(null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)&&Hu(e,null===(n=window.documentPictureInPicture)||void 0===n?void 0:n.window)}function Hu(e,t){const n=t||window;let i=e.offsetTop,s=e.offsetLeft;const o=e.offsetWidth,r=e.offsetHeight,{hidden:a}=e,{display:c}=getComputedStyle(e);for(;e.offsetParent;)i+=(e=e.offsetParent).offsetTop,s+=e.offsetLeft;return i<n.pageYOffset+n.innerHeight&&s<n.pageXOffset+n.innerWidth&&i+r>n.pageYOffset&&s+o>n.pageXOffset&&!a&&"none"!==c}class zu extends qr.EventEmitter{constructor(e,t,n,i){var s;super(),this.metadataMuted=!1,this.encryption=Es.NONE,this.log=Lr,this.handleMuted=()=>{this.emit(vc.Muted)},this.handleUnmuted=()=>{this.emit(vc.Unmuted)},this.log=Or(null!==(s=null==i?void 0:i.loggerName)&&void 0!==s?s:Ir.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=n,this.source=td.Source.Unknown}setTrack(e){this.track&&(this.track.off(vc.Muted,this.handleMuted),this.track.off(vc.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(vc.Muted,this.handleMuted),e.on(vc.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},null===(e=this.loggerContextCb)||void 0===e?void 0:e.call(this)),$c(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get isEncrypted(){return this.encryption!==Es.NONE}get audioTrack(){if(jd(this.track))return this.track}get videoTrack(){if(Bd(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=td.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===td.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}var Gu,Ju,Ku,$u,Qu,Yu,Xu;Gu=zu||(zu={}),(Ju=Gu.SubscriptionStatus||(Gu.SubscriptionStatus={})).Desired="desired",Ju.Subscribed="subscribed",Ju.Unsubscribed="unsubscribed",(Ku=Gu.PermissionStatus||(Gu.PermissionStatus={})).Allowed="allowed",Ku.NotAllowed="not_allowed";class Zu extends zu{get isUpstreamPaused(){var e;return null===(e=this.track)||void 0===e?void 0:e.isUpstreamPaused}constructor(e,t,n,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(vc.Ended)},this.handleCpuConstrained=()=>{this.track&&Bd(this.track)&&this.emit(vc.CpuConstrained,this.track)},this.updateInfo(t),this.setTrack(n)}setTrack(e){this.track&&(this.track.off(vc.Ended,this.handleTrackEnded),this.track.off(vc.CpuConstrained,this.handleCpuConstrained)),super.setTrack(e),e&&(e.on(vc.Ended,this.handleTrackEnded),e.on(vc.CpuConstrained,this.handleCpuConstrained))}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return Nr(this,void 0,void 0,function*(){var e;return null===(e=this.track)||void 0===e?void 0:e.mute()})}unmute(){return Nr(this,void 0,void 0,function*(){var e;return null===(e=this.track)||void 0===e?void 0:e.unmute()})}pauseUpstream(){return Nr(this,void 0,void 0,function*(){var e;yield null===(e=this.track)||void 0===e?void 0:e.pauseUpstream()})}resumeUpstream(){return Nr(this,void 0,void 0,function*(){var e;yield null===(e=this.track)||void 0===e?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(jd(this.track)){const t=this.track.getSourceTrackSettings(),n=/* @__PURE__ */new Set;return t.autoGainControl&&n.add(_s.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&n.add(_s.TF_ECHO_CANCELLATION),t.noiseSuppression&&n.add(_s.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&n.add(_s.TF_STEREO),(null===(e=this.options)||void 0===e?void 0:e.dtx)||n.add(_s.TF_NO_DTX),this.track.enhancedNoiseCancellation&&n.add(_s.TF_ENHANCED_NOISE_CANCELLATION),Array.from(n.values())}return[]}}function eh(e,t){return Nr(this,void 0,void 0,function*(){null!=e||(e={});let n=!1;const{audioProcessor:i,videoProcessor:s,optionsWithoutProcessor:o}=Qc(e);let r=o.audio,a=o.video;if(i&&"object"==typeof o.audio&&(o.audio.processor=i),s&&"object"==typeof o.video&&(o.video.processor=s),e.audio&&"object"==typeof o.audio&&"string"==typeof o.audio.deviceId){const e=o.audio.deviceId;o.audio.deviceId={exact:e},n=!0,r=Object.assign(Object.assign({},o.audio),{deviceId:{ideal:e}})}if(o.video&&"object"==typeof o.video&&"string"==typeof o.video.deviceId){const e=o.video.deviceId;o.video.deviceId={exact:e},n=!0,a=Object.assign(Object.assign({},o.video),{deviceId:{ideal:e}})}!0===o.audio?o.audio={deviceId:"default"}:"object"==typeof o.audio&&null!==o.audio&&(o.audio=Object.assign(Object.assign({},o.audio),{deviceId:o.audio.deviceId||"default"})),!0===o.video?o.video={deviceId:"default"}:"object"!=typeof o.video||o.video.deviceId||(o.video.deviceId="default");const c=Bc(o,zl,Gl),d=Vc(c),l=navigator.mediaDevices.getUserMedia(d);o.audio&&(ll.userMediaPromiseMap.set("audioinput",l),l.catch(()=>ll.userMediaPromiseMap.delete("audioinput"))),o.video&&(ll.userMediaPromiseMap.set("videoinput",l),l.catch(()=>ll.userMediaPromiseMap.delete("videoinput")));try{const e=yield l;return yield Promise.all(e.getTracks().map(n=>Nr(this,void 0,void 0,function*(){const o="audio"===n.kind;let r,a=o?c.audio:c.video;"boolean"!=typeof a&&a||(a={});const l=o?d.audio:d.video;"boolean"!=typeof l&&(r=l);const u=n.getSettings().deviceId;(null==r?void 0:r.deviceId)&&Dd(r.deviceId)!==u?r.deviceId=u:r||(r={deviceId:u});const h=function(e,t,n){switch(e.kind){case"audio":return new cu(e,t,!1,void 0,n);case"video":return new yu(e,t,!1,n);default:throw new yc("unsupported track type: ".concat(e.kind))}}(n,r,t);return h.kind===td.Kind.Video?h.source=td.Source.Camera:h.kind===td.Kind.Audio&&(h.source=td.Source.Microphone),h.mediaStream=e,jd(h)&&i?yield h.setProcessor(i):Bd(h)&&s&&(yield h.setProcessor(s)),h})))}catch(ep){if(!n)throw ep;return eh(Object.assign(Object.assign({},e),{audio:r,video:a}),t)}})}function th(e){return Nr(this,void 0,void 0,function*(){return(yield eh({audio:null==e||e,video:!1}))[0]})}(Qu=$u||($u={})).Excellent="excellent",Qu.Good="good",Qu.Poor="poor",Qu.Lost="lost",Qu.Unknown="unknown";class nh extends qr.EventEmitter{get logContext(){var e,t;return Object.assign({},null===(t=null===(e=this.loggerOptions)||void 0===e?void 0:e.loggerContextCb)||void 0===t?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return(null===(e=this.permissions)||void 0===e?void 0:e.agent)||this.kind===Ts.AGENT}get isActive(){var e;return(null===(e=this.participantInfo)||void 0===e?void 0:e.state)===ws.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,n,i,s,o){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Ts.STANDARD;var a;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=$u.Unknown,this.log=Lr,this.log=Or(null!==(a=null==o?void 0:o.loggerName)&&void 0!==a?a:Ir.Participant),this.loggerOptions=o,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=n,this.metadata=i,this.audioTrackPublications=/* @__PURE__ */new Map,this.videoTrackPublications=/* @__PURE__ */new Map,this.trackPublications=/* @__PURE__ */new Map,this._kind=r,this._attributes=null!=s?s:{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}waitUntilActive(){return this.isActive?Promise.resolve():(this.activeFuture||(this.activeFuture=new Od,this.once(hc.Active,()=>{var e,t;null===(t=null===(e=this.activeFuture)||void 0===e?void 0:e.resolve)||void 0===t||t.call(e),this.activeFuture=void 0})),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(td.Source.Camera);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(td.Source.Microphone);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(td.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(1e3*Number.parseInt(this.participantInfo.joinedAt.toString())):/* @__PURE__ */new Date}updateInfo(e){var t;return!(this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version)&&(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===ws.ACTIVE&&(null===(t=this.participantInfo)||void 0===t?void 0:t.state)!==ws.ACTIVE&&this.emit(hc.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const t=this.metadata!==e,n=this.metadata;this.metadata=e,t&&this.emit(hc.ParticipantMetadataChanged,n)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(hc.ParticipantNameChanged,e)}_setAttributes(e){const t=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={});const i=[...Object.keys(t),...Object.keys(e)],s={};for(const o of i)e[o]!==t[o]&&(s[o]=null!==(n=t[o])&&void 0!==n?n:"");return s}(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(hc.AttributesChanged,t)}setPermissions(e){var t,n,i,s,o,r;const a=this.permissions,c=e.canPublish!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublish)||e.canSubscribe!==(null===(n=this.permissions)||void 0===n?void 0:n.canSubscribe)||e.canPublishData!==(null===(i=this.permissions)||void 0===i?void 0:i.canPublishData)||e.hidden!==(null===(s=this.permissions)||void 0===s?void 0:s.hidden)||e.recorder!==(null===(o=this.permissions)||void 0===o?void 0:o.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((e,t)=>{var n;return e!==(null===(n=this.permissions)||void 0===n?void 0:n.canPublishSources[t])})||e.canSubscribeMetrics!==(null===(r=this.permissions)||void 0===r?void 0:r.canSubscribeMetrics);return this.permissions=e,c&&this.emit(hc.ParticipantPermissionsChanged,a),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=/* @__PURE__ */new Date),this.emit(hc.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=function(e){switch(e){case ps.EXCELLENT:return $u.Excellent;case ps.GOOD:return $u.Good;case ps.POOR:return $u.Poor;case ps.LOST:return $u.Lost;default:return $u.Unknown}}(e),t!==this._connectionQuality&&this.emit(hc.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,t;this.activeFuture&&(null===(t=(e=this.activeFuture).reject)||void 0===t||t.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>jd(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(vc.Muted,()=>{this.emit(hc.TrackMuted,e)}),e.on(vc.Unmuted,()=>{this.emit(hc.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case td.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case td.Kind.Video:this.videoTrackPublications.set(e.trackSid,e)}}}class ih extends nh{constructor(e,t,n,i,s,o){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=/* @__PURE__ */new Set,this.pendingPublishPromises=/* @__PURE__ */new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=Es.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=/* @__PURE__ */new Map,this.pendingResponses=/* @__PURE__ */new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Od)},this.handleReconnected=()=>{var e,t;null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.resolve)||void 0===t||t.call(e),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleClosing=()=>{var e,t,n,i,s,o;this.reconnectFuture&&(this.reconnectFuture.promise.catch(e=>this.log.warn(e.message,this.logContext)),null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.reject)||void 0===t||t.call(e,new Error("Got disconnected during reconnection attempt")),this.reconnectFuture=void 0),this.signalConnectedFuture&&(null===(i=(n=this.signalConnectedFuture).reject)||void 0===i||i.call(n,new Error("Got disconnected without signal connected")),this.signalConnectedFuture=void 0),null===(o=null===(s=this.activeAgentFuture)||void 0===s?void 0:s.reject)||void 0===o||o.call(s,new Error("Got disconnected without active agent present")),this.activeAgentFuture=void 0,this.firstActiveAgent=void 0},this.handleSignalConnected=e=>{var t,n;e.participant&&this.updateInfo(e.participant),this.signalConnectedFuture||(this.signalConnectedFuture=new Od),null===(n=(t=this.signalConnectedFuture).resolve)||void 0===n||n.call(t)},this.handleSignalRequestResponse=e=>{const{requestId:t,reason:n,message:i}=e,s=this.pendingSignalRequests.get(t);s&&(n!==pr.OK&&s.reject(new Sc(i,n)),this.pendingSignalRequests.delete(t))},this.handleDataPacket=e=>{switch(e.value.case){case"rpcResponse":let t=e.value.value,n=null,i=null;"payload"===t.value.case?n=t.value.value:"error"===t.value.case&&(i=Zl.fromProto(t.value.value)),this.handleIncomingRpcResponse(t.requestId,n,i);break;case"rpcAck":let s=e.value.value;this.handleIncomingRpcAck(s.requestId)}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(e=>function(e){var t,n,i;if(!e.participantSid&&!e.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Zo({participantIdentity:null!==(t=e.participantIdentity)&&void 0!==t?t:"",participantSid:null!==(n=e.participantSid)&&void 0!==n?n:"",allTracks:null!==(i=e.allowAll)&&void 0!==i&&i,trackSids:e.allowedTrackSids||[]})}(e)))},this.onTrackUnmuted=e=>{this.onTrackMuted(e,e.isUpstreamPaused)},this.onTrackMuted=(e,t)=>{void 0===t&&(t=!0),e.sid?this.engine.updateMuteStatus(e.sid,t):this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),$c(e)))},this.onTrackUpstreamPaused=e=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),$c(e))),this.onTrackMuted(e,!0)},this.onTrackUpstreamResumed=e=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),$c(e))),this.onTrackMuted(e,e.isMuted)},this.onTrackFeatureUpdate=e=>{const t=this.audioTrackPublications.get(e.sid);t?this.engine.client.sendUpdateLocalAudioTrack(t.trackSid,t.getTrackFeatures()):this.log.warn("Could not update local audio track settings, missing publication for track ".concat(e.sid),this.logContext)},this.onTrackCpuConstrained=(e,t)=>{this.log.debug("track cpu constrained",Object.assign(Object.assign({},this.logContext),$c(t))),this.emit(hc.LocalTrackCpuConstrained,e,t)},this.handleSubscribedQualityUpdate=e=>Nr(this,void 0,void 0,function*(){var t,n,i,s,o;if(!(null===(o=this.roomOptions)||void 0===o?void 0:o.dynacast))return;const r=this.videoTrackPublications.get(e.trackSid);if(!r)return void this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:e.trackSid}));if(!r.videoTrack)return;const a=yield r.videoTrack.setPublishingCodecs(e.subscribedCodecs);try{for(var c,d=!0,l=Fr(a);!(t=(c=yield l.next()).done);d=!0){s=c.value,d=!1;const e=s;Oc(e)&&(this.log.debug("publish ".concat(e," for ").concat(r.videoTrack.sid),Object.assign(Object.assign({},this.logContext),$c(r))),yield this.publishAdditionalCodecForTrack(r.videoTrack,e,r.options))}}catch(u){n={error:u}}finally{try{d||t||!(i=l.return)||(yield i.call(l))}finally{if(n)throw n.error}}}),this.handleLocalTrackUnpublished=e=>{const t=this.trackPublications.get(e.trackSid);t?this.unpublishTrack(t.track):this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:e.trackSid}))},this.handleTrackEnded=e=>Nr(this,void 0,void 0,function*(){if(e.source===td.Source.ScreenShare||e.source===td.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),$c(e))),this.unpublishTrack(e);else if(e.isUserProvided)yield e.mute();else if(Vd(e)||qd(e))try{if(gd())try{const t=yield null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:e.source===td.Source.Camera?"camera":"microphone"});if(t&&"denied"===t.state)throw this.log.warn("user has revoked access to ".concat(e.source),Object.assign(Object.assign({},this.logContext),$c(e))),t.onchange=()=>{"denied"!==t.state&&(e.isMuted||e.restartTrack(),t.onchange=null)},new Error("GetUserMedia Permission denied")}catch(ep){}e.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),$c(e))),Vd(e)?yield e.restartTrack({deviceId:"default"}):yield e.restartTrack())}catch(ep){this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),$c(e))),yield e.mute()}}),this.audioTrackPublications=/* @__PURE__ */new Map,this.videoTrackPublications=/* @__PURE__ */new Map,this.trackPublications=/* @__PURE__ */new Map,this.engine=n,this.roomOptions=i,this.setupEngine(n),this.activeDeviceMap=/* @__PURE__ */new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=/* @__PURE__ */new Map,this.rpcHandlers=s,this.roomOutgoingDataStreamManager=o}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==Es.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){var t;this.engine=e,this.engine.on(mc.RemoteMute,(e,t)=>{const n=this.trackPublications.get(e);n&&n.track&&(t?n.mute():n.unmute())}),(null===(t=this.signalConnectedFuture)||void 0===t?void 0:t.isResolved)&&(this.signalConnectedFuture=void 0),this.engine.on(mc.Connected,this.handleReconnected).on(mc.SignalConnected,this.handleSignalConnected).on(mc.SignalRestarted,this.handleReconnected).on(mc.SignalResumed,this.handleReconnected).on(mc.Restarting,this.handleReconnecting).on(mc.Resuming,this.handleReconnecting).on(mc.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(mc.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(mc.Closing,this.handleClosing).on(mc.SignalRequestResponse,this.handleSignalRequestResponse).on(mc.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return Nr(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return Nr(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return Nr(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return Nr(this,arguments,void 0,function(e){var t=this;let{metadata:n,name:i,attributes:s}=e;return function*(){return new $a((e,o)=>Nr(t,void 0,void 0,function*(){var t,r;try{let a=!1;const c=yield this.engine.client.sendUpdateLocalMetadata(null!==(t=null!=n?n:this.metadata)&&void 0!==t?t:"",null!==(r=null!=i?i:this.name)&&void 0!==r?r:"",s),d=performance.now();for(this.pendingSignalRequests.set(c,{resolve:e,reject:e=>{o(e),a=!0},values:{name:i,metadata:n,attributes:s}});performance.now()-d<5e3&&!a;){if((!i||this.name===i)&&(!n||this.metadata===n)&&(!s||Object.entries(s).every(e=>{let[t,n]=e;return this.attributes[t]===n||""===n&&!this.attributes[t]})))return this.pendingSignalRequests.delete(c),void e();yield od(50)}o(new Sc("Request to update local metadata timed out","TimeoutError"))}catch(ep){ep instanceof Error?o(ep):o(new Error(String(ep)))}}))}()})}setCameraEnabled(e,t,n){return this.setTrackEnabled(td.Source.Camera,e,t,n)}setMicrophoneEnabled(e,t,n){return this.setTrackEnabled(td.Source.Microphone,e,t,n)}setScreenShareEnabled(e,t,n){return this.setTrackEnabled(td.Source.ScreenShare,e,t,n)}setE2EEEnabled(e){return Nr(this,void 0,void 0,function*(){this.encryptionType=e?Es.GCM:Es.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,t,n,i){return Nr(this,void 0,void 0,function*(){var s,o;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:t})),this.republishPromise&&(yield this.republishPromise);let r=this.getTrackPublication(e);if(t)if(r)yield r.unmute();else{let t;if(this.pendingPublishing.has(e)){const t=yield this.waitForPendingPublicationOfSource(e);return t||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield null==t?void 0:t.unmute(),t}this.pendingPublishing.add(e);try{switch(e){case td.Source.Camera:t=yield this.createTracks({video:null===(s=n)||void 0===s||s});break;case td.Source.Microphone:t=yield this.createTracks({audio:null===(o=n)||void 0===o||o});break;case td.Source.ScreenShare:t=yield this.createScreenTracks(Object.assign({},n));break;default:throw new yc(e)}}catch(ep){throw null==t||t.forEach(e=>{e.stop()}),ep instanceof Error&&this.emit(hc.MediaDevicesError,ep,Gc(e)),this.pendingPublishing.delete(e),ep}for(const i of t){const t=Object.assign(Object.assign({},this.roomOptions.publishDefaults),n);e===td.Source.Microphone&&jd(i)&&t.preConnectBuffer&&(this.log.info("starting preconnect buffer for microphone",Object.assign({},this.logContext)),i.startPreConnectBuffer())}try{const e=[];for(const s of t)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),$c(s))),e.push(this.publishTrack(s,i));const n=yield Promise.all(e);[r]=n}catch(ep){throw null==t||t.forEach(e=>{e.stop()}),ep}finally{this.pendingPublishing.delete(e)}}else if(!(null==r?void 0:r.track)&&this.pendingPublishing.has(e)&&(r=yield this.waitForPendingPublicationOfSource(e),r||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),r&&r.track)if(e===td.Source.ScreenShare){r=yield this.unpublishTrack(r.track);const e=this.getTrackPublication(td.Source.ScreenShareAudio);e&&e.track&&this.unpublishTrack(e.track)}else yield r.mute();return r})}enableCameraAndMicrophone(){return Nr(this,void 0,void 0,function*(){if(!this.pendingPublishing.has(td.Source.Camera)&&!this.pendingPublishing.has(td.Source.Microphone)){this.pendingPublishing.add(td.Source.Camera),this.pendingPublishing.add(td.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(e=>this.publishTrack(e)))}finally{this.pendingPublishing.delete(td.Source.Camera),this.pendingPublishing.delete(td.Source.Microphone)}}})}createTracks(e){return Nr(this,void 0,void 0,function*(){var t,n;null!=e||(e={});const i=Bc(e,null===(t=this.roomOptions)||void 0===t?void 0:t.audioCaptureDefaults,null===(n=this.roomOptions)||void 0===n?void 0:n.videoCaptureDefaults);try{const e=yield eh(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return e.map(e=>(jd(e)&&(this.microphoneError=void 0,e.setAudioContext(this.audioContext),e.source=td.Source.Microphone,this.emit(hc.AudioStreamAcquired)),Bd(e)&&(this.cameraError=void 0,e.source=td.Source.Camera),e))}catch(s){throw s instanceof Error&&(e.audio&&(this.microphoneError=s),e.video&&(this.cameraError=s)),s}})}createScreenTracks(e){return Nr(this,void 0,void 0,function*(){if(void 0===e&&(e={}),void 0===navigator.mediaDevices.getDisplayMedia)throw new bc("getDisplayMedia not supported");void 0!==e.resolution||function(){const e=Xa();return"Safari"===(null==e?void 0:e.name)&&e.version.startsWith("17.")||"iOS"===(null==e?void 0:e.os)&&!!(null==e?void 0:e.osVersion)&&Cd(e.osVersion,"17")>=0}()||(e.resolution=jc.h1080fps30.resolution);const t=function(e){var t,n;let i=null===(t=e.video)||void 0===t||t;return e.resolution&&e.resolution.width>0&&e.resolution.height>0&&(i="boolean"==typeof i?{}:i,i=hd()?Object.assign(Object.assign({},i),{width:{max:e.resolution.width},height:{max:e.resolution.height},frameRate:e.resolution.frameRate}):Object.assign(Object.assign({},i),{width:{ideal:e.resolution.width},height:{ideal:e.resolution.height},frameRate:e.resolution.frameRate})),{audio:null!==(n=e.audio)&&void 0!==n&&n,video:i,controller:e.controller,selfBrowserSurface:e.selfBrowserSurface,surfaceSwitching:e.surfaceSwitching,systemAudio:e.systemAudio,preferCurrentTab:e.preferCurrentTab}}(e),n=yield navigator.mediaDevices.getDisplayMedia(t),i=n.getVideoTracks();if(0===i.length)throw new yc("no video track found");const s=new yu(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});s.source=td.Source.ScreenShare,e.contentHint&&(s.mediaStreamTrack.contentHint=e.contentHint);const o=[s];if(n.getAudioTracks().length>0){this.emit(hc.AudioStreamAcquired);const e=new cu(n.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});e.source=td.Source.ScreenShareAudio,o.push(e)}return o})}publishTrack(e,t){return Nr(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}publishOrRepublishTrack(e,t){return Nr(this,arguments,void 0,function(e,t){var n=this;let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function*(){var s,o,r,a;let c,d;if(Vd(e)&&e.setAudioContext(n.audioContext),yield null===(s=n.reconnectFuture)||void 0===s?void 0:s.promise,n.republishPromise&&!i&&(yield n.republishPromise),Fd(e)&&n.pendingPublishPromises.has(e)&&(yield n.pendingPublishPromises.get(e)),e instanceof MediaStreamTrack)c=e.getConstraints();else{let t;switch(c=e.constraints,e.source){case td.Source.Microphone:t="audioinput";break;case td.Source.Camera:t="videoinput"}t&&n.activeDeviceMap.has(t)&&(c=Object.assign(Object.assign({},c),{deviceId:n.activeDeviceMap.get(t)}))}if(e instanceof MediaStreamTrack)switch(e.kind){case"audio":e=new cu(e,c,!0,n.audioContext,{loggerName:n.roomOptions.loggerName,loggerContextCb:()=>n.logContext});break;case"video":e=new yu(e,c,!0,{loggerName:n.roomOptions.loggerName,loggerContextCb:()=>n.logContext});break;default:throw new yc("unsupported MediaStreamTrack kind ".concat(e.kind))}else e.updateLoggerOptions({loggerName:n.roomOptions.loggerName,loggerContextCb:()=>n.logContext});if(n.trackPublications.forEach(t=>{t.track&&t.track===e&&(d=t)}),d)return n.log.warn("track has already been published, skipping",Object.assign(Object.assign({},n.logContext),$c(d))),d;const l=Object.assign(Object.assign({},n.roomOptions.publishDefaults),t),u="channelCount"in e.mediaStreamTrack.getSettings()&&2===e.mediaStreamTrack.getSettings().channelCount||2===e.mediaStreamTrack.getConstraints().channelCount,h=null!==(o=l.forceStereo)&&void 0!==o?o:u;h&&(void 0===l.dtx&&n.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},n.logContext),$c(e))),void 0===l.red&&n.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(r=l.dtx)&&void 0!==r||(l.dtx=!1),null!==(a=l.red)&&void 0!==a||(l.red=!1)),!function(){const e=Xa(),t="17.2";if(e)return"Safari"!==e.name&&"iOS"!==e.os||!!("iOS"===e.os&&e.osVersion&&Cd(e.osVersion,t)>=0)||"Safari"===e.name&&Cd(e.version,t)>=0}()&&n.roomOptions.e2ee&&(n.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},n.logContext)),l.simulcast=!1),l.source&&(e.source=l.source);const p=new Promise((t,i)=>Nr(n,void 0,void 0,function*(){try{if(this.engine.client.currentState!==vl.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:$c(e)}));let n=!1;const s=setTimeout(()=>{n=!0,e.stop(),i(new Tc("publishing rejected as engine not connected within timeout",408))},15e3);if(yield this.waitUntilEngineConnected(),clearTimeout(s),n)return;const o=yield this.publish(e,l,h);t(o)}else try{const n=yield this.publish(e,l,h);t(n)}catch(ep){i(ep)}}catch(ep){i(ep)}}));n.pendingPublishPromises.set(e,p);try{return yield p}catch(ep){throw ep}finally{n.pendingPublishPromises.delete(e)}}()})}waitUntilEngineConnected(){return this.signalConnectedFuture||(this.signalConnectedFuture=new Od),this.signalConnectedFuture.promise}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),$c(e))),!1;const{canPublish:t,canPublishSources:n}=this.permissions;return!(!t||0!==n.length&&!n.map(e=>function(e){switch(e){case us.CAMERA:return td.Source.Camera;case us.MICROPHONE:return td.Source.Microphone;case us.SCREEN_SHARE:return td.Source.ScreenShare;case us.SCREEN_SHARE_AUDIO:return td.Source.ScreenShareAudio;default:return td.Source.Unknown}}(e)).includes(e.source))||(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),$c(e))),!1)}publish(e,t,n){return Nr(this,void 0,void 0,function*(){var i,s,o,r,a,c,d,l,u,h;if(!this.hasPermissionsToPublish(e))throw new Tc("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(t=>Fd(e)&&t.source===e.source)&&e.source!==td.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),$c(e))),t.stopMicTrackOnMute&&jd(e)&&(e.stopOnMute=!0),e.source===td.Source.ScreenShare&&ld()&&(t.simulcast=!1),"av1"!==t.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(hd()||ld())return!1;const e=RTCRtpSender.getCapabilities("video");let t=!1;if(e)for(const n of e.codecs)if("video/av1"===n.mimeType.toLowerCase()){t=!0;break}return t}()||(t.videoCodec=void 0),"vp9"!==t.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(ld())return!1;if(hd()){const e=Xa();if((null==e?void 0:e.version)&&Cd(e.version,"16")<0)return!1;if("iOS"===(null==e?void 0:e.os)&&(null==e?void 0:e.osVersion)&&Cd(e.osVersion,"16")<0)return!1}const e=RTCRtpSender.getCapabilities("video");let t=!1;if(e)for(const n of e.codecs)if("video/vp9"===n.mimeType.toLowerCase()){t=!0;break}return t}()||(t.videoCodec=void 0),void 0===t.videoCodec&&(t.videoCodec=Wl),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(e=>t.videoCodec===Jc(e.mime))||(t.videoCodec=Jc(this.enabledPublishVideoCodecs[0].mime)));const p=t.videoCodec;e.on(vc.Muted,this.onTrackMuted),e.on(vc.Unmuted,this.onTrackUnmuted),e.on(vc.Ended,this.handleTrackEnded),e.on(vc.UpstreamPaused,this.onTrackUpstreamPaused),e.on(vc.UpstreamResumed,this.onTrackUpstreamResumed),e.on(vc.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const m=[],g=!(null===(i=t.dtx)||void 0===i||i),v=e.getSourceTrackSettings();v.autoGainControl&&m.push(_s.TF_AUTO_GAIN_CONTROL),v.echoCancellation&&m.push(_s.TF_ECHO_CANCELLATION),v.noiseSuppression&&m.push(_s.TF_NOISE_SUPPRESSION),v.channelCount&&v.channelCount>1&&m.push(_s.TF_STEREO),g&&m.push(_s.TF_NO_DTX),Vd(e)&&e.hasPreConnectBuffer&&m.push(_s.TF_PRECONNECT_BUFFER);const f=new fo({cid:e.mediaStreamTrack.id,name:t.name,type:td.kindToProto(e.kind),muted:e.isMuted,source:td.sourceToProto(e.source),disableDtx:g,encryption:this.encryptionType,stereo:n,disableRed:this.isE2EEEnabled||!(null===(s=t.red)||void 0===s||s),stream:null==t?void 0:t.stream,backupCodecPolicy:null==t?void 0:t.backupCodecPolicy,audioFeatures:m});let _;if(e.kind===td.Kind.Video){let n={width:0,height:0};try{n=yield e.waitForDimensions()}catch(ep){const i=null!==(r=null===(o=this.roomOptions.videoCaptureDefaults)||void 0===o?void 0:o.resolution)&&void 0!==r?r:Uc.h720.resolution;n={width:i.width,height:i.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),$c(e)),{dims:n}))}f.width=n.width,f.height=n.height,qd(e)&&(cd(p)&&(e.source===td.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),$c(e))))),t.scalabilityMode=null!==(a=t.scalabilityMode)&&void 0!==a?a:"L3T3_KEY"),f.simulcastCodecs=[new vo({codec:p,cid:e.mediaStreamTrack.id})],!0===t.backupCodec&&(t.backupCodec={codec:Wl}),t.backupCodec&&p!==t.backupCodec.codec&&f.encryption===Es.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),f.simulcastCodecs.push(new vo({codec:t.backupCodec.codec,cid:""})))),_=gu(e.source===td.Source.ScreenShare,f.width,f.height,t),f.layers=wu(f.width,f.height,_,cd(t.videoCodec))}else e.kind===td.Kind.Audio&&(_=[{maxBitrate:null===(c=t.audioPreset)||void 0===c?void 0:c.maxBitrate,priority:null!==(l=null===(d=t.audioPreset)||void 0===d?void 0:d.priority)&&void 0!==l?l:"high",networkPriority:null!==(h=null===(u=t.audioPreset)||void 0===u?void 0:u.priority)&&void 0!==h?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new Cc("cannot publish track when not connected");const b=()=>Nr(this,void 0,void 0,function*(){var n,i,s;if(!this.engine.pcManager)throw new Cc("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,_),this.emit(hc.LocalSenderCreated,e.sender,e),qd(e)&&(null!==(n=t.degradationPreference)&&void 0!==n||(t.degradationPreference=function(e){return e.source===td.Source.ScreenShare||e.constraints.height&&Dd(e.constraints.height)>=1080?"maintain-resolution":"balanced"}(e)),e.setDegradationPreference(t.degradationPreference)),_)if(ld()&&e.kind===td.Kind.Audio){let t;for(const n of this.engine.pcManager.publisher.getTransceivers())if(n.sender===e.sender){t=n;break}t&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:t,codec:"opus",maxbr:(null===(i=_[0])||void 0===i?void 0:i.maxBitrate)?_[0].maxBitrate/1e3:0})}else e.codec&&cd(e.codec)&&(null===(s=_[0])||void 0===s?void 0:s.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:f.cid,codec:e.codec,maxbr:_[0].maxBitrate/1e3});yield this.engine.negotiate()});let y;const k=new Promise((t,n)=>Nr(this,void 0,void 0,function*(){var i;try{y=yield this.engine.addTrack(f),t(y)}catch(s){e.sender&&(null===(i=this.engine.pcManager)||void 0===i?void 0:i.publisher)&&(this.engine.pcManager.publisher.removeTrack(e.sender),yield this.engine.negotiate().catch(t=>{this.log.error("failed to negotiate after removing track due to failed add track request",Object.assign(Object.assign(Object.assign({},this.logContext),$c(e)),{error:t}))})),n(s)}}));if(this.enabledPublishVideoCodecs.length>0){const e=yield Promise.all([k,b()]);y=e[0]}else{let n;if(y=yield k,y.codecs.forEach(e=>{void 0===n&&(n=e.mimeType)}),n&&e.kind===td.Kind.Video){const i=Jc(n);i!==p&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),$c(e)),{codec:i})),t.videoCodec=i,_=gu(e.source===td.Source.ScreenShare,f.width,f.height,t))}yield b()}const C=new Zu(e.kind,y,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});if(C.on(vc.CpuConstrained,e=>this.onTrackCpuConstrained(e,C)),C.options=t,e.sid=y.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:_,trackInfo:y})),qd(e)?e.startMonitor(this.engine.client):Vd(e)&&e.startMonitor(),this.addTrackPublication(C),this.emit(hc.LocalTrackPublished,C),Vd(e)&&y.audioFeatures.includes(_s.TF_PRECONNECT_BUFFER)){const t=e.getPreConnectBuffer(),n=e.getPreConnectBufferMimeType();if(this.on(hc.LocalTrackSubscribed,t=>{if(t.trackSid===y.sid){if(!e.hasPreConnectBuffer)return void this.log.warn("subscribe event came to late, buffer already closed",this.logContext);this.log.debug("finished recording preconnect buffer",Object.assign(Object.assign({},this.logContext),$c(e))),e.stopPreConnectBuffer()}}),t){new Promise((i,s)=>Nr(this,void 0,void 0,function*(){var o,r,a,c,d,l;try{this.log.debug("waiting for agent",Object.assign(Object.assign({},this.logContext),$c(e)));const g=setTimeout(()=>{s(new Error("agent not active within 10 seconds"))},1e4),f=yield this.waitUntilActiveAgentPresent();clearTimeout(g),this.log.debug("sending preconnect buffer",Object.assign(Object.assign({},this.logContext),$c(e)));const _=yield this.streamBytes({name:"preconnect-buffer",mimeType:n,topic:"lk.agent.pre-connect-audio-buffer",destinationIdentities:[f.identity],attributes:{trackId:C.trackSid,sampleRate:String(null!==(d=v.sampleRate)&&void 0!==d?d:"48000"),channels:String(null!==(l=v.channelCount)&&void 0!==l?l:"1")}});try{for(var u,h=!0,p=Fr(t);!(o=(u=yield p.next()).done);h=!0){c=u.value,h=!1;const e=c;yield _.write(e)}}catch(m){r={error:m}}finally{try{h||o||!(a=p.return)||(yield a.call(p))}finally{if(r)throw r.error}}yield _.close(),i()}catch(ep){s(ep)}})).then(()=>{this.log.debug("preconnect buffer sent successfully",Object.assign(Object.assign({},this.logContext),$c(e)))}).catch(t=>{this.log.error("error sending preconnect buffer",Object.assign(Object.assign(Object.assign({},this.logContext),$c(e)),{error:t}))})}}return C})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,n){return Nr(this,void 0,void 0,function*(){var i;if(this.encryptionType!==Es.NONE)return;let s;if(this.trackPublications.forEach(t=>{t.track&&t.track===e&&(s=t)}),!s)throw new yc("track is not published");if(!qd(e))throw new yc("track is not a video track");const o=Object.assign(Object.assign({},null===(i=this.roomOptions)||void 0===i?void 0:i.publishDefaults),n),r=function(e,t,n){var i,s,o,r;if(!n.backupCodec||!0===n.backupCodec||n.backupCodec.codec===n.videoCodec)return;t!==n.backupCodec.codec&&Lr.warn("requested a different codec than specified as backup",{serverRequested:t,backup:n.backupCodec.codec}),n.videoCodec=t,n.videoEncoding=n.backupCodec.encoding;const a=e.mediaStreamTrack.getSettings(),c=null!==(i=a.width)&&void 0!==i?i:null===(s=e.dimensions)||void 0===s?void 0:s.width,d=null!==(o=a.height)&&void 0!==o?o:null===(r=e.dimensions)||void 0===r?void 0:r.height;return e.source===td.Source.ScreenShare&&n.simulcast&&(n.simulcast=!1),gu(e.source===td.Source.ScreenShare,c,d,n)}(e,t,o);if(!r)return void this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),$c(e)));const a=e.addSimulcastTrack(t,r);if(!a)return;const c=new fo({cid:a.mediaStreamTrack.id,type:td.kindToProto(e.kind),muted:e.isMuted,source:td.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:o.videoCodec,cid:a.mediaStreamTrack.id}]});if(c.layers=wu(c.width,c.height,r),!this.engine||this.engine.isClosed)throw new Cc("cannot publish track when not connected");const d=(yield Promise.all([this.engine.addTrack(c),(()=>Nr(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,a,o,r),yield this.engine.negotiate()}))()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:r,trackInfo:d}))})}unpublishTrack(e,t){return Nr(this,void 0,void 0,function*(){var n,i;if(Fd(e)){const t=this.pendingPublishPromises.get(e);t&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),$c(e))),yield t)}const s=this.getPublicationForTrack(e),o=s?$c(s):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),o)),!s||!s.track)return void this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),o));(e=s.track).off(vc.Muted,this.onTrackMuted),e.off(vc.Unmuted,this.onTrackUnmuted),e.off(vc.Ended,this.handleTrackEnded),e.off(vc.UpstreamPaused,this.onTrackUpstreamPaused),e.off(vc.UpstreamResumed,this.onTrackUpstreamResumed),e.off(vc.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),void 0===t&&(t=null===(i=null===(n=this.roomOptions)||void 0===n?void 0:n.stopLocalTrackOnUnpublish)||void 0===i||i),t?e.stop():e.stopMonitor();let r=!1;const a=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<$l.FAILED&&a)try{for(const e of this.engine.pcManager.publisher.getTransceivers())e.sender===a&&(e.direction="inactive",r=!0);if(this.engine.removeTrack(a)&&(r=!0),qd(e)){for(const[,t]of e.simulcastCodecs)t.sender&&(this.engine.removeTrack(t.sender)&&(r=!0),t.sender=void 0);e.simulcastCodecs.clear()}}catch(ep){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),o),{error:ep}))}switch(this.trackPublications.delete(s.trackSid),s.kind){case td.Kind.Audio:this.audioTrackPublications.delete(s.trackSid);break;case td.Kind.Video:this.videoTrackPublications.delete(s.trackSid)}return this.emit(hc.LocalTrackUnpublished,s),s.setTrack(void 0),r&&(yield this.engine.negotiate()),s})}unpublishTracks(e){return Nr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(e=>this.unpublishTrack(e)))).filter(e=>!!e)})}republishAllTracks(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){t.republishPromise&&(yield t.republishPromise),t.republishPromise=new $a((i,s)=>Nr(t,void 0,void 0,function*(){try{const t=[];this.trackPublications.forEach(n=>{n.track&&(e&&(n.options=Object.assign(Object.assign({},n.options),e)),t.push(n))}),yield Promise.all(t.map(e=>Nr(this,void 0,void 0,function*(){const t=e.track;yield this.unpublishTrack(t,!1),!n||t.isMuted||t.source===td.Source.ScreenShare||t.source===td.Source.ScreenShareAudio||!Vd(t)&&!qd(t)||t.isUserProvided||(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:e.trackSid})),yield t.restartTrack()),yield this.publishOrRepublishTrack(t,e.options,!0)}))),i()}catch(t){t instanceof Error?s(t):s(new Error(String(t)))}finally{this.republishPromise=void 0}})),yield t.republishPromise}()})}publishData(e){return Nr(this,arguments,void 0,function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const i=n.reliable?xs.RELIABLE:xs.LOSSY,s=n.destinationIdentities,o=n.topic;let r=new js({participantIdentity:t.identity,payload:e,destinationIdentities:s,topic:o});const a=new Ds({kind:i,value:{case:"user",value:r}});yield t.engine.sendDataPacket(a,i)}()})}publishDtmf(e,t){return Nr(this,void 0,void 0,function*(){const n=new Ds({kind:xs.RELIABLE,value:{case:"sipDtmf",value:new Bs({code:e,digit:t})}});yield this.engine.sendDataPacket(n,xs.RELIABLE)})}sendChatMessage(e,t){return Nr(this,void 0,void 0,function*(){const n={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:null==t?void 0:t.attachments},i=new Ds({value:{case:"chatMessage",value:new Ws(Object.assign(Object.assign({},n),{timestamp:Hn.parse(n.timestamp)}))}});return yield this.engine.sendDataPacket(i,xs.RELIABLE),this.emit(hc.ChatMessage,n),n})}editChatMessage(e,t){return Nr(this,void 0,void 0,function*(){const n=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new Ds({value:{case:"chatMessage",value:new Ws(Object.assign(Object.assign({},n),{timestamp:Hn.parse(n.timestamp),editTimestamp:Hn.parse(n.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,xs.RELIABLE),this.emit(hc.ChatMessage,n),n})}sendText(e,t){return Nr(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendText(e,t)})}streamText(e){return Nr(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamText(e)})}sendFile(e,t){return Nr(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendFile(e,t)})}streamBytes(e){return Nr(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamBytes(e)})}performRpc(e){let{destinationIdentity:t,method:n,payload:i,responseTimeout:s=15e3}=e;return new $a((e,o)=>Nr(this,void 0,void 0,function*(){var r,a,c,d;if(eu(i)>15360)return void o(Zl.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));if((null===(a=null===(r=this.engine.latestJoinResponse)||void 0===r?void 0:r.serverInfo)||void 0===a?void 0:a.version)&&Cd(null===(d=null===(c=this.engine.latestJoinResponse)||void 0===c?void 0:c.serverInfo)||void 0===d?void 0:d.version,"1.8.0")<0)return void o(Zl.builtIn("UNSUPPORTED_SERVER"));const l=Math.max(s,8e3),u=crypto.randomUUID();yield this.publishRpcRequest(t,u,n,i,l);const h=setTimeout(()=>{this.pendingAcks.delete(u),o(Zl.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(u),clearTimeout(p)},7e3);this.pendingAcks.set(u,{resolve:()=>{clearTimeout(h)},participantIdentity:t});const p=setTimeout(()=>{this.pendingResponses.delete(u),o(Zl.builtIn("RESPONSE_TIMEOUT"))},s);this.pendingResponses.set(u,{resolve:(t,n)=>{clearTimeout(p),this.pendingAcks.has(u)&&(this.log.warn("RPC response received before ack",u),this.pendingAcks.delete(u),clearTimeout(h)),n?o(n):e(null!=t?t:"")},participantIdentity:t})}))}registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,n){const i=this.pendingResponses.get(e);i?(i.resolve(t,n),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,n,i,s){return Nr(this,void 0,void 0,function*(){const o=new Ds({destinationIdentities:[e],kind:xs.RELIABLE,value:{case:"rpcRequest",value:new Hs({id:t,method:n,payload:i,responseTimeoutMs:s,version:1})}});yield this.engine.sendDataPacket(o,xs.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:n}]of this.pendingAcks)n===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:n,resolve:i}]of this.pendingResponses)n===e&&(i(null,Zl.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(e=>"video"===e.mime.split("/")[0].toLowerCase())}updateInfo(e){return!!super.updateInfo(e)&&(e.tracks.forEach(e=>{var t,n;const i=this.trackPublications.get(e.sid);if(i){const s=i.isMuted||null!==(n=null===(t=i.track)||void 0===t?void 0:t.isUpstreamPaused)&&void 0!==n&&n;s!==e.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),$c(i)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(e.sid,s))}}),!0)}setActiveAgent(e){var t,n,i,s;this.firstActiveAgent=e,e&&!this.firstActiveAgent&&(this.firstActiveAgent=e),e?null===(n=null===(t=this.activeAgentFuture)||void 0===t?void 0:t.resolve)||void 0===n||n.call(t,e):null===(s=null===(i=this.activeAgentFuture)||void 0===i?void 0:i.reject)||void 0===s||s.call(i,new Error("Agent disconnected")),this.activeAgentFuture=void 0}waitUntilActiveAgentPresent(){return this.firstActiveAgent?Promise.resolve(this.firstActiveAgent):(this.activeAgentFuture||(this.activeAgentFuture=new Od),this.activeAgentFuture.promise)}getPublicationForTrack(e){let t;return this.trackPublications.forEach(n=>{const i=n.track;i&&(e instanceof MediaStreamTrack?(Vd(i)||qd(i))&&i.mediaStreamTrack===e&&(t=n):e===i&&(t=n))}),t}waitForPendingPublicationOfSource(e){return Nr(this,void 0,void 0,function*(){const t=Date.now();for(;Date.now()<t+1e4;){const t=Array.from(this.pendingPublishPromises.entries()).find(t=>{let[n]=t;return n.source===e});if(t)return t[1];yield od(20)}})}}class sh extends zu{constructor(e,t,n,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.requestedDisabled=void 0,this.visible=!0,this.handleEnded=e=>{this.setTrack(void 0),this.emit(vc.Ended,e)},this.handleVisibilityChange=e=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(e),this.logContext),this.visible=e,this.emitTrackUpdate()},this.handleVideoDimensionsChange=e=>{this.log.debug("adaptivestream video dimensions ".concat(e.width,"x").concat(e.height),this.logContext),this.videoDimensionsAdaptiveStream=e,this.emitTrackUpdate()},this.subscribed=n,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Oo({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Ks({participantSid:"",trackSids:[this.trackSid]})]});this.emit(vc.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(n)}get subscriptionStatus(){return!1===this.subscribed?zu.SubscriptionStatus.Unsubscribed:super.isSubscribed?zu.SubscriptionStatus.Subscribed:zu.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?zu.PermissionStatus.Allowed:zu.PermissionStatus.NotAllowed}get isSubscribed(){return!1!==this.subscribed&&super.isSubscribed}get isDesired(){return!1!==this.subscribed}get isEnabled(){return void 0!==this.requestedDisabled?!this.requestedDisabled:!this.isAdaptiveStream||this.visible}get isLocal(){return!1}setEnabled(e){this.isManualOperationAllowed()&&this.requestedDisabled!==!e&&(this.requestedDisabled=!e,this.emitTrackUpdate())}setVideoQuality(e){this.isManualOperationAllowed()&&this.requestedMaxQuality!==e&&(this.requestedMaxQuality=e,this.requestedVideoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,n;this.isManualOperationAllowed()&&((null===(t=this.requestedVideoDimensions)||void 0===t?void 0:t.width)===e.width&&(null===(n=this.requestedVideoDimensions)||void 0===n?void 0:n.height)===e.height||(zd(this.track)&&(this.requestedVideoDimensions=e),this.requestedMaxQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&zd(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){var e;return null!==(e=this.requestedMaxQuality)&&void 0!==e?e:Zc.HIGH}setTrack(e){const t=this.subscriptionStatus,n=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(vc.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(vc.VisibilityChanged,this.handleVisibilityChange),i.off(vc.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(vc.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(vc.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(vc.VisibilityChanged,this.handleVisibilityChange),e.on(vc.Ended,this.handleEnded),this.emit(vc.Subscribed,e)),this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(vc.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?vc.Muted:vc.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(vc.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(vc.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return!!this.isDesired||(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return zd(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Ao({trackSids:[this.trackSid],disabled:!this.isEnabled,fps:this.fps});if(this.kind===td.Kind.Video){let s=this.requestedVideoDimensions;if(void 0!==this.videoDimensionsAdaptiveStream)if(s){Yc(this.videoDimensionsAdaptiveStream,s)&&(this.log.debug("using adaptive stream dimensions instead of requested",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),s=this.videoDimensionsAdaptiveStream)}else if(void 0!==this.requestedMaxQuality&&this.trackInfo){const e=(t=this.trackInfo,n=this.requestedMaxQuality,null===(i=t.layers)||void 0===i?void 0:i.find(e=>e.quality===n));e&&Yc(this.videoDimensionsAdaptiveStream,e)&&(this.log.debug("using adaptive stream dimensions instead of max quality layer",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),s=this.videoDimensionsAdaptiveStream)}else this.log.debug("using adaptive stream dimensions",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),s=this.videoDimensionsAdaptiveStream;s?(e.width=Math.ceil(s.width),e.height=Math.ceil(s.height)):void 0!==this.requestedMaxQuality?(this.log.debug("using requested max quality",Object.assign(Object.assign({},this.logContext),{quality:this.requestedMaxQuality})),e.quality=this.requestedMaxQuality):(this.log.debug("using default quality",Object.assign(Object.assign({},this.logContext),{quality:Zc.HIGH})),e.quality=Zc.HIGH)}var t,n,i;this.emit(vc.UpdateSettings,e)}}class oh extends nh{static fromParticipantInfo(e,t,n){return new oh(e,t.sid,t.identity,t.name,t.metadata,t.attributes,n,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,t,n,i,s,o,r){super(t,n||"",i,s,o,r,arguments.length>7&&void 0!==arguments[7]?arguments[7]:Ts.STANDARD),this.signalClient=e,this.trackPublications=/* @__PURE__ */new Map,this.audioTrackPublications=/* @__PURE__ */new Map,this.videoTrackPublications=/* @__PURE__ */new Map,this.volumeMap=/* @__PURE__ */new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(vc.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign(Object.assign({},this.logContext),$c(e)),{settings:t})),this.signalClient.sendUpdateTrackSettings(t)}),e.on(vc.UpdateSubscription,e=>{e.participantTracks.forEach(e=>{e.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(e)}),e.on(vc.SubscriptionPermissionChanged,t=>{this.emit(hc.TrackSubscriptionPermissionChanged,e,t)}),e.on(vc.SubscriptionStatusChanged,t=>{this.emit(hc.TrackSubscriptionStatusChanged,e,t)}),e.on(vc.Subscribed,t=>{this.emit(hc.TrackSubscribed,t,e)}),e.on(vc.Unsubscribed,t=>{this.emit(hc.TrackUnsubscribed,t,e)}),e.on(vc.SubscriptionFailed,t=>{this.emit(hc.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:td.Source.Microphone;this.volumeMap.set(t,e);const n=this.getTrackPublication(t);n&&n.track&&n.track.setVolume(e)}getVolume(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:td.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,n,i,s,o){let r=this.getTrackPublicationBySid(t);if(r||t.startsWith("TR")||this.trackPublications.forEach(t=>{r||e.kind!==t.kind.toString()||(r=t)}),!r)return 0===o?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),void this.emit(hc.TrackSubscriptionFailed,t)):(void 0===o&&(o=20),void setTimeout(()=>{this.addSubscribedMediaTrack(e,t,n,i,s,o-1)},150));if("ended"===e.readyState)return this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),$c(r))),void this.emit(hc.TrackSubscriptionFailed,t);let a;return a="video"===e.kind?new qu(e,t,i,s):new Bu(e,t,i,this.audioContext,this.audioOutput),a.source=r.source,a.isMuted=r.isMuted,a.setMediaStream(n),a.start(),r.setTrack(a),this.volumeMap.has(r.source)&&Wd(a)&&jd(a)&&a.setVolume(this.volumeMap.get(r.source)),r}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return e.tracks.forEach(e=>{var i,s;let o=this.getTrackPublicationBySid(e.sid);if(o)o.updateInfo(e);else{const t=td.kindFromProto(e.type);if(!t)return;o=new sh(t,e,null===(i=this.signalClient.connectOptions)||void 0===i?void 0:i.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:null===(s=this.loggerOptions)||void 0===s?void 0:s.loggerName}),o.updateInfo(e),n.set(e.sid,o);const r=Array.from(this.trackPublications.values()).find(e=>e.source===(null==o?void 0:o.source));r&&o.source!==td.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:$c(r),newTrack:$c(o)})),this.addTrackPublication(o)}t.set(e.sid,o)}),this.trackPublications.forEach(e=>{t.has(e.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),$c(e))),this.unpublishTrack(e.trackSid,!0))}),n.forEach(e=>{this.emit(hc.TrackPublished,e)}),!0}unpublishTrack(e,t){const n=this.trackPublications.get(e);if(!n)return;const{track:i}=n;switch(i&&(i.stop(),n.setTrack(void 0)),this.trackPublications.delete(e),n.kind){case td.Kind.Audio:this.audioTrackPublications.delete(e);break;case td.Kind.Video:this.videoTrackPublications.delete(e)}t&&this.emit(hc.TrackUnpublished,n)}setAudioOutput(e){return Nr(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(n=>{var i;jd(n.track)&&Wd(n.track)&&t.push(n.track.setSinkId(null!==(i=e.deviceId)&&void 0!==i?i:"default"))}),yield Promise.all(t)})}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:n})),super.emit(e,...n)}}(Xu=Yu||(Yu={})).Disconnected="disconnected",Xu.Connecting="connecting",Xu.Connected="connected",Xu.Reconnecting="reconnecting",Xu.SignalReconnecting="signalReconnecting";class rh extends qr.EventEmitter{get hasE2EESetup(){return void 0!==this.e2eeManager}constructor(e){var t,n,i,s,o;if(super(),t=this,this.state=Yu.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=Lr,this.bufferedEvents=[],this.isResuming=!1,this.rpcHandlers=/* @__PURE__ */new Map,this.connect=(e,t,n)=>Nr(this,void 0,void 0,function*(){var i;if("undefined"==typeof RTCPeerConnection||!rd()&&!ad())throw vd()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const s=yield this.disconnectLock.lock();if(this.state===Yu.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),s(),Promise.resolve();if(this.connectFuture)return s(),this.connectFuture.promise;this.setAndEmitConnectionState(Yu.Connecting),(null===(i=this.regionUrlProvider)||void 0===i?void 0:i.getServerUrl().toString())!==Jd(e)&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),fd(new URL(e))&&(void 0===this.regionUrlProvider?this.regionUrlProvider=new Xl(e,t):this.regionUrlProvider.updateToken(t),this.regionUrlProvider.fetchRegionSettings().then(e=>{var t;null===(t=this.regionUrlProvider)||void 0===t||t.setServerReportedRegions(e)}).catch(e=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:e}))}));const o=(i,r,a)=>Nr(this,void 0,void 0,function*(){var c,d;this.abortController&&this.abortController.abort();const l=new AbortController;this.abortController=l,null==s||s();try{if(yield cl.getInstance().getBackOffPromise(e),l.signal.aborted)throw _c.cancelled("Connection attempt aborted");yield this.attemptConnection(null!=a?a:e,t,n,l),this.abortController=void 0,i()}catch(u){if(this.regionUrlProvider&&u instanceof _c&&u.reason!==sc.Cancelled&&u.reason!==sc.NotAllowed){let t=null;try{this.log.debug("Fetching next region"),t=yield this.regionUrlProvider.getNextBestRegionUrl(null===(c=this.abortController)||void 0===c?void 0:c.signal)}catch(h){if(h instanceof _c&&(401===h.status||h.reason===sc.Cancelled))return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),void r(h)}[sc.InternalError,sc.ServerUnreachable,sc.Timeout].includes(u.reason)&&(this.log.debug("Adding failed connection attempt to back off"),cl.getInstance().addFailedConnectionAttempt(e)),t&&!(null===(d=this.abortController)||void 0===d?void 0:d.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(u.message,". Retrying with another region: ").concat(t),this.logContext),this.recreateEngine(),yield o(i,r,t)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Ad(u)),r(u))}else{let e=gs.UNKNOWN_REASON;u instanceof _c&&(e=Ad(u)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e),r(u)}}}),r=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Od((e,t)=>{o(e,t,r)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(e,t,n,i,s,o)=>Nr(this,void 0,void 0,function*(){var r,a,c;const d=yield n.join(e,t,{autoSubscribe:i.autoSubscribe,adaptiveStream:"object"==typeof s.adaptiveStream||s.adaptiveStream,maxRetries:i.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:i.websocketTimeout},o.signal,!s.singlePeerConnection);let l=d.serverInfo;if(l||(l={version:d.serverVersion,region:d.serverRegion}),this.serverInfo=l,this.log.debug("connected to Livekit Server ".concat(Object.entries(l).map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n)}).join(", ")),{room:null===(r=d.room)||void 0===r?void 0:r.name,roomSid:null===(a=d.room)||void 0===a?void 0:a.sid,identity:null===(c=d.participant)||void 0===c?void 0:c.identity}),!l.version)throw new kc("unknown server version");return"0.15.1"===l.version&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),s.dynacast=!1),d}),this.applyJoinResponse=e=>{const t=e.participant;if(this.localParticipant.sid=t.sid,this.localParticipant.identity=t.identity,this.localParticipant.setEnabledPublishCodecs(e.enabledPublishCodecs),this.e2eeManager)try{this.e2eeManager.setSifTrailer(e.sifTrailer)}catch(ep){this.log.error(ep instanceof Error?ep.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:ep}))}this.handleParticipantUpdates([t,...e.otherParticipants]),e.room&&this.handleRoomUpdate(e.room)},this.attemptConnection=(e,t,n,i)=>Nr(this,void 0,void 0,function*(){var s,o;this.state===Yu.Reconnecting||this.isResuming||(null===(s=this.engine)||void 0===s?void 0:s.pendingReconnect)?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),(null===(o=this.regionUrlProvider)||void 0===o?void 0:o.isCloud())&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Kl),n),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const n=yield this.connectSignal(e,t,this.engine,this.connOptions,this.options,i);this.applyJoinResponse(n),this.setupLocalParticipantEvents(),this.emit(lc.SignalConnected)}catch(r){yield this.engine.close(),this.recreateEngine();const e=i.signal.aborted?_c.cancelled("Signal connection aborted"):_c.serverUnreachable("could not establish signal connection");throw r instanceof Error&&(e.message="".concat(e.message,": ").concat(r.message)),r instanceof _c&&(e.reason=r.reason,e.status=r.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:r})),e}if(i.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),_c.cancelled("Connection attempt aborted");try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,i)}catch(ep){throw yield this.engine.close(),this.recreateEngine(),ep}gd()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),gd()&&window.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(Yu.Connected),this.emit(lc.Connected),cl.getInstance().resetFailedConnectionAttempts(e),this.registerConnectionReconcile(),this.regionUrlProvider&&this.regionUrlProvider.notifyConnected()}),this.disconnect=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Nr(t,[...n],void 0,function(){var e=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var n,i,s;const o=yield e.disconnectLock.lock();try{if(e.state===Yu.Disconnected)return void e.log.debug("already disconnected",e.logContext);if(e.log.info("disconnect from room",Object.assign({},e.logContext)),e.state===Yu.Connecting||e.state===Yu.Reconnecting||e.isResuming){const t="Abort connection attempt due to user initiated disconnect";e.log.warn(t,e.logContext),null===(n=e.abortController)||void 0===n||n.abort(t),null===(s=null===(i=e.connectFuture)||void 0===i?void 0:i.reject)||void 0===s||s.call(i,_c.cancelled("Client initiated disconnect")),e.connectFuture=void 0}e.engine&&(e.engine.client.isDisconnected||(yield e.engine.client.sendLeave()),yield e.engine.close()),e.handleDisconnect(t,gs.CLIENT_INITIATED),e.engine=void 0}finally{o()}}()})},this.onPageLeave=()=>Nr(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>Nr(this,void 0,void 0,function*(){const e=[],t=Xa();if(t&&"iOS"===t.os){const t="livekit-dummy-audio-el";let n=document.getElementById(t);if(!n){n=document.createElement("audio"),n.id=t,n.autoplay=!0,n.hidden=!0;const e=Ld();e.enabled=!0;const i=new MediaStream([e]);n.srcObject=i,document.addEventListener("visibilitychange",()=>{n&&(n.srcObject=document.hidden?null:i,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(n),this.once(lc.Disconnected,()=>{null==n||n.remove(),n=null})}e.push(n)}this.remoteParticipants.forEach(t=>{t.audioTrackPublications.forEach(t=>{t.track&&t.track.attachedElements.forEach(t=>{e.push(t)})})});try{yield Promise.all([this.acquireAudioContext(),...e.map(e=>(e.muted=!1,e.play()))]),this.handleAudioPlaybackStarted()}catch(n){throw this.handleAudioPlaybackFailed(n),n}}),this.startVideo=()=>Nr(this,void 0,void 0,function*(){const e=[];for(const t of this.remoteParticipants.values())t.videoTrackPublications.forEach(t=>{var n;null===(n=t.track)||void 0===n||n.attachedElements.forEach(t=>{e.includes(t)||e.push(t)})});yield Promise.all(e.map(e=>e.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(e=>{"NotAllowedError"===e.name?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const e of this.remoteParticipants.values())this.handleParticipantDisconnected(e.identity,e);this.setAndEmitConnectionState(Yu.Reconnecting)&&this.emit(lc.Reconnecting)},this.handleSignalRestarted=e=>Nr(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(e.serverRegion),Object.assign(Object.assign({},this.logContext),{region:e.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(e);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(t){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:t}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:e.serverRegion}))}catch(n){return}this.setAndEmitConnectionState(Yu.Connected),this.emit(lc.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=e=>{e.forEach(e=>{var t;if(e.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(e);""===e.identity&&(e.identity=null!==(t=this.sidToIdentity.get(e.sid))&&void 0!==t?t:"");let n=this.remoteParticipants.get(e.identity);e.state===ws.DISCONNECTED?this.handleParticipantDisconnected(e.identity,n):n=this.getOrCreateParticipant(e.identity,e)})},this.handleActiveSpeakersUpdate=e=>{const t=[],n={};e.forEach(e=>{if(n[e.sid]=!0,e.sid===this.localParticipant.sid)this.localParticipant.audioLevel=e.level,this.localParticipant.setIsSpeaking(!0),t.push(this.localParticipant);else{const n=this.getRemoteParticipantBySid(e.sid);n&&(n.audioLevel=e.level,n.setIsSpeaking(!0),t.push(n))}}),n[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(e=>{n[e.sid]||(e.audioLevel=0,e.setIsSpeaking(!1))}),this.activeSpeakers=t,this.emitWhenConnected(lc.ActiveSpeakersChanged,t)},this.handleSpeakersChanged=e=>{const t=/* @__PURE__ */new Map;this.activeSpeakers.forEach(e=>{const n=this.remoteParticipants.get(e.identity);n&&n.sid!==e.sid||t.set(e.sid,e)}),e.forEach(e=>{let n=this.getRemoteParticipantBySid(e.sid);e.sid===this.localParticipant.sid&&(n=this.localParticipant),n&&(n.audioLevel=e.level,n.setIsSpeaking(e.active),e.active?t.set(e.sid,n):t.delete(e.sid))});const n=Array.from(t.values());n.sort((e,t)=>t.audioLevel-e.audioLevel),this.activeSpeakers=n,this.emitWhenConnected(lc.ActiveSpeakersChanged,n)},this.handleStreamStateUpdate=e=>{e.streamStates.forEach(e=>{const t=this.getRemoteParticipantBySid(e.participantSid);if(!t)return;const n=t.getTrackPublicationBySid(e.trackSid);if(!n||!n.track)return;const i=td.streamStateFromProto(e.state);n.track.setStreamState(i),i!==n.track.streamState&&(t.emit(hc.TrackStreamStateChanged,n,n.track.streamState),this.emitWhenConnected(lc.TrackStreamStateChanged,n,n.track.streamState,t))})},this.handleSubscriptionPermissionUpdate=e=>{const t=this.getRemoteParticipantBySid(e.participantSid);if(!t)return;const n=t.getTrackPublicationBySid(e.trackSid);n&&n.setAllowed(e.allowed)},this.handleSubscriptionError=e=>{const t=Array.from(this.remoteParticipants.values()).find(t=>t.trackPublications.has(e.trackSid));if(!t)return;const n=t.getTrackPublicationBySid(e.trackSid);n&&n.setSubscriptionError(e.err)},this.handleDataPacket=(e,t)=>{const n=this.remoteParticipants.get(e.participantIdentity);if("user"===e.value.case)this.handleUserPacket(n,e.value.value,e.kind,t);else if("transcription"===e.value.case)this.handleTranscription(n,e.value.value);else if("sipDtmf"===e.value.case)this.handleSipDtmf(n,e.value.value);else if("chatMessage"===e.value.case)this.handleChatMessage(n,e.value.value);else if("metrics"===e.value.case)this.handleMetrics(e.value.value,n);else if("streamHeader"===e.value.case||"streamChunk"===e.value.case||"streamTrailer"===e.value.case)this.handleDataStream(e,t);else if("rpcRequest"===e.value.case){const t=e.value.value;this.handleIncomingRpcRequest(e.participantIdentity,t.id,t.method,t.payload,t.responseTimeoutMs,t.version)}},this.handleUserPacket=(e,t,n,i)=>{this.emit(lc.DataReceived,t.payload,e,n,t.topic,i),null==e||e.emit(hc.DataReceived,t.payload,n,i)},this.handleSipDtmf=(e,t)=>{this.emit(lc.SipDTMFReceived,t,e),null==e||e.emit(hc.SipDTMFReceived,t)},this.handleTranscription=(e,t)=>{const n=t.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(t.transcribedParticipantIdentity),i=null==n?void 0:n.trackPublications.get(t.trackId),s=function(e,t){return e.segments.map(e=>{let{id:n,text:i,language:s,startTime:o,endTime:r,final:a}=e;var c;const d=null!==(c=t.get(n))&&void 0!==c?c:Date.now(),l=Date.now();return a?t.delete(n):t.set(n,d),{id:n,text:i,startTime:Number.parseInt(o.toString()),endTime:Number.parseInt(r.toString()),final:a,language:s,firstReceivedTime:d,lastReceivedTime:l}})}(t,this.transcriptionReceivedTimes);null==i||i.emit(vc.TranscriptionReceived,s),null==n||n.emit(hc.TranscriptionReceived,s,i),this.emit(lc.TranscriptionReceived,s,n,i)},this.handleChatMessage=(e,t)=>{const n=function(e){const{id:t,timestamp:n,message:i,editTimestamp:s}=e;return{id:t,timestamp:Number.parseInt(n.toString()),editTimestamp:s?Number.parseInt(s.toString()):void 0,message:i}}(t);this.emit(lc.ChatMessage,n,e)},this.handleMetrics=(e,t)=>{this.emit(lc.MetricsReceived,e,t)},this.handleDataStream=(e,t)=>{this.incomingDataStreamManager.handleDataStreamPacket(e,t)},this.bufferedSegments=/* @__PURE__ */new Map,this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(lc.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=e=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:e})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(lc.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(lc.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(lc.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>Nr(this,void 0,void 0,function*(){var e;"iOS"!==(null===(e=Xa())||void 0===e?void 0:e.os)&&(yield this.selectDefaultDevices()),this.emit(lc.MediaDevicesChanged)}),this.handleRoomUpdate=e=>{const t=this.roomInfo;this.roomInfo=e,t&&t.metadata!==e.metadata&&this.emitWhenConnected(lc.RoomMetadataChanged,e.metadata),(null==t?void 0:t.activeRecording)!==e.activeRecording&&this.emitWhenConnected(lc.RecordingStatusChanged,e.activeRecording)},this.handleConnectionQualityUpdate=e=>{e.updates.forEach(e=>{if(e.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(e.quality);const t=this.getRemoteParticipantBySid(e.participantSid);t&&t.setConnectionQuality(e.quality)})},this.onLocalParticipantMetadataChanged=e=>{this.emit(lc.ParticipantMetadataChanged,e,this.localParticipant)},this.onLocalParticipantNameChanged=e=>{this.emit(lc.ParticipantNameChanged,e,this.localParticipant)},this.onLocalAttributesChanged=e=>{this.emit(lc.ParticipantAttributesChanged,e,this.localParticipant)},this.onLocalTrackMuted=e=>{this.emit(lc.TrackMuted,e,this.localParticipant)},this.onLocalTrackUnmuted=e=>{this.emit(lc.TrackUnmuted,e,this.localParticipant)},this.onTrackProcessorUpdate=e=>{var t;null===(t=null==e?void 0:e.onPublish)||void 0===t||t.call(e,this)},this.onLocalTrackPublished=e=>Nr(this,void 0,void 0,function*(){var t,n,i,s,o,r;if(null===(t=e.track)||void 0===t||t.on(vc.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(n=e.track)||void 0===n||n.on(vc.Restarted,this.onLocalTrackRestarted),null===(o=null===(s=null===(i=e.track)||void 0===i?void 0:i.getProcessor())||void 0===s?void 0:s.onPublish)||void 0===o||o.call(s,this),this.emit(lc.LocalTrackPublished,e,this.localParticipant),Vd(e.track)){(yield e.track.checkForSilence())&&this.emit(lc.LocalAudioSilenceDetected,e)}const a=yield null===(r=e.track)||void 0===r?void 0:r.getDeviceId(!1),c=Gc(e.source);c&&a&&a!==this.localParticipant.activeDeviceMap.get(c)&&(this.localParticipant.activeDeviceMap.set(c,a),this.emit(lc.ActiveDeviceChanged,c,a))}),this.onLocalTrackUnpublished=e=>{var t,n;null===(t=e.track)||void 0===t||t.off(vc.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(n=e.track)||void 0===n||n.off(vc.Restarted,this.onLocalTrackRestarted),this.emit(lc.LocalTrackUnpublished,e,this.localParticipant)},this.onLocalTrackRestarted=e=>Nr(this,void 0,void 0,function*(){const t=yield e.getDeviceId(!1),n=Gc(e.source);n&&t&&t!==this.localParticipant.activeDeviceMap.get(n)&&(this.log.debug("local track restarted, setting ".concat(n," ").concat(t," active"),this.logContext),this.localParticipant.activeDeviceMap.set(n,t),this.emit(lc.ActiveDeviceChanged,n,t))}),this.onLocalConnectionQualityChanged=e=>{this.emit(lc.ConnectionQualityChanged,e,this.localParticipant)},this.onMediaDevicesError=(e,t)=>{this.emit(lc.MediaDevicesError,e,t)},this.onLocalParticipantPermissionsChanged=e=>{this.emit(lc.ParticipantPermissionsChanged,e,this.localParticipant)},this.onLocalChatMessageSent=e=>{this.emit(lc.ChatMessage,e,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=/* @__PURE__ */new Map,this.sidToIdentity=/* @__PURE__ */new Map,this.options=Object.assign(Object.assign({},Jl),e),this.log=Or(null!==(n=this.options.loggerName)&&void 0!==n?n:Ir.Room),this.transcriptionReceivedTimes=/* @__PURE__ */new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},zl),null==e?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},Gl),null==e?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Hl),null==e?void 0:e.publishDefaults),this.maybeCreateEngine(),this.incomingDataStreamManager=new xu,this.outgoingDataStreamManager=new Fu(this.engine,this.log),this.disconnectLock=new Cn,this.localParticipant=new ih("","",this.engine,this.options,this.rpcHandlers,this.outgoingDataStreamManager),(this.options.e2ee||this.options.encryption)&&this.setupE2EE(),this.engine.e2eeManager=this.e2eeManager,this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Dd(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Dd(this.options.audioCaptureDefaults.deviceId)),(null===(i=this.options.audioOutput)||void 0===i?void 0:i.deviceId)&&this.switchActiveDevice("audiooutput",Dd(this.options.audioOutput.deviceId)).catch(e=>this.log.warn("Could not set audio output: ".concat(e.message),this.logContext)),gd()){const e=new AbortController;null===(o=null===(s=navigator.mediaDevices)||void 0===s?void 0:s.addEventListener)||void 0===o||o.call(s,"devicechange",this.handleDeviceChange,{signal:e.signal}),rh.cleanupRegistry&&rh.cleanupRegistry.register(this,()=>{e.abort()})}}registerTextStreamHandler(e,t){return this.incomingDataStreamManager.registerTextStreamHandler(e,t)}unregisterTextStreamHandler(e){return this.incomingDataStreamManager.unregisterTextStreamHandler(e)}registerByteStreamHandler(e,t){return this.incomingDataStreamManager.registerByteStreamHandler(e,t)}unregisterByteStreamHandler(e){return this.incomingDataStreamManager.unregisterByteStreamHandler(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setE2EEEnabled(e){return Nr(this,void 0,void 0,function*(){if(!this.e2eeManager)throw Error("e2ee not configured, please set e2ee settings within the room options");yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),""!==this.localParticipant.identity&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity)})}setupE2EE(){var e;const t=!!this.options.encryption,n=this.options.encryption||this.options.e2ee;n&&("e2eeManager"in n?(this.e2eeManager=n.e2eeManager,this.e2eeManager.isDataChannelEncryptionEnabled=t):this.e2eeManager=new al(n,t),this.e2eeManager.on(el.ParticipantEncryptionStatusChanged,(e,t)=>{t.isLocal&&(this.isE2EEEnabled=e),this.emit(lc.ParticipantEncryptionStatusChanged,e,t)}),this.e2eeManager.on(el.EncryptionError,(e,t)=>{const n=t?this.getParticipantByIdentity(t):void 0;this.emit(lc.EncryptionError,e,n)}),null===(e=this.e2eeManager)||void 0===e||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:null===(e=this.roomInfo)||void 0===e?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,t;return null!==(t=null===(e=this.roomInfo)||void 0===e?void 0:e.activeRecording)&&void 0!==t&&t}getSid(){return this.state===Yu.Disconnected?$a.resolve(""):this.roomInfo&&""!==this.roomInfo.sid?$a.resolve(this.roomInfo.sid):new $a((e,t)=>{const n=t=>{""!==t.sid&&(this.engine.off(mc.RoomUpdate,n),e(t.sid))};this.engine.on(mc.RoomUpdate,n),this.once(lc.Disconnected,()=>{this.engine.off(mc.RoomUpdate,n),t(new Cc("Room disconnected before room server id was available"))})})}get name(){var e,t;return null!==(t=null===(e=this.roomInfo)||void 0===e?void 0:e.name)&&void 0!==t?t:""}get metadata(){var e;return null===(e=this.roomInfo)||void 0===e?void 0:e.metadata}get numParticipants(){var e,t;return null!==(t=null===(e=this.roomInfo)||void 0===e?void 0:e.numParticipants)&&void 0!==t?t:0}get numPublishers(){var e,t;return null!==(t=null===(e=this.roomInfo)||void 0===e?void 0:e.numPublishers)&&void 0!==t?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Ru(this.options),this.engine.e2eeManager=this.e2eeManager,this.engine.on(mc.ParticipantUpdate,this.handleParticipantUpdates).on(mc.RoomUpdate,this.handleRoomUpdate).on(mc.SpeakersChanged,this.handleSpeakersChanged).on(mc.StreamStateChanged,this.handleStreamStateUpdate).on(mc.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(mc.SubscriptionError,this.handleSubscriptionError).on(mc.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(mc.MediaTrackAdded,(e,t,n)=>{this.onTrackAdded(e,t,n)}).on(mc.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(mc.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(mc.DataPacketReceived,this.handleDataPacket).on(mc.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(Yu.SignalReconnecting)&&this.emit(lc.SignalReconnecting)}).on(mc.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(Yu.Connected)&&this.emit(lc.Reconnected)}).on(mc.SignalResumed,()=>{this.bufferedEvents=[],(this.state===Yu.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(mc.Restarting,this.handleRestarting).on(mc.SignalRestarted,this.handleSignalRestarted).on(mc.Offline,()=>{this.setAndEmitConnectionState(Yu.Reconnecting)&&this.emit(lc.Reconnecting)}).on(mc.DCBufferStatusChanged,(e,t)=>{this.emit(lc.DCBufferStatusChanged,e,t)}).on(mc.LocalTrackSubscribed,e=>{const t=this.localParticipant.getTrackPublications().find(t=>{let{trackSid:n}=t;return n===e});t?(this.localParticipant.emit(hc.LocalTrackSubscribed,t),this.emitWhenConnected(lc.LocalTrackSubscribed,t,this.localParticipant)):this.log.warn("could not find local track subscription for subscribed event",this.logContext)}).on(mc.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((e,t)=>{this.handleParticipantDisconnected(t,e)}),this.emit(lc.Moved,e.room.name),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine),this.outgoingDataStreamManager&&this.outgoingDataStreamManager.setupEngine(this.engine))}static getLocalDevices(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ll.getInstance().getDevices(e,t)}prepareConnection(e,t){return Nr(this,void 0,void 0,function*(){if(this.state===Yu.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(fd(new URL(e))&&t){this.regionUrlProvider=new Xl(e,t);const n=yield this.regionUrlProvider.getNextBestRegionUrl();n&&this.state===Yu.Disconnected&&(this.regionUrl=n,yield fetch(xd(n),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(n),this.logContext))}else yield fetch(xd(e),{method:"HEAD"})}catch(ep){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:ep}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return Nr(this,void 0,void 0,function*(){let n,i=()=>Nr(this,void 0,void 0,function*(){});switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":n=new rr({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":n=new rr({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":n=new rr({scenario:{case:"serverLeave",value:!0}});break;case"migration":n=new rr({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":i=()=>Nr(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),n=new rr({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":i=()=>Nr(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),n=new rr({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":n=new rr({scenario:{case:"switchCandidateProtocol",value:"force-tls"===e?2:1}}),i=()=>Nr(this,void 0,void 0,function*(){const e=this.engine.client.onLeave;e&&e(new Fo({reason:gs.CLIENT_INITIATED,action:jo.RECONNECT}))});break;case"subscriber-bandwidth":if(void 0===t||"number"!=typeof t)throw new Error("subscriber-bandwidth requires a number as argument");n=new rr({scenario:{case:"subscriberBandwidth",value:Ud(t)}});break;case"leave-full-reconnect":n=new rr({scenario:{case:"leaveRequestFullReconnect",value:!0}})}n&&(yield this.engine.client.sendSimulateScenario(n),yield i())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return Nr(this,arguments,void 0,function(e,t){var n=this;let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function*(){var s,o,r,a,c,d,l;let u=!0,h=!1;const p=i?{exact:t}:t;if("audioinput"===e){h=0===n.localParticipant.audioTrackPublications.size;const t=null!==(s=n.getActiveDevice(e))&&void 0!==s?s:n.options.audioCaptureDefaults.deviceId;n.options.audioCaptureDefaults.deviceId=p;const i=Array.from(n.localParticipant.audioTrackPublications.values()).filter(e=>e.source===td.Source.Microphone);try{u=(yield Promise.all(i.map(e=>{var t;return null===(t=e.audioTrack)||void 0===t?void 0:t.setDeviceId(p)}))).every(e=>!0===e)}catch(ep){throw n.options.audioCaptureDefaults.deviceId=t,ep}const o=i.some(e=>{var t,n;return null!==(n=null===(t=e.track)||void 0===t?void 0:t.isMuted)&&void 0!==n&&n});u&&o&&(h=!0)}else if("videoinput"===e){h=0===n.localParticipant.videoTrackPublications.size;const t=null!==(o=n.getActiveDevice(e))&&void 0!==o?o:n.options.videoCaptureDefaults.deviceId;n.options.videoCaptureDefaults.deviceId=p;const i=Array.from(n.localParticipant.videoTrackPublications.values()).filter(e=>e.source===td.Source.Camera);try{u=(yield Promise.all(i.map(e=>{var t;return null===(t=e.videoTrack)||void 0===t?void 0:t.setDeviceId(p)}))).every(e=>!0===e)}catch(ep){throw n.options.videoCaptureDefaults.deviceId=t,ep}const s=i.some(e=>{var t,n;return null!==(n=null===(t=e.track)||void 0===t?void 0:t.isMuted)&&void 0!==n&&n});u&&s&&(h=!0)}else if("audiooutput"===e){if(h=!0,!dd()&&!n.options.webAudioMix||n.options.webAudioMix&&n.audioContext&&!("setSinkId"in n.audioContext))throw new Error("cannot switch audio output, the current browser does not support it");n.options.webAudioMix&&(t=null!==(r=yield ll.getInstance().normalizeDeviceId("audiooutput",t))&&void 0!==r?r:""),null!==(a=(l=n.options).audioOutput)&&void 0!==a||(l.audioOutput={});const i=null!==(c=n.getActiveDevice(e))&&void 0!==c?c:n.options.audioOutput.deviceId;n.options.audioOutput.deviceId=t;try{n.options.webAudioMix&&(null===(d=n.audioContext)||void 0===d||d.setSinkId(t)),yield Promise.all(Array.from(n.remoteParticipants.values()).map(e=>e.setAudioOutput({deviceId:t})))}catch(ep){throw n.options.audioOutput.deviceId=i,ep}}return h&&(n.localParticipant.activeDeviceMap.set(e,t),n.emit(lc.ActiveDeviceChanged,e,t)),u}()})}setupLocalParticipantEvents(){this.localParticipant.on(hc.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(hc.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(hc.AttributesChanged,this.onLocalAttributesChanged).on(hc.TrackMuted,this.onLocalTrackMuted).on(hc.TrackUnmuted,this.onLocalTrackUnmuted).on(hc.LocalTrackPublished,this.onLocalTrackPublished).on(hc.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(hc.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(hc.MediaDevicesError,this.onMediaDevicesError).on(hc.AudioStreamAcquired,this.startAudio).on(hc.ChatMessage,this.onLocalChatMessageSent).on(hc.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;null===(e=this.engine)||void 0===e||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,n){if(this.state===Yu.Connecting||this.state===Yu.Reconnecting){const i=()=>{this.log.debug("deferring on track for later",{mediaTrackId:e.id,mediaStreamId:t.id,tracksInStream:t.getTracks().map(e=>e.id)}),this.onTrackAdded(e,t,n),s()},s=()=>{this.off(lc.Reconnected,i),this.off(lc.Connected,i),this.off(lc.Disconnected,s)};return this.once(lc.Reconnected,i),this.once(lc.Connected,i),void this.once(lc.Disconnected,s)}if(this.state===Yu.Disconnected)return void this.log.warn("skipping incoming track after Room disconnected",this.logContext);if("ended"===e.readyState)return void this.log.info("skipping incoming track as it already ended",this.logContext);const i=function(e){const t=e.split("|");return t.length>1?[t[0],e.substr(t[0].length+1)]:[e,""]}(t.id),s=i[0];let o=i[1],r=e.id;if(o&&o.startsWith("TR")&&(r=o),s===this.localParticipant.sid)return void this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);const a=Array.from(this.remoteParticipants.values()).find(e=>e.sid===s);if(!a)return void this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(s),this.logContext);if(!r.startsWith("TR")){const e=this.engine.getTrackIdForReceiver(n);if(!e)return void this.log.error("Tried to add a track whose 'sid' could not be found for a participant, that's not present. Sid: ".concat(s),this.logContext);r=e}let c;r.startsWith("TR")||this.log.warn("Tried to add a track whose 'sid' could not be determined for a participant, that's not present. Sid: ".concat(s,", streamId: ").concat(o,", trackId: ").concat(r),Object.assign(Object.assign({},this.logContext),{rpID:s,streamId:o,trackId:r})),this.options.adaptiveStream&&(c="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{});const d=a.addSubscribedMediaTrack(e,r,t,n,c);(null==d?void 0:d.isEncrypted)&&!this.e2eeManager&&this.emit(lc.EncryptionError,new Error("Encrypted ".concat(d.source," track received from participant ").concat(a.sid,", but room does not have encryption enabled!")))}handleDisconnect(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var n,i;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.incomingDataStreamManager.clearControllers(),this.state!==Yu.Disconnected){this.regionUrl=void 0,this.regionUrlProvider&&this.regionUrlProvider.notifyDisconnected();try{this.remoteParticipants.forEach(e=>{e.trackPublications.forEach(t=>{e.unpublishTrack(t.trackSid)})}),this.localParticipant.trackPublications.forEach(t=>{var n,i,s;t.track&&this.localParticipant.unpublishTrack(t.track,e),e?(null===(n=t.track)||void 0===n||n.detach(),null===(i=t.track)||void 0===i||i.stop()):null===(s=t.track)||void 0===s||s.stopMonitor()}),this.localParticipant.off(hc.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(hc.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(hc.AttributesChanged,this.onLocalAttributesChanged).off(hc.TrackMuted,this.onLocalTrackMuted).off(hc.TrackUnmuted,this.onLocalTrackUnmuted).off(hc.LocalTrackPublished,this.onLocalTrackPublished).off(hc.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(hc.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(hc.MediaDevicesError,this.onMediaDevicesError).off(hc.AudioStreamAcquired,this.startAudio).off(hc.ChatMessage,this.onLocalChatMessageSent).off(hc.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&"boolean"==typeof this.options.webAudioMix&&(this.audioContext.close(),this.audioContext=void 0),gd()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),null===(i=null===(n=navigator.mediaDevices)||void 0===n?void 0:n.removeEventListener)||void 0===i||i.call(n,"devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(Yu.Disconnected),this.emit(lc.Disconnected,t)}}}handleParticipantDisconnected(e,t){var n;this.remoteParticipants.delete(e),t&&(this.incomingDataStreamManager.validateParticipantHasNoActiveDataStreams(e),t.trackPublications.forEach(e=>{t.unpublishTrack(e.trackSid,!0)}),this.emit(lc.ParticipantDisconnected,t),t.setDisconnected(),null===(n=this.localParticipant)||void 0===n||n.handleParticipantDisconnected(t.identity))}handleIncomingRpcRequest(e,t,n,i,s,o){return Nr(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),1!==o)return void(yield this.engine.publishRpcResponse(e,t,null,Zl.builtIn("UNSUPPORTED_VERSION")));const r=this.rpcHandlers.get(n);if(!r)return void(yield this.engine.publishRpcResponse(e,t,null,Zl.builtIn("UNSUPPORTED_METHOD")));let a=null,c=null;try{const o=yield r({requestId:t,callerIdentity:e,payload:i,responseTimeout:s});eu(o)>15360?(a=Zl.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),this.log.warn("RPC Response payload too large for ".concat(n))):c=o}catch(d){d instanceof Zl?a=d:(this.log.warn("Uncaught error returned by RPC handler for ".concat(n,". Returning APPLICATION_ERROR instead."),d),a=Zl.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,c,a)})}selectDefaultDevices(){return Nr(this,void 0,void 0,function*(){var e,t,n;const i=ll.getInstance().previousDevices,s=yield ll.getInstance().getDevices(void 0,!1),o=Xa();if("Chrome"===(null==o?void 0:o.name)&&"iOS"!==o.os)for(let a of s){const e=i.find(e=>e.deviceId===a.deviceId);e&&""!==e.label&&e.kind===a.kind&&e.label!==a.label&&"default"===this.getActiveDevice(a.kind)&&this.emit(lc.ActiveDeviceChanged,a.kind,a.deviceId)}const r=["audiooutput","audioinput","videoinput"];for(let a of r){const o=zc(a),r=this.localParticipant.getTrackPublication(o);if(r&&(null===(e=r.track)||void 0===e?void 0:e.isUserProvided))continue;const c=s.filter(e=>e.kind===a),d=this.getActiveDevice(a);d===(null===(t=i.filter(e=>e.kind===a)[0])||void 0===t?void 0:t.deviceId)&&c.length>0&&(null===(n=c[0])||void 0===n?void 0:n.deviceId)!==d?yield this.switchActiveDevice(a,c[0].deviceId):"audioinput"===a&&!pd()||"videoinput"===a||!(c.length>0)||c.find(e=>e.deviceId===this.getActiveDevice(a))||"audiooutput"===a&&pd()||(yield this.switchActiveDevice(a,c[0].deviceId))}})}acquireAudioContext(){return Nr(this,void 0,void 0,function*(){var e,t;if("boolean"!=typeof this.options.webAudioMix&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:this.audioContext&&"closed"!==this.audioContext.state||(this.audioContext=null!==(e=Hc())&&void 0!==e?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(e=>e.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&"suspended"===this.audioContext.state)try{yield Promise.race([this.audioContext.resume(),od(200)])}catch(ep){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:ep}))}const n="running"===(null===(t=this.audioContext)||void 0===t?void 0:t.state);n!==this.canPlaybackAudio&&(this.audioEnabled=n,this.emit(lc.AudioPlaybackStatusChanged,n))})}createParticipant(e,t){var n;let i;return i=t?oh.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):new oh(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),(null===(n=this.options.audioOutput)||void 0===n?void 0:n.deviceId)&&i.setAudioOutput(this.options.audioOutput).catch(e=>this.log.warn("Could not set audio output: ".concat(e.message),this.logContext)),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const n=this.remoteParticipants.get(e);if(t){n.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity)}return n}const n=this.createParticipant(e,t);return this.remoteParticipants.set(e,n),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(lc.ParticipantConnected,n),n.on(hc.TrackPublished,e=>{this.emitWhenConnected(lc.TrackPublished,e,n)}).on(hc.TrackSubscribed,(e,t)=>{e.kind===td.Kind.Audio?(e.on(vc.AudioPlaybackStarted,this.handleAudioPlaybackStarted),e.on(vc.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):e.kind===td.Kind.Video&&(e.on(vc.VideoPlaybackFailed,this.handleVideoPlaybackFailed),e.on(vc.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(lc.TrackSubscribed,e,t,n)}).on(hc.TrackUnpublished,e=>{this.emit(lc.TrackUnpublished,e,n)}).on(hc.TrackUnsubscribed,(e,t)=>{this.emit(lc.TrackUnsubscribed,e,t,n)}).on(hc.TrackMuted,e=>{this.emitWhenConnected(lc.TrackMuted,e,n)}).on(hc.TrackUnmuted,e=>{this.emitWhenConnected(lc.TrackUnmuted,e,n)}).on(hc.ParticipantMetadataChanged,e=>{this.emitWhenConnected(lc.ParticipantMetadataChanged,e,n)}).on(hc.ParticipantNameChanged,e=>{this.emitWhenConnected(lc.ParticipantNameChanged,e,n)}).on(hc.AttributesChanged,e=>{this.emitWhenConnected(lc.ParticipantAttributesChanged,e,n)}).on(hc.ConnectionQualityChanged,e=>{this.emitWhenConnected(lc.ConnectionQualityChanged,e,n)}).on(hc.ParticipantPermissionsChanged,e=>{this.emitWhenConnected(lc.ParticipantPermissionsChanged,e,n)}).on(hc.TrackSubscriptionStatusChanged,(e,t)=>{this.emitWhenConnected(lc.TrackSubscriptionStatusChanged,e,t,n)}).on(hc.TrackSubscriptionFailed,(e,t)=>{this.emit(lc.TrackSubscriptionFailed,e,n,t)}).on(hc.TrackSubscriptionPermissionChanged,(e,t)=>{this.emitWhenConnected(lc.TrackSubscriptionPermissionChanged,e,t,n)}).on(hc.Active,()=>{this.emitWhenConnected(lc.ParticipantActive,n),n.kind===Ts.AGENT&&this.localParticipant.setActiveAgent(n)}),t&&n.updateInfo(t),n}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((e,t)=>(e.push(...t.getTrackPublications()),e),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,t)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&Hd(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Ic.setInterval(()=>{this.engine&&!this.engine.isClosed&&this.engine.verifyTransport()?e=0:(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnectedOrConnecting:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,gs.STATE_MISMATCH)))},4e3)}clearConnectionReconcile(){this.connectionReconcileInterval&&Ic.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e!==this.state&&(this.state=e,this.emit(lc.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,n]=e;this.emit(t,...n)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(this.state===Yu.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,n]);else if(this.state===Yu.Connected)return this.emit(e,...n);return!1}simulateParticipants(e){return Nr(this,void 0,void 0,function*(){var t,n,i,s;const o=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),r=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new bs({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:Hn.parse(/* @__PURE__ */(new Date).getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Cs({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(lc.SignalConnected),this.emit(lc.Connected),this.setAndEmitConnectionState(Yu.Connected),o.video){const e=new Zu(td.Kind.Video,new Is({source:us.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:ls.AUDIO,name:"video-dummy"}),new yu(o.useRealTracks&&(null===(t=window.navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia)?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Rd(160*(null!==(n=r.aspectRatios[0])&&void 0!==n?n:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(e),this.localParticipant.emit(hc.LocalTrackPublished,e)}if(o.audio){const e=new Zu(td.Kind.Audio,new Is({source:us.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:ls.AUDIO}),new cu(o.useRealTracks&&(null===(i=navigator.mediaDevices)||void 0===i?void 0:i.getUserMedia)?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ld(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(e),this.localParticipant.emit(hc.LocalTrackPublished,e)}for(let e=0;e<r.count-1;e+=1){let t=new Cs({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(e),state:ws.ACTIVE,tracks:[],joinedAt:Hn.parse(Date.now())});const n=this.getOrCreateParticipant(t.identity,t);if(r.video){const i=Rd(160*(null!==(s=r.aspectRatios[e%r.aspectRatios.length])&&void 0!==s?s:1),160,!1,!0),o=new Is({source:us.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:ls.AUDIO});n.addSubscribedMediaTrack(i,o.sid,new MediaStream([i]),new RTCRtpReceiver),t.tracks=[...t.tracks,o]}if(r.audio){const e=Ld(),i=new Is({source:us.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:ls.AUDIO});n.addSubscribedMediaTrack(e,i.sid,new MediaStream([e]),new RTCRtpReceiver),t.tracks=[...t.tracks,i]}n.updateInfo(t)}})}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(e!==lc.ActiveSpeakersChanged&&e!==lc.TranscriptionReceived){const t=ah(n).filter(e=>void 0!==e);e!==lc.TrackSubscribed&&e!==lc.TrackUnsubscribed||this.log.trace("subscribe trace: ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:t})),this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:t}))}return super.emit(e,...n)}}function ah(e){return e.map(e=>{if(e)return Array.isArray(e)?ah(e):"object"==typeof e?"logContext"in e?e.logContext:void 0:e})}var ch,dh,lh,uh,hh,ph,mh,gh,vh,fh,_h,bh,yh,kh,Ch,wh;rh.cleanupRegistry="undefined"!=typeof FinalizationRegistry&&new FinalizationRegistry(e=>{e()}),(dh=ch||(ch={}))[dh.TooShort=0]="TooShort",dh[dh.HeaderOverrun=1]="HeaderOverrun",dh[dh.MissingExtWords=2]="MissingExtWords",dh[dh.UnsupportedVersion=3]="UnsupportedVersion",dh[dh.InvalidHandle=4]="InvalidHandle",dh[dh.MalformedExt=5]="MalformedExt",(uh=lh||(lh={}))[uh.TooSmallForHeader=0]="TooSmallForHeader",uh[uh.TooSmallForPayload=1]="TooSmallForPayload",(ph=hh||(hh={}))[ph.UserTimestamp=2]="UserTimestamp",ph[ph.E2ee=1]="E2ee",hh.UserTimestamp,hh.E2ee,(gh=mh||(mh={}))[gh.Reserved=0]="Reserved",gh[gh.TooLarge=1]="TooLarge",(fh=vh||(vh={}))[fh.Start=0]="Start",fh[fh.Inter=1]="Inter",fh[fh.Final=2]="Final",fh[fh.Single=3]="Single",(bh=_h||(_h={}))[bh.MtuTooShort=0]="MtuTooShort",Or(Ir.DataTracks),(kh=yh||(yh={}))[kh.Interrupted=0]="Interrupted",kh[kh.UnknownFrame=1]="UnknownFrame",kh[kh.BufferFull=2]="BufferFull",kh[kh.Incomplete=3]="Incomplete",(wh=Ch||(Ch={}))[wh.IDLE=0]="IDLE",wh[wh.RUNNING=1]="RUNNING",wh[wh.SKIPPED=2]="SKIPPED",wh[wh.SUCCESS=3]="SUCCESS",wh[wh.FAILED=4]="FAILED";qr.EventEmitter;qr.EventEmitter;function Th(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new TextEncoder,new TextDecoder;class Sh extends Error{constructor(e,t){var n;super(e,t),Th(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}Th(Sh,"code","ERR_JOSE_GENERIC");Th(class extends Sh{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:i,payload:t}}),Th(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),Th(this,"claim",void 0),Th(this,"reason",void 0),Th(this,"payload",void 0),this.claim=n,this.reason=i,this.payload=t}},"code","ERR_JWT_CLAIM_VALIDATION_FAILED");Th(class extends Sh{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:i,payload:t}}),Th(this,"code","ERR_JWT_EXPIRED"),Th(this,"claim",void 0),Th(this,"reason",void 0),Th(this,"payload",void 0),this.claim=n,this.reason=i,this.payload=t}},"code","ERR_JWT_EXPIRED");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}},"code","ERR_JOSE_ALG_NOT_ALLOWED");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JOSE_NOT_SUPPORTED")}},"code","ERR_JOSE_NOT_SUPPORTED");Th(class extends Sh{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),Th(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JWS_INVALID")}},"code","ERR_JWS_INVALID");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JWT_INVALID")}},"code","ERR_JWT_INVALID");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");Th(class extends Sh{constructor(){super(...arguments),Th(this,"code","ERR_JWKS_INVALID")}},"code","ERR_JWKS_INVALID");Th(class extends Sh{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),Th(this,"code","ERR_JWKS_NO_MATCHING_KEY")}},"code","ERR_JWKS_NO_MATCHING_KEY");Th(class extends Sh{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),Th(this,Symbol.asyncIterator,void 0),Th(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}},"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");Th(class extends Sh{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),Th(this,"code","ERR_JWKS_TIMEOUT")}},"code","ERR_JWKS_TIMEOUT");function Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Eh.apply(null,arguments)}Th(class extends Sh{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),Th(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}},"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Ph=new Uint8Array(0);class Ih{static getFullOptions(e){var t;const n=function(e){var t,n;const{textOnly:i}=null!=(t=null==(n=e.overrides)?void 0:n.conversation)?t:{},{textOnly:s}=e;return"boolean"==typeof s?("boolean"==typeof i&&s!==i&&console.warn(`Conflicting textOnly options provided: ${s} via options.textOnly (will be used) and ${i} via options.overrides.conversation.textOnly (will be ignored)`),s):"boolean"==typeof i?i:void 0}(e);return Eh({clientTools:{},onConnect:()=>{},onDebug:()=>{},onDisconnect:()=>{},onError:()=>{},onMessage:()=>{},onAudio:()=>{},onModeChange:()=>{},onStatusChange:()=>{},onCanSendFeedbackChange:()=>{},onInterruption:()=>{}},e,{textOnly:n,overrides:Eh({},e.overrides,{conversation:Eh({},null==(t=e.overrides)?void 0:t.conversation,{textOnly:n})})})}constructor(e,t){var n=this;this.options=void 0,this.connection=void 0,this.lastInterruptTimestamp=0,this.mode="listening",this.status="connecting",this.volume=1,this.currentEventId=1,this.lastFeedbackEventId=0,this.canSendFeedback=!1,this.endSessionWithDetails=async function(e){"connected"!==n.status&&"connecting"!==n.status||(n.updateStatus("disconnecting"),await n.handleEndSession(),n.updateStatus("disconnected"),n.options.onDisconnect&&n.options.onDisconnect(e))},this.onMessage=async function(e){switch(e.type){case"interruption":return void n.handleInterruption(e);case"agent_response":return void n.handleAgentResponse(e);case"user_transcript":return void n.handleUserTranscript(e);case"internal_tentative_agent_response":return void n.handleTentativeAgentResponse(e);case"client_tool_call":try{await n.handleClientToolCall(e)}catch(t){n.onError(`Unexpected error in client tool call handling: ${t instanceof Error?t.message:String(t)}`,{clientToolName:e.client_tool_call.tool_name,toolCallId:e.client_tool_call.tool_call_id})}return;case"audio":return void n.handleAudio(e);case"vad_score":return void n.handleVadScore(e);case"ping":return void n.connection.sendMessage({type:"pong",event_id:e.ping_event.event_id});case"mcp_tool_call":return void n.handleMCPToolCall(e);case"mcp_connection_status":return void n.handleMCPConnectionStatus(e);case"agent_tool_request":return void n.handleAgentToolRequest(e);case"agent_tool_response":return void n.handleAgentToolResponse(e);case"conversation_initiation_metadata":return void n.handleConversationMetadata(e);case"asr_initiation_metadata":return void n.handleAsrInitiationMetadata(e);case"agent_chat_response_part":return void n.handleAgentChatResponsePart(e);case"error":return void n.handleErrorEvent(e);default:return void(n.options.onDebug&&n.options.onDebug(e))}},this.setVolume=({volume:e})=>{this.volume=e},this.options=e,this.connection=t,this.options.onConnect&&this.options.onConnect({conversationId:t.conversationId}),this.connection.onMessage(this.onMessage),this.connection.onDisconnect(this.endSessionWithDetails),this.connection.onModeChange(e=>this.updateMode(e)),this.updateStatus("connected")}endSession(){return this.endSessionWithDetails({reason:"user"})}async handleEndSession(){this.connection.close()}updateMode(e){e!==this.mode&&(this.mode=e,this.options.onModeChange&&this.options.onModeChange({mode:e}))}updateStatus(e){e!==this.status&&(this.status=e,this.options.onStatusChange&&this.options.onStatusChange({status:e}))}updateCanSendFeedback(){const e=this.currentEventId!==this.lastFeedbackEventId;this.canSendFeedback!==e&&(this.canSendFeedback=e,this.options.onCanSendFeedbackChange&&this.options.onCanSendFeedbackChange({canSendFeedback:e}))}handleInterruption(e){e.interruption_event&&(this.lastInterruptTimestamp=e.interruption_event.event_id,this.options.onInterruption&&this.options.onInterruption({event_id:e.interruption_event.event_id}))}handleAgentResponse(e){this.options.onMessage&&this.options.onMessage({source:"ai",role:"agent",message:e.agent_response_event.agent_response,event_id:e.agent_response_event.event_id})}handleUserTranscript(e){this.options.onMessage&&this.options.onMessage({source:"user",role:"user",message:e.user_transcription_event.user_transcript,event_id:e.user_transcription_event.event_id})}handleTentativeAgentResponse(e){this.options.onDebug&&this.options.onDebug({type:"tentative_agent_response",response:e.tentative_agent_response_internal_event.tentative_agent_response})}handleVadScore(e){this.options.onVadScore&&this.options.onVadScore({vadScore:e.vad_score_event.vad_score})}async handleClientToolCall(e){if(Object.prototype.hasOwnProperty.call(this.options.clientTools,e.client_tool_call.tool_name))try{var t;const n=null!=(t=await this.options.clientTools[e.client_tool_call.tool_name](e.client_tool_call.parameters))?t:"Client tool execution successful.",i="object"==typeof n?JSON.stringify(n):String(n);this.connection.sendMessage({type:"client_tool_result",tool_call_id:e.client_tool_call.tool_call_id,result:i,is_error:!1})}catch(n){this.onError(`Client tool execution failed with following error: ${null==n?void 0:n.message}`,{clientToolName:e.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:e.client_tool_call.tool_call_id,result:`Client tool execution failed: ${null==n?void 0:n.message}`,is_error:!0})}else{if(this.options.onUnhandledClientToolCall)return void this.options.onUnhandledClientToolCall(e.client_tool_call);this.onError(`Client tool with name ${e.client_tool_call.tool_name} is not defined on client`,{clientToolName:e.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:e.client_tool_call.tool_call_id,result:`Client tool with name ${e.client_tool_call.tool_name} is not defined on client`,is_error:!0})}}handleAudio(e){}handleMCPToolCall(e){this.options.onMCPToolCall&&this.options.onMCPToolCall(e.mcp_tool_call)}handleMCPConnectionStatus(e){this.options.onMCPConnectionStatus&&this.options.onMCPConnectionStatus(e.mcp_connection_status)}handleAgentToolRequest(e){this.options.onAgentToolRequest&&this.options.onAgentToolRequest(e.agent_tool_request)}handleAgentToolResponse(e){"end_call"===e.agent_tool_response.tool_name&&this.endSessionWithDetails({reason:"agent",context:new CloseEvent("end_call",{reason:"Agent ended the call"})}),this.options.onAgentToolResponse&&this.options.onAgentToolResponse(e.agent_tool_response)}handleConversationMetadata(e){this.options.onConversationMetadata&&this.options.onConversationMetadata(e.conversation_initiation_metadata_event)}handleAsrInitiationMetadata(e){this.options.onAsrInitiationMetadata&&this.options.onAsrInitiationMetadata(e.asr_initiation_metadata_event)}handleAgentChatResponsePart(e){this.options.onAgentChatResponsePart&&this.options.onAgentChatResponsePart(e.text_response_part)}handleErrorEvent(e){const t=e.error_event.error_type,n=e.error_event.message||e.error_event.reason||"Unknown error";"max_duration_exceeded"!==t?this.onError(`Server error: ${n}`,{errorType:t,code:e.error_event.code,debugMessage:e.error_event.debug_message,details:e.error_event.details}):this.endSessionWithDetails({reason:"error",message:n,context:new Event("max_duration_exceeded")})}onError(e,t){console.error(e,t),this.options.onError&&this.options.onError(e,t)}getId(){return this.connection.conversationId}isOpen(){return"connected"===this.status}setMicMuted(e){this.connection.setMicMuted(e)}getInputByteFrequencyData(){return Ph}getOutputByteFrequencyData(){return Ph}getInputVolume(){return 0}getOutputVolume(){return 0}sendFeedback(e){this.canSendFeedback?(this.connection.sendMessage({type:"feedback",score:e?"like":"dislike",event_id:this.currentEventId}),this.lastFeedbackEventId=this.currentEventId,this.updateCanSendFeedback()):console.warn(0===this.lastFeedbackEventId?"Cannot send feedback: the conversation has not started yet.":"Cannot send feedback: feedback has already been sent for the current response.")}sendContextualUpdate(e){this.connection.sendMessage({type:"contextual_update",text:e})}sendUserMessage(e){this.connection.sendMessage({type:"user_message",text:e})}sendUserActivity(){this.connection.sendMessage({type:"user_activity"})}sendMCPToolApprovalResult(e,t){this.connection.sendMessage({type:"mcp_tool_approval_result",tool_call_id:e,is_approved:t})}}let Rh=class{constructor(e={}){this.queue=[],this.disconnectionDetails=null,this.onDisconnectCallback=null,this.onMessageCallback=null,this.onModeChangeCallback=null,this.onDebug=void 0,this.onDebug=e.onDebug}debug(e){this.onDebug&&this.onDebug(e)}onMessage(e){this.onMessageCallback=e;const t=this.queue;this.queue=[],t.length>0&&queueMicrotask(()=>{t.forEach(e)})}onDisconnect(e){this.onDisconnectCallback=e;const t=this.disconnectionDetails;t&&queueMicrotask(()=>{e(t)})}onModeChange(e){this.onModeChangeCallback=e}updateMode(e){var t;null==(t=this.onModeChangeCallback)||t.call(this,e)}disconnect(e){var t;this.disconnectionDetails||(this.disconnectionDetails=e,null==(t=this.onDisconnectCallback)||t.call(this,e))}handleMessage(e){this.onMessageCallback?this.onMessageCallback(e):this.queue.push(e)}};function Mh(e){const[t,n]=e.split("_");if(!["pcm","ulaw"].includes(t))throw new Error(`Invalid format: ${e}`);const i=Number.parseInt(n);if(Number.isNaN(i))throw new Error(`Invalid sample rate: ${n}`);return{format:t,sampleRate:i}}const Lh="0.15.1";function Oh(e){return!!e.type}const Dh="conversation_initiation_client_data";function xh(e){var t;const n={type:Dh};var i,s,o,r,a,c,d,l;return e.overrides&&(n.conversation_config_override={agent:{prompt:null==(i=e.overrides.agent)?void 0:i.prompt,first_message:null==(s=e.overrides.agent)?void 0:s.firstMessage,language:null==(o=e.overrides.agent)?void 0:o.language},tts:{voice_id:null==(r=e.overrides.tts)?void 0:r.voiceId,speed:null==(a=e.overrides.tts)?void 0:a.speed,stability:null==(c=e.overrides.tts)?void 0:c.stability,similarity_boost:null==(d=e.overrides.tts)?void 0:d.similarityBoost},conversation:{text_only:null==(l=e.overrides.conversation)?void 0:l.textOnly}}),e.customLlmExtraBody&&(n.custom_llm_extra_body=e.customLlmExtraBody),e.dynamicVariables&&(n.dynamic_variables=e.dynamicVariables),e.userId&&(n.user_id=e.userId),null!=(t=e.overrides)&&t.client&&(n.source_info={source:e.overrides.client.source,version:e.overrides.client.version}),n}let Ah=class extends Error{constructor(e,t){super(e),this.closeCode=void 0,this.closeReason=void 0,this.name="SessionConnectionError",this.closeCode=null==t?void 0:t.closeCode,this.closeReason=null==t?void 0:t.closeReason}},Nh=class e extends Rh{constructor(e,t,n,i){super(),this.socket=void 0,this.conversationId=void 0,this.inputFormat=void 0,this.outputFormat=void 0,this.socket=e,this.conversationId=t,this.inputFormat=n,this.outputFormat=i,this.socket.addEventListener("error",e=>{setTimeout(()=>this.disconnect({reason:"error",message:"The connection was closed due to a socket error.",context:e}),0)}),this.socket.addEventListener("close",e=>{this.disconnect(1e3===e.code?{reason:"agent",context:e,closeCode:e.code,closeReason:e.reason||void 0}:{reason:"error",message:e.reason||"The connection was closed by the server.",context:e,closeCode:e.code,closeReason:e.reason||void 0})}),this.socket.addEventListener("message",e=>{try{const t=JSON.parse(e.data);if(!Oh(t))return void this.debug({type:"invalid_event",message:"Received invalid socket event",data:e.data});this.handleMessage(t)}catch(t){this.debug({type:"parsing_error",message:"Failed to parse socket message",error:t instanceof Error?t.message:String(t),data:e.data})}})}static async create(t){let n=null;try{var i,s,o;const r=null!=(i=t.origin)?i:"wss://api.elevenlabs.io";let a;const c=(null==(s=t.overrides)||null==(s=s.client)?void 0:s.version)||Lh,d=(null==(o=t.overrides)||null==(o=o.client)?void 0:o.source)||"js_sdk";if(t.signedUrl){const e=t.signedUrl.includes("?")?"&":"?";a=`${t.signedUrl}${e}source=${d}&version=${c}`}else a=`${r}/v1/convai/conversation?agent_id=${t.agentId}&source=${d}&version=${c}`;const l=["convai"];t.authorization&&l.push(`bearer.${t.authorization}`),n=new WebSocket(a,l);const u=await new Promise((e,i)=>{n.addEventListener("open",()=>{var e;const i=xh(t);null==(e=n)||e.send(JSON.stringify(i))},{once:!0}),n.addEventListener("error",e=>{setTimeout(()=>i(new Ah("The connection was closed due to a socket error.")),0)}),n.addEventListener("close",e=>{i(new Ah(e.reason||(1e3===e.code?"Connection closed normally before session could be established.":"Connection closed unexpectedly before session could be established."),{closeCode:e.code,closeReason:e.reason||void 0}))}),n.addEventListener("message",t=>{const n=JSON.parse(t.data);Oh(n)&&("conversation_initiation_metadata"===n.type?e(n.conversation_initiation_metadata_event):console.warn("First received message is not conversation metadata."))},{once:!0})}),{conversation_id:h,agent_output_audio_format:p,user_input_audio_format:m}=u,g=Mh(null!=m?m:"pcm_16000"),v=Mh(p);return new e(n,h,g,v)}catch(a){var r;throw null==(r=n)||r.close(),a}}close(){this.socket.close(1e3,"User ended conversation")}sendMessage(e){this.socket.send(JSON.stringify(e))}async setMicMuted(e){console.warn(`WebSocket connection setMicMuted called with ${e}, but this is handled by VoiceConversation`)}};function Uh(e){const t=new Uint8Array(e);return window.btoa(String.fromCharCode(...t))}function Fh(e){const t=window.atob(e),n=t.length,i=new Uint8Array(n);for(let s=0;s<n;s++)i[s]=t.charCodeAt(s);return i.buffer}const jh=/* @__PURE__ */new Map;function Bh(e,t){return async(n,i)=>{const s=jh.get(e);if(s)return n.addModule(s);if(i)try{return await n.addModule(i),void jh.set(e,i)}catch(a){throw new Error(`Failed to load the ${e} worklet module from path: ${i}. Error: ${a}`)}const o=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(o);try{return await n.addModule(r),void jh.set(e,r)}catch(c){URL.revokeObjectURL(r)}try{const i=`data:application/javascript;base64,${btoa(t)}`;await n.addModule(i),jh.set(e,i)}catch(a){throw new Error(`Failed to load the ${e} worklet module. Make sure the browser supports AudioWorklets. If you are using a strict CSP, you may need to self-host the worklet files.`)}}}const qh=Bh("rawAudioProcessor",'/*\n * ulaw encoding logic taken from the wavefile library\n * https://github.com/rochars/wavefile/blob/master/lib/codecs/mulaw.js\n * USED BY @elevenlabs/client\n */\n\nconst BIAS = 0x84;\nconst CLIP = 32635;\nconst encodeTable = [\n 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,\n 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\n 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7\n];\n\nfunction encodeSample(sample) {\n let sign;\n let exponent;\n let mantissa;\n let muLawSample;\n sign = (sample >> 8) & 0x80;\n if (sign !== 0) sample = -sample;\n sample = sample + BIAS;\n if (sample > CLIP) sample = CLIP;\n exponent = encodeTable[(sample>>7) & 0xFF];\n mantissa = (sample >> (exponent+3)) & 0x0F;\n muLawSample = ~(sign | (exponent << 4) | mantissa);\n \n return muLawSample;\n}\n\nclass RawAudioProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n \n this.port.onmessage = ({ data }) => {\n switch (data.type) {\n case "setFormat":\n this.isMuted = false;\n this.buffer = []; // Initialize an empty buffer\n this.bufferSize = data.sampleRate / 10;\n this.format = data.format;\n\n if (globalThis.LibSampleRate && sampleRate !== data.sampleRate) {\n globalThis.LibSampleRate.create(1, sampleRate, data.sampleRate).then(resampler => {\n this.resampler = resampler;\n });\n }\n break;\n case "setMuted":\n this.isMuted = data.isMuted;\n break;\n }\n };\n }\n process(inputs) {\n if (!this.buffer) {\n return true;\n }\n \n const input = inputs[0]; // Get the first input node\n if (input.length > 0) {\n let channelData = input[0]; // Get the first channel\'s data\n\n // Resample the audio if necessary\n if (this.resampler) {\n channelData = this.resampler.full(channelData);\n }\n\n // Add channel data to the buffer\n this.buffer.push(...channelData);\n // Get max volume \n let sum = 0.0;\n for (let i = 0; i < channelData.length; i++) {\n sum += channelData[i] * channelData[i];\n }\n const maxVolume = Math.sqrt(sum / channelData.length);\n // Check if buffer size has reached or exceeded the threshold\n if (this.buffer.length >= this.bufferSize) {\n const float32Array = this.isMuted \n ? new Float32Array(this.buffer.length)\n : new Float32Array(this.buffer);\n\n let encodedArray = this.format === "ulaw"\n ? new Uint8Array(float32Array.length)\n : new Int16Array(float32Array.length);\n\n // Iterate through the Float32Array and convert each sample to PCM16\n for (let i = 0; i < float32Array.length; i++) {\n // Clamp the value to the range [-1, 1]\n let sample = Math.max(-1, Math.min(1, float32Array[i]));\n\n // Scale the sample to the range [-32768, 32767]\n let value = sample < 0 ? sample * 32768 : sample * 32767;\n if (this.format === "ulaw") {\n value = encodeSample(Math.round(value));\n }\n\n encodedArray[i] = value;\n }\n\n // Send the buffered data to the main script\n this.port.postMessage([encodedArray, maxVolume]);\n\n // Clear the buffer after sending\n this.buffer = [];\n }\n }\n return true; // Continue processing\n }\n}\nregisterProcessor("rawAudioProcessor", RawAudioProcessor);\n');class Vh extends Rh{constructor(e,t,n,i,s={}){super(s),this.conversationId=void 0,this.inputFormat=void 0,this.outputFormat=void 0,this.room=void 0,this.isConnected=!1,this.audioEventId=1,this.audioCaptureContext=null,this.audioElements=[],this.outputDeviceId=null,this.outputAnalyser=null,this.outputFrequencyData=null,this.room=e,this.conversationId=t,this.inputFormat=n,this.outputFormat=i,this.setupRoomEventListeners()}static async create(e){let t;if("conversationToken"in e&&e.conversationToken)t=e.conversationToken;else{if(!("agentId"in e)||!e.agentId)throw new Error("Either conversationToken or agentId is required for WebRTC connection");try{var n,i,s;const r=(null==(n=e.overrides)||null==(n=n.client)?void 0:n.version)||Lh,a=(null==(i=e.overrides)||null==(i=i.client)?void 0:i.source)||"js_sdk",c=`${o=null!=(s=e.origin)?s:"https://api.elevenlabs.io",o.replace(/^wss:\/\//,"https://")}/v1/convai/conversation/token?agent_id=${e.agentId}&source=${a}&version=${r}`,d=await fetch(c);if(!d.ok)throw new Error(`ElevenLabs API returned ${d.status} ${d.statusText}`);if(t=(await d.json()).token,!t)throw new Error("No conversation token received from API")}catch(ep){let n=ep instanceof Error?ep.message:String(ep);throw ep instanceof Error&&ep.message.includes("401")&&(n="Your agent has authentication enabled, but no signed URL or conversation token was provided."),new Error(`Failed to fetch conversation token for agent ${e.agentId}: ${n}`)}}var o;const r=new rh;try{const n=`room_${Date.now()}`,i=Mh("pcm_48000"),s=Mh("pcm_48000"),o=new Vh(r,n,i,s,e),c=e.livekitUrl||"wss://livekit.rtc.elevenlabs.io";var a;await r.connect(c,t),await new Promise(e=>{if(o.isConnected)e();else{const t=()=>{r.off(lc.Connected,t),e()};r.on(lc.Connected,t)}}),r.name&&(o.conversationId=(null==(a=r.name.match(/(conv_[a-zA-Z0-9]+)/))?void 0:a[0])||r.name),e.textOnly||await r.localParticipant.setMicrophoneEnabled(!0);const d=xh(e);return o.debug({type:Dh,message:d}),await o.sendMessage(d),o}catch(ep){throw await r.disconnect(),ep}}setupRoomEventListeners(){var e=this;this.room.on(lc.Connected,async function(){e.isConnected=!0,console.info("WebRTC room connected")}),this.room.on(lc.Disconnected,e=>{this.isConnected=!1,this.disconnect({reason:"agent",context:new CloseEvent("close",{reason:null==e?void 0:e.toString()})})}),this.room.on(lc.ConnectionStateChanged,e=>{e===Yu.Disconnected&&(this.isConnected=!1,this.disconnect({reason:"error",message:`LiveKit connection state changed to ${e}`,context:new Event("connection_state_changed")}))}),this.room.on(lc.DataReceived,(e,t)=>{try{const t=JSON.parse((new TextDecoder).decode(e));if("audio"===t.type)return;Oh(t)?this.handleMessage(t):console.warn("Invalid socket event received:",t)}catch(n){console.warn("Failed to parse incoming data message:",n),console.warn("Raw payload:",(new TextDecoder).decode(e))}}),this.room.on(lc.TrackSubscribed,async function(t,n,i){if(t.kind===td.Kind.Audio&&i.identity.includes("agent")){const n=t,i=n.attach();if(i.autoplay=!0,i.controls=!1,e.outputDeviceId&&i.setSinkId)try{await i.setSinkId(e.outputDeviceId)}catch(s){console.warn("Failed to set output device for new audio element:",s)}i.style.display="none",document.body.appendChild(i),e.audioElements.push(i),1===e.audioElements.length&&(null==e.onDebug||e.onDebug({type:"audio_element_ready"})),await e.setupAudioCapture(n)}}),this.room.on(lc.ActiveSpeakersChanged,async function(t){e.updateMode(t.length>0&&t[0].identity.startsWith("agent")?"speaking":"listening")}),this.room.on(lc.ParticipantDisconnected,e=>{var t;null!=(t=e.identity)&&t.startsWith("agent")&&this.disconnect({reason:"agent",context:new CloseEvent("close",{reason:"agent disconnected"})})})}close(){if(this.isConnected){try{this.room.localParticipant.audioTrackPublications.forEach(e=>{e.track&&e.track.stop()})}catch(ep){console.warn("Error stopping local tracks:",ep)}this.audioCaptureContext&&(this.audioCaptureContext.close().catch(e=>{console.warn("Error closing audio capture context:",e)}),this.audioCaptureContext=null),this.audioElements.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),this.audioElements=[],this.room.disconnect()}}async sendMessage(e){if(this.isConnected&&this.room.localParticipant){if(!("user_audio_chunk"in e))try{const t=(new TextEncoder).encode(JSON.stringify(e));await this.room.localParticipant.publishData(t,{reliable:!0})}catch(t){this.debug({type:"send_message_error",message:{message:e,error:t}}),console.error("Failed to send message via WebRTC:",t)}}else console.warn("Cannot send message: room not connected or no local participant")}getRoom(){return this.room}async setMicMuted(e){if(!this.isConnected||!this.room.localParticipant)return void console.warn("Cannot set microphone muted: room not connected or no local participant");const t=this.room.localParticipant.getTrackPublication(td.Source.Microphone);if(null!=t&&t.track)try{e?await t.track.mute():await t.track.unmute()}catch(n){await this.room.localParticipant.setMicrophoneEnabled(!e)}else await this.room.localParticipant.setMicrophoneEnabled(!e)}async setupAudioCapture(e){try{const t=new AudioContext;this.audioCaptureContext=t,this.outputAnalyser=t.createAnalyser(),this.outputAnalyser.fftSize=2048,this.outputAnalyser.smoothingTimeConstant=.8;const n=new MediaStream([e.mediaStreamTrack]),i=t.createMediaStreamSource(n);i.connect(this.outputAnalyser),await qh(t.audioWorklet);const s=new AudioWorkletNode(t,"rawAudioProcessor");this.outputAnalyser.connect(s),s.port.postMessage({type:"setFormat",format:this.outputFormat.format,sampleRate:this.outputFormat.sampleRate}),s.port.onmessage=e=>{const[t,n]=e.data;if(n>.01){const e=Uh(t.buffer),n=this.audioEventId++;this.handleMessage({type:"audio",audio_event:{audio_base_64:e,event_id:n}})}},i.connect(s)}catch(t){console.warn("Failed to set up audio capture:",t)}}setAudioVolume(e){this.audioElements.forEach(t=>{t.volume=e})}async setAudioOutputDevice(e){if(!("setSinkId"in HTMLAudioElement.prototype))throw new Error("setSinkId is not supported in this browser");const t=this.audioElements.map(async function(t){try{await t.setSinkId(e)}catch(n){throw console.error("Failed to set sink ID for audio element:",n),n}});await Promise.all(t),this.outputDeviceId=e}async setAudioInputDevice(e){if(!this.isConnected||!this.room.localParticipant)throw new Error("Cannot change input device: room not connected or no local participant");try{const t=this.room.localParticipant.getTrackPublication(td.Source.Microphone);null!=t&&t.track&&(await t.track.stop(),await this.room.localParticipant.unpublishTrack(t.track));const n={deviceId:{exact:e},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:{ideal:1}},i=await th(n);await this.room.localParticipant.publishTrack(i,{name:"microphone",source:td.Source.Microphone})}catch(t){console.error("Failed to change input device:",t);try{await this.room.localParticipant.setMicrophoneEnabled(!0)}catch(n){console.error("Failed to recover microphone after device switch error:",n)}throw t}}getOutputByteFrequencyData(){return this.outputAnalyser?(null!=this.outputFrequencyData||(this.outputFrequencyData=new Uint8Array(this.outputAnalyser.frequencyBinCount)),this.outputAnalyser.getByteFrequencyData(this.outputFrequencyData),this.outputFrequencyData):null}}async function Wh(e){const t=(n=e).connectionType?n.connectionType:"conversationToken"in n&&n.conversationToken?"webrtc":"websocket";var n;switch(t){case"websocket":return Nh.create(e);case"webrtc":return Vh.create(e);default:throw new Error(`Unknown connection type: ${t}`)}}function Hh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}async function zh(e={default:0,android:3e3}){let t=e.default;var n;if(/android/i.test(navigator.userAgent))t=null!=(n=e.android)?n:t;else if(Hh()){var i;t=null!=(i=e.ios)?i:t}t>0&&await new Promise(e=>setTimeout(e,t))}class Gh extends Ih{static async startSession(e){const t=Ih.getFullOptions(e);t.onStatusChange&&t.onStatusChange({status:"connecting"}),t.onCanSendFeedbackChange&&t.onCanSendFeedbackChange({canSendFeedback:!1}),t.onModeChange&&t.onModeChange({mode:"listening"}),t.onCanSendFeedbackChange&&t.onCanSendFeedbackChange({canSendFeedback:!1});let n=null;try{return await zh(t.connectionDelay),n=await Wh(e),new Gh(t,n)}catch(s){var i;throw t.onStatusChange&&t.onStatusChange({status:"disconnected"}),null==(i=n)||i.close(),s}}}async function Jh(e,t){const n=t||"https://cdn.jsdelivr.net/npm/@alexanderolsen/libsamplerate-js@2.1.2/dist/libsamplerate.worklet.js";await e.audioWorklet.addModule(n)}const Kh={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:{ideal:1}};class $h{static async create({sampleRate:e,format:t,preferHeadphonesForIosDevices:n,inputDeviceId:i,workletPaths:s,libsampleratePath:o,onError:r}){let a=null,c=null;try{const d=Eh({sampleRate:{ideal:e}},Kh);if(Hh()&&n){const e=(await window.navigator.mediaDevices.enumerateDevices()).find(e=>"audioinput"===e.kind&&["airpod","headphone","earphone"].find(t=>e.label.toLowerCase().includes(t)));e&&(d.deviceId={ideal:e.deviceId})}i&&(d.deviceId=$h.getDeviceIdConstraint(i));const l=navigator.mediaDevices.getSupportedConstraints().sampleRate;a=new window.AudioContext(l?{sampleRate:e}:{});const u=a.createAnalyser();l||await Jh(a,o),await qh(a.audioWorklet,null==s?void 0:s.rawAudioProcessor);const h=Eh({voiceIsolation:!0},d);c=await navigator.mediaDevices.getUserMedia({audio:h});const p=a.createMediaStreamSource(c),m=new AudioWorkletNode(a,"rawAudioProcessor");m.port.postMessage({type:"setFormat",format:t,sampleRate:e}),p.connect(u),u.connect(m),await a.resume();const g=await navigator.permissions.query({name:"microphone"});return new $h(a,u,m,c,p,g,r)}catch(u){var d,l;throw null==(d=c)||d.getTracks().forEach(e=>{e.stop()}),null==(l=a)||l.close(),u}}static getDeviceIdConstraint(e){if(e)return Hh()?{ideal:e}:{exact:e}}constructor(e,t,n,i,s,o,r=console.error){this.context=void 0,this.analyser=void 0,this.worklet=void 0,this.inputStream=void 0,this.mediaStreamSource=void 0,this.permissions=void 0,this.onError=void 0,this.settingInput=!1,this.handlePermissionsChange=()=>{if("denied"===this.permissions.state)this.onError("Microphone permission denied");else if(!this.settingInput){var e;const[t]=this.inputStream.getAudioTracks(),{deviceId:n}=null!=(e=null==t?void 0:t.getSettings())?e:{};this.setInputDevice(n).catch(e=>{this.onError("Failed to reset input device after permission change:",e)})}},this.context=e,this.analyser=t,this.worklet=n,this.inputStream=i,this.mediaStreamSource=s,this.permissions=o,this.onError=r,this.permissions.addEventListener("change",this.handlePermissionsChange)}forgetInputStreamAndSource(){for(const e of this.inputStream.getTracks())e.stop();this.mediaStreamSource.disconnect()}async close(){this.forgetInputStreamAndSource(),this.permissions.removeEventListener("change",this.handlePermissionsChange),await this.context.close()}setMuted(e){this.worklet.port.postMessage({type:"setMuted",isMuted:e})}async setInputDevice(e){try{if(this.settingInput)throw new Error("Input device is already being set");this.settingInput=!0;const t=Eh({},Kh);e&&(t.deviceId=$h.getDeviceIdConstraint(e));const n=Eh({voiceIsolation:!0},t),i=await navigator.mediaDevices.getUserMedia({audio:n});this.forgetInputStreamAndSource(),this.inputStream=i,this.mediaStreamSource=this.context.createMediaStreamSource(i),this.mediaStreamSource.connect(this.analyser)}catch(t){throw this.onError("Failed to switch input device:",t),t}finally{this.settingInput=!1}}}const Qh=Bh("audioConcatProcessor",'/*\n * ulaw decoding logic taken from the wavefile library\n * https://github.com/rochars/wavefile/blob/master/lib/codecs/mulaw.js\n * USED BY @elevenlabs/client\n */\n\nconst decodeTable = [0, 132, 396, 924, 1980, 4092, 8316, 16764];\n\nfunction decodeSample(muLawSample) {\n let sign;\n let exponent;\n let mantissa;\n let sample;\n muLawSample = ~muLawSample;\n sign = muLawSample & 0x80;\n exponent = (muLawSample >> 4) & 0x07;\n mantissa = muLawSample & 0x0f;\n sample = decodeTable[exponent] + (mantissa << (exponent + 3));\n if (sign !== 0) sample = -sample;\n\n return sample;\n}\n\nclass AudioConcatProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.buffers = []; // Initialize an empty buffer\n this.cursor = 0;\n this.currentBuffer = null;\n this.wasInterrupted = false;\n this.finished = false;\n\n this.port.onmessage = ({ data }) => {\n switch (data.type) {\n case "setFormat":\n this.format = data.format;\n if (globalThis.LibSampleRate && sampleRate !== data.sampleRate) {\n globalThis.LibSampleRate.create(\n 1,\n data.sampleRate,\n sampleRate\n ).then(resampler => {\n this.resampler = resampler;\n });\n }\n break;\n case "buffer":\n this.wasInterrupted = false;\n this.buffers.push(\n this.format === "ulaw"\n ? new Uint8Array(data.buffer)\n : new Int16Array(data.buffer)\n );\n break;\n case "interrupt":\n this.wasInterrupted = true;\n break;\n case "clearInterrupted":\n if (this.wasInterrupted) {\n this.wasInterrupted = false;\n this.buffers = [];\n this.currentBuffer = null;\n }\n }\n };\n }\n process(_, outputs) {\n let finished = false;\n const output = outputs[0][0];\n for (let i = 0; i < output.length; i++) {\n if (!this.currentBuffer) {\n if (this.buffers.length === 0) {\n finished = true;\n break;\n }\n this.currentBuffer = this.buffers.shift();\n if (this.resampler) {\n this.currentBuffer = this.resampler.full(this.currentBuffer);\n }\n this.cursor = 0;\n }\n\n let value = this.currentBuffer[this.cursor];\n if (this.format === "ulaw") {\n value = decodeSample(value);\n }\n output[i] = value / 32768;\n this.cursor++;\n\n if (this.cursor >= this.currentBuffer.length) {\n this.currentBuffer = null;\n }\n }\n\n if (this.finished !== finished) {\n this.finished = finished;\n this.port.postMessage({ type: "process", finished });\n }\n\n return true; // Continue processing\n }\n}\n\nregisterProcessor("audioConcatProcessor", AudioConcatProcessor);\n');class Yh{static async create({sampleRate:e,format:t,outputDeviceId:n,workletPaths:i,libsampleratePath:s}){let o=null,r=null;try{const a=navigator.mediaDevices.getSupportedConstraints().sampleRate;o=new AudioContext(a?{sampleRate:e}:{});const c=o.createAnalyser(),d=o.createGain();r=new Audio,r.src="",r.load(),r.autoplay=!0,r.style.display="none",document.body.appendChild(r);const l=o.createMediaStreamDestination();r.srcObject=l.stream,d.connect(c),c.connect(l),a&&o.sampleRate===e||(o.sampleRate!==e&&console.warn(`[ConversationalAI] Sample rate ${e} not available, resampling to ${o.sampleRate}`),await Jh(o,s)),await Qh(o.audioWorklet,null==i?void 0:i.audioConcatProcessor);const u=new AudioWorkletNode(o,"audioConcatProcessor");return u.port.postMessage({type:"setFormat",format:t,sampleRate:e}),u.connect(d),await o.resume(),n&&r.setSinkId&&await r.setSinkId(n),new Yh(o,c,d,u,r)}catch(d){var a,c;throw null!=(a=r)&&a.parentNode&&r.parentNode.removeChild(r),null==(c=r)||c.pause(),o&&"closed"!==o.state&&await o.close(),d}}constructor(e,t,n,i,s){this.context=void 0,this.analyser=void 0,this.gain=void 0,this.worklet=void 0,this.audioElement=void 0,this.context=e,this.analyser=t,this.gain=n,this.worklet=i,this.audioElement=s}async setOutputDevice(e){if(!("setSinkId"in HTMLAudioElement.prototype))throw new Error("setSinkId is not supported in this browser");await this.audioElement.setSinkId(e||"")}async close(){this.audioElement.parentNode&&this.audioElement.parentNode.removeChild(this.audioElement),this.audioElement.pause(),await this.context.close()}}class Xh extends Ih{static async requestWakeLock(){if("wakeLock"in navigator)try{return await navigator.wakeLock.request("screen")}catch(ep){}return null}static async startSession(e){var t;const n=Ih.getFullOptions(e);n.onStatusChange&&n.onStatusChange({status:"connecting"}),n.onCanSendFeedbackChange&&n.onCanSendFeedbackChange({canSendFeedback:!1});let i=null,s=null,o=null,r=null,a=null;(null==(t=e.useWakeLock)||t)&&(a=await Xh.requestWakeLock());try{var c;return r=await navigator.mediaDevices.getUserMedia({audio:!0}),await zh(n.connectionDelay),s=await Wh(e),[i,o]=await Promise.all([$h.create(Eh({},s.inputFormat,{preferHeadphonesForIosDevices:e.preferHeadphonesForIosDevices,inputDeviceId:e.inputDeviceId,workletPaths:e.workletPaths,libsampleratePath:e.libsampleratePath})),Yh.create(Eh({},s.outputFormat,{outputDeviceId:e.outputDeviceId,workletPaths:e.workletPaths}))]),null==(c=r)||c.getTracks().forEach(e=>{e.stop()}),r=null,new Xh(n,s,i,o,a)}catch(m){var d,l,u,h;n.onStatusChange&&n.onStatusChange({status:"disconnected"}),null==(d=r)||d.getTracks().forEach(e=>{e.stop()}),null==(l=s)||l.close(),await(null==(u=i)?void 0:u.close()),await(null==(h=o)?void 0:h.close());try{var p;await(null==(p=a)?void 0:p.release()),a=null}catch(g){}throw m}}constructor(e,t,n,i,s){super(e,t),this.input=void 0,this.output=void 0,this.wakeLock=void 0,this.inputFrequencyData=void 0,this.outputFrequencyData=void 0,this.visibilityChangeHandler=null,this.onInputWorkletMessage=e=>{"connected"===this.status&&this.connection.sendMessage({user_audio_chunk:Uh(e.data[0].buffer)})},this.onOutputWorkletMessage=({data:e})=>{"process"===e.type&&this.updateMode(e.finished?"listening":"speaking")},this.addAudioBase64Chunk=e=>{this.output.gain.gain.cancelScheduledValues(this.output.context.currentTime),this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"}),this.output.worklet.port.postMessage({type:"buffer",buffer:Fh(e)})},this.fadeOutAudio=()=>{this.updateMode("listening"),this.output.worklet.port.postMessage({type:"interrupt"}),this.output.gain.gain.exponentialRampToValueAtTime(1e-4,this.output.context.currentTime+2),setTimeout(()=>{this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"})},2e3)},this.calculateVolume=e=>{if(0===e.length)return 0;let t=0;for(let n=0;n<e.length;n++)t+=e[n]/255;return t/=e.length,t<0?0:t>1?1:t},this.setVolume=({volume:e})=>{const t=Number.isFinite(e)?Math.min(1,Math.max(0,e)):1;this.volume=t,this.connection instanceof Vh?this.connection.setAudioVolume(t):this.output.gain.gain.value=t},this.input=n,this.output=i,this.wakeLock=s,this.input.worklet.port.onmessage=this.onInputWorkletMessage,this.output.worklet.port.onmessage=this.onOutputWorkletMessage,s&&(this.visibilityChangeHandler=()=>{var e;"visible"===document.visibilityState&&null!=(e=this.wakeLock)&&e.released&&Xh.requestWakeLock().then(e=>{this.wakeLock=e})},document.addEventListener("visibilitychange",this.visibilityChangeHandler))}async handleEndSession(){await super.handleEndSession(),this.visibilityChangeHandler&&document.removeEventListener("visibilitychange",this.visibilityChangeHandler);try{var e;await(null==(e=this.wakeLock)?void 0:e.release()),this.wakeLock=null}catch(t){}await this.input.close(),await this.output.close()}handleInterruption(e){super.handleInterruption(e),this.fadeOutAudio()}handleAudio(e){var t,n;super.handleAudio(e),e.audio_event.alignment&&this.options.onAudioAlignment&&this.options.onAudioAlignment(e.audio_event.alignment),this.lastInterruptTimestamp<=e.audio_event.event_id&&(e.audio_event.audio_base_64&&(null==(t=(n=this.options).onAudio)||t.call(n,e.audio_event.audio_base_64),this.connection instanceof Vh||this.addAudioBase64Chunk(e.audio_event.audio_base_64)),this.currentEventId=e.audio_event.event_id,this.updateCanSendFeedback(),this.updateMode("speaking"))}setMicMuted(e){this.connection instanceof Vh?this.connection.setMicMuted(e):this.input.setMuted(e)}getInputByteFrequencyData(){return null!=this.inputFrequencyData||(this.inputFrequencyData=new Uint8Array(this.input.analyser.frequencyBinCount)),this.input.analyser.getByteFrequencyData(this.inputFrequencyData),this.inputFrequencyData}getOutputByteFrequencyData(){return this.connection instanceof Vh?this.connection.getOutputByteFrequencyData()||new Uint8Array(1024):(null!=this.outputFrequencyData||(this.outputFrequencyData=new Uint8Array(this.output.analyser.frequencyBinCount)),this.output.analyser.getByteFrequencyData(this.outputFrequencyData),this.outputFrequencyData)}getInputVolume(){return this.calculateVolume(this.getInputByteFrequencyData())}getOutputVolume(){return this.calculateVolume(this.getOutputByteFrequencyData())}async changeInputDevice({sampleRate:e,format:t,preferHeadphonesForIosDevices:n,inputDeviceId:i}){try{if(this.connection instanceof Nh)try{return await this.input.setInputDevice(i),this.input}catch(s){console.warn("Failed to change device on existing input, recreating:",s)}this.connection instanceof Vh&&await this.connection.setAudioInputDevice(i||""),await this.input.close();const o=await $h.create({sampleRate:null!=e?e:this.connection.inputFormat.sampleRate,format:null!=t?t:this.connection.inputFormat.format,preferHeadphonesForIosDevices:n,inputDeviceId:i,workletPaths:this.options.workletPaths,libsampleratePath:this.options.libsampleratePath,onError:this.options.onError});return this.input=o,this.input.worklet.port.onmessage=this.onInputWorkletMessage,this.input}catch(s){throw console.error("Error changing input device",s),s}}async changeOutputDevice({sampleRate:e,format:t,outputDeviceId:n}){try{if(this.connection instanceof Nh)try{return await this.output.setOutputDevice(n),this.output}catch(i){console.warn("Failed to change device on existing output, recreating:",i)}this.connection instanceof Vh&&await this.connection.setAudioOutputDevice(n||""),await this.output.close();const s=await Yh.create({sampleRate:null!=e?e:this.connection.outputFormat.sampleRate,format:null!=t?t:this.connection.outputFormat.format,outputDeviceId:n,workletPaths:this.options.workletPaths});return this.output=s,this.output}catch(i){throw console.error("Error changing output device",i),i}}}var Zh,ep,tp,np;(ep=Zh||(Zh={})).SESSION_STARTED="session_started",ep.PARTIAL_TRANSCRIPT="partial_transcript",ep.COMMITTED_TRANSCRIPT="committed_transcript",ep.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS="committed_transcript_with_timestamps",ep.AUTH_ERROR="auth_error",ep.ERROR="error",ep.OPEN="open",ep.CLOSE="close",ep.QUOTA_EXCEEDED="quota_exceeded",ep.COMMIT_THROTTLED="commit_throttled",ep.TRANSCRIBER_ERROR="transcriber_error",ep.UNACCEPTED_TERMS="unaccepted_terms",ep.RATE_LIMITED="rate_limited",ep.INPUT_ERROR="input_error",ep.QUEUE_OVERFLOW="queue_overflow",ep.RESOURCE_EXHAUSTED="resource_exhausted",ep.SESSION_TIME_LIMIT_EXCEEDED="session_time_limit_exceeded",ep.CHUNK_SIZE_EXCEEDED="chunk_size_exceeded",ep.INSUFFICIENT_AUDIO_ACTIVITY="insufficient_audio_activity",function(e){e.PCM_8000="pcm_8000",e.PCM_16000="pcm_16000",e.PCM_22050="pcm_22050",e.PCM_24000="pcm_24000",e.PCM_44100="pcm_44100",e.PCM_48000="pcm_48000",e.ULAW_8000="ulaw_8000"}(tp||(tp={})),function(e){e.MANUAL="manual",e.VAD="vad"}(np||(np={}));class ip extends Ih{static startSession(e){const t=ip.getFullOptions(e);return t.textOnly?Gh.startSession(t):Xh.startSession(t)}}function sp(){return sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},sp.apply(null,arguments)}const op=["micMuted","volume","serverLocation"];function rp(e={}){const{micMuted:t,volume:n,serverLocation:i}=e,s=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,op),o=be(null),r=be(null),a=be(!1),[c,d]=fe("disconnected"),[l,u]=fe(!1),[h,p]=fe("listening"),m=be(t),g=be(n);return m.current=t,g.current=n,_e(()=>{var e;void 0!==t&&(null==o||null==(e=o.current)||e.setMicMuted(t))},[t]),_e(()=>{var e;void 0!==n&&(null==o||null==(e=o.current)||e.setVolume({volume:n}))},[n]),_e(()=>()=>{var e;a.current=!0,r.current?r.current.then(e=>e.endSession()):null==(e=o.current)||e.endSession()},[]),{startSession:async e=>{var t;if(null!=(t=o.current)&&t.isOpen())return o.current.getId();if(r.current)return(await r.current).getId();a.current=!1;try{var n,c,l,h,v,f,_,b,y,k;const t=function(e="us"){switch(e){case"eu-residency":case"in-residency":case"us":case"global":return e;default:return console.warn(`[ConversationalAI] Invalid server-location: ${e}. Defaulting to "us"`),"us"}}((null==e?void 0:e.serverLocation)||i),C=function(e){return{us:"wss://api.elevenlabs.io","eu-residency":"wss://api.eu.residency.elevenlabs.io","in-residency":"wss://api.in.residency.elevenlabs.io",global:"wss://api.elevenlabs.io"}[e]}(t),w=function(e){return{us:"wss://livekit.rtc.elevenlabs.io","eu-residency":"wss://livekit.rtc.eu.residency.elevenlabs.io","in-residency":"wss://livekit.rtc.in.residency.elevenlabs.io",global:"wss://livekit.rtc.elevenlabs.io"}[e]}(t);if(r.current=ip.startSession(sp({},null!=s?s:{},null!=e?e:{},{origin:C,livekitUrl:(null==e?void 0:e.livekitUrl)||(null==s?void 0:s.livekitUrl)||w,overrides:sp({},null!=(n=null==s?void 0:s.overrides)?n:{},null!=(c=null==e?void 0:e.overrides)?c:{},{client:sp({},null!=(l=null==s||null==(h=s.overrides)?void 0:h.client)?l:{},null!=(v=null==e||null==(f=e.overrides)?void 0:f.client)?v:{},{source:(null==e||null==(_=e.overrides)||null==(_=_.client)?void 0:_.source)||(null==s||null==(b=s.overrides)||null==(b=b.client)?void 0:b.source)||"react_sdk",version:(null==e||null==(y=e.overrides)||null==(y=y.client)?void 0:y.version)||(null==s||null==(k=s.overrides)||null==(k=k.client)?void 0:k.version)||"0.14.2"})}),onConnect:(null==e?void 0:e.onConnect)||(null==s?void 0:s.onConnect),onDisconnect:(null==e?void 0:e.onDisconnect)||(null==s?void 0:s.onDisconnect),onError:(null==e?void 0:e.onError)||(null==s?void 0:s.onError),onMessage:(null==e?void 0:e.onMessage)||(null==s?void 0:s.onMessage),onAudio:(null==e?void 0:e.onAudio)||(null==s?void 0:s.onAudio),onDebug:(null==e?void 0:e.onDebug)||(null==s?void 0:s.onDebug),onUnhandledClientToolCall:(null==e?void 0:e.onUnhandledClientToolCall)||(null==s?void 0:s.onUnhandledClientToolCall),onVadScore:(null==e?void 0:e.onVadScore)||(null==s?void 0:s.onVadScore),onInterruption:(null==e?void 0:e.onInterruption)||(null==s?void 0:s.onInterruption),onAgentToolRequest:(null==e?void 0:e.onAgentToolRequest)||(null==s?void 0:s.onAgentToolRequest),onAgentToolResponse:(null==e?void 0:e.onAgentToolResponse)||(null==s?void 0:s.onAgentToolResponse),onConversationMetadata:(null==e?void 0:e.onConversationMetadata)||(null==s?void 0:s.onConversationMetadata),onMCPToolCall:(null==e?void 0:e.onMCPToolCall)||(null==s?void 0:s.onMCPToolCall),onMCPConnectionStatus:(null==e?void 0:e.onMCPConnectionStatus)||(null==s?void 0:s.onMCPConnectionStatus),onAsrInitiationMetadata:(null==e?void 0:e.onAsrInitiationMetadata)||(null==s?void 0:s.onAsrInitiationMetadata),onAgentChatResponsePart:(null==e?void 0:e.onAgentChatResponsePart)||(null==s?void 0:s.onAgentChatResponsePart),onAudioAlignment:(null==e?void 0:e.onAudioAlignment)||(null==s?void 0:s.onAudioAlignment),onModeChange:({mode:t})=>{var n;p(t),null==(n=(null==e?void 0:e.onModeChange)||(null==s?void 0:s.onModeChange))||n({mode:t})},onStatusChange:({status:t})=>{var n;d(t),null==(n=(null==e?void 0:e.onStatusChange)||(null==s?void 0:s.onStatusChange))||n({status:t})},onCanSendFeedbackChange:({canSendFeedback:t})=>{var n;u(t),null==(n=(null==e?void 0:e.onCanSendFeedbackChange)||(null==s?void 0:s.onCanSendFeedbackChange))||n({canSendFeedback:t})}})),o.current=await r.current,a.current)throw await o.current.endSession(),o.current=null,r.current=null,new Error("Session cancelled during connection");return void 0!==m.current&&o.current.setMicMuted(m.current),void 0!==g.current&&o.current.setVolume({volume:g.current}),o.current.getId()}finally{r.current=null}},endSession:async()=>{a.current=!0;const e=r.current,t=o.current;if(o.current=null,e){const t=await e;await t.endSession()}else await(null==t?void 0:t.endSession())},setVolume:({volume:e})=>{var t;null==(t=o.current)||t.setVolume({volume:e})},getInputByteFrequencyData:()=>{var e;return null==(e=o.current)?void 0:e.getInputByteFrequencyData()},getOutputByteFrequencyData:()=>{var e;return null==(e=o.current)?void 0:e.getOutputByteFrequencyData()},getInputVolume:()=>{var e,t;return null!=(e=null==(t=o.current)?void 0:t.getInputVolume())?e:0},getOutputVolume:()=>{var e,t;return null!=(e=null==(t=o.current)?void 0:t.getOutputVolume())?e:0},sendFeedback:e=>{var t;null==(t=o.current)||t.sendFeedback(e)},getId:()=>{var e;return null==(e=o.current)?void 0:e.getId()},sendContextualUpdate:e=>{var t;null==(t=o.current)||t.sendContextualUpdate(e)},sendUserMessage:e=>{var t;null==(t=o.current)||t.sendUserMessage(e)},sendUserActivity:()=>{var e;null==(e=o.current)||e.sendUserActivity()},sendMCPToolApprovalResult:(e,t)=>{var n;null==(n=o.current)||n.sendMCPToolApprovalResult(e,t)},changeInputDevice:async e=>{if(o.current&&"changeInputDevice"in o.current)return await o.current.changeInputDevice(e);throw new Error("Device switching is only available for voice conversations")},changeOutputDevice:async e=>{if(o.current&&"changeOutputDevice"in o.current)return await o.current.changeOutputDevice(e);throw new Error("Device switching is only available for voice conversations")},status:c,canSendFeedback:l,micMuted:t,isSpeaking:"speaking"===h}}function ap(){const[e,t]=fe(!1),[n,i]=fe(null),[s,o]=fe(null),[r,a]=fe(!1),[c,d]=fe(null),l=rp({onConnect:()=>console.log("ElevenLabs Connected"),onDisconnect:()=>{console.log("ElevenLabs Disconnected"),i(null)},onError:e=>o(e.message||"Conversation error")}),u=l.isSpeaking,h="connected"===l.status,p="connecting"===l.status,m=be(null),g=be(!1);return{start:Ce(async(e,n)=>{if(g.current||h||p)return;g.current=!0;const s=n.reduce((e,t,n)=>({...e,[`avatar_${n+1}`]:t.name}),{});try{if(!(await(async()=>{if(m.current)return!0;try{return m.current=await navigator.mediaDevices.getUserMedia({audio:!0}),!0}catch{return o("Microphone permission denied"),!1}})()))return;t(!1),await l.startSession({agentId:e,connectionType:"webrtc",dynamicVariables:s,clientTools:(r={setActiveAvatar:i,setDataCollectionOpen:a,setUserData:d},{glowAvatar:async({name:e})=>(r.setActiveAvatar(e),`Switched active avatar to ${e}`),navigateToSection:async({id:e})=>{console.log(`Navigating to: ${e}`);const t=document.getElementById(e);return t?t.scrollIntoView({behavior:"smooth"}):"home"===e.toLowerCase()&&window.scrollTo({top:0,behavior:"smooth"}),`Mapsd to ${e}`},openValidationPopup:async e=>(r.setUserData({name:e.name??"",email:e.email??"",phone:e.phone??"",description:e.description??""}),r.setDataCollectionOpen(!0),"Data collection modal opened for the user.")})})}catch(c){console.error(c),o("Failed to start session")}finally{g.current=!1}var r},[l,h,p]),stop:async()=>{m.current?.getTracks().forEach(e=>e.stop()),m.current=null,i(null),await l.endSession()},isConnected:h,isConnecting:p,isSpeaking:u,activeAvatar:n,setActiveAvatar:i,toggleMic:()=>t(e=>!e),micMuted:e,error:s,setError:o,dataCollectionOpen:r,setDataCollectionOpen:a,handleUserDataCollected:async e=>{d(e),a(!1),await l.sendUserMessage(`The user has provided their info: ${JSON.stringify(e)}`)},userData:c,setUserData:d}}const cp=function(e){function t(e){var n,i;return this.getChildContext||(n=/* @__PURE__ */new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,S(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+u++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}(null),dp=()=>{return e=cp,t=se.context[e.__c],(n=ve(ie++,9)).c=e,t?(null==n.__&&(n.__=!0,t.sub(se)),t.props.value):e.__;var e,t,n},lp=({children:e})=>{const t=dp();return t?function(e,t){var n=_(rt,{__v:e,h:t});return n.containerInfo=t,n}(e,t):null};function up({data:e,isOpen:t,isLoading:n=!1,onClose:i,title:s="Update Information",onSubmit:o}){const[r,a]=fe({});if(_e(()=>{if(t){const t={};Object.entries(e||{}).forEach(([e,n])=>{t[e]=n?.toString()??""}),a(t)}},[e,t]),!t)return null;/* @__PURE__ */
3
+ return ne(lp,{children:/* @__PURE__ */ne("div",{className:"vd-modal-overlay",children:[
4
+ /* @__PURE__ */ne("div",{className:"vd-modal-backdrop",onClick:i}),
5
+ /* @__PURE__ */ne("div",{className:"vd-modal-container animate-zoom-in",children:[
6
+ /* @__PURE__ */ne("div",{className:"vd-modal-glow"}),
7
+ /* @__PURE__ */ne("div",{className:"vd-modal-header",children:[
8
+ /* @__PURE__ */ne("div",{className:"vd-modal-title-box",children:[
9
+ /* @__PURE__ */ne("div",{className:"vd-modal-icon-wrapper",children:/* @__PURE__ */ne(Ve,{size:20})}),
10
+ /* @__PURE__ */ne("h3",{children:s})]}),
11
+ /* @__PURE__ */ne("button",{onClick:i,className:"vd-modal-close",children:/* @__PURE__ */ne(ze,{size:20})})]}),
12
+ /* @__PURE__ */ne("div",{className:"vd-modal-body custom-scrollbar",children:n?/* @__PURE__ */ne("div",{className:"vd-modal-loader",children:[
13
+ /* @__PURE__ */ne(Fe,{className:"vd-spin",size:32}),
14
+ /* @__PURE__ */ne("p",{children:"Preparing fields..."})]}):/* @__PURE__ */ne("form",{onSubmit:e=>{e.preventDefault(),o(r),i()},className:"vd-modal-form",children:[
15
+ /* @__PURE__ */ne("div",{className:"vd-form-grid",children:Object.entries(r).map(([e,t])=>/* @__PURE__ */ne("div",{className:"vd-input-group",children:[
16
+ /* @__PURE__ */ne("label",{children:e.replace(/_/g," ")}),
17
+ /* @__PURE__ */ne("input",{type:"text",value:t,onChange:t=>((e,t)=>{a(n=>({...n,[e]:t}))})(e,t.target.value),className:"vd-input-field"})]},e))}),
18
+ /* @__PURE__ */ne("div",{className:"vd-modal-footer",children:[
19
+ /* @__PURE__ */ne("div",{className:"vd-verify-badge",children:[
20
+ /* @__PURE__ */ne(Ue,{size:12}),
21
+ /* @__PURE__ */ne("span",{children:"Verify before submission"})]}),
22
+ /* @__PURE__ */ne("div",{className:"vd-footer-btns",children:[
23
+ /* @__PURE__ */ne("button",{type:"button",onClick:i,className:"vd-btn-ghost",children:"Cancel"}),
24
+ /* @__PURE__ */ne("button",{type:"submit",className:"vd-btn-save",children:[
25
+ /* @__PURE__ */ne(We,{size:14}),"Save Changes"]})]})]})]})})]})]})})}function hp({title:e,agentId:t,avatars:n}){const[i,s]=fe(!1),o=ap(),r=be({}),[a,c]=fe(360);return _e(()=>{const e=o.activeAvatar;e&&(o.isSpeaking?r.current[e]?.startTalking():r.current[e]?.stopTalking())},[o.isSpeaking,o.activeAvatar]),_e(()=>{let e;return o.isConnected&&(c(360),e=setInterval(()=>{c(e=>e>0?e-1:0)},1e3)),()=>clearInterval(e)},[o.isConnected]),/* @__PURE__ */ne("div",{className:"vd-widget-container",children:[
26
+ /* @__PURE__ */ne(up,{isOpen:o.dataCollectionOpen,title:"Verify Information",onClose:()=>o.setDataCollectionOpen(!1),data:o.userData,onSubmit:o.handleUserDataCollected}),!i&&/* @__PURE__ */ne("div",{className:"vd-main-card",children:[
27
+ /* @__PURE__ */ne("div",{className:"vd-header",children:[
28
+ /* @__PURE__ */ne("div",{className:"vd-title-group",children:[
29
+ /* @__PURE__ */ne("h3",{children:e}),o.isConnected&&/* @__PURE__ */ne("span",{className:"vd-timer",children:[Math.floor(a/60),":",(a%60).toString().padStart(2,"0")]})]}),
30
+ /* @__PURE__ */ne("button",{onClick:()=>s(!0),className:"vd-icon-btn",children:/* @__PURE__ */ne(je,{size:18})})]}),
31
+ /* @__PURE__ */ne("div",{className:"vd-body",children:[
32
+ /* @__PURE__ */ne("div",{className:`vd-avatar-grid count-${n.length}`,children:n.map(e=>/* @__PURE__ */ne("div",{className:"vd-avatar-item "+(o.activeAvatar===e.name?"active":""),onMouseEnter:()=>{o.isSpeaking&&o.activeAvatar===e.name||r.current[e.name]?.triggerHover()},onMouseLeave:()=>{o.isSpeaking&&o.activeAvatar===e.name||r.current[e.name]?.stopHover()},children:[
33
+ /* @__PURE__ */ne(_n,{lottieSrc:e.avatar,ref:t=>{r.current[e.name]=t}}),
34
+ /* @__PURE__ */ne("p",{children:e.role})]},e.name))}),
35
+ /* @__PURE__ */ne("div",{className:"vd-controls",children:o.isConnected?/* @__PURE__ */ne(y,{children:[
36
+ /* @__PURE__ */ne("div",{className:"vd-active-controls",children:[
37
+ /* @__PURE__ */ne("button",{onClick:o.toggleMic,className:"vd-mic-btn",children:o.micMuted?/* @__PURE__ */ne(Be,{color:"red"}):/* @__PURE__ */ne(qe,{})}),
38
+ /* @__PURE__ */ne("button",{onClick:o.stop,className:"vd-end-btn",children:[
39
+ /* @__PURE__ */ne(He,{size:16,fill:"currentColor"})," End Call"]})]}),
40
+ /* @__PURE__ */ne("a",{href:"https://voicedots.io/",target:"_blank",rel:"noopener noreferrer",className:"vd-watermark",children:"Powered by VoiceDots"})]}):/* @__PURE__ */ne(y,{children:[
41
+ /* @__PURE__ */ne("button",{className:"vd-btn-primary",onClick:()=>{if(n.length>0){const e=n[0];o.setActiveAvatar(e.name),o.start(t,n)}},disabled:o.isConnecting,children:o.isConnecting?/* @__PURE__ */ne(y,{children:[
42
+ /* @__PURE__ */ne("div",{className:"vd-btn-icon-wrapper vd-sliding",children:/* @__PURE__ */ne("img",{src:"/voicedotslogo.svg",alt:"VoiceDots Logo"})}),"Connecting..."]}):/* @__PURE__ */ne(y,{children:[
43
+ /* @__PURE__ */ne("div",{className:"vd-btn-icon-wrapper",children:/* @__PURE__ */ne("img",{src:"/voicedotslogo.svg",alt:"VoiceDots Logo"})}),"Let's Talk"]})}),
44
+ /* @__PURE__ */ne("a",{href:"https://voicedots.io/",target:"_blank",rel:"noopener noreferrer",className:"vd-watermark",children:"Powered by VoiceDots"})]})})]})]}),i&&/* @__PURE__ */ne("button",{className:"vd-pill",onClick:()=>s(!1),children:[
45
+ /* @__PURE__ */ne("div",{className:"vd-pill-icon-container",children:/* @__PURE__ */ne("div",{className:"vd-pill-icon "+(o.isSpeaking?"pulse":""),children:/* @__PURE__ */ne("div",{className:"vd-pill-icon-inner"})})}),
46
+ /* @__PURE__ */ne("span",{className:"vd-pill-text",children:"VoiceDots"})]})]})}!function(e,t,n,i){function s(){var t=Reflect.construct(HTMLElement,[],s);return t._vdomComponent=e,t._root=t,t}(s.prototype=Object.create(HTMLElement.prototype)).constructor=s,s.prototype.connectedCallback=function(){$.call(this,i)},s.prototype.attributeChangedCallback=Y,s.prototype.disconnectedCallback=X,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),s.observedAttributes=n,e.formAssociated&&(s.formAssociated=!0),n.forEach(function(e){Object.defineProperty(s.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t);var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})}),customElements.define(t,s)}(function({config:e}){const t=be(null),[n,i]=fe(null);_e(()=>{t.current&&i(t.current)},[]);const s=ke(()=>{try{return JSON.parse(e)}catch(ep){return console.error("VoiceDots: JSON Parse Error",ep),{avatars:[]}}},[e]),o=s.themeColor||"#8B5CF6";/* @__PURE__ */
47
+ return ne(cp.Provider,{value:n,children:/* @__PURE__ */ne("div",{className:"vd-widget-host",style:{"--theme-color":o},children:[
48
+ /* @__PURE__ */ne(hp,{title:s.title,agentId:s.agentId,avatars:s.avatars}),
49
+ /* @__PURE__ */ne("div",{className:"vd-portal-host",ref:t})]})})},"voicedots-ai",["config"]);