@ai-matrx/coding-sessions 0.1.92 → 0.1.94
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.
|
@@ -9,11 +9,11 @@ Error generating stack: `+e.message+`
|
|
|
9
9
|
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=hn.get(n)||n,qt(e,n,r);else return}Gt=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:pn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Rt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[St]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Gt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}Gt=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}ln(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Gt=!0),o=m;break;case`name`:m!==f&&(Gt=!0),a=m;break;case`checked`:m!==f&&(Gt=!0),u=m;break;case`defaultChecked`:m!==f&&(Gt=!0),d=m;break;case`value`:m!==f&&(Gt=!0),s=m;break;case`defaultValue`:m!==f&&(Gt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}rn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Gt=!0),p=o;break;case`defaultValue`:o!==l&&(Gt=!0),c=o;break;case`multiple`:o!==l&&(Gt=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Gt=!0),p=a;break;case`defaultValue`:a!==o&&(Gt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}cn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Gt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[xt]=r,n[St]=t,np(n,e,t),Ft(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=jt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),At(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),At(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);At(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=fe.d;fe.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=Mt(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ft(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[kt]=!0,o.onload=o.onerror=function(){It(o)}),Ft(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ft(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Pt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ft(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Pt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ft(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Pt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ft(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=xe.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Pt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Pt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+nn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[kt]){r.loading=1;return}}else t=e.createElement(`link`),t[kt]=!0,t.onload=t.onerror=It.bind(null,t),np(t,`link`,n),Ft(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+nn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,Ft(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ft(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Ft(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Ft(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ft(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ot]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ft(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function uh(e){return e?(e=Oi,e):Oi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Md(n,e,t),ho(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=gt(t);var n=Ti(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=2,yh(e,t,n,r)}finally{fe.p=a,z.T=i}}function vh(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=8,yh(e,t,n,r)}finally{fe.p=a,z.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Xu&6)&&(md=ze()+500,Ef(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=bn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=jt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=jt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Mt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Mt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[St]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[St]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[Ct]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:z,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Je=Jh.inject(qh),Ye=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Ct]=t.current,Uf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g();function y(e){let t=`${e.url??(typeof location<`u`?`ws://${location.host}/ws`:`ws://127.0.0.1:4789/ws`)}?token=${encodeURIComponent(e.token)}`,n=new Set,r=new Set,i=new Map,a=[],o=null,s={state:`connecting`},c=1,l=500,u=!1;function d(e){s=e;for(let t of r)t(e)}function f(){d({state:`connecting`});let r=new WebSocket(t);o=r,r.onopen=()=>{for(u=!0,l=500,d({state:`open`});a.length>0;)r.send(a.shift())},r.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}if(t.event){for(let e of n)e(t.event);return}if(typeof t.id==`number`){let e=i.get(t.id);if(!e)return;i.delete(t.id),t.ok?e.resolve(t.result):e.reject(Error(t.error??`The request failed.`))}},r.onclose=()=>{o=null;for(let[,e]of i)e.reject(Error(`Lost the connection to the coding sessions host.`));i.clear(),d({state:`closed`,reason:u?`Lost the connection to the coding sessions host. Reconnecting…`:`Can't reach the coding sessions host. It may have stopped, or this link's access token is out of date.`});let t=e.maxBackoffMs??8e3;setTimeout(f,l),l=Math.min(t,l*2)}}return f(),{call(e,...t){let n=c++,r=JSON.stringify({id:n,method:e,args:t}),s=new Promise((e,t)=>{i.set(n,{resolve:e,reject:t})});return o&&o.readyState===WebSocket.OPEN?o.send(r):a.push(r),s},subscribe(e){return n.add(e),()=>{n.delete(e)}},status(){return s},onStatus(e){return r.add(e),()=>{r.delete(e)}}}}var b=0;function x(e){let t=globalThis.crypto;return typeof t?.randomUUID==`function`?`${e}_${t.randomUUID()}`:(b+=1,`${e}_${Date.now().toString(36)}_${b.toString(36)}_${Math.random().toString(36).slice(2,10)}`)}function S(e){return{id:e.id??x(`msg`),role:e.role,parts:e.parts??[],status:e.status??`complete`,metadata:{requestId:e.metadata?.requestId??null,serverMessageId:e.metadata?.serverMessageId??null,modelRef:e.metadata?.modelRef??null,createdAt:e.metadata?.createdAt??new Date().toISOString(),raw:e.metadata?.raw??null}}}function C(e){let t=``;for(let n of e.parts)n.type===`text`&&(t+=n.text);return t}var w=Object.freeze({sendKey:`enter`,density:`comfortable`,showReasoningByDefault:!1,expandToolCardsByDefault:!1,autoScroll:!0,readAloudAutoPlay:!1,retainDrafts:!0,sendWhileBusy:!1,hideArchivedConversations:!0,messageActions:!0,attachmentMaxBytes:26214400,reasoningSentinel:`split`,routing:`any`});function T(e={}){return{...w,...E(e.organization),...E(e.surface),...E(e.user)}}function E(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function D(){return{notify(e){let t=e.remedy?`[ai-matrx/chat] ${e.message} — ${e.remedy}`:`[ai-matrx/chat] ${e.message}`;e.level===`error`?console.error(t):e.level===`warning`?console.warn(t):console.info(t)}}}function O(e=D()){let t=new Map,n=!1,r=()=>{n||(n=!0,e.notify({level:`warning`,message:`Chat preferences and drafts are being kept in memory only, so they will be lost when this page reloads.`,remedy:"Give the chat a `prefs` port backed by localStorage (or your own store) to keep drafts across reloads."}))};return{get:e=>t.get(e)??null,set:(e,n)=>{r(),t.set(e,n)},remove:e=>{t.delete(e)}}}function k(e=D()){let t=O(e),n=null;try{if(n=globalThis.localStorage??null,n){let e=`__ai_matrx_chat_probe__`;n.setItem(e,`1`),n.removeItem(e)}}catch{n=null}if(!n)return t;let r=n;return{get:e=>{try{let t=r.getItem(e);if(t!==null)return t}catch{}return t.get(e)},set:(e,n)=>{try{r.setItem(e,n)}catch{t.set(e,n)}},remove:e=>{try{r.removeItem(e)}catch{}t.remove(e)}}}var A=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),j=o(((e,t)=>{t.exports=A()}))(),M=(0,_.createContext)(null),N=(0,_.createContext)({});function P({conversationId:e,children:t}){return(0,j.jsx)(N.Provider,{value:{conversationId:e??null},children:t})}function F(){return(0,_.useContext)(N)}var I={};function L(){return(0,_.useContext)(M)??I}var ee=(0,_.createContext)(null);function te(){return(0,_.useContext)(ee)}function ne(){let e=te();if(!e)throw Error(`[content-ir-react] No ContentIrRenderProvider above this component. Mount one at the app root with your host adapter (kind definitions, component resolver, renderBlock, renderValue, reportError).`);return e}var re=`__ir`,ie=`__kind`,ae=2166136261,oe=16777619;function se(e,t){let n=e>>>0;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=n+((n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24))>>>0;return n>>>0}function ce(){let e=ae,t=oe,n=0;return{push(r){e=se(e,r),t=se(t,r),n+=r.length},current(){return`${n.toString(36)}-${e.toString(36)}${t.toString(36)}`}}}function le(e){let t=ce();return t.push(e),t.current()}function ue(e,t,n){return{v:1,engine:`fe-kind-parser`,fingerprint:le(JSON.stringify(e)),root:{role:`structured`,kind:t,kindState:`resolved`,discriminator:n?.discriminator??{format:`json`,key:`__kind`},path:[],status:`complete`,value:e,residue:null}}}var R=`directive_v`;`${R}`;var de=[`reference`,`view`,`create`,`update`,`delete`,`action`,`validation`,`secret`],z={reference:`pure`,view:`pure`,validation:`pure`,secret:`sensitive`,create:`side_effect`,update:`side_effect`,delete:`side_effect`,action:`side_effect`},fe=new Set(de.filter(e=>z[e]===`side_effect`)),pe=new Set([`reference`,`secret`]);function me(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(z,e)}function he(e){return typeof e==`string`&&e.startsWith(`directive_v`)}function ge(e){return/^[a-z][a-z0-9_]*$/.test(e)}function _e(e,t,n=1){if(!me(e))throw Error(`unknown directive class ${JSON.stringify(e)}; the vocabulary is CLOSED: ${de.join(`, `)}.`);if(typeof t!=`string`||!ge(t))throw Error(`invalid directive noun ${JSON.stringify(t)} for class ${JSON.stringify(e)}: a noun is lowercase [a-z0-9_], starts with a letter, and is non-empty.`);return`${R}${n}_${e}_${t}`}function ve(e){if(!he(e))return null;let t=e.slice(11),n=t.indexOf(`_`);if(n<=0)return null;let r=t.slice(0,n);if(!/^[0-9]+$/.test(r))return null;let i=t.slice(n+1),a=i.indexOf(`_`);if(a<=0)return null;let o=i.slice(0,a),s=i.slice(a+1);return!me(o)||!ge(s)?null:{slug:e,version:Number.parseInt(r,10),directiveClass:o,noun:s,capability:z[o],executes:ye(o),inContent:be(o)}}function ye(e){return me(e)&&fe.has(e)}function be(e){return me(e)&&pe.has(e)}function xe(e){let t=e.trimStart().match(/^\{\s*"__kind"\s*:\s*"([^"]*)/);return!!t&&he(t[1])}var Se=`matrx_version`,Ce={reference:`reference`,secret:`secret`,validation:`validation`},we=new Set([`output_directive`,`function`]),Te=/^(create|update|delete):([a-z][a-z0-9_]*)$/,Ee=Symbol.for(`ai-matrx.content-ir.legacy-shell-uses`),De=globalThis[Ee]??={count:0};function Oe(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;if(!(Se in t))return!1;let n=t.kind;return typeof n==`string`&&(n in Ce||we.has(n))}function ke(e,t){let n,r;if(we.has(e)){let e=Te.exec(t);e?(n=e[1],r=e[2]):(n=`action`,r=t)}else{let i=Ce[e];if(!i)return null;n=i,r=t}try{return _e(n,r)}catch{return null}}function Ae(e){let t=e.kind,n=e.type;if(typeof t!=`string`||typeof n!=`string`)return null;let r=ke(t,n);if(r===null)return null;let i=e.items;return De.count+=1,{[ie]:r,items:Array.isArray(i)?[...i]:[]}}var je=class extends Error{constructor(e){super(e),this.name=`DirectiveDecodeError`}};function Me(e){return typeof e!=`object`||!e||Array.isArray(e)?null:e}function Ne(e){let t=Me(e);if(t===null)return null;let n=!1;if(Oe(t)){let e=Ae(t);if(e===null)throw new je(`a retired 4-key shell with kind=${JSON.stringify(t.kind)} type=${JSON.stringify(t.type)} does not map onto the Kind Directives grammar. Emit the current shell: {"${ie}": "directive_v1_<class>_<noun>", "items": [...]}.`);t=e,n=!0}let r=t[ie];if(!he(r))return null;let i=ve(r);if(i===null)throw new je(`malformed directive slug ${JSON.stringify(r)} — it claims the reserved "directive_v" namespace but does not parse as directive_v<version>_<class>_<noun>.`);let a=t.items,o=Array.isArray(a)?a.filter(e=>Me(e)!==null):[];return{parsed:i,slug:i.slug,directiveClass:i.directiveClass,noun:i.noun,items:o,shell:{[ie]:i.slug,items:o},legacyShell:n}}function Pe(e,t){try{return Ne(e)}catch(e){return t?.(e instanceof Error?e.message:`directive decode failed`),null}}function Fe(e,t){if(typeof e!=`string`)return Pe(e,t);let n;try{n=JSON.parse(e)}catch{return null}return Pe(n,t)}function Ie(e){let t=e.replace(/_/g,` `).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e}var Le={reference:`Reference`,view:`View`,create:`Create`,update:`Update`,delete:`Delete`,action:`Run`,validation:`Validate`,secret:`Secret`};function Re(e,t){let n=t?.(e)?.label;return n&&n.length>0?n:Ie(e)}function ze(e,t){return t?.(e)?.family??``}function Be(e,t){return t?.(e)?.titleColumn??null}function Ve(e,t,n){let r=Re(t,n),i=Le[e];return{noun:r,family:ze(t,n),action:i,title:`${i} ${r}`}}var He=[`name`,`title`,`label`,`heading`,`slug`,`key`,`question`,`summary`],Ue=new Set([`__kind`,...He,`id`,`description`,`about`,`notes`,`content`,`text`,`body`,`organization_id`,`user_id`,`created_by`,`resource_type`]);function We(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim())return t.trim()}return null}function Ge(e,t,n,r){return((t?We(e,[t]):null)??We(e,He))||(r>1?`Item ${n+1} of ${r}`:`Item`)}function Ke(e){return We(e,[`description`,`about`,`summary`,`doc`])}var qe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Je={variable_definitions:`variables`,context_policies:`context`,custom_tools:`custom tools`};function Ye(e){return Je[e]??e.replace(/_/g,` `)}function Xe(e,t=4){let n=[];for(let[r,i]of Object.entries(e)){if(n.length>=t)break;if(!Ue.has(r)){if(Array.isArray(i)){if(i.length===0)continue;n.push({key:r,label:Ye(r),value:String(i.length)});continue}if(typeof i==`string`){let e=i.trim();if(!e||e.length>40||qe.test(e))continue;n.push({key:r,label:Ye(r),value:e});continue}(typeof i==`number`||typeof i==`boolean`)&&n.push({key:r,label:Ye(r),value:String(i)})}}return n}function Ze(e,t){let n=e[ie],r=typeof n==`string`&&n?n:t;return r?{[ie]:r,...e}:null}var Qe=new Set([`markdown`,`md`,`mdx`]);function $e(e){return!!e&&Qe.has(e.toLowerCase())}function et(e){return e!==void 0&&e!==``&&`
|
|
10
10
|
\r\f\v`.includes(e)}function tt(e){let t=0,n=e.length;for(;t<n&&et(e[t]);)t++;for(;n>t&&et(e[n-1]);)n--;return t===0&&n===e.length?e:e.slice(t,n)}function nt(e){return e!==void 0&&e!==``&&`
|
|
11
11
|
\v\f\r \xA0 \u2028\u2029 `.includes(e)}function rt(e){let t=0,n=e.length;for(;t<n&&nt(e[t]);)t++;for(;n>t&&nt(e[n-1]);)n--;let r=0;for(;t+r<n&&e[t+r]==="`";)r++;if(r<3||e.slice(t+r,n).includes("`"))return null;let i=t+r;for(;i<n&&nt(e[i]);)i++;let a=i;for(;a<n&&!nt(e[a]);)a++;return{ticks:r,lang:e.slice(i,a)}}function it(e,t,n,r){let i=0;for(;i<e.length&&e[i]==="`";)i++;if(i<3)return`content`;let a=tt(e.slice(i));return a===``?i<t?`content`:n&&r>0?`close-nested`:`close-outer`:n&&i>=t&&!a.includes("`")?`open-nested`:`content`}function at(e){let t=e.trimStart();if(t.startsWith("```")){let e=rt(t);return e?{char:"`",ticks:e.ticks,lang:e.lang}:null}if(e.length-t.length<=3&&t.startsWith(`~~~`)){let e=/^(~{3,})(.*)$/.exec(t);return e?{char:`~`,ticks:e[1].length,lang:e[2].trim().split(/\s/)[0]??``}:null}return null}function ot(e){return at(e)!==null}var st=class{opener;state={inString:!1,escaped:!1};depth=0;sawNested=!1;isJson;nesting;tildeCloser;constructor(e,t={}){this.opener=e,this.isJson=e.char==="`"&&e.lang===`json`,this.nesting=e.char==="`"&&(t.nesting??$e(e.lang)),this.tildeCloser=e.char===`~`?RegExp(`^ {0,3}~{${e.ticks},}[ \\t]*$`):null}get nestedDepth(){return this.depth}feed(e){if(this.tildeCloser)return this.tildeCloser.test(e);let t=tt(e),n=e.indexOf("```");if(n===-1)return this.isJson&&(this.state=ut(e,0,e.length,this.state)),!1;if(this.isJson){let t=ut(e,0,n,this.state);if(t.inString)return this.state=ut(e,n,e.length,t),!1}if(t.startsWith("```")){let e=it(t,this.opener.ticks,this.nesting,this.depth);if(e===`close-outer`)return!0;e===`open-nested`&&(this.depth++,this.sawNested=!0),e===`close-nested`&&this.depth--}else{let t=dt(e,n),r=tt(e.slice(n+t));if(t>=this.opener.ticks&&r===``&&this.depth===0)return!0}return this.isJson&&(this.state=ut(e,0,e.length,this.state)),!1}};function ct(e,t,n){let r=lt(e,t,new st(n));if(r.closed||!r.reader.sawNested||r.reader.nestedDepth<=0)return{line:r.line,closed:r.closed};if(e.streaming)return{line:r.line,closed:!1};let i=lt(e,t,new st(n,{nesting:!1}));return{line:i.line,closed:i.closed}}function lt(e,t,n){for(let r=t+1;r<e.count;r++){if(e.openTail?.(r))continue;let t=e.line(r);if(t===null)return{line:r-1,closed:!1,reader:n};if(n.feed(t))return{line:r,closed:!0,reader:n}}return{line:e.count-1,closed:!1,reader:n}}function ut(e,t,n,r){let{inString:i,escaped:a}=r;for(let r=t;r<n;r++){let t=e[r];if(a){a=!1;continue}if(t===`\\`&&i){a=!0;continue}t===`"`&&(i=!i)}return{inString:i,escaped:a}}function dt(e,t){let n=0;for(;t+n<e.length&&e[t+n]==="`";)n++;return n}function ft(e){let t=0,n=0;for(;;){let r=/^ {0,3}> ?/.exec(e.slice(n));if(!r)return{depth:t,offset:n};t++,n+=r[0].length}}function pt(e,t){let n=0;for(let r=0;r<t;r++){let t=/^ {0,3}> ?/.exec(e.slice(n));if(!t)return null;n+=t[0].length}return e.slice(n)}var mt=/^( *)([-*+]|\d{1,9}[.)])( +|\t|$)/;function ht(e){let t=0;for(;t<e.length&&e[t]===` `;)t++;return t}function gt(e){let t=[],n=[];for(let r=0;;){let i=e.indexOf(`
|
|
12
|
-
`,r),a=i===-1?e.length:i;if(t.push(r),n.push(a>r&&e.charCodeAt(a-1)===13?a-1:a),i===-1)break;r=i+1}let r=t.length,i=r=>e.slice(t[r],n[r]),a={ranges:[],fences:[],paragraphs:[],endsInFence:!1,pendingPara:-1},o={count:r,line:i},s=0;for(let c=0;c<r;c++){let l=at(i(c));if(!l||l.char!=="`")continue;_t(e,t,n,i,s,c,a);let u=ct(o,c,l);a.ranges.push({start:t[c],end:n[u.line],kind:`fence`}),a.fences.push([c,u.line,u.closed]),a.pendingPara=-1,!u.closed&&u.line===r-1&&(a.endsInFence=!0),c=u.line,s=c+1}return _t(e,t,n,i,s,r,a),a}function _t(e,t,n,r,i,a,o){let s=-1,c=0,l=[],u=e=>{s!==-1&&o.paragraphs.push([s,e]),s=-1};for(let e=i;e<a;e++){let i=r(e),{depth:d,offset:f}=ft(i);d!==c&&(c=d,l=[]);let p=i.slice(f);if(p.trim()===``){u(t[e]),(e!==t.length-1||i!==``)&&(o.pendingPara=-1);continue}let m=ht(p);for(;l.length&&m<l[l.length-1];)l.pop();let h=mt.exec(p),g=l.length?l[l.length-1]:0;if(h){let e=h[3].length;g=h[1].length+h[2].length+(e>=1&&e<=4?e:1),l.push(g),p=p.slice(Math.min(g,p.length))}else p=p.slice(Math.min(m,g));let _=at(p);if(!_){s===-1&&(s=t[e]),o.pendingPara===-1&&(o.pendingPara=t[e]);continue}u(t[e]),o.pendingPara=-1;let v=g,y=ct({count:a,line:e=>{let t=pt(r(e),d);if(t===null)return null;if(_.char===`~`&&v>0){let e=ht(t);return t.trim()!==``&&e<v?null:t.slice(Math.min(e,v))}return t}},e,_);o.ranges.push({start:t[e],end:n[y.line],kind:`fence`}),o.fences.push([e,y.line,y.closed]),!y.closed&&y.line===t.length-1&&(o.endsInFence=!0),e=y.line}u(a<t.length?t[a]:e.length)}var vt=class{all=[];byLength=new Map;indexOf=new Map;constructor(e,t,n){for(let r=t;r<n;){if(e.charCodeAt(r)!==96){r++;continue}let t=1;for(;r+t<n&&e.charCodeAt(r+t)===96;)t++;this.indexOf.set(r,this.all.length),this.all.push([r,t]);let i=this.byLength.get(t);i?i.push(r):this.byLength.set(t,[r]),r+=t}}next(e,t){let n=this.byLength.get(e);if(!n)return-1;let r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<t?r=e+1:i=e}return n[r]??-1}index(e){return this.indexOf.get(e)??-1}};function yt(e,t,n,r){let i=null;for(let a=t;a<n;){let o=e.charCodeAt(a);if(o===92){a+=2;continue}if(o!==96){a++;continue}let s=dt(e,a),c=Math.min(s,n-a);i??=new vt(e,t,n);let l=i.next(c,a+c);if(l===-1){a+=c;continue}r.push({start:a,end:l+c,kind:`span`}),a=l+c}}function bt(e){let t=gt(e),n=[...t.ranges];for(let[r,i]of t.paragraphs)yt(e,r,i,n);return n.sort((e,t)=>e.start-t.start)}function xt(e){let t=[],n=0;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`\\`){r+=1;continue}i===`|`&&(t.push(e.slice(n,r)),n=r+1)}return t.push(e.slice(n)),t}function St(e){let t=xt(e).map(e=>e.trim());return t.length>1&&t[0]===``&&t.shift(),(t.length>1&&t[t.length-1]===``||t.length===1&&t[0]===``&&!e.includes(`|`))&&t.pop(),t}function Ct(e){return e.replace(/\\\|/g,`|`)}var wt=/^(?:[-+*](?:\s|$)|\d{1,9}[.)](?:\s|$)|>|#{1,6}(?:\s|$)|(?:-\s*){3,}$|(?:\*\s*){3,}$|(?:_\s*){3,}$|\[\^[^\]\s]+\]:)/,Tt=e=>wt.test(e)||ot(e)||Nt(e),Et=/^<(?:script|pre|style|textarea)(?:[\s>]|$)/i,Dt=/^(?:<!--|<\?|<![A-Za-z]|<!\[CDATA\[)/,Ot=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,kt=RegExp(`^</?(?:${Ot})(?:[\\s>]|/>|$)`,`i`),At=RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s"'=<>\`]+|'[^']*'|"[^"]*"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`),jt=RegExp(`^</?(?:address|article|aside|base|basefont|body|center|dialog|dir|fieldset|footer|form|frame|frameset|head|header|html|iframe|legend|link|main|menu|menuitem|nav|noframes|optgroup|option|param|search|title|track)(?:[\\s>]|/>|$)`,`i`);function Mt(e){return jt.test(e)}[...Ot.replace(`h[1-6]`,`h1|h2|h3|h4|h5|h6`).split(`|`)];function Nt(e){return e.startsWith(`<`)?Et.test(e)||Dt.test(e)||kt.test(e)||At.test(e):!1}function Pt(e){let t=0;for(let n of e)if(n===` `)t+=1;else if(n===` `)t+=4-t%4;else break;return t}var Ft=/^([ \t]*)([-+*]|\d{1,9}[.)])([ \t]+|$)/;function It(e){let t=Pt(e[1]??``)+(e[2]??``).length,n=e[3]?Pt(` `.repeat(t)+e[3])-t:1;return t+(n>=1&&n<=4?n:1)}function Lt(e,t){return Rt(e,t,!1)}function Rt(e,t,n){let r=n?Ft.exec(e[t]??``):null;if(r)return It(r);let i=Pt(e[t]??``);if(i===0)return 0;for(let n=t-1;n>=0;--n){let t=e[n]??``;if(!t.trim())continue;let r=Pt(t),a=Ft.exec(t);if(a&&r<i){let e=It(a);if(e<=i)return e;continue}if(r===0)return 0}return 0}var zt=/^:?-+:?$/;function Bt(e){let t=e.trim();if(!t.includes(`|`))return!1;let n=St(t);return n.length>0&&n.every(e=>zt.test(e))}function Vt(e){let t=e.trim();return t.startsWith(`|`)&&t.includes(`|`,1)}function Ht(e){return e===void 0||!Bt(e)?!1:!wt.test(e.trim())}function Ut(e,t){let n=e.trim();return!n||Vt(n)||!n.startsWith(`|`)&&Tt(n)||!Ht(t)?!1:St(n).length===St(t.trim()).length}function Wt(e,t=0){let n=e.trim();return!n||Pt(e)-t>=4?!1:n.startsWith(`|`)||!Tt(n)}function Gt(e,t){let n=e[t]??``;return!Vt(n)&&!Ut(n,e[t+1])?!1:!Zt(e,t)&&!Xt(e,t)}var Kt=/^ {0,3}>/,qt=/^(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,Jt=e=>/^#{1,6}(?:\s|$)/.test(e)||qt.test(e)||ot(e)||Nt(e);function Yt(e){if(Et.test(e))return/<\/(?:script|pre|style|textarea)>/i;if(e.startsWith(`<!--`))return/-->/;if(e.startsWith(`<?`))return/\?>/;if(e.startsWith(`<![CDATA[`))return/\]\]>/;if(/^<![A-Za-z]/.test(e))return/>/;if(kt.test(e)||At.test(e))return null}function Xt(e,t){let n=t;for(;n>0&&(e[n-1]??``).trim();)--n;let r,i=!1;for(let a=n;a<t;a+=1){let t=e[a]??``;if(r!==void 0){r&&r.test(t)&&(r=void 0);continue}let n=t.trim(),o=Pt(t)<4?Yt(n):void 0,s=o===null&&!kt.test(n);if(o===void 0||i&&s){i=!0;continue}i=!1,!Mt(n)&&(r=o&&o.test(n.slice(2))?void 0:o)}return r!==void 0}function Zt(e,t){let n=e[t]??``,r=-1;for(let n=t-1;n>=0;--n){let t=e[n]??``,i=t.trim();if(!i||Jt(i))break;let a=Ft.exec(t);if(a){let e=t.slice(a[0].length).trim();if(!e||Jt(e))break;r=n;break}if(r=n,Kt.test(t))break}if(r<0)return!1;let i=e[r]??``;return Kt.test(i)?!Kt.test(n):Pt(n)<Rt(e,r,!0)}function Qt(e,t){let n=e[t]??``,r=e[t+1];return!Gt(e,t)||!Ht(r)||St(n).length!==St(r).length?!1:Pt(n)-Lt(e,t)<4}function $t(e,t){let n=Lt(e,t),r=Math.min(e.length,t+2);for(;r<e.length&&Wt(e[r]??``,n);)r+=1;return r}var en=`generic_structured`,tn=Symbol.for(`ai-matrx.content-ir-react.sourceless-db-row-reports`);globalThis[tn]??=new Set;var nn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rn(e){return typeof e==`string`&&nn.test(e)}var an=new Set([`update`,`delete`]),on=new Set([`__kind`,`id`]);function sn(e){let t=e.id;return typeof t==`string`&&t.trim()?t.trim():typeof t==`number`?String(t):null}function cn(e){let t=e.replace(/_/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function ln(e,t){return`${e} ${rn(t)?t.slice(0,8):t.length>12?`${t.slice(0,12)}…`:t}`}function un(e){if(e==null)return{value:`cleared`,full:`cleared`,clears:!0};if(typeof e==`string`){let t=e.trim();if(!t)return{value:`cleared`,full:`cleared`,clears:!0};let n=t.replace(/\s+/g,` `);return{value:n.length>60?`${n.slice(0,59)}…`:n,full:t,clears:!1}}if(typeof e==`number`||typeof e==`boolean`)return{value:String(e),full:String(e),clears:!1};if(Array.isArray(e)){let t=e.length;return{value:t===0?`cleared`:`${t} ${t===1?`entry`:`entries`}`,full:dn(e),clears:t===0}}let t=Object.keys(e).length;return{value:t===0?`cleared`:`${t} ${t===1?`field`:`fields`}`,full:dn(e),clears:t===0}}function dn(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function fn(e){let t=[];for(let[n,r]of Object.entries(e))on.has(n)||t.push({key:n,label:cn(n),...un(r)});return t}function pn({children:e,...t}){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...t,children:e})}var mn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`}),(0,j.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,j.jsx)(`path`,{d:`M3 15h6`}),(0,j.jsx)(`path`,{d:`M6 12v6`})]}),hn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M12 20h9`}),(0,j.jsx)(`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`})]}),gn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M3 6h18`}),(0,j.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,j.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`}),(0,j.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,j.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),_n=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`polygon`,{points:`6 3 20 12 6 21 6 3`})}),vn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`}),(0,j.jsx)(`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.01-.4-2.96A4 4 0 0 1 14 5.5c.63.42 1.13 1 1.44 1.66`}),(0,j.jsx)(`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`})]}),yn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,j.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,j.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,j.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,j.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,j.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,j.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,j.jsx)(`path`,{d:`M17 16.5v5.17`}),(0,j.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,j.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,j.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,j.jsx)(`path`,{d:`M12 13.5V8`})]}),bn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),xn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`m9 18 6-6-6-6`})}),Sn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,j.jsx)(`polyline`,{points:`9 21 3 21 3 15`}),(0,j.jsx)(`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`}),(0,j.jsx)(`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`})]}),Cn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),wn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,j.jsx)(`path`,{d:`M3 3v5h5`})]}),Tn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,j.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),En=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,j.jsx)(`path`,{d:`M12 9v4`}),(0,j.jsx)(`path`,{d:`M12 17h.01`})]}),Dn=new Set([`create_agent`,`create_agent_definition`,`agent`]);function On(e,t){if(e===`action`&&Dn.has(t))return vn;switch(e){case`create`:return mn;case`update`:return hn;case`delete`:return gn;default:return _n}}var kn=2e3,An=30;function jn({directive:e,label:t=`Apply`,itemCount:n,onApplied:r}){let i=L(),a=F().conversationId||void 0,o=e.items,s=!!i.applyState&&!!i.confirm&&e.parsed.executes&&o.length>0,[c,l]=(0,_.useState)(s?{status:`checking`}:{status:`idle`}),[u,d]=(0,_.useState)(0),f=(0,_.useRef)(null),p=Re(e.noun,i.nouns),m=s?JSON.stringify([e.slug,o,a??null]):``,h=i.applyState,g=i.reportError;if((0,_.useEffect)(()=>{if(!m||!h)return;let[e,t,n]=JSON.parse(m),r={__kind:e,items:t};n&&(r.conversationId=n);let i=!0,a=0,o=null,s=()=>{h(r).then(e=>{i&&(e.state===`applied`?l(n=>n.status===`checking`||n.status===`finishing`?{status:`applied`,applied:t.length,failed:0,message:e.message?.trim()?e.message.trim():null,records:e.records??[]}:n):e.state===`in_flight`&&a<An?(a+=1,l(e=>e.status===`checking`||e.status===`finishing`?{status:`finishing`}:e),o=setTimeout(s,kn)):l(e=>e.status===`checking`||e.status===`finishing`?{status:`idle`}:e))}).catch(t=>{if(!i)return;let n=t instanceof Error&&t.message?t.message:String(t);(g??console.error)(`[kind-directives] Could not read whether ${e} was already applied: ${n}`),l(e=>e.status===`checking`||e.status===`finishing`?{status:`idle`}:e)})};return s(),()=>{i=!1,o&&clearTimeout(o)}},[m,h,g]),(0,_.useEffect)(()=>{if(c.status!==`applying`)return;f.current=Date.now();let e=setInterval(()=>d(Math.round((Date.now()-(f.current??0))/1e3)),1e3);return()=>clearInterval(e)},[c.status]),!e.parsed.executes)return null;let v=i.confirm;if(!v)return null;async function y(t=!1){if(!v)return;let n=c;if(i.ask){l({status:`asking`});let r=!1;try{r=await i.ask({directive:e,items:o,nounLabel:p,...t?{again:!0}:{}})}catch(e){l({status:`error`,message:e instanceof Error&&e.message?e.message:`We could not ask you to confirm this, so nothing was done.`});return}if(!r){l(t?n:{status:`idle`});return}}d(0),l({status:`applying`});try{let n={__kind:e.slug,items:o};a&&(n.conversationId=a),t&&(n.force=!0);let i=await v(n);l({status:`applied`,applied:i.applied,failed:i.failed,message:i.message?.trim()?i.message.trim():null,records:i.records??[]}),r?.()}catch(e){l({status:`error`,message:e instanceof Error&&e.message?e.message:`That couldn't be applied just now. Please try again.`})}}if(c.status===`applied`){let t=c.failed>0,n=e.directiveClass===`delete`,r=p,a=i.renderRecord?c.records:[];return(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs ${t?`text-destructive`:`text-primary`}`,"data-apply-state":`applied`,children:[(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1`,children:[t?(0,j.jsx)(En,{className:`mt-px h-3.5 w-3.5 shrink-0`}):(0,j.jsx)(Tn,{className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,j.jsxs)(`span`,{className:`min-w-0`,children:[c.message??`Applied ${c.applied}`,t&&!c.message?` · ${c.failed} failed`:``]})]}),a.map(e=>(0,j.jsx)(`span`,{className:`inline-flex min-w-0 items-center`,children:i.renderRecord?.({...e,fallback:ln(r,e.id),context:`applied`,trashed:n})},`${e.noun}:${e.id}`)),(0,j.jsxs)(`button`,{type:`button`,onClick:()=>void y(!t),className:`inline-flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,"data-apply-action":t?`retry`:`run-again`,children:[(0,j.jsx)(wn,{className:`h-3 w-3`}),t?`Retry`:`Run again`]})]})}return c.status===`checking`?(0,j.jsx)(`span`,{className:`inline-flex h-6 w-6 items-center justify-center text-muted-foreground`,role:`status`,"aria-label":`Checking whether this already ran`,"data-apply-state":`checking`,children:(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`})}):c.status===`finishing`?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,role:`status`,"data-apply-state":`finishing`,children:[(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`}),`Finishing…`]}):(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>void y(),disabled:c.status===`applying`||c.status===`asking`||o.length===0,className:`inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs font-medium hover:bg-accent disabled:opacity-50`,children:[c.status===`applying`?(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`}):(0,j.jsx)(_n,{className:`h-3.5 w-3.5`}),c.status===`applying`?`Applying${n?` ${n} ${n===1?`item`:`items`}`:``}…${u?` ${u}s`:``}`:t]}),c.status===`error`?(0,j.jsxs)(`span`,{className:`inline-flex max-w-sm items-start gap-1 text-xs text-destructive`,children:[(0,j.jsx)(En,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{children:c.message})]}):null]})}function Mn({directive:e,reason:t}){let n=L(),r=e.items.length,i=Ve(e.directiveClass,e.noun,n.nouns);return(0,j.jsxs)(`div`,{className:`my-3 inline-flex flex-wrap items-center gap-2 rounded-md border border-border bg-muted px-2.5 py-1 text-sm`,children:[(0,j.jsx)(yn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-foreground`,children:i.title}),i.family?(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,i.family]}):null,(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r,` `,r===1?`item`:`items`]}),t?(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,t]}):null,(0,j.jsx)(jn,{directive:e})]})}var Nn=/^\{\s*"__kind"\s*:\s*"([^"]+)"/;function Pn(e){return e.trimStart().match(Nn)?.[1]??null}function Fn({content:e,streaming:t,className:n}){let r=L(),i=Pn(e),a=i?ve(i):null,o=a?Ve(a.directiveClass,a.noun,r.nouns):null,s=a?On(a.directiveClass,a.noun):yn,c=o?.title??`Structured action`;return(0,j.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5${n?` ${n}`:``}`,"data-directive":i??void 0,"data-directive-state":t?`streaming`:`incomplete`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:c}),o?.family?(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,t?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,role:`status`,children:[(0,j.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary`,"aria-hidden":!0}),`Writing…`]}):(0,j.jsx)(`span`,{className:`text-xs text-destructive`,role:`status`,children:`Cut off before it finished — nothing can be applied.`})]}),t?null:(0,j.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer select-none hover:text-foreground`,children:`Show what arrived`}),(0,j.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded bg-muted px-2 py-1 text-[11px]`,children:e})]})]})}var In=Symbol.for(`ai-matrx.content-ir-react.directive-renderers`),Ln=globalThis[In]??={bySlug:new Map,byClass:new Map};function Rn(e){return Ln.bySlug.get(e.slug)??Ln.byClass.get(e.directiveClass)??null}var zn=3;function Bn({directive:e,item:t,index:n,total:r}){let i=L(),a=an.has(e.directiveClass)?sn(t):null;if(a)return(0,j.jsx)(Vn,{directive:e,item:t,recordId:a});let o=Ge(t,Be(e.noun,i.nouns),n,r),s=Ke(t),c=Xe(t),l=i.itemKind?.(e.slug)??null,u=Ve(e.directiveClass,e.noun,i.nouns),d=i.openItem,f=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`min-w-0 shrink-0 truncate font-medium text-foreground`,children:o}),(0,j.jsx)(`span`,{className:`hidden min-w-0 flex-1 items-baseline gap-2 overflow-hidden sm:flex`,children:c.map(e=>(0,j.jsxs)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:[e.value,` `,e.label]},e.key))}),s&&c.length===0?(0,j.jsx)(`span`,{className:`hidden truncate text-[11px] text-muted-foreground sm:inline`,children:s}):null,d?(0,j.jsx)(Sn,{className:`ml-auto h-3 w-3 shrink-0 text-muted-foreground`}):null]});return(0,j.jsxs)(`div`,{className:`flex items-center gap-2 py-1 text-xs`,children:[d?(0,j.jsx)(`button`,{type:`button`,onClick:()=>d({item:Ze(t,l)??t,itemKind:l,title:o,subtitle:`${u.title} · item ${n+1} of ${r}`,directive:e,index:n,total:r}),className:`flex min-w-0 flex-1 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-accent hover:text-accent-foreground`,title:`Open to read it`,children:f}):(0,j.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 px-1 py-0.5`,children:f}),i.renderCopy?.({label:o,value:t,kind:l,size:`xs`})]})}function Vn({directive:e,item:t,recordId:n}){let r=L(),i=ln(Re(e.noun,r.nouns),n),a=e.directiveClass===`update`?fn(t):[],o=r.renderRecord?r.renderRecord({noun:e.noun,id:n,fallback:i,context:`row`}):(0,j.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:i});return(0,j.jsxs)(`div`,{className:`py-1 text-xs`,"data-directive-target":n,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1 px-1`,children:o}),r.renderCopy?.({label:i,value:t,size:`xs`})]}),e.directiveClass===`update`?a.length===0?(0,j.jsx)(`p`,{className:`px-1 text-[11px] text-muted-foreground`,children:`Sets no fields — nothing would change.`}):(0,j.jsx)(`ul`,{className:`mt-0.5 space-y-0.5 px-1`,children:a.map(e=>(0,j.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-[11px]`,title:`${e.label} → ${e.full}`,children:[(0,j.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.label}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-muted-foreground`,children:`→`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate ${e.clears?`italic text-muted-foreground`:`text-foreground`}`,children:e.value})]},e.key))}):null]})}function Hn({directive:e}){let t=L(),[n,r]=(0,_.useState)(!1),i=e.items,a=i.length,o=Ve(e.directiveClass,e.noun,t.nouns),s=On(e.directiveClass,e.noun),c=n?i:i.slice(0,zn),l=a-c.length;return(0,j.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5`,"data-directive":e.slug,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:o.title}),o.family?(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,(0,j.jsxs)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:[a,` `,a===1?`item`:`items`]}),(0,j.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t.renderCopy?.({label:o.title,value:e.shell,size:`icon`}),(0,j.jsx)(jn,{directive:e,itemCount:a})]})]}),a===0?(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No items — nothing would be written.`}):(0,j.jsx)(`div`,{className:`mt-0.5 divide-y divide-border/60`,children:c.map((t,n)=>(0,j.jsx)(Bn,{directive:e,item:t,index:n,total:a},n))}),l>0||n?(0,j.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`mt-0.5 inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-muted-foreground hover:text-foreground`,children:[n?(0,j.jsx)(bn,{className:`h-3 w-3`}):(0,j.jsx)(xn,{className:`h-3 w-3`}),n?`Show less`:`Show ${l} more`]}):null]})}function Un(e){try{return JSON.parse(e),!0}catch{return!1}}function Wn({conversationId:e,...t}){return e===void 0?(0,j.jsx)(Gn,{...t}):(0,j.jsx)(P,{conversationId:e,children:(0,j.jsx)(Gn,{...t})})}function Gn({content:e,className:t,streaming:n}){let r=L(),i=Fe(e,e=>{let t=`[kind-directives] ${e}`;r.reportError?r.reportError(t):console.error(t)});if(!i){if(typeof e==`string`&&xe(e)&&!Un(e))return(0,j.jsx)(Fn,{content:e,streaming:n!==!1,className:t});let r=typeof e==`string`?e:JSON.stringify(e,null,2);return(0,j.jsx)(`pre`,{className:`my-3 overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 text-xs text-muted-foreground${t?` ${t}`:``}`,children:r})}let a=Rn(i);return a?(0,j.jsx)(a,{directive:i}):i.parsed.executes?(0,j.jsx)(Hn,{directive:i}):(0,j.jsx)(Mn,{directive:i})}function Kn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qn(e,t){if(he(e)||t.kinds.getDefinition(e)?.legacyBlockType)return!0;let n=t.components.resolve(e,t.platform,`output`);return n?.isActive?n.componentKey!==en:!1}function Jn(e){return he(e.kind)?(0,j.jsx)(Wn,{content:e.value,...e.className===void 0?{}:{className:e.className}}):(0,j.jsx)(Yn,{...e})}function Yn({kind:e,value:t,showRoutingNote:n=!0,unroutableFallback:r,variant:i=`card`,className:a}){let o=ne(),[s,c]=(0,_.useState)(()=>qn(e,o)?`routable`:`checking`);(0,_.useEffect)(()=>{let t=!1,n=!1,r=()=>{t||c(qn(e,o)?`routable`:n?`unroutable`:`checking`)},i=o.components.subscribe(r);r(),o.components.requestComponent(e,o.platform,`output`);let a=o.components.getVersion()>0;return Promise.allSettled([o.kinds.ensureWarm(),o.components.ensureWarm()]).then(async()=>{n=!0,r(),a&&await o.components.refresh(),r()}),()=>{t=!0,i()}},[o,e]);let l=Kn(t)?{type:`code`,content:JSON.stringify(t,null,2),language:`json`,metadata:{[re]:ue(t,e)}}:null,u=i===`bare`?void 0:`rounded-md border border-border bg-card p-3`;if(s===`unroutable`&&r!==void 0)return(0,j.jsx)(j.Fragment,{children:r});let d=l===null||s===`unroutable`,f=`This shape has no custom component yet, so it renders through the universal viewer — exactly what production shows today.`;return(0,j.jsxs)(`div`,{className:a?`space-y-3 ${a}`:`space-y-3`,children:[n&&s===`unroutable`?o.renderNotice?.(f)??(0,j.jsx)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:f}):null,(0,j.jsx)(`div`,{className:u,children:d?o.renderValue({value:t,kind:e}):o.renderBlock(l)})]})}var Xn=/^(https?:|mailto:|tel:)/i,Zn=/^([./#?]|[A-Za-z0-9_-]+\/)/;function Qn(e){let t=e.trim();return t===``?null:Xn.test(t)?t:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)?null:Zn.test(t)?t:null}function $n(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:null}var er=400,tr=["(`+)([^\\n]{0,400}?)\\1",`!\\[([^\\]\\n]*)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`\\[([^\\]\\n]+)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`(\\*\\*|__)(?=\\S)([^\\n]{0,400}?\\S)\\7`,`(\\*|_)(?=\\S)([^*_\\n]{0,400}?\\S)\\9`,`(~~)(?=\\S)([^\\n]{0,400}?\\S)\\11`,`(https?://[^\\s<>()]+)`].join(`|`);function nr(e,t,n=0){if(n>6||e.length>er*64)return[e];let r=[],i=new RegExp(tr,`g`),a=0,o=0,s=i.exec(e);for(;s!==null;){s.index>a&&r.push(e.slice(a,s.index));let c=`${t}i${o}`;if(o+=1,s[1]!==void 0)r.push((0,j.jsx)(`code`,{children:s[2]??``},c));else if(s[4]!==void 0){let e=$n(s[4]),t=s[3]??``;r.push(e===null?(0,j.jsx)(_.Fragment,{children:t===``?s[4]:t},c):(0,j.jsx)(`img`,{className:`mx-chat-md__image`,src:e,alt:t,loading:`lazy`,referrerPolicy:`no-referrer`},c))}else if(s[6]!==void 0){let e=Qn(s[6]),t=s[5]??``;r.push(e===null?(0,j.jsx)(_.Fragment,{children:t},c):(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:nr(t,`${c}-`,n+1)},c))}else s[8]===void 0?s[10]===void 0?s[12]===void 0?s[13]!==void 0&&r.push((0,j.jsx)(`a`,{href:s[13],target:`_blank`,rel:`noreferrer noopener`,children:s[13]},c)):r.push((0,j.jsx)(`del`,{children:nr(s[12],`${c}-`,n+1)},c)):r.push((0,j.jsx)(`em`,{children:nr(s[10],`${c}-`,n+1)},c)):r.push((0,j.jsx)(`strong`,{children:nr(s[8],`${c}-`,n+1)},c));a=s.index+s[0].length,s=i.exec(e)}return a<e.length&&r.push(e.slice(a)),r}var rr=/^\s{0,3}(`{3,}|~{3,})\s*([^\s`]*)/,ir=/^(#{1,6})\s+(.*)$/,ar=/^\s{0,3}[-*+]\s+(.*)$/,or=/^\s{0,3}\d{1,9}[.)]\s+(.*)$/,sr=/^\s{0,3}>\s?(.*)$/,cr=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/;function lr(e){return St(e).map(Ct)}function ur(e){let t=e.split(`
|
|
12
|
+
`,r),a=i===-1?e.length:i;if(t.push(r),n.push(a>r&&e.charCodeAt(a-1)===13?a-1:a),i===-1)break;r=i+1}let r=t.length,i=r=>e.slice(t[r],n[r]),a={ranges:[],fences:[],paragraphs:[],endsInFence:!1,pendingPara:-1},o={count:r,line:i},s=0;for(let c=0;c<r;c++){let l=at(i(c));if(!l||l.char!=="`")continue;_t(e,t,n,i,s,c,a);let u=ct(o,c,l);a.ranges.push({start:t[c],end:n[u.line],kind:`fence`}),a.fences.push([c,u.line,u.closed]),a.pendingPara=-1,!u.closed&&u.line===r-1&&(a.endsInFence=!0),c=u.line,s=c+1}return _t(e,t,n,i,s,r,a),a}function _t(e,t,n,r,i,a,o){let s=-1,c=0,l=[],u=e=>{s!==-1&&o.paragraphs.push([s,e]),s=-1};for(let e=i;e<a;e++){let i=r(e),{depth:d,offset:f}=ft(i);d!==c&&(c=d,l=[]);let p=i.slice(f);if(p.trim()===``){u(t[e]),(e!==t.length-1||i!==``)&&(o.pendingPara=-1);continue}let m=ht(p);for(;l.length&&m<l[l.length-1];)l.pop();let h=mt.exec(p),g=l.length?l[l.length-1]:0;if(h){let e=h[3].length;g=h[1].length+h[2].length+(e>=1&&e<=4?e:1),l.push(g),p=p.slice(Math.min(g,p.length))}else p=p.slice(Math.min(m,g));let _=at(p);if(!_){s===-1&&(s=t[e]),o.pendingPara===-1&&(o.pendingPara=t[e]);continue}u(t[e]),o.pendingPara=-1;let v=g,y=ct({count:a,line:e=>{let t=pt(r(e),d);if(t===null)return null;if(_.char===`~`&&v>0){let e=ht(t);return t.trim()!==``&&e<v?null:t.slice(Math.min(e,v))}return t}},e,_);o.ranges.push({start:t[e],end:n[y.line],kind:`fence`}),o.fences.push([e,y.line,y.closed]),!y.closed&&y.line===t.length-1&&(o.endsInFence=!0),e=y.line}u(a<t.length?t[a]:e.length)}var vt=class{all=[];byLength=new Map;indexOf=new Map;constructor(e,t,n){for(let r=t;r<n;){if(e.charCodeAt(r)!==96){r++;continue}let t=1;for(;r+t<n&&e.charCodeAt(r+t)===96;)t++;this.indexOf.set(r,this.all.length),this.all.push([r,t]);let i=this.byLength.get(t);i?i.push(r):this.byLength.set(t,[r]),r+=t}}next(e,t){let n=this.byLength.get(e);if(!n)return-1;let r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<t?r=e+1:i=e}return n[r]??-1}index(e){return this.indexOf.get(e)??-1}};function yt(e,t,n,r){let i=null;for(let a=t;a<n;){let o=e.charCodeAt(a);if(o===92){a+=2;continue}if(o!==96){a++;continue}let s=dt(e,a),c=Math.min(s,n-a);i??=new vt(e,t,n);let l=i.next(c,a+c);if(l===-1){a+=c;continue}r.push({start:a,end:l+c,kind:`span`}),a=l+c}}function bt(e){let t=gt(e),n=[...t.ranges];for(let[r,i]of t.paragraphs)yt(e,r,i,n);return n.sort((e,t)=>e.start-t.start)}function xt(e){let t=[],n=0;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`\\`){r+=1;continue}i===`|`&&(t.push(e.slice(n,r)),n=r+1)}return t.push(e.slice(n)),t}function St(e){let t=xt(e).map(e=>e.trim());return t.length>1&&t[0]===``&&t.shift(),(t.length>1&&t[t.length-1]===``||t.length===1&&t[0]===``&&!e.includes(`|`))&&t.pop(),t}function Ct(e){return e.replace(/\\\|/g,`|`)}var wt=/^(?:[-+*](?:\s|$)|\d{1,9}[.)](?:\s|$)|>|#{1,6}(?:\s|$)|(?:-\s*){3,}$|(?:\*\s*){3,}$|(?:_\s*){3,}$|\[\^[^\]\s]+\]:)/,Tt=e=>wt.test(e)||ot(e)||Nt(e),Et=/^<(?:script|pre|style|textarea)(?:[\s>]|$)/i,Dt=/^(?:<!--|<\?|<![A-Za-z]|<!\[CDATA\[)/,Ot=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,kt=RegExp(`^</?(?:${Ot})(?:[\\s>]|/>|$)`,`i`),At=RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s"'=<>\`]+|'[^']*'|"[^"]*"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`),jt=RegExp(`^</?(?:address|article|aside|base|basefont|body|center|dialog|dir|fieldset|footer|form|frame|frameset|head|header|html|iframe|legend|link|main|menu|menuitem|nav|noframes|optgroup|option|param|search|title|track)(?:[\\s>]|/>|$)`,`i`);function Mt(e){return jt.test(e)}[...Ot.replace(`h[1-6]`,`h1|h2|h3|h4|h5|h6`).split(`|`)];function Nt(e){return e.startsWith(`<`)?Et.test(e)||Dt.test(e)||kt.test(e)||At.test(e):!1}function Pt(e){let t=0;for(let n of e)if(n===` `)t+=1;else if(n===` `)t+=4-t%4;else break;return t}var Ft=/^([ \t]*)([-+*]|\d{1,9}[.)])([ \t]+|$)/;function It(e){let t=Pt(e[1]??``)+(e[2]??``).length,n=e[3]?Pt(` `.repeat(t)+e[3])-t:1;return t+(n>=1&&n<=4?n:1)}function Lt(e,t){return Rt(e,t,!1)}function Rt(e,t,n){let r=n?Ft.exec(e[t]??``):null;if(r)return It(r);let i=Pt(e[t]??``);if(i===0)return 0;for(let n=t-1;n>=0;--n){let t=e[n]??``;if(!t.trim())continue;let r=Pt(t),a=Ft.exec(t);if(a&&r<i){let e=It(a);if(e<=i)return e;continue}if(r===0)return 0}return 0}var zt=/^:?-+:?$/;function Bt(e){let t=e.trim();if(!t.includes(`|`))return!1;let n=St(t);return n.length>0&&n.every(e=>zt.test(e))}function Vt(e){let t=e.trim();return t.startsWith(`|`)&&t.includes(`|`,1)}function Ht(e){return e===void 0||!Bt(e)?!1:!wt.test(e.trim())}function Ut(e,t){let n=e.trim();return!n||Vt(n)||!n.startsWith(`|`)&&Tt(n)||!Ht(t)?!1:St(n).length===St(t.trim()).length}function Wt(e,t=0){let n=e.trim();return!n||Pt(e)-t>=4?!1:n.startsWith(`|`)||!Tt(n)}function Gt(e,t){let n=e[t]??``;return!Vt(n)&&!Ut(n,e[t+1])?!1:!Zt(e,t)&&!Xt(e,t)}var Kt=/^ {0,3}>/,qt=/^(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,Jt=e=>/^#{1,6}(?:\s|$)/.test(e)||qt.test(e)||ot(e)||Nt(e);function Yt(e){if(Et.test(e))return/<\/(?:script|pre|style|textarea)>/i;if(e.startsWith(`<!--`))return/-->/;if(e.startsWith(`<?`))return/\?>/;if(e.startsWith(`<![CDATA[`))return/\]\]>/;if(/^<![A-Za-z]/.test(e))return/>/;if(kt.test(e)||At.test(e))return null}function Xt(e,t){let n=t;for(;n>0&&(e[n-1]??``).trim();)--n;let r,i=!1;for(let a=n;a<t;a+=1){let t=e[a]??``;if(r!==void 0){r&&r.test(t)&&(r=void 0);continue}let n=t.trim(),o=Pt(t)<4?Yt(n):void 0,s=o===null&&!kt.test(n);if(o===void 0||i&&s){i=!0;continue}i=!1,!Mt(n)&&(r=o&&o.test(n.slice(2))?void 0:o)}return r!==void 0}function Zt(e,t){let n=e[t]??``,r=-1;for(let n=t-1;n>=0;--n){let t=e[n]??``,i=t.trim();if(!i||Jt(i))break;let a=Ft.exec(t);if(a){let e=t.slice(a[0].length).trim();if(!e||Jt(e))break;r=n;break}if(r=n,Kt.test(t))break}if(r<0)return!1;let i=e[r]??``;return Kt.test(i)?!Kt.test(n):Pt(n)<Rt(e,r,!0)}function Qt(e,t){let n=e[t]??``,r=e[t+1];return!Gt(e,t)||!Ht(r)||St(n).length!==St(r).length?!1:Pt(n)-Lt(e,t)<4}function $t(e,t){let n=Lt(e,t),r=Math.min(e.length,t+2);for(;r<e.length&&Wt(e[r]??``,n);)r+=1;return r}var en=`generic_structured`,tn=Symbol.for(`ai-matrx.content-ir-react.sourceless-db-row-reports`);globalThis[tn]??=new Set;var nn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rn(e){return typeof e==`string`&&nn.test(e)}var an=new Set([`update`,`delete`]),on=new Set([`__kind`,`id`]);function sn(e){let t=e.id;return typeof t==`string`&&t.trim()?t.trim():typeof t==`number`?String(t):null}function cn(e){let t=e.replace(/_/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function ln(e,t){return`${e} ${rn(t)?t.slice(0,8):t.length>12?`${t.slice(0,12)}…`:t}`}function un(e){if(e==null)return{value:`cleared`,full:`cleared`,clears:!0};if(typeof e==`string`){let t=e.trim();if(!t)return{value:`cleared`,full:`cleared`,clears:!0};let n=t.replace(/\s+/g,` `);return{value:n.length>60?`${n.slice(0,59)}…`:n,full:t,clears:!1}}if(typeof e==`number`||typeof e==`boolean`)return{value:String(e),full:String(e),clears:!1};if(Array.isArray(e)){let t=e.length;return{value:t===0?`cleared`:`${t} ${t===1?`entry`:`entries`}`,full:dn(e),clears:t===0}}let t=Object.keys(e).length;return{value:t===0?`cleared`:`${t} ${t===1?`field`:`fields`}`,full:dn(e),clears:t===0}}function dn(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function fn(e){let t=[];for(let[n,r]of Object.entries(e))on.has(n)||t.push({key:n,label:cn(n),...un(r)});return t}function pn({children:e,...t}){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...t,children:e})}var mn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`}),(0,j.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,j.jsx)(`path`,{d:`M3 15h6`}),(0,j.jsx)(`path`,{d:`M6 12v6`})]}),hn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M12 20h9`}),(0,j.jsx)(`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`})]}),gn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M3 6h18`}),(0,j.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,j.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`}),(0,j.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,j.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),_n=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`polygon`,{points:`6 3 20 12 6 21 6 3`})}),vn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`}),(0,j.jsx)(`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.01-.4-2.96A4 4 0 0 1 14 5.5c.63.42 1.13 1 1.44 1.66`}),(0,j.jsx)(`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`})]}),yn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,j.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,j.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,j.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,j.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,j.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,j.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,j.jsx)(`path`,{d:`M17 16.5v5.17`}),(0,j.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,j.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,j.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,j.jsx)(`path`,{d:`M12 13.5V8`})]}),bn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),xn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`m9 18 6-6-6-6`})}),Sn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,j.jsx)(`polyline`,{points:`9 21 3 21 3 15`}),(0,j.jsx)(`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`}),(0,j.jsx)(`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`})]}),Cn=e=>(0,j.jsx)(pn,{...e,children:(0,j.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),wn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,j.jsx)(`path`,{d:`M3 3v5h5`})]}),Tn=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,j.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),En=e=>(0,j.jsxs)(pn,{...e,children:[(0,j.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,j.jsx)(`path`,{d:`M12 9v4`}),(0,j.jsx)(`path`,{d:`M12 17h.01`})]}),Dn=new Set([`create_agent`,`create_agent_definition`,`agent`]);function On(e,t){if(e===`action`&&Dn.has(t))return vn;switch(e){case`create`:return mn;case`update`:return hn;case`delete`:return gn;default:return _n}}var kn=2e3,An=30;function jn({directive:e,label:t=`Apply`,itemCount:n,onApplied:r}){let i=L(),a=F().conversationId||void 0,o=e.items,s=!!i.applyState&&!!i.confirm&&e.parsed.executes&&o.length>0,[c,l]=(0,_.useState)(s?{status:`checking`}:{status:`idle`}),[u,d]=(0,_.useState)(0),[f,p]=(0,_.useState)(!1),m=(0,_.useRef)(null),h=Re(e.noun,i.nouns),g=s?JSON.stringify([e.slug,o,a??null]):``,v=i.applyState,y=i.reportError;if((0,_.useEffect)(()=>{if(!g||!v)return;let[e,t,n]=JSON.parse(g),r={__kind:e,items:t};n&&(r.conversationId=n);let i=!0,a=0,o=null,s=()=>{v(r).then(e=>{i&&(e.state===`applied`?l(n=>n.status===`checking`||n.status===`finishing`?{status:`applied`,applied:t.length,failed:0,message:e.message?.trim()?e.message.trim():null,records:e.records??[]}:n):e.state===`in_flight`&&a<An?(a+=1,l(e=>e.status===`checking`||e.status===`finishing`?{status:`finishing`}:e),o=setTimeout(s,kn)):l(e=>e.status===`checking`||e.status===`finishing`?{status:`idle`}:e))}).catch(t=>{if(!i)return;let n=t instanceof Error&&t.message?t.message:String(t);(y??console.error)(`[kind-directives] Could not read whether ${e} was already applied: ${n}`),l(e=>e.status===`checking`||e.status===`finishing`?{status:`idle`}:e)})};return s(),()=>{i=!1,o&&clearTimeout(o)}},[g,v,y]),(0,_.useEffect)(()=>{if(c.status!==`applying`)return;m.current=Date.now();let e=setInterval(()=>d(Math.round((Date.now()-(m.current??0))/1e3)),1e3);return()=>clearInterval(e)},[c.status]),!e.parsed.executes)return null;let b=i.confirm;if(!b)return null;async function x(t=!1){if(!b)return;let n=c;if(i.ask){t?p(!0):l({status:`asking`});let r=!1;try{r=await i.ask({directive:e,items:o,nounLabel:h,...t?{again:!0}:{}})}catch(e){p(!1),l({status:`error`,message:e instanceof Error&&e.message?e.message:`We could not ask you to confirm this, so nothing was done.`});return}if(p(!1),!r){l(t?n:{status:`idle`});return}}d(0),l({status:`applying`});try{let n={__kind:e.slug,items:o};a&&(n.conversationId=a),t&&(n.force=!0);let i=await b(n);l({status:`applied`,applied:i.applied,failed:i.failed,message:i.message?.trim()?i.message.trim():null,records:i.records??[]}),r?.()}catch(e){l({status:`error`,message:e instanceof Error&&e.message?e.message:`That couldn't be applied just now. Please try again.`})}}if(c.status===`applied`){let t=c.failed>0,n=e.directiveClass===`delete`,r=h,a=i.renderRecord?c.records:[];return(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs ${t?`text-destructive`:`text-primary`}`,"data-apply-state":`applied`,children:[(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1`,children:[t?(0,j.jsx)(En,{className:`mt-px h-3.5 w-3.5 shrink-0`}):(0,j.jsx)(Tn,{className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,j.jsxs)(`span`,{className:`min-w-0`,children:[c.message??`Applied ${c.applied}`,t&&!c.message?` · ${c.failed} failed`:``]})]}),a.map(e=>(0,j.jsx)(`span`,{className:`inline-flex min-w-0 items-center`,children:i.renderRecord?.({...e,fallback:ln(r,e.id),context:`applied`,trashed:n})},`${e.noun}:${e.id}`)),(0,j.jsxs)(`button`,{type:`button`,disabled:f,onClick:()=>void x(!t),className:`inline-flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50`,"data-apply-action":t?`retry`:`run-again`,children:[(0,j.jsx)(wn,{className:`h-3 w-3`}),t?`Retry`:`Run again`]})]})}return c.status===`checking`?(0,j.jsx)(`span`,{className:`inline-flex h-6 w-6 items-center justify-center text-muted-foreground`,role:`status`,"aria-label":`Checking whether this already ran`,"data-apply-state":`checking`,children:(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`})}):c.status===`finishing`?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,role:`status`,"data-apply-state":`finishing`,children:[(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`}),`Finishing…`]}):(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>void x(),disabled:c.status===`applying`||c.status===`asking`||o.length===0,className:`inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs font-medium hover:bg-accent disabled:opacity-50`,children:[c.status===`applying`?(0,j.jsx)(Cn,{className:`h-3.5 w-3.5 animate-spin`}):(0,j.jsx)(_n,{className:`h-3.5 w-3.5`}),c.status===`applying`?`Applying${n?` ${n} ${n===1?`item`:`items`}`:``}…${u?` ${u}s`:``}`:t]}),c.status===`error`?(0,j.jsxs)(`span`,{className:`inline-flex max-w-sm items-start gap-1 text-xs text-destructive`,children:[(0,j.jsx)(En,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{children:c.message})]}):null]})}function Mn({directive:e,reason:t}){let n=L(),r=e.items.length,i=Ve(e.directiveClass,e.noun,n.nouns);return(0,j.jsxs)(`div`,{className:`my-3 inline-flex flex-wrap items-center gap-2 rounded-md border border-border bg-muted px-2.5 py-1 text-sm`,children:[(0,j.jsx)(yn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-foreground`,children:i.title}),i.family?(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,i.family]}):null,(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r,` `,r===1?`item`:`items`]}),t?(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,t]}):null,(0,j.jsx)(jn,{directive:e})]})}var Nn=/^\{\s*"__kind"\s*:\s*"([^"]+)"/;function Pn(e){return e.trimStart().match(Nn)?.[1]??null}function Fn({content:e,streaming:t,className:n}){let r=L(),i=Pn(e),a=i?ve(i):null,o=a?Ve(a.directiveClass,a.noun,r.nouns):null,s=a?On(a.directiveClass,a.noun):yn,c=o?.title??`Structured action`;return(0,j.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5${n?` ${n}`:``}`,"data-directive":i??void 0,"data-directive-state":t?`streaming`:`incomplete`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:c}),o?.family?(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,t?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,role:`status`,children:[(0,j.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary`,"aria-hidden":!0}),`Writing…`]}):(0,j.jsx)(`span`,{className:`text-xs text-destructive`,role:`status`,children:`Cut off before it finished — nothing can be applied.`})]}),t?null:(0,j.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer select-none hover:text-foreground`,children:`Show what arrived`}),(0,j.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded bg-muted px-2 py-1 text-[11px]`,children:e})]})]})}var In=Symbol.for(`ai-matrx.content-ir-react.directive-renderers`),Ln=globalThis[In]??={bySlug:new Map,byClass:new Map};function Rn(e){return Ln.bySlug.get(e.slug)??Ln.byClass.get(e.directiveClass)??null}var zn=3;function Bn({directive:e,item:t,index:n,total:r}){let i=L(),a=an.has(e.directiveClass)?sn(t):null;if(a)return(0,j.jsx)(Vn,{directive:e,item:t,recordId:a});let o=Ge(t,Be(e.noun,i.nouns),n,r),s=Ke(t),c=Xe(t),l=i.itemKind?.(e.slug)??null,u=Ve(e.directiveClass,e.noun,i.nouns),d=i.openItem,f=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`min-w-0 shrink-0 truncate font-medium text-foreground`,children:o}),(0,j.jsx)(`span`,{className:`hidden min-w-0 flex-1 items-baseline gap-2 overflow-hidden sm:flex`,children:c.map(e=>(0,j.jsxs)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:[e.value,` `,e.label]},e.key))}),s&&c.length===0?(0,j.jsx)(`span`,{className:`hidden truncate text-[11px] text-muted-foreground sm:inline`,children:s}):null,d?(0,j.jsx)(Sn,{className:`ml-auto h-3 w-3 shrink-0 text-muted-foreground`}):null]});return(0,j.jsxs)(`div`,{className:`flex items-center gap-2 py-1 text-xs`,children:[d?(0,j.jsx)(`button`,{type:`button`,onClick:()=>d({item:Ze(t,l)??t,itemKind:l,title:o,subtitle:`${u.title} · item ${n+1} of ${r}`,directive:e,index:n,total:r}),className:`flex min-w-0 flex-1 items-center gap-2 rounded px-1 py-0.5 text-left hover:bg-accent hover:text-accent-foreground`,title:`Open to read it`,children:f}):(0,j.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 px-1 py-0.5`,children:f}),i.renderCopy?.({label:o,value:t,kind:l,size:`xs`})]})}function Vn({directive:e,item:t,recordId:n}){let r=L(),i=ln(Re(e.noun,r.nouns),n),a=e.directiveClass===`update`?fn(t):[],o=r.renderRecord?r.renderRecord({noun:e.noun,id:n,fallback:i,context:`row`}):(0,j.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:i});return(0,j.jsxs)(`div`,{className:`py-1 text-xs`,"data-directive-target":n,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1 px-1`,children:o}),r.renderCopy?.({label:i,value:t,size:`xs`})]}),e.directiveClass===`update`?a.length===0?(0,j.jsx)(`p`,{className:`px-1 text-[11px] text-muted-foreground`,children:`Sets no fields — nothing would change.`}):(0,j.jsx)(`ul`,{className:`mt-0.5 space-y-0.5 px-1`,children:a.map(e=>(0,j.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-[11px]`,title:`${e.label} → ${e.full}`,children:[(0,j.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.label}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-muted-foreground`,children:`→`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate ${e.clears?`italic text-muted-foreground`:`text-foreground`}`,children:e.value})]},e.key))}):null]})}function Hn({directive:e}){let t=L(),[n,r]=(0,_.useState)(!1),i=e.items,a=i.length,o=Ve(e.directiveClass,e.noun,t.nouns),s=On(e.directiveClass,e.noun),c=n?i:i.slice(0,zn),l=a-c.length;return(0,j.jsxs)(`div`,{className:`my-3 rounded-md border border-border bg-card px-2.5 py-1.5`,"data-directive":e.slug,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:o.title}),o.family?(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o.family}):null,(0,j.jsxs)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:[a,` `,a===1?`item`:`items`]}),(0,j.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t.renderCopy?.({label:o.title,value:e.shell,size:`icon`}),(0,j.jsx)(jn,{directive:e,itemCount:a})]})]}),a===0?(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No items — nothing would be written.`}):(0,j.jsx)(`div`,{className:`mt-0.5 divide-y divide-border/60`,children:c.map((t,n)=>(0,j.jsx)(Bn,{directive:e,item:t,index:n,total:a},n))}),l>0||n?(0,j.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`mt-0.5 inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-muted-foreground hover:text-foreground`,children:[n?(0,j.jsx)(bn,{className:`h-3 w-3`}):(0,j.jsx)(xn,{className:`h-3 w-3`}),n?`Show less`:`Show ${l} more`]}):null]})}function Un(e){try{return JSON.parse(e),!0}catch{return!1}}function Wn({conversationId:e,...t}){return e===void 0?(0,j.jsx)(Gn,{...t}):(0,j.jsx)(P,{conversationId:e,children:(0,j.jsx)(Gn,{...t})})}function Gn({content:e,className:t,streaming:n}){let r=L(),i=Fe(e,e=>{let t=`[kind-directives] ${e}`;r.reportError?r.reportError(t):console.error(t)});if(!i){if(typeof e==`string`&&xe(e)&&!Un(e))return(0,j.jsx)(Fn,{content:e,streaming:n!==!1,className:t});let r=typeof e==`string`?e:JSON.stringify(e,null,2);return(0,j.jsx)(`pre`,{className:`my-3 overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 text-xs text-muted-foreground${t?` ${t}`:``}`,children:r})}let a=Rn(i);return a?(0,j.jsx)(a,{directive:i}):i.parsed.executes?(0,j.jsx)(Hn,{directive:i}):(0,j.jsx)(Mn,{directive:i})}function Kn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qn(e,t){if(he(e)||t.kinds.getDefinition(e)?.legacyBlockType)return!0;let n=t.components.resolve(e,t.platform,`output`);return n?.isActive?n.componentKey!==en:!1}function Jn(e){return he(e.kind)?(0,j.jsx)(Wn,{content:e.value,...e.className===void 0?{}:{className:e.className}}):(0,j.jsx)(Yn,{...e})}function Yn({kind:e,value:t,showRoutingNote:n=!0,unroutableFallback:r,variant:i=`card`,className:a}){let o=ne(),[s,c]=(0,_.useState)(()=>qn(e,o)?`routable`:`checking`);(0,_.useEffect)(()=>{let t=!1,n=!1,r=()=>{t||c(qn(e,o)?`routable`:n?`unroutable`:`checking`)},i=o.components.subscribe(r);r(),o.components.requestComponent(e,o.platform,`output`);let a=o.components.getVersion()>0;return Promise.allSettled([o.kinds.ensureWarm(),o.components.ensureWarm()]).then(async()=>{n=!0,r(),a&&await o.components.refresh(),r()}),()=>{t=!0,i()}},[o,e]);let l=Kn(t)?{type:`code`,content:JSON.stringify(t,null,2),language:`json`,metadata:{[re]:ue(t,e)}}:null,u=i===`bare`?void 0:`rounded-md border border-border bg-card p-3`;if(s===`unroutable`&&r!==void 0)return(0,j.jsx)(j.Fragment,{children:r});let d=l===null||s===`unroutable`,f=`This shape has no custom component yet, so it renders through the universal viewer — exactly what production shows today.`;return(0,j.jsxs)(`div`,{className:a?`space-y-3 ${a}`:`space-y-3`,children:[n&&s===`unroutable`?o.renderNotice?.(f)??(0,j.jsx)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:f}):null,(0,j.jsx)(`div`,{className:u,children:d?o.renderValue({value:t,kind:e}):o.renderBlock(l)})]})}var Xn=/^(https?:|mailto:|tel:)/i,Zn=/^([./#?]|[A-Za-z0-9_-]+\/)/;function Qn(e){let t=e.trim();return t===``?null:Xn.test(t)?t:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)?null:Zn.test(t)?t:null}function $n(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:null}var er=400,tr=["(`+)([^\\n]{0,400}?)\\1",`!\\[([^\\]\\n]*)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`\\[([^\\]\\n]+)\\]\\(((?:[^()\\s]|\\([^()\\s]*\\))+)\\)`,`(\\*\\*|__)(?=\\S)([^\\n]{0,400}?\\S)\\7`,`(\\*|_)(?=\\S)([^*_\\n]{0,400}?\\S)\\9`,`(~~)(?=\\S)([^\\n]{0,400}?\\S)\\11`,`(https?://[^\\s<>()]+)`].join(`|`);function nr(e,t,n=0){if(n>6||e.length>er*64)return[e];let r=[],i=new RegExp(tr,`g`),a=0,o=0,s=i.exec(e);for(;s!==null;){s.index>a&&r.push(e.slice(a,s.index));let c=`${t}i${o}`;if(o+=1,s[1]!==void 0)r.push((0,j.jsx)(`code`,{children:s[2]??``},c));else if(s[4]!==void 0){let e=$n(s[4]),t=s[3]??``;r.push(e===null?(0,j.jsx)(_.Fragment,{children:t===``?s[4]:t},c):(0,j.jsx)(`img`,{className:`mx-chat-md__image`,src:e,alt:t,loading:`lazy`,referrerPolicy:`no-referrer`},c))}else if(s[6]!==void 0){let e=Qn(s[6]),t=s[5]??``;r.push(e===null?(0,j.jsx)(_.Fragment,{children:t},c):(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:nr(t,`${c}-`,n+1)},c))}else s[8]===void 0?s[10]===void 0?s[12]===void 0?s[13]!==void 0&&r.push((0,j.jsx)(`a`,{href:s[13],target:`_blank`,rel:`noreferrer noopener`,children:s[13]},c)):r.push((0,j.jsx)(`del`,{children:nr(s[12],`${c}-`,n+1)},c)):r.push((0,j.jsx)(`em`,{children:nr(s[10],`${c}-`,n+1)},c)):r.push((0,j.jsx)(`strong`,{children:nr(s[8],`${c}-`,n+1)},c));a=s.index+s[0].length,s=i.exec(e)}return a<e.length&&r.push(e.slice(a)),r}var rr=/^\s{0,3}(`{3,}|~{3,})\s*([^\s`]*)/,ir=/^(#{1,6})\s+(.*)$/,ar=/^\s{0,3}[-*+]\s+(.*)$/,or=/^\s{0,3}\d{1,9}[.)]\s+(.*)$/,sr=/^\s{0,3}>\s?(.*)$/,cr=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/;function lr(e){return St(e).map(Ct)}function ur(e){let t=e.split(`
|
|
13
13
|
`),n=[];{let e=0;for(let r of t)n.push(e),e+=r.length+1}let r=[],i=0,a=0;for(;i<t.length;){let e=t[i]??``;if(e.trim()===``){i+=1;continue}a=i;let n=rr.exec(e);if(n!==null){let e=n[1]??"```",a=n[2]??``,o=[];i+=1;let s=!1;for(;i<t.length;){let n=t[i]??``;if(n.trimStart().startsWith(e[0]??"`")&&n.trim().length>=3){let t=rr.exec(n);if(t!==null&&(t[1]??``).length>=e.length){s=!0,i+=1;break}}o.push(n),i+=1}r.push({type:`code`,language:a,body:o.join(`
|
|
14
14
|
`),closed:s});continue}let o=ir.exec(e);if(o!==null){r.push({type:`heading`,level:(o[1]??`#`).length,body:o[2]??``}),i+=1;continue}if(cr.test(e)){r.push({type:`rule`}),i+=1;continue}if(sr.test(e)){let e=[];for(;i<t.length;){let n=sr.exec(t[i]??``);if(n===null)break;e.push(n[1]??``),i+=1}r.push({type:`quote`,body:e.join(`
|
|
15
15
|
`)});continue}let s=ar.exec(e),c=or.exec(e);if(s!==null||c!==null){let e=c!==null,n=[];for(;i<t.length;){let r=t[i]??``,a=e?or.exec(r):ar.exec(r);if(a===null)break;n.push(a[1]??``),i+=1}r.push({type:`list`,ordered:e,items:n});continue}if(Qt(t,i)){let n=lr(e),a=$t(t,i);i+=2;let o=[];for(;i<a;){let e=lr(t[i]??``);o.push(n.map((t,n)=>e[n]??``)),i+=1}r.push({type:`table`,header:n,rows:o});continue}let l=[];for(;i<t.length;){let e=t[i]??``;if(e.trim()===``||rr.test(e)||ir.test(e)||ar.test(e)||or.test(e)||sr.test(e)||cr.test(e))break;l.push(e),i+=1}r.push({type:`paragraph`,body:l.join(`
|
|
16
|
-
`)})}return{blocks:r,openFrom:n[a]??0}}function dr(){let e=new Map,t=0,n=(n,r)=>{t+=1;let i=ur(r);return e.set(n,{text:r,blocks:i.blocks,stable:i.blocks.slice(0,Math.max(0,i.blocks.length-1)),stableEnd:i.openFrom}),i.blocks};return{get parses(){return t},forget(t){e.delete(t)},parse(r,i){let a=e.get(r);if(a===void 0)return n(r,i);if(a.text===i)return a.blocks;if(!i.startsWith(a.text))return n(r,i);t+=1;let o=ur(i.slice(a.stableEnd)),s=[...a.stable,...o.blocks];return e.set(r,{text:i,blocks:s,stable:s.slice(0,Math.max(0,s.length-1)),stableEnd:a.stableEnd+o.openFrom}),s}}}function fr(e,t){switch(e.type){case`code`:return(0,j.jsx)(`pre`,{className:`mx-chat-md__pre`,"data-language":e.language||void 0,children:(0,j.jsx)(`code`,{children:e.body})},t);case`heading`:{let n=Math.min(6,Math.max(1,e.level)),r=`h${n}`;return(0,j.jsx)(r,{className:`mx-chat-md__heading`,"data-level":n,children:nr(e.body,`${t}-`)},t)}case`quote`:return(0,j.jsx)(`blockquote`,{className:`mx-chat-md__quote`,children:nr(e.body,`${t}-`)},t);case`list`:return e.ordered?(0,j.jsx)(`ol`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:nr(e,`${t}-${n}-`)},`${t}-${n}`))},t):(0,j.jsx)(`ul`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:nr(e,`${t}-${n}-`)},`${t}-${n}`))},t);case`table`:return(0,j.jsx)(`div`,{className:`mx-chat-md__table-scroll`,children:(0,j.jsxs)(`table`,{className:`mx-chat-md__table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:e.header.map((e,n)=>(0,j.jsx)(`th`,{children:nr(e,`${t}-h${n}-`)},`${t}-h${n}`))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,j.jsx)(`tr`,{children:e.map((e,r)=>(0,j.jsx)(`td`,{children:nr(e,`${t}-r${n}c${r}-`)},`${t}-r${n}c${r}`))},`${t}-r${n}`))})]})},t);case`rule`:return(0,j.jsx)(`hr`,{className:`mx-chat-md__rule`},t);case`paragraph`:return(0,j.jsx)(`p`,{className:`mx-chat-md__paragraph`,children:nr(e.body,`${t}-`)},t)}}function pr(e){let t=e.cache.parse(e.cacheKey,e.text);return(0,j.jsx)(`div`,{className:`mx-chat-md`,children:t.map((e,t)=>fr(e,`b${t}`))})}var mr=`This answer contains a structured block, and it is shown as plain text here because this app has not connected the content renderer.`,hr=`Mount <ContentIrRenderProvider host={…}> from @ai-matrx/content-ir-react above your chat to draw structured blocks properly.`;function gr(e){let t=te(),n=e.announce;return(0,_.useEffect)(()=>{t===null&&n()},[t,n]),t===null?(0,j.jsxs)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block-standin`,children:[(0,j.jsx)(`span`,{className:`mx-chat-standin`,children:mr}),(0,j.jsx)(pr,{text:e.request.text,cacheKey:`${e.request.messageId}:${e.request.kind}`,cache:e.cache})]}):(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block`,"data-kind":e.request.kind,children:(0,j.jsx)(Jn,{kind:e.request.kind,value:e.request.data??e.request.text,variant:`bare`})})}function _r(e={}){let t=e.notifier??D(),n=e.cache??dr(),r=!1,i=()=>{r||(r=!0,t.notify({level:`warning`,message:mr,remedy:hr}))};return function(e){return e.kind!==`markdown`&&e.kind!==`text`?(0,j.jsx)(gr,{request:e,cache:n,notifier:t,announce:i}):e.text===``?null:(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`markdown`,children:(0,j.jsx)(pr,{text:e.text,cacheKey:e.messageId,cache:n})})}}function vr(e){return!!(/[zZ]$/.test(e)||/[+-]\d{2}(:?\d{2})?$/.test(e)||/\b(GMT|UTC)\b/i.test(e))}function yr(e){let t=e.trim();return!t||!/\d{1,2}:\d{2}/.test(t)||vr(t)?t:`${t.replace(` `,`T`)}Z`}function br(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=yr(e);if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var xr={year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};function Sr(e,t=xr,n=`—`){let r=br(e);return r?r.toLocaleString(void 0,t):n}var Cr=[{limit:6e4,divisor:1e3,short:`s`,long:`second`},{limit:36e5,divisor:6e4,short:`m`,long:`minute`},{limit:864e5,divisor:36e5,short:`h`,long:`hour`},{limit:6048e5,divisor:864e5,short:`d`,long:`day`},{limit:2592e6,divisor:6048e5,short:`w`,long:`week`},{limit:31536e6,divisor:2592e6,short:`mo`,long:`month`}],wr=[{unit:`year`,ms:31536e6},{unit:`month`,ms:2592e6},{unit:`week`,ms:6048e5},{unit:`day`,ms:864e5},{unit:`hour`,ms:36e5},{unit:`minute`,ms:6e4}];function Tr(e,t={}){let n=t.style??`short`,r=t.suffix===!1,i=t.now??Date.now(),a=br(e);if(!a)return t.fallbackToInput===!0&&typeof e==`string`?e:t.fallback??`—`;if(n===`intl`){let e=a.getTime()-i,t=Math.abs(e);if(t<6e4)return`just now`;let n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let{unit:r,ms:i}of wr)if(t>=i)return n.format(Math.trunc(e/i),r);return`just now`}let o=i-a.getTime(),s=o<0;if(s&&-o<6e4)return`just now`;let c=Math.abs(o);for(let e of Cr)if(c<e.limit){let t=Math.max(1,Math.floor(c/e.divisor)),i=n===`long`?`${t} ${e.long}${t===1?``:`s`}`:`${t}${e.short}`;return r?i:s?`in ${i}`:`${i} ago`}return(t.absolute??(r?`date`:`datetime`))===`date`?a.toLocaleDateString():Sr(a)}var Er=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function Dr(e,t={}){let n=t.fallback??`—`;if(e==null||!Number.isFinite(e)||e<0)return n;if(e<1024)return`${Math.round(e)} B`;let r=e,i=0;for(;r>=1024&&i<Er.length-1;)r/=1024,i+=1;return`${r>=10?String(Math.round(r)):r.toFixed(1)} ${Er[i]}`}function Or(e){return typeof e==`number`&&Number.isFinite(e)}function kr(e,t={}){let{digits:n=2,unknown:r=`—`}=t;if(!Or(e))return r;let i;if(n===`adaptive`||n===`trim`){let t=Math.abs(e);i=t===0||t>=1?2:t>=.01?4:6}else i=n;return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n===`trim`?Math.min(2,i):i,maximumFractionDigits:i})}`}var Ar=[``,`k`,`M`,`B`,`T`];function jr(e,t={}){let{unknown:n=`—`,style:r=`plain`,locale:i}=t;if(!Or(e))return n;if(r!==`compact`)return e.toLocaleString(i);let a=e<0?`-`:``,o=Math.abs(e);if(o<1e3)return`${a}${Math.round(o)}`;let s=0;for(;o>=1e3&&s<Ar.length-1;)o/=1e3,s+=1;let c=o>=10?Math.round(o):Number(o.toFixed(1));return c>=1e3&&s<Ar.length-1&&(o/=1e3,s+=1,c=o>=10?Math.round(o):Number(o.toFixed(1))),`${a}${o>=10?String(c):c.toFixed(1)}${Ar[s]}`}var Mr=`Attachments aren't set up here, so this file has not been sent.`,Nr="Give <ChatComposerProvider> a `files` port (your upload service) to attach files to a message.";function Pr(e){let t=!1;return{available:!1,upload(){return t||(t=!0,e.notify({level:`warning`,message:Mr,remedy:Nr})),Promise.reject(Error(Mr))}}}function Fr(e,t){return`${e} is larger than the ${Dr(t)} limit for this chat, so it has not been attached.`}function Ir(e){let t=e.replace(/[._-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).trim().toLowerCase();return t===``?`Working…`:t.charAt(0).toUpperCase()+t.slice(1)}function Lr(e){let t=new Set;return{request(n){if(t.size===0)return e.notify({level:`warning`,message:`There is nowhere to put your message back, so it has not been restored for you.`,remedy:`Copy your message from the conversation above and send it again, or mount this transcript inside a chat that has a message box.`}),!1;for(let e of t)e(n);return!0},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var Rr=(0,_.createContext)(null);function zr(e){let{thread:t,ports:n,slots:r,children:i}=e,[a]=(0,_.useState)(()=>{let e=D();return{notifier:e,prefs:k(e)}}),o=n?.notifier??a.notifier,s=(0,_.useRef)(null);(s.current===null||s.current.notifier!==o)&&(s.current={notifier:o,bus:Lr(o),renderContent:_r({notifier:o}),files:Pr(o)});let c=s.current.bus,l=s.current.renderContent,u=s.current.files,d=(0,_.useMemo)(()=>({thread:t,ports:{renderContent:n?.renderContent??l,notifier:o,prefs:n?.prefs??a.prefs,files:n?.files??u,voice:n?.voice??null,toolLabel:n?.toolLabel??Ir,modelPicker:n?.modelPicker??null,quickset:n?.quickset??null},slots:r??{},retry:c}),[t,n?.renderContent,n?.prefs,n?.files,n?.voice,n?.toolLabel,n?.modelPicker,n?.quickset,o,r,c,l,u,a.prefs]),f=(0,_.useRef)(t);return(0,_.useEffect)(()=>{if(f.current===t)return;let e=f.current.getSnapshot().status;(e===`streaming`||e===`submitted`)&&o.notify({level:`warning`,message:`The previous answer was still arriving when this chat switched conversations.`,remedy:`Stop the answer before switching, or the run keeps going in the background.`}),f.current=t},[t,o]),(0,j.jsx)(Rr.Provider,{value:d,children:i})}function Br(){let e=(0,_.useContext)(Rr);if(e===null)throw Error(`[@ai-matrx/chat] This component must be rendered inside <ChatProvider thread={…}>. Wrap your chat surface in one, passing a thread from createChatThread() or createExternalThreadSource().`);return e}function Vr(){let{thread:e}=Br(),t=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),n=(0,_.useCallback)((t,n)=>e.send(n===void 0?{text:t}:{text:t,fileIds:n}),[e]),r=(0,_.useCallback)(()=>e.cancel(),[e]);return(0,_.useMemo)(()=>({snapshot:t,messages:t.messages,status:t.status,isBusy:t.status===`submitted`||t.status===`streaming`,conversationId:t.conversationId,ephemeral:t.ephemeral,ephemeralReason:t.ephemeralReason,error:t.error,send:n,cancel:r}),[t,n,r])}function Hr(e){let{thread:t}=Br(),n=(0,_.useCallback)(n=>t.subscribeToMessage(e,n),[t,e]),r=(0,_.useCallback)(()=>t.getMessageSnapshot(e),[t,e]);return(0,_.useSyncExternalStore)(n,r,r)}function Ur(){return Br().thread.features}function Wr(){return Br().ports}function Gr(){return Br().slots}var Kr=`ai-matrx.chat.draft.`;function qr(){let{thread:e,ports:t,retry:n}=Br(),r=e.features,i=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),a=i.conversationId,o=i.status===`submitted`||i.status===`streaming`,s=`${Kr}${a??`new`}`,[c,l]=(0,_.useState)(()=>r.retainDrafts?t.prefs.get(s)??``:``),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(s);(0,_.useEffect)(()=>{if(f.current===s)return;let e=f.current;if(f.current=s,!r.retainDrafts)return;let n=t.prefs.get(e);if(n!==null&&n!==``){t.prefs.set(s,n),t.prefs.remove(e),l(n);return}l(t.prefs.get(s)??``)},[s,r.retainDrafts,t.prefs]);let p=(0,_.useCallback)(e=>{l(e),d(!1),r.retainDrafts&&(e===``?t.prefs.remove(f.current):t.prefs.set(f.current,e))},[r.retainDrafts,t.prefs]);(0,_.useEffect)(()=>n.subscribe(e=>{l(e),d(!0),r.retainDrafts&&t.prefs.set(f.current,e)}),[n,r.retainDrafts,t.prefs]);let m=(0,_.useCallback)(async()=>{let n=c.trim();if(n===``||o&&!r.sendWhileBusy)return null;l(``),d(!1),r.retainDrafts&&t.prefs.remove(f.current);let i=await e.send({text:n});return i.accepted||(l(n),r.retainDrafts&&t.prefs.set(f.current,n)),i},[c,o,e,r.retainDrafts,r.sendWhileBusy,t.prefs]),h=(0,_.useCallback)(()=>e.cancel(),[e]),g=(0,_.useCallback)(t=>{if(t.key===`Escape`){if(!o)return;t.preventDefault(),e.cancel();return}if(t.key!==`Enter`)return;let n=t.metaKey||t.ctrlKey;(r.sendKey===`enter`?!t.shiftKey&&!n:n)&&(t.preventDefault(),m())},[r.sendKey,o,m,e]);return{text:c,setText:p,canSend:c.trim()!==``&&(!o||r.sendWhileBusy),isBusy:o,send:m,stop:h,onKeyDown:g,restoredFromFailure:u}}function Jr(e,t){let n=e.findIndex(e=>e.id===t);if(n<=0)return``;for(let t=n-1;t>=0;--t){let n=e[t];if(n&&n.role===`user`)return C(n)}return``}function Yr(){return(0,j.jsx)(`svg`,{className:`mx-chat-chevron`,width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})}function Xr(){return(0,j.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})})}var Zr=Object.defineProperty,Qr=(e,t)=>Zr(e,`name`,{value:t,configurable:!0}),$r=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Qr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Qr(B,`composeEventHandlers`);function ei(e){if(!$r)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Qr(ei,`getOwnerWindow`);function ti(e){if(!$r)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Qr(ti,`getOwnerDocument`);function ni(e,t=!1){let{activeElement:n}=ti(e);if(!n?.nodeName)return null;if(ri(n)&&n.contentDocument)return ni(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ti(n).getElementById(e);if(t)return t}}return n}Qr(ni,`getActiveElement`);function ri(e){return e.tagName===`IFRAME`}Qr(ri,`isFrame`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0});function oi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ai(oi,`setRef`);function si(...e){return t=>{let n=!1,r=e.map(e=>{let r=oi(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():oi(e[t],null)}}}}ai(si,`composeRefs`);function V(...e){return _.useCallback(si(...e),e)}ai(V,`useComposedRefs`);var ci=Object.defineProperty,li=(e,t)=>ci(e,`name`,{value:t,configurable:!0});function ui(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=li(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,j.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return li(i,`useContext`),[r,i]}li(ui,`createContext`);function di(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=li(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return li(s,`useContext`),[o,s]}li(r,`createContext`);let i=li(()=>{let t=n.map(e=>_.createContext(e));return li(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,fi(i,...t)]}li(di,`createContextScope`);function fi(...e){let t=e[0];if(e.length===1)return t;let n=li(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return li(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}li(fi,`composeContextScopes`);var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});function hi(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wi(r)&&typeof Oi==`function`&&(r=Oi(r._payload)),_.Children.forEach(r,e=>{if(Si(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wi(n)&&typeof Oi==`function`&&(n=Oi(n._payload)),a=yi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?xi(a):void 0,l=V(n,c);if(!a){if(r||r===0)throw Error(o?Di(e):Ei(e));return r}let u=bi(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mi(hi,`createSlot`);var gi=hi(`Slot`),_i=Symbol.for(`radix.slottable`);function vi(e){let t=mi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_i,t}mi(vi,`createSlottable`);var yi=mi((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function bi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}mi(bi,`mergeProps`);function xi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}mi(xi,`getElementRef`);function Si(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_i}mi(Si,`isSlottable`);var Ci=Symbol.for(`react.lazy`);function wi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ci&&`_payload`in e&&Ti(e._payload)}mi(wi,`isLazyComponent`);function Ti(e){return typeof e==`object`&&!!e&&`then`in e}mi(Ti,`isPromiseLike`);var Ei=mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Di=mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Oi=_.use,ki=c(m(),1),Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hi(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mi(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}ji(Mi,`dispatchDiscreteCustomEvent`);var Ni=Object.defineProperty,Pi=(e,t)=>Ni(e,`name`,{value:t,configurable:!0});function Fi(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Pi(Fi,`useCallbackRef`);var Ii=Object.defineProperty,Li=(e,t)=>Ii(e,`name`,{value:t,configurable:!0}),Ri=`dismissableLayer.update`,zi=`dismissableLayer.pointerDownOutside`,Bi=`dismissableLayer.focusOutside`,Vi,Hi=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ui=_.forwardRef(Li(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Hi),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=V(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Ki(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=qi(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Fi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Vi=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ji(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Vi))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ji())},[d,u]),_.useEffect(()=>{let e=Li(()=>m({}),`handleUpdate`);return document.addEventListener(Ri,e),()=>document.removeEventListener(Ri,e)},[]),(0,j.jsx)(H.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:B(e.onFocusCapture,T.onFocusCapture),onBlurCapture:B(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:B(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Wi(){let e=_.useContext(Hi),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Li(Wi,`useDismissableLayerSurface`);var Gi=Li(()=>!0,`IS_TRUE`);function Ki(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Gi}=t,s=Fi(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Li(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Li(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Li(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Li(p,`handleInteractionBubble`);let m=Li(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Yi(zi,s,p,{discrete:!0})};if(Li(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Li(()=>c.current=!0,`onPointerDownCapture`)}}Li(Ki,`usePointerDownOutside`);function qi(e,t=globalThis?.document){let n=Fi(e),r=_.useRef(!1);return _.useEffect(()=>{let e=Li(e=>{e.target&&!r.current&&Yi(Bi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Li(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Li(()=>r.current=!1,`onBlurCapture`)}}Li(qi,`useFocusOutside`);function Ji(){let e=new CustomEvent(Ri);document.dispatchEvent(e)}Li(Ji,`dispatchUpdate`);function Yi(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Mi(i,a):i.dispatchEvent(a)}Li(Yi,`handleAndDispatchCustomEvent`);var Xi=globalThis?.document?_.useLayoutEffect:()=>{},Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=_.useId||(()=>void 0),ea=0;function U(e){let[t,n]=_.useState($i());return Xi(()=>{e||n(e=>e??String(ea++))},[e]),e||(t?`radix-${t}`:``)}Qi(U,`useId`);var W=[`top`,`right`,`bottom`,`left`],ta=Math.min,na=Math.max,ra=Math.round,ia=Math.floor,aa=e=>({x:e,y:e}),oa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sa(e,t,n){return na(e,ta(t,n))}function ca(e,t){return typeof e==`function`?e(t):e}function la(e){return e.split(`-`)[0]}function ua(e){return e.split(`-`)[1]}function da(e){return e===`x`?`y`:`x`}function fa(e){return e===`y`?`height`:`width`}function pa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ma(e){return da(pa(e))}function ha(e,t,n){n===void 0&&(n=!1);let r=ua(e),i=ma(e),a=fa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wa(o)),[o,wa(o)]}function ga(e){let t=wa(e);return[_a(e),t,_a(t)]}function _a(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var va=[`left`,`right`],ya=[`right`,`left`],ba=[`top`,`bottom`],xa=[`bottom`,`top`];function Sa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ya:va:t?va:ya;case`left`:case`right`:return t?ba:xa;default:return[]}}function Ca(e,t,n,r){let i=ua(e),a=Sa(la(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_a)))),a}function wa(e){let t=la(e);return oa[t]+e.slice(t.length)}function Ta(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ea(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ta(e)}function Da(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Oa(e,t,n){let{reference:r,floating:i}=e,a=pa(t),o=ma(t),s=fa(o),c=la(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ka(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ca(t,e),p=Ea(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Da(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Da(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Aa=50,ja=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ka},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oa(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Aa&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oa(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ma=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ca(e,t)||{};if(l==null)return{};let d=Ea(u),f={x:n,y:r},p=ma(i),m=fa(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ta(d[_],T),D=ta(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=sa(E,k,O),j=!c.arrow&&ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Na=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ca(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=la(r),_=pa(o),v=la(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wa(o)]:ga(o)),x=p!==`none`;!d&&x&&b.push(...Ca(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ha(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===pa(t)||T.every(e=>pa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Pa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fa(e){return W.some(t=>e[t]>=0)}var Ia=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ca(e,t);switch(i){case`referenceHidden`:{let e=Pa(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fa(e)}}}case`escaped`:{let e=Pa(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fa(e)}}}default:return{}}}}},La=new Set([`left`,`top`]);async function Ra(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=la(n),s=ua(n),c=pa(n)===`y`,l=La.has(o)?-1:1,u=a&&c?-1:1,d=ca(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var za=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ra(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ba=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ca(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pa(i),p=da(f),m=u[p],h=u[f],g=(e,t)=>sa(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Va=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ca(e,t),u={x:n,y:r},d=pa(i),f=da(d),p=u[f],m=u[d],h=ca(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=La.has(la(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ha=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ca(e,t),c=await i.detectOverflow(t,s),l=la(n),u=ua(n),d=pa(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ta(p-c[m],g),y=ta(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*na(c.left,c.right):S=p-2*na(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ua(){return typeof window<`u`}function Wa(e){return qa(e)?(e.nodeName||``).toLowerCase():`#document`}function Ga(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ka(e){return((qa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qa(e){return Ua()?e instanceof Node||e instanceof Ga(e).Node:!1}function Ja(e){return Ua()?e instanceof Element||e instanceof Ga(e).Element:!1}function Ya(e){return Ua()?e instanceof HTMLElement||e instanceof Ga(e).HTMLElement:!1}function Xa(e){return!Ua()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ga(e).ShadowRoot}function Za(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=co(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Qa(e){return/^(table|td|th)$/.test(Wa(e))}function $a(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var eo=/transform|translate|scale|rotate|perspective|filter/,to=/paint|layout|strict|content/,no=e=>!!e&&e!==`none`,ro;function io(e){let t=Ja(e)?co(e):e;return no(t.transform)||no(t.translate)||no(t.scale)||no(t.rotate)||no(t.perspective)||!oo()&&(no(t.backdropFilter)||no(t.filter))||eo.test(t.willChange||``)||to.test(t.contain||``)}function ao(e){let t=uo(e);for(;Ya(t)&&!so(t);){if(io(t))return t;if($a(t))return null;t=uo(t)}return null}function oo(){return ro??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ro}function so(e){return/^(html|body|#document)$/.test(Wa(e))}function co(e){return Ga(e).getComputedStyle(e)}function lo(e){return Ja(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Wa(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Xa(e)&&e.host||Ka(e);return Xa(t)?t.host:t}function fo(e){let t=uo(e);return so(t)?(e.ownerDocument||e).body:Ya(t)&&Za(t)?t:fo(t)}function po(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fo(e),i=r===e.ownerDocument?.body,a=Ga(r);if(i){let e=mo(a);return t.concat(a,a.visualViewport||[],Za(r)?r:[],e&&n?po(e):[])}return t.concat(r,po(r,[],n))}function mo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ho(e){let t=co(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ya(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ra(n)!==a||ra(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function go(e){return Ja(e)?e:e.contextElement}function _o(e){let t=go(e);if(!Ya(t))return aa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ho(t),o=(a?ra(n.width):n.width)/r,s=(a?ra(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vo=aa(0);function yo(e){let t=Ga(e);return!oo()||!t.visualViewport?vo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ga(e)}function xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=go(e),o=aa(1);t&&(r?Ja(r)&&(o=_o(r)):o=_o(e));let s=bo(a,n,r)?yo(a):aa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ga(a),t=Ja(r)?Ga(r):r,n=e,i=mo(n);for(;i&&t!==n;){let e=_o(i),t=i.getBoundingClientRect(),r=co(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ga(i),i=mo(n)}}return Da({width:u,height:d,x:c,y:l})}function So(e,t){let n=lo(e).scrollLeft;return t?t.left+n:xo(Ka(e)).left+n}function Co(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-So(e,n),y:n.top+t.scrollTop}}function wo(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ka(r),s=t?$a(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=aa(1),u=aa(0),d=Ya(r);if((d||!a)&&((Wa(r)!==`body`||Za(o))&&(c=lo(r)),d)){let e=xo(r);l=_o(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Co(o,c):aa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function To(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Eo(e){let t=lo(e),n=e.ownerDocument.body,r=na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+So(e),o=-t.scrollTop;return co(n).direction===`rtl`&&(a+=na(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Do=25;function Oo(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ga(e),a=Ka(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!oo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(So(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Do&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ko(e,t){let n=xo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_o(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ao(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Oo(e,n,t);else if(t===`document`)r=Eo(Ka(e));else if(Ja(t))r=ko(t,n);else{let n=yo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Da(r)}function jo(e,t){let n=t.get(e);if(n)return n;let r=po(e,[],!1).filter(e=>Ja(e)&&Wa(e)!==`body`),i=null,a=co(e).position===`fixed`,o=a?uo(e):e;for(;Ja(o)&&!so(o);){let e=co(o),t=io(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=uo(o)}return t.set(e,r),r}function Mo(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$a(t)?[]:jo(t,this._c):[].concat(n),r],o=Ao(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ao(t,a[e],i);s=na(n.top,s),c=ta(n.right,c),l=ta(n.bottom,l),u=na(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function No(e){let{width:t,height:n}=ho(e);return{width:t,height:n}}function Po(e,t,n){let r=Ya(t),i=Ka(t),a=n===`fixed`,o=xo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=aa(0);if((r||!a)&&((Wa(t)!==`body`||Za(i))&&(s=lo(t)),r)){let e=xo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=So(i));let l=i&&!r&&!a?Co(i,s):aa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Fo(e){return co(e).position===`static`}function Io(e,t){if(!Ya(e)||co(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ka(e)===n&&(n=n.ownerDocument.body),n}function Lo(e,t){let n=Ga(e);if($a(e))return n;if(!Ya(e)){let t=uo(e);for(;t&&!so(t);){if(Ja(t)&&!Fo(t))return t;t=uo(t)}return n}let r=Io(e,t);for(;r&&Qa(r)&&Fo(r);)r=Io(r,t);return r&&so(r)&&Fo(r)&&!io(r)?n:r||ao(e)||n}var Ro=async function(e){let t=this.getOffsetParent||Lo,n=this.getDimensions,r=await n(e.floating);return{reference:Po(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function G(e){return co(e).direction===`rtl`}var zo={convertOffsetParentRelativeRectToViewportRelativeRect:wo,getDocumentElement:Ka,getClippingRect:Mo,getOffsetParent:Lo,getElementRects:Ro,getClientRects:To,getDimensions:No,getScale:_o,isElement:Ja,isRTL:G};function Bo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vo(e,t,n){let r=null,i,a=Ka(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ia(d),h=ia(a.clientWidth-(u+f)),g=ia(a.clientHeight-(d+p)),_=ia(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:na(0,ta(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Bo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ga(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ho(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=go(e),u=i||a?[...l?po(l):[],...t?po(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vo(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?xo(e):null;c&&g();function g(){let t=xo(e);h&&!Bo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Uo=za,Wo=Ba,Go=Na,Ko=Ha,qo=Ia,Jo=Ma,Yo=Va,Xo=(e,t,n)=>{let r=new Map,i=n??{},a={...zo,...i.platform,_c:r};return ja(e,t,{...i,platform:a})},Zo=typeof document<`u`?_.useLayoutEffect:function(){};function Qo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $o(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function es(e,t){let n=$o(e);return Math.round(t*n)/n}function ts(e){let t=_.useRef(e);return Zo(()=>{t.current=e}),t}function ns(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Qo(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=ts(c),O=ts(i),k=ts(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Xo(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Qo(T.current,t)&&(T.current=t,ki.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Zo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Zo(()=>(j.current=!0,()=>{j.current=!1}),[]),Zo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=es(N.floating,u.x),r=es(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$o(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var rs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Jo({element:r.current,padding:i}).fn(n):r?Jo({element:r,padding:i}).fn(n):{}}}},is=(e,t)=>{let n=Uo(e);return{name:n.name,fn:n.fn,options:[e,t]}},as=(e,t)=>{let n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},os=(e,t)=>({fn:Yo(e).fn,options:[e,t]}),ss=(e,t)=>{let n=Go(e);return{name:n.name,fn:n.fn,options:[e,t]}},cs=(e,t)=>{let n=Ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},ls=(e,t)=>{let n=qo(e);return{name:n.name,fn:n.fn,options:[e,t]}},us=(e,t)=>{let n=rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ds=Object.defineProperty,fs=(e,t)=>ds(e,`name`,{value:t,configurable:!0});function ps(e){let[t,n]=_.useState(void 0);return Xi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}fs(ps,`useSize`);var ms=Object.defineProperty,hs=(e,t)=>ms(e,`name`,{value:t,configurable:!0}),gs=`Popper`,[_s,vs]=di(gs),[ys,bs]=_s(gs),xs=hs(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,j.jsx)(ys,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ss=`PopperAnchor`,Cs=_.forwardRef(hs(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=bs(Ss,n),o=_.useRef(null),s=a.onAnchorChange,c=V(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&As(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,j.jsx)(H.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),ws=`PopperContent`,[Ts,Es]=_s(ws),Ds=_.forwardRef(hs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=bs(ws,n),[v,y]=_.useState(null),b=V(t,y),[x,S]=_.useState(null),C=ps(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Os),altBoundary:k},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=ns({strategy:`fixed`,placement:E,whileElementsMounted:hs((...e)=>Ho(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[is({mainAxis:i+T,alignmentAxis:o}),c&&as({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?os():void 0,...A}),c&&ss({...A}),cs({...A,apply:hs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&us({element:x,padding:s}),ks({arrowWidth:w,arrowHeight:T}),f&&ls({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),L=g.setPlacementState;Xi(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=As(P),ne=Fi(m);Xi(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=_.useState();return Xi(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,j.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,j.jsx)(Ts,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,j.jsx)(H.div,{"data-side":ee,"data-align":te,...h,ref:b,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function Os(e){return e!==null}hs(Os,`isNotNull`);var ks=hs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=As(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function As(e){let[t,n=`center`]=e.split(`-`);return[t,n]}hs(As,`getSideAndAlignFromPlacement`);var js=xs,Ms=Cs,Ns=Ds,Ps=Object.defineProperty,Fs=_.forwardRef(((e,t)=>Ps(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);Xi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ki.createPortal((0,j.jsx)(H.div,{...r,ref:t}),o):null},`Portal`)),Is=Object.defineProperty,Ls=(e,t)=>Is(e,`name`,{value:t,configurable:!0});function Rs(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Ls(Rs,`useStateMachine`);var zs=Ls(e=>{let{present:t,children:n}=e,r=Bs(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Hs(r.ref,Ws(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function Bs(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=Rs(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??Us(r.current),o.current=void 0):a.current=`none`},[s]),Xi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Us(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Xi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ls(a=>{let o=Us(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ls(e=>{e.target===t&&(a.current=Us(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Us(t)}else r.current=null;n(e)},[])}}Ls(Bs,`usePresence`);function Vs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ls(Vs,`setRef`);function Hs(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vs(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vs(n[e],null)}}},[])}Ls(Hs,`useStableComposedRefs`);function Us(e){return e?.animationName||`none`}Ls(Us,`getAnimationName`);function Ws(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ls(Ws,`getElementRef`);var Gs=Object.defineProperty,Ks=(e,t)=>Gs(e,`name`,{value:t,configurable:!0}),qs=_.useEffectEvent,Js=_.useInsertionEffect;function Ys(e){if(typeof qs==`function`)return qs(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Js==`function`?Js(()=>{t.current=e}):Xi(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ks(Ys,`useEffectEvent`);var Xs=Object.defineProperty,Zs=(e,t)=>Xs(e,`name`,{value:t,configurable:!0}),Qs=_.useInsertionEffect||Xi;function $s({prop:e,defaultProp:t,onChange:n=Zs(()=>{},`onChange`),caller:r}){let[i,a,o]=ec({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=tc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Zs($s,`useControllableState`);function ec({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Qs(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Zs(ec,`useUncontrolledState`);function tc(e){return typeof e==`function`}Zs(tc,`isFunction`);var nc=Symbol(`RADIX:SYNC_STATE`);function rc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ys(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===nc)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:nc,state:i})},[i,d.state,c]),[h,f]}Zs(rc,`useControllableStateReducer`);var ic=Object.defineProperty,ac=(e,t)=>ic(e,`name`,{value:t,configurable:!0}),oc=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),sc=_.forwardRef(ac(function(e,t){return(0,j.jsx)(H.span,{...e,ref:t,style:{...oc,...e.style}})},`VisuallyHidden`)),cc=Object.defineProperty,lc=(e,t)=>cc(e,`name`,{value:t,configurable:!0}),[uc,dc]=di(`Tooltip`,[vs]),fc=vs(),pc=`TooltipProvider`,mc=700,hc=`tooltip.open`,[gc,_c]=uc(pc),vc=lc(e=>{let{__scopeTooltip:t,delayDuration:n=mc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(gc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),yc=`Tooltip`,[bc,xc]=uc(yc),Sc=lc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=_c(yc,e.__scopeTooltip),l=fc(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=U(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=$s({prop:r,defaultProp:i??!1,onChange:lc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(hc))):c.onClose(),a?.(e)},`onChange`),caller:yc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,j.jsx)(js,{...l,children:(0,j.jsx)(bc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Cc=`TooltipTrigger`,wc=_.forwardRef(lc(function(e,t){let{__scopeTooltip:n,...r}=e,i=xc(Cc,n),a=_c(Cc,n),o=fc(n),s=V(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,j.jsx)(Ms,{asChild:!0,...o,children:(0,j.jsx)(H.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:B(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:B(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:B(e.onBlur,i.onClose),onClick:B(e.onClick,i.onClose)})})},`TooltipTrigger`)),Tc=`TooltipPortal`,[Ec,Dc]=uc(Tc,{forceMount:void 0}),Oc=lc(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=xc(Tc,t);return(0,j.jsx)(Ec,{scope:t,forceMount:n,children:(0,j.jsx)(zs,{present:n||a.open,children:(0,j.jsx)(Fs,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),kc=`TooltipContent`,Ac=_.forwardRef(lc(function(e,t){let n=Dc(kc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=xc(kc,e.__scopeTooltip);return(0,j.jsx)(zs,{present:r||o.open,children:o.disableHoverableContent?(0,j.jsx)(Nc,{side:i,...a,ref:t}):(0,j.jsx)(jc,{side:i,...a,ref:t})})},`TooltipContent`)),jc=_.forwardRef(lc(function(e,t){let n=xc(kc,e.__scopeTooltip),r=_c(kc,e.__scopeTooltip),i=_.useRef(null),a=V(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Fc(r,Pc(r,n.getBoundingClientRect())),a=Ic(t.getBoundingClientRect()),o=Rc([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=lc(e=>p(e,u),`handleTriggerLeave`),t=lc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=lc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Lc(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,j.jsx)(Nc,{...e,ref:a})},`TooltipContentHoverable`)),Mc=vi(`TooltipContent`),Nc=_.forwardRef(lc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=xc(kc,n),u=fc(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(hc,d),()=>document.removeEventListener(hc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=lc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Xi(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,j.jsx)(Ui,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,j.jsxs)(Ns,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,j.jsx)(Mc,{children:r}),i?(0,j.jsx)(sc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Pc(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}lc(Pc,`getExitSideFromRect`);function Fc(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}lc(Fc,`getPaddedExitPoints`);function Ic(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}lc(Ic,`getPointsFromRect`);function Lc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}lc(Lc,`isPointInPolygon`);function Rc(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),zc(t)}lc(Rc,`getHull`);function zc(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}lc(zc,`getHullPresorted`);var Bc=vc,Vc=Sc,Hc=wc,Uc=Oc,Wc=Ac;function Gc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Kc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gc(e))&&(r&&(r+=` `),r+=t);return r}var qc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Jc=(e,t)=>({classGroupId:e,validator:t}),Yc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Xc=`-`,Zc=[],Qc=`arbitrary..`,$c=e=>{let t=nl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return tl(e);let n=e.split(Xc);return el(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?qc(i,t):t:i||Zc}return n[e]||Zc}}},el=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=el(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Xc):e.slice(t).join(Xc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},tl=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Qc+r:void 0})(),nl=e=>{let{theme:t,classGroups:n}=e;return rl(n,t)},rl=(e,t)=>{let n=Yc();for(let r in e){let i=e[r];il(i,n,r,t)}return n},il=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];al(i,t,n,r)}},al=(e,t,n,r)=>{if(typeof e==`string`){ol(e,t,n);return}if(typeof e==`function`){sl(e,t,n,r);return}cl(e,t,n,r)},ol=(e,t,n)=>{let r=e===``?t:ll(t,e);r.classGroupId=n},sl=(e,t,n,r)=>{if(ul(e)){il(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Jc(n,e))},cl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];il(o,ll(t,a),n,r)}},ll=(e,t)=>{let n=e,r=t.split(Xc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Yc(),n.nextPart.set(t,i)),n=i}return n},ul=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,dl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},fl=`!`,pl=`:`,ml=[],hl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),gl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===pl){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(fl)?(c=s.slice(0,-1),l=!0):s.startsWith(fl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return hl(t,l,c,u)};if(t){let e=t+pl,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):hl(ml,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},_l=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},vl=e=>({cache:dl(e.cacheSize),parseClassName:gl(e),sortModifiers:_l(e),postfixLookupClassGroupIds:yl(e),...$c(e)}),yl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},bl=/\s+/,xl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(bl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+fl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Sl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Cl(n))&&(i&&(i+=` `),i+=r);return i},Cl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Cl(e[r]))&&(n&&(n+=` `),n+=t);return n},wl=(e,...t)=>{let n,r,i,a,o=o=>(n=vl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=xl(e,n);return i(e,a),a};return a=o,(...e)=>a(Sl(...e))},Tl=[],El=e=>{let t=t=>t[e]||Tl;return t.isThemeGetter=!0,t.themeKey=e,t},Dl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ol=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Al=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Nl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=e=>kl.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),Il=e=>!!e&&Number.isInteger(Number(e)),Ll=e=>e.endsWith(`%`)&&K(e.slice(0,-1)),Rl=e=>Al.test(e),zl=()=>!0,Bl=e=>jl.test(e)&&!Ml.test(e),Vl=()=>!1,Hl=e=>Nl.test(e),Ul=e=>Pl.test(e),Wl=e=>!q(e)&&!J(e),Gl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Kl=e=>su(e,du,Vl),q=e=>Dl.test(e),ql=e=>su(e,fu,Bl),Jl=e=>su(e,pu,K),Yl=e=>su(e,hu,zl),Xl=e=>su(e,mu,Vl),Zl=e=>su(e,lu,Vl),Ql=e=>su(e,uu,Ul),$l=e=>su(e,gu,Hl),J=e=>Ol.test(e),eu=e=>cu(e,fu),tu=e=>cu(e,mu),nu=e=>cu(e,lu),ru=e=>cu(e,du),iu=e=>cu(e,uu),au=e=>cu(e,gu,!0),ou=e=>cu(e,hu,!0),su=(e,t,n)=>{let r=Dl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cu=(e,t,n=!1)=>{let r=Ol.exec(e);return r?r[1]?t(r[1]):n:!1},lu=e=>e===`position`||e===`percentage`,uu=e=>e===`image`||e===`url`,du=e=>e===`length`||e===`size`||e===`bg-size`,fu=e=>e===`length`,pu=e=>e===`number`,mu=e=>e===`family-name`,hu=e=>e===`number`||e===`weight`,gu=e=>e===`shadow`,_u=wl(()=>{let e=El(`color`),t=El(`font`),n=El(`text`),r=El(`font-weight`),i=El(`tracking`),a=El(`leading`),o=El(`breakpoint`),s=El(`container`),c=El(`spacing`),l=El(`radius`),u=El(`shadow`),d=El(`inset-shadow`),f=El(`text-shadow`),p=El(`drop-shadow`),m=El(`blur`),h=El(`perspective`),g=El(`aspect`),_=El(`ease`),v=El(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[Fl,`full`,`auto`,...w()],E=()=>[Il,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,Il,J,q]},Il,J,q],O=()=>[Il,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Fl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,Fl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Fl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,q],L=()=>[...b(),nu,Zl,{position:[J,q]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,ru,Kl,{size:[J,q]}],ne=()=>[Ll,eu,ql],re=()=>[``,`none`,`full`,l,J,q],ie=()=>[``,K,eu,ql],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[K,Ll,nu,Zl],ce=()=>[``,`none`,m,J,q],le=()=>[`none`,K,J,q],ue=()=>[`none`,K,J,q],R=()=>[K,J,q],de=()=>[Fl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Rl],breakpoint:[Rl],color:[zl],container:[Rl],"drop-shadow":[Rl],ease:[`in`,`out`,`in-out`],font:[Wl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Rl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Rl],shadow:[Rl],spacing:[`px`,K],text:[Rl],"text-shadow":[Rl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Fl,q,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,q]}],"container-named":[Gl],columns:[{columns:[K,`auto`,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Il,`auto`,J,q]}],basis:[{basis:[Fl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[K,Fl,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,K,J,q]}],shrink:[{shrink:[``,K,J,q]}],order:[{order:[Il,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,eu,ql]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ou,Yl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ll,q]}],"font-family":[{font:[tu,Xl,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[K,`none`,J,Jl]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[K,`from-font`,`auto`,J,ql]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[K,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Il,J,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Il,J,q],radial:[``,J,q],conic:[``,Il,J,q]},iu,Ql]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[K,J,q]}],"outline-w":[{outline:[``,K,eu,ql]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,au,$l]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,au,$l]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[K,ql]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,au,$l]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[K,J,q]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:ce()}],brightness:[{brightness:[K,J,q]}],contrast:[{contrast:[K,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,au,$l]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,K,J,q]}],"hue-rotate":[{"hue-rotate":[K,J,q]}],invert:[{invert:[``,K,J,q]}],saturate:[{saturate:[K,J,q]}],sepia:[{sepia:[``,K,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[K,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[K,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,K,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,K,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[K,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[K,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,K,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[K,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[K,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[Il,J,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[K,eu,ql,Jl]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Y(...e){return _u(Kc(e))}var vu=`matrx-motion-overlay`,yu=`matrx-motion-popper`,bu={top:`matrx-motion-sheet-top`,bottom:`matrx-motion-sheet-bottom`,left:`matrx-motion-sheet-left`,right:`matrx-motion-sheet-right`,center:`matrx-motion-sheet-center`},xu=`matrx-spin`;[...Object.values(bu)];var Su=Symbol.for(`ai-matrx.design-system.portal-container-context`),Cu=globalThis,wu=Cu[Su]??=_.createContext(void 0);function Tu({container:e,children:t}){return(0,j.jsx)(wu.Provider,{value:e??void 0,children:t})}function Eu(e){let t=_.useContext(wu);return e===void 0?t??void 0:e??void 0}var Du=`data-matrx-title`,Ou=`data-matrx-tooltip-trigger`,ku=350,Au=500,ju=6,Mu=8,Nu=`matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,Pu=Symbol.for(`@ai-matrx/design-system/title-tooltips`),Fu={get:e=>e[Pu],set:(e,t)=>{e[Pu]=t},delete:e=>{delete e[Pu]}};function Iu(e=typeof document>`u`?void 0:document){if(!e)return()=>{};let t=Fu.get(e);t?t.count+=1:Fu.set(e,{count:1,uninstall:Lu(e)});let n=!1;return()=>{if(n)return;n=!0;let t=Fu.get(e);t&&(--t.count,t.count<=0&&(t.uninstall(),Fu.delete(e)))}}function Lu(e){let t=e.defaultView,n=null,r=null,i,a=0,o=t?.HTMLElement,s=e=>{if(!o||!(e instanceof t.Node))return null;let n=e instanceof o?e:e.parentElement;if(!n)return null;let r=n.closest(`[title], [${Du}]`);return!r||!(r instanceof o)||r.closest(`[data-native-title]`)?null:r},c=e=>(e.getAttribute(`data-matrx-title`)??e.getAttribute(`title`)??``).trim(),l=e=>{let t=e.getAttribute(`title`);t!==null&&(e.setAttribute(Du,t),e.removeAttribute(`title`))},u=e=>{let t=e.getAttribute(Du);t!==null&&(e.hasAttribute(`title`)||e.setAttribute(`title`,t),e.removeAttribute(Du))},d=()=>r&&r.isConnected?r:(r=e.createElement(`div`),r.setAttribute(`role`,`tooltip`),r.setAttribute(`data-slot`,`title-tooltip`),r.className=Nu,r.style.visibility=`hidden`,e.body.appendChild(r),r),f=e=>{let t=e.closest(`[data-title-side]`)?.getAttribute(`data-title-side`);return t===`bottom`||t===`left`||t===`right`?t:`top`},p=(e,n)=>{let r=t?.innerWidth??0,i=t?.innerHeight??0,a=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s={top:a.top-ju-o.height>=Mu,bottom:a.bottom+ju+o.height<=i-Mu,left:a.left-ju-o.width>=Mu,right:a.right+ju+o.width<=r-Mu},c={top:`bottom`,bottom:`top`,left:`right`,right:`left`},l=f(e),u=s[l]?l:s[c[l]]?c[l]:l,d,p;u===`top`||u===`bottom`?(d=a.left+a.width/2-o.width/2,p=u===`top`?a.top-ju-o.height:a.bottom+ju):(p=a.top+a.height/2-o.height/2,d=u===`left`?a.left-ju-o.width:a.right+ju),d=Math.min(Math.max(d,Mu),Math.max(Mu,r-Mu-o.width)),p=Math.min(Math.max(p,Mu),Math.max(Mu,i-Mu-o.height)),n.style.transform=`translate(${Math.round(d)}px, ${Math.round(p)}px)`,n.setAttribute(`data-side`,u)},m=(e,n)=>{let r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;for(let r=e;r;r=r===n?null:r.parentElement){let e=t?.getComputedStyle(r);if(!e||e.display===`none`||e.visibility===`hidden`||Number(e.opacity)===0)return!1}return!0},h=(n,r)=>{let i=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),a=i(r);if(!a||!t)return!1;let o=e.createTreeWalker(n,t.NodeFilter.SHOW_TEXT);for(let e=o.nextNode();e;e=o.nextNode()){if(i(e.textContent??``)!==a)continue;let t=e.parentElement;if(t&&m(t,n)&&!(t.scrollWidth>t.clientWidth+1))return!0}return!1},g=(e,t)=>{if(n!==e||e.closest(`[data-matrx-tooltip-trigger]`))return;let r=c(e);if(!r||!e.isConnected||h(e,r))return;let i=d();i.textContent=r,i.style.visibility=`hidden`,i.setAttribute(`data-state`,t?`instant-open`:`delayed-open`),p(e,i),i.style.visibility=`visible`,e.id&&(i.id=`${e.id}-title-tooltip`)},_=()=>{i!==void 0&&clearTimeout(i),i=void 0,r&&r.style.visibility===`visible`&&(a=Date.now()),r&&(r.style.visibility=`hidden`,r.removeAttribute(`data-state`))},v=e=>{n!==e&&(y(),n=e,l(e),Date.now()-a<Au?g(e,!0):i=setTimeout(()=>g(e,!1),ku))},y=()=>{_(),n&&u(n),n=null},b=e=>{if(e.pointerType===`touch`)return;let t=s(e.target);t?v(t):n&&y()},x=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},S=e=>{let t=s(e.target);if(!t)return;let n=!0;try{n=e.target.matches(`:focus-visible`)}catch{n=!0}n&&v(t)},C=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},w=()=>y(),T=e=>{e.key===`Escape`&&y()};return e.addEventListener(`pointerover`,b,!0),e.addEventListener(`pointerout`,x,!0),e.addEventListener(`focusin`,S,!0),e.addEventListener(`focusout`,C,!0),e.addEventListener(`pointerdown`,w,!0),e.addEventListener(`keydown`,T,!0),e.addEventListener(`scroll`,w,!0),t?.addEventListener(`blur`,w),()=>{y(),e.removeEventListener(`pointerover`,b,!0),e.removeEventListener(`pointerout`,x,!0),e.removeEventListener(`focusin`,S,!0),e.removeEventListener(`focusout`,C,!0),e.removeEventListener(`pointerdown`,w,!0),e.removeEventListener(`keydown`,T,!0),e.removeEventListener(`scroll`,w,!0),t?.removeEventListener(`blur`,w),r?.remove(),r=null}}function Ru({titleTooltips:e=!0,...t}){return _.useEffect(()=>{if(e)return Iu()},[e]),(0,j.jsx)(Bc,{...t})}var zu=Vc,Bu=_.forwardRef((e,t)=>(0,j.jsx)(Hc,{ref:t,[Ou]:``,...e}));Bu.displayName=Hc.displayName;var Vu=_.forwardRef(({className:e,sideOffset:t=4,container:n,animated:r=!0,...i},a)=>{let o=Eu(n);return(0,j.jsx)(Uc,{container:o??null,children:(0,j.jsx)(Wc,{ref:a,"data-slot":`tooltip-content`,sideOffset:t,className:Y(`matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,r&&`matrx-motion-popper`,e),...i})})});Vu.displayName=Wc.displayName;function Hu(...e){return e.filter(Boolean).join(` `).trim()}var Uu=Symbol.for(`@ai-matrx/tap-target:guard`);function Wu(){return globalThis[Uu]===!0}var Gu=[`--matrx-tap-box`,`--matrx-tap-gap`,`--matrx-tap-pill-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-wide-size`,`--matrx-tap-icon-size`,`--matrx-tap-touch-min`,`--matrx-tap-target-size`],Ku=[{scope:`[data-matrx-table][data-matrx-table-density]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-icon-size`])},{scope:`[data-alchemy-trigger]`,tokens:new Set([`--matrx-tap-icon-size`])}],qu=Ku[0].scope,Ju=`.matrx-tap-target, .matrx-tap-group`,Yu=/^(?:[^\s:]+:)*!?-?(?:\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\[)/;function Xu(e){if(!Wu()||!e)return null;let t=e.split(/\s+/).filter(e=>e&&Yu.test(e));return t.length?`className is the glyph colour only — remove "${t.join(` `)}"`:null}function X(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Z(e){let t=typeof e.className==`string`?e.className.trim().split(/\s+/).slice(0,4).join(`.`):``;return`<${e.tagName.toLowerCase()}${t?`.${t}`:``}>`}function Q(e,t){let n=t.getComputedStyle(e);return n.position===`absolute`||n.position===`fixed`||n.display===`none`}function Zu(e){return e.matches(Ju)?1:e.querySelectorAll(Ju).length}function Qu(e,t,n){let r=``,i=e=>{e!==t&&(e.nodeType===3?r+=e.textContent??``:e.nodeType===1&&!Q(e,n)&&e.childNodes.forEach(i))};return e.childNodes.forEach(i),r.trim()}function $u(e,t){if(e.matches(Ju))return!0;if(Zu(e)!==1)return!1;let n=e.querySelector(Ju);return!Array.from(e.querySelectorAll(`input, select, textarea, button, a, [role='button']`)).some(e=>e!==n&&!n.contains(e))&&Qu(e,n,t)===``}var ed=null;function td(e){let t=e.defaultView,n=t.getComputedStyle(e.documentElement),r=Gu.map(e=>n.getPropertyValue(e)).join(`|`);if(ed?.key===r)return ed;let i=e.createElement(`div`);i.setAttribute(`aria-hidden`,`true`),i.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0`,i.innerHTML=`<button class="matrx-tap-target"><div class="matrx-tap-pill"><svg class="matrx-tap-icon"></svg></div></button><button class="matrx-tap-target matrx-tap-target-sm"><div class="matrx-tap-pill matrx-tap-pill-sm"></div></button><button class="matrx-tap-target matrx-tap-target-inline"><div class="matrx-tap-pill matrx-tap-pill-inline"></div></button>`,e.body.appendChild(i);let[a,o,s]=Array.from(i.children);return ed={key:r,target:a.offsetHeight,pill:a.firstElementChild.offsetHeight,icon:X(t.getComputedStyle(a.querySelector(`svg`)).height),sm:o.offsetHeight,smPill:o.firstElementChild.offsetHeight,wide:s.firstElementChild.offsetHeight},i.remove(),ed}function nd(e){let t=e.ownerDocument,n=t.defaultView;if(!n||!e.isConnected)return null;let r=n.getComputedStyle(e);if(r.display===`none`)return null;let i=n.getComputedStyle(t.documentElement),a=e.closest(qu)!==null,o=new Set;for(let t of Gu){let n=r.getPropertyValue(t).trim();if(n!==i.getPropertyValue(t).trim()){if(!Ku.some(n=>n.tokens.has(t)&&e.closest(n.scope)))return`${t} overridden to "${n}" — tap geometry is not configurable`;o.add(t)}}let s=e.classList.contains(`matrx-tap-target-sm`),c=/matrx-tap-target-(?:inline|mobile-icon-only)/.test(e.className),l=e.querySelector(`:scope > .matrx-tap-pill`),u=l?.querySelector(`.matrx-tap-icon`)??null,d=X(r.minHeight)>=e.offsetHeight-.5||X(r.minWidth)>=e.offsetWidth-.5;if(!a&&l&&!d){let r=td(t),i=s?r.sm:r.target,a=s?[r.smPill]:c?[r.pill,r.wide]:[r.pill];if(Math.abs(e.offsetHeight-i)>.5)return`button is ${e.offsetHeight}px tall, canon is ${i}px`;if(!c&&Math.abs(e.offsetWidth-i)>.5)return`button is ${e.offsetWidth}px wide, canon is ${i}px`;if(!a.some(e=>Math.abs(l.offsetHeight-e)<=.5))return`pill is ${l.offsetHeight}px, canon is ${a.join(` or `)}px`;if(u&&!o.has(`--matrx-tap-icon-size`)){let e=X(n.getComputedStyle(u).height);if(Math.abs(e-r.icon)>.5)return`glyph is ${e}px, canon is ${r.icon}px`}}let f=e;if(e.parentElement?.matches(`.matrx-tap-group-row, .matrx-tap-search-measure`)){let t=e.closest(`.matrx-tap-group`);if(t&&Zu(e.parentElement)>1)return null;f=t??e}for(let e=0;e<2;e+=1){let e=f.parentElement;if(!e||e===t.body||Array.from(e.children).filter(e=>e!==f&&!Q(e,n)).length>0||Qu(e,f,n)!==``)break;let r=n.getComputedStyle(e),i=X(r.marginLeft)+X(r.marginRight)+X(r.paddingLeft)+X(r.paddingRight);if(i>.5)return`${Z(e)} adds ${i}px around a tap button — tap buttons space themselves`;f=e}let p=f.parentElement;if(p){let e=n.getComputedStyle(p),t=/flex|grid/.test(e.display),r=Array.from(p.children).filter(e=>e!==f&&$u(e,n));if(t&&r.length>0){let t=X(e.display.includes(`grid`)||!e.flexDirection.startsWith(`column`)?e.columnGap:e.rowGap);if(t>.5)return`${Z(p)} adds a ${t}px gap between tap buttons — remove it; tap buttons space themselves`}}return null}var rd=new Set;function id(e,t){e.setAttribute(`data-matrx-tap-violation`,t);let n=`${t}@${e.getAttribute(`aria-label`)??e.textContent??``}`;rd.has(n)||(rd.add(n),console.error(`[tap-target] ${t}`,e))}var ad=new Set,od=null,sd=!1;function cd(e){let t=nd(e);t?id(e,t):e.removeAttribute(`data-matrx-tap-violation`)}function ld(e){sd||(sd=!0,e.addEventListener(`resize`,()=>{od&&clearTimeout(od),od=setTimeout(()=>ad.forEach(e=>e.isConnected?cd(e):ad.delete(e)),200)}))}function ud(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function dd(e,t){let n=(0,_.useRef)(null);return(0,_.useCallback)(r=>{if(ud(e,r),n.current&&n.current!==r&&ad.delete(n.current),n.current=r,!Wu()||!r)return;if(t){id(r,t);return}let i=r.ownerDocument.defaultView;i&&(ad.add(r),ld(i),i.requestAnimationFrame(()=>cd(r)))},[e,t])}var fd={default:`text-foreground`,muted:`text-muted-foreground group-hover/tap:text-foreground`,primary:`text-primary`,destructive:`text-destructive`,success:`text-success`,warning:`text-warning`,info:`text-info`},pd={primary:{fill:`bg-primary group-hover/tap:bg-primary/85`,glyph:`text-primary-foreground`},destructive:{fill:`bg-destructive group-hover/tap:bg-destructive/85`,glyph:`text-destructive-foreground`},success:{fill:`bg-success group-hover/tap:bg-success/85`,glyph:`text-success-foreground`},warning:{fill:`bg-warning group-hover/tap:bg-warning/85`,glyph:`text-warning-foreground`},neutral:{fill:`bg-foreground group-hover/tap:bg-foreground/85`,glyph:`text-background`}},md=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function hd(e){let t=e.toLowerCase().split(`+`),n=t.pop()??``;return{mod:t.includes(`mod`),shift:t.includes(`shift`),alt:t.includes(`alt`),key:n}}function gd(e){let t=hd(e),n=t.key.length===1?t.key.toUpperCase():t.key[0].toUpperCase()+t.key.slice(1);return md?`${t.alt?`⌥`:``}${t.shift?`⇧`:``}${t.mod?`⌘`:``}${n}`:[t.mod&&`Ctrl`,t.alt&&`Alt`,t.shift&&`Shift`,n].filter(Boolean).join(`+`)}function _d(e){let t=e;return!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function vd(e,t){let n=hd(t);return(e.metaKey||e.ctrlKey)!==n.mod||e.altKey!==n.alt||/^[a-z0-9]$|^[a-z]{2,}$/.test(n.key)&&e.shiftKey!==n.shift||!n.mod&&_d(e.target)?!1:e.key.toLowerCase()===n.key}function yd(e,t,n){(0,_.useEffect)(()=>{if(!e||!n)return;let r=n=>{if(!vd(n,e))return;let r=t();r&&r.isConnected&&(n.preventDefault(),r.click())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,n,t])}function bd({badge:e}){return e===`dot`?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,"data-dot":``}):e<=0?null:(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,children:e>99?`99+`:e})}function xd({className:e}){return(0,j.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,j.jsx)(`circle`,{className:xu,cx:`12`,cy:`12`,r:`9`,strokeDasharray:`28.27`,strokeDashoffset:`9`,strokeLinecap:`round`,style:{transformOrigin:`12px 12px`}})})}function Sd(){return(0,j.jsx)(`svg`,{className:`matrx-tap-chevron`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function Cd(e,t){return t?(0,j.jsxs)(`span`,{className:`matrx-tap-tooltip`,children:[e,(0,j.jsx)(`kbd`,{className:`matrx-tap-kbd`,children:gd(t)})]}):e}var wd=Symbol.for(`@ai-matrx/tap-target:link-component`);function Td(){return globalThis[wd]??null}var Ed=/^(https?:|mailto:|tel:)/i,Dd=`matrx-tap-target group group/tap`,Od=`matrx-tap-target matrx-tap-target-sm group group/tap`;function kd({icon:e,children:t,strokeWidth:n=2,className:r}){return e?(0,_.isValidElement)(e)?(0,_.cloneElement)(e,{className:Hu(r,e.props.className)}):(0,j.jsx)(`span`,{className:r,children:e}):(0,j.jsx)(`svg`,{className:r,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function Ad(e,t,n){let r=!!e;return t===`sm`?{outerClassName:r&&n?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap`:r?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap`:Od,inlineModifier:n?`matrx-tap-pill-mobile-icon-only-sm`:`matrx-tap-pill-inline-sm`}:{outerClassName:r&&n?`${Dd} matrx-tap-target-mobile-icon-only`:r?`${Dd} matrx-tap-target-inline`:Dd,inlineModifier:n?`matrx-tap-pill-mobile-icon-only`:`matrx-tap-pill-inline`}}function jd({label:e,pillClassName:t,iconClassName:n,labelClassName:r,inlineModifier:i,icon:a,children:o,strokeWidth:s=2,loading:c,chevron:l}){let u=c?(0,j.jsx)(xd,{className:n}):(0,j.jsx)(kd,{icon:a,strokeWidth:s,className:n,children:o}),d=e?`${t} ${i}`.trim():t;return e?(0,j.jsxs)(`div`,{className:d,children:[u,(0,j.jsx)(`span`,{className:r??`matrx-tap-label`,children:e}),l?(0,j.jsx)(Sd,{}):null]}):(0,j.jsx)(`div`,{className:d,children:u})}function Md({size:e=`default`,colorClassName:t,pillClassName:n,iconClassName:r,labelClassName:i,icon:a,children:o,strokeWidth:s,label:c,mobileIconOnly:l=!1,onClick:u,as:d,htmlFor:f,ariaLabel:p,disabled:m,href:h,target:g,rel:v,prefetch:y,linkComponent:b,tooltip:x,tooltipSide:S,tooltipAlign:C,rest:w,buttonRef:T}){let{tone:E,badge:D,pressed:O,loading:k,disabledReason:A,shortcut:M,chevron:N,...P}=w??{},F=!!(m||A),I=A||(typeof x==`string`&&x?x:void 0)||p||c,L=x===!1,ee=dd(T,(I?null:`every tap button needs a tooltip — pass ariaLabel`)??Xu(t??P.className)??(P.style?`style is not supported on a tap button`:null)),te=(0,_.useRef)(null),ne=(0,_.useCallback)(e=>{te.current=e,ee(e)},[ee]);yd(M,(0,_.useCallback)(()=>te.current,[]),!F&&!k);let re=E?fd[E]:O&&!t?fd.primary:null;re&&(r=`matrx-tap-icon ${re}`,i=`matrx-tap-label ${re}`),O&&(n=`${n} matrx-tap-pressed`);let{outerClassName:ie,inlineModifier:ae}=Ad(c,e,l),oe=l?`${i??`matrx-tap-label`} matrx-tap-label-mobile-icon-only`:i,se=jd({label:c,pillClassName:n,iconClassName:r,labelClassName:oe,inlineModifier:c?ae:``,icon:a,children:o,strokeWidth:s,loading:k,chevron:N}),ce=Nd({href:h,target:g,rel:v,prefetch:y,linkComponent:b,as:d,htmlFor:f,onClick:k?void 0:u,ariaLabel:c&&!l?void 0:p??c,disabled:F,outerClassName:ie,title:L&&I?M?`${I} (${gd(M)})`:I:void 0,children:(0,j.jsxs)(j.Fragment,{children:[se,D===void 0?null:(0,j.jsx)(bd,{badge:D})]}),rest:{...P,...O===void 0?{}:{"aria-pressed":O},...k?{"aria-busy":!0}:{},...M?{"aria-keyshortcuts":M.replace(/mod/i,`Meta`)}:{}},triggerRef:ne});return L||!I?ce:Pd(ce,{tooltip:I,ariaLabel:I,disabled:F,tooltipSide:S,tooltipAlign:C,shortcut:M})}function Nd({href:e,target:t,rel:n,prefetch:r,linkComponent:i,as:a,htmlFor:o,onClick:s,ariaLabel:c,disabled:l,outerClassName:u,children:d,rest:f,triggerRef:p,title:m}){let{style:h,...g}=f??{};if(l&&e)return(0,j.jsx)(`span`,{ref:p,"aria-disabled":`true`,"aria-label":c,title:m,className:`${u} opacity-40 pointer-events-none`,children:d});if(e){if(Ed.test(e))return(0,j.jsx)(`a`,{ref:p,href:e,target:t??`_blank`,rel:n??`noopener noreferrer`,"aria-label":c,title:m,className:u,children:d});let a=i??Td();return a?(0,j.jsx)(a,{ref:p,href:e,target:t,rel:n,prefetch:r,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`a`,{ref:p,href:e,target:t,rel:n,"aria-label":c,title:m,className:u,children:d})}return a===`label`?(0,j.jsx)(`label`,{ref:p,htmlFor:o,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`button`,{ref:p,type:`button`,onClick:s,"aria-label":c,title:m,disabled:l,...g,className:u,children:d})}function Pd(e,{tooltip:t,ariaLabel:n,disabled:r,tooltipSide:i=`top`,tooltipAlign:a=`center`,shortcut:o}){if(t===!1)return e;let s=typeof t==`string`&&t.length>0?t:n;return s?(0,j.jsxs)(zu,{children:[(0,j.jsx)(Bu,{asChild:!0,children:r?(0,j.jsx)(`span`,{className:`inline-flex`,children:e}):e}),(0,j.jsx)(Vu,{side:i,align:a,children:Cd(s,o)})]}):e}var Fd=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-glass-thin-border`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})});(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-muted-foreground group-hover/tap:text-foreground`;return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});var Id=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tone:p,bgColor:m,iconColor:h,hoverBgColor:g,activeBgColor:_,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...C},w){return Md({icon:e,children:t,strokeWidth:n,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...Ld(p,m,h,g,_),rest:C,buttonRef:w})});function Ld(e,t,n,r,i){if(!(!e&&(t||n||r||i))){let t=pd[e??`primary`];return{pillClassName:`matrx-tap-pill ${t.fill} ${t.glyph} group-active/tap:brightness-90`,iconClassName:`matrx-tap-icon ${t.glyph}`,labelClassName:`matrx-tap-label ${t.glyph}`}}let a=n??`text-primary-foreground`;return{pillClassName:`matrx-tap-pill ${t??`bg-primary`} ${a} ${r??`group-hover/tap:bg-primary/80`} ${i??`group-active/tap:brightness-90`}`,iconClassName:`matrx-tap-icon ${a}`,labelClassName:`matrx-tap-label ${a}`}}(0,_.forwardRef)(function({tone:e=`destructive`,...t},n){return(0,j.jsx)(Id,{ref:n,tone:e,...t})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-foreground`;return Md({colorClassName:i,size:`sm`,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});function Rd(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0),r=(0,_.useRef)(!1),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=48,[]),l=(0,_.useCallback)(e=>{r.current=!0,e.scrollTop=e.scrollHeight},[]),u=(0,_.useCallback)(()=>{let e=t.current;if(e===null)return;if(r.current){r.current=!1;return}let i=c(e);n.current=i,a(i),i&&s(!1)},[c]),d=(0,_.useCallback)(e=>{let n=t.current;n!==null&&n.removeEventListener(`scroll`,u),t.current=e,e!==null&&e.addEventListener(`scroll`,u,{passive:!0})},[u]);(0,_.useEffect)(()=>()=>{let e=t.current;e!==null&&e.removeEventListener(`scroll`,u)},[u]);let f=(0,_.useCallback)(()=>{let r=t.current;if(r!==null&&e){if(n.current){l(r);return}s(!0)}},[e,l]);return{ref:d,pinned:i,hasUnseenBelow:o,jumpToLatest:(0,_.useCallback)(()=>{let e=t.current;e!==null&&(l(e),n.current=!0,a(!0),s(!1))},[l]),onContentChange:f}}function zd(e){let t=[],n=``,r=0;for(let i of bt(e)){if(i.start<r)continue;n+=e.slice(r,i.start);let a=e.slice(i.start,i.end);t.push(i.kind===`fence`?` code block `:Bd(a)),n+=`\uE300${t.length-1}\uE301`,r=i.end}return n+=e.slice(r),n.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}([*+-]|\d+\.)\s+/gm,``).replace(/(\*\*\*|___)(.+?)\1/g,`$2`).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(\*|_)(.+?)\1/g,`$2`).replace(/~~(.+?)~~/g,`$1`).replace(/^\s{0,3}([-*_]\s?){3,}$/gm,``).replace(/\uE300(\d+)\uE301/g,(e,n)=>t[Number(n)]??``).replace(/[ \t]{2,}/g,` `)}function Bd(e){let t=/^`+/.exec(e)?.[0].length??0,n=e.slice(t,e.length-t);return/^ .* $/s.test(n)&&n.trim()?n.slice(1,-1):n}var Vd=`Your message could not be copied.`,Hd=`Select the text and copy it with your keyboard — this browser did not allow the page to use the clipboard.`,Ud=2e3;function Wd(e){let{message:t}=e,{notifier:n}=Wr(),r=Gr(),{thread:i,retry:a}=Br(),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=(0,_.useCallback)((e,t)=>{let r=globalThis.navigator?.clipboard,i=r?.writeText?.bind(r);if(i===void 0){n.notify({level:`warning`,message:Vd,remedy:Hd});return}i(e).then(()=>{s(t),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>s(null),Ud)},()=>{n.notify({level:`warning`,message:Vd,remedy:Hd})})},[n]);if(t.status===`streaming`||t.status===`pending`)return null;let u=C(t),d=r.messageActions?.(t),f=t.role===`user`,p=f?``:Jr(i.getSnapshot().messages,t.id);return u===``&&d===void 0?null:(0,j.jsxs)(`div`,{className:`mx-chat-actions`,role:`group`,"aria-label":f?`Actions for your message`:`Actions for this answer`,"data-message-id":t.id,children:[u===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-text`,onClick:()=>l(zd(u),`text`),children:o===`text`?`Copied`:`Copy`}),u===``||f?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-markdown`,onClick:()=>l(u,`markdown`),children:o===`markdown`?`Copied`:`Copy as markdown`}),p===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`retry`,onClick:()=>void i.send({text:p}),children:`Ask again`}),f&&u!==``?(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`edit`,onClick:()=>a.request(u),children:`Edit and send again`}):null,d,o===null?null:(0,j.jsx)(`span`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:`Copied to the clipboard`})]})}var Gd=Object.defineProperty,Kd=(e,t)=>Gd(e,`name`,{value:t,configurable:!0});function qd(e){let t=e+`CollectionProvider`,[n,r]=di(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Kd(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,j.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=hi(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=V(t,a(s,n).collectionRef);return(0,j.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=hi(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=V(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,j.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Kd(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Kd(qd,`createCollection`);var Jd=new WeakMap,Yd=class e extends Map{static{Kd(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Jd.set(this,!0)}set(e,t){return Jd.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Qd(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Xd(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Xd(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Xd(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Xd(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Zd(e,t);return n===-1?void 0:e[n]}Kd(Xd,`at`);function Zd(e,t){let n=e.length,r=Qd(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Kd(Zd,`toSafeIndex`);function Qd(e){return e!==e||e===0?0:Math.trunc(e)}Kd(Qd,`toSafeInteger`);function $d(e){let t=e+`CollectionProvider`,[n,r]=di(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Yd,setItemMap:Kd(()=>void 0,`setItemMap`)}),o=Kd(({state:e,...t})=>e?(0,j.jsx)(c,{...t,state:e}):(0,j.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Kd(e=>{let t=h();return(0,j.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Kd(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=V(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=rf(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,j.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=hi(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=V(t,a(l,n).collectionRef);return(0,j.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=hi(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=V(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);ef(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(nf):(t.set(s,{...e,element:s}),t.toSorted(nf)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Yd(e)))}},[s,m,u]),(0,j.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new Yd)}Kd(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Kd(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Kd($d,`createCollection`);function ef(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Kd(ef,`shallowEqual`);function tf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Kd(tf,`isElementPreceding`);function nf(e,t){return!e[1].element||!t[1].element?0:tf(e[1].element,t[1].element)?-1:1}Kd(nf,`sortByDocumentPosition`);function rf(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Kd(rf,`getChildListObserver`);var af=Object.defineProperty,of=(e,t)=>af(e,`name`,{value:t,configurable:!0}),sf=_.createContext(void 0);function cf(e){let t=_.useContext(sf);return e||t||`ltr`}of(cf,`useDirection`);function lf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...e}}function uf(e){return(0,j.jsxs)(`svg`,{...lf(e),children:[(0,j.jsx)(`path`,{d:`M18 6 6 18`}),(0,j.jsx)(`path`,{d:`m6 6 12 12`})]})}function df(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 15 15`,width:15,height:15,fill:`none`,"aria-hidden":!0,...e}}function ff(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function pf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:`currentColor`})})}function mf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function hf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function gf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var _f=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,vf=Kc,yf=(e,t)=>n=>{if(t?.variants==null)return vf(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=_f(t)||_f(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return vf(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},bf=Object.defineProperty,xf=(e,t)=>bf(e,`name`,{value:t,configurable:!0}),Sf=`focusScope.autoFocusOnMount`,Cf=`focusScope.autoFocusOnUnmount`,wf={bubbles:!1,cancelable:!0},Tf=_.forwardRef(xf(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Fi(i),u=Fi(a),d=_.useRef(null),f=V(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Mf(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Mf(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Mf(s)};xf(e,`handleFocusIn`),xf(t,`handleFocusOut`),xf(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){Nf.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Sf,wf);s.addEventListener(Sf,l),s.dispatchEvent(t),t.defaultPrevented||(Ef(If(Of(s)),{select:!0}),document.activeElement===e&&Mf(s))}return()=>{s.removeEventListener(Sf,l),setTimeout(()=>{let t=new CustomEvent(Cf,wf);s.addEventListener(Cf,u),s.dispatchEvent(t),t.defaultPrevented||Mf(e??document.body,{select:!0}),s.removeEventListener(Cf,u),Nf.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Df(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Mf(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Mf(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(H.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Ef(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Mf(r,{select:t}),document.activeElement!==n)return}xf(Ef,`focusFirst`);function Df(e){let t=Of(e);return[kf(t,e),kf(t.reverse(),e)]}xf(Df,`getTabbableEdges`);function Of(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:xf(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}xf(Of,`getTabbableCandidates`);function kf(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Af(r,{upTo:t})))return r}xf(kf,`findVisible`);function Af(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}xf(Af,`isHidden`);function jf(e){return e instanceof HTMLInputElement&&`select`in e}xf(jf,`isSelectableInput`);function Mf(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jf(e)&&t&&e.select()}}xf(Mf,`focus`);var Nf=Pf();function Pf(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ff(e,t),e.unshift(t)},remove(t){e=Ff(e,t),e[0]?.resume()}}}xf(Pf,`createFocusScopesStack`);function Ff(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}xf(Ff,`arrayRemove`);function If(e){return e.filter(e=>e.tagName!==`A`)}xf(If,`removeLinks`);var Lf=Object.defineProperty,Rf=(e,t)=>Lf(e,`name`,{value:t,configurable:!0}),zf=0,Bf=null;function $(e){return Vf(),e.children}Rf($,`FocusGuards`);function Vf(){_.useEffect(()=>{Bf||={start:Hf(),end:Hf()};let{start:e,end:t}=Bf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),zf++,()=>{zf===1&&(Bf?.start.remove(),Bf?.end.remove(),Bf=null),zf=Math.max(0,zf-1)}},[])}Rf(Vf,`useFocusGuards`);function Hf(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Rf(Hf,`createFocusGuard`);var Uf=function(){return Uf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Uf.apply(this,arguments)};function Wf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Gf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Kf=`right-scroll-bar-position`,qf=`width-before-scroll-bar`,Jf=`with-scroll-bars-hidden`,Yf=`--removed-body-scroll-bar-size`;function Xf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zf(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Qf=typeof window<`u`?_.useLayoutEffect:_.useEffect,$f=new WeakMap;function ep(e,t){var n=Zf(t||null,function(t){return e.forEach(function(e){return Xf(e,t)})});return Qf(function(){var t=$f.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xf(e,null)}),i.forEach(function(e){r.has(e)||Xf(e,a)})}$f.set(n,e)},[e]),n}function tp(e){return e}function np(e,t){t===void 0&&(t=tp);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function rp(e){e===void 0&&(e={});var t=np(null);return t.options=Uf({async:!0,ssr:!1},e),t}var ip=function(e){var t=e.sideCar,n=Wf(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Uf({},n))};ip.isSideCarExport=!0;function ap(e,t){return e.useMedium(t),ip}var op=rp(),sp=function(){},cp=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:sp,onWheelCapture:sp,onTouchMoveCapture:sp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=ep([n,t]),w=Uf(Uf({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:op,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Uf(Uf({},w),{ref:C})):_.createElement(y,Uf({},w,{className:c,ref:C}),s))});cp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cp.classNames={fullWidth:qf,zeroRight:Kf};var lp=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function up(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lp();return t&&e.setAttribute(`nonce`,t),e}function dp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fp(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=up())&&(dp(t,n),fp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mp=function(){var e=pp();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hp=function(){var e=mp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gp={left:0,top:0,right:0,gap:0},_p=function(e){return parseInt(e||``,10)||0},vp=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[_p(n),_p(r),_p(i)]},yp=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gp;var t=vp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bp=hp(),xp=`data-scroll-locked`,Sp=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
16
|
+
`)})}return{blocks:r,openFrom:n[a]??0}}function dr(){let e=new Map,t=0,n=(n,r)=>{t+=1;let i=ur(r);return e.set(n,{text:r,blocks:i.blocks,stable:i.blocks.slice(0,Math.max(0,i.blocks.length-1)),stableEnd:i.openFrom}),i.blocks};return{get parses(){return t},forget(t){e.delete(t)},parse(r,i){let a=e.get(r);if(a===void 0)return n(r,i);if(a.text===i)return a.blocks;if(!i.startsWith(a.text))return n(r,i);t+=1;let o=ur(i.slice(a.stableEnd)),s=[...a.stable,...o.blocks];return e.set(r,{text:i,blocks:s,stable:s.slice(0,Math.max(0,s.length-1)),stableEnd:a.stableEnd+o.openFrom}),s}}}function fr(e,t){switch(e.type){case`code`:return(0,j.jsx)(`pre`,{className:`mx-chat-md__pre`,"data-language":e.language||void 0,children:(0,j.jsx)(`code`,{children:e.body})},t);case`heading`:{let n=Math.min(6,Math.max(1,e.level)),r=`h${n}`;return(0,j.jsx)(r,{className:`mx-chat-md__heading`,"data-level":n,children:nr(e.body,`${t}-`)},t)}case`quote`:return(0,j.jsx)(`blockquote`,{className:`mx-chat-md__quote`,children:nr(e.body,`${t}-`)},t);case`list`:return e.ordered?(0,j.jsx)(`ol`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:nr(e,`${t}-${n}-`)},`${t}-${n}`))},t):(0,j.jsx)(`ul`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:nr(e,`${t}-${n}-`)},`${t}-${n}`))},t);case`table`:return(0,j.jsx)(`div`,{className:`mx-chat-md__table-scroll`,children:(0,j.jsxs)(`table`,{className:`mx-chat-md__table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:e.header.map((e,n)=>(0,j.jsx)(`th`,{children:nr(e,`${t}-h${n}-`)},`${t}-h${n}`))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,j.jsx)(`tr`,{children:e.map((e,r)=>(0,j.jsx)(`td`,{children:nr(e,`${t}-r${n}c${r}-`)},`${t}-r${n}c${r}`))},`${t}-r${n}`))})]})},t);case`rule`:return(0,j.jsx)(`hr`,{className:`mx-chat-md__rule`},t);case`paragraph`:return(0,j.jsx)(`p`,{className:`mx-chat-md__paragraph`,children:nr(e.body,`${t}-`)},t)}}function pr(e){let t=e.cache.parse(e.cacheKey,e.text);return(0,j.jsx)(`div`,{className:`mx-chat-md`,children:t.map((e,t)=>fr(e,`b${t}`))})}var mr=`This answer contains a structured block, and it is shown as plain text here because this app has not connected the content renderer.`,hr=`Mount <ContentIrRenderProvider host={…}> from @ai-matrx/content-ir-react above your chat to draw structured blocks properly.`;function gr(e){let t=te(),n=e.announce;return(0,_.useEffect)(()=>{t===null&&n()},[t,n]),t===null?(0,j.jsxs)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block-standin`,children:[(0,j.jsx)(`span`,{className:`mx-chat-standin`,children:mr}),(0,j.jsx)(pr,{text:e.request.text,cacheKey:`${e.request.messageId}:${e.request.kind}`,cache:e.cache})]}):(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block`,"data-kind":e.request.kind,children:(0,j.jsx)(Jn,{kind:e.request.kind,value:e.request.data??e.request.text,variant:`bare`})})}function _r(e={}){let t=e.notifier??D(),n=e.cache??dr(),r=!1,i=()=>{r||(r=!0,t.notify({level:`warning`,message:mr,remedy:hr}))};return function(e){return e.kind!==`markdown`&&e.kind!==`text`?(0,j.jsx)(gr,{request:e,cache:n,notifier:t,announce:i}):e.text===``?null:(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`markdown`,children:(0,j.jsx)(pr,{text:e.text,cacheKey:e.messageId,cache:n})})}}function vr(e){return!!(/[zZ]$/.test(e)||/[+-]\d{2}(:?\d{2})?$/.test(e)||/\b(GMT|UTC)\b/i.test(e))}function yr(e){let t=e.trim();return!t||!/\d{1,2}:\d{2}/.test(t)||vr(t)?t:`${t.replace(` `,`T`)}Z`}function br(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=yr(e);if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var xr={year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};function Sr(e,t=xr,n=`—`){let r=br(e);return r?r.toLocaleString(void 0,t):n}var Cr=[{limit:6e4,divisor:1e3,short:`s`,long:`second`},{limit:36e5,divisor:6e4,short:`m`,long:`minute`},{limit:864e5,divisor:36e5,short:`h`,long:`hour`},{limit:6048e5,divisor:864e5,short:`d`,long:`day`},{limit:2592e6,divisor:6048e5,short:`w`,long:`week`},{limit:31536e6,divisor:2592e6,short:`mo`,long:`month`}],wr=[{unit:`year`,ms:31536e6},{unit:`month`,ms:2592e6},{unit:`week`,ms:6048e5},{unit:`day`,ms:864e5},{unit:`hour`,ms:36e5},{unit:`minute`,ms:6e4}];function Tr(e,t={}){let n=t.style??`short`,r=t.suffix===!1,i=t.now??Date.now(),a=br(e);if(!a)return t.fallbackToInput===!0&&typeof e==`string`?e:t.fallback??`—`;if(n===`intl`){let e=a.getTime()-i,t=Math.abs(e);if(t<6e4)return`just now`;let n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let{unit:r,ms:i}of wr)if(t>=i)return n.format(Math.trunc(e/i),r);return`just now`}let o=i-a.getTime(),s=o<0;if(s&&-o<6e4)return`just now`;let c=Math.abs(o);for(let e of Cr)if(c<e.limit){let t=Math.max(1,Math.floor(c/e.divisor)),i=n===`long`?`${t} ${e.long}${t===1?``:`s`}`:`${t}${e.short}`;return r?i:s?`in ${i}`:`${i} ago`}return(t.absolute??(r?`date`:`datetime`))===`date`?a.toLocaleDateString():Sr(a)}var Er=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function Dr(e,t={}){let n=t.fallback??`—`;if(e==null||!Number.isFinite(e)||e<0)return n;if(e<1024)return`${Math.round(e)} B`;let r=e,i=0;for(;r>=1024&&i<Er.length-1;)r/=1024,i+=1;return`${r>=10?String(Math.round(r)):r.toFixed(1)} ${Er[i]}`}function Or(e){return typeof e==`number`&&Number.isFinite(e)}function kr(e,t={}){let{digits:n=2,unknown:r=`—`}=t;if(!Or(e))return r;let i;if(n===`adaptive`||n===`trim`){let t=Math.abs(e);i=t===0||t>=1?2:t>=.01?4:6}else i=n;return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n===`trim`?Math.min(2,i):i,maximumFractionDigits:i})}`}var Ar=[``,`k`,`M`,`B`,`T`];function jr(e,t={}){let{unknown:n=`—`,style:r=`plain`,locale:i}=t;if(!Or(e))return n;if(r!==`compact`)return e.toLocaleString(i);let a=e<0?`-`:``,o=Math.abs(e);if(o<1e3)return`${a}${Math.round(o)}`;let s=0;for(;o>=1e3&&s<Ar.length-1;)o/=1e3,s+=1;let c=o>=10?Math.round(o):Number(o.toFixed(1));return c>=1e3&&s<Ar.length-1&&(o/=1e3,s+=1,c=o>=10?Math.round(o):Number(o.toFixed(1))),`${a}${o>=10?String(c):c.toFixed(1)}${Ar[s]}`}var Mr=`Attachments aren't set up here, so this file has not been sent.`,Nr="Give <ChatComposerProvider> a `files` port (your upload service) to attach files to a message.";function Pr(e){let t=!1;return{available:!1,upload(){return t||(t=!0,e.notify({level:`warning`,message:Mr,remedy:Nr})),Promise.reject(Error(Mr))}}}function Fr(e,t){return`${e} is larger than the ${Dr(t)} limit for this chat, so it has not been attached.`}function Ir(e){let t=e.replace(/[._-]+/g,` `).replace(/([a-z\d])([A-Z])/g,`$1 $2`).trim().toLowerCase();return t===``?`Working…`:t.charAt(0).toUpperCase()+t.slice(1)}function Lr(e){let t=new Set;return{request(n){if(t.size===0)return e.notify({level:`warning`,message:`There is nowhere to put your message back, so it has not been restored for you.`,remedy:`Copy your message from the conversation above and send it again, or mount this transcript inside a chat that has a message box.`}),!1;for(let e of t)e(n);return!0},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var Rr=(0,_.createContext)(null);function zr(e){let{thread:t,ports:n,slots:r,children:i}=e,[a]=(0,_.useState)(()=>{let e=D();return{notifier:e,prefs:k(e)}}),o=n?.notifier??a.notifier,s=(0,_.useRef)(null);(s.current===null||s.current.notifier!==o)&&(s.current={notifier:o,bus:Lr(o),renderContent:_r({notifier:o}),files:Pr(o)});let c=s.current.bus,l=s.current.renderContent,u=s.current.files,d=(0,_.useMemo)(()=>({thread:t,ports:{renderContent:n?.renderContent??l,notifier:o,prefs:n?.prefs??a.prefs,files:n?.files??u,voice:n?.voice??null,toolLabel:n?.toolLabel??Ir,modelPicker:n?.modelPicker??null,quickset:n?.quickset??null},slots:r??{},retry:c}),[t,n?.renderContent,n?.prefs,n?.files,n?.voice,n?.toolLabel,n?.modelPicker,n?.quickset,o,r,c,l,u,a.prefs]),f=(0,_.useRef)(t);return(0,_.useEffect)(()=>{if(f.current===t)return;let e=f.current.getSnapshot().status;(e===`streaming`||e===`submitted`)&&o.notify({level:`warning`,message:`The previous answer was still arriving when this chat switched conversations.`,remedy:`Stop the answer before switching, or the run keeps going in the background.`}),f.current=t},[t,o]),(0,j.jsx)(Rr.Provider,{value:d,children:i})}function Br(){let e=(0,_.useContext)(Rr);if(e===null)throw Error(`[@ai-matrx/chat] This component must be rendered inside <ChatProvider thread={…}>. Wrap your chat surface in one, passing a thread from createChatThread() or createExternalThreadSource().`);return e}function Vr(){let{thread:e}=Br(),t=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),n=(0,_.useCallback)((t,n)=>e.send(n===void 0?{text:t}:{text:t,fileIds:n}),[e]),r=(0,_.useCallback)(()=>e.cancel(),[e]);return(0,_.useMemo)(()=>({snapshot:t,messages:t.messages,status:t.status,isBusy:t.status===`submitted`||t.status===`streaming`,conversationId:t.conversationId,ephemeral:t.ephemeral,ephemeralReason:t.ephemeralReason,error:t.error,send:n,cancel:r}),[t,n,r])}function Hr(e){let{thread:t}=Br(),n=(0,_.useCallback)(n=>t.subscribeToMessage(e,n),[t,e]),r=(0,_.useCallback)(()=>t.getMessageSnapshot(e),[t,e]);return(0,_.useSyncExternalStore)(n,r,r)}function Ur(){return Br().thread.features}function Wr(){return Br().ports}function Gr(){return Br().slots}var Kr=`ai-matrx.chat.draft.`;function qr(){let{thread:e,ports:t,retry:n}=Br(),r=e.features,i=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),a=i.conversationId,o=i.status===`submitted`||i.status===`streaming`,s=`${Kr}${a??`new`}`,[c,l]=(0,_.useState)(()=>r.retainDrafts?t.prefs.get(s)??``:``),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(s);(0,_.useEffect)(()=>{if(f.current===s)return;let e=f.current;if(f.current=s,!r.retainDrafts)return;let n=t.prefs.get(e);if(n!==null&&n!==``){t.prefs.set(s,n),t.prefs.remove(e),l(n);return}l(t.prefs.get(s)??``)},[s,r.retainDrafts,t.prefs]);let p=(0,_.useCallback)(e=>{l(e),d(!1),r.retainDrafts&&(e===``?t.prefs.remove(f.current):t.prefs.set(f.current,e))},[r.retainDrafts,t.prefs]);(0,_.useEffect)(()=>n.subscribe(e=>{l(e),d(!0),r.retainDrafts&&t.prefs.set(f.current,e)}),[n,r.retainDrafts,t.prefs]);let m=(0,_.useCallback)(async()=>{let n=c.trim();if(n===``||o&&!r.sendWhileBusy)return null;l(``),d(!1),r.retainDrafts&&t.prefs.remove(f.current);let i=await e.send({text:n});return i.accepted||(l(n),r.retainDrafts&&t.prefs.set(f.current,n)),i},[c,o,e,r.retainDrafts,r.sendWhileBusy,t.prefs]),h=(0,_.useCallback)(()=>e.cancel(),[e]),g=(0,_.useCallback)(t=>{if(t.key===`Escape`){if(!o)return;t.preventDefault(),e.cancel();return}if(t.key!==`Enter`)return;let n=t.metaKey||t.ctrlKey;(r.sendKey===`enter`?!t.shiftKey&&!n:n)&&(t.preventDefault(),m())},[r.sendKey,o,m,e]);return{text:c,setText:p,canSend:c.trim()!==``&&(!o||r.sendWhileBusy),isBusy:o,send:m,stop:h,onKeyDown:g,restoredFromFailure:u}}function Jr(e,t){let n=e.findIndex(e=>e.id===t);if(n<=0)return``;for(let t=n-1;t>=0;--t){let n=e[t];if(n&&n.role===`user`)return C(n)}return``}function Yr(){return(0,j.jsx)(`svg`,{className:`mx-chat-chevron`,width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})}function Xr(){return(0,j.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})})}var Zr=Object.defineProperty,Qr=(e,t)=>Zr(e,`name`,{value:t,configurable:!0}),$r=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Qr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Qr(B,`composeEventHandlers`);function ei(e){if(!$r)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Qr(ei,`getOwnerWindow`);function ti(e){if(!$r)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Qr(ti,`getOwnerDocument`);function ni(e,t=!1){let{activeElement:n}=ti(e);if(!n?.nodeName)return null;if(ri(n)&&n.contentDocument)return ni(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ti(n).getElementById(e);if(t)return t}}return n}Qr(ni,`getActiveElement`);function ri(e){return e.tagName===`IFRAME`}Qr(ri,`isFrame`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0});function oi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ai(oi,`setRef`);function si(...e){return t=>{let n=!1,r=e.map(e=>{let r=oi(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():oi(e[t],null)}}}}ai(si,`composeRefs`);function V(...e){return _.useCallback(si(...e),e)}ai(V,`useComposedRefs`);var ci=Object.defineProperty,li=(e,t)=>ci(e,`name`,{value:t,configurable:!0});function ui(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=li(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,j.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return li(i,`useContext`),[r,i]}li(ui,`createContext`);function di(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=li(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return li(s,`useContext`),[o,s]}li(r,`createContext`);let i=li(()=>{let t=n.map(e=>_.createContext(e));return li(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,fi(i,...t)]}li(di,`createContextScope`);function fi(...e){let t=e[0];if(e.length===1)return t;let n=li(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return li(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}li(fi,`composeContextScopes`);var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});function hi(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wi(r)&&typeof Oi==`function`&&(r=Oi(r._payload)),_.Children.forEach(r,e=>{if(Si(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wi(n)&&typeof Oi==`function`&&(n=Oi(n._payload)),a=yi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?xi(a):void 0,l=V(n,c);if(!a){if(r||r===0)throw Error(o?Di(e):Ei(e));return r}let u=bi(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mi(hi,`createSlot`);var gi=hi(`Slot`),_i=Symbol.for(`radix.slottable`);function vi(e){let t=mi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_i,t}mi(vi,`createSlottable`);var yi=mi((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function bi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}mi(bi,`mergeProps`);function xi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}mi(xi,`getElementRef`);function Si(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_i}mi(Si,`isSlottable`);var Ci=Symbol.for(`react.lazy`);function wi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ci&&`_payload`in e&&Ti(e._payload)}mi(wi,`isLazyComponent`);function Ti(e){return typeof e==`object`&&!!e&&`then`in e}mi(Ti,`isPromiseLike`);var Ei=mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Di=mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Oi=_.use,ki=c(m(),1),Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hi(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mi(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}ji(Mi,`dispatchDiscreteCustomEvent`);var Ni=Object.defineProperty,Pi=(e,t)=>Ni(e,`name`,{value:t,configurable:!0});function Fi(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Pi(Fi,`useCallbackRef`);var Ii=Object.defineProperty,Li=(e,t)=>Ii(e,`name`,{value:t,configurable:!0}),Ri=`dismissableLayer.update`,zi=`dismissableLayer.pointerDownOutside`,Bi=`dismissableLayer.focusOutside`,Vi,Hi=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ui=_.forwardRef(Li(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Hi),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=V(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Ki(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=qi(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Fi(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Vi=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ji(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Vi))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ji())},[d,u]),_.useEffect(()=>{let e=Li(()=>m({}),`handleUpdate`);return document.addEventListener(Ri,e),()=>document.removeEventListener(Ri,e)},[]),(0,j.jsx)(H.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:B(e.onFocusCapture,T.onFocusCapture),onBlurCapture:B(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:B(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Wi(){let e=_.useContext(Hi),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Li(Wi,`useDismissableLayerSurface`);var Gi=Li(()=>!0,`IS_TRUE`);function Ki(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Gi}=t,s=Fi(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Li(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Li(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Li(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Li(p,`handleInteractionBubble`);let m=Li(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Yi(zi,s,p,{discrete:!0})};if(Li(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Li(()=>c.current=!0,`onPointerDownCapture`)}}Li(Ki,`usePointerDownOutside`);function qi(e,t=globalThis?.document){let n=Fi(e),r=_.useRef(!1);return _.useEffect(()=>{let e=Li(e=>{e.target&&!r.current&&Yi(Bi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Li(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Li(()=>r.current=!1,`onBlurCapture`)}}Li(qi,`useFocusOutside`);function Ji(){let e=new CustomEvent(Ri);document.dispatchEvent(e)}Li(Ji,`dispatchUpdate`);function Yi(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Mi(i,a):i.dispatchEvent(a)}Li(Yi,`handleAndDispatchCustomEvent`);var Xi=globalThis?.document?_.useLayoutEffect:()=>{},Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=_.useId||(()=>void 0),ea=0;function U(e){let[t,n]=_.useState($i());return Xi(()=>{e||n(e=>e??String(ea++))},[e]),e||(t?`radix-${t}`:``)}Qi(U,`useId`);var W=[`top`,`right`,`bottom`,`left`],ta=Math.min,na=Math.max,ra=Math.round,ia=Math.floor,aa=e=>({x:e,y:e}),oa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sa(e,t,n){return na(e,ta(t,n))}function ca(e,t){return typeof e==`function`?e(t):e}function la(e){return e.split(`-`)[0]}function ua(e){return e.split(`-`)[1]}function da(e){return e===`x`?`y`:`x`}function fa(e){return e===`y`?`height`:`width`}function pa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ma(e){return da(pa(e))}function ha(e,t,n){n===void 0&&(n=!1);let r=ua(e),i=ma(e),a=fa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wa(o)),[o,wa(o)]}function ga(e){let t=wa(e);return[_a(e),t,_a(t)]}function _a(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var va=[`left`,`right`],ya=[`right`,`left`],ba=[`top`,`bottom`],xa=[`bottom`,`top`];function Sa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ya:va:t?va:ya;case`left`:case`right`:return t?ba:xa;default:return[]}}function Ca(e,t,n,r){let i=ua(e),a=Sa(la(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_a)))),a}function wa(e){let t=la(e);return oa[t]+e.slice(t.length)}function Ta(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ea(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ta(e)}function Da(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Oa(e,t,n){let{reference:r,floating:i}=e,a=pa(t),o=ma(t),s=fa(o),c=la(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ka(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ca(t,e),p=Ea(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Da(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Da(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Aa=50,ja=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ka},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oa(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Aa&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oa(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ma=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ca(e,t)||{};if(l==null)return{};let d=Ea(u),f={x:n,y:r},p=ma(i),m=fa(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ta(d[_],T),D=ta(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=sa(E,k,O),j=!c.arrow&&ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Na=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ca(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=la(r),_=pa(o),v=la(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wa(o)]:ga(o)),x=p!==`none`;!d&&x&&b.push(...Ca(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ha(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===pa(t)||T.every(e=>pa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Pa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fa(e){return W.some(t=>e[t]>=0)}var Ia=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ca(e,t);switch(i){case`referenceHidden`:{let e=Pa(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fa(e)}}}case`escaped`:{let e=Pa(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fa(e)}}}default:return{}}}}},La=new Set([`left`,`top`]);async function Ra(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=la(n),s=ua(n),c=pa(n)===`y`,l=La.has(o)?-1:1,u=a&&c?-1:1,d=ca(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var za=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ra(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ba=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ca(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pa(i),p=da(f),m=u[p],h=u[f],g=(e,t)=>sa(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Va=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ca(e,t),u={x:n,y:r},d=pa(i),f=da(d),p=u[f],m=u[d],h=ca(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=La.has(la(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ha=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ca(e,t),c=await i.detectOverflow(t,s),l=la(n),u=ua(n),d=pa(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ta(p-c[m],g),y=ta(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*na(c.left,c.right):S=p-2*na(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ua(){return typeof window<`u`}function Wa(e){return qa(e)?(e.nodeName||``).toLowerCase():`#document`}function Ga(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ka(e){return((qa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qa(e){return Ua()?e instanceof Node||e instanceof Ga(e).Node:!1}function Ja(e){return Ua()?e instanceof Element||e instanceof Ga(e).Element:!1}function Ya(e){return Ua()?e instanceof HTMLElement||e instanceof Ga(e).HTMLElement:!1}function Xa(e){return!Ua()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ga(e).ShadowRoot}function Za(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=co(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Qa(e){return/^(table|td|th)$/.test(Wa(e))}function $a(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var eo=/transform|translate|scale|rotate|perspective|filter/,to=/paint|layout|strict|content/,no=e=>!!e&&e!==`none`,ro;function io(e){let t=Ja(e)?co(e):e;return no(t.transform)||no(t.translate)||no(t.scale)||no(t.rotate)||no(t.perspective)||!oo()&&(no(t.backdropFilter)||no(t.filter))||eo.test(t.willChange||``)||to.test(t.contain||``)}function ao(e){let t=uo(e);for(;Ya(t)&&!so(t);){if(io(t))return t;if($a(t))return null;t=uo(t)}return null}function oo(){return ro??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ro}function so(e){return/^(html|body|#document)$/.test(Wa(e))}function co(e){return Ga(e).getComputedStyle(e)}function lo(e){return Ja(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Wa(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Xa(e)&&e.host||Ka(e);return Xa(t)?t.host:t}function fo(e){let t=uo(e);return so(t)?(e.ownerDocument||e).body:Ya(t)&&Za(t)?t:fo(t)}function po(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fo(e),i=r===e.ownerDocument?.body,a=Ga(r);if(i){let e=mo(a);return t.concat(a,a.visualViewport||[],Za(r)?r:[],e&&n?po(e):[])}return t.concat(r,po(r,[],n))}function mo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ho(e){let t=co(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ya(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ra(n)!==a||ra(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function go(e){return Ja(e)?e:e.contextElement}function _o(e){let t=go(e);if(!Ya(t))return aa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ho(t),o=(a?ra(n.width):n.width)/r,s=(a?ra(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vo=aa(0);function yo(e){let t=Ga(e);return!oo()||!t.visualViewport?vo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ga(e)}function xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=go(e),o=aa(1);t&&(r?Ja(r)&&(o=_o(r)):o=_o(e));let s=bo(a,n,r)?yo(a):aa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ga(a),t=Ja(r)?Ga(r):r,n=e,i=mo(n);for(;i&&t!==n;){let e=_o(i),t=i.getBoundingClientRect(),r=co(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ga(i),i=mo(n)}}return Da({width:u,height:d,x:c,y:l})}function So(e,t){let n=lo(e).scrollLeft;return t?t.left+n:xo(Ka(e)).left+n}function Co(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-So(e,n),y:n.top+t.scrollTop}}function wo(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ka(r),s=t?$a(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=aa(1),u=aa(0),d=Ya(r);if((d||!a)&&((Wa(r)!==`body`||Za(o))&&(c=lo(r)),d)){let e=xo(r);l=_o(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Co(o,c):aa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function To(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Eo(e){let t=lo(e),n=e.ownerDocument.body,r=na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+So(e),o=-t.scrollTop;return co(n).direction===`rtl`&&(a+=na(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Do=25;function Oo(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ga(e),a=Ka(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!oo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(So(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Do&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ko(e,t){let n=xo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_o(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ao(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Oo(e,n,t);else if(t===`document`)r=Eo(Ka(e));else if(Ja(t))r=ko(t,n);else{let n=yo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Da(r)}function jo(e,t){let n=t.get(e);if(n)return n;let r=po(e,[],!1).filter(e=>Ja(e)&&Wa(e)!==`body`),i=null,a=co(e).position===`fixed`,o=a?uo(e):e;for(;Ja(o)&&!so(o);){let e=co(o),t=io(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=uo(o)}return t.set(e,r),r}function Mo(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$a(t)?[]:jo(t,this._c):[].concat(n),r],o=Ao(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ao(t,a[e],i);s=na(n.top,s),c=ta(n.right,c),l=ta(n.bottom,l),u=na(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function No(e){let{width:t,height:n}=ho(e);return{width:t,height:n}}function Po(e,t,n){let r=Ya(t),i=Ka(t),a=n===`fixed`,o=xo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=aa(0);if((r||!a)&&((Wa(t)!==`body`||Za(i))&&(s=lo(t)),r)){let e=xo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=So(i));let l=i&&!r&&!a?Co(i,s):aa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Fo(e){return co(e).position===`static`}function Io(e,t){if(!Ya(e)||co(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ka(e)===n&&(n=n.ownerDocument.body),n}function Lo(e,t){let n=Ga(e);if($a(e))return n;if(!Ya(e)){let t=uo(e);for(;t&&!so(t);){if(Ja(t)&&!Fo(t))return t;t=uo(t)}return n}let r=Io(e,t);for(;r&&Qa(r)&&Fo(r);)r=Io(r,t);return r&&so(r)&&Fo(r)&&!io(r)?n:r||ao(e)||n}var Ro=async function(e){let t=this.getOffsetParent||Lo,n=this.getDimensions,r=await n(e.floating);return{reference:Po(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function G(e){return co(e).direction===`rtl`}var zo={convertOffsetParentRelativeRectToViewportRelativeRect:wo,getDocumentElement:Ka,getClippingRect:Mo,getOffsetParent:Lo,getElementRects:Ro,getClientRects:To,getDimensions:No,getScale:_o,isElement:Ja,isRTL:G};function Bo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vo(e,t,n){let r=null,i,a=Ka(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ia(d),h=ia(a.clientWidth-(u+f)),g=ia(a.clientHeight-(d+p)),_=ia(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:na(0,ta(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Bo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ga(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ho(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=go(e),u=i||a?[...l?po(l):[],...t?po(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vo(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?xo(e):null;c&&g();function g(){let t=xo(e);h&&!Bo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Uo=za,Wo=Ba,Go=Na,Ko=Ha,qo=Ia,Jo=Ma,Yo=Va,Xo=(e,t,n)=>{let r=new Map,i=n??{},a={...zo,...i.platform,_c:r};return ja(e,t,{...i,platform:a})},Zo=typeof document<`u`?_.useLayoutEffect:function(){};function Qo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $o(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function es(e,t){let n=$o(e);return Math.round(t*n)/n}function ts(e){let t=_.useRef(e);return Zo(()=>{t.current=e}),t}function ns(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Qo(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=ts(c),O=ts(i),k=ts(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Xo(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Qo(T.current,t)&&(T.current=t,ki.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Zo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Zo(()=>(j.current=!0,()=>{j.current=!1}),[]),Zo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=es(N.floating,u.x),r=es(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$o(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var rs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Jo({element:r.current,padding:i}).fn(n):r?Jo({element:r,padding:i}).fn(n):{}}}},is=(e,t)=>{let n=Uo(e);return{name:n.name,fn:n.fn,options:[e,t]}},as=(e,t)=>{let n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},os=(e,t)=>({fn:Yo(e).fn,options:[e,t]}),ss=(e,t)=>{let n=Go(e);return{name:n.name,fn:n.fn,options:[e,t]}},cs=(e,t)=>{let n=Ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},ls=(e,t)=>{let n=qo(e);return{name:n.name,fn:n.fn,options:[e,t]}},us=(e,t)=>{let n=rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ds=Object.defineProperty,fs=(e,t)=>ds(e,`name`,{value:t,configurable:!0});function ps(e){let[t,n]=_.useState(void 0);return Xi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}fs(ps,`useSize`);var ms=Object.defineProperty,hs=(e,t)=>ms(e,`name`,{value:t,configurable:!0}),gs=`Popper`,[_s,vs]=di(gs),[ys,bs]=_s(gs),xs=hs(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,j.jsx)(ys,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ss=`PopperAnchor`,Cs=_.forwardRef(hs(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=bs(Ss,n),o=_.useRef(null),s=a.onAnchorChange,c=V(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&As(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,j.jsx)(H.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),ws=`PopperContent`,[Ts,Es]=_s(ws),Ds=_.forwardRef(hs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=bs(ws,n),[v,y]=_.useState(null),b=V(t,y),[x,S]=_.useState(null),C=ps(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Os),altBoundary:k},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=ns({strategy:`fixed`,placement:E,whileElementsMounted:hs((...e)=>Ho(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[is({mainAxis:i+T,alignmentAxis:o}),c&&as({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?os():void 0,...A}),c&&ss({...A}),cs({...A,apply:hs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&us({element:x,padding:s}),ks({arrowWidth:w,arrowHeight:T}),f&&ls({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),L=g.setPlacementState;Xi(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=As(P),ne=Fi(m);Xi(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=_.useState();return Xi(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,j.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,j.jsx)(Ts,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,j.jsx)(H.div,{"data-side":ee,"data-align":te,...h,ref:b,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function Os(e){return e!==null}hs(Os,`isNotNull`);var ks=hs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=As(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function As(e){let[t,n=`center`]=e.split(`-`);return[t,n]}hs(As,`getSideAndAlignFromPlacement`);var js=xs,Ms=Cs,Ns=Ds,Ps=Object.defineProperty,Fs=_.forwardRef(((e,t)=>Ps(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);Xi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ki.createPortal((0,j.jsx)(H.div,{...r,ref:t}),o):null},`Portal`)),Is=Object.defineProperty,Ls=(e,t)=>Is(e,`name`,{value:t,configurable:!0});function Rs(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Ls(Rs,`useStateMachine`);var zs=Ls(e=>{let{present:t,children:n}=e,r=Bs(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Hs(r.ref,Ws(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function Bs(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=Rs(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??Us(r.current),o.current=void 0):a.current=`none`},[s]),Xi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Us(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Xi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ls(a=>{let o=Us(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ls(e=>{e.target===t&&(a.current=Us(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Us(t)}else r.current=null;n(e)},[])}}Ls(Bs,`usePresence`);function Vs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ls(Vs,`setRef`);function Hs(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vs(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vs(n[e],null)}}},[])}Ls(Hs,`useStableComposedRefs`);function Us(e){return e?.animationName||`none`}Ls(Us,`getAnimationName`);function Ws(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ls(Ws,`getElementRef`);var Gs=Object.defineProperty,Ks=(e,t)=>Gs(e,`name`,{value:t,configurable:!0}),qs=_.useEffectEvent,Js=_.useInsertionEffect;function Ys(e){if(typeof qs==`function`)return qs(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Js==`function`?Js(()=>{t.current=e}):Xi(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ks(Ys,`useEffectEvent`);var Xs=Object.defineProperty,Zs=(e,t)=>Xs(e,`name`,{value:t,configurable:!0}),Qs=_.useInsertionEffect||Xi;function $s({prop:e,defaultProp:t,onChange:n=Zs(()=>{},`onChange`),caller:r}){let[i,a,o]=ec({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=tc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Zs($s,`useControllableState`);function ec({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Qs(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Zs(ec,`useUncontrolledState`);function tc(e){return typeof e==`function`}Zs(tc,`isFunction`);var nc=Symbol(`RADIX:SYNC_STATE`);function rc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ys(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===nc)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:nc,state:i})},[i,d.state,c]),[h,f]}Zs(rc,`useControllableStateReducer`);var ic=Object.defineProperty,ac=(e,t)=>ic(e,`name`,{value:t,configurable:!0}),oc=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),sc=_.forwardRef(ac(function(e,t){return(0,j.jsx)(H.span,{...e,ref:t,style:{...oc,...e.style}})},`VisuallyHidden`)),cc=Object.defineProperty,lc=(e,t)=>cc(e,`name`,{value:t,configurable:!0}),[uc,dc]=di(`Tooltip`,[vs]),fc=vs(),pc=`TooltipProvider`,mc=700,hc=`tooltip.open`,[gc,_c]=uc(pc),vc=lc(e=>{let{__scopeTooltip:t,delayDuration:n=mc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(gc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),yc=`Tooltip`,[bc,xc]=uc(yc),Sc=lc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=_c(yc,e.__scopeTooltip),l=fc(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=U(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=$s({prop:r,defaultProp:i??!1,onChange:lc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(hc))):c.onClose(),a?.(e)},`onChange`),caller:yc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,j.jsx)(js,{...l,children:(0,j.jsx)(bc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Cc=`TooltipTrigger`,wc=_.forwardRef(lc(function(e,t){let{__scopeTooltip:n,...r}=e,i=xc(Cc,n),a=_c(Cc,n),o=fc(n),s=V(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,j.jsx)(Ms,{asChild:!0,...o,children:(0,j.jsx)(H.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:B(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:B(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:B(e.onBlur,i.onClose),onClick:B(e.onClick,i.onClose)})})},`TooltipTrigger`)),Tc=`TooltipPortal`,[Ec,Dc]=uc(Tc,{forceMount:void 0}),Oc=lc(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=xc(Tc,t);return(0,j.jsx)(Ec,{scope:t,forceMount:n,children:(0,j.jsx)(zs,{present:n||a.open,children:(0,j.jsx)(Fs,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),kc=`TooltipContent`,Ac=_.forwardRef(lc(function(e,t){let n=Dc(kc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=xc(kc,e.__scopeTooltip);return(0,j.jsx)(zs,{present:r||o.open,children:o.disableHoverableContent?(0,j.jsx)(Nc,{side:i,...a,ref:t}):(0,j.jsx)(jc,{side:i,...a,ref:t})})},`TooltipContent`)),jc=_.forwardRef(lc(function(e,t){let n=xc(kc,e.__scopeTooltip),r=_c(kc,e.__scopeTooltip),i=_.useRef(null),a=V(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Fc(r,Pc(r,n.getBoundingClientRect())),a=Ic(t.getBoundingClientRect()),o=Rc([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=lc(e=>p(e,u),`handleTriggerLeave`),t=lc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=lc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Lc(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,j.jsx)(Nc,{...e,ref:a})},`TooltipContentHoverable`)),Mc=vi(`TooltipContent`),Nc=_.forwardRef(lc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=xc(kc,n),u=fc(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(hc,d),()=>document.removeEventListener(hc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=lc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Xi(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,j.jsx)(Ui,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,j.jsxs)(Ns,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,j.jsx)(Mc,{children:r}),i?(0,j.jsx)(sc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Pc(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}lc(Pc,`getExitSideFromRect`);function Fc(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}lc(Fc,`getPaddedExitPoints`);function Ic(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}lc(Ic,`getPointsFromRect`);function Lc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}lc(Lc,`isPointInPolygon`);function Rc(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),zc(t)}lc(Rc,`getHull`);function zc(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}lc(zc,`getHullPresorted`);var Bc=vc,Vc=Sc,Hc=wc,Uc=Oc,Wc=Ac;function Gc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Kc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gc(e))&&(r&&(r+=` `),r+=t);return r}var qc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Jc=(e,t)=>({classGroupId:e,validator:t}),Yc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Xc=`-`,Zc=[],Qc=`arbitrary..`,$c=e=>{let t=nl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return tl(e);let n=e.split(Xc);return el(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?qc(i,t):t:i||Zc}return n[e]||Zc}}},el=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=el(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Xc):e.slice(t).join(Xc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},tl=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Qc+r:void 0})(),nl=e=>{let{theme:t,classGroups:n}=e;return rl(n,t)},rl=(e,t)=>{let n=Yc();for(let r in e){let i=e[r];il(i,n,r,t)}return n},il=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];al(i,t,n,r)}},al=(e,t,n,r)=>{if(typeof e==`string`){ol(e,t,n);return}if(typeof e==`function`){sl(e,t,n,r);return}cl(e,t,n,r)},ol=(e,t,n)=>{let r=e===``?t:ll(t,e);r.classGroupId=n},sl=(e,t,n,r)=>{if(ul(e)){il(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Jc(n,e))},cl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];il(o,ll(t,a),n,r)}},ll=(e,t)=>{let n=e,r=t.split(Xc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Yc(),n.nextPart.set(t,i)),n=i}return n},ul=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,dl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},fl=`!`,pl=`:`,ml=[],hl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),gl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===pl){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(fl)?(c=s.slice(0,-1),l=!0):s.startsWith(fl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return hl(t,l,c,u)};if(t){let e=t+pl,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):hl(ml,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},_l=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},vl=e=>({cache:dl(e.cacheSize),parseClassName:gl(e),sortModifiers:_l(e),postfixLookupClassGroupIds:yl(e),...$c(e)}),yl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},bl=/\s+/,xl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(bl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+fl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Sl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Cl(n))&&(i&&(i+=` `),i+=r);return i},Cl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Cl(e[r]))&&(n&&(n+=` `),n+=t);return n},wl=(e,...t)=>{let n,r,i,a,o=o=>(n=vl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=xl(e,n);return i(e,a),a};return a=o,(...e)=>a(Sl(...e))},Tl=[],El=e=>{let t=t=>t[e]||Tl;return t.isThemeGetter=!0,t.themeKey=e,t},Dl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ol=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Al=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Nl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=e=>kl.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),Il=e=>!!e&&Number.isInteger(Number(e)),Ll=e=>e.endsWith(`%`)&&K(e.slice(0,-1)),Rl=e=>Al.test(e),zl=()=>!0,Bl=e=>jl.test(e)&&!Ml.test(e),Vl=()=>!1,Hl=e=>Nl.test(e),Ul=e=>Pl.test(e),Wl=e=>!q(e)&&!J(e),Gl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Kl=e=>su(e,du,Vl),q=e=>Dl.test(e),ql=e=>su(e,fu,Bl),Jl=e=>su(e,pu,K),Yl=e=>su(e,hu,zl),Xl=e=>su(e,mu,Vl),Zl=e=>su(e,lu,Vl),Ql=e=>su(e,uu,Ul),$l=e=>su(e,gu,Hl),J=e=>Ol.test(e),eu=e=>cu(e,fu),tu=e=>cu(e,mu),nu=e=>cu(e,lu),ru=e=>cu(e,du),iu=e=>cu(e,uu),au=e=>cu(e,gu,!0),ou=e=>cu(e,hu,!0),su=(e,t,n)=>{let r=Dl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cu=(e,t,n=!1)=>{let r=Ol.exec(e);return r?r[1]?t(r[1]):n:!1},lu=e=>e===`position`||e===`percentage`,uu=e=>e===`image`||e===`url`,du=e=>e===`length`||e===`size`||e===`bg-size`,fu=e=>e===`length`,pu=e=>e===`number`,mu=e=>e===`family-name`,hu=e=>e===`number`||e===`weight`,gu=e=>e===`shadow`,_u=wl(()=>{let e=El(`color`),t=El(`font`),n=El(`text`),r=El(`font-weight`),i=El(`tracking`),a=El(`leading`),o=El(`breakpoint`),s=El(`container`),c=El(`spacing`),l=El(`radius`),u=El(`shadow`),d=El(`inset-shadow`),f=El(`text-shadow`),p=El(`drop-shadow`),m=El(`blur`),h=El(`perspective`),g=El(`aspect`),_=El(`ease`),v=El(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[Fl,`full`,`auto`,...w()],E=()=>[Il,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,Il,J,q]},Il,J,q],O=()=>[Il,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Fl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,Fl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Fl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,q],L=()=>[...b(),nu,Zl,{position:[J,q]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,ru,Kl,{size:[J,q]}],ne=()=>[Ll,eu,ql],re=()=>[``,`none`,`full`,l,J,q],ie=()=>[``,K,eu,ql],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[K,Ll,nu,Zl],ce=()=>[``,`none`,m,J,q],le=()=>[`none`,K,J,q],ue=()=>[`none`,K,J,q],R=()=>[K,J,q],de=()=>[Fl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Rl],breakpoint:[Rl],color:[zl],container:[Rl],"drop-shadow":[Rl],ease:[`in`,`out`,`in-out`],font:[Wl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Rl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Rl],shadow:[Rl],spacing:[`px`,K],text:[Rl],"text-shadow":[Rl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Fl,q,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,q]}],"container-named":[Gl],columns:[{columns:[K,`auto`,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Il,`auto`,J,q]}],basis:[{basis:[Fl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[K,Fl,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,K,J,q]}],shrink:[{shrink:[``,K,J,q]}],order:[{order:[Il,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,eu,ql]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ou,Yl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ll,q]}],"font-family":[{font:[tu,Xl,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[K,`none`,J,Jl]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[K,`from-font`,`auto`,J,ql]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[K,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Il,J,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Il,J,q],radial:[``,J,q],conic:[``,Il,J,q]},iu,Ql]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[K,J,q]}],"outline-w":[{outline:[``,K,eu,ql]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,au,$l]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,au,$l]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[K,ql]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,au,$l]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[K,J,q]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:ce()}],brightness:[{brightness:[K,J,q]}],contrast:[{contrast:[K,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,au,$l]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,K,J,q]}],"hue-rotate":[{"hue-rotate":[K,J,q]}],invert:[{invert:[``,K,J,q]}],saturate:[{saturate:[K,J,q]}],sepia:[{sepia:[``,K,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[K,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[K,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,K,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,K,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[K,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[K,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,K,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[K,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[K,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[Il,J,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[K,eu,ql,Jl]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Y(...e){return _u(Kc(e))}var vu=`matrx-motion-overlay`,yu=`matrx-motion-popper`,bu={top:`matrx-motion-sheet-top`,bottom:`matrx-motion-sheet-bottom`,left:`matrx-motion-sheet-left`,right:`matrx-motion-sheet-right`,center:`matrx-motion-sheet-center`},xu=`matrx-spin`;[...Object.values(bu)];var Su=Symbol.for(`ai-matrx.design-system.portal-container-context`),Cu=globalThis,wu=Cu[Su]??=_.createContext(void 0);function Tu({container:e,children:t}){return(0,j.jsx)(wu.Provider,{value:e??void 0,children:t})}function Eu(e){let t=_.useContext(wu);return e===void 0?t??void 0:e??void 0}var Du=`data-matrx-title`,Ou=`data-matrx-tooltip-trigger`,ku=350,Au=500,ju=6,Mu=8,Nu=`matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,Pu=Symbol.for(`@ai-matrx/design-system/title-tooltips`),Fu={get:e=>e[Pu],set:(e,t)=>{e[Pu]=t},delete:e=>{delete e[Pu]}};function Iu(e=typeof document>`u`?void 0:document){if(!e)return()=>{};let t=Fu.get(e);t?t.count+=1:Fu.set(e,{count:1,uninstall:Lu(e)});let n=!1;return()=>{if(n)return;n=!0;let t=Fu.get(e);t&&(--t.count,t.count<=0&&(t.uninstall(),Fu.delete(e)))}}function Lu(e){let t=e.defaultView,n=null,r=null,i,a=0,o=t?.HTMLElement,s=e=>{if(!o||!(e instanceof t.Node))return null;let n=e instanceof o?e:e.parentElement;if(!n)return null;let r=n.closest(`[title], [${Du}]`);return!r||!(r instanceof o)||r.closest(`[data-native-title]`)?null:r},c=e=>(e.getAttribute(`data-matrx-title`)??e.getAttribute(`title`)??``).trim(),l=e=>{let t=e.getAttribute(`title`);t!==null&&(e.setAttribute(Du,t),e.removeAttribute(`title`))},u=e=>{let t=e.getAttribute(Du);t!==null&&(e.hasAttribute(`title`)||e.setAttribute(`title`,t),e.removeAttribute(Du))},d=()=>r&&r.isConnected?r:(r=e.createElement(`div`),r.setAttribute(`role`,`tooltip`),r.setAttribute(`data-slot`,`title-tooltip`),r.className=Nu,r.style.visibility=`hidden`,e.body.appendChild(r),r),f=e=>{let t=e.closest(`[data-title-side]`)?.getAttribute(`data-title-side`);return t===`bottom`||t===`left`||t===`right`?t:`top`},p=(e,n)=>{let r=t?.innerWidth??0,i=t?.innerHeight??0,a=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s={top:a.top-ju-o.height>=Mu,bottom:a.bottom+ju+o.height<=i-Mu,left:a.left-ju-o.width>=Mu,right:a.right+ju+o.width<=r-Mu},c={top:`bottom`,bottom:`top`,left:`right`,right:`left`},l=f(e),u=s[l]?l:s[c[l]]?c[l]:l,d,p;u===`top`||u===`bottom`?(d=a.left+a.width/2-o.width/2,p=u===`top`?a.top-ju-o.height:a.bottom+ju):(p=a.top+a.height/2-o.height/2,d=u===`left`?a.left-ju-o.width:a.right+ju),d=Math.min(Math.max(d,Mu),Math.max(Mu,r-Mu-o.width)),p=Math.min(Math.max(p,Mu),Math.max(Mu,i-Mu-o.height)),n.style.transform=`translate(${Math.round(d)}px, ${Math.round(p)}px)`,n.setAttribute(`data-side`,u)},m=(e,n)=>{let r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;for(let r=e;r;r=r===n?null:r.parentElement){let e=t?.getComputedStyle(r);if(!e||e.display===`none`||e.visibility===`hidden`||Number(e.opacity)===0)return!1}return!0},h=(n,r)=>{let i=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),a=i(r);if(!a||!t)return!1;let o=e.createTreeWalker(n,t.NodeFilter.SHOW_TEXT);for(let e=o.nextNode();e;e=o.nextNode()){if(i(e.textContent??``)!==a)continue;let t=e.parentElement;if(t&&m(t,n)&&!(t.scrollWidth>t.clientWidth+1))return!0}return!1},g=(e,t)=>{if(n!==e||e.closest(`[data-matrx-tooltip-trigger]`))return;let r=c(e);if(!r||!e.isConnected||h(e,r))return;let i=d();i.textContent=r,i.style.visibility=`hidden`,i.setAttribute(`data-state`,t?`instant-open`:`delayed-open`),p(e,i),i.style.visibility=`visible`,e.id&&(i.id=`${e.id}-title-tooltip`)},_=()=>{i!==void 0&&clearTimeout(i),i=void 0,r&&r.style.visibility===`visible`&&(a=Date.now()),r&&(r.style.visibility=`hidden`,r.removeAttribute(`data-state`))},v=e=>{n!==e&&(y(),n=e,l(e),Date.now()-a<Au?g(e,!0):i=setTimeout(()=>g(e,!1),ku))},y=()=>{_(),n&&u(n),n=null},b=e=>{if(e.pointerType===`touch`)return;let t=s(e.target);t?v(t):n&&y()},x=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},S=e=>{let t=s(e.target);if(!t)return;let n=!0;try{n=e.target.matches(`:focus-visible`)}catch{n=!0}n&&v(t)},C=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},w=()=>y(),T=e=>{e.key===`Escape`&&y()};return e.addEventListener(`pointerover`,b,!0),e.addEventListener(`pointerout`,x,!0),e.addEventListener(`focusin`,S,!0),e.addEventListener(`focusout`,C,!0),e.addEventListener(`pointerdown`,w,!0),e.addEventListener(`keydown`,T,!0),e.addEventListener(`scroll`,w,!0),t?.addEventListener(`blur`,w),()=>{y(),e.removeEventListener(`pointerover`,b,!0),e.removeEventListener(`pointerout`,x,!0),e.removeEventListener(`focusin`,S,!0),e.removeEventListener(`focusout`,C,!0),e.removeEventListener(`pointerdown`,w,!0),e.removeEventListener(`keydown`,T,!0),e.removeEventListener(`scroll`,w,!0),t?.removeEventListener(`blur`,w),r?.remove(),r=null}}function Ru({titleTooltips:e=!0,...t}){return _.useEffect(()=>{if(e)return Iu()},[e]),(0,j.jsx)(Bc,{...t})}var zu=Vc,Bu=_.forwardRef((e,t)=>(0,j.jsx)(Hc,{ref:t,[Ou]:``,...e}));Bu.displayName=Hc.displayName;var Vu=_.forwardRef(({className:e,sideOffset:t=4,container:n,animated:r=!0,...i},a)=>{let o=Eu(n);return(0,j.jsx)(Uc,{container:o??null,children:(0,j.jsx)(Wc,{ref:a,"data-slot":`tooltip-content`,sideOffset:t,className:Y(`matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,r&&`matrx-motion-popper`,e),...i})})});Vu.displayName=Wc.displayName;function Hu(...e){return e.filter(Boolean).join(` `).trim()}var Uu=Symbol.for(`@ai-matrx/tap-target:guard`);function Wu(){return globalThis[Uu]===!0}var Gu=[`--matrx-tap-box`,`--matrx-tap-gap`,`--matrx-tap-pill-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-wide-size`,`--matrx-tap-icon-size`,`--matrx-tap-touch-min`,`--matrx-tap-target-size`],Ku=[{scope:`[data-matrx-table][data-matrx-table-density]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-icon-size`])},{scope:`[data-alchemy-trigger]`,tokens:new Set([`--matrx-tap-icon-size`])}],qu=Ku[0].scope,Ju=`.matrx-tap-target, .matrx-tap-group`,Yu=/^(?:[^\s:]+:)*!?-?(?:\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\[)/;function Xu(e){if(!Wu()||!e)return null;let t=e.split(/\s+/).filter(e=>e&&Yu.test(e));return t.length?`className is the glyph colour only — remove "${t.join(` `)}"`:null}function X(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Z(e){let t=typeof e.className==`string`?e.className.trim().split(/\s+/).slice(0,4).join(`.`):``;return`<${e.tagName.toLowerCase()}${t?`.${t}`:``}>`}function Q(e,t){let n=t.getComputedStyle(e);return n.position===`absolute`||n.position===`fixed`||n.display===`none`}function Zu(e){return e.matches(Ju)?1:e.querySelectorAll(Ju).length}function Qu(e,t,n){let r=``,i=e=>{e!==t&&(e.nodeType===3?r+=e.textContent??``:e.nodeType===1&&!Q(e,n)&&e.childNodes.forEach(i))};return e.childNodes.forEach(i),r.trim()}function $u(e,t){if(e.matches(Ju))return!0;if(Zu(e)!==1)return!1;let n=e.querySelector(Ju);return!Array.from(e.querySelectorAll(`input, select, textarea, button, a, [role='button']`)).some(e=>e!==n&&!n.contains(e))&&Qu(e,n,t)===``}var ed=null;function td(e){let t=e.defaultView,n=t.getComputedStyle(e.documentElement),r=Gu.map(e=>n.getPropertyValue(e)).join(`|`);if(ed?.key===r)return ed;let i=e.createElement(`div`);i.setAttribute(`aria-hidden`,`true`),i.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0`,i.innerHTML=`<button class="matrx-tap-target"><div class="matrx-tap-pill"><svg class="matrx-tap-icon"></svg></div></button><button class="matrx-tap-target matrx-tap-target-sm"><div class="matrx-tap-pill matrx-tap-pill-sm"></div></button><button class="matrx-tap-target matrx-tap-target-inline"><div class="matrx-tap-pill matrx-tap-pill-inline"></div></button>`,e.body.appendChild(i);let[a,o,s]=Array.from(i.children);return ed={key:r,target:a.offsetHeight,pill:a.firstElementChild.offsetHeight,icon:X(t.getComputedStyle(a.querySelector(`svg`)).height),sm:o.offsetHeight,smPill:o.firstElementChild.offsetHeight,wide:s.firstElementChild.offsetHeight},i.remove(),ed}function nd(e){let t=e.ownerDocument,n=t.defaultView;if(!n||!e.isConnected)return null;let r=n.getComputedStyle(e);if(r.display===`none`)return null;let i=n.getComputedStyle(t.documentElement),a=e.closest(qu)!==null,o=new Set;for(let t of Gu){let n=r.getPropertyValue(t).trim();if(n!==i.getPropertyValue(t).trim()){if(!Ku.some(n=>n.tokens.has(t)&&e.closest(n.scope)))return`${t} overridden to "${n}" — tap geometry is not configurable`;o.add(t)}}let s=e.classList.contains(`matrx-tap-target-sm`),c=/matrx-tap-target-(?:inline|mobile-icon-only)/.test(e.className),l=e.querySelector(`:scope > .matrx-tap-pill`),u=l?.querySelector(`.matrx-tap-icon`)??null,d=X(r.minHeight)>=e.offsetHeight-.5||X(r.minWidth)>=e.offsetWidth-.5;if(!a&&l&&!d){let r=td(t),i=s?r.sm:r.target,a=s?[r.smPill]:c?[r.pill,r.wide]:[r.pill];if(Math.abs(e.offsetHeight-i)>.5)return`button is ${e.offsetHeight}px tall, canon is ${i}px`;if(!c&&Math.abs(e.offsetWidth-i)>.5)return`button is ${e.offsetWidth}px wide, canon is ${i}px`;if(!a.some(e=>Math.abs(l.offsetHeight-e)<=.5))return`pill is ${l.offsetHeight}px, canon is ${a.join(` or `)}px`;if(u&&!o.has(`--matrx-tap-icon-size`)){let e=X(n.getComputedStyle(u).height);if(Math.abs(e-r.icon)>.5)return`glyph is ${e}px, canon is ${r.icon}px`}}let f=e;if(e.parentElement?.matches(`.matrx-tap-group-row, .matrx-tap-search-measure`)){let t=e.closest(`.matrx-tap-group`);if(t&&Zu(e.parentElement)>1)return null;f=t??e}for(let e=0;e<2;e+=1){let e=f.parentElement;if(!e||e===t.body||Array.from(e.children).filter(e=>e!==f&&!Q(e,n)).length>0||Qu(e,f,n)!==``)break;let r=n.getComputedStyle(e),i=X(r.marginLeft)+X(r.marginRight)+X(r.paddingLeft)+X(r.paddingRight);if(i>.5)return`${Z(e)} adds ${i}px around a tap button — tap buttons space themselves`;f=e}let p=f.parentElement;if(p){let e=n.getComputedStyle(p),t=/flex|grid/.test(e.display),r=Array.from(p.children).filter(e=>e!==f&&$u(e,n));if(t&&r.length>0){let t=X(e.display.includes(`grid`)||!e.flexDirection.startsWith(`column`)?e.columnGap:e.rowGap);if(t>.5)return`${Z(p)} adds a ${t}px gap between tap buttons — remove it; tap buttons space themselves`}}return null}var rd=new Set;function id(e,t){e.setAttribute(`data-matrx-tap-violation`,t);let n=`${t}@${e.getAttribute(`aria-label`)??e.textContent??``}`;rd.has(n)||(rd.add(n),console.error(`[tap-target] ${t}`,e))}var ad=new Set,od=null,sd=!1;function cd(e){let t=nd(e);t?id(e,t):e.removeAttribute(`data-matrx-tap-violation`)}function ld(e){sd||(sd=!0,e.addEventListener(`resize`,()=>{od&&clearTimeout(od),od=setTimeout(()=>ad.forEach(e=>e.isConnected?cd(e):ad.delete(e)),200)}))}function ud(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function dd(e,t){let n=(0,_.useRef)(null);return(0,_.useCallback)(r=>{if(ud(e,r),n.current&&n.current!==r&&ad.delete(n.current),n.current=r,!Wu()||!r)return;if(t){id(r,t);return}let i=r.ownerDocument.defaultView;i&&(ad.add(r),ld(i),i.requestAnimationFrame(()=>cd(r)))},[e,t])}var fd={default:`text-foreground`,muted:`text-muted-foreground group-hover/tap:text-foreground`,primary:`text-primary`,destructive:`text-destructive`,success:`text-success`,warning:`text-warning`,info:`text-info`},pd={primary:{fill:`bg-primary group-hover/tap:bg-primary/85`,glyph:`text-primary-foreground`},destructive:{fill:`bg-destructive group-hover/tap:bg-destructive/85`,glyph:`text-destructive-foreground`},success:{fill:`bg-success group-hover/tap:bg-success/85`,glyph:`text-success-foreground`},warning:{fill:`bg-warning group-hover/tap:bg-warning/85`,glyph:`text-warning-foreground`},neutral:{fill:`bg-foreground group-hover/tap:bg-foreground/85`,glyph:`text-background`}},md=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function hd(e){let t=e.toLowerCase().split(`+`),n=t.pop()??``;return{mod:t.includes(`mod`),shift:t.includes(`shift`),alt:t.includes(`alt`),key:n}}function gd(e){let t=hd(e),n=t.key.length===1?t.key.toUpperCase():t.key[0].toUpperCase()+t.key.slice(1);return md?`${t.alt?`⌥`:``}${t.shift?`⇧`:``}${t.mod?`⌘`:``}${n}`:[t.mod&&`Ctrl`,t.alt&&`Alt`,t.shift&&`Shift`,n].filter(Boolean).join(`+`)}function _d(e){let t=e;return!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function vd(e,t){let n=hd(t);return(e.metaKey||e.ctrlKey)!==n.mod||e.altKey!==n.alt||/^[a-z0-9]$|^[a-z]{2,}$/.test(n.key)&&e.shiftKey!==n.shift||!n.mod&&_d(e.target)?!1:e.key.toLowerCase()===n.key}function yd(e,t,n){(0,_.useEffect)(()=>{if(!e||!n)return;let r=n=>{if(!vd(n,e))return;let r=t();r&&r.isConnected&&(n.preventDefault(),r.click())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,n,t])}function bd({badge:e}){return e===`dot`?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,"data-dot":``}):e<=0?null:(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,children:e>99?`99+`:e})}function xd({className:e}){return(0,j.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,j.jsx)(`circle`,{className:xu,cx:`12`,cy:`12`,r:`9`,strokeDasharray:`28.27`,strokeDashoffset:`9`,strokeLinecap:`round`,style:{transformOrigin:`12px 12px`}})})}function Sd(){return(0,j.jsx)(`svg`,{className:`matrx-tap-chevron`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function Cd(e,t){return t?(0,j.jsxs)(`span`,{className:`matrx-tap-tooltip`,children:[e,(0,j.jsx)(`kbd`,{className:`matrx-tap-kbd`,children:gd(t)})]}):e}var wd=Symbol.for(`@ai-matrx/tap-target:link-component`);function Td(){return globalThis[wd]??null}var Ed=/^(https?:|mailto:|tel:)/i,Dd=`matrx-tap-target group group/tap`,Od=`matrx-tap-target matrx-tap-target-sm group group/tap`;function kd({icon:e,children:t,strokeWidth:n=2,className:r}){return e?(0,_.isValidElement)(e)?(0,_.cloneElement)(e,{className:Hu(r,e.props.className)}):(0,j.jsx)(`span`,{className:r,children:e}):(0,j.jsx)(`svg`,{className:r,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function Ad(e,t,n){let r=!!e;return t===`sm`?{outerClassName:r&&n?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap`:r?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap`:Od,inlineModifier:n?`matrx-tap-pill-mobile-icon-only-sm`:`matrx-tap-pill-inline-sm`}:{outerClassName:r&&n?`${Dd} matrx-tap-target-mobile-icon-only`:r?`${Dd} matrx-tap-target-inline`:Dd,inlineModifier:n?`matrx-tap-pill-mobile-icon-only`:`matrx-tap-pill-inline`}}function jd({label:e,pillClassName:t,iconClassName:n,labelClassName:r,inlineModifier:i,icon:a,children:o,strokeWidth:s=2,loading:c,chevron:l}){let u=c?(0,j.jsx)(xd,{className:n}):(0,j.jsx)(kd,{icon:a,strokeWidth:s,className:n,children:o}),d=e?`${t} ${i}`.trim():t;return e?(0,j.jsxs)(`div`,{className:d,children:[u,(0,j.jsx)(`span`,{className:r??`matrx-tap-label`,children:e}),l?(0,j.jsx)(Sd,{}):null]}):(0,j.jsx)(`div`,{className:d,children:u})}function Md({size:e=`default`,colorClassName:t,pillClassName:n,iconClassName:r,labelClassName:i,icon:a,children:o,strokeWidth:s,label:c,mobileIconOnly:l=!1,onClick:u,as:d,htmlFor:f,ariaLabel:p,disabled:m,href:h,target:g,rel:v,prefetch:y,linkComponent:b,tooltip:x,tooltipSide:S,tooltipAlign:C,rest:w,buttonRef:T}){let{tone:E,badge:D,pressed:O,loading:k,disabledReason:A,shortcut:M,chevron:N,...P}=w??{},F=!!(m||A),I=A||(typeof x==`string`&&x?x:void 0)||p||c,L=x===!1,ee=dd(T,(I?null:`every tap button needs a tooltip — pass ariaLabel`)??Xu(t??P.className)??(P.style?`style is not supported on a tap button`:null)),te=(0,_.useRef)(null),ne=(0,_.useCallback)(e=>{te.current=e,ee(e)},[ee]);yd(M,(0,_.useCallback)(()=>te.current,[]),!F&&!k);let re=E?fd[E]:O&&!t?fd.primary:null;re&&(r=`matrx-tap-icon ${re}`,i=`matrx-tap-label ${re}`),O&&(n=`${n} matrx-tap-pressed`);let{outerClassName:ie,inlineModifier:ae}=Ad(c,e,l),oe=l?`${i??`matrx-tap-label`} matrx-tap-label-mobile-icon-only`:i,se=jd({label:c,pillClassName:n,iconClassName:r,labelClassName:oe,inlineModifier:c?ae:``,icon:a,children:o,strokeWidth:s,loading:k,chevron:N}),ce=Nd({href:h,target:g,rel:v,prefetch:y,linkComponent:b,as:d,htmlFor:f,onClick:k?void 0:u,ariaLabel:c&&!l?void 0:p??c,disabled:F,outerClassName:ie,title:L&&I?M?`${I} (${gd(M)})`:I:void 0,children:(0,j.jsxs)(j.Fragment,{children:[se,D===void 0?null:(0,j.jsx)(bd,{badge:D})]}),rest:{...P,...O===void 0?{}:{"aria-pressed":O},...k?{"aria-busy":!0}:{},...M?{"aria-keyshortcuts":M.replace(/mod/i,`Meta`)}:{}},triggerRef:ne});return L||!I?ce:Pd(ce,{tooltip:I,ariaLabel:I,disabled:F,tooltipSide:S,tooltipAlign:C,shortcut:M})}function Nd({href:e,target:t,rel:n,prefetch:r,linkComponent:i,as:a,htmlFor:o,onClick:s,ariaLabel:c,disabled:l,outerClassName:u,children:d,rest:f,triggerRef:p,title:m}){let{style:h,...g}=f??{};if(l&&e)return(0,j.jsx)(`span`,{ref:p,"aria-disabled":`true`,"aria-label":c,title:m,className:`${u} opacity-40 pointer-events-none`,children:d});if(e){if(Ed.test(e))return(0,j.jsx)(`a`,{ref:p,href:e,target:t??`_blank`,rel:n??`noopener noreferrer`,"aria-label":c,title:m,className:u,children:d});let a=i??Td();return a?(0,j.jsx)(a,{ref:p,href:e,target:t,rel:n,prefetch:r,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`a`,{ref:p,href:e,target:t,rel:n,"aria-label":c,title:m,className:u,children:d})}return a===`label`?(0,j.jsx)(`label`,{ref:p,htmlFor:o,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`button`,{ref:p,type:`button`,onClick:s,"aria-label":c,title:m,disabled:l,...g,className:u,children:d})}function Pd(e,{tooltip:t,ariaLabel:n,disabled:r,tooltipSide:i=`top`,tooltipAlign:a=`center`,shortcut:o}){if(t===!1)return e;let s=typeof t==`string`&&t.length>0?t:n;return s?(0,j.jsxs)(zu,{children:[(0,j.jsx)(Bu,{asChild:!0,children:r?(0,j.jsx)(`span`,{className:`inline-flex`,children:e}):e}),(0,j.jsx)(Vu,{side:i,align:a,children:Cd(s,o)})]}):e}var Fd=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-glass-thin-border`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})});(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-muted-foreground group-hover/tap:text-foreground`;return Md({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});var Id=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tone:p,bgColor:m,iconColor:h,hoverBgColor:g,activeBgColor:_,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...C},w){return Md({icon:e,children:t,strokeWidth:n,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...Ld(p,m,h,g,_),rest:C,buttonRef:w})});function Ld(e,t,n,r,i){if(!(!e&&(t||n||r||i))){let t=pd[e??`primary`];return{pillClassName:`matrx-tap-pill ${t.fill} ${t.glyph} group-active/tap:brightness-90`,iconClassName:`matrx-tap-icon ${t.glyph}`,labelClassName:`matrx-tap-label ${t.glyph}`}}let a=n??`text-primary-foreground`;return{pillClassName:`matrx-tap-pill ${t??`bg-primary`} ${a} ${r??`group-hover/tap:bg-primary/80`} ${i??`group-active/tap:brightness-90`}`,iconClassName:`matrx-tap-icon ${a}`,labelClassName:`matrx-tap-label ${a}`}}(0,_.forwardRef)(function({tone:e=`destructive`,...t},n){return(0,j.jsx)(Id,{ref:n,tone:e,...t})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-foreground`;return Md({colorClassName:i,size:`sm`,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});function Rd(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0),r=(0,_.useRef)(!1),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=48,[]),l=(0,_.useCallback)(e=>{r.current=!0,e.scrollTop=e.scrollHeight},[]),u=(0,_.useCallback)(()=>{let e=t.current;if(e===null)return;if(r.current){r.current=!1;return}let i=c(e);n.current=i,a(i),i&&s(!1)},[c]),d=(0,_.useCallback)(e=>{let n=t.current;n!==null&&n.removeEventListener(`scroll`,u),t.current=e,e!==null&&e.addEventListener(`scroll`,u,{passive:!0})},[u]);(0,_.useEffect)(()=>()=>{let e=t.current;e!==null&&e.removeEventListener(`scroll`,u)},[u]);let f=(0,_.useCallback)(()=>{let r=t.current;if(r!==null&&e){if(n.current){l(r);return}s(!0)}},[e,l]);return{ref:d,pinned:i,hasUnseenBelow:o,jumpToLatest:(0,_.useCallback)(()=>{let e=t.current;e!==null&&(l(e),n.current=!0,a(!0),s(!1))},[l]),onContentChange:f}}function zd(e){let t=[],n=``,r=0;for(let i of bt(e)){if(i.start<r)continue;n+=e.slice(r,i.start);let a=e.slice(i.start,i.end);t.push(i.kind===`fence`?` code block `:Bd(a)),n+=`\uE300${t.length-1}\uE301`,r=i.end}return n+=e.slice(r),n.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}([*+-]|\d+\.)\s+/gm,``).replace(/(\*\*\*|___)(.+?)\1/g,`$2`).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(\*|_)(.+?)\1/g,`$2`).replace(/~~(.+?)~~/g,`$1`).replace(/^\s{0,3}([-*_]\s?){3,}$/gm,``).replace(/\uE300(\d+)\uE301/g,(e,n)=>t[Number(n)]??``).replace(/[ \t]{2,}/g,` `)}function Bd(e){let t=/^`+/.exec(e)?.[0].length??0,n=e.slice(t,e.length-t);return/^ .* $/s.test(n)&&n.trim()?n.slice(1,-1):n}var Vd=`Your message could not be copied.`,Hd=`Select the text and copy it with your keyboard — this browser did not allow the page to use the clipboard.`,Ud=2e3;function Wd(e){let{message:t}=e,{notifier:n}=Wr(),r=Gr(),{thread:i,retry:a}=Br(),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=(0,_.useCallback)((e,t)=>{let r=globalThis.navigator?.clipboard,i=r?.writeText?.bind(r);if(i===void 0){n.notify({level:`warning`,message:Vd,remedy:Hd});return}i(e).then(()=>{s(t),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>s(null),Ud)},()=>{n.notify({level:`warning`,message:Vd,remedy:Hd})})},[n]);if(t.status===`streaming`||t.status===`pending`)return null;let u=C(t),d=r.messageActions?.(t),f=t.role===`user`,p=f?``:Jr(i.getSnapshot().messages,t.id);return u===``&&d===void 0?null:(0,j.jsxs)(`div`,{className:`mx-chat-actions`,role:`group`,"aria-label":f?`Actions for your message`:`Actions for this answer`,"data-message-id":t.id,children:[u===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-text`,onClick:()=>l(zd(u),`text`),children:o===`text`?`Copied`:`Copy`}),u===``||f?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-markdown`,onClick:()=>l(u,`markdown`),children:o===`markdown`?`Copied`:`Copy as markdown`}),p===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`retry`,onClick:()=>void i.send({text:p}),children:`Ask again`}),f&&u!==``?(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`edit`,onClick:()=>a.request(u),children:`Edit and send again`}):null,d,o===null?null:(0,j.jsx)(`span`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:`Copied to the clipboard`})]})}var Gd=Object.defineProperty,Kd=(e,t)=>Gd(e,`name`,{value:t,configurable:!0});function qd(e){let t=e+`CollectionProvider`,[n,r]=di(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Kd(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,j.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=hi(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=V(t,a(s,n).collectionRef);return(0,j.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=hi(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=V(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,j.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Kd(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Kd(qd,`createCollection`);var Jd=new WeakMap,Yd=class e extends Map{static{Kd(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Jd.set(this,!0)}set(e,t){return Jd.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Qd(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Xd(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Xd(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Xd(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Xd(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Zd(e,t);return n===-1?void 0:e[n]}Kd(Xd,`at`);function Zd(e,t){let n=e.length,r=Qd(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Kd(Zd,`toSafeIndex`);function Qd(e){return e!==e||e===0?0:Math.trunc(e)}Kd(Qd,`toSafeInteger`);function $d(e){let t=e+`CollectionProvider`,[n,r]=di(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Yd,setItemMap:Kd(()=>void 0,`setItemMap`)}),o=Kd(({state:e,...t})=>e?(0,j.jsx)(c,{...t,state:e}):(0,j.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Kd(e=>{let t=h();return(0,j.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Kd(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=V(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=rf(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,j.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=hi(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=V(t,a(l,n).collectionRef);return(0,j.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=hi(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=V(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);ef(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(nf):(t.set(s,{...e,element:s}),t.toSorted(nf)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Yd(e)))}},[s,m,u]),(0,j.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new Yd)}Kd(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Kd(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Kd($d,`createCollection`);function ef(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Kd(ef,`shallowEqual`);function tf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Kd(tf,`isElementPreceding`);function nf(e,t){return!e[1].element||!t[1].element?0:tf(e[1].element,t[1].element)?-1:1}Kd(nf,`sortByDocumentPosition`);function rf(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Kd(rf,`getChildListObserver`);var af=Object.defineProperty,of=(e,t)=>af(e,`name`,{value:t,configurable:!0}),sf=_.createContext(void 0);function cf(e){let t=_.useContext(sf);return e||t||`ltr`}of(cf,`useDirection`);function lf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...e}}function uf(e){return(0,j.jsxs)(`svg`,{...lf(e),children:[(0,j.jsx)(`path`,{d:`M18 6 6 18`}),(0,j.jsx)(`path`,{d:`m6 6 12 12`})]})}function df(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 15 15`,width:15,height:15,fill:`none`,"aria-hidden":!0,...e}}function ff(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function pf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:`currentColor`})})}function mf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function hf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function gf(e){return(0,j.jsx)(`svg`,{...df(e),children:(0,j.jsx)(`path`,{d:`M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var _f=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,vf=Kc,yf=(e,t)=>n=>{if(t?.variants==null)return vf(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=_f(t)||_f(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return vf(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},bf=Object.defineProperty,xf=(e,t)=>bf(e,`name`,{value:t,configurable:!0}),Sf=`focusScope.autoFocusOnMount`,Cf=`focusScope.autoFocusOnUnmount`,wf={bubbles:!1,cancelable:!0},Tf=_.forwardRef(xf(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Fi(i),u=Fi(a),d=_.useRef(null),f=V(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Mf(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Mf(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Mf(s)};xf(e,`handleFocusIn`),xf(t,`handleFocusOut`),xf(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){Nf.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Sf,wf);s.addEventListener(Sf,l),s.dispatchEvent(t),t.defaultPrevented||(Ef(If(Of(s)),{select:!0}),document.activeElement===e&&Mf(s))}return()=>{s.removeEventListener(Sf,l),setTimeout(()=>{let t=new CustomEvent(Cf,wf);s.addEventListener(Cf,u),s.dispatchEvent(t),t.defaultPrevented||Mf(e??document.body,{select:!0}),s.removeEventListener(Cf,u),Nf.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Df(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Mf(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Mf(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(H.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Ef(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Mf(r,{select:t}),document.activeElement!==n)return}xf(Ef,`focusFirst`);function Df(e){let t=Of(e);return[kf(t,e),kf(t.reverse(),e)]}xf(Df,`getTabbableEdges`);function Of(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:xf(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}xf(Of,`getTabbableCandidates`);function kf(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Af(r,{upTo:t})))return r}xf(kf,`findVisible`);function Af(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}xf(Af,`isHidden`);function jf(e){return e instanceof HTMLInputElement&&`select`in e}xf(jf,`isSelectableInput`);function Mf(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jf(e)&&t&&e.select()}}xf(Mf,`focus`);var Nf=Pf();function Pf(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ff(e,t),e.unshift(t)},remove(t){e=Ff(e,t),e[0]?.resume()}}}xf(Pf,`createFocusScopesStack`);function Ff(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}xf(Ff,`arrayRemove`);function If(e){return e.filter(e=>e.tagName!==`A`)}xf(If,`removeLinks`);var Lf=Object.defineProperty,Rf=(e,t)=>Lf(e,`name`,{value:t,configurable:!0}),zf=0,Bf=null;function $(e){return Vf(),e.children}Rf($,`FocusGuards`);function Vf(){_.useEffect(()=>{Bf||={start:Hf(),end:Hf()};let{start:e,end:t}=Bf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),zf++,()=>{zf===1&&(Bf?.start.remove(),Bf?.end.remove(),Bf=null),zf=Math.max(0,zf-1)}},[])}Rf(Vf,`useFocusGuards`);function Hf(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Rf(Hf,`createFocusGuard`);var Uf=function(){return Uf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Uf.apply(this,arguments)};function Wf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Gf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Kf=`right-scroll-bar-position`,qf=`width-before-scroll-bar`,Jf=`with-scroll-bars-hidden`,Yf=`--removed-body-scroll-bar-size`;function Xf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zf(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Qf=typeof window<`u`?_.useLayoutEffect:_.useEffect,$f=new WeakMap;function ep(e,t){var n=Zf(t||null,function(t){return e.forEach(function(e){return Xf(e,t)})});return Qf(function(){var t=$f.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xf(e,null)}),i.forEach(function(e){r.has(e)||Xf(e,a)})}$f.set(n,e)},[e]),n}function tp(e){return e}function np(e,t){t===void 0&&(t=tp);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function rp(e){e===void 0&&(e={});var t=np(null);return t.options=Uf({async:!0,ssr:!1},e),t}var ip=function(e){var t=e.sideCar,n=Wf(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Uf({},n))};ip.isSideCarExport=!0;function ap(e,t){return e.useMedium(t),ip}var op=rp(),sp=function(){},cp=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:sp,onWheelCapture:sp,onTouchMoveCapture:sp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=ep([n,t]),w=Uf(Uf({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:op,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Uf(Uf({},w),{ref:C})):_.createElement(y,Uf({},w,{className:c,ref:C}),s))});cp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cp.classNames={fullWidth:qf,zeroRight:Kf};var lp=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function up(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lp();return t&&e.setAttribute(`nonce`,t),e}function dp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fp(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=up())&&(dp(t,n),fp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mp=function(){var e=pp();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hp=function(){var e=mp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gp={left:0,top:0,right:0,gap:0},_p=function(e){return parseInt(e||``,10)||0},vp=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[_p(n),_p(r),_p(i)]},yp=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gp;var t=vp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bp=hp(),xp=`data-scroll-locked`,Sp=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
17
17
|
.${Jf} {
|
|
18
18
|
overflow: hidden ${r};
|
|
19
19
|
padding-right: ${s}px ${r};
|